[krbdev.mit.edu #6773] rshd's limit on login name length is unnecessarily low

The RT System itself via RT rt-comment at krbdev.mit.edu
Thu Sep 9 19:04:50 EDT 2010


>From krb5-bugs-incoming-bounces at PCH.mit.edu  Thu Sep  9 19:04:49 2010
Return-Path: <krb5-bugs-incoming-bounces at PCH.mit.edu>
Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90])
	by krbdev.mit.edu (Postfix) with ESMTP id A7F353E634;
	Thu,  9 Sep 2010 19:04:49 -0400 (EDT)
Received: from pch.mit.edu (pch.mit.edu [127.0.0.1])
	by pch.mit.edu (8.13.6/8.12.8) with ESMTP id o89N4n5F001999;
	Thu, 9 Sep 2010 19:04:49 -0400
Received: from mailhub-dmz-3.mit.edu (MAILHUB-DMZ-3.MIT.EDU [18.9.21.42])
	by pch.mit.edu (8.13.6/8.12.8) with ESMTP id o89MeRjW031773
	for <krb5-bugs-incoming at PCH.mit.edu>; Thu, 9 Sep 2010 18:40:27 -0400
Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU
	[18.7.68.35])
	by mailhub-dmz-3.mit.edu (8.13.8/8.9.2) with ESMTP id o89MeFrw028729
	for <krb5-bugs at mit.edu>; Thu, 9 Sep 2010 18:40:27 -0400
X-AuditID: 12074423-b7b19ae0000059ef-65-4c89623ffa71
Received: from mx1.redhat.com ( [209.132.183.28])
	by dmz-mailsec-scanner-6.mit.edu (Symantec Brightmail Gateway) with
	SMTP id 69.EF.23023.F32698C4; Thu,  9 Sep 2010 18:39:59 -0400 (EDT)
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o89MeNWL009700
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <krb5-bugs at mit.edu>; Thu, 9 Sep 2010 18:40:23 -0400
Received: from blade.bos.redhat.com (blade.bos.redhat.com [10.16.0.23])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id o89MeIcn015484
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <krb5-bugs at mit.edu>; Thu, 9 Sep 2010 18:40:19 -0400
Received: from blade.bos.redhat.com (localhost.localdomain [127.0.0.1])
	by blade.bos.redhat.com (8.14.4/8.14.3) with ESMTP id o89MeIjf029117
	for <krb5-bugs at mit.edu>; Thu, 9 Sep 2010 18:40:18 -0400
Received: (from nalin at localhost)
	by blade.bos.redhat.com (8.14.4/8.14.4/Submit) id o89MeIHU029115;
	Thu, 9 Sep 2010 18:40:18 -0400
Date: Thu, 9 Sep 2010 18:40:18 -0400
Message-Id: <201009092240.o89MeIHU029115 at blade.bos.redhat.com>
To: krb5-bugs at mit.edu
Subject: rshd's limit on login name length is unnecessarily low
From: nalin at redhat.com
X-send-pr-version: 3.99
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-Brightmail-Tracker: AAAAAhX1h9UV9lj3
X-Mailman-Approved-At: Thu, 09 Sep 2010 19:04:47 -0400
X-BeenThere: krb5-bugs-incoming at mailman.mit.edu
X-Mailman-Version: 2.1.6
Precedence: list
Sender: krb5-bugs-incoming-bounces at PCH.mit.edu
Errors-To: krb5-bugs-incoming-bounces at PCH.mit.edu


>Submitter-Id:	net
>Originator:	
>Organization:
>Confidential:	no
>Synopsis:	rshd's limit on login name length is unnecessarily low
>Severity:	non-critical
>Priority:	low
>Category:	krb5-appl
>Class:		change-request
>Release:	1.0.1
>Environment:
	
System: Linux blade.bos.redhat.com 2.6.34-43.fc14.x86_64 #1 SMP Thu Jun 17 10:32:12 UTC 2010 x86_64 x86_64 x86_64 GNU/Linux
Architecture: x86_64

>Description:
	Rik Brown reported that kshd limits user names to 16 chars, while
	the more practical limit of the size of the user name field in
	a utmp entry is typically higher, at least on glibc systems.
>How-To-Repeat:
	Create a temporary user with 'useradd' with a name more than 16
	chars long, but less than 32 (the limit I get here).  Try to run
	"printenv USER" via rsh.
>Fix:
	Here's a revised version of Rik's patch from
	https://bugzilla.redhat.com/show_bug.cgi?id=611713:

Index: bsd/krshd.c
===================================================================
--- bsd/krshd.c	(revision 3307)
+++ bsd/krshd.c	(working copy)
@@ -171,7 +171,14 @@
 
 
 
+#ifdef HAVE_UTMP_H
+#include <utmp.h>
+#endif
 
+#ifndef UT_NAMESIZE	/* linux defines it directly in <utmp.h> */
+#define	UT_NAMESIZE	sizeof(((struct utmp *)0)->ut_name)
+#endif
+
 #define MAXRETRIES 4
 
 krb5_context bsd_context;
@@ -438,7 +445,7 @@
 #include <tmpdir.h>
 char tmpdir[64] = "TMPDIR=";
 #else
-char	username[20] = "USER=";
+char	username[UT_NAMESIZE + 6] = "USER=";
 #endif
 
 char	homedir[64] = "HOME=";
@@ -493,7 +500,7 @@
 #define NCARGS 4096
 #endif
 
-#define NMAX   16 
+#define NMAX   UT_NAMESIZE
 
 int pid;
 char locuser[NMAX+1];




More information about the krb5-bugs mailing list