Bacula-users

Re: [Bacula-users] Baculum probelm with bconsole

2014-06-19 06:49:41
Subject: Re: [Bacula-users] Baculum probelm with bconsole
From: Marcin Haba <ganiuszka AT gmail DOT com>
To: "Bacula-users AT lists.sourceforge DOT net" <bacula-users AT lists.sourceforge DOT net>
Date: Thu, 19 Jun 2014 12:44:07 +0200
2014-06-18 12:16 GMT+02:00 agris <bacula-forum AT backupcentral DOT com>:
> my bacula sources for centos last are compiled from fedora 21 src.rpm, add 
> bacula 7.0.4 source. only need to manual change between database types and 
> force install without one sql lib witch not need.
>
> i get web work. i had default test install centos,apache php.
> only think i edit was bconsole.conf read to others.
>
> without than i get error :
> [root@localhost www]# sudo -u apache bconsole
> 14-Jun 13:30 bconsole: ABORTING due to ERROR in mem_pool.c:156
> obuf is NULL
> bconsole: message.c:1327: void e_msg(const char*, int, int, int, const char*, 
> ...): Assertion `p!=__null' failed.
> Bacula interrupted by signal 6: IOT trap
> Kaboom! bconsole, bconsole got signal 6 - IOT trap at 14-Jun-2014 13:30:31. 
> Attempting traceback.
> Kaboom! exepath=/var/www
> Calling: /var/www/btraceback /var/www/bconsole 42548 /tmp
> execv: /var/www/btraceback failed: ERR=No such file or directory
> The btraceback call returned 255
> Dumping: /tmp/bconsole.42548.lockdump
>
>
> so i do not touch sudoers. i think what php by default allow to execute shell 
> commands.

Hello,

In case using sudo I suggest using full path to bconsole.

It looks that because you are running sudo from root account with
switching to user by -u param, then root user can read "bconsole" full
path from his PATH shell variable. But after switching to apache user,
this user has not access to root PATH, so apache user looks in current
path (in this case /var/www) and here looking for "bconsole" binary.

As result above described action, you see:

Calling: /var/www/btraceback /var/www/bconsole 42548 /tmp
execv: /var/www/btraceback failed: ERR=No such file or directory

In your workinng Baculum you needed to add "read for others"
permission for configuration file, because without using sudo, apache
user has not access to this file.

Summing up, calling:

1)

# sudo -u apache /your/path/bconsole

or equivalent:

# su apache
$ sudo /your/path/bconsole

requires:
- definition /your/path/bconsole in sudoers file for apache user
access without password

NOT require:
- read and execute access to bconsole binary file for apache user
- read access to bconsole configuration file for apache user

2)

From apache account:

$ /your/path/bconsole

requires:
- read and execute access to bconsole binary file for apache user
- read access to bconsole configuration file for apache user

NOT require:
- using sudo

In your case you are using 2) option. Both options are valid. Good way
for checking access to bconsole by Apache user can be using Bconsole
connection test button in Baculum wizard.

Please note that there is bug with working this test button in
versions 7.0.3 and 7.0.4 and there is need to use older version of
Baculum or use patch attached to this discussion. Final solution could
be waiting for new Bacula release with Baculum patch applied.

Best regards.
Marcin

-- 
"Większej miłości nikt nie ma nad tę, jak gdy kto życie swoje kładzie
za przyjaciół swoich." Jezus Chrystus

------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users