summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-01-20 11:20:58 +0100
committerVolker Lendecke <vl@samba.org>2008-01-20 11:20:58 +0100
commit0b9314db5ace99096d7f8afa7f449f8e734a6b64 (patch)
treef5ecf285cc2b086b52ebfc6c6b67db44cc20bb14 /source3
parente1d01878f5e7c4a0f7d90ae0463bd6c11774d910 (diff)
downloadsamba-0b9314db5ace99096d7f8afa7f449f8e734a6b64.tar.gz
samba-0b9314db5ace99096d7f8afa7f449f8e734a6b64.tar.bz2
samba-0b9314db5ace99096d7f8afa7f449f8e734a6b64.zip
Support XATTR_CREATE and XATTR_REPLACE in vfs_xattr_tdb
(This used to be commit 3509ee597f0977aadd4c70cfe8830a6aa95cd71f)
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_xattr_tdb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source3/modules/vfs_xattr_tdb.c b/source3/modules/vfs_xattr_tdb.c
index 0acca51c5d..7416fa785a 100644
--- a/source3/modules/vfs_xattr_tdb.c
+++ b/source3/modules/vfs_xattr_tdb.c
@@ -269,6 +269,11 @@ static int xattr_tdb_setattr(struct db_context *db_ctx,
for (i=0; i<attribs->num_xattrs; i++) {
if (strcmp(attribs->xattrs[i].name, name) == 0) {
+ if (flags & XATTR_CREATE) {
+ TALLOC_FREE(rec);
+ errno = EEXIST;
+ return -1;
+ }
break;
}
}
@@ -276,6 +281,12 @@ static int xattr_tdb_setattr(struct db_context *db_ctx,
if (i == attribs->num_xattrs) {
struct tdb_xattr *tmp;
+ if (flags & XATTR_REPLACE) {
+ TALLOC_FREE(rec);
+ errno = ENOATTR;
+ return -1;
+ }
+
tmp = TALLOC_REALLOC_ARRAY(
attribs, attribs->xattrs, struct tdb_xattr,
attribs->num_xattrs + 1);