summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-06-22 17:36:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:30 -0500
commit7743106635b4720385aebba75c13598276ceeedb (patch)
tree50fc25f4e61d637dab80b1abca96f24ecb8ca97f /source4
parent98024a8125a841def4110974a5c94987acab5360 (diff)
downloadsamba-7743106635b4720385aebba75c13598276ceeedb.tar.gz
samba-7743106635b4720385aebba75c13598276ceeedb.tar.bz2
samba-7743106635b4720385aebba75c13598276ceeedb.zip
r16468: implement SMB2_ALL_INFORMATION in the posix backend
metze (This used to be commit 1bce493cbc003db37e9ea94c20019990e1eb785a)
Diffstat (limited to 'source4')
-rw-r--r--source4/ntvfs/posix/pvfs_qfileinfo.c41
1 files changed, 36 insertions, 5 deletions
diff --git a/source4/ntvfs/posix/pvfs_qfileinfo.c b/source4/ntvfs/posix/pvfs_qfileinfo.c
index 2d43c5a582..c805a4a555 100644
--- a/source4/ntvfs/posix/pvfs_qfileinfo.c
+++ b/source4/ntvfs/posix/pvfs_qfileinfo.c
@@ -196,7 +196,7 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
info->standard_info.out.alloc_size = name->dos.alloc_size;
info->standard_info.out.size = name->st.st_size;
info->standard_info.out.nlink = name->dos.nlink;
- info->standard_info.out.delete_pending = 0;
+ info->standard_info.out.delete_pending = 0; /* only for qfileinfo */
info->standard_info.out.directory =
(name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)? 1 : 0;
return NT_STATUS_OK;
@@ -221,7 +221,7 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
info->all_info.out.alloc_size = name->dos.alloc_size;
info->all_info.out.size = name->st.st_size;
info->all_info.out.nlink = name->dos.nlink;
- info->all_info.out.delete_pending = 0;
+ info->all_info.out.delete_pending = 0; /* only set by qfileinfo */
info->all_info.out.directory =
(name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)? 1 : 0;
info->all_info.out.ea_size = name->dos.ea_size;
@@ -251,15 +251,15 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
return NT_STATUS_OK;
case RAW_FILEINFO_ACCESS_INFORMATION:
- info->access_information.out.access_flags = 0;
+ info->access_information.out.access_flags = 0; /* only set by qfileinfo */
return NT_STATUS_OK;
case RAW_FILEINFO_POSITION_INFORMATION:
- info->position_information.out.position = 0;
+ info->position_information.out.position = 0; /* only set by qfileinfo */
return NT_STATUS_OK;
case RAW_FILEINFO_MODE_INFORMATION:
- info->mode_information.out.mode = 0;
+ info->mode_information.out.mode = 0; /* only set by qfileinfo */
return NT_STATUS_OK;
case RAW_FILEINFO_ALIGNMENT_INFORMATION:
@@ -283,6 +283,27 @@ static NTSTATUS pvfs_map_fileinfo(struct pvfs_state *pvfs,
case RAW_FILEINFO_SEC_DESC:
return pvfs_acl_query(pvfs, req, name, fd, info);
+
+ case RAW_FILEINFO_SMB2_ALL_INFORMATION:
+ info->all_info2.out.create_time = name->dos.create_time;
+ info->all_info2.out.access_time = name->dos.access_time;
+ info->all_info2.out.write_time = name->dos.write_time;
+ info->all_info2.out.change_time = name->dos.change_time;
+ info->all_info2.out.attrib = name->dos.attrib;
+ info->all_info2.out.unknown1 = 0;
+ info->all_info2.out.alloc_size = name->dos.alloc_size;
+ info->all_info2.out.size = name->st.st_size;
+ info->all_info2.out.nlink = name->dos.nlink;
+ info->all_info2.out.delete_pending = 0; /* only set by qfileinfo */
+ info->all_info2.out.directory =
+ (name->dos.attrib & FILE_ATTRIBUTE_DIRECTORY)? 1 : 0;
+ info->all_info2.out.file_id = name->dos.file_id;
+ info->all_info2.out.ea_size = name->dos.ea_size;
+ info->all_info2.out.access_mask = 0; /* only set by qfileinfo */
+ info->all_info2.out.position = 0; /* only set by qfileinfo */
+ info->all_info2.out.mode = 0; /* only set by qfileinfo */
+ info->all_info2.out.fname.s = name->original_name;
+ return NT_STATUS_OK;
}
return NT_STATUS_INVALID_LEVEL;
@@ -386,6 +407,16 @@ NTSTATUS pvfs_qfileinfo(struct ntvfs_module_context *ntvfs,
info->mode_information.out.mode = h->mode;
break;
+ case RAW_FILEINFO_SMB2_ALL_INFORMATION:
+ if (pvfs_delete_on_close_set(pvfs, h, NULL, NULL)) {
+ info->all_info.out.delete_pending = 1;
+ info->all_info.out.nlink--;
+ }
+ info->all_info2.out.position = h->position;
+ info->all_info2.out.access_mask = f->access_mask;
+ info->all_info2.out.mode = h->mode;
+ break;
+
default:
break;
}