aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_wrappers.c
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2014-04-16 13:57:50 -0500
committerPeter Seebach <peter.seebach@windriver.com>2014-04-21 18:12:22 -0500
commitd4c7177bb87aad975852715c6956426b5595bb78 (patch)
tree53c8520e9510f9118a4d855c274cf5a679f25e99 /pseudo_wrappers.c
parentf1d474452e24e185c4f657bba700ac6509cbd0cd (diff)
downloadpseudo-d4c7177bb87aad975852715c6956426b5595bb78.tar.gz
pseudo-d4c7177bb87aad975852715c6956426b5595bb78.tar.bz2
pseudo-d4c7177bb87aad975852715c6956426b5595bb78.zip
Initial draft xattr support
Initial, incomplete, support for extended attributes. Extended attributes are implemented fairly naively, using a second table in the file database using the primary file table's id as a foreign key. The ON DELETE CASCADE behavior requires sqlite 3.6.19 or later with foreign key and trigger support compiled in. To reduce round-trips, the client does not check for existing attributes, but rather, sends three distinct set messages; OP_SET_XATTR, OP_CREATE_XATTR, OP_REPLACE_XATTR. A SET message always succeeds, a CREATE fails if the attribute already exists, and a REPLACE fails if the attribute does not already exist. The /* flags */ feature of makewrappers is used to correct path names appropriately, so all functions are already working with complete paths, and can always use functions that work on links; if they were supposed to dereference, the path fixup code got that. The xattr support is enabled, for now, conditional on whether getfattr --help succeeds. Not yet implemented: Translation for system.posix_acl_access, which is used by "cp -a" (or "cp --preserve-all") on some systems to try to copy modes. Signed-off-by: Peter Seebach <peter.seebach@windriver.com>
Diffstat (limited to 'pseudo_wrappers.c')
-rw-r--r--pseudo_wrappers.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c
index a594d2e..4a40fed 100644
--- a/pseudo_wrappers.c
+++ b/pseudo_wrappers.c
@@ -48,6 +48,9 @@
#include "pseudo_ipc.h"
#include "pseudo_client.h"
+/* Types and declarations we need in advance. */
+#include "pseudo_wrapper_table.c"
+
static void pseudo_enosys(const char *);
static int pseudo_check_wrappers(void);
static volatile int antimagic = 0;
@@ -62,10 +65,6 @@ static void pseudo_sigblock(sigset_t *);
extern char *program_invocation_short_name;
static sigset_t pseudo_saved_sigmask;
-/* the generated code goes here */
-#include "pseudo_wrapper_table.c"
-#include "pseudo_wrapfuncs.c"
-
/* Constructor only exists in libpseudo */
static void _libpseudo_init(void) __attribute__ ((constructor));
@@ -252,4 +251,7 @@ pseudo_check_wrappers(void) {
return _libpseudo_initted;
}
+/* the generated code goes here */
#include "port_wrappers.c"
+#include "pseudo_wrapfuncs.c"
+