Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Oct 2000 17:43:19 -0700 (PDT)
From:      Doug Barton <DougB@gorean.org>
To:        Warner Losh <imp@village.org>
Cc:        Gianmarco Giovannelli <gmarco@giovannelli.it>, stable@FreeBSD.ORG
Subject:   Re: username with - 
Message-ID:  <Pine.BSF.4.21.0010091741150.84731-200000@dt051n37.san.rr.com>
In-Reply-To: <200010091802.MAA13347@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

--0-89123106-971138599=:84731
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Mon, 9 Oct 2000, Warner Losh wrote:

> In message <5.0.0.25.0.20001009083602.02993e90@194.184.65.4> Gianmarco Giovannelli writes:
> : Let's remove the check from rmuser : if a user is in the user db, rmuser 
> : must know how to wipe it from there :-)
> 
> Index: rmuser.perl
> ===================================================================
> RCS file: /home/imp/FreeBSD/CVS/src/usr.sbin/adduser/rmuser.perl,v
> retrieving revision 1.10
> diff -u -r1.10 rmuser.perl
> --- rmuser.perl	2000/03/14 14:27:34	1.10
> +++ rmuser.perl	2000/10/09 18:00:58
> @@ -107,8 +107,8 @@
>  if ($#ARGV == 0) {
>      # Username was given as a parameter
>      $login_name = pop(@ARGV);
> -    die "Sorry, login name must contain alphanumeric characters only.\n"
> -	if ($login_name !~ /^[a-zA-Z0-9_]\w*$/);
> +    die "Sorry, login name must not contain colons (:).\n"
> +	if ($login_name =~ /:/);
>  } else {
>      if ($affirm) {
>  	print STDERR "${whoami}: Error: -y option given without username!\n";
> 
> Nuff said?

	Actually the attached patch is more what I had in mind. If you
would rather go with your version, make sure to hit get_login_name() as
well. 

Doug
-- 
        "The dead cannot be seduced."
		- Kai, "Lexx"

	Do YOU Yahoo!?


--0-89123106-971138599=:84731
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rmuser.diff"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.BSF.4.21.0010091743190.84731@dt051n37.san.rr.com>
Content-Description: 
Content-Disposition: attachment; filename="rmuser.diff"

SW5kZXg6IHJtdXNlci5wZXJsDQo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQpS
Q1MgZmlsZTogL3Vzci9uY3ZzL3NyYy91c3Iuc2Jpbi9hZGR1c2VyL3JtdXNl
ci5wZXJsLHYNCnJldHJpZXZpbmcgcmV2aXNpb24gMS4xMA0KZGlmZiAtdSAt
cjEuMTAgcm11c2VyLnBlcmwNCi0tLSBybXVzZXIucGVybAkyMDAwLzAzLzE0
IDE0OjI3OjM0CTEuMTANCisrKyBybXVzZXIucGVybAkyMDAwLzEwLzEwIDAw
OjM4OjAzDQpAQCAtMTA3LDggKzEwNyw2IEBADQogaWYgKCQjQVJHViA9PSAw
KSB7DQogICAgICMgVXNlcm5hbWUgd2FzIGdpdmVuIGFzIGEgcGFyYW1ldGVy
DQogICAgICRsb2dpbl9uYW1lID0gcG9wKEBBUkdWKTsNCi0gICAgZGllICJT
b3JyeSwgbG9naW4gbmFtZSBtdXN0IGNvbnRhaW4gYWxwaGFudW1lcmljIGNo
YXJhY3RlcnMgb25seS5cbiINCi0JaWYgKCRsb2dpbl9uYW1lICF+IC9eW2Et
ekEtWjAtOV9dXHcqJC8pOw0KIH0gZWxzZSB7DQogICAgIGlmICgkYWZmaXJt
KSB7DQogCXByaW50IFNUREVSUiAiJHt3aG9hbWl9OiBFcnJvcjogLXkgb3B0
aW9uIGdpdmVuIHdpdGhvdXQgdXNlcm5hbWUhXG4iOw0KQEAgLTExOSwxNSAr
MTE3LDEzIEBADQogICAgICRsb2dpbl9uYW1lID0gJmdldF9sb2dpbl9uYW1l
Ow0KIH0NCiANCi1pZiAoKCRwd19lbnQgPSAmY2hlY2tfbG9naW5fbmFtZSgk
bG9naW5fbmFtZSkpIGVxICcwJykgew0KK2lmICh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IlxuJHt3aG9hbWl9OiBXYXJuaW5nOiBjb3VsZG4ndCBzZXQgbW9kZSBvZiAk
bmV3X3Bhc3N3ZF9maWxlIHRvIDA2MDAgKCQhKVxuXHRjb250aW51aW5nLCBi
dXQgcGxlYXNlIGNoZWNrIG1vZGUgb2YgL2V0Yy9tYXN0ZXIucGFzc3dkIVxu
IjsNCiAgICAgJHNraXBwZWQgPSAwOw0KLSAgICB3aGlsZSAoJGkgPSA8TUFT
VEVSX1BXPikgew0KLQlpZiAoJGkgPX4gL1xuJC8pIHsNCi0JICAgIGNob3Ag
JGk7DQotCX0NCi0JaWYgKCRpIG5lICRwd19lbnQpIHsNCi0JICAgIHByaW50
IE5FV19QVyAiJGlcbiI7DQorICAgIHdoaWxlICg8TUFTVEVSX1BXPikgew0K
KwlpZiAobm90IC9eJGxvZ2luX25hbWVcOi9pbykgew0KKwkgICAgcHJpbnQg
TkVXX1BXOw0KIAl9IGVsc2Ugew0KIAkgICAgcHJpbnQgU1RERVJSICJEcm9w
cGVkIGVudHJ5IGZvciAkbG9naW5fbmFtZVxuIiBpZiAkZGVidWc7DQogCSAg
ICAkc2tpcHBlZCA9IDE7DQo=
--0-89123106-971138599=:84731--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0010091741150.84731-200000>