• Bug#679751: Lintian now detect package pointing to /home

    From Michael Biebl@21:1/5 to guillem@debian.org on Mon Sep 18 03:30:01 2017
    XPost: linux.debian.bugs.dist
    To: guillem@debian.org (Guillem Jover)

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SLaIJodomsgwtbUb7vft1e11CokHqxluK
    Content-Type: text/plain; charset=utf-8
    Content-Language: en-US
    Content-Transfer-Encoding: quoted-printable

    On Fri, 31 Jul 2015 13:16:24 +0200 Guillem Jover <guillem@debian.org> wrote:
    Hi!

    On Fri, 2015-07-31 at 11:34:20 +0200, Bastien ROUCARIES wrote:
    On Fri, Jul 31, 2015 at 11:04 AM, Bastien ROUCARIES wrote:
    Lintian now detect script creating user pointing to /home.

    After a chat under #debian-qa it appear that canonical path for non existant home dir is /nonexistant could be documented ?

    Moreover how can a developper could correct a mistake in previous
    package ? Rip the /home directory correct hte passd file ?

    To fix a wrong home path you can do something like:

    ,---
    # Fix the home directory name created by an old package.
    u_home=$(getent passwd USERNAME | cut -d: -f6)
    if [ "$u_home" = "OLDHOME" ] ; then
    usermod --home NEWHOME USERNAME >/dev/null || true
    fi
    `---


    It's not as simple as that. You might still have running processes with
    that uid in which case usermod complains and exists.
    So to successfully run usermod you'd have to kill a processes running
    under that uid.

    --
    Why is it that all of the instruments seeking intelligent life in the
    universe are pointed away from Earth?


    --SLaIJodomsgwtbUb7vft1e11CokHqxluK--

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEECbOsLssWnJBDRcxUauHfDWCPItwFAlm/ELsACgkQauHfDWCP ItzOrQ/+NG73X12Jk4ZMEL+m4oGn7Dslw3ZYoX1uhZpIVnAhWknAjTHt5XjQBlI5 mmSmZPxyFYYexO/EihHFquzrGsJ2UYrP/WuqtguAoddE8N3WN0Xc4pU6etvZD7qK lKdlLnQhWDmswStYIeaUbNDrHAuVsBDtvQ8JmKTsF6EWr/KlMWmnLYhUV8qwsROx 9cNgeT5jnfM+gtiMI+32M4OZCxjRtfknMnhS/dgBfnKHGz4ps/3m5YAX29p0aXEe CsD8oos+VqDD8EpQqfsgm0cD/1Oo78G/mkWwSk3tbb6WBqa+p/wm/AmH3O5FIZHY tYn/aZy2MJlzz8gmLpWdORDENZhz7vVjx65IA+GzPEjswCttbpnZeiDtktj1DbhZ 0GlXtyEH8x68gqdYKQxiGe/t5eNfJTls2wytPDZezjuTyj+IvBCXNxl2eOwA0dio YZdW/QXd8lyznqEn1cNThL2PUOYWJuh6bPSV1ojBMMjJXm197ptv73TSWbtuhB3X pZvUDhXDCptTZx12HZ17wGifzk62VOOpDPYCugO02xkkPUyXoMtmvSgnnBuZDdnP lVDcBj8szBs4JPuyzn1q3O3i3EW7XPYgPuCw/zmcbrt+eTyYdMjElMSE/+jexJS4 VHQI0flnkktW/e/Hpz0wYwjURkbT93HBV3Ip4QDauDMzQ+iS/QM=
    =8jer
    -----END PGP SIGNATURE-----

    --- SoupGate-
  • From Michael Biebl@21:1/5 to All on Mon Sep 18 03:40:01 2017
    XPost: linux.debian.bugs.dist
    To: guillem@debian.org (Guillem Jover)
    Copy: jcristau@debian.org (Julien Cristau)

    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6SdIGNm85ngt8aVu1Xrc0LkptOLR9T4TA
    Content-Type: text/plain; charset=utf-8
    Content-Language: en-US
    Content-Transfer-Encoding: quoted-printable

    Am 18.09.2017 um 02:18 schrieb Michael Biebl:
    It's not as simple as that. You might still have running processes with
    that uid in which case usermod complains and exists.
    So to successfully run usermod you'd have to kill a processes running
    under that uid.

    Fwiw, I ran into this issue when an upstream of mine switched runtimedir
    from /var/run to /run and my postinst so far has created a system user
    with --home /var/run/foo which I now wanted to change to --home /run/foo.
    As the package starts a (socket activated) daemon, this needs some
    dedicated code to disable socket activation, then stop the daemon, then
    change the home directory via usermod, then re-enable socket activation.

    Or I just don't try to anticipate all possible corner cases and simply
    use the new home directory only on new installations.

    Not sure what's better.


    --
    Why is it that all of the instruments seeking intelligent life in the
    universe are pointed away from Earth?


    --6SdIGNm85ngt8aVu1Xrc0LkptOLR9T4TA--

    -----BEGIN PGP SIGNATURE-----

    iQIzBAEBCAAdFiEECbOsLssWnJBDRcxUauHfDWCPItwFAlm/FDoACgkQauHfDWCP ItyHTg/8DXRuEUuor/r3i5ag06dp0rT2a85KZojrW23MYjW4l+H0MqFxDIz7S/5O 8tNm2Q8kHUccrYJ5BxVNU+L4d1Mw68slzkpYD/8VMUCGtF43IH1ZmH6OS72N9/ic yzE0RjicS5kycwDSn5gjRU83tH42qAd+TfLQskvddE7Y9Hnj8i40KIDUoR2Bsh1i 9TIKRprhM0yhh3YEQfZpu8w/EeWQb+iek7VoJC8+R/6XLX/kFsPP4jiy6RjYqite R+llYmrSFi0tycrSBWRPpeK1GKa5caGEsWm+URXQD06rTu+9Hs9AE3mXY/E4a7Kl gP3IQvYO1MDxbko+UWNdfDwgMjqsG0XhrC7jy8S+1PrtV64k5l7vJn/HNK42EjiE ml2A2w3a+eqSJHlDJTtLk/17FYN0mbrMqGObmJ3yruEJpNmxLt8WS7CjmK2qcAiu IueF7Qf2poAl550Gvu646KR76Mex72XYQaJenpDZcPQS44Zq3sTkDNG39ZVsq+AC 6cwV17n0XZVyChUIpc/4Rken9tVI9gAvCVdSAqPD2wOTRsKcHUzzY7vVIU4edAFQ mOYvNvtu4zSl14SLuKkwhs4El1A5QJ94pQab7cYphImVhmy/cQsFjl/Zmaf8QELZ M2vUzzkNvDu0w+QAbjjdNgC6BJZfJSoq5HxmUVHkOkD2Frvf9r0=
    =IzMl
    -----END PGP SIGNATURE-----

    --- SoupGate-