Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 1998 09:15:30 -0500
From:      Jonathan Lemon <jlemon@americantv.com>
To:        Al Reuben <alex@nac.net>
Cc:        freebsd-questions@FreeBSD.ORG, Rick Smith <rsmith@nac.net>, Who???? <rpalma@nac.net>
Subject:   Re: Strange username questions...
Message-ID:  <19980514091530.11532@right.PCS>
In-Reply-To: <Pine.BSF.3.96.980514004150.24642K-100000@iago.nac.net>; from Al Reuben on May 05, 1998 at 12:52:06AM -0400
References:  <Pine.BSF.3.96.980514004150.24642K-100000@iago.nac.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On May 05, 1998 at 12:52:06AM -0400, Al Reuben wrote:
> We are running into two problems, one of which I think we have solved by
> looking at the archives. First, we have the need for greater than 8
> character usernames; we have over 9500 accounts, and many _already_ have
> usernames > 8 chars, and we can't change them. But, I saw the notes on
> -CURRENT, etc., and I think we can accomplish this feat.

Yup, > 8 char usernames are doable; just remember to recompile all
the various pieces that want to know about the username limit.
 

> However, we found something else interesting. Unlike Linux, FreeBSD
> appears that it can't have '.'s (meaning PERIODS) in usernames; for
> instance:
>
> So, my question is, why? Is there a reason that '.'s can't be in the
> username? 

>From the passwd(5) man page:

     The login name must never begin with a hyphen (``-''); also, it is
     strongly suggested that neither upper-case characters or dots (``.'') be
     part of the name, as this tends to confuse mailers.

So it's just a suggestion, which happens to be enforced by the adduser
script.  If it doesn't cause problems for you, then by all means, just
go ahead and put usernames with "." in the passwd file.
--
Jonathan

In fact, here's a patch for adduser (beware of cut&paste lossage):

@@ -316,7 +316,7 @@
     local($name);
 
     while(1) {
-       $name = &confirm_list("Enter username", 1, "a-z0-9_-", "");
+       $name = &confirm_list("Enter username", 1, "a-z0-9_-.", "");
        if (length($name) > 16) {
            warn "Username is longer than 16 chars\a\n";
            next;
@@ -329,7 +329,7 @@
 sub new_users_name_valid {
     local($name) = @_;
 
-    if ($name !~ /^[a-z0-9_][a-z0-9_\-]*$/) {
+    if ($name !~ /^[a-z0-9_\.][a-z0-9_\-\.]*$/) {
        warn "Wrong username. " .
            "Please use only lowercase characters or digits\a\n";
        return 0;

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



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