]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/3.0.1-acl-error.patch
Tweak kernstodo
[bacula/bacula] / bacula / patches / 3.0.1-acl-error.patch
1
2  This patch can be applied to version 3.0.1 and makes
3  error conditions obtaining acls during backup non-fatal.
4  This should fix bug #1305.
5
6  Apply it to version 3.0.1 with:
7
8  cd <bacula-source>
9  patch -p0 <3.0.1-acl-error.patch
10  ./configure <your-options>
11  make
12  ...
13  make install
14
15
16
17 Index: src/filed/acl.c
18 ===================================================================
19 --- src/filed/acl.c     (revision 8902)
20 +++ src/filed/acl.c     (working copy)
21 @@ -406,31 +406,35 @@
22        pm_strcpy(jcr->acl_data, "");
23        acl_free(acl);
24  
25 -      return -1;
26 +      return 0;                       /* non-fatal error */
27     }
28  
29     /*
30      * Handle errors gracefully.
31      */
32 -   switch (errno) {
33 +   if (acl == (acl_t)NULL) {
34 +      switch (errno) {
35  #if defined(BACL_ENOTSUP)
36 -   case BACL_ENOTSUP:
37 -      /*
38 -       * Not supported, just pretend there is nothing to see
39 -       */
40 -      pm_strcpy(jcr->acl_data, "");
41 -      return 0;
42 +      case BACL_ENOTSUP:
43 +         break;                       /* not supported */
44  #endif
45 -   default:
46 -      berrno be;
47 -      Jmsg2(jcr, M_ERROR, 0, _("acl_get_file error on file \"%s\": ERR=%s\n"),
48 -         jcr->last_fname, be.bstrerror());
49 -      Dmsg2(100, "acl_get_file error file=%s ERR=%s\n",  
50 -         jcr->last_fname, be.bstrerror());
51 +      default:
52 +         berrno be;
53 +         /* Some real error */
54 +         Jmsg2(jcr, M_ERROR, 0, _("acl_get_file error on file \"%s\": ERR=%s\n"),
55 +            jcr->last_fname, be.bstrerror());
56 +         Dmsg2(100, "acl_get_file error file=%s ERR=%s\n",  
57 +            jcr->last_fname, be.bstrerror());
58  
59 -      pm_strcpy(jcr->acl_data, "");
60 -      return -1;
61 +         pm_strcpy(jcr->acl_data, "");
62 +         return 0;                    /* non-fatal error */
63 +      }
64     }
65 +   /*
66 +    * Not supported, just pretend there is nothing to see
67 +    */
68 +   pm_strcpy(jcr->acl_data, "");
69 +   return 0;
70  }
71  
72  /*