summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_open.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-05 17:52:35 +1100
committerAndrew Tridgell <tridge@samba.org>2010-03-05 23:07:31 +1100
commitace6d75ae6f953b76fa9709857af4744020cd6fb (patch)
treef125e6a22e60284437b55eb915ab62ccbe979a7c /source4/ntvfs/posix/pvfs_open.c
parent034bcaf14d1bc651c8b51b489aebcfa392158f2c (diff)
downloadsamba-ace6d75ae6f953b76fa9709857af4744020cd6fb.tar.gz
samba-ace6d75ae6f953b76fa9709857af4744020cd6fb.tar.bz2
samba-ace6d75ae6f953b76fa9709857af4744020cd6fb.zip
s4-pvfs: use pvfs_sys_*() functions to wrap posix calls
This allows for root override, which fixes many problems with mismatches between NT ACL permissions and unix permissions. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/ntvfs/posix/pvfs_open.c')
-rw-r--r--source4/ntvfs/posix/pvfs_open.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index d9d0d2178a..f88e21e738 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -73,7 +73,7 @@ static int pvfs_dir_handle_destructor(struct pvfs_file_handle *h)
DEBUG(0,("Warning: xattr unlink hook failed for '%s' - %s\n",
delete_path, nt_errstr(status)));
}
- if (rmdir(delete_path) != 0) {
+ if (pvfs_sys_rmdir(h->pvfs, delete_path) != 0) {
DEBUG(0,("pvfs_dir_handle_destructor: failed to rmdir '%s' - %s\n",
delete_path, strerror(errno)));
}
@@ -344,7 +344,7 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
uint32_t attrib = io->generic.in.file_attr | FILE_ATTRIBUTE_DIRECTORY;
mode_t mode = pvfs_fileperms(pvfs, attrib);
- if (mkdir(name->full_name, mode) == -1) {
+ if (pvfs_sys_mkdir(pvfs, name->full_name, mode) == -1) {
return pvfs_map_errno(pvfs,errno);
}
@@ -432,7 +432,7 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
return NT_STATUS_OK;
cleanup_delete:
- rmdir(name->full_name);
+ pvfs_sys_rmdir(pvfs, name->full_name);
return status;
}
@@ -514,7 +514,7 @@ static int pvfs_handle_destructor(struct pvfs_file_handle *h)
DEBUG(0,("Warning: xattr unlink hook failed for '%s' - %s\n",
delete_path, nt_errstr(status)));
}
- if (unlink(delete_path) != 0) {
+ if (pvfs_sys_unlink(h->pvfs, delete_path) != 0) {
DEBUG(0,("pvfs_close: failed to delete '%s' - %s\n",
delete_path, strerror(errno)));
} else {
@@ -677,7 +677,7 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
mode = pvfs_fileperms(pvfs, attrib);
/* create the file */
- fd = open(name->full_name, flags | O_CREAT | O_EXCL| O_NONBLOCK, mode);
+ fd = pvfs_sys_open(pvfs, name->full_name, flags | O_CREAT | O_EXCL| O_NONBLOCK, mode);
if (fd == -1) {
return pvfs_map_errno(pvfs, errno);
}
@@ -856,7 +856,7 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
cleanup_delete:
close(fd);
- unlink(name->full_name);
+ pvfs_sys_unlink(pvfs, name->full_name);
return status;
}
@@ -1549,7 +1549,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
}
/* do the actual open */
- fd = open(f->handle->name->full_name, flags | O_NONBLOCK);
+ fd = pvfs_sys_open(pvfs, f->handle->name->full_name, flags | O_NONBLOCK, 0);
if (fd == -1) {
status = pvfs_map_errno(f->pvfs, errno);