svn rev #3308: trunk/bsd/
ghudson@MIT.EDU
ghudson at MIT.EDU
Mon Sep 13 19:16:05 EDT 2010
Commit By: ghudson
Log Message:
>From nalin at redhat.com: Allow username lengths up to the system's value
of UT_NAMESIZE.
Changed Files:
U trunk/bsd/krshd.c
Modified: trunk/bsd/krshd.c
===================================================================
--- trunk/bsd/krshd.c 2010-08-05 19:36:05 UTC (rev 3307)
+++ trunk/bsd/krshd.c 2010-09-13 23:16:05 UTC (rev 3308)
@@ -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-appl-commits
mailing list