summaryrefslogtreecommitdiffstats
path: root/ctdb/lib/replace/system
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2013-05-29 14:44:03 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-05-29 17:47:16 +1000
commit4c1dc871b9ebdb9a83ab7b4714d89e451ea0783a (patch)
tree340462070c256ce4f33bf0ccf344725c16270e17 /ctdb/lib/replace/system
parentfe1fc55c616f175a3ebdd8edb64dca0430c149d7 (diff)
replace: Sync to latest replace from upstream
The latest commits affecting lib/replace remove autoconf build from Samba tree. So using following commit as a sync point. commit 9ddfd7d8784e6f546628f48990b69ee2850be52d Author: Andrew Bartlett <abartlet@samba.org> Date: Wed May 22 17:23:30 2013 +1000 Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit 506b27c944b4031e8a325816bd12abddd442a0bb)
Diffstat (limited to 'ctdb/lib/replace/system')
-rw-r--r--ctdb/lib/replace/system/filesys.h74
-rw-r--r--ctdb/lib/replace/system/gssapi.h (renamed from ctdb/lib/replace/system/printing.h)41
-rw-r--r--ctdb/lib/replace/system/kerberos.h18
-rw-r--r--ctdb/lib/replace/system/passwd.h9
-rw-r--r--ctdb/lib/replace/system/wait.h4
5 files changed, 102 insertions, 44 deletions
diff --git a/ctdb/lib/replace/system/filesys.h b/ctdb/lib/replace/system/filesys.h
index e2c3c1dd72..c8ac2b4f74 100644
--- a/ctdb/lib/replace/system/filesys.h
+++ b/ctdb/lib/replace/system/filesys.h
@@ -114,6 +114,8 @@
#if HAVE_SYS_ATTRIBUTES_H
#include <sys/attributes.h>
+#elif HAVE_ATTR_ATTRIBUTES_H
+#include <attr/attributes.h>
#endif
/* mutually exclusive (SuSE 8.2) */
@@ -123,11 +125,26 @@
#include <sys/xattr.h>
#endif
+#ifdef HAVE_SYS_EA_H
+#include <sys/ea.h>
+#endif
+
+#ifdef HAVE_SYS_EXTATTR_H
+#include <sys/extattr.h>
+#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
+#ifndef XATTR_CREATE
+#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
+#endif
+
+#ifndef XATTR_REPLACE
+#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+#endif
+
/* Some POSIX definitions for those without */
#ifndef S_IFDIR
@@ -200,4 +217,61 @@
# define uwrap_enabled() 0
#endif /* UID_WRAPPER */
+/*
+ this allows us to use a uniform error handling for our xattr
+ wrappers
+*/
+#ifndef ENOATTR
+#define ENOATTR ENODATA
+#endif
+
+
+#if !defined(HAVE_GETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+ssize_t rep_getxattr (const char *path, const char *name, void *value, size_t size);
+#define getxattr(path, name, value, size) rep_getxattr(path, name, value, size)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_FGETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+ssize_t rep_fgetxattr (int filedes, const char *name, void *value, size_t size);
+#define fgetxattr(filedes, name, value, size) rep_fgetxattr(filedes, name, value, size)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_LISTXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+ssize_t rep_listxattr (const char *path, char *list, size_t size);
+#define listxattr(path, list, size) rep_listxattr(path, list, size)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_FLISTXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+ssize_t rep_flistxattr (int filedes, char *list, size_t size);
+#define flistxattr(filedes, value, size) rep_flistxattr(filedes, value, size)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_REMOVEXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+int rep_removexattr (const char *path, const char *name);
+#define removexattr(path, name) rep_removexattr(path, name)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_FREMOVEXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+int rep_fremovexattr (int filedes, const char *name);
+#define fremovexattr(filedes, name) rep_fremovexattr(filedes, name)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_SETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+int rep_setxattr (const char *path, const char *name, const void *value, size_t size, int flags);
+#define setxattr(path, name, value, size, flags) rep_setxattr(path, name, value, size, flags)
+/* define is in "replace.h" */
+#endif
+
+#if !defined(HAVE_FSETXATTR) || defined(XATTR_ADDITIONAL_OPTIONS)
+int rep_fsetxattr (int filedes, const char *name, const void *value, size_t size, int flags);
+#define fsetxattr(filedes, name, value, size, flags) rep_fsetxattr(filedes, name, value, size, flags)
+/* define is in "replace.h" */
+#endif
+
#endif
diff --git a/ctdb/lib/replace/system/printing.h b/ctdb/lib/replace/system/gssapi.h
index 7eb02d004a..6386c7b21a 100644
--- a/ctdb/lib/replace/system/printing.h
+++ b/ctdb/lib/replace/system/gssapi.h
@@ -1,17 +1,17 @@
-#ifndef _system_printing_h
-#define _system_printing_h
+#ifndef _system_gssapi_h
+#define _system_gssapi_h
-/*
+/*
Unix SMB/CIFS implementation.
- printing system include wrappers
+ GSSAPI system include wrappers
Copyright (C) Andrew Tridgell 2004
-
+
** NOTE! The following LGPL license applies to the replace
** library. This does NOT imply that all of Samba is released
** under the LGPL
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@@ -27,24 +27,27 @@
*/
-#ifdef AIX
-#define DEFAULT_PRINTING PRINT_AIX
-#define PRINTCAP_NAME "/etc/qconfig"
-#endif
+#ifdef HAVE_GSSAPI
-#ifdef HPUX
-#define DEFAULT_PRINTING PRINT_HPUX
+#ifdef HAVE_GSSAPI_GSSAPI_EXT_H
+#include <gssapi/gssapi_ext.h>
+#elif HAVE_GSSAPI_GSSAPI_H
+#include <gssapi/gssapi.h>
+#elif HAVE_GSSAPI_GSSAPI_GENERIC_H
+#include <gssapi/gssapi_generic.h>
+#elif HAVE_GSSAPI_H
+#include <gssapi.h>
#endif
-#ifdef QNX
-#define DEFAULT_PRINTING PRINT_QNX
+#if HAVE_GSSAPI_GSSAPI_KRB5_H
+#include <gssapi/gssapi_krb5.h>
#endif
-#ifndef DEFAULT_PRINTING
-#define DEFAULT_PRINTING PRINT_BSD
-#endif
-#ifndef PRINTCAP_NAME
-#define PRINTCAP_NAME "/etc/printcap"
+#if HAVE_GSSAPI_GSSAPI_SPNEGO_H
+#include <gssapi/gssapi_spnego.h>
+#elif HAVE_GSSAPI_SPNEGO_H
+#include <gssapi_spnego.h>
#endif
#endif
+#endif
diff --git a/ctdb/lib/replace/system/kerberos.h b/ctdb/lib/replace/system/kerberos.h
index 7762d4be46..636ce0f2e0 100644
--- a/ctdb/lib/replace/system/kerberos.h
+++ b/ctdb/lib/replace/system/kerberos.h
@@ -7,11 +7,11 @@
kerberos system include wrappers
Copyright (C) Andrew Tridgell 2004
-
+
** NOTE! The following LGPL license applies to the replace
** library. This does NOT imply that all of Samba is released
** under the LGPL
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@@ -37,19 +37,5 @@
#include <com_err.h>
#endif
-#ifdef HAVE_GSSAPI_GSSAPI_EXT_H
-#include <gssapi/gssapi_ext.h>
-#elif HAVE_GSSAPI_GSSAPI_H
-#include <gssapi/gssapi.h>
-#elif HAVE_GSSAPI_GSSAPI_GENERIC_H
-#include <gssapi/gssapi_generic.h>
-#elif HAVE_GSSAPI_H
-#include <gssapi.h>
-#endif
-
-#if HAVE_GSSAPI_GSSAPI_KRB5_H
-#include <gssapi/gssapi_krb5.h>
-#endif
-
#endif
#endif
diff --git a/ctdb/lib/replace/system/passwd.h b/ctdb/lib/replace/system/passwd.h
index f630012f00..8257e066ac 100644
--- a/ctdb/lib/replace/system/passwd.h
+++ b/ctdb/lib/replace/system/passwd.h
@@ -67,15 +67,6 @@
#include <compat.h>
#endif
-#ifdef REPLACE_GETPASS
-#if defined(REPLACE_GETPASS_BY_GETPASSPHRASE)
-#define getpass(prompt) getpassphrase(prompt)
-#else
-#define getpass(prompt) rep_getpass(prompt)
-char *rep_getpass(const char *prompt);
-#endif
-#endif
-
#ifndef NGROUPS_MAX
#define NGROUPS_MAX 32 /* Guess... */
#endif
diff --git a/ctdb/lib/replace/system/wait.h b/ctdb/lib/replace/system/wait.h
index f0c3bdccab..146c61a094 100644
--- a/ctdb/lib/replace/system/wait.h
+++ b/ctdb/lib/replace/system/wait.h
@@ -40,6 +40,10 @@
#include <setjmp.h>
#endif
+#ifdef HAVE_SYS_UCONTEXT_H
+#include <sys/ucontext.h>
+#endif
+
#if !defined(HAVE_SIG_ATOMIC_T_TYPE)
typedef int sig_atomic_t;
#endif