Re: Weird chmod behaviour

看板DFBSD_bugs作者時間21年前 (2004/11/22 05:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串12/13 (看更多)
Are you using HEAD or Stable ? Post your 'dmesg' and 'df' output. :Heh, the snippets of code I posted were taken from the MAKEDEV script. :I wasn't clear enough. The point I was trying to make was that the :chmod command following each mknod *did* work, but it must have been :called with the same (0600) argument each time, which is clearly not :what the MAKEDEV script calls for. : :I've been trying to dream up reasons why the arguments passed to :each newly forked shell might not be updated properly... I'm still thinking namecache, but a /bin/sh bug would also explain it (not very well though). MAKEDEV unconditionally rm -f's each device and runs mknod, then usually chmod's. MAKEDEV's umask is 077 so the initial mknod will create the node with perms 600. The mknod() shell procedure in MAKEDEV counts the arguments and adds root:wheel if it doesn't think a user:group was specified, which could account for why /dev/fd0 didn't get root:operator, but I can't imagine why /bin/sh would fail to count the arguments properly only 'sometimes'. If /bin/sh fails to run the chmod then the perms would end up 600. But I suspect that /bin/sh is running the programs just fine and the problem is that the calls to chown() and chmod() are not operating properly. In particular the mknod program itself directly calls chown() so a ktrace would tell us where the problem is. We desparately need to have ktrace output for a failed case to figure out where the problem is. Another thing ... when it fails on you run an ncptrace of /dev. -Matt Matthew Dillon <dillon@backplane.com>
文章代碼(AID): #11eGbL00 (DFBSD_bugs)
討論串 (同標題文章)
文章代碼(AID): #11eGbL00 (DFBSD_bugs)