Bug 745017 - Bacula Catalog Backup Failing Due to umask issue in make_catalog_backup.pl script
Summary: Bacula Catalog Backup Failing Due to umask issue in make_catalog_backup.pl sc...
Keywords:
Status: CLOSED DUPLICATE of bug 651780
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: bacula
Version: 6.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Lukáš Nykrýn
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-11 08:10 UTC by Jason Tingle
Modified: 2011-10-13 08:07 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-13 08:07:52 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Jason Tingle 2011-10-11 08:10:39 UTC
Description of problem:
The umask on line 92 of the make_catalog_backup.pl script is incorrectly configured.  A mask is set instead of a umask.

my %args = @_;
    umask(0700);
    unlink("$wd/.my.cnf");
    open(MY, ">$wd/.my.cnf")

This should be
    umask(0077)

The backup of the catalog will fail because of this problem.  MySQL will ignore the .my.cnf file create in /var/spool/bacula since it is world writable

[root@nicodemus bacula]# ./make_catalog_backup.pl MyCatalog
Warning: World-writable config file '/var/spool/bacula/.my.cnf' is ignored
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect
[root@nicodemus bacula]# ls -l /var/spool/bacula/.my.cnf
----rw-rw-. 1 root root 46 Oct 11 04:04 /var/spool/bacula/.my.cnf

# Now make the change and try again
[root@nicodemus bacula]# rm /var/spool/bacula/.my.cnf
[root@nicodemus bacula]# perl -i.bak -wple 's/0700/0077/;' /usr/libexec/bacula/make_catalog_backup.pl
[root@nicodemus bacula]# ./make_catalog_backup.pl MyCatalog
[root@nicodemus bacula]# echo $?
0
[root@nicodemus bacula]# ls -l /var/spool/bacula/.my.cnf
-rw-------. 1 root root 46 Oct 11 04:07 /var/spool/bacula/.my.cnf


Version-Release number of selected component (if applicable):

[root@nicodemus ~]# rpm -q bacula-director-common
bacula-director-common-5.0.0-7.el6.x86_64

[root@nicodemus ~]# rpm -ql bacula-director-common|grep make_catalog_backup.pl
/usr/libexec/bacula/make_catalog_backup.pl



How reproducible:


Steps to Reproduce:
1. Install the bacula-director rpm and after configuring the mysql database and bacula-dir.conf file try to take a backup of the catalog
2. The catalog backup will fail
  
Actual results:
Backup of Bacula Catalog fails

Expected results:
Backup of Bacula Catalog should be successful

Additional info:

Comment 2 RHEL Program Management 2011-10-11 08:29:23 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unfortunately unable to
address this request at this time. Red Hat invites you to
ask your support representative to propose this request, if
appropriate and relevant, in the next release of Red Hat
Enterprise Linux. If you would like it considered as an
exception in the current release, please ask your support
representative.

Comment 3 Lukáš Nykrýn 2011-10-13 08:07:52 UTC

*** This bug has been marked as a duplicate of bug 651780 ***


Note You need to log in before you can comment on or make changes to this bug.