Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 93016 - su from `shadow' package lacks `preserve environment' and `login shell' features
Summary: su from `shadow' package lacks `preserve environment' and `login shell' features
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High minor (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-17 19:34 UTC by Leonid Kabanov
Modified: 2006-01-13 17:55 UTC (History)
2 users (show)

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


Attachments
patch for coreutils patchset (coreutils-5.2.1-patches-0.11.patch.bz2,15.62 KB, application/octet-stream)
2005-07-22 00:21 UTC, Leonid Kabanov
Details
coreutils ebuild patch (coreutils-5.2.1-r6.ebuild.patch,715 bytes, patch)
2005-07-22 00:23 UTC, Leonid Kabanov
Details | Diff
coreutils ebuild patch (coreutils-5.2.1-r6.ebuild.patch,1.11 KB, patch)
2005-07-22 01:31 UTC, Leonid Kabanov
Details | Diff
pam file for su (pam.d-su,1.03 KB, text/plain)
2005-07-22 01:34 UTC, Leonid Kabanov
Details
pam file for su (openpam) (pam.d-su-openpam,249 bytes, text/plain)
2005-07-22 01:35 UTC, Leonid Kabanov
Details
shadow-4.0.11.1-GNU-su.tar.bz2 (shadow-4.0.11.1-GNU-su.tar.bz2,11.92 KB, application/x-bzip)
2005-08-24 02:09 UTC, Martin Schlemmer (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Leonid Kabanov 2005-05-17 19:34:17 UTC
`su' from `sys-apps/shadow' package cannot be used for users with invalid shells
(`/bin/false', `/dev/null', etc.). `su' at least in Debian, Ubuntu, Knoppix,
RedHat, Fedora Core and SuSE distributions have `-s' command-line option for
these users to specify login shell as well as `-p' for preserve environment
variables. These distributions use sh-utils and its successor coreutils. This
was reported even in early 2003 but our `su' still lacks those features.
P.S. I know this bug is dup 15014 but seems noone want reopen this bug.

Reproducible: Always
Steps to Reproduce:
1. su -c 'ls -l' nobody 


Actual Results:  
(none)

Expected Results:  
listing of /
Comment 1 Leonid Kabanov 2005-07-22 00:21:22 UTC
Created attachment 64035 [details]
patch for coreutils patchset 

This patch enables `su' in coreutils package.
Comment 2 Leonid Kabanov 2005-07-22 00:23:44 UTC
Created attachment 64036 [details, diff]
coreutils ebuild patch

Patch for `coreutils-5.2.1-r6.ebuild' for enabling `pam' support in `su'
Comment 3 Leonid Kabanov 2005-07-22 00:27:56 UTC
I test this patches with and whitout `acl' use flags. Works fine for me. Patches
for shadow package not ready yet. I think I'll make them next week.
Comment 4 Leonid Kabanov 2005-07-22 01:31:03 UTC
Created attachment 64038 [details, diff]
coreutils ebuild patch

More pam staff from shadow ebuild
Comment 5 Leonid Kabanov 2005-07-22 01:34:34 UTC
Created attachment 64039 [details]
pam file for su

pam file for su
Comment 6 Leonid Kabanov 2005-07-22 01:35:06 UTC
Created attachment 64040 [details]
pam file for su (openpam)

pam file for su
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2005-07-26 03:51:49 UTC
How about adding those options to shadow's su rather?  su from coreutils have
really unmainted pam support, and as such I'd rather not us it.
Comment 8 Leonid Kabanov 2005-07-26 19:33:44 UTC
As I know debian has patches for shadow's `su' but I busy for now and cannot
check this. I reply with more details when I have more free time to investigate.
Comment 9 SpanKY gentoo-dev 2005-07-26 20:17:21 UTC
yeah, like az said, we're not interested in using `su` from coreutils ...

debian uses `su` from shadow so if their su supports these options its prob
because they patched them in ...
Comment 10 Leonid Kabanov 2005-08-23 01:10:52 UTC
Debian's `shadow' source package is heavily patched - patch is about 6 MB. This
patch is for 4.0.3 version only for now and I cannot port it to 4.0.7 :( I can
post patch for `su.c' and manpages here if you want to try.
Using `su' from `coreutils' is much more easy - pam support mantained by all
major distros and available for recent version of coreutils. `su' from shadow
maintained by debian/ubuntu only as I know.
Comment 11 Andreas Kobara 2005-08-23 06:02:05 UTC
IMHO: su's (-s /bin/sh -c "...") syntax is needed for almost any commercial
software installer running on Linux. Therefore it would be preferable to have at
least a dummy syntax supporting "-s /bin/sh".

As long as "gentoo's su" lacks this support it'll be hard for gentoo to become a
supported distribution by commercial software companies.
Comment 12 SpanKY gentoo-dev 2005-08-23 06:17:21 UTC
upstream is already looking into adding the GNU su features into shadow
Comment 13 Martin Schlemmer (RETIRED) gentoo-dev 2005-08-24 02:09:49 UTC
Created attachment 66724 [details]
shadow-4.0.11.1-GNU-su.tar.bz2

Well, I did port the patches, and did some formatting/bug addition patches.  I
also did send this upstream, but unlike usual, they have not come back.  I will
do like to note that its still very rough, and that I did try to do it to show
what the Debian patches did.  I however add this for now in case.
Comment 14 SpanKY gentoo-dev 2006-01-13 17:55:22 UTC
upstream shadow has been adding more and more of these features with each release

4.0.14 for example has both "--preserve-environment" and "--login"