/*
- $Id: ea.h,v 1.3 2009-10-15 12:06:07 franklahm Exp $
+ $Id: ea.h,v 1.11 2010-03-12 15:16:49 franklahm Exp $
Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
This program is free software; you can redistribute it and/or modify
#include <config.h>
#endif
-#ifdef HAVE_NFSv4_ACLS
+#ifdef HAVE_SOLARIS_ACLS
#include <sys/acl.h>
#endif
kXAttrReplace = 0x4
};
+#if !defined(HAVE_SETXATTR)
+#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
+#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
+#endif
+
+
+/****************************************************************************************
+ * Stuff for our implementation of storing EAs in files in .AppleDouble dirs
+ ****************************************************************************************/
+
#define EA_INITED 0xea494e54 /* ea"INT", for interfacing ea_open w. ea_close */
#define EA_MAGIC 0x61644541 /* "adEA" */
#define EA_VERSION1 0x01
struct ea {
uint32_t ea_inited; /* needed for interfacing ea_open w. ea_close */
const struct vol *vol; /* vol handle, ea_close needs it */
+ int dirfd; /* for *at (cf openat) semantics, -1 means ignore */
char *filename; /* name of file, needed by ea_close too */
unsigned int ea_count; /* number of EAs in ea_entries array */
struct ea_entry (*ea_entries)[]; /* malloced and realloced as needed by ea_count*/
extern int ea_deletefile(VFS_FUNC_ARGS_DELETEFILE);
extern int ea_renamefile(VFS_FUNC_ARGS_RENAMEFILE);
extern int ea_copyfile(VFS_FUNC_ARGS_COPYFILE);
-
-/* Solaris native EAs */
-#ifdef HAVE_SOLARIS_EAS
-extern int sol_get_easize(VFS_FUNC_ARGS_EA_GETSIZE);
-extern int sol_get_eacontent(VFS_FUNC_ARGS_EA_GETCONTENT);
-extern int sol_list_eas(VFS_FUNC_ARGS_EA_LIST);
-extern int sol_set_ea(VFS_FUNC_ARGS_EA_SET);
-extern int sol_remove_ea(VFS_FUNC_ARGS_EA_REMOVE);
-#endif /* HAVE_SOLARIS_EAS */
+extern int ea_chown(VFS_FUNC_ARGS_CHOWN);
+extern int ea_chmod_file(VFS_FUNC_ARGS_SETFILEMODE);
+extern int ea_chmod_dir(VFS_FUNC_ARGS_SETDIRUNIXMODE);
+
+/* native EAs */
+extern int sys_get_easize(VFS_FUNC_ARGS_EA_GETSIZE);
+extern int sys_get_eacontent(VFS_FUNC_ARGS_EA_GETCONTENT);
+extern int sys_list_eas(VFS_FUNC_ARGS_EA_LIST);
+extern int sys_set_ea(VFS_FUNC_ARGS_EA_SET);
+extern int sys_remove_ea(VFS_FUNC_ARGS_EA_REMOVE);
+/* native EA VFSfile/dir cp/mv/rm */
+extern int sys_ea_copyfile(VFS_FUNC_ARGS_COPYFILE);
+
+/* dbd needs access to these */
+extern int ea_open(const struct vol * restrict vol,
+ const char * restrict uname,
+ eaflags_t eaflags,
+ struct ea * restrict ea);
+extern int ea_openat(const struct vol * restrict vol,
+ int dirfd,
+ const char * restrict uname,
+ eaflags_t eaflags,
+ struct ea * restrict ea);
+extern int ea_close(struct ea * restrict ea);
+extern char *ea_path(const struct ea * restrict ea, const char * restrict eaname, int macname);
#endif /* ATALK_EA_H */