The following reply was made to PR bin/138855; it has been noted by GNATS.

From: Marcin Cieslak <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: Re: bin/138855: [patch] if the hostname is empty, opiepasswd(1)
 creates a seed too short
Date: Sun, 19 Dec 2010 21:14:36 +0000

 This patch:
 
 Index: newseed.c
 ===================================================================
 --- newseed.c  (revision 212217)
 +++ newseed.c  (working copy)
 @@ -81,6 +81,10 @@
                        utsname.nodename[1] = 'e';
                }
                utsname.nodename[2] = 0;
 +              if (!isalnum(utsname.nodename[0])
 +                      utsname.nodename[0] = 'k';
 +              if (!isalnum(utsname.nodename[1])
 +                      utsname.nodename[1] = 'f';
 
                if (snprintf(seed, OPIE_SEED_MAX+1, "%s%04d", utsname.nodename,
                                (rand() % 9999) + 1) >= OPIE_SEED_MAX+1)
 
 should fix seed generation also for one-letter hostnames (the
 generated seed for hostname "x" was "x." and the opiepasswd failed
 as well because of the isalnum() check in writerec.c.
 
 //Marcin
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to