]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/filed/job.c
Change checking for acl and xattr support from first file to job level.
[bacula/bacula] / bacula / src / filed / job.c
index 4d825499ee11eac6cc3943eaadcac7d3dc747284..c91f2135fa02ca8407756c578244488c7cb9fc95 100644 (file)
@@ -44,6 +44,22 @@ static pthread_mutex_t vss_mutex = PTHREAD_MUTEX_INITIALIZER;
 static int enable_vss = 0;
 #endif
 
+/*
+ * As Windows saves ACLs as part of the standard backup stream
+ * we just pretend here that is has implicit acl support.
+ */
+#if defined(HAVE_ACL) || defined(HAVE_WIN32)
+const bool have_acl = true;
+#else
+const bool have_acl = false;
+#endif
+
+#if defined(HAVE_XATTR)
+const bool have_xattr = true;
+#else
+const bool have_xattr = false;
+#endif
+
 extern CLIENT *me;                    /* our client resource */
 
 /* Imported functions */
@@ -196,7 +212,7 @@ static char read_close[]   = "read close session %d\n";
  *  5. FD gets/runs ClientRunBeforeJob and sends ClientRunAfterJob
  *  6. Dir sends include/exclude
  *  7. FD sends data to SD
- *  8. SD/FD disconnects while SD despools data and attributes (optionnal)
+ *  8. SD/FD disconnects while SD despools data and attributes (optional)
  *  9. FD runs ClientRunAfterJob
  */
 
@@ -1439,6 +1455,19 @@ static int backup_cmd(JCR *jcr)
    }
 #endif
 
+   /*
+    * Validate some options given to the backup make sense for the compiled in
+    * options of this filed.
+    */
+   if (jcr->ff->flags & FO_ACL && !have_acl) {
+      Jmsg(jcr, M_FATAL, 0, _("ACL support not configured for your machine.\n"));
+      goto cleanup;
+   }
+   if (jcr->ff->flags & FO_XATTR && !have_xattr) {
+      Jmsg(jcr, M_FATAL, 0, _("XATTR support not configured for your machine.\n"));
+      goto cleanup;
+   }
+
    set_jcr_job_status(jcr, JS_Blocked);
    jcr->set_JobType(JT_BACKUP);
    Dmsg1(100, "begin backup ff=%p\n", jcr->ff);