summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-04-04 08:34:25 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-04-05 13:39:00 +1000
commitc70ac29c5441073752da7384b7f3bf54c9986aa0 (patch)
treead33c1dc4ac5782f682ce66029d73cc5551a4a82 /source3/lib
parentc5b17c555576a2b8e24e0df613dde922fe60520d (diff)
downloadsamba-c70ac29c5441073752da7384b7f3bf54c9986aa0.tar.gz
samba-c70ac29c5441073752da7384b7f3bf54c9986aa0.tar.bz2
samba-c70ac29c5441073752da7384b7f3bf54c9986aa0.zip
s3-vfs: Remove unused lsetxattr call from VFS modules, system.c and configure
If this is ever needed again, it would be more appropriate as an options argument to listxattr. Andrew Bartlett
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/system.c64
1 files changed, 0 insertions, 64 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index ed5cf0cec8..abebb43915 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -1821,70 +1821,6 @@ int sys_setxattr (const char *path, const char *name, const void *value, size_t
#endif
}
-int sys_lsetxattr (const char *path, const char *name, const void *value, size_t size, int flags)
-{
-#if defined(HAVE_LSETXATTR)
- return lsetxattr(path, name, value, size, flags);
-#elif defined(HAVE_SETXATTR) && defined(XATTR_ADD_OPT)
- int options = XATTR_NOFOLLOW;
- return setxattr(path, name, value, size, 0, options);
-#elif defined(LSETEA)
- return lsetea(path, name, value, size, flags);
-#elif defined(HAVE_EXTATTR_SET_LINK)
- char *s;
- int retval = 0;
- int attrnamespace = (strncmp(name, "system", 6) == 0) ?
- EXTATTR_NAMESPACE_SYSTEM : EXTATTR_NAMESPACE_USER;
- const char *attrname = ((s=strchr_m(name, '.')) == NULL) ? name : s + 1;
- if (flags) {
- /* Check attribute existence */
- retval = extattr_get_link(path, attrnamespace, attrname, NULL, 0);
- if (retval < 0) {
- /* REPLACE attribute, that doesn't exist */
- if (flags & XATTR_REPLACE && errno == ENOATTR) {
- errno = ENOATTR;
- return -1;
- }
- /* Ignore other errors */
- }
- else {
- /* CREATE attribute, that already exists */
- if (flags & XATTR_CREATE) {
- errno = EEXIST;
- return -1;
- }
- }
- }
-
- retval = extattr_set_link(path, attrnamespace, attrname, value, size);
- return (retval < 0) ? -1 : 0;
-#elif defined(HAVE_ATTR_SET)
- int myflags = ATTR_DONTFOLLOW;
- char *attrname = strchr(name,'.') + 1;
-
- if (strncmp(name, "system", 6) == 0) myflags |= ATTR_ROOT;
- if (flags & XATTR_CREATE) myflags |= ATTR_CREATE;
- if (flags & XATTR_REPLACE) myflags |= ATTR_REPLACE;
-
- return attr_set(path, attrname, (const char *)value, size, myflags);
-#elif defined(HAVE_ATTROPEN)
- int ret = -1;
- int myflags = O_RDWR | AT_SYMLINK_NOFOLLOW;
- int attrfd;
- if (flags & XATTR_CREATE) myflags |= O_EXCL;
- if (!(flags & XATTR_REPLACE)) myflags |= O_CREAT;
- attrfd = solaris_attropen(path, name, myflags, (mode_t) SOLARIS_ATTRMODE);
- if (attrfd >= 0) {
- ret = solaris_write_xattr(attrfd, value, size);
- close(attrfd);
- }
- return ret;
-#else
- errno = ENOSYS;
- return -1;
-#endif
-}
-
int sys_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags)
{
#if defined(HAVE_FSETXATTR)