ACLs on HPUX

Jeremy Allison jra at samba.org
Wed Dec 5 12:17:01 GMT 2001


On Wed, Dec 05, 2001 at 12:18:19PM -0800, P Ranjit Kumar wrote:
> Hi
> 
> I have researched the ACLs on HPUX quite a bit. I also found out that HPUX
> doesn't have facl() system call.
> 
> So for implementing ACLs support on Samba 2.2.2 we need to some how get a
> file name from an fd. I think there is no way you can get a file name from a
> file descriptor (am I wrong here??). One ugly way would be to maintain a
> mapping between the file descriptor and filenames when samba opens the file.
> Another ugly way is to modify 2.2.2 code so it doesn't call
> sys_acl_set/get_fd.
> 
> I chose the second way to implement ACL support in Samba 2.2.2. This feature
> is available in HP CIFS A.01.08 to be released in March 2002.
> 
> Knowing that the Samba team won't accept these changes I didn't submit the
> changes.

There is no UNIX way to map from fd to pathname. But there is a Samba way
to map from fd to name, which can be hidden under the lib/sysacl.c interface.

They way you do it is to search the fsp list for a fsp struct with
a matching fd. This contains the dos name of the file being referenced,
under the share path which is available in the fsp->conn struct.

This then allows you to do the setfacl call on an fd, and under
the covers for HPUX only do the call on the name. It won't be
fast, but it will present the same interface as POSIX complient
systems, thus allowing easy integration.

Then when HPUX gets a resonable fgetacl/fsetacl call we can
move the underlying code to use that.

If you'll send me the code changes you made I'll look at
integrating them into the lib/sysacl.c mechanism in the
way described above, and getting them into Samba 2.2.3.

Jeremy.




More information about the samba-technical mailing list