diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-10-29 09:28:35 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:05:01 -0500 |
commit | 9752471973007289fb7659f0311cd316b401c034 (patch) | |
tree | 653b5a7ed3f9736632d8e0339fa03bf4a205dfc9 /source4/ntvfs/posix/pvfs_open.c | |
parent | b448bd5b5e430684a9f3c78ebe8d13fdedb20810 (diff) | |
download | samba-9752471973007289fb7659f0311cd316b401c034.tar.gz samba-9752471973007289fb7659f0311cd316b401c034.tar.bz2 samba-9752471973007289fb7659f0311cd316b401c034.zip |
r3363: added basic support for SA_RIGHT_FILE_EXECUTE, needed for opening .dll files
(This used to be commit ba1bfd51e1b694cb69afe559f695addaf03b4d81)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_open.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_open.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c index 1575ca82c1..73514f81b7 100644 --- a/source4/ntvfs/posix/pvfs_open.c +++ b/source4/ntvfs/posix/pvfs_open.c @@ -289,16 +289,13 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs, access_mask = GENERIC_RIGHTS_FILE_READ | GENERIC_RIGHTS_FILE_WRITE; } - switch (access_mask & (SA_RIGHT_FILE_READ_DATA | SA_RIGHT_FILE_WRITE_DATA)) { - case SA_RIGHT_FILE_READ_DATA: - flags = O_RDONLY; - break; - case SA_RIGHT_FILE_WRITE_DATA: - flags = O_WRONLY; - break; - case SA_RIGHT_FILE_WRITE_DATA|SA_RIGHT_FILE_READ_DATA: + if ((access_mask & SA_RIGHT_FILE_READ_EXEC) && + (access_mask & SA_RIGHT_FILE_WRITE_DATA)) { flags = O_RDWR; - break; + } else if (access_mask & SA_RIGHT_FILE_WRITE_DATA) { + flags = O_WRONLY; + } else { + flags = O_RDONLY; } f = talloc_p(req, struct pvfs_file); @@ -493,16 +490,13 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs, return NT_STATUS_INVALID_PARAMETER; } - switch (access_mask & (SA_RIGHT_FILE_READ_DATA | SA_RIGHT_FILE_WRITE_DATA)) { - case SA_RIGHT_FILE_READ_DATA: - flags |= O_RDONLY; - break; - case SA_RIGHT_FILE_WRITE_DATA: - flags |= O_WRONLY; - break; - case SA_RIGHT_FILE_WRITE_DATA|SA_RIGHT_FILE_READ_DATA: + if ((access_mask & SA_RIGHT_FILE_READ_EXEC) && + (access_mask & SA_RIGHT_FILE_WRITE_DATA)) { flags |= O_RDWR; - break; + } else if (access_mask & SA_RIGHT_FILE_WRITE_DATA) { + flags |= O_WRONLY; + } else { + flags |= O_RDONLY; } /* handle creating a new file separately */ |