Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 592176 - user.eclass: enewuser(): Broken detection of 1 unsupported extra argument
Summary: user.eclass: enewuser(): Broken detection of 1 unsupported extra argument
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All All
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-26 09:43 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2016-08-31 11:59 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis 2016-08-26 09:43:50 UTC
enewuser() contains:

	# handle groups
	local egroups=$1; shift
	local g egroups_arr
	IFS="," read -r -a egroups_arr <<<"${egroups}"
➜	shift
	if [[ ${#egroups_arr[@]} -gt 0 ]] ; then
	...
	fi
	einfo " - Groups: ${egroups:-(none)}"

	# handle extra args
	if [[ $# -gt 0 ]] ; then
		die "extra arguments no longer supported; please file a bug"
	else


If only 1 (insteaf of e.g. 2) unsupported extra argument is passed, then above call to die() is not triggered due to unnecessary call to 'shift' indicated above.
Comment 1 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2016-08-29 08:53:05 UTC
commit 02698677b5ebb43cdb82e580e47eb4d98725caae
Author: Lars Wendler <polynomial-c@gentoo.org>
Date:   Mon Aug 29 10:49:22 2016

    user.eclass: Removed superfluous "shift" call (bug #592176).