]> git.sur5r.net Git - bacula/bacula/commitdiff
Apply Time Oberfoell's ACL patch
authorKern Sibbald <kern@sibbald.com>
Sat, 12 Jun 2004 12:38:17 +0000 (12:38 +0000)
committerKern Sibbald <kern@sibbald.com>
Sat, 12 Jun 2004 12:38:17 +0000 (12:38 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1412 91ce42f0-d328-0410-95d8-f526ca767f89

15 files changed:
bacula/autoconf/acconfig.h
bacula/autoconf/config.h.in
bacula/autoconf/configure.in
bacula/configure
bacula/src/baconfig.h
bacula/src/dird/catreq.c
bacula/src/dird/inc_conf.c
bacula/src/dird/newvol.c
bacula/src/dird/next_vol.c
bacula/src/dird/protos.h
bacula/src/filed/backup.c
bacula/src/filed/job.c
bacula/src/filed/restore.c
bacula/src/findlib/find.h
bacula/src/findlib/match.c

index e7fb0a28fb4051d54a830027328159381cdc7928..1a1308c1bac34fbece93ded3c3f7b10ab3f7432d 100644 (file)
 /* Define if you have zlib */
 #undef HAVE_LIBZ
 
+/* Define if you have libacl */
+#undef HAVE_ACL
+
 /* General libs */
 #undef LIBS
 
index db298b00848a4067cf4a2c5fee90a5aae94cf924..a4dee78ce5da89217582c200a10f90e18a457097 100644 (file)
 /* Define if you have zlib */
 #undef HAVE_LIBZ
 
+/* Define if you have libacl */
+#undef HAVE_ACL
+
 /* General libs */
 #undef LIBS
 
index 40acbb825ea03b66ec374f6540ebfd9d046af619..3c7366e3a431d92b12c733a5c9644ca2b502228a 100644 (file)
@@ -1286,6 +1286,14 @@ if test x$FDLIBS = x-lz; then
   have_zlib=yes
 fi
 
+AC_CHECK_HEADER(sys/acl.h)
+AC_CHECK_LIB(acl, acl_get_file, [FDLIBS="-lacl $FDLIBS"])
+have_acl=no
+if test $ac_cv_lib_acl_acl_get_file = yes; then
+   AC_DEFINE(HAVE_ACL)
+   have_acl=yes
+fi
+
 dnl Check for pthread libraries
 PTHREAD_LIB=""
 AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread",
@@ -1779,6 +1787,7 @@ Configuration on `date`:
   enable-gnome:              ${support_gnome} ${gnome_version}
   enable-wx-console:         ${support_wx_console}
   client-only:               ${build_client_only}
+  ACL support:               ${have_acl}
 
   " > config.out
 
index ec385647da469d7142e69083edba239f271996a1..284695f40545aac12dc98e8f340b561cea299241 100755 (executable)
@@ -17644,6 +17644,204 @@ _ACEOF
   have_zlib=yes
 fi
 
+if test "${ac_cv_header_sys_acl_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for sys/acl.h" >&5
+echo $ECHO_N "checking for sys/acl.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_acl_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_acl_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_acl_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking sys/acl.h usability" >&5
+echo $ECHO_N "checking sys/acl.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <sys/acl.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking sys/acl.h presence" >&5
+echo $ECHO_N "checking sys/acl.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/acl.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+  yes:no )
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/acl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+  no:yes )
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/acl.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/acl.h: check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/acl.h: proceeding with the preprocessor's result" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for sys/acl.h" >&5
+echo $ECHO_N "checking for sys/acl.h... $ECHO_C" >&6
+if test "${ac_cv_header_sys_acl_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_sys_acl_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_acl_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_acl_h" >&6
+
+fi
+
+
+echo "$as_me:$LINENO: checking for acl_get_file in -lacl" >&5
+echo $ECHO_N "checking for acl_get_file in -lacl... $ECHO_C" >&6
+if test "${ac_cv_lib_acl_acl_get_file+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lacl  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char acl_get_file ();
+int
+main ()
+{
+acl_get_file ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+         { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_acl_acl_get_file=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_acl_acl_get_file=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_acl_acl_get_file" >&5
+echo "${ECHO_T}$ac_cv_lib_acl_acl_get_file" >&6
+if test $ac_cv_lib_acl_acl_get_file = yes; then
+  FDLIBS="-lacl $FDLIBS"
+fi
+
+have_acl=no
+if test $ac_cv_lib_acl_acl_get_file = yes; then
+   cat >>confdefs.h <<\_ACEOF
+#define HAVE_ACL 1
+_ACEOF
+
+   have_acl=yes
+fi
+
 PTHREAD_LIB=""
 echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5
 echo $ECHO_N "checking for pthread_create in -lpthread... $ECHO_C" >&6
@@ -19690,6 +19888,7 @@ Configuration on `date`:
   enable-gnome:              ${support_gnome} ${gnome_version}
   enable-wx-console:         ${support_wx_console}
   client-only:               ${build_client_only}
+  ACL support:               ${have_acl}
 
   " > config.out
 
index 0d0c80d11c6d3ff3936a20a85d6ff5032b93bcd5..3e82d763bd185ba0432fde6a9b2c0215b14b3a56 100644 (file)
 #define STREAM_WIN32_GZIP_DATA   12    /* Gzipped Win32 BackupRead data */
 #define STREAM_MACOS_FORK_DATA   13    /* Mac resource fork */
 #define STREAM_HFSPLUS_ATTRIBUTES 14   /* Mac OS extra attributes */
+#define STREAM_UNIX_ATTRIBUTES_ACL 15 /* ACL attributes on UNIX */
 
 /* 
  *  File type (Bacula defined).           
index e135902f18544bebaf37e8ded3d7c04c8e2fb1d6..14fd97202ba56a40e18f05b38e83a4ed944fcdd6 100644 (file)
@@ -103,7 +103,7 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
     */
    Dmsg1(200, "catreq %s", bs->msg);
    if (sscanf(bs->msg, Find_media, &Job, &index) == 2) {
-      ok = find_next_volume_for_append(jcr, &mr, TRUE /*permit create new vol*/);
+      ok = find_next_volume_for_append(jcr, &mr, true /*permit create new vol*/);
       /*
        * Send Find Media response to Storage daemon 
        */
index 1dd970381e1a80c283fd59e9060a01b90a6aecdf..c5f3d1fc87150f990b3f5010788c56fc0683aa12 100644 (file)
@@ -103,7 +103,8 @@ enum {
    INC_KW_PORTABLE,
    INC_KW_MTIMEONLY,
    INC_KW_KEEPATIME,
-   INC_KW_EXCLUDE
+   INC_KW_EXCLUDE,
+   INC_KW_ACL
 };
 
 /*
@@ -124,6 +125,7 @@ static struct s_kw FS_option_kw[] = {
    {"mtimeonly",   INC_KW_MTIMEONLY},
    {"keepatime",   INC_KW_KEEPATIME},
    {"exclude",     INC_KW_EXCLUDE},
+   {"aclsupport",  INC_KW_ACL},
    {NULL,         0}
 };
 
@@ -175,6 +177,8 @@ static struct s_fs_opt FS_options[] = {
    {"no",       INC_KW_KEEPATIME,     "0"},
    {"yes",      INC_KW_EXCLUDE,       "e"},
    {"no",       INC_KW_EXCLUDE,       "0"},
+   {"yes",           INC_KW_ACL,        "A"},
+   {"no",           INC_KW_ACL,         "0"},
    {NULL,      0,                   0}
 };
 
index e5352d4c3c8674ffc54da89cbcd95a81c74c275a..0863e67014b4ad026b1db2df2060a3c30ae368e9 100644 (file)
@@ -43,7 +43,7 @@ static int perform_full_name_substitution(JCR *jcr, MEDIA_DBR *mr, POOL_DBR *pr)
 /*
  * Automatic Volume name creation using the LabelFormat
  */
-int newVolume(JCR *jcr, MEDIA_DBR *mr)
+bool newVolume(JCR *jcr, MEDIA_DBR *mr)
 {
    POOL_DBR pr;
 
@@ -81,7 +81,7 @@ int newVolume(JCR *jcr, MEDIA_DBR *mr)
            db_unlock(jcr->db);
             Jmsg(jcr, M_INFO, 0, _("Created new Volume \"%s\" in catalog.\n"), mr->VolumeName);
             Dmsg1(90, "Created new Volume=%s\n", mr->VolumeName);
-           return 1;
+           return true;
         } else {
             Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db));
         }
@@ -89,7 +89,7 @@ int newVolume(JCR *jcr, MEDIA_DBR *mr)
    }
 bail_out:
    db_unlock(jcr->db);
-   return 0;   
+   return false;
 }
 
 static int create_simple_name(JCR *jcr, MEDIA_DBR *mr, POOL_DBR *pr)
index 2c1dd30ba1236709d738dbdafe195044a7748a6a..5063edf12273041e66839b756bef958a106ff33a 100644 (file)
@@ -40,7 +40,7 @@
  *   MEDIA_DBR mr (zeroed out)
  *   create -- whether or not to create a new volume
  */
-int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int create)
+int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, bool create)
 {
    int retry = 0;
    bool ok;
index 8a1a85bdfd20fcc74d5b25d15c71a0958fc39fae..d7266a12df85ab11c583b53e3646f32dbebef3ff 100644 (file)
@@ -101,12 +101,12 @@ extern int bget_dirmsg(BSOCK *bs);
 extern void wait_for_storage_daemon_termination(JCR *jcr);
 
 /* next_vol.c */
-int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, int create);
+int find_next_volume_for_append(JCR *jcr, MEDIA_DBR *mr, bool create);
 bool has_volume_expired(JCR *jcr, MEDIA_DBR *mr);
 void check_if_volume_valid_or_recyclable(JCR *jcr, MEDIA_DBR *mr, char **reason);
 
 /* newvol.c */
-int newVolume(JCR *jcr, MEDIA_DBR *mr);
+bool newVolume(JCR *jcr, MEDIA_DBR *mr);
 
 /* ua_acl.c */
 bool acl_access_ok(UAContext *ua, int acl, char *item);
index 8571be775e1b944794b995b0290dcdf0fa14b32f..534dbd9a68ce6eae0f4bd53e208ffb238de57cba 100644 (file)
 #include "bacula.h"
 #include "filed.h"
 
+#ifdef HAVE_ACL
+#include <sys/acl.h>
+#include <acl/libacl.h>
+#endif
+
 static int save_file(FF_PKT *ff_pkt, void *pkt);
 
 /* 
@@ -464,6 +469,87 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr)
         return 0;
       }
    }
+   
+#ifdef HAVE_ACL
+   /* ACL stream */
+   if(ff_pkt->flags & FO_ACL) {
+      char *acl_text;
+      /* Read ACLs for files, dirs and links */
+      if(ff_pkt->type == FT_DIREND) {
+        /* Directory: Try for default ACL*/
+        acl_t myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_DEFAULT);
+        if(!myAcl) {
+            Dmsg1(200, "No default ACL defined for directory: %s!\n", ff_pkt->fname);
+           /* If there is no default ACL get standard ACL */
+           myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_ACCESS);
+           if(!myAcl) {
+               Emsg1(M_WARNING, 0, "Error while trying to get ACL of directory: %s!\n", ff_pkt->fname);
+           }
+        }
+         acl_text = acl_to_any_text(myAcl, NULL, ',', TEXT_ABBREVIATE);
+        /* Free memory */
+        acl_free(myAcl);
+      } else {
+        /* Files or links */
+        acl_t myAcl = acl_get_file(ff_pkt->fname, ACL_TYPE_ACCESS);
+        if(!myAcl) {
+            Emsg1(M_WARNING, 0, "Error while trying to get ACL of file: %s!\n", ff_pkt->fname);
+           acl_free(myAcl);
+        }
+         acl_text = acl_to_any_text(myAcl, NULL, ',', TEXT_ABBREVIATE);
+        acl_free(myAcl);
+      }
+      
+      /* Send stream to server */
+      sd = jcr->store_bsock;
+      char *rbuf, *wbuf;
+      int rsize = jcr->buf_size;
+      
+      msgsave = sd->msg;
+      rbuf = sd->msg;
+      wbuf = sd->msg;
+      
+      pm_strcpy(&jcr->last_fname, ff_pkt->fname);
+      
+      /*
+      * Send ACL header
+      *
+      */
+      if(!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_UNIX_ATTRIBUTES_ACL)) {
+        set_jcr_job_status(jcr, JS_ErrorTerminated);
+        return 0;
+      }
+      
+      /* Make space at beginning of buffer for fileAddr */
+      if(ff_pkt->flags & FO_SPARSE) {
+        rbuf += SPARSE_FADDR_SIZE;
+        rsize -= SPARSE_FADDR_SIZE;
+      }
+      
+      /* Send the buffer to the storage deamon */
+      if(ff_pkt->flags & FO_SPARSE) {
+        sd->msglen += SPARSE_FADDR_SIZE;
+      }
+      sd->msg = acl_text;
+      sd->msglen += strlen(acl_text);
+      if(!bnet_send(sd)) {
+        sd->msg = msgsave;
+        sd->msglen = 0;
+        bclose(&ff_pkt->bfd);
+        set_jcr_job_status(jcr, JS_ErrorTerminated);
+         Emsg1(M_WARNING, 0, "Error while trying to send ACL of %s to SD!\n", ff_pkt->fname);
+      } else {
+        jcr->JobBytes += sd->msglen;
+        sd->msg = msgsave;
+        bclose(&ff_pkt->bfd);
+        if(!bnet_sig(sd, BNET_EOD)) {
+           set_jcr_job_status(jcr, JS_ErrorTerminated);
+        } else {
+            Dmsg1(200, "ACL of file: %s successfully backed up!\n", ff_pkt->fname);
+        }
+      }  
+   }
+#endif
 
    /* Terminate any MD5 signature and send it to Storage daemon and the Director */
    if (gotMD5 && ff_pkt->flags & FO_MD5) {
index e095f2b5e772c4f521e8c8a945ee72d2dc855f64..2343366a0ce392f0a80d3a9f367d776682fa9fe6 100644 (file)
@@ -1096,6 +1096,7 @@ static int storage_cmd(JCR *jcr)
    /* Try to connect for 1 hour at 10 second intervals */
    sd = bnet_connect(jcr, 10, me->SDConnectTimeout, _("Storage daemon"), 
                     jcr->stored_addr, NULL, stored_port, 1);
+   Dmsg0(110, "Connection OK to SD.\n");
    if (sd == NULL) {
       Jmsg(jcr, M_FATAL, 0, _("Failed to connect to Storage daemon: %s:%d\n"),
          jcr->stored_addr, stored_port);
index 6066677bdebb90494e2bb53d95b1bcc096abccf0..1ad10c0179a638cc70fcddf769928376c5a0dd95 100644 (file)
 #include "bacula.h"
 #include "filed.h"
 
+#ifdef HAVE_ACL
+#include <sys/acl.h>
+#include <acl/libacl.h>
+#endif
+
 /* Data received from Storage Daemon */
 static char rec_header[] = "rechdr %ld %ld %ld %ld %ld";
 
@@ -59,9 +64,12 @@ void do_restore(JCR *jcr)
    uint64_t fileAddr = 0;            /* file write address */
    int non_support_data = 0;
    int non_support_attr = 0;
+   int non_support_acl = 0;
    int prog_name_msg = 0;
    ATTR *attr;
-   
+#ifdef HAVE_ACL
+   acl_t acl;
+#endif
 
    binit(&bfd);
    sd = jcr->store_bsock;
@@ -307,6 +315,38 @@ void do_restore(JCR *jcr)
 #endif
         break;
 
+#ifdef HAVE_ACL
+      case STREAM_UNIX_ATTRIBUTES_ACL:  
+        /* Recover ACL from stream and check it */
+        acl = acl_from_text(sd->msg);
+        if(acl_valid(acl) != 0) {
+            Emsg1(M_WARNING, 0, "Failure in the ACL of %s! FD is not able to restore it!\n", jcr->last_fname);
+           acl_free(acl);
+        }
+        
+        /* Try to restore ACL */
+        if(attr->type == FT_DIREND) {
+           /* Directory */
+           if(acl_set_file(jcr->last_fname, ACL_TYPE_DEFAULT, acl) != 0) {
+              if(acl_set_file(jcr->last_fname, ACL_TYPE_ACCESS, acl) != 0) {
+                  Emsg1(M_WARNING, 0, "Error! Can't restore ACL of directory: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+              }
+           }
+        } else {
+           /* File or Link */
+           if(acl_set_file(jcr->last_fname, ACL_TYPE_ACCESS, acl) != 0) {
+               Emsg1(M_WARNING, 0, "Error! Can't restore ACL of file: %s! Maybe system does not support ACLs!\n", jcr->last_fname);
+           }
+        }
+        acl_free(acl);
+         Dmsg1(200, "ACL of file: %s successfully restored!", jcr->last_fname);
+        break;
+#else 
+      case STREAM_UNIX_ATTRIBUTES_ACL:  
+        non_support_acl++;
+        break;                       /* unconfigured, ignore */
+#endif  
+        
       case STREAM_MD5_SIGNATURE:
       case STREAM_SHA1_SIGNATURE:
         break;
@@ -360,6 +400,10 @@ ok_out:
       Jmsg(jcr, M_ERROR, 0, _("%d non-supported data streams and %d non-supported attrib streams ignored.\n"),
         non_support_data, non_support_attr);
    }
+   if (non_support_acl) {
+      Jmsg(jcr, M_INFO, 0, _("%d non-supported acl streams ignored.\n"), non_support_acl);
+   }
+
 }         
 
 #ifdef HAVE_LIBZ
index 32dda2c8a02bc5818b231ba1b85c1e1b2f8dab87..7bdf0c2778ce83aa0992a5370f3ff3ff935c9c82 100755 (executable)
@@ -86,6 +86,7 @@ enum {
 #define FO_MTIMEONLY    (1<<11)       /* Use mtime rather than mtime & ctime */
 #define FO_KEEPATIME    (1<<12)       /* Reset access time */
 #define FO_EXCLUDE      (1<<13)       /* Exclude file */
+#define FO_ACL         (1<<14)         /* Backup ACLs */
 
 struct s_included_file {
    struct s_included_file *next;
index 669ebbdddd712b19d04097d892cabe0d88968e95..61b926b1fa00cf6dcae98ac246d2cb8c8e2c027b 100644 (file)
@@ -144,7 +144,10 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, char *fname)
          case 'w':
            inc->options |= FO_IF_NEWER;
            break;
-         case 'Z':                 /* gzip compression */
+         case 'A':
+           inc->options |= FO_ACL;
+           break;
+        case 'Z':                 /* gzip compression */
            inc->options |= FO_GZIP;
             inc->level = *++p - '0';
             Dmsg1(200, "Compression level=%d\n", inc->level);