From gnb@itga.com.au  Wed Jul 12 23:12:22 2000
Return-Path: <gnb@itga.com.au>
Received: from ns.itga.com.au (ns.itga.com.au [202.53.40.210])
	by hub.freebsd.org (Postfix) with ESMTP id 1D6DF37C2F4
	for <FreeBSD-gnats-submit@freebsd.org>; Wed, 12 Jul 2000 23:12:20 -0700 (PDT)
	(envelope-from gnb@itga.com.au)
Received: from lightning.itga.com.au (lightning.itga.com.au [192.168.71.20])
	by ns.itga.com.au (8.9.3/8.9.3) with ESMTP id QAA67484
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 13 Jul 2000 16:12:13 +1000 (EST)
	(envelope-from gnb@itga.com.au)
Received: from hellcat.itga.com.au (hellcat.itga.com.au [192.168.71.163])
	by lightning.itga.com.au (8.9.3/8.9.3) with ESMTP id QAA08807;
	Thu, 13 Jul 2000 16:12:12 +1000 (EST)
Received: (from gnb@localhost)
	by hellcat.itga.com.au (8.9.3/8.9.3) id QAA75928;
	Thu, 13 Jul 2000 16:12:12 +1000 (EST)
	(envelope-from gnb@itga.com.au)
Message-Id: <200007130612.QAA75928@hellcat.itga.com.au>
Date: Thu, 13 Jul 2000 16:12:12 +1000 (EST)
From: Gregory Bond <gnb@itga.com.au>
To: FreeBSD-gnats-submit@freebsd.org
Subject: skey won't work for usernames > 8 characters
X-Send-Pr-Version: 3.2

>Number:         19886
>Category:       bin
>Synopsis:       skey won't work for usernames > 8 characters
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    sheldonh
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 12 23:20:01 PDT 2000
>Closed-Date:    Tue Jul 18 04:38:30 PDT 2000
>Last-Modified:  Tue Jul 18 04:39:27 PDT 2000
>Originator:     Gregory Bond
>Release:        FreeBSD 4.0-STABLE i386
>Organization:
ITG Australia Limited
>Environment:

4-Stable

>Description:

skey will not authenticate usernames longer than 8 characters.

>How-To-Repeat:

adduser "testuser123" and try and use s/key to log in.

>Fix:


Index: skeylogin.c
===================================================================
RCS file: /usr/ncvs/src/lib/libskey/skeylogin.c,v
retrieving revision 1.14
diff -u -r1.14 skeylogin.c
--- skeylogin.c	1998/10/26 13:33:39	1.14
+++ skeylogin.c	2000/07/13 06:05:43
@@ -19,6 +19,8 @@
 #include <time.h>
 #include <errno.h>
 
+#include <utmp.h>
+
 #include "skey.h"
 #include "pathnames.h"
 
@@ -124,7 +126,7 @@
 
 	/* Look up user name in database */
 	len = strlen(name);
-	if( len > 8 ) len = 8;		/*  Added 8/2/91  -  nmh */
+	if( len > UT_NAMESIZE ) len = UT_NAMESIZE;
 	found = 0;
 	while(!feof(mp->keyfile)){
 		recstart = ftell(mp->keyfile);

>Release-Note:
>Audit-Trail:

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: Gregory Bond <gnb@itga.com.au>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/19886: skey won't work for usernames > 8 characters 
Date: Thu, 13 Jul 2000 12:36:03 +0200

 On Thu, 13 Jul 2000 16:12:12 +1000, Gregory Bond wrote:
 
 > skey will not authenticate usernames longer than 8 characters.
 
 Your patch doesn't deal with the header inclusions in a
 style(9)-consistent way.  Of course, the file is already out of sync
 with style(9) in that respect. :-)
 
 I'm sending two patches, to be applied in order.  The first corrects the
 existing inclusions, while the second applies the change you intended.
 it would be better if they were applied as two distinct commits.
 
 Note also that the style of the conditional was not consistent with the
 conditionals in the rest of the file.
 
 Ciao,
 Sheldon.
 
 Index: skeylogin.c
 ===================================================================
 RCS file: /home/ncvs/src/lib/libskey/skeylogin.c,v
 retrieving revision 1.14
 diff -u -d -r1.14 skeylogin.c
 --- skeylogin.c	1998/10/26 13:33:39	1.14
 +++ skeylogin.c	2000/07/13 10:30:02
 @@ -10,14 +10,11 @@
  #include <sys/time.h>
  #include <sys/resource.h>
  
 -
 +#include <errno.h>
  #include <stdio.h>
  #include <stdlib.h>
  #include <string.h>
 -#include <sys/types.h>
 -#include <sys/stat.h>
  #include <time.h>
 -#include <errno.h>
  
  #include "skey.h"
  #include "pathnames.h"
 
 --- skeylogin.c.orig	Thu Jul 13 12:33:23 2000
 +++ skeylogin.c	Thu Jul 13 12:34:08 2000
 @@ -15,6 +15,7 @@
  #include <stdlib.h>
  #include <string.h>
  #include <time.h>
 +#include <utmp.h>
  
  #include "skey.h"
  #include "pathnames.h"
 @@ -121,7 +122,8 @@
  
  	/* Look up user name in database */
  	len = strlen(name);
 -	if( len > 8 ) len = 8;		/*  Added 8/2/91  -  nmh */
 +	if(len > UT_NAMESIZE)
 +		len = UT_NAMESIZE;
  	found = 0;
  	while(!feof(mp->keyfile)){
  		recstart = ftell(mp->keyfile);
 
State-Changed-From-To: open->closed 
State-Changed-By: sheldonh 
State-Changed-When: Tue Jul 18 04:38:30 PDT 2000 
State-Changed-Why:  
Committed as rev 1.16 of skeylogin.c and merged onto RELENG_4 in 
rev 1.14.6.1 .  Thanks! 


Responsible-Changed-From-To: freebsd-bugs->sheldonh 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Tue Jul 18 04:38:30 PDT 2000 
Responsible-Changed-Why:  
I did it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19886 
>Unformatted:
