]> git.sur5r.net Git - bacula/bacula/blob - bacula/patches/1.36.1/1.36.1-acl.patch
ebl update
[bacula/bacula] / bacula / patches / 1.36.1 / 1.36.1-acl.patch
1
2  This patch fixes some typos with ACL checking that results
3  in the incorrect name being used for the check.
4  This could lead to security problems with unwanted 
5  access by restricted consoles.
6  Apply the patch to 1.36.1 with:
7
8  cd <bacula-source>
9  patch -p0 <1.36.1-acl.patch
10  make
11  ...
12  
13  
14
15 Index: src/dird/ua_run.c
16 ===================================================================
17 RCS file: /cvsroot/bacula/bacula/src/dird/ua_run.c,v
18 retrieving revision 1.58
19 diff -u -r1.58 ua_run.c
20 --- src/dird/ua_run.c   8 Nov 2004 21:12:12 -0000       1.58
21 +++ src/dird/ua_run.c   30 Jan 2005 16:41:09 -0000
22 @@ -325,12 +330,13 @@
23        pool = job->pool;            /* use default */
24     }
25     if (!pool) {
26 -      return 1;
27 -   } else if (!acl_access_ok(ua, Pool_ACL, store->hdr.name)) {
28 +      return 0;
29 +   } else if (!acl_access_ok(ua, Pool_ACL, pool->hdr.name)) {
30        bsendmsg(ua, _("No authorization. Pool \"%s\".\n"),
31                pool->hdr.name);
32 -      return 1;
33 +      return 0;
34     }
35 +   Dmsg1(200, "Using pool\n", pool->hdr.name);
36  
37     if (client_name) {
38        client = (CLIENT *)GetResWithName(R_CLIENT, client_name);
39 @@ -344,12 +350,13 @@
40        client = job->client;          /* use default */
41     }
42     if (!client) {
43 -      return 1;
44 -   } else if (!acl_access_ok(ua, Client_ACL, store->hdr.name)) {
45 +      return 0;
46 +   } else if (!acl_access_ok(ua, Client_ACL, client->hdr.name)) {
47        bsendmsg(ua, _("No authorization. Client \"%s\".\n"),
48                client->hdr.name);
49 -      return 1;
50 +      return 0;
51     }
52 +   Dmsg1(200, "Using client=%s\n", client->hdr.name);
53  
54     if (fileset_name) {
55        fileset = (FILESET *)GetResWithName(R_FILESET, fileset_name);
56 @@ -361,11 +368,11 @@
57        fileset = job->fileset;          /* use default */
58     }
59     if (!fileset) {
60 -      return 1;
61 -   } else if (!acl_access_ok(ua, FileSet_ACL, store->hdr.name)) {
62 +      return 0;
63 +   } else if (!acl_access_ok(ua, FileSet_ACL, fileset->hdr.name)) {
64        bsendmsg(ua, _("No authorization. FileSet \"%s\".\n"),
65                fileset->hdr.name);
66 -      return 1;
67 +      return 0;
68     }
69  
70     if (verify_job_name) {