Skip to contentSkip to conversation

running batman as non-root

B.A.T.M.A.N. Freifunk Dresden 2 participants 3 messages Sep 14, 2007 – Sep 20, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

I'm running batman (experimental) on a debian linux as root but want to access the debug levels (batmand -c -b -d 1) from within a apache that is not running as root.

batman actually checks the user id and does not allow to run as non-root users. also when I disable the check, batman can not access the /var/run/batman.socket except when I change the access modes from command line.
but after each start of batman, the access rights are restricted to root.

Is it possible to also support non root access for batmand -c -b -d 1?

Regards
Stephan

#1 lore raw

Hi,

Quoted 3 lines

I'm running batman (experimental) on a debian linux as root but want to access the debug levels (batmand -c -b -d 1) from within a apache that is not running as root.

indeed a problem. As quick fix you could use sudo and allow www-data to access batmand.

Quoted 4 lines

batman actually checks the user id and does not allow to run as non-root users. also when I disable the check, batman can not access the /var/run/batman.socket except when I change the access modes from command line.

That is why batman checks the user id ...

Quoted 1 line

Is it possible to also support non root access for batmand -c -b -d 1?

The question is: Do we really want that ? I understand your case but your solutions implies that other non-privileged could access the daemon. The "batmand -c" command can do much more than giving you the debug output as changing the gateway_class / routing_class / preferred gateway and may be more in the future.

Regards,
Marek

#2 lore raw

Hi,

Thanks, I no use the following setting in /etc/sudoers:

# Cmnd alias specification
Cmnd_Alias BATMAND=/usr/bin/batmand -c -b -d [0-9]

# User privilege specification
root ALL=(ALL) ALL
www-data ALL=NOPASSWD: BATMAND