/*
* 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
*
* @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;
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)));
* (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
*/
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);
}
}
/*
* 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:
/*
* 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;
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",
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;
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:
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);
}