[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug in mkdir(2)?



Steve McIntyre <stevem@chiark.greenend.org.uk> writes:

   I find this difficult to believe, but I can't find any documentation to
   say one way or the other. mkdir(2) takes a mode but ignores the
   higher-order bits (e.g. the sticky bit). The following (simple) source
   demonstrates this: 

This is normal, I think.  do_mkdir() in fs/namei.c in the kernel
contains the following fragment
        mode &= 0777 & ~current->fs->umask;
which sets all the mode bits to 0 except the low-order ones.  Thus, it
seems to me that this is expected behavior.


Reply to: