Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 532588

Summary: mail-mta/nullmailer-1.13-r4 pkg_postinst calls chmod/chown without referencing ROOT
Product: Gentoo Linux Reporter: Dennis Schridde <dschridde+gentoobugs>
Component: [OLD] ServerAssignee: Robin Johnson <robbat2>
Status: RESOLVED FIXED    
Severity: normal CC: jlec, net-mail+disabled
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 532622    
Bug Blocks:    

Description Dennis Schridde 2014-12-14 20:47:16 UTC
These are bound to fail if ROOT is set:
        # This contains passwords, so should be secure
        fperms 0640 /etc/nullmailer/remotes
        fowners root:nullmail /etc/nullmailer/remotes

>>> Installing (27 of 37) mail-mta/nullmailer-1.13-r4::gentoo to /var/lxc/ns/
 * >>> SetUID: [chmod go-r] /usr/bin/mailq ...                                                                                                                                                                                          [ ok ]
 * >>> SetUID: [chmod go-r] /usr/sbin/nullmailer-queue ...                                                                                                                                                                              [ ok ]
chmod: cannot access '/etc/nullmailer/remotes': No such file or directory
 * ERROR: mail-mta/nullmailer-1.13-r4::gentoo failed (postinst phase):
 *   (no error message)
 * 
 * Call stack:
 *     ebuild.sh, line  93:  Called pkg_postinst
 *   environment, line 3238:  Called die
 * The specific snippet of code:
 *       chmod 0640 /etc/nullmailer/remotes || die;
 * 
 * If you need support, post the output of `emerge --info '=mail-mta/nullmailer-1.13-r4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=mail-mta/nullmailer-1.13-r4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/mail-mta/nullmailer-1.13-r4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/mail-mta/nullmailer-1.13-r4/temp/environment'.
 * Working directory: '/usr/lib64/python3.3/site-packages'
 * S: '/var/tmp/portage/mail-mta/nullmailer-1.13-r4/work/nullmailer-1.13'
!!! FAILED postinst: 1


Reproducible: Always
Comment 1 Mike Gilbert gentoo-dev 2014-12-15 00:35:01 UTC
The problem is not with the fperms/fowners calls. These implicitly prepend ${ED} to their arguments.

Rather, the problem is the chmod/chown calls in pkg_postinst.
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2014-12-15 07:56:27 UTC
+*nullmailer-1.13-r5 (15 Dec 2014)
+
+  15 Dec 2014; Justin Lecher <jlec@gentoo.org> +nullmailer-1.13-r5.ebuild:
+  Drop einstall in favour of plain emake, #521552; prepend chmod/chown calls in
+  pkg_* with ROOT, #532588
+
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2015-01-05 12:47:02 UTC
+  05 Jan 2015; Justin Lecher <jlec@gentoo.org> -nullmailer-1.13-r4.ebuild:
+  Drop old, obsoletes #521552 & #532588
+