summaryrefslogtreecommitdiff
path: root/source/modules
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
commit3509ee597f0977aadd4c70cfe8830a6aa95cd71f (patch)
tree18f65afb1e069ef3aff92f72452ae32f9bdbdd17 /source/modules
parentdac468216e7e103b6897f33ec3608412f77265cf (diff)
downloadsamba-3509ee597f0977aadd4c70cfe8830a6aa95cd71f.tar.gz
Support XATTR_CREATE and XATTR_REPLACE in vfs_xattr_tdb
Diffstat (limited to 'source/modules')
-rw-r--r--source/modules/vfs_xattr_tdb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/modules/vfs_xattr_tdb.c b/source/modules/vfs_xattr_tdb.c
index 0acca51c5d9..7416fa785a9 100644
--- a/source/modules/vfs_xattr_tdb.c
+++ b/source/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);