Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38235 - rbash and bash -r are not same thing
Summary: rbash and bash -r are not same thing
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-14 16:57 UTC by Ronny Schoeniger
Modified: 2004-09-21 20:22 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ronny Schoeniger 2004-01-14 16:57:16 UTC
If i start a restricted shell with rbash i am able to run programs because PATH is the same as in a normal shell.
If i start a restricted shell with bash -r am not able to run any program because PATH is not set.
Shouldn't be rbash and bash -r completly the same?

My version of bash is: bash-2.05b-r7
Comment 1 Ronny Schoeniger 2004-01-14 17:00:45 UTC
In adition, it seems that rbash runs /etc/profile at login!
Comment 2 Dick Marinus 2004-07-10 10:02:07 UTC
it seems to me like bash -r enables the restriction *before* running the profile. rbash enables the restriction *after* running the profile.
from the bash manpage:
"These restrictions are enforced after any startup files are read."

I suppose bash -r is 'buggy', though working around is easy (and it might be a feature instead of a bug) :-)
Comment 3 Aron Griffis (RETIRED) gentoo-dev 2004-07-10 14:22:19 UTC
According to the man-page and info-pages they should be the same thing, you're right.  Sounds fishy to me so I filed a bug using bashbug
Comment 4 Dick Marinus 2004-07-11 13:15:55 UTC
please don't forget to mention we have a patched bash (for rbash!)
(/usr/portage/app-shells/bash/files/bash-2.05b-rbash.patch)
Comment 5 SpanKY gentoo-dev 2004-07-11 13:45:47 UTC
does rbash still differently w/out that patch ?
Comment 6 Dick Marinus 2004-07-11 13:56:39 UTC
Yup, I've just compiled bash without the patch and it seem to have the same problem.
I can't see the purpose of the patch, restricted bash still works...
Comment 7 Aron Griffis (RETIRED) gentoo-dev 2004-07-11 15:33:04 UTC
Thanks for mentioning the patch.  I hadn't noticed it previously.  Thankfully it's unrelated to the problem reported upstream
Comment 8 Dick Marinus 2004-09-21 12:01:31 UTC
bash 3.00 seems to be fixed...
Comment 9 solar (RETIRED) gentoo-dev 2004-09-21 15:06:16 UTC
/me thinks rbash is pretty silly substitute for proper access control.
One just has to type bash from within the rbash shell to escape it.

solar@simple ~ $ rbash 
solar@simple ~ $ pwd
/home/solar
solar@simple ~ $ cd /
rbash: cd: restricted
solar@simple ~ $ bash
solar@simple ~ $ cd /
solar@simple / $ pwd
/
solar@simple / $ bash --version
GNU bash, version 3.00.0(1)-release (i686-pc-linux-gnu)
Copyright (C) 2004 Free Software Foundation, Inc.
Comment 10 SpanKY gentoo-dev 2004-09-21 20:22:32 UTC
regardless, bash-3.x seems to have things fixed