]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/acl.h
New overhaul of xattr code.
[bacula/bacula] / bacula / src / filed / acl.h
index dc60ce41ec239f9146faf54ac99d382f6955e796..fddc90b0cfc91516242dbc3765c03b45b917f097 100644 (file)
@@ -6,7 +6,7 @@
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
    License as published by the Free Software Foundation and included
    in the file LICENSE.
 
@@ -15,7 +15,7 @@
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -29,8 +29,8 @@
  * Properties we use for getting and setting ACLs.
  */
 
  * Properties we use for getting and setting ACLs.
  */
 
-#ifndef _BACULA_ACL_
-#define _BACULA_ACL_
+#ifndef __ACL_H
+#define __ACL_H
 
 /* For shorter ACL strings when possible, define BACL_WANT_SHORT_ACLS */
 /* #define BACL_WANT_SHORT_ACLS */
 
 /* For shorter ACL strings when possible, define BACL_WANT_SHORT_ACLS */
 /* #define BACL_WANT_SHORT_ACLS */
@@ -46,36 +46,52 @@ typedef enum {
    BACL_TYPE_ACCESS = 1,
    BACL_TYPE_DEFAULT = 2,
    BACL_TYPE_DEFAULT_DIR = 3,
    BACL_TYPE_ACCESS = 1,
    BACL_TYPE_DEFAULT = 2,
    BACL_TYPE_DEFAULT_DIR = 3,
-   BACL_TYPE_EXTENDED = 4
+   BACL_TYPE_EXTENDED = 4,
+   BACL_TYPE_NFS4 = 5
 } bacl_type;
 
 /*
 } bacl_type;
 
 /*
- * This value is used as ostype when we encounter a invalid acl type.
+ * This value is used as ostype when we encounter an invalid acl type.
  * The way the code is build this should never happen.
  */
 #if !defined(ACL_TYPE_NONE)
 #define ACL_TYPE_NONE 0x0
 #endif
 
  * The way the code is build this should never happen.
  */
 #if !defined(ACL_TYPE_NONE)
 #define ACL_TYPE_NONE 0x0
 #endif
 
-#if defined(HAVE_FREEBSD_OS)
-#define BACL_ENOTSUP          EOPNOTSUPP
-#elif defined(HAVE_DARWIN_OS)
-#define BACL_ENOTSUP          EOPNOTSUPP
-#elif defined(HAVE_HPUX_OS)
-#define BACL_ENOTSUP          EOPNOTSUPP
+#if defined(HAVE_FREEBSD_OS) || \
+    defined(HAVE_DARWIN_OS) || \
+    defined(HAVE_HPUX_OS) || \
+    defined(HAVE_LINUX_OS)
+#define BACL_ENOTSUP EOPNOTSUPP
 #elif defined(HAVE_IRIX_OS)
 #elif defined(HAVE_IRIX_OS)
-#define BACL_ENOTSUP          ENOSYS
-#elif defined(HAVE_LINUX_OS) 
-#define BACL_ENOTSUP          ENOTSUP
+#define BACL_ENOTSUP ENOSYS
 #endif
 
 #endif
 
+#define BACL_FLAG_SAVE_NATIVE    0x01
+#define BACL_FLAG_SAVE_AFS       0x02
+#define BACL_FLAG_RESTORE_NATIVE 0x04
+#define BACL_FLAG_RESTORE_AFS    0x08
+
+struct acl_build_data_t {
+   uint32_t nr_errors;
+   uint32_t content_length;
+   POOLMEM *content;
+};
+
+struct acl_parse_data_t {
+   uint32_t nr_errors;
+};
+
 /*
  * Internal tracking data.
  */
 struct acl_data_t {
 /*
  * Internal tracking data.
  */
 struct acl_data_t {
-   POOLMEM *content;
-   uint32_t content_length;
-   uint32_t nr_errors;
+   uint32_t flags;             /* See BACL_FLAG_* */
+   uint32_t current_dev;
+   union {
+      struct acl_build_data_t *build;
+      struct acl_parse_data_t *parse;
+   } u;
 };
 
 #endif
 };
 
 #endif