diff options
author | Jeremy Allison <jra@samba.org> | 2000-10-05 19:04:41 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2000-10-05 19:04:41 +0000 |
commit | 94c63f6ca473306a3e5607d76aa05a63a9da765c (patch) | |
tree | c1ea2d43ab22f602909454a72fd94452fb26c004 /source3/smbd/unix_acls.c | |
parent | bbd7f7bf0fd4f6cda41989c3371d7bf18f49a592 (diff) | |
download | samba-94c63f6ca473306a3e5607d76aa05a63a9da765c.tar.gz samba-94c63f6ca473306a3e5607d76aa05a63a9da765c.tar.xz samba-94c63f6ca473306a3e5607d76aa05a63a9da765c.zip |
Vector get_nt_acl/set_nt_acl via vfs. POSIX ACL support should be added
above this layer.
Jeremy.
(This used to be commit b90af886a951b7b049ed7a42e6d99c332e43897b)
Diffstat (limited to 'source3/smbd/unix_acls.c')
-rw-r--r-- | source3/smbd/unix_acls.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/source3/smbd/unix_acls.c b/source3/smbd/unix_acls.c index 48f6163596..a564ec9ee5 100644 --- a/source3/smbd/unix_acls.c +++ b/source3/smbd/unix_acls.c @@ -59,6 +59,7 @@ static SEC_ACCESS map_unix_perms( int *pacl_type, mode_t perm, int r_mask, int w return sa; } +#if 0 /**************************************************************************** Validate a SID. ****************************************************************************/ @@ -88,6 +89,7 @@ static BOOL validate_unix_sid( DOM_SID *psid, uint32 *prid, DOM_SID *sd_sid) return True; } +#endif /**************************************************************************** Map NT perms to UNIX. @@ -350,6 +352,15 @@ size_t get_nt_acl(files_struct *fsp, SEC_DESC **ppdesc) sid_copy( &group_sid, &global_sid_World); } else { + /* + * If there is a VFS redirect, use it. + */ + + if ((fsp->is_directory || fsp->fd == -1) && fsp->conn->vfs_ops.get_nt_acl) + return fsp->conn->vfs_ops.get_nt_acl(dos_to_unix(fsp->fsp_name, False), ppdesc); + else if (fsp->conn->vfs_ops.fget_nt_acl) + return fsp->conn->vfs_ops.fget_nt_acl(fsp->fd, ppdesc); + if(fsp->is_directory || fsp->fd == -1) { if(vfs_stat(fsp->conn,fsp->fsp_name, &sbuf) != 0) { return 0; @@ -452,22 +463,23 @@ BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd) BOOL got_dacl = False; /* + * If there is a VFS redirect, use it. + */ + + if ((fsp->is_directory || fsp->fd == -1) && fsp->conn->vfs_ops.set_nt_acl) + return fsp->conn->vfs_ops.set_nt_acl(dos_to_unix(fsp->fsp_name, False), security_info_sent, psd); + else if (fsp->conn->vfs_ops.fset_nt_acl) + return fsp->conn->vfs_ops.fset_nt_acl(fsp->fd, security_info_sent, psd); + + /* * Get the current state of the file. */ - if(fsp->is_directory) { + if(fsp->is_directory || fsp->fd == -1) { if(vfs_stat(fsp->conn,fsp->fsp_name, &sbuf) != 0) return False; } else { - - int ret; - - if(fsp->fd == -1) - ret = vfs_stat(fsp->conn,fsp->fsp_name,&sbuf); - else - ret = conn->vfs_ops.fstat(fsp->fd,&sbuf); - - if(ret != 0) + if(conn->vfs_ops.fstat(fsp->fd,&sbuf) != 0) return False; } |