Hi, I'm sorry for being silent for such a long time. At the end the customer decided that he does not want the fix. So I won't push either.
For the record, to test whether chown and chmod operation should be swapped one can use if (pathconf(ifname, _PC_CHOWN_RESTRICTED) == -1 && errno == 0) Thank you for your help and sorry for wasting your time. Cheers -- Vlad