Skip to Content.
Sympa Menu

sm-commit - Re: [SM-Commit] GIT changes to devel-shadow grimoire by Thomas Orgis (6161d6d9a4b27fd85b61331ed2e70928fcf7af92)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jeremy Blosser <jblosser-smgl AT firinn.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: Re: [SM-Commit] GIT changes to devel-shadow grimoire by Thomas Orgis (6161d6d9a4b27fd85b61331ed2e70928fcf7af92)
  • Date: Tue, 27 Mar 2007 11:23:18 -0500

On Mar 14, Thomas Orgis [scm AT mail.sourcemage.org] wrote:
> GIT changes to devel-shadow grimoire by Thomas Orgis
> <sobukus AT sourcemage.org>:
>
> security/shadow/CONFIGURE | 13 ++++++++++++-
> security/shadow/DETAILS | 2 +-
> security/shadow/FINAL | 1 +
> security/shadow/HISTORY | 8 ++++++++
> security/shadow/INSTALL | 6 +++++-
> 5 files changed, 27 insertions(+), 3 deletions(-)
>
> New commits:
> commit 091e9ab891d9767bf4118c6d9624dac54a600c86
> Author: Thomas Orgis <sobukus AT sourcemage.org>
> Commit: Thomas Orgis <sobukus AT sourcemage.org>
>
> shadow: restore my changes... move create_group to FINAL since it seems
> to fail in stage root with PAM when in INSTALL,
> not really cleared why, though (PAM only needs pam libs and config
> files, which are available in the castfs...)
>
> commit f373381803a6fa66431445c72ef398c796c0fab9
> Author: Thomas Orgis <sobukus AT sourcemage.org>
> Commit: Thomas Orgis <sobukus AT sourcemage.org>
>
> Revert "Revert "shadow: bug 13505 and general fix for honoring config
> files""
>
> This reverts commit 66851e37ad6744232452f7bb698d364adfe1aaad.
>
> diff --git a/security/shadow/CONFIGURE b/security/shadow/CONFIGURE
> index 7ad9599..ed1bef6 100755
> --- a/security/shadow/CONFIGURE
> +++ b/security/shadow/CONFIGURE
> @@ -29,4 +29,15 @@ interactively" &&
> }
> fi
> # the tools give negative return even after successfully fixing stuff
> -true
> +true &&
> +# Unsure about TRACK_ROOT here
> +local default_home=/home/users &&

Not good, we have to track this if upstream changes it again.

> +local old_home=$(grep '^HOME=' $INSTALL_ROOT/etc/default/useradd
> 2>/dev/null | sed 's/HOME=//') &&
> +if [[ -n "$old_home" ]]; then
> + default_home=$old_home
> +fi &&
> +config_query_string SHADOW_HOME "base directory for user homes:"
> "$default_home" &&

Maybe:
"Base directory for user home directories (null to accept upstream default):"

And it is entirely likely we should only ask the question and/or modify the
config file it this is the first install (if the config file didn't exist
when the cast started). I doubt it's good to modify the config file on a
later upgrade if the admin changed it in the meantime.

(Also not: capitalized query, proper grammer; it makes us look like we know
what we're doing.)

> +if ! [[ -e "$INSTALL_ROOT/$SHADOW_HOME" ]]; then
> + message "$SHADOW_HOME does not seem to exist, it's up to you to take
> care of
> +that..."
> +fi

We may as well ask if they want us to create it:

config_query SHADOW_CREATE_HOME "$SHADOW_HOME does not exist, create it?" n

> --- a/security/shadow/INSTALL
> +++ b/security/shadow/INSTALL
> @@ -1,10 +1,14 @@
> +# make sure that config files won't get overwritten by install
> +echo "install:" > etc/Makefile &&
> +echo "install:" > etc/pam.d/Makefile &&
> make install DESTDIR=$INSTALL_ROOT &&
>
> install_config_file etc/limits $INSTALL_ROOT/etc/limits &&
> install_config_file etc/login.access $INSTALL_ROOT/etc/login.access &&
> install_config_file etc/login.defs $INSTALL_ROOT/etc/login.defs &&
> -
> +sed -i -e 's,^HOME=.*$,HOME='"$SHADOW_HOME"',' -e
> 's,GROUP=1000,GROUP=users,' etc/useradd &&

This is the wrong way to do this; man useradd, look for '-D'. This may
need to go in FINAL too.

Also, I am skeptical we want to change this to a named group instead of the
gid. Upstream uses the gid; we shouldn't change it just because we think
we're smarter than them. Maybe a local admin has renamed his users group
but still expects to use the same gid, or something. It's the admin's job,
not ours.

> mkdir -p $INSTALL_ROOT/etc/default &&
> +install_config_file etc/useradd $INSTALL_ROOT/etc/default/useradd &&
>
> cp -fv $SCRIPT_DIRECTORY/adduser $INSTALL_ROOT/usr/sbin &&
> cp -fv $SCRIPT_DIRECTORY/deluser $INSTALL_ROOT/usr/sbin

Attachment: pgpzvvTNtcSeE.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page