All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] Generic syscalls -- chmod vs. fchmodat
@ 2011-01-24 19:57 Linas Vepstas
  2011-01-24 21:05 ` Roland McGrath
  2011-01-25 14:29   ` Arnd Bergmann
  0 siblings, 2 replies; 26+ messages in thread
From: Linas Vepstas @ 2011-01-24 19:57 UTC (permalink / raw)
  To: Chris Metcalf, Arnd Bergmann; +Cc: GLIBC Devel, linux-kernel, libc-ports

Chris, Arnd, all,

Found a bug/incompatibility in the generic syscalls chmod implementation;
not sure if this is a kernel bug or a glibc bug, or how to correctly resolve it.

The new "generic chmod" implementation for glibc sends chmod to the
kernel call sys_fchmodat with  AT_FDCWD, instead of using the older
"deprecated" chmod syscall.  These two behave slightly differently:  with
the new implementation, the file "" (i.e. string of length zero) gets
interpreted
as . and so the syscall succeeds, setting perms on .  The old syscall would
return an errno=2 No such file or directory for this filename.

My gut instinct is that this is a kernel bug, but am not so sure; perhaps this
is "working as designed".  I thought of submitting a patch to fs/namei.c to
fix this, but then got lost in the details: there didn't seem to be
any particularly
good place to add this check.  Meanwhile, a glibc test case (posix/tst-chmod.c)
is failing as a result.

Should we put a check for this funky non-filename into the glibc
generic code, or into sys_chmodat? Recommendations?

--linas

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2011-02-11  9:12 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-24 19:57 [BUG] Generic syscalls -- chmod vs. fchmodat Linas Vepstas
2011-01-24 21:05 ` Roland McGrath
2011-01-24 21:32   ` Mike Frysinger
2011-01-25 14:29 ` Arnd Bergmann
2011-01-25 14:29   ` Arnd Bergmann
2011-01-25 17:45   ` Roland McGrath
2011-01-25 17:45     ` Roland McGrath
2011-01-25 18:21     ` Arnd Bergmann
2011-01-25 18:21       ` Arnd Bergmann
2011-01-25 18:34       ` Roland McGrath
2011-01-25 18:34         ` Roland McGrath
2011-01-25 20:04         ` Arnd Bergmann
2011-01-25 20:04           ` Arnd Bergmann
2011-01-25 18:52       ` Mike Frysinger
2011-01-25 18:52         ` Mike Frysinger
2011-01-25 19:56         ` Eric Blake
2011-01-25 19:56           ` Eric Blake
2011-01-25 20:31           ` Eric Blake
2011-01-25 20:31             ` Eric Blake
2011-01-25 21:32             ` Eric Blake
2011-01-25 21:32               ` Eric Blake
2011-01-25 22:10               ` Linas Vepstas
2011-02-10 18:12     ` Andries Brouwer
2011-02-10 18:17       ` Roland McGrath
2011-02-10 18:17         ` Roland McGrath
2011-02-11  9:11       ` Andreas Schwab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.