1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

Get ready for EA code... Add Linux interface.

Jeremy.
(This used to be commit 4885314074)
This commit is contained in:
Jeremy Allison 2003-06-05 20:29:55 +00:00
parent 81d2802743
commit 8e047054e8
4 changed files with 144 additions and 2 deletions

View File

@ -551,7 +551,7 @@ AC_CHECK_HEADERS(shadow.h netinet/ip.h netinet/tcp.h netinet/in_systm.h netinet/
AC_CHECK_HEADERS(nss.h nss_common.h ns_api.h sys/security.h security/pam_appl.h security/pam_modules.h)
AC_CHECK_HEADERS(stropts.h poll.h)
AC_CHECK_HEADERS(sys/capability.h syscall.h sys/syscall.h)
AC_CHECK_HEADERS(sys/acl.h sys/xattr.h sys/cdefs.h glob.h)
AC_CHECK_HEADERS(sys/acl.h attr/xattr.h sys/cdefs.h glob.h)
# For experimental utmp support (lastlog on some BSD-like systems)
AC_CHECK_HEADERS(utmp.h utmpx.h lastlog.h)
@ -938,6 +938,13 @@ AC_LIBTESTFUNC(sec, bigcrypt)
AC_LIBTESTFUNC(security, getprpwnam)
AC_LIBTESTFUNC(sec, getprpwnam)
############################################
# Check if we have libattr
AC_SEARCH_LIBS(getxattr, [attr])
AC_CHECK_FUNCS(getxattr, lgetxattr,fgetxattr,listxattr,llistxattr)
AC_CHECK_FUNCS(flistxattr,removexattr,lremovexattr,fremovexattr)
AC_CHECK_FUNCS(setxattr,lsetxattr,fsetxattr)
# Assume non-shared by default and override below
BLDSHARED="false"

View File

@ -437,6 +437,10 @@
#include <com_err.h>
#endif
#if HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#endif
/* Special macros that are no-ops except when run under Valgrind on
* x86. They've moved a little bit from valgrind 1.0.4 to 1.9.4 */
#if HAVE_VALGRIND_MEMCHECK_H

View File

@ -78,7 +78,8 @@
#define SEC_DESC_DACL_DEFAULTED 0x0008
#define SEC_DESC_SACL_PRESENT 0x0010
#define SEC_DESC_SACL_DEFAULTED 0x0020
#define SEC_DESC_SELF_RELATIVE 0x8000
#define SEC_DESC_DACL_TRUSTED 0x0040
#define SEC_DESC_SERVER_SECURITY 0x0080
/*
* New Windows 2000 bits.
*/
@ -89,6 +90,11 @@
#define SE_DESC_DACL_PROTECTED 0x1000
#define SE_DESC_SACL_PROTECTED 0x2000
/* Don't know what this means. */
#define SEC_DESC_RM_CONTROL_VALID 0x4000
#define SEC_DESC_SELF_RELATIVE 0x8000
/* security information */
#define OWNER_SECURITY_INFORMATION 0x00000001
#define GROUP_SECURITY_INFORMATION 0x00000002

View File

@ -1253,3 +1253,128 @@ int sys_dup2(int oldfd, int newfd)
#endif
SAFE_FREE(msgbuf);
}
/**************************************************************************
Wrappers for extented attribute calls. Based on the Linux package with
support for IRIX also. Expand as other systems have them.
****************************************************************************/
ssize_t sys_getxattr (const char *path, const char *name, void *value, size_t size)
{
#if defined(HAVE_GETXATTR)
return getxattr(path, name, value, size);
#else
errno = ENOSYS;
return -1;
#endif
}
ssize_t sys_lgetxattr (const char *path, const char *name, void *value, size_t size)
{
#if defined(HAVE_LGETXATTR)
return lgetxattr(path, name, value, size);
#else
errno = ENOSYS;
return -1;
#endif
}
ssize_t sys_fgetxattr (int filedes, const char *name, void *value, size_t size)
{
#if defined(HAVE_FGETXATTR)
return fgetxattr(filedes, name, value, size);
#else
errno = ENOSYS;
return -1;
#endif
}
ssize_t sys_listxattr (const char *path, char *list, size_t size)
{
#if defined(HAVE_LISTXATTR)
return listxattr(path, list, size);
#else
errno = ENOSYS;
return -1;
#endif
}
ssize_t sys_llistxattr (const char *path, char *list, size_t size)
{
#if defined(HAVE_GETXATTR)
return llistxattr(path, list, size);
#else
errno = ENOSYS;
return -1;
#endif
}
ssize_t sys_flistxattr (int filedes, char *list, size_t size)
{
#if defined(HAVE_FLISTXATTR)
return flistxattr(filedes, list, size);
#else
errno = ENOSYS;
return -1;
#endif
}
int sys_removexattr (const char *path, const char *name)
{
#if defined(HAVE_REMOVEXATTR)
return removexattr(path, name);
#else
errno = ENOSYS;
return -1;
#endif
}
int sys_lremovexattr (const char *path, const char *name)
{
#if defined(HAVE_LREMOVEXATTR)
return lremovexattr(path, name);
#else
errno = ENOSYS;
return -1;
#endif
}
int sys_fremovexattr (int filedes, const char *name)
{
#if defined(HAVE_FREMOVEXATTR)
return fremovexattr(filedes, name);
#else
errno = ENOSYS;
return -1;
#endif
}
int sys_setxattr (const char *path, const char *name, const void *value, size_t size, int flags)
{
#if defined(HAVE_SETXATTR)
return setxattr(path, name, value, size, flags);
#else
errno = ENOSYS;
return -1;
#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);
#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)
return fsetxattr(path, name, value, size, flags);
#else
errno = ENOSYS;
return -1;
#endif
}