summaryrefslogtreecommitdiff
path: root/source4/ntvfs/posix/pvfs_xattr.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-24 06:09:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:06 -0500
commitf2a605eeab5752e4884987496f2661368f85b271 (patch)
tree7ca13a761e79c14f2b9689f76aee989958f76b1a /source4/ntvfs/posix/pvfs_xattr.c
parent624f5f1b5c05c6205c6eb0c1ff21477e9e9a857c (diff)
downloadsamba-f2a605eeab5752e4884987496f2661368f85b271.tar.gz
samba-f2a605eeab5752e4884987496f2661368f85b271.tar.bz2
samba-f2a605eeab5752e4884987496f2661368f85b271.zip
r3939: - added "posix:fakeoplocks" option for testing with oplocks forced on
- added support for sticky write times after a setfileinfo, by using a write_time field in the DosAttrib xattr structure. (This used to be commit 4a52fae82d8305e999f94f1947daa21dab54cdfd)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_xattr.c')
-rw-r--r--source4/ntvfs/posix/pvfs_xattr.c43
1 files changed, 34 insertions, 9 deletions
diff --git a/source4/ntvfs/posix/pvfs_xattr.c b/source4/ntvfs/posix/pvfs_xattr.c
index fda15a2e92..47549499e6 100644
--- a/source4/ntvfs/posix/pvfs_xattr.c
+++ b/source4/ntvfs/posix/pvfs_xattr.c
@@ -183,6 +183,7 @@ NTSTATUS pvfs_dosattrib_load(struct pvfs_state *pvfs, struct pvfs_filename *name
struct xattr_DosAttrib attrib;
TALLOC_CTX *mem_ctx = talloc(name, 0);
struct xattr_DosInfo1 *info1;
+ struct xattr_DosInfo2 *info2;
if (name->stream_name != NULL) {
name->stream_exists = False;
@@ -233,6 +234,27 @@ NTSTATUS pvfs_dosattrib_load(struct pvfs_state *pvfs, struct pvfs_filename *name
if (info1->change_time != 0) {
name->dos.change_time = info1->change_time;
}
+ name->dos.flags = 0;
+ break;
+
+ case 2:
+ info2 = &attrib.info.info2;
+ name->dos.attrib = pvfs_attrib_normalise(info2->attrib);
+ name->dos.ea_size = info2->ea_size;
+ if (name->st.st_size == info2->size) {
+ name->dos.alloc_size =
+ pvfs_round_alloc_size(pvfs, info2->alloc_size);
+ }
+ if (info2->create_time != 0) {
+ name->dos.create_time = info2->create_time;
+ }
+ if (info2->change_time != 0) {
+ name->dos.change_time = info2->change_time;
+ }
+ name->dos.flags = info2->flags;
+ if (name->dos.flags & XATTR_ATTRIB_FLAG_STICKY_WRITE_TIME) {
+ name->dos.write_time = info2->write_time;
+ }
break;
default:
@@ -255,23 +277,26 @@ NTSTATUS pvfs_dosattrib_load(struct pvfs_state *pvfs, struct pvfs_filename *name
NTSTATUS pvfs_dosattrib_save(struct pvfs_state *pvfs, struct pvfs_filename *name, int fd)
{
struct xattr_DosAttrib attrib;
- struct xattr_DosInfo1 *info1;
+ struct xattr_DosInfo2 *info2;
if (!(pvfs->flags & PVFS_FLAG_XATTR_ENABLE)) {
return NT_STATUS_OK;
}
- attrib.version = 1;
- info1 = &attrib.info.info1;
+ attrib.version = 2;
+ info2 = &attrib.info.info2;
name->dos.attrib = pvfs_attrib_normalise(name->dos.attrib);
- info1->attrib = name->dos.attrib;
- info1->ea_size = name->dos.ea_size;
- info1->size = name->st.st_size;
- info1->alloc_size = name->dos.alloc_size;
- info1->create_time = name->dos.create_time;
- info1->change_time = name->dos.change_time;
+ info2->attrib = name->dos.attrib;
+ info2->ea_size = name->dos.ea_size;
+ info2->size = name->st.st_size;
+ info2->alloc_size = name->dos.alloc_size;
+ info2->create_time = name->dos.create_time;
+ info2->change_time = name->dos.change_time;
+ info2->write_time = name->dos.write_time;
+ info2->flags = name->dos.flags;
+ info2->name = "";
return pvfs_xattr_ndr_save(pvfs, name->full_name, fd,
XATTR_DOSATTRIB_NAME, &attrib,