The openssh ebuild needs to add the sshd user/group in postinst, not pkg_setup, because otherwise the .tbz2 is utterly useless. Additionally, this is the proper place for it to be. Thanks! --- openssh-3.3_p1.ebuild 2002-06-22 20:35:06.000000000 -0500 +++ openssh-3.3_p1-r1.ebuild 2002-06-25 18:54:35.000000000 -0500 @@ -27,17 +27,6 @@ LICENSE="as-is" SLOT="0" -pkg_setup() { - if ! groupmod sshd; then - groupadd -g 90 sshd || die "problem adding group sshd" - fi - - if ! id sshd; then - useradd -g sshd -s /dev/null -d /var/empty -c "sshd" sshd - assert "problem adding user sshd" - fi -} - src_compile() { local myconf use tcpd || myconf="${myconf} --without-tcp-wrappers" @@ -74,6 +63,15 @@ } pkg_postinst() { + if ! groupmod sshd; then + groupadd -g 90 sshd || die "problem adding group sshd" + fi + + if ! id sshd; then + useradd -g sshd -s /dev/null -d /var/empty -c "sshd" sshd + assert "problem adding user sshd" + fi + # empty dir for the new priv separation auth chroot.. install -d -m0755 -o root -g root ${ROOT}/var/empty
so, any ebuild doing user addition stuff in pkg_setup() is broken by definition? i think postfix is using a similar thingy; in its case it *needs* to come before src_install because certain files needs to be chown'ed to the newly created group for postfix. so cant portage and .tbz2's work properly with pkg_setup doing user addition stuff? hit me with the cl00bie stick if need be.
Yes. Is any action going to be taken on this?
pkg_setup needs to be fixed so that it also works for tbz2 packages too... since woodchip points out that sometimes we need these accounts to exist *before* src_install. pkg_setup() was added by Bevin and he didn't touch every area of the code that he needed to. But easy enough to fix -- I can tweak portage so that tbz2 installs call pkg_setup, then pkg_preinst, then merge, then pkg_postinst. That appears to be the "right thing to do" in this case. OK, I fixed portage.py to call pkg_setup() on packages. The order that everything is done for .tbz2s is as follows: 1) extract info (and ebuild) from tbz2 2) run pkg_setup(), abort if problems 3) extract files from tbz2 4) run pkg_preinst() 5) merge files 6) run pkg_postinst() This fix will be in Portage 2.0.10+; I'm going to attach my working copy of portage.py to this bug so that you can test it to verify that this issue is resolved.
Created attachment 1923 [details] portage.py pre-2.0.10 portage.py with tbz2 fixes
OK, jnelson has convinced me that using pkg_setup() for adding users is broken. If your compile process requires user accounts to be added, then your compile process is broken and you should look into patching makefiles. pkg_setup() should only be used for checking things, configuring environment variables, etc -- it should make no lasting changes to the underlying system.