> Sorry ... didn't think anyone was interested, and it's off topic, but
> here it is in a nutshell:
>
> The client I'm working with is moving from a Novell server to a FreeBSD
> server using Samba. They're very unhappy with Samba's behaviour in only
> 1 respect: on the Novell server, files/directories that were not
> readible by the user did not appear in the directory listing. For legacy
> reasons, they have a single shared directory that contains hundreds of
> directories, most of which are not accessibly to the majority of
> groups/users on the system.
> Samba has no option for this that I can find, and I have not been able
> to produce this effect with manipulation of the filesystem permissions.
> So I dug into the source code and found that the code that produces a
> directory listing is relatively simple. It's simply a loop that iterates
> through all the files(directories) in a directory and presents them to
> the client. So, ignoring these files/directories is simply a matter of a
> test for access() at the beginning of the loop that does a "continue" if
> it fails on read access.
> So you see ... this is probably one of the few situations where access()
> is safe, since a mistake in this case does not provide any access the
> object (that's handled later, in a completely seperate block of code)
>
> If I'm wrong, please feel free to correct me.
This is actually an interesting case.
The canonical answer is that you're wrong, and you should use stat(2) for
this purpose.
However it's fair to assume that with ACLs entering the picture,
access(2) may actually given you a better answer. I would poke the
TrustedBSD people to be certain about this, though.
--
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also. But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view. [Dr. Fritz Todt]
V I C T O R Y N O T V E N G E A N C E
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message