From 0b9314db5ace99096d7f8afa7f449f8e734a6b64 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Jan 2008 11:20:58 +0100 Subject: Support XATTR_CREATE and XATTR_REPLACE in vfs_xattr_tdb (This used to be commit 3509ee597f0977aadd4c70cfe8830a6aa95cd71f) --- source3/modules/vfs_xattr_tdb.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source3/modules') 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; inum_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); -- cgit