Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#657103: rkhunter: Invalid BINDIR configuration option: Invalid directory found: ~/bin

866 views
Skip to first unread message

Jesse Molina

unread,
Jan 24, 2012, 4:20:01 AM1/24/12
to

Hi

Shell is bash 4.2-1.

If you want debug output, tell me explicitly what you want. Normally I
like a good mystery, but I do not have the time right now.



Julien Valroff wrote:
> This indeed shouldn't happen as $PATH should only be used when BINDIR
> configuration option doesn't exist.
>
> What is your default shell? I'm surprised it leaves ~/bin in $PATH - it
> should be automagically changed to an absolute path.
>
> % grep PATH ~/.zshrc
> ## PATH definition
> [ -d ~/scripts ]&& PATH=$PATH:~/scripts
> [ -d ~/bin ]&& PATH=$PATH:~/bin
>
> % echo $PATH
> /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/julien/scripts:/home/julien/bin
>
> rkhunter then complains as it only accepts bin directories beginning with /
> to avoid any relative paths being used.

--
# Jesse Molina
# Mail = je...@opendreams.net
# Page = page-...@opendreams.net
# Cell = 1.602.323.7608
# Web = http://www.opendreams.net/jesse/





--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Julien Valroff

unread,
Jan 26, 2012, 3:20:02 PM1/26/12
to
Le mardi 24 janv. 2012 à 10:07:03 (+0100 CET), Jesse Molina a écrit :
>
> Hi
>
> Shell is bash 4.2-1.

How do you define your $PATH?

Make sure you do not use ' which would prevent ~/ from being expanded to
/home/username/

PATH=$PATH:~/bin

is enough

The rkhunter warning is actually normal as it doesn't accept any directory
in $PATH or $BINDIR which doesn't begin with / - which is a safe way to
avoid relative paths.

Cheers,
Julien

--
.''`. Julien Valroff ~ <jul...@kirya.net> ~ <jul...@debian.org>
: :' : Debian Developer & Free software contributor
`. `'` http://www.kirya.net/
`- 4096R/ E1D8 5796 8214 4687 E416 948C 859F EF67 258E 26B1

Jesse Molina

unread,
Jan 31, 2012, 3:10:01 AM1/31/12
to

Sorry for slow reply.

-->echo $PATH
~/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

-->egrep PATH= .bash*
.bash_profile:PATH="/usr/local/sbin:/usr/sbin:/sbin:${PATH}"
.bash_profile: PATH="~/bin:${PATH}"



-->sudo rkhunter --propupd
Invalid BINDIR configuration option: Invalid directory found: ~/bin
[~]
-->PATH="/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
[~]
-->sudo rkhunter --propupd
[ Rootkit Hunter version 1.3.8 ]
^C[~]
-->PATH="~/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games"
[~]
-->sudo rkhunter --propupd
Invalid BINDIR configuration option: Invalid directory found: ~/bin



The question as to why BINDIR in the config file is being ignored remains.

-->egrep "^BINDIR" /etc/rkhunter.conf
BINDIR="/bin /usr/bin /sbin /usr/sbin /usr/local/bin /usr/local/sbin
/usr/libexec /usr/local/libexec"




Julien Valroff wrote:
> How do you define your $PATH?
>
> Make sure you do not use ' which would prevent ~/ from being expanded to
> /home/username/
>
> PATH=$PATH:~/bin
>
> is enough
>
> The rkhunter warning is actually normal as it doesn't accept any directory
> in $PATH or $BINDIR which doesn't begin with / - which is a safe way to
> avoid relative paths.

Julien Valroff

unread,
Jan 31, 2012, 2:10:01 PM1/31/12
to
Le mardi 31 janv. 2012 à 09:02:59 (+0100 CET), Jesse Molina a écrit :
>
> Sorry for slow reply.
>
> -->echo $PATH
> ~/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
>
> -->egrep PATH= .bash*
> .bash_profile:PATH="/usr/local/sbin:/usr/sbin:/sbin:${PATH}"
> .bash_profile: PATH="~/bin:${PATH}"

OK, I have finally managed to get this behaviour, "~/bin" is not expanded...

[...]
> The question as to why BINDIR in the config file is being ignored remains.

Read around line 2122 of rkhunter:

# The BINPATHS list is prepended with the root PATH. However,
# any specified BINDIR directories beginning with a '+' will
# be prepended before the root PATH.
#
# Once that has been done, we check that each directory begins
# with a '/'. We remove any non-existent directories, but we do
# not flag this as an error. We also remove any duplicate directories.

Hence the root PATH is then always considered, contrary to what I had
originally thought. The behaviour you describe is IMHO normal, the cause is
the fact you don't allow ~/bin to be expanded to /home/user/bin.

Simply change your .bash_profile to state PATH=~/bin:${PATH} and it should
work as expected.

Cheers,
Julien

--
.''`. Julien Valroff ~ <jul...@kirya.net> ~ <jul...@debian.org>
: :' : Debian Developer & Free software contributor
`. `'` http://www.kirya.net/
`- 4096R/ E1D8 5796 8214 4687 E416 948C 859F EF67 258E 26B1



Jesse Molina

unread,
Jan 31, 2012, 7:40:02 PM1/31/12
to

Okay, I understand now. Thanks for your help.

I have a habit of quoting things. Looks like it bit me.

~/bin does get expanded for me in the shell, so it's never been a
problem for me before. Since rkhunter takes $PATH in as-is, it doesn't
know what to do with ~.

FYI, this was never a problem until something in rkhunter changed fairly
recently.

Thanks. Go ahead and close out.
0 new messages