Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 103480 - <=net-dns/ez-ipupdate-3.0.11_beta8-r1 - unable to run as unprivileged user due to /var/run permissions
Summary: <=net-dns/ez-ipupdate-3.0.11_beta8-r1 - unable to run as unprivileged user du...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: STABLEREQ
Depends on:
Blocks:
 
Reported: 2005-08-23 10:59 UTC by Matt Drew (RETIRED)
Modified: 2007-12-17 15:56 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
adds /var/run/ez-ipupdate via ebuild, tweaks init file to compensate (ez-ipupdate-3.0.11_beta8-var_run.patch,539 bytes, patch)
2005-08-23 13:25 UTC, Matt Drew (RETIRED)
Details | Diff
build log (build.log,4.91 KB, text/plain)
2007-11-19 10:11 UTC, Alan Hourihane
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Drew (RETIRED) gentoo-dev 2005-08-23 10:59:07 UTC
ez-ipupdate has a feature where it can run as low-privilege user (username
ez-ipupdate as created by the gentoo ebuild).  This is configured in the
/etc/ez-ipupdate.conf file with the following directive:

[code]
run-as-user=ez-ipupdate
[/code]

However, attempting to use this functionality results in a silent failure due to
the permissions on /var/run (0755 root:root) - the ez-ipupdate user cannot write
the pid file and silently exits (unless run the foreground where one can see the
error).  It does not log this failure to syslog (to my knowledge).  This leaves
the service in the started-but-not-running state that has to be cleared by
zapping the service.

Reproducible: Always
Steps to Reproduce:
1. install ez-ipupdate, configure, and add run-as-user directive to the
/etc/ez-ipupdate.conf
2. attempt to start: /etc/init.d/ezipupdate start
3. Note that startup is "successful", but pid file is not in /var/run

Actual Results:  
service is in started-but-not-running state, ez-ipupdate is not running, pid
file is not written.

Expected Results:  
service starts normally and pid file is written to /var/run
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2005-08-23 11:02:28 UTC
Re-assign, this package needs a maintainer.
Comment 2 Matt Drew (RETIRED) gentoo-dev 2005-08-23 13:25:13 UTC
Created attachment 66684 [details, diff]
adds /var/run/ez-ipupdate via ebuild, tweaks init file to compensate

diff -u patch to the ebuild file to add the /var/run/ez-ipupdate directory,
chown it, modify the init control script, and remove it on uninstall.  Used
diff-u because the other patch currently in portage also uses that format.
Comment 3 Matt Drew (RETIRED) gentoo-dev 2005-08-23 13:45:32 UTC
while patching probably need to update the HOMEPAGE and SRC_URI as well:

http://ez-ipupdate.com
http://ez-ipupdate.com/dist/${PN}-${MY_PV}.tar.gz
Comment 4 Alec Warner (RETIRED) archtester gentoo-dev Security 2007-01-17 21:14:14 UTC
Er, according to the einfo...

        einfo "Please do not use the 'run-as-user', 'run-as-euser',"
        einfo "'cache-file' and 'pidfile' options, since these are"
        einfo "handled internally by the init-script!"

Does this not occur?

The initscripts look like they are correct in this behavior.
Comment 5 Matt Drew (RETIRED) gentoo-dev 2007-01-18 12:48:20 UTC
I didn't see the einfo warning.  The stable ebuild (beta8-r1) init script handles the problem by running as root - BUT you're right, the ~x86 ebuild fixes the init script.  Should I close this when that build gets stabilized?

Hmm, would this actually qualify as a security issue?  The daemon probably shouldn't be running as root.
Comment 6 Alec Warner (RETIRED) archtester gentoo-dev Security 2007-01-19 04:01:29 UTC
(In reply to comment #5)
> I didn't see the einfo warning.  The stable ebuild (beta8-r1) init script
> handles the problem by running as root - BUT you're right, the ~x86 ebuild
> fixes the init script.  Should I close this when that build gets stabilized?
> 
> Hmm, would this actually qualify as a security issue?  The daemon probably
> shouldn't be running as root.
> 

offhand no; nothing prevents you from running apache as root (other than the fact that it doesn't come that way by default).  However if you are concerned feel free to CC security@gentoo.org to this bug.
Comment 7 Goran Mekić 2007-05-05 01:35:22 UTC
Works on x86-fbsd without "run-as-user" option
Comment 8 Jakub Moc (RETIRED) gentoo-dev 2007-10-04 23:12:28 UTC
arches, please stabilize 3.0.11_beta8-r4 so that we can finally close this...
Comment 9 Ferris McCormick (RETIRED) gentoo-dev 2007-10-05 11:35:45 UTC
Sparc done.
Comment 10 Christian Faulhammer (RETIRED) gentoo-dev 2007-10-05 13:33:36 UTC
x86 stable
Comment 11 Tobias Scherbaum (RETIRED) gentoo-dev 2007-10-06 19:30:24 UTC
ppc stable
Comment 12 Stefan Briesenick (RETIRED) gentoo-dev 2007-10-07 16:44:55 UTC
@amd64 herd: please stabilize, because I want to remove *-r1 asap. thanks!
Comment 13 Alan Hourihane 2007-10-12 21:40:43 UTC
It's having a problem executing "missing" with this one....

make[1]: Entering directory `/var/tmp/portage/net-dns/ez-ipupdate-3.0.11_beta8-r4/work/ez-ipupdate-3.0.11b8'
cd . && /var/tmp/portage/net-dns/ez-ipupdate-3.0.11_beta8-r4/work/ez-ipupdate-3.0.11b8/missing aclocal-1.4
/bin/sh: /var/tmp/portage/net-dns/ez-ipupdate-3.0.11_beta8-r4/work/ez-ipupdate-3.0.11b8/missing: Permission denied
make[1]: *** [aclocal.m4] Error 126
make[1]: Leaving directory `/var/tmp/portage/net-dns/ez-ipupdate-3.0.11_beta8-r4/work/ez-ipupdate-3.0.11b8'
 * 
 * ERROR: net-dns/ez-ipupdate-3.0.11_beta8-r4 failed.
 * Call stack:
 *   ebuild.sh, line 1654:   Called dyn_compile
 *   ebuild.sh, line 990:   Called qa_call 'src_compile'
 *   ebuild.sh, line 44:   Called src_compile
 *   ez-ipupdate-3.0.11_beta8-r4.ebuild, line 37:   Called die
 * 
 * emake failed
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-dns/ez-ipupdate-3.0.11_beta8-r4/temp/build.log'.
 * 

 * Messages for package net-dns/ez-ipupdate-3.0.11_beta8-r4:

 * 
 * ERROR: net-dns/ez-ipupdate-3.0.11_beta8-r4 failed.
 * Call stack:
 *   ebuild.sh, line 1654:   Called dyn_compile
 *   ebuild.sh, line 990:   Called qa_call 'src_compile'
 *   ebuild.sh, line 44:   Called src_compile
 *   ez-ipupdate-3.0.11_beta8-r4.ebuild, line 37:   Called die
 * 
 * emake failed
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-dns/ez-ipupdate-3.0.11_beta8-r4/temp/build.log'.
 * 
make: *** [/usr/src/log/net-dns/ez-ipupdate] Error 1
Comment 14 Alan Hourihane 2007-10-12 21:42:15 UTC
Looking at the permissions of missing and it doesn't have execute permissions.
Comment 15 Stefan Briesenick (RETIRED) gentoo-dev 2007-10-13 09:31:11 UTC
huh? It works here. But perhaps the autoconf/automake stuff is quite too old, so I should play around with eautoreconf...

stay tuned!
Comment 16 Stefan Briesenick (RETIRED) gentoo-dev 2007-11-17 23:57:35 UTC
@Alan Hourihane: can you please post your "emerge --info"?
Comment 17 Alan Hourihane 2007-11-18 20:55:34 UTC
Portage 2.1.3.9 (selinux/2007.0/x86/hardened, gcc-4.1.1, glibc-2.5-r4, 2.6.22-gentoo-r9 i686)
=================================================================
System uname: 2.6.22-gentoo-r9 i686 Intel(R) Pentium(R) M processor 1.86GHz
Timestamp of tree: Fri, 12 Oct 2007 16:30:01 +0000
distcc 2.18.3 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [enabled]
ccache version 2.4 [enabled]
app-shells/bash:     3.2_p17
dev-lang/python:     2.4.4-r5
dev-python/pycrypto: 2.0.1-r6
dev-util/ccache:     2.4-r7
sys-apps/baselayout: 1.12.9-r2
sys-apps/sandbox:    1.2.17
sys-devel/autoconf:  2.61-r1
sys-devel/automake:  1.10
sys-devel/binutils:  2.17-r1
sys-devel/gcc-config: 1.4.0-r4
sys-devel/libtool:   1.5.24
virtual/os-headers:  2.6.22-r2
ACCEPT_KEYWORDS="x86"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-Os -fomit-frame-pointer -march=i486 -mtune=pentium -pipe -fforce-addr"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-Os -fomit-frame-pointer -march=i486 -mtune=pentium -pipe -fforce-addr"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache distcc distlocks loadpolicy metadata-transfer sandbox selinux sesandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --filter=H_**/files/digest-*"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="activefilter adsl apache2 atm berkdb bitmap-fonts cli cracklib crypt cups dhcp dri eap-tls fortran gdbm gpm hardened iconv ipppd ipv6 isdnlog ldap midi minimal mpm-prefork mppe-mppc mschap mudflap ncurses netboot nls nptl nptlonly openmp pam pcre perl pic pppd python radius readline reflection selinux session spl ssl tcpd truetype-fonts type1-fonts unicode usb x86 xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mulaw multi null plug rate route share shm softvol" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="apm ark chips cirrus cyrix dummy fbdev glint i128 i740 i810 imstt mach64 mga neomagic nsc nv r128 radeon rendition s3 s3virge savage siliconmotion sis sisusb tdfx tga trident tseng v4l vesa vga via vmware voodoo"
Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, LDFLAGS, LINGUAS, MAKEOPTS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 18 Stefan Briesenick (RETIRED) gentoo-dev 2007-11-19 00:19:20 UTC
hmm, that is strange. On all my systems, it just works. I can not reproduce it. That 'missing' part isn't executed at all.

can you please post the /var/tmp/portage/net-dns/ez-ipupdate-3.0.11_beta8-r4/temp/build.log

thanks!
Comment 19 Alan Hourihane 2007-11-19 10:11:34 UTC
Created attachment 136356 [details]
build log

Here's the complete build log
Comment 20 Alan Hourihane 2007-11-19 20:14:28 UTC
O.k.

The problem is this line....

am__api_version="1.4"
 
in the configure script. Because my installed copy of aclocal is 1.10 which translate to aclocal-1.10 and the configure script in this package expects aclocal-1.4.

So it runs the missing script to re-configure itself.

The easy fix is to chmod +x missing in the ebuild.
Comment 21 Stefan Briesenick (RETIRED) gentoo-dev 2007-11-19 21:53:55 UTC
if this works, then I add the chmod in src_unpack().
Comment 22 Alan Hourihane 2007-11-20 11:03:41 UTC
Yes, it does work. Please add chmod +x missing to the src_unpack script.
Comment 23 Alan Hourihane 2007-12-02 23:32:48 UTC
Is there any chance that this extra chmod will get added ?
Comment 24 Stefan Briesenick (RETIRED) gentoo-dev 2007-12-03 09:04:39 UTC
there is, if I can't find a better solution. But the chmod hack is ugly. Please gimme 2 further days, ok?
Comment 25 Alan Hourihane 2007-12-03 09:24:18 UTC
Well, the missing file should be executable anyway, so I don't think it is a hack.

The fact is that configure will try to execute missing to sort things out.
Comment 26 Stefan Briesenick (RETIRED) gentoo-dev 2007-12-09 23:06:03 UTC
ok, fixed within -r4.
Comment 27 Alan Hourihane 2007-12-17 14:35:03 UTC
thanks. this can be closed now.