diff options
author | Tim Prouty <tprouty@samba.org> | 2008-12-30 17:17:24 -0800 |
---|---|---|
committer | Tim Prouty <tprouty@samba.org> | 2009-01-11 22:13:36 -0800 |
commit | 5c48ba6563ff025037b9337d34b9aa13de610fba (patch) | |
tree | e24789f5a1f0ed1fad8fe76b072148c23661be01 /source3 | |
parent | ce5eded7e03d86d5d7f2ee1a9d975fae116d2306 (diff) | |
download | samba-5c48ba6563ff025037b9337d34b9aa13de610fba.tar.gz samba-5c48ba6563ff025037b9337d34b9aa13de610fba.tar.bz2 samba-5c48ba6563ff025037b9337d34b9aa13de610fba.zip |
s3: General cleanup of the open path in the OneFS vfs module
Diffstat (limited to 'source3')
-rw-r--r-- | source3/modules/onefs.h | 4 | ||||
-rw-r--r-- | source3/modules/onefs_acl.c | 6 | ||||
-rw-r--r-- | source3/modules/onefs_open.c | 17 | ||||
-rw-r--r-- | source3/modules/onefs_system.c | 11 | ||||
-rw-r--r-- | source3/modules/vfs_onefs.c | 6 |
5 files changed, 17 insertions, 27 deletions
diff --git a/source3/modules/onefs.h b/source3/modules/onefs.h index 8d0f45abdb..884f141661 100644 --- a/source3/modules/onefs.h +++ b/source3/modules/onefs.h @@ -80,8 +80,8 @@ NTSTATUS onefs_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, /* * Utility functions */ -NTSTATUS onefs_setup_sd(uint32 security_info_sent, SEC_DESC *psd, - struct ifs_security_descriptor *sd); +NTSTATUS onefs_samba_sd_to_sd(uint32 security_info_sent, SEC_DESC *psd, + struct ifs_security_descriptor *sd); /* * System Interfaces diff --git a/source3/modules/onefs_acl.c b/source3/modules/onefs_acl.c index 5351118a87..9258e0cddc 100644 --- a/source3/modules/onefs_acl.c +++ b/source3/modules/onefs_acl.c @@ -696,8 +696,8 @@ onefs_get_nt_acl(vfs_handle_struct *handle, const char* name, * * @return NTSTATUS_OK if successful */ -NTSTATUS onefs_setup_sd(uint32 security_info_sent, SEC_DESC *psd, - struct ifs_security_descriptor *sd) +NTSTATUS onefs_samba_sd_to_sd(uint32 security_info_sent, SEC_DESC *psd, + struct ifs_security_descriptor *sd) { struct ifs_security_acl dacl, sacl, *daclp, *saclp; struct ifs_identity owner, group, *ownerp, *groupp; @@ -789,7 +789,7 @@ onefs_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, DEBUG(5,("Setting SD on file %s.\n", fsp->fsp_name )); - status = onefs_setup_sd(security_info_sent, psd, &sd); + status = onefs_samba_sd_to_sd(security_info_sent, psd, &sd); if (!NT_STATUS_IS_OK(status)) { DEBUG(3, ("SD initialization failure: %s", nt_errstr(status))); diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c index a86d39948d..df0b75df95 100644 --- a/source3/modules/onefs_open.c +++ b/source3/modules/onefs_open.c @@ -575,8 +575,6 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn, * (requiring delete access) then recreates it. */ case FILE_SUPERSEDE: - /* If file exists replace/overwrite. If file doesn't - * exist create. */ /** * @todo: Clear all file attributes? * http://www.osronline.com/article.cfm?article=302 @@ -748,19 +746,8 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn, */ flags2 &= ~(O_CREAT|O_TRUNC); - /** - * XXX: TODO - * Apparently this is necessary because we ship with - * lp_acl_check_permissions = no. It is set to no because our - * ifs_createfile does the access check correctly. This check - * was added in the last merge, and the question is why is it - * necessary? Check out Bug 25547 and Bug 14596. The key is - * to figure out what case this is covering, and do some - * testing to see if it's actually necessary. If it is, maybe - * it should go upstream in open.c. - */ - if (!lp_acl_check_permissions(SNUM(conn)) && - (access_mask & DELETE_ACCESS)) { + /* Deny DELETE_ACCESS explicitly if the share is read only. */ + if (access_mask & DELETE_ACCESS) { return map_nt_error_from_unix(EACCES); } } diff --git a/source3/modules/onefs_system.c b/source3/modules/onefs_system.c index 485e7f56ac..ee257d8f90 100644 --- a/source3/modules/onefs_system.c +++ b/source3/modules/onefs_system.c @@ -91,7 +91,7 @@ static const char *onefs_oplock_str(enum oplock_type onefs_oplock_type) /* * Convert from onefs to samba oplock. */ -static int onefs_to_samba_oplock(enum oplock_type onefs_oplock) +static int onefs_oplock_to_samba_oplock(enum oplock_type onefs_oplock) { switch (onefs_oplock) { case OPLOCK_NONE: @@ -112,7 +112,7 @@ static int onefs_to_samba_oplock(enum oplock_type onefs_oplock) /* * Convert from samba to onefs oplock. */ -static enum oplock_type samba_to_onefs_oplock(int samba_oplock_type) +static enum oplock_type onefs_samba_oplock_to_oplock(int samba_oplock_type) { if (BATCH_OPLOCK_TYPE(samba_oplock_type)) return OPLOCK_BATCH; if (EXCLUSIVE_OPLOCK_TYPE(samba_oplock_type)) return OPLOCK_EXCLUSIVE; @@ -152,7 +152,7 @@ int onefs_sys_create_file(connection_struct *conn, secinfo = (get_sec_info(sd) & IFS_SEC_INFO_KNOWN_MASK); - status = onefs_setup_sd(secinfo, sd, &ifs_sd); + status = onefs_samba_sd_to_sd(secinfo, sd, &ifs_sd); if (!NT_STATUS_IS_OK(status)) { DEBUG(1, ("SD initialization failure: %s", @@ -164,7 +164,7 @@ int onefs_sys_create_file(connection_struct *conn, pifs_sd = &ifs_sd; } - onefs_oplock = samba_to_onefs_oplock(oplock_request); + onefs_oplock = onefs_samba_oplock_to_oplock(oplock_request); /* Temporary until oplock work is added to vfs_onefs */ onefs_oplock = OPLOCK_NONE; @@ -204,7 +204,8 @@ int onefs_sys_create_file(connection_struct *conn, onefs_oplock_str(onefs_granted_oplock))); if (granted_oplock) { - *granted_oplock = onefs_to_samba_oplock(onefs_granted_oplock); + *granted_oplock = + onefs_oplock_to_samba_oplock(onefs_granted_oplock); } out: diff --git a/source3/modules/vfs_onefs.c b/source3/modules/vfs_onefs.c index b902812498..b6faf52c9a 100644 --- a/source3/modules/vfs_onefs.c +++ b/source3/modules/vfs_onefs.c @@ -27,14 +27,16 @@ static int onefs_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode) { - DEBUG(0, ("SMB_VFS_MKDIR should never be called in vfs_onefs")); + /* SMB_VFS_MKDIR should never be called in vfs_onefs */ + SMB_ASSERT(false); return SMB_VFS_NEXT_MKDIR(handle, path, mode); } static int onefs_open(vfs_handle_struct *handle, const char *fname, files_struct *fsp, int flags, mode_t mode) { - DEBUG(0, ("SMB_VFS_OPEN should never be called in vfs_onefs")); + /* SMB_VFS_OPEN should never be called in vfs_onefs */ + SMB_ASSERT(false); return SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode); } |