[krb5-appl] - krshd: don't limit user names to 16 chars when utmp can handle names at least a bit longer than
Nalin Dahyabhai
nalin at fedoraproject.org
Fri Sep 10 14:12:26 UTC 2010
commit 0c66d203d3953a3871449a6df94204e585039402
Author: Nalin Dahyabhai <nalin at redhat.com>
Date: Fri Sep 10 10:12:07 2010 -0400
- krshd: don't limit user names to 16 chars when utmp can handle names
at least a bit longer than that (#611713, RT#6773)
krb5-appl-1.0.1-nmax-is-ut_namesize.patch | 38 +++++++++++++++++++++++++++++
krb5-appl.spec | 8 +++++-
2 files changed, 45 insertions(+), 1 deletions(-)
---
diff --git a/krb5-appl-1.0.1-nmax-is-ut_namesize.patch b/krb5-appl-1.0.1-nmax-is-ut_namesize.patch
new file mode 100644
index 0000000..f7cb208
--- /dev/null
+++ b/krb5-appl-1.0.1-nmax-is-ut_namesize.patch
@@ -0,0 +1,38 @@
+Raise the limit on the length of user names to the most utmp will
+allow. Based on a patch by Rik Brown. RT#6773.
+
+diff -up krb5-appl-1.0.1/bsd/krshd.c krb5-appl-1.0.1/bsd/krshd.c
+--- krb5-appl-1.0.1/bsd/krshd.c 2010-09-09 18:33:22.969924000 -0400
++++ krb5-appl-1.0.1/bsd/krshd.c 2010-09-09 18:34:09.691923991 -0400
+@@ -175,6 +175,13 @@ char copyright[] =
+
+
+
++#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
+
+@@ -443,7 +450,7 @@ char username[32] = "LOGNAME=";
+ #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 @@ int maxlogs;
+ #define NCARGS 1024
+ #endif
+
+-#define NMAX 16
++#define NMAX UT_NAMESIZE
+
+ int pid;
+ char locuser[NMAX+1];
diff --git a/krb5-appl.spec b/krb5-appl.spec
index 8ea4c41..54512e4 100644
--- a/krb5-appl.spec
+++ b/krb5-appl.spec
@@ -10,7 +10,7 @@
Summary: Kerberos-aware versions of telnet, ftp, rsh, and rlogin
Name: krb5-appl
Version: 1.0.1
-Release: 2%{?dist}
+Release: 3%{?dist}
# Maybe we should explode from the now-available-to-everybody tarball instead?
# http://web.mit.edu/kerberos/dist/krb5-appl/1.0/krb5-appl-1.0.1-signed.tar
Source0: krb5-appl-%{version}.tar.gz
@@ -45,6 +45,7 @@ Patch73: krb5-1.6.3-ftp_glob_runique.patch
Patch79: krb5-trunk-ftp_mget_case.patch
Patch88: krb5-1.7-sizeof.patch
Patch89: krb5-appl-1.0.1-largefile.patch
+Patch90: krb5-appl-1.0.1-nmax-is-ut_namesize.patch
License: MIT
URL: http://web.mit.edu/kerberos/www/
@@ -102,6 +103,7 @@ ln -s NOTICE LICENSE
%patch79 -p2 -b .ftp_mget_case
%patch88 -p3 -b .sizeof
%patch89 -p1 -b .largefile
+%patch90 -p1 -b .nmax-is-ut_namesize
# Rename the man pages so that they'll get generated correctly. Uses the
# "krb5-appl-1.0-manpaths.txt" source file.
@@ -251,6 +253,10 @@ exit 0
%{krb5prefix}/man/man8/telnetd.8*
%changelog
+* Fri Sep 10 2010 Nalin Dahyabhai <nalin at redhat.com> - 1.0.1-3
+- krshd: don't limit user names to 16 chars when utmp can handle names
+ at least a bit longer than that (#611713, RT#6773)
+
* Wed Jun 9 2010 Nalin Dahyabhai <nalin at redhat.com> - 1.0.1-2
- use the "pathmunge" function to add %%{krb5prefix}/bin to $PATH rather
than doing it the harder way ourselves (part of #544652)
More information about the scm-commits
mailing list