fln / addrwatch

A tool similar to arpwatch for IPv4/IPv6 and ethernet address pairing monitoring.
GNU General Public License v3.0
184 stars 30 forks source link

Cannot connect to remote mysql when dropping privileges #2

Closed darknight7 closed 11 years ago

darknight7 commented 11 years ago

It seems that addrwatch is unable to open the file with credentials when dropping privileges. The file itself is both in the addrwatch user home and in root's home, with respectively correct permissions. No problem if the -u switch is not used. Maybe the home directory is detected before the privileges are dropped? Thanks for writing this software and making it available.

fln commented 11 years ago

Thanks for reporting the issue. Fix is in the master branch: https://github.com/fln/addrwatch/commit/1fe0b00fa3732e3d5c0b75400a5eee5a5b3a09f1

Environment variable HOME is now changed to new user home directory after dropping privileges, this should solve the issue. This commit also adds new command line option where you can specify MySQL config file explicitly.