Re: Setuid bits get dropped on fs-mounted partitions (2.2.2-ac7) !?!?

Trond Myklebust (trond.myklebust@fys.uio.no)
02 Mar 1999 18:47:37 +0100


alan@lxorguk.ukuu.org.uk (Alan Cox) writes:

> > The setuid file is testit.dpkg-new which gets chmod'ed to 6775, but
> > for some reason the setattr gets queued before the write and the
> > kernel must be removing the setuid bits because of the write...
>
> I take it the program actually executes the chmod after it finishes writing ?

If you have asynchronous writes, and call 'fchmod' on the open file,
this problem may indeed occur. Worse: if you call fchown you may end
up making the file unwritable.

Does anybody know what POSIX et al. say about this sort of question?
Are you required to issue an 'fsync' or 'fdatasync' before calling
fchmod/fchown on an open file?

i.e. Is this a bug in dpkg or in the NFS client?

Cheers,
Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/