[Pkg-mailman-hackers] [bsb@debian.org: Bug#186642: Must blame mailman preinst]

Siggy Brentrup bsb@debian.org
Thu, 25 Mar 2004 21:00:02 +0100


--wTWi5aaYRw9ix9vO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello Co-Maintainers,

this is an ancient bug no one was able to reproduce. IMO the bogus
code might be from a ancient version (suidmanager comes to mind).

Please read and comment on my suggestions below.  A third method not
mentioned there might be asserting ugid 38 in the config script
refusing to go any further when the condition is not met with a
critical debconf note holding an additional OK flag.  I still have to
check if debconf supports this idea.

Opinions, suggestions?
=2E Siggy


----- Forwarded message from Siggy Brentrup <bsb@debian.org> -----

Subject: Bug#186642: Must blame mailman preinst
Reply-To: Siggy Brentrup <bsb@debian.org>, 186642@bugs.debian.org
Date: Thu, 25 Mar 2004 17:31:32 +0100
=46rom: Siggy Brentrup <bsb@debian.org>
To: 186642@bugs.debian.org, control@bugs.debian.org

package mailman
severity 186642 serious
thanks

Hi,

I can't believe I have to do this, but when looking
into mailman's preinst again I notices this piece
of code:

if [ "$1" =3D "install" ]; then
	if ! id -g list > /dev/null 2>&1 ; then
		addgroup list
	fi
	if ! id -u list > /dev/null 2>&1 ; then
		adduser --system --home /var/list --ingroup list list
		chsh -s /bin/sh list
	fi
fi

Assuming the system admin has removed 'list' user and/or group,
this will happily add them again with id !=3D 38 causing the
errors observed by the bug submitter.

I'm not yet decided how to handle this case. If we continue
to use this code (after adding --system on addgroup), file
ownership must be adjusted in the postinst.

Alternatively we can recreate list.list with uid/gid 38
like this, bailing out when the situation requires admin
interaction.


# Make sure group list with gid 38 exists.
list_gid=3D"$(id -g list 2>/dev/null)"
case "$list_gid" in
  38) ;;
  ) # Group list doesn't exist
    if ! addgroup --system --gid 38 list ; then
      echo "Can't create group list with gid 38, bailing out."
      exit 1
    fi
    ;;
  *) # Group list exists with gid !=3D 38
    cat >&2 <<EOF
Group list has gid ${list_gid} instead of 38
as required by Debian policy. Please fix this
situation before retrying to install mailman.
EOF
    read junk </dev/tty
    exit 1
    ;;
esac

=2E.. same for user list ...


Opinions?
=2E Siggy



----- End forwarded message -----

--wTWi5aaYRw9ix9vO
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAYzpC94B/SGO8KQcRAvPvAJ4kSF4MmUp8e+93QkFoUJ7wZ5ot0wCgqjNG
0SBOOjX6KziwNrc8jFSId8o=
=/WOf
-----END PGP SIGNATURE-----

--wTWi5aaYRw9ix9vO--