Bug 19886

Summary: skey won't work for usernames > 8 characters
Product: Base System Reporter: Gregory Bond <gnb>
Component: binAssignee: Sheldon Hearn <sheldonh>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.0-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Gregory Bond 2000-07-13 07:20:01 UTC
skey will not authenticate usernames longer than 8 characters.

How-To-Repeat: 
adduser "testuser123" and try and use s/key to log in.
Comment 1 Sheldon Hearn 2000-07-13 11:36:03 UTC
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);
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-18 12:38:30 UTC
State Changed
From-To: open->closed

Committed as rev 1.16 of skeylogin.c and merged onto RELENG_4 in 
rev 1.14.6.1 .  Thanks! 


Comment 3 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-18 12:38:30 UTC
Responsible Changed
From-To: freebsd-bugs->sheldonh

I did it.