Subject: Re: [netatalk-admins] netatalk's handling of file permissions is broken...
From: Edan Idzerda (edan@mtu.edu)
Date: Fri Nov 07 1997 - 14:04:03 EST
a sun wrote:
> umm, the netatalk code isn't that hard to follow. i believe i told you
> that the mode changes were coming from the chmod()'s in unix.c. the
> easiest way of fixing the problem would involve stat()'ing directories
> and then using the special bits of the umode during the chmod.
I haven't tried to follow all of the code, but I agree that figure
out where it might be changing the permissions is not terribly tricky.
Since the Mac has no way of changing the setuid, setgid, or sticky
bits of a directory, doesn't it make sense for afpd to never
change them? And chmod (dir, mode) will do that, unfortunately.
I haven't patched netatalk yet, but I think that changing the
mode used at line 520 of unix.c will do the trick.
Just stat() the directory about to be changed, and use
the mode bits that the Mac has no notion of. I think the
below masking should do the trick:
mode = (stbuf.st_mode & 007000) | mode;
My current opinion is that afpd *is* actually broken in
this sense. I will patch my copy of 1.4b2 soon and if
successful I will post my results to the list--but if
someone else beats me I'll try not to clutter :)
- edan
-- Edan Idzerda <edan@mtu.edu> System Administrator -- Michigan Technological University, Houghton MI USA
This archive was generated by hypermail 2b28 : Sat Dec 18 1999 - 16:28:01 EST