Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 271081 - enewuser fails; argument order to adduser is wrong; patch attached.
Summary: enewuser fails; argument order to adduser is wrong; patch attached.
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Solaris
: High major (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-24 15:56 UTC by Wicher Minnaard
Modified: 2009-10-18 07:52 UTC (History)
1 user (show)

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


Attachments
Patch to usr/portage/eclass/eutils.class (eutils.eclass.patch,446 bytes, patch)
2009-05-24 15:58 UTC, Wicher Minnaard
Details | Diff
Testcase for enewuser (test_enewuser-2.ebuild,264 bytes, text/plain)
2009-05-24 16:00 UTC, Wicher Minnaard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wicher Minnaard 2009-05-24 15:56:35 UTC
enewuser in eutils.eclass doesn't call adduser with the LOGIN argument placed last. Instead, it places extra arguments ('-c some_comment' , for instance) last. This is not what useradd (in this case: useradd from SunOS 5.10) expects.
By default it adds the comment "added by portage for $pkgname", so all ebuilds using enewuser fail.
All variants of 'adduser' that I've ever encountered need LOGIN as a last arg when creating new users, so based on that assumption I've made a patch to eutils.class (attached). Tested with test_enewuser-2.ebuild (attached).

Reproducible: Always

Steps to Reproduce:
1. Emerge test_enewuser-2.ebuild or any other ebuild using enewuser

Actual Results:  
Emerge fails. Log shows:
UX: /usr/sbin/useradd: ERROR: invalid syntax.

So the user is not added to the system.

Expected Results:  
User should've been added to the system.

Portage 2.2.00.13625-prefix (prefix/sunos/solaris/5.10/x86, gcc-4.3.2, unavailable, 5.10 i86pc)
=================================================================
System uname: Solaris-2.10-i86pc-i386-32bit-ELF
Timestamp of tree: Sun, 24 May 2009 15:13:16 +0000
app-shells/bash:     4.0_p24
dev-lang/python:     2.6.2
sys-devel/autoconf:  2.63-r01.1
sys-devel/automake:  1.9.6-r2, 1.10.2-r00.1
sys-devel/binutils:  2.19.1-r01.1
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:   2.2.6a
ACCEPT_KEYWORDS="~x86-solaris"
CBUILD="i386-pc-solaris2.10"
CFLAGS="-O2 -pipe -m32 -march=native"
CHOST="i386-pc-solaris2.10"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -m32 -march=native"
DISTDIR="/gentaris/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going"
EPREFIX="/gentaris"
FEATURES="assume-digests collision-protect distlocks fixpackages nodoc nostrip parallel-fetch preserve-libs protect-owned sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://distro.ibiblio.org/pub/linux/distributions/gentoo"
LDFLAGS=""
MAKEOPTS="-j4"
PKGDIR="/gentaris/usr/portage/packages"
PORTAGE_CONFIGROOT="/gentaris/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/gentaris/var/tmp"
PORTDIR="/gentaris/usr/portage"
PORTDIR_OVERLAY="/gentaris/usr/local/portage"
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="bash-completion bzip2 cracklib crypt dirac encode faac faad fontconfig gmp gnutls gsm iconv jpeg midi mp3 mysqli ncurses ogg png postgres prefix readline speex sqlite ssl suexec theora tiff truetype unicode vorbis x264 x86-solaris xvid zlib" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy proxy_connect proxy_ftp proxy_http" APACHE2_MPMS="prefork" ELIBC="SunOS" INPUT_DEVICES="keyboard mouse" KERNEL="SunOS" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU"
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Wicher Minnaard 2009-05-24 15:58:42 UTC
Created attachment 192311 [details, diff]
Patch to usr/portage/eclass/eutils.class
Comment 2 Wicher Minnaard 2009-05-24 16:00:07 UTC
Created attachment 192313 [details]
Testcase for enewuser
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2009-06-05 21:23:11 UTC
(In reply to comment #1)
> Created an attachment (id=192311) [edit]
> Patch to usr/portage/eclass/eutils.class
> 

Would you mind adding a proper case for solaris? Match on *-solaris*
Comment 4 Wicher Minnaard 2009-06-05 21:45:19 UTC
I would ;-)
I thought about that, but the thing that stopped me from doing exactly that is that I've never seen an 'adduser' that tolerates arguments after the 'login' argument. Therefore, the fallback case in eutils.class looked wrong to me, so I patched that.

Do you know of any 'adduser' programs on niche Unixoids that *do take* arguments _after_ the 'login' argument? That would change things.
Comment 5 velociraptor 2009-10-18 07:05:50 UTC
This problem is still exists as of 10/18/2009.  Solaris expects "useradd" to end with the login name.  I'm not aware of any "unix-oid" OS that allows anything to follow the login name.
Comment 6 Fabian Groffen gentoo-dev 2009-10-18 07:07:28 UTC
hmmm, that patch actually looks pretty trivial...
Comment 7 Fabian Groffen gentoo-dev 2009-10-18 07:34:30 UTC
@base-system: would you prefer a new case for *-solaris*, or is moving the ${euser} to the end (as last argument) also acceptable?
Comment 8 SpanKY gentoo-dev 2009-10-18 07:47:59 UTC
moving $euser to the end is fine.  the proposed patch here has incorrect indentation though, so make sure you dont commit that :p.
Comment 9 Fabian Groffen gentoo-dev 2009-10-18 07:52:52 UTC
That patch is probably on an outdated version of eutils.eclass, but the idea is the same.

I committed the change, thanks and sorry for the long wait.