Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: Ian Stakenvicius <axs@g.o>
Subject: RFC: enewuser should force updates to shell and home
Date: Wed, 13 Jun 2012 12:00:16 -0400
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hey all - I'd like to propose that enewuser forces updates to a user's
home dir and shell whenever it is called, so that if this changes with
new versions of an ebuild it is dealt with automatically rather than
having to modify them in pkg_postinst/pkg_setup directly.

Here's my proposed patch to user.eclass -- please note that I can't
conform the syntax for the darwin ('dscl') calls as I don't have
access and my googling did not provide an exact-match in terms of
usage.  The rest i'm highly confident will work based on the manpages
I was able to find.  If anyone has these platforms and can test/update
the calls, I would appreciate it.


- --- user.eclass 2011-12-19 14:38:34.000000000 -0500
+++ user.eclass.forcehomedir    2012-06-13 11:54:26.000000000 -0400
@@ -230,24 +230,39 @@
                for g in "${egroups_arr[@]}" ; do
                        dscl . merge "/groups/${g}" users "${euser}"
                done
+               ### force updates of some user properties
+               dscl . change "/users/${euser}" home "${ehome}"
+               dscl . change "/users/${euser}" shell "${eshell}"
                ;;

        *-freebsd*|*-dragonfly*)
                pw useradd "${euser}" "${opts[@]}" || die
+               ### force updates of some user properties
+               pw usermod "${euser}" -d "${ehome}" || die
+               pw usermod "${euser}" -s "${eshell}" || die
                ;;

        *-netbsd*)
                useradd "${opts[@]}" "${euser}" || die
+               ### force updates of some user properties
+               usermod -d "${ehome}" "${euser}" || die
+               usermod -s "${eshell}" "${euser}" || die
                ;;

        *-openbsd*)
                # all ops the same, except the -g vs -g/-G ...
                useradd -u ${euid} -s "${eshell}" \
                        -d "${ehome}" -g "${egroups}" "${euser}" || die
+               ### force updates of some user properties
+               usermod -d "${ehome}" "${euser}" || die
+               usermod -s "${eshell}" "${euser}" || die
                ;;

        *)
                useradd -r "${opts[@]}" "${euser}" || die
+               ### force updates of some user properties
+               usermod -d "${ehome}" "${euser}" || die
+               usermod -s "${eshell}" "${euser}" || die
                ;;
        esac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (GNU/Linux)

iF4EAREIAAYFAk/YuRAACgkQ2ugaI38ACPCCxgD/TUhHRThNOHOGoR04CwRwx+Nt
oEJy0MdknD0KDm/uT5oA/AiYZ9fDthJEmPyOgFra+BnWqLCkexvqz+K5SaoS1Pyw
=+xJb
-----END PGP SIGNATURE-----


Replies:
Re: RFC: enewuser should force updates to shell and home
-- Mike Gilbert
Re: RFC: enewuser should force updates to shell and home
-- Fabian Groffen
Re: RFC: enewuser should force updates to shell and home
-- Michał Górny
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
ebuild laziness and binpkg overhead
Next by thread:
Re: RFC: enewuser should force updates to shell and home
Previous by date:
Re: remote-id cpan-module
Next by date:
Re: Repoman check before file stable request


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.