From ca62ddd8d901cce923d1cda958793054f80b1f57 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 5 Jun 2006 21:48:29 +0000 Subject: r16051: Move the XATTR compatability code into a new file, so I can use it for the getntacl utility. Andrew Bartlett (This used to be commit b1e0d4747b412929e1d4e24d6d9e504df3ddc824) --- source4/lib/util/wrap_xattr.c | 121 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 source4/lib/util/wrap_xattr.c (limited to 'source4/lib/util/wrap_xattr.c') diff --git a/source4/lib/util/wrap_xattr.c b/source4/lib/util/wrap_xattr.c new file mode 100644 index 0000000000..21c8f90635 --- /dev/null +++ b/source4/lib/util/wrap_xattr.c @@ -0,0 +1,121 @@ +/* + Unix SMB/CIFS implementation. + + POSIX NTVFS backend - xattr support using filesystem xattrs + + Copyright (C) Andrew Tridgell 2004 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" +#include "system/filesys.h" +#include "wrap_xattr.h" + +#if defined(HAVE_XATTR_SUPPORT) && defined(XATTR_ADDITIONAL_OPTIONS) +static ssize_t _wrap_darwin_fgetxattr(int fd, const char *name, void *value, size_t size) +{ + return fgetxattr(fd, name, value, size, 0, 0); +} +static ssize_t _wrap_darwin_getxattr(const char *path, const char *name, void *value, size_t size) +{ + return getxattr(path, name, value, size, 0, 0); +} +static int _wrap_darwin_fsetxattr(int fd, const char *name, void *value, size_t size, int flags) +{ + return fsetxattr(fd, name, value, size, 0, flags); +} +static int _wrap_darwin_setxattr(const char *path, const char *name, void *value, size_t size, int flags) +{ + return setxattr(path, name, value, size, 0, flags); +} +static int _wrap_darwin_fremovexattr(int fd, const char *name) +{ + return fremovexattr(fd, name, 0); +} +static int _wrap_darwin_removexattr(const char *path, const char *name) +{ + return removexattr(path, name, 0); +} +#define fgetxattr _wrap_darwin_fgetxattr +#define getxattr _wrap_darwin_getxattr +#define fsetxattr _wrap_darwin_fsetxattr +#define setxattr _wrap_darwin_setxattr +#define fremovexattr _wrap_darwin_fremovexattr +#define removexattr _wrap_darwin_removexattr +#elif !defined(HAVE_XATTR_SUPPORT) +static ssize_t _none_fgetxattr(int fd, const char *name, void *value, size_t size) +{ + errno = ENOSYS; + return -1; +} +static ssize_t _none_getxattr(const char *path, const char *name, void *value, size_t size) +{ + errno = ENOSYS; + return -1; +} +static int _none_fsetxattr(int fd, const char *name, void *value, size_t size, int flags) +{ + errno = ENOSYS; + return -1; +} +static int _none_setxattr(const char *path, const char *name, void *value, size_t size, int flags) +{ + errno = ENOSYS; + return -1; +} +static int _none_fremovexattr(int fd, const char *name) +{ + errno = ENOSYS; + return -1; +} +static int _none_removexattr(const char *path, const char *name) +{ + errno = ENOSYS; + return -1; +} +#define fgetxattr _none_fgetxattr +#define getxattr _none_getxattr +#define fsetxattr _none_fsetxattr +#define setxattr _none_setxattr +#define fremovexattr _none_fremovexattr +#define removexattr _none_removexattr +#endif + +_PUBLIC_ ssize_t wrap_fgetxattr(int fd, const char *name, void *value, size_t size) +{ + return fgetxattr(fd, name, value, size); +} +_PUBLIC_ ssize_t wrap_getxattr(const char *path, const char *name, void *value, size_t size) +{ + return getxattr(path, name, value, size); +} +_PUBLIC_ int wrap_fsetxattr(int fd, const char *name, void *value, size_t size, int flags) +{ + return fsetxattr(fd, name, value, size, flags); +} +_PUBLIC_ int wrap_setxattr(const char *path, const char *name, void *value, size_t size, int flags) +{ + return setxattr(path, name, value, size, flags); +} +_PUBLIC_ int wrap_fremovexattr(int fd, const char *name) +{ + return fremovexattr(fd, name); +} +_PUBLIC_ int wrap_removexattr(const char *path, const char *name) +{ + return removexattr(path, name); +} + -- cgit From a64980dd4008ba5e13d81374ee3f3073e875c33f Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 13 Jun 2006 10:47:08 +0000 Subject: r16186: Use full include path to make sure it's being picked up by the dependency generator. (This used to be commit fbbc3b11683d594d31e6487873946b68c2c46923) --- source4/lib/util/wrap_xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/lib/util/wrap_xattr.c') diff --git a/source4/lib/util/wrap_xattr.c b/source4/lib/util/wrap_xattr.c index 21c8f90635..4e4470839e 100644 --- a/source4/lib/util/wrap_xattr.c +++ b/source4/lib/util/wrap_xattr.c @@ -22,7 +22,7 @@ #include "includes.h" #include "system/filesys.h" -#include "wrap_xattr.h" +#include "lib/util/wrap_xattr.h" #if defined(HAVE_XATTR_SUPPORT) && defined(XATTR_ADDITIONAL_OPTIONS) static ssize_t _wrap_darwin_fgetxattr(int fd, const char *name, void *value, size_t size) -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/lib/util/wrap_xattr.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/lib/util/wrap_xattr.c') diff --git a/source4/lib/util/wrap_xattr.c b/source4/lib/util/wrap_xattr.c index 4e4470839e..955f39a7eb 100644 --- a/source4/lib/util/wrap_xattr.c +++ b/source4/lib/util/wrap_xattr.c @@ -7,7 +7,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -16,8 +16,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit