summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-03-12 22:48:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:57:06 -0500
commita1b295ed4823ce8d06f830b8db9a5d965c934b54 (patch)
tree2de735a28634c011930456f6591072a3c1471263 /source4/ntvfs/posix
parent33647bd841c1c74e7dc50e93379e372056ac2df1 (diff)
downloadsamba-a1b295ed4823ce8d06f830b8db9a5d965c934b54.tar.gz
samba-a1b295ed4823ce8d06f830b8db9a5d965c934b54.tar.bz2
samba-a1b295ed4823ce8d06f830b8db9a5d965c934b54.zip
r14256: - rename smb_file -> smb_handle
- move it into the in/out substructs again - allow file.path only on smb_fileinfo/smb_setfileinfo metze (This used to be commit be6d5298a2cdb7e7c61d70471bad445645af5963)
Diffstat (limited to 'source4/ntvfs/posix')
-rw-r--r--source4/ntvfs/posix/pvfs_flush.c4
-rw-r--r--source4/ntvfs/posix/pvfs_ioctl.c2
-rw-r--r--source4/ntvfs/posix/pvfs_lock.c4
-rw-r--r--source4/ntvfs/posix/pvfs_open.c12
-rw-r--r--source4/ntvfs/posix/pvfs_qfileinfo.c4
-rw-r--r--source4/ntvfs/posix/pvfs_read.c2
-rw-r--r--source4/ntvfs/posix/pvfs_seek.c2
-rw-r--r--source4/ntvfs/posix/pvfs_setfileinfo.c19
-rw-r--r--source4/ntvfs/posix/pvfs_write.c2
9 files changed, 26 insertions, 25 deletions
diff --git a/source4/ntvfs/posix/pvfs_flush.c b/source4/ntvfs/posix/pvfs_flush.c
index f0ab02f96b..ad87ed623b 100644
--- a/source4/ntvfs/posix/pvfs_flush.c
+++ b/source4/ntvfs/posix/pvfs_flush.c
@@ -46,8 +46,8 @@ NTSTATUS pvfs_flush(struct ntvfs_module_context *ntvfs,
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
- if (io->flush.file.fnum != 0xFFFF) {
- f = pvfs_find_fd(pvfs, req, io->flush.file.fnum);
+ if (io->flush.in.file.fnum != 0xFFFF) {
+ f = pvfs_find_fd(pvfs, req, io->flush.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
diff --git a/source4/ntvfs/posix/pvfs_ioctl.c b/source4/ntvfs/posix/pvfs_ioctl.c
index 032aec1d8d..829da47a12 100644
--- a/source4/ntvfs/posix/pvfs_ioctl.c
+++ b/source4/ntvfs/posix/pvfs_ioctl.c
@@ -42,7 +42,7 @@ static NTSTATUS pvfs_ntioctl(struct ntvfs_module_context *ntvfs,
struct pvfs_state *pvfs = ntvfs->private_data;
struct pvfs_file *f;
- f = pvfs_find_fd(pvfs, req, io->ntioctl.file.fnum);
+ f = pvfs_find_fd(pvfs, req, io->ntioctl.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
diff --git a/source4/ntvfs/posix/pvfs_lock.c b/source4/ntvfs/posix/pvfs_lock.c
index b9b9832d51..4dbb13cb42 100644
--- a/source4/ntvfs/posix/pvfs_lock.c
+++ b/source4/ntvfs/posix/pvfs_lock.c
@@ -243,7 +243,7 @@ static NTSTATUS pvfs_lock_cancel(struct pvfs_state *pvfs, struct ntvfs_request *
/* check if the lock request matches exactly - you can only cancel with exact matches */
if (p->lck->lockx.in.ulock_cnt == lck->lockx.in.ulock_cnt &&
p->lck->lockx.in.lock_cnt == lck->lockx.in.lock_cnt &&
- p->lck->lockx.file.fnum == lck->lockx.file.fnum &&
+ p->lck->lockx.in.file.fnum == lck->lockx.in.file.fnum &&
p->lck->lockx.in.mode == (lck->lockx.in.mode & ~LOCKING_ANDX_CANCEL_LOCK)) {
int i;
@@ -285,7 +285,7 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
return ntvfs_map_lock(ntvfs, req, lck);
}
- f = pvfs_find_fd(pvfs, req, lck->lockx.file.fnum);
+ f = pvfs_find_fd(pvfs, req, lck->lockx.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
diff --git a/source4/ntvfs/posix/pvfs_open.c b/source4/ntvfs/posix/pvfs_open.c
index fcae5f8d61..d4b2d0b30a 100644
--- a/source4/ntvfs/posix/pvfs_open.c
+++ b/source4/ntvfs/posix/pvfs_open.c
@@ -144,7 +144,7 @@ static NTSTATUS pvfs_open_setup_eas_acl(struct pvfs_state *pvfs,
if (io->ntcreatex.in.sec_desc) {
union smb_setfileinfo set;
- set.set_secdesc.file.fnum = fnum;
+ set.set_secdesc.in.file.fnum = fnum;
set.set_secdesc.in.secinfo_flags = SECINFO_DACL;
set.set_secdesc.in.sd = io->ntcreatex.in.sec_desc;
@@ -390,7 +390,7 @@ static NTSTATUS pvfs_open_directory(struct pvfs_state *pvfs,
talloc_steal(pvfs, f);
io->generic.out.oplock_level = OPLOCK_NONE;
- io->generic.file.fnum = f->fnum;
+ io->generic.out.file.fnum = f->fnum;
io->generic.out.create_action = create_action;
io->generic.out.create_time = name->dos.create_time;
io->generic.out.access_time = name->dos.access_time;
@@ -712,7 +712,7 @@ static NTSTATUS pvfs_create_file(struct pvfs_state *pvfs,
} else {
io->generic.out.oplock_level = OPLOCK_NONE;
}
- io->generic.file.fnum = f->fnum;
+ io->generic.out.file.fnum = f->fnum;
io->generic.out.create_action = NTCREATEX_ACTION_CREATED;
io->generic.out.create_time = name->dos.create_time;
io->generic.out.access_time = name->dos.access_time;
@@ -880,7 +880,7 @@ static NTSTATUS pvfs_open_deny_dos(struct ntvfs_module_context *ntvfs,
name = f->handle->name;
io->generic.out.oplock_level = OPLOCK_NONE;
- io->generic.file.fnum = f->fnum;
+ io->generic.out.file.fnum = f->fnum;
io->generic.out.create_action = NTCREATEX_ACTION_EXISTED;
io->generic.out.create_time = name->dos.create_time;
io->generic.out.access_time = name->dos.access_time;
@@ -1239,7 +1239,7 @@ NTSTATUS pvfs_open(struct ntvfs_module_context *ntvfs,
} else {
io->generic.out.oplock_level = OPLOCK_NONE;
}
- io->generic.file.fnum = f->fnum;
+ io->generic.out.file.fnum = f->fnum;
io->generic.out.create_action = stream_existed?
NTCREATEX_ACTION_EXISTED:NTCREATEX_ACTION_CREATED;
io->generic.out.create_time = name->dos.create_time;
@@ -1278,7 +1278,7 @@ NTSTATUS pvfs_close(struct ntvfs_module_context *ntvfs,
return ntvfs_map_close(ntvfs, req, io);
}
- f = pvfs_find_fd(pvfs, req, io->close.file.fnum);
+ f = pvfs_find_fd(pvfs, req, io->close.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
diff --git a/source4/ntvfs/posix/pvfs_qfileinfo.c b/source4/ntvfs/posix/pvfs_qfileinfo.c
index b01b7bb649..c23a3c8348 100644
--- a/source4/ntvfs/posix/pvfs_qfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_qfileinfo.c
@@ -289,7 +289,7 @@ NTSTATUS pvfs_qpathinfo(struct ntvfs_module_context *ntvfs,
NTSTATUS status;
/* resolve the cifs name to a posix name */
- status = pvfs_resolve_name(pvfs, req, info->generic.file.path, PVFS_RESOLVE_STREAMS, &name);
+ status = pvfs_resolve_name(pvfs, req, info->generic.in.file.path, PVFS_RESOLVE_STREAMS, &name);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
@@ -326,7 +326,7 @@ NTSTATUS pvfs_qfileinfo(struct ntvfs_module_context *ntvfs,
NTSTATUS status;
uint32_t access_needed;
- f = pvfs_find_fd(pvfs, req, info->generic.file.fnum);
+ f = pvfs_find_fd(pvfs, req, info->generic.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
diff --git a/source4/ntvfs/posix/pvfs_read.c b/source4/ntvfs/posix/pvfs_read.c
index a6b7cf6dd0..c88f49d116 100644
--- a/source4/ntvfs/posix/pvfs_read.c
+++ b/source4/ntvfs/posix/pvfs_read.c
@@ -41,7 +41,7 @@ NTSTATUS pvfs_read(struct ntvfs_module_context *ntvfs,
return ntvfs_map_read(ntvfs, req, rd);
}
- f = pvfs_find_fd(pvfs, req, rd->readx.file.fnum);
+ f = pvfs_find_fd(pvfs, req, rd->readx.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
diff --git a/source4/ntvfs/posix/pvfs_seek.c b/source4/ntvfs/posix/pvfs_seek.c
index 1d43f2c855..dbfb4e1c3d 100644
--- a/source4/ntvfs/posix/pvfs_seek.c
+++ b/source4/ntvfs/posix/pvfs_seek.c
@@ -35,7 +35,7 @@ NTSTATUS pvfs_seek(struct ntvfs_module_context *ntvfs,
struct pvfs_file_handle *h;
NTSTATUS status;
- f = pvfs_find_fd(pvfs, req, io->lseek.file.fnum);
+ f = pvfs_find_fd(pvfs, req, io->lseek.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
diff --git a/source4/ntvfs/posix/pvfs_setfileinfo.c b/source4/ntvfs/posix/pvfs_setfileinfo.c
index 5a6643bdd4..45edaa5b94 100644
--- a/source4/ntvfs/posix/pvfs_setfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_setfileinfo.c
@@ -71,14 +71,14 @@ static uint32_t pvfs_setfileinfo_access(union smb_setfileinfo *info)
static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
struct ntvfs_request *req,
struct pvfs_filename *name,
- struct smb_rename_information *r)
+ union smb_setfileinfo *info)
{
NTSTATUS status;
struct pvfs_filename *name2;
char *new_name, *p;
/* renames are only allowed within a directory */
- if (strchr_m(r->new_name, '\\')) {
+ if (strchr_m(info->rename_information.in.new_name, '\\')) {
return NT_STATUS_NOT_SUPPORTED;
}
@@ -93,7 +93,7 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
}
/* w2k3 does not appear to allow relative rename */
- if (r->root_fid != 0) {
+ if (info->rename_information.in.root_fid != 0) {
return NT_STATUS_INVALID_PARAMETER;
}
@@ -108,7 +108,8 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
}
*p = 0;
- new_name = talloc_asprintf(req, "%s\\%s", new_name, r->new_name);
+ new_name = talloc_asprintf(req, "%s\\%s", new_name,
+ info->rename_information.in.new_name);
if (new_name == NULL) {
return NT_STATUS_NO_MEMORY;
}
@@ -128,7 +129,7 @@ static NTSTATUS pvfs_setfileinfo_rename(struct pvfs_state *pvfs,
return NT_STATUS_OK;
}
- if (!r->overwrite) {
+ if (!info->rename_information.in.overwrite) {
return NT_STATUS_OBJECT_NAME_COLLISION;
}
@@ -249,7 +250,7 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
NTSTATUS status;
uint32_t access_needed;
- f = pvfs_find_fd(pvfs, req, info->generic.file.fnum);
+ f = pvfs_find_fd(pvfs, req, info->generic.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}
@@ -358,7 +359,7 @@ NTSTATUS pvfs_setfileinfo(struct ntvfs_module_context *ntvfs,
case RAW_SFILEINFO_RENAME_INFORMATION:
return pvfs_setfileinfo_rename(pvfs, req, h->name,
- &info->rename_information.in);
+ info);
case RAW_SFILEINFO_SEC_DESC:
return pvfs_acl_set(pvfs, req, h->name, h->fd, f->access_mask, info);
@@ -435,7 +436,7 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
uint32_t access_needed;
/* resolve the cifs name to a posix name */
- status = pvfs_resolve_name(pvfs, req, info->generic.file.path,
+ status = pvfs_resolve_name(pvfs, req, info->generic.in.file.path,
PVFS_RESOLVE_STREAMS, &name);
if (!NT_STATUS_IS_OK(status)) {
return status;
@@ -534,7 +535,7 @@ NTSTATUS pvfs_setpathinfo(struct ntvfs_module_context *ntvfs,
case RAW_SFILEINFO_RENAME_INFORMATION:
return pvfs_setfileinfo_rename(pvfs, req, name,
- &info->rename_information.in);
+ info);
case RAW_SFILEINFO_DISPOSITION_INFO:
case RAW_SFILEINFO_DISPOSITION_INFORMATION:
diff --git a/source4/ntvfs/posix/pvfs_write.c b/source4/ntvfs/posix/pvfs_write.c
index c16b66b7cc..6930a0ba41 100644
--- a/source4/ntvfs/posix/pvfs_write.c
+++ b/source4/ntvfs/posix/pvfs_write.c
@@ -40,7 +40,7 @@ NTSTATUS pvfs_write(struct ntvfs_module_context *ntvfs,
return ntvfs_map_write(ntvfs, req, wr);
}
- f = pvfs_find_fd(pvfs, req, wr->writex.file.fnum);
+ f = pvfs_find_fd(pvfs, req, wr->writex.in.file.fnum);
if (!f) {
return NT_STATUS_INVALID_HANDLE;
}