Commit 71afae90 authored by Erich E. Hoover's avatar Erich E. Hoover Committed by Alexandre Julliard

ntdll: Add support for FreeBSD style extended attributes.

parent 282120a9
......@@ -8195,6 +8195,12 @@ then :
printf "%s\n" "#define HAVE_SYS_EVENT_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "sys/extattr.h" "ac_cv_header_sys_extattr_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_extattr_h" = xyes
then :
printf "%s\n" "#define HAVE_SYS_EXTATTR_H 1" >>confdefs.h
fi
ac_fn_c_check_header_compile "$LINENO" "sys/filio.h" "ac_cv_header_sys_filio_h" "$ac_includes_default"
if test "x$ac_cv_header_sys_filio_h" = xyes
then :
......
......@@ -467,6 +467,7 @@ AC_CHECK_HEADERS(\
sys/cdio.h \
sys/epoll.h \
sys/event.h \
sys/extattr.h \
sys/filio.h \
sys/ipc.h \
sys/link.h \
......
......@@ -102,6 +102,10 @@
#ifdef HAVE_SYS_XATTR_H
#include <sys/xattr.h>
#endif
#ifdef HAVE_SYS_EXTATTR_H
#undef XATTR_ADDITIONAL_OPTIONS
#include <sys/extattr.h>
#endif
#include <time.h>
#include <unistd.h>
......@@ -171,7 +175,14 @@ typedef struct
#define MAX_IGNORED_FILES 4
#define SAMBA_XATTR_DOS_ATTRIB "user.DOSATTRIB"
#ifndef XATTR_USER_PREFIX
# define XATTR_USER_PREFIX "user."
#endif
#ifndef XATTR_USER_PREFIX_LEN
# define XATTR_USER_PREFIX_LEN (sizeof(XATTR_USER_PREFIX) - 1)
#endif
#define SAMBA_XATTR_DOS_ATTRIB XATTR_USER_PREFIX "DOSATTRIB"
#define XATTR_ATTRIBS_MASK (FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_SYSTEM)
struct file_identity
......@@ -371,6 +382,8 @@ static int xattr_fremove( int filedes, const char *name )
# else
return fremovexattr( filedes, name );
# endif
#elif defined(HAVE_SYS_EXTATTR_H)
return extattr_delete_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN] );
#else
errno = ENOSYS;
return -1;
......@@ -386,6 +399,9 @@ static int xattr_fset( int filedes, const char *name, const void *value, size_t
# else
return fsetxattr( filedes, name, value, size, 0 );
# endif
#elif defined(HAVE_SYS_EXTATTR_H)
return extattr_set_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
value, size );
#else
errno = ENOSYS;
return -1;
......@@ -401,6 +417,9 @@ static int xattr_get( const char *path, const char *name, void *value, size_t si
# else
return getxattr( path, name, value, size );
# endif
#elif defined(HAVE_SYS_EXTATTR_H)
return extattr_get_file( path, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
value, size );
#else
errno = ENOSYS;
return -1;
......@@ -416,6 +435,9 @@ static int xattr_fget( int filedes, const char *name, void *value, size_t size )
# else
return fgetxattr( filedes, name, value, size );
# endif
#elif defined(HAVE_SYS_EXTATTR_H)
return extattr_get_fd( filedes, EXTATTR_NAMESPACE_USER, &name[XATTR_USER_PREFIX_LEN],
value, size );
#else
errno = ENOSYS;
return -1;
......
......@@ -568,6 +568,9 @@
/* Define to 1 if you have the <sys/event.h> header file. */
#undef HAVE_SYS_EVENT_H
/* Define to 1 if you have the <sys/extattr.h> header file. */
#undef HAVE_SYS_EXTATTR_H
/* Define to 1 if you have the <sys/filio.h> header file. */
#undef HAVE_SYS_FILIO_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment