summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2013-07-27 10:07:53 +0400
committerIgor Pashev <pashev.igor@gmail.com>2013-07-27 19:35:25 +0400
commit721cb7545f84219c4dc18404cf7b70df0c9dce25 (patch)
tree0fdbe2d159b61b9487d7051aba3f3ba3e4eaf205
parentd737b48a84a8cf5b86b1e672e24863d7ee1864fc (diff)
downloadshadow-721cb7545f84219c4dc18404cf7b70df0c9dce25.tar.gz
shadow (1:4.1.5.1-1+dyson1) unstable; urgency=lowdyson/4.1.5.1-1+dyson1
* New upstream release * Use 2^31 - 1 instead of LONG_MAX in SHA_salt_size() - updated 0020-No-RAND_MAX-for-random.patch * Patch login to work with solaris ttymon - added solaris-ttymon.patch * Refreshed patches
-rw-r--r--debian/changelog11
-rw-r--r--debian/patches/0001-503_shadowconfig.8.patch45
-rw-r--r--debian/patches/0002-428_grpck_add_prune_option.patch12
-rw-r--r--debian/patches/0003-008_login_log_failure_in_FTMP.patch22
-rw-r--r--debian/patches/0004-429_login_FAILLOG_ENAB.patch34
-rw-r--r--debian/patches/0005-401_cppw_src.dpatch.patch31
-rw-r--r--debian/patches/0006-402_cppw_selinux.patch12
-rw-r--r--debian/patches/0007-506_relaxed_usernames.patch30
-rw-r--r--debian/patches/0008-542_useradd-O_option.patch22
-rw-r--r--debian/patches/0009-501_commonio_group_shadow.patch10
-rw-r--r--debian/patches/0010-463_login_delay_obeys_to_PAM.patch34
-rw-r--r--debian/patches/0011-523_su_arguments_are_concatenated.patch10
-rw-r--r--debian/patches/0012-523_su_arguments_are_no_more_concatenated_by_default.patch14
-rw-r--r--debian/patches/0013-508_nologin_in_usr_sbin.patch12
-rw-r--r--debian/patches/0014-505_useradd_recommend_adduser.patch20
-rw-r--r--debian/patches/0015-utmp.c.patch12
-rw-r--r--debian/patches/0016-getspnam_r.patch26
-rw-r--r--debian/patches/0017-environ.patch16
-rw-r--r--debian/patches/0018-putgrent.patch8
-rw-r--r--debian/patches/0019-putpwent-segfault.patch8
-rw-r--r--debian/patches/0020-No-RAND_MAX-for-random.patch28
-rw-r--r--debian/patches/series1
-rw-r--r--debian/patches/solaris-ttymon.patch65
23 files changed, 283 insertions, 200 deletions
diff --git a/debian/changelog b/debian/changelog
index 7e344d6..79af5a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,14 @@
+shadow (1:4.1.5.1-1+dyson1) unstable; urgency=low
+
+ * New upstream release
+ * Use 2^31 - 1 instead of LONG_MAX in SHA_salt_size()
+ - updated 0020-No-RAND_MAX-for-random.patch
+ * Patch login to work with solaris ttymon
+ - added solaris-ttymon.patch
+ * Refreshed patches
+
+ -- Igor Pashev <pashev.igor@gmail.com> Sat, 27 Jul 2013 19:34:26 +0400
+
shadow (1:4.1.5-1+dyson4) unstable; urgency=low
** SNAPSHOT build @03df336c176dd8d8dea802ebd1bdc918b35c433e **
diff --git a/debian/patches/0001-503_shadowconfig.8.patch b/debian/patches/0001-503_shadowconfig.8.patch
index ed296de..135d8a9 100644
--- a/debian/patches/0001-503_shadowconfig.8.patch
+++ b/debian/patches/0001-503_shadowconfig.8.patch
@@ -17,11 +17,10 @@ Status wrt upstream: The shadowconfig utility is debian specific.
create mode 100644 man/shadowconfig.8
create mode 100644 man/shadowconfig.8.xml
-diff --git a/man/fr/shadowconfig.8 b/man/fr/shadowconfig.8
-new file mode 100644
-index 0000000..784da70
---- /dev/null
-+++ b/man/fr/shadowconfig.8
+Index: b/man/fr/shadowconfig.8
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/man/fr/shadowconfig.8 2013-07-27 19:33:03.546370258 +0400
@@ -0,0 +1,26 @@
+.\" This file was generated with po4a. Translate the source file.
+.\"
@@ -49,11 +48,10 @@ index 0000000..784da70
+.SH TRADUCTION
+Nicolas FRANÇOIS, 2004.
+Veuillez signaler toute erreur à <\fIdebian\-l10\-french@lists.debian.org\fR>.
-diff --git a/man/ja/shadowconfig.8 b/man/ja/shadowconfig.8
-new file mode 100644
-index 0000000..a75c6f7
---- /dev/null
-+++ b/man/ja/shadowconfig.8
+Index: b/man/ja/shadowconfig.8
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/man/ja/shadowconfig.8 2013-07-27 19:33:03.547324925 +0400
@@ -0,0 +1,25 @@
+.\" all right reserved,
+.\" Translated Tue Oct 30 11:59:11 JST 2001
@@ -80,11 +78,10 @@ index 0000000..a75c6f7
+
+.I /usr/share/doc/passwd/README.debian.gz
+には shadow パスワードとそれに関する特徴の簡単な紹介が書かれている。
-diff --git a/man/pl/shadowconfig.8 b/man/pl/shadowconfig.8
-new file mode 100644
-index 0000000..2016c9f
---- /dev/null
-+++ b/man/pl/shadowconfig.8
+Index: b/man/pl/shadowconfig.8
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/man/pl/shadowconfig.8 2013-07-27 19:33:03.548178959 +0400
@@ -0,0 +1,27 @@
+.\" $Id: shadowconfig.8,v 1.3 2001/08/23 23:10:51 kloczek Exp $
+.\" {PTM/WK/1999-09-14}
@@ -113,11 +110,10 @@ index 0000000..2016c9f
+.IR /usr/share/doc/passwd/README.debian.gz ,
+gdzie znajdziesz krótkie wprowadzenie do ochrony haseł z użyciem dodatkowych
+plików haseł przesłanianych (shadow passwords) i związanych tematów.
-diff --git a/man/shadowconfig.8 b/man/shadowconfig.8
-new file mode 100644
-index 0000000..c0ee0af
---- /dev/null
-+++ b/man/shadowconfig.8
+Index: b/man/shadowconfig.8
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/man/shadowconfig.8 2013-07-27 19:33:03.548869499 +0400
@@ -0,0 +1,41 @@
+.\"Generated by db2man.xsl. Don't modify this, modify the source.
+.de Sh \" Subsection
@@ -160,11 +156,10 @@ index 0000000..c0ee0af
+.PP
+Note that turning shadow passwords off and on again will lose all password aging information\&.
+
-diff --git a/man/shadowconfig.8.xml b/man/shadowconfig.8.xml
-new file mode 100644
-index 0000000..b4080ea
---- /dev/null
-+++ b/man/shadowconfig.8.xml
+Index: b/man/shadowconfig.8.xml
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/man/shadowconfig.8.xml 2013-07-27 19:33:03.549861198 +0400
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
diff --git a/debian/patches/0002-428_grpck_add_prune_option.patch b/debian/patches/0002-428_grpck_add_prune_option.patch
index 1dbe071..ae90f22 100644
--- a/debian/patches/0002-428_grpck_add_prune_option.patch
+++ b/debian/patches/0002-428_grpck_add_prune_option.patch
@@ -7,11 +7,11 @@ Status wrt upstream: It could certainly be submitted to upstream.
src/grpck.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
-diff --git a/src/grpck.c b/src/grpck.c
-index 1846c4d..17cef2c 100644
---- a/src/grpck.c
-+++ b/src/grpck.c
-@@ -81,6 +81,7 @@ static bool gr_locked = false;
+Index: b/src/grpck.c
+===================================================================
+--- a/src/grpck.c 2013-07-27 19:32:56.534193327 +0400
++++ b/src/grpck.c 2013-07-27 19:33:06.260610138 +0400
+@@ -81,6 +81,7 @@
/* Options */
static bool read_only = false;
static bool sort_mode = false;
@@ -19,7 +19,7 @@ index 1846c4d..17cef2c 100644
/* local function prototypes */
static void fail_exit (int status);
-@@ -203,7 +204,7 @@ static void process_flags (int argc, char **argv)
+@@ -203,7 +204,7 @@
/*
* Parse the command line arguments
*/
diff --git a/debian/patches/0003-008_login_log_failure_in_FTMP.patch b/debian/patches/0003-008_login_log_failure_in_FTMP.patch
index ace8fae..404f666 100644
--- a/debian/patches/0003-008_login_log_failure_in_FTMP.patch
+++ b/debian/patches/0003-008_login_log_failure_in_FTMP.patch
@@ -10,11 +10,11 @@ Notes:
src/login.c | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
-diff --git a/lib/getdef.c b/lib/getdef.c
-index ac08163..3673e84 100644
---- a/lib/getdef.c
-+++ b/lib/getdef.c
-@@ -62,6 +62,7 @@ static struct itemdef def_table[] = {
+Index: b/lib/getdef.c
+===================================================================
+--- a/lib/getdef.c 2013-07-27 19:32:55.578200421 +0400
++++ b/lib/getdef.c 2013-07-27 19:33:08.345048874 +0400
+@@ -62,6 +62,7 @@
{"ERASECHAR", NULL},
{"FAIL_DELAY", NULL},
{"FAKE_SHELL", NULL},
@@ -22,7 +22,7 @@ index ac08163..3673e84 100644
{"GID_MAX", NULL},
{"GID_MIN", NULL},
{"HUSHLOGIN_FILE", NULL},
-@@ -103,7 +104,6 @@ static struct itemdef def_table[] = {
+@@ -103,7 +104,6 @@
{"ENVIRON_FILE", NULL},
{"ENV_TZ", NULL},
{"FAILLOG_ENAB", NULL},
@@ -30,11 +30,11 @@ index ac08163..3673e84 100644
{"ISSUE_FILE", NULL},
{"LASTLOG_ENAB", NULL},
{"LOGIN_STRING", NULL},
-diff --git a/src/login.c b/src/login.c
-index fe628de..2d13b0f 100644
---- a/src/login.c
-+++ b/src/login.c
-@@ -835,6 +835,24 @@ int main (int argc, char **argv)
+Index: b/src/login.c
+===================================================================
+--- a/src/login.c 2013-07-27 19:32:55.578150588 +0400
++++ b/src/login.c 2013-07-27 19:33:08.347749648 +0400
+@@ -831,6 +831,24 @@
(void) puts ("");
(void) puts (_("Login incorrect"));
diff --git a/debian/patches/0004-429_login_FAILLOG_ENAB.patch b/debian/patches/0004-429_login_FAILLOG_ENAB.patch
index 31543a6..4f56c50 100644
--- a/debian/patches/0004-429_login_FAILLOG_ENAB.patch
+++ b/debian/patches/0004-429_login_FAILLOG_ENAB.patch
@@ -9,11 +9,11 @@ Note: It could be removed if pam_tally could report the number of failures
src/login.c | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 2 deletions(-)
-diff --git a/lib/getdef.c b/lib/getdef.c
-index 3673e84..b42795b 100644
---- a/lib/getdef.c
-+++ b/lib/getdef.c
-@@ -61,6 +61,7 @@ static struct itemdef def_table[] = {
+Index: b/lib/getdef.c
+===================================================================
+--- a/lib/getdef.c 2013-07-27 19:33:08.345048874 +0400
++++ b/lib/getdef.c 2013-07-27 19:33:10.709475162 +0400
+@@ -61,6 +61,7 @@
{"ENV_SUPATH", NULL},
{"ERASECHAR", NULL},
{"FAIL_DELAY", NULL},
@@ -21,7 +21,7 @@ index 3673e84..b42795b 100644
{"FAKE_SHELL", NULL},
{"FTMP_FILE", NULL},
{"GID_MAX", NULL},
-@@ -103,7 +104,6 @@ static struct itemdef def_table[] = {
+@@ -103,7 +104,6 @@
{"ENV_HZ", NULL},
{"ENVIRON_FILE", NULL},
{"ENV_TZ", NULL},
@@ -29,13 +29,13 @@ index 3673e84..b42795b 100644
{"ISSUE_FILE", NULL},
{"LASTLOG_ENAB", NULL},
{"LOGIN_STRING", NULL},
-diff --git a/src/login.c b/src/login.c
-index 2d13b0f..5792c5e 100644
---- a/src/login.c
-+++ b/src/login.c
-@@ -133,9 +133,9 @@ static void update_utmp (const char *user,
+Index: b/src/login.c
+===================================================================
+--- a/src/login.c 2013-07-27 19:33:08.347749648 +0400
++++ b/src/login.c 2013-07-27 19:33:10.711976461 +0400
+@@ -131,9 +131,9 @@
+ const char *host,
/*@null@*/const struct utmp *utent);
- #endif /* ! USE_PAM */
-#ifndef USE_PAM
static struct faillog faillog;
@@ -44,7 +44,7 @@ index 2d13b0f..5792c5e 100644
static void bad_time_notify (void);
static void check_nologin (bool login_to_root);
#else
-@@ -795,6 +795,9 @@ int main (int argc, char **argv)
+@@ -791,6 +791,9 @@
SYSLOG ((LOG_NOTICE,
"TOO MANY LOGIN TRIES (%u)%s FOR '%s'",
failcount, fromhost, failent_user));
@@ -54,7 +54,7 @@ index 2d13b0f..5792c5e 100644
fprintf (stderr,
_("Maximum number of tries exceeded (%u)\n"),
failcount);
-@@ -812,6 +815,14 @@ int main (int argc, char **argv)
+@@ -808,6 +811,14 @@
pam_strerror (pamh, retcode)));
failed = true;
}
@@ -69,7 +69,7 @@ index 2d13b0f..5792c5e 100644
if (!failed) {
break;
-@@ -835,6 +846,10 @@ int main (int argc, char **argv)
+@@ -831,6 +842,10 @@
(void) puts ("");
(void) puts (_("Login incorrect"));
@@ -80,7 +80,7 @@ index 2d13b0f..5792c5e 100644
if (getdef_str("FTMP_FILE") != NULL) {
#ifdef USE_UTMPX
struct utmpx *failent =
-@@ -1291,6 +1306,7 @@ int main (int argc, char **argv)
+@@ -1285,6 +1300,7 @@
*/
#ifndef USE_PAM
motd (); /* print the message of the day */
@@ -88,7 +88,7 @@ index 2d13b0f..5792c5e 100644
if ( getdef_bool ("FAILLOG_ENAB")
&& (0 != faillog.fail_cnt)) {
failprint (&faillog);
-@@ -1303,6 +1319,7 @@ int main (int argc, char **argv)
+@@ -1297,6 +1313,7 @@
username, (int) faillog.fail_cnt));
}
}
diff --git a/debian/patches/0005-401_cppw_src.dpatch.patch b/debian/patches/0005-401_cppw_src.dpatch.patch
index 865e1b7..c672c8f 100644
--- a/debian/patches/0005-401_cppw_src.dpatch.patch
+++ b/debian/patches/0005-401_cppw_src.dpatch.patch
@@ -16,11 +16,11 @@ Subject: 401_cppw_src.dpatch
3 files changed, 241 insertions(+)
create mode 100644 src/cppw.c
-diff --git a/po/POTFILES.in b/po/POTFILES.in
-index 1758f49..ee1a486 100644
---- a/po/POTFILES.in
-+++ b/po/POTFILES.in
-@@ -85,6 +85,7 @@ src/chfn.c
+Index: b/po/POTFILES.in
+===================================================================
+--- a/po/POTFILES.in 2013-07-27 19:32:53.527293721 +0400
++++ b/po/POTFILES.in 2013-07-27 19:33:12.930211349 +0400
+@@ -85,6 +85,7 @@
src/chgpasswd.c
src/chpasswd.c
src/chsh.c
@@ -28,11 +28,11 @@ index 1758f49..ee1a486 100644
src/expiry.c
src/faillog.c
src/gpasswd.c
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 88cae99..6a1e46b 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -26,6 +26,7 @@ bin_PROGRAMS = groups login su
+Index: b/src/Makefile.am
+===================================================================
+--- a/src/Makefile.am 2013-07-27 19:32:53.527343384 +0400
++++ b/src/Makefile.am 2013-07-27 19:33:12.931554426 +0400
+@@ -26,6 +26,7 @@
sbin_PROGRAMS = nologin
ubin_PROGRAMS = faillog lastlog chage chfn chsh expiry gpasswd newgrp passwd
usbin_PROGRAMS = \
@@ -40,7 +40,7 @@ index 88cae99..6a1e46b 100644
chgpasswd \
chpasswd \
groupadd \
-@@ -82,6 +83,7 @@ chfn_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $
+@@ -82,6 +83,7 @@
chgpasswd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBSELINUX) $(LIBCRYPT)
chsh_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT_NOPAM) $(LIBSKEY) $(LIBMD)
chpasswd_LDADD = $(LDADD) $(LIBPAM) $(LIBSELINUX) $(LIBCRYPT)
@@ -48,11 +48,10 @@ index 88cae99..6a1e46b 100644
gpasswd_LDADD = $(LDADD) $(LIBAUDIT) $(LIBSELINUX) $(LIBCRYPT)
groupadd_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
groupdel_LDADD = $(LDADD) $(LIBPAM_SUID) $(LIBAUDIT) $(LIBSELINUX)
-diff --git a/src/cppw.c b/src/cppw.c
-new file mode 100644
-index 0000000..beb4c36
---- /dev/null
-+++ b/src/cppw.c
+Index: b/src/cppw.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ b/src/cppw.c 2013-07-27 19:33:12.932563432 +0400
@@ -0,0 +1,238 @@
+/*
+ cppw, cpgr copy with locking given file over the password or group file
diff --git a/debian/patches/0006-402_cppw_selinux.patch b/debian/patches/0006-402_cppw_selinux.patch
index d258b0d..95f77d0 100644
--- a/debian/patches/0006-402_cppw_selinux.patch
+++ b/debian/patches/0006-402_cppw_selinux.patch
@@ -14,10 +14,10 @@ Depends on 401_cppw_src.dpatch
src/cppw.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
-diff --git a/src/cppw.c b/src/cppw.c
-index beb4c36..2cbbbc0 100644
---- a/src/cppw.c
-+++ b/src/cppw.c
+Index: b/src/cppw.c
+===================================================================
+--- a/src/cppw.c 2013-07-27 19:33:12.932563432 +0400
++++ b/src/cppw.c 2013-07-27 19:33:15.290898836 +0400
@@ -34,6 +34,9 @@
#include <sys/types.h>
#include <signal.h>
@@ -28,7 +28,7 @@ index beb4c36..2cbbbc0 100644
#include "exitcodes.h"
#include "prototypes.h"
#include "pwio.h"
-@@ -139,6 +142,22 @@ static void cppwcopy (const char *file,
+@@ -139,6 +142,22 @@
if (access (file, F_OK) != 0) {
cppwexit (file, 1, 1);
}
@@ -51,7 +51,7 @@ index beb4c36..2cbbbc0 100644
if (file_lock () == 0) {
cppwexit (_("Couldn't lock file"), 0, 5);
}
-@@ -167,6 +186,15 @@ static void cppwcopy (const char *file,
+@@ -167,6 +186,15 @@
cppwexit (NULL,0,1);
}
diff --git a/debian/patches/0007-506_relaxed_usernames.patch b/debian/patches/0007-506_relaxed_usernames.patch
index adfd922..a5cc66d 100644
--- a/debian/patches/0007-506_relaxed_usernames.patch
+++ b/debian/patches/0007-506_relaxed_usernames.patch
@@ -22,10 +22,10 @@ Details:
man/useradd.8.xml | 10 +++++++++-
3 files changed, 37 insertions(+), 2 deletions(-)
-diff --git a/libmisc/chkname.c b/libmisc/chkname.c
-index 42111ae..f3799ac 100644
---- a/libmisc/chkname.c
-+++ b/libmisc/chkname.c
+Index: b/libmisc/chkname.c
+===================================================================
+--- a/libmisc/chkname.c 2013-07-27 19:32:51.986367225 +0400
++++ b/libmisc/chkname.c 2013-07-27 19:33:17.402553812 +0400
@@ -48,6 +48,7 @@
static bool is_valid_name (const char *name)
@@ -34,7 +34,7 @@ index 42111ae..f3799ac 100644
/*
* User/group names must match [a-z_][a-z0-9_-]*[$]
*/
-@@ -66,6 +67,26 @@ static bool is_valid_name (const char *name)
+@@ -66,6 +67,26 @@
return false;
}
}
@@ -61,11 +61,11 @@ index 42111ae..f3799ac 100644
return true;
}
-diff --git a/man/groupadd.8.xml b/man/groupadd.8.xml
-index da2ebf3..eae7324 100644
---- a/man/groupadd.8.xml
-+++ b/man/groupadd.8.xml
-@@ -240,12 +240,18 @@
+Index: b/man/groupadd.8.xml
+===================================================================
+--- a/man/groupadd.8.xml 2013-07-27 19:32:51.986458087 +0400
++++ b/man/groupadd.8.xml 2013-07-27 19:33:17.403833437 +0400
+@@ -259,12 +259,18 @@
<refsect1 id='caveats'>
<title>CAVEATS</title>
<para>
@@ -85,11 +85,11 @@ index da2ebf3..eae7324 100644
Groupnames may only be up to &GROUP_NAME_MAX_LENGTH; characters long.
</para>
<para>
-diff --git a/man/useradd.8.xml b/man/useradd.8.xml
-index ee4b4e5..0ae6303 100644
---- a/man/useradd.8.xml
-+++ b/man/useradd.8.xml
-@@ -635,12 +635,20 @@
+Index: b/man/useradd.8.xml
+===================================================================
+--- a/man/useradd.8.xml 2013-07-27 19:32:51.986478728 +0400
++++ b/man/useradd.8.xml 2013-07-27 19:33:17.416209819 +0400
+@@ -654,12 +654,20 @@
</para>
<para>
diff --git a/debian/patches/0008-542_useradd-O_option.patch b/debian/patches/0008-542_useradd-O_option.patch
index 1b35765..4fc1588 100644
--- a/debian/patches/0008-542_useradd-O_option.patch
+++ b/debian/patches/0008-542_useradd-O_option.patch
@@ -11,11 +11,11 @@ Status wrt upstream: not included as this is just specific
src/useradd.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
-diff --git a/man/useradd.8.xml b/man/useradd.8.xml
-index 0ae6303..3ee0e38 100644
---- a/man/useradd.8.xml
-+++ b/man/useradd.8.xml
-@@ -321,6 +321,11 @@
+Index: b/man/useradd.8.xml
+===================================================================
+--- a/man/useradd.8.xml 2013-07-27 19:33:17.416209819 +0400
++++ b/man/useradd.8.xml 2013-07-27 19:33:19.823730279 +0400
+@@ -340,6 +340,11 @@
databases are resetted to avoid reusing the entry from a previously
deleted user.
</para>
@@ -27,11 +27,11 @@ index 0ae6303..3ee0e38 100644
</listitem>
</varlistentry>
<varlistentry>
-diff --git a/src/useradd.c b/src/useradd.c
-index 4fdb29c..c240ef3 100644
---- a/src/useradd.c
-+++ b/src/useradd.c
-@@ -1011,9 +1011,9 @@ static void process_flags (int argc, char **argv)
+Index: b/src/useradd.c
+===================================================================
+--- a/src/useradd.c 2013-07-27 19:32:50.976096183 +0400
++++ b/src/useradd.c 2013-07-27 19:33:19.826786636 +0400
+@@ -1011,9 +1011,9 @@
};
while ((c = getopt_long (argc, argv,
#ifdef WITH_SELINUX
@@ -43,7 +43,7 @@ index 4fdb29c..c240ef3 100644
#endif /* !WITH_SELINUX */
long_options, NULL)) != -1) {
switch (c) {
-@@ -1136,6 +1136,7 @@ static void process_flags (int argc, char **argv)
+@@ -1136,6 +1136,7 @@
kflg = true;
break;
case 'K':
diff --git a/debian/patches/0009-501_commonio_group_shadow.patch b/debian/patches/0009-501_commonio_group_shadow.patch
index 5150b52..2efd87f 100644
--- a/debian/patches/0009-501_commonio_group_shadow.patch
+++ b/debian/patches/0009-501_commonio_group_shadow.patch
@@ -7,10 +7,10 @@ Fixes: #166793
lib/commonio.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
-diff --git a/lib/commonio.c b/lib/commonio.c
-index 60bcd83..3cde698 100644
---- a/lib/commonio.c
-+++ b/lib/commonio.c
+Index: b/lib/commonio.c
+===================================================================
+--- a/lib/commonio.c 2013-07-27 19:32:49.942585975 +0400
++++ b/lib/commonio.c 2013-07-27 19:33:22.057092716 +0400
@@ -44,6 +44,7 @@
#include <errno.h>
#include <stdio.h>
@@ -19,7 +19,7 @@ index 60bcd83..3cde698 100644
#include "nscd.h"
#ifdef WITH_TCB
#include <tcb.h>
-@@ -966,13 +967,20 @@ int commonio_close (struct commonio_db *db)
+@@ -966,13 +967,20 @@
goto fail;
}
} else {
diff --git a/debian/patches/0010-463_login_delay_obeys_to_PAM.patch b/debian/patches/0010-463_login_delay_obeys_to_PAM.patch
index 8c00f19..1e9ad07 100644
--- a/debian/patches/0010-463_login_delay_obeys_to_PAM.patch
+++ b/debian/patches/0010-463_login_delay_obeys_to_PAM.patch
@@ -12,11 +12,11 @@ Note: If removed, FAIL_DELAY must be re-added to /etc/login.defs
src/login.c | 19 +++++--------------
2 files changed, 6 insertions(+), 15 deletions(-)
-diff --git a/lib/getdef.c b/lib/getdef.c
-index b42795b..038f7a2 100644
---- a/lib/getdef.c
-+++ b/lib/getdef.c
-@@ -60,7 +60,6 @@ static struct itemdef def_table[] = {
+Index: b/lib/getdef.c
+===================================================================
+--- a/lib/getdef.c 2013-07-27 19:33:10.709475162 +0400
++++ b/lib/getdef.c 2013-07-27 19:33:24.102981573 +0400
+@@ -60,7 +60,6 @@
{"ENV_PATH", NULL},
{"ENV_SUPATH", NULL},
{"ERASECHAR", NULL},
@@ -24,7 +24,7 @@ index b42795b..038f7a2 100644
{"FAILLOG_ENAB", NULL},
{"FAKE_SHELL", NULL},
{"FTMP_FILE", NULL},
-@@ -104,6 +103,7 @@ static struct itemdef def_table[] = {
+@@ -104,6 +103,7 @@
{"ENV_HZ", NULL},
{"ENVIRON_FILE", NULL},
{"ENV_TZ", NULL},
@@ -32,11 +32,11 @@ index b42795b..038f7a2 100644
{"ISSUE_FILE", NULL},
{"LASTLOG_ENAB", NULL},
{"LOGIN_STRING", NULL},
-diff --git a/src/login.c b/src/login.c
-index 5792c5e..260bf6d 100644
---- a/src/login.c
-+++ b/src/login.c
-@@ -529,7 +529,6 @@ int main (int argc, char **argv)
+Index: b/src/login.c
+===================================================================
+--- a/src/login.c 2013-07-27 19:33:10.711976461 +0400
++++ b/src/login.c 2013-07-27 19:33:24.107846041 +0400
+@@ -525,7 +525,6 @@
#if defined(HAVE_STRFTIME) && !defined(USE_PAM)
char ptime[80];
#endif
@@ -44,7 +44,7 @@ index 5792c5e..260bf6d 100644
unsigned int retries;
bool subroot = false;
#ifndef USE_PAM
-@@ -549,6 +548,7 @@ int main (int argc, char **argv)
+@@ -545,6 +544,7 @@
pid_t child;
char *pam_user = NULL;
#else
@@ -52,7 +52,7 @@ index 5792c5e..260bf6d 100644
struct spwd *spwd = NULL;
#endif
/*
-@@ -709,7 +709,6 @@ int main (int argc, char **argv)
+@@ -705,7 +705,6 @@
}
environ = newenvp; /* make new environment active */
@@ -60,7 +60,7 @@ index 5792c5e..260bf6d 100644
retries = getdef_unum ("LOGIN_RETRIES", RETRIES);
#ifdef USE_PAM
-@@ -725,8 +724,7 @@ int main (int argc, char **argv)
+@@ -721,8 +720,7 @@
/*
* hostname & tty are either set to NULL or their correct values,
@@ -70,7 +70,7 @@ index 5792c5e..260bf6d 100644
*
* PAM_RHOST and PAM_TTY are used for authentication, only use
* information coming from login or from the caller (e.g. no utmp)
-@@ -735,10 +733,6 @@ int main (int argc, char **argv)
+@@ -731,10 +729,6 @@
PAM_FAIL_CHECK;
retcode = pam_set_item (pamh, PAM_TTY, tty);
PAM_FAIL_CHECK;
@@ -81,7 +81,7 @@ index 5792c5e..260bf6d 100644
/* if fflg, then the user has already been authenticated */
if (!fflg) {
unsigned int failcount = 0;
-@@ -779,12 +773,6 @@ int main (int argc, char **argv)
+@@ -775,12 +769,6 @@
bool failed = false;
failcount++;
@@ -94,7 +94,7 @@ index 5792c5e..260bf6d 100644
retcode = pam_authenticate (pamh, 0);
-@@ -1107,14 +1095,17 @@ int main (int argc, char **argv)
+@@ -1103,14 +1091,17 @@
free (username);
username = NULL;
diff --git a/debian/patches/0011-523_su_arguments_are_concatenated.patch b/debian/patches/0011-523_su_arguments_are_concatenated.patch
index 698c029..45426dc 100644
--- a/debian/patches/0011-523_su_arguments_are_concatenated.patch
+++ b/debian/patches/0011-523_su_arguments_are_concatenated.patch
@@ -10,11 +10,11 @@ Note: the fix of the man page is still missing.
src/su.c | 29 +++++++++++++++++++++++++++++
1 file changed, 29 insertions(+)
-diff --git a/src/su.c b/src/su.c
-index d719011..9f751fe 100644
---- a/src/su.c
-+++ b/src/su.c
-@@ -1150,6 +1150,35 @@ int main (int argc, char **argv)
+Index: b/src/su.c
+===================================================================
+--- a/src/su.c 2013-07-27 19:32:47.985126282 +0400
++++ b/src/su.c 2013-07-27 19:33:26.382799481 +0400
+@@ -1153,6 +1153,35 @@
argv[0] = "-c";
argv[1] = command;
}
diff --git a/debian/patches/0012-523_su_arguments_are_no_more_concatenated_by_default.patch b/debian/patches/0012-523_su_arguments_are_no_more_concatenated_by_default.patch
index 8edfa8a..d0619eb 100644
--- a/debian/patches/0012-523_su_arguments_are_no_more_concatenated_by_default.patch
+++ b/debian/patches/0012-523_su_arguments_are_no_more_concatenated_by_default.patch
@@ -12,11 +12,11 @@ Status wrt upstream: This patch is Debian specific.
src/su.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
-diff --git a/src/su.c b/src/su.c
-index 9f751fe..7405e24 100644
---- a/src/su.c
-+++ b/src/su.c
-@@ -104,6 +104,19 @@ static char caller_name[BUFSIZ];
+Index: b/src/su.c
+===================================================================
+--- a/src/su.c 2013-07-27 19:33:26.382799481 +0400
++++ b/src/su.c 2013-07-27 19:33:28.454184918 +0400
+@@ -104,6 +104,19 @@
/* If nonzero, change some environment vars to indicate the user su'd to. */
static bool change_environment = true;
@@ -36,7 +36,7 @@ index 9f751fe..7405e24 100644
#ifdef USE_PAM
static pam_handle_t *pamh = NULL;
static int caught = 0;
-@@ -950,6 +963,8 @@ int main (int argc, char **argv)
+@@ -950,6 +963,8 @@
int ret;
#endif /* USE_PAM */
@@ -45,7 +45,7 @@ index 9f751fe..7405e24 100644
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
-@@ -1154,7 +1169,7 @@ int main (int argc, char **argv)
+@@ -1157,7 +1172,7 @@
* resulting string is always given to the shell with its
* -c option.
*/
diff --git a/debian/patches/0013-508_nologin_in_usr_sbin.patch b/debian/patches/0013-508_nologin_in_usr_sbin.patch
index 897d62d..cfb5567 100644
--- a/debian/patches/0013-508_nologin_in_usr_sbin.patch
+++ b/debian/patches/0013-508_nologin_in_usr_sbin.patch
@@ -6,11 +6,11 @@ Subject: 508_nologin_in_usr_sbin
src/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/src/Makefile.am b/src/Makefile.am
-index 6a1e46b..3cabcb2 100644
---- a/src/Makefile.am
-+++ b/src/Makefile.am
-@@ -23,7 +23,6 @@ INCLUDES = \
+Index: b/src/Makefile.am
+===================================================================
+--- a/src/Makefile.am 2013-07-27 19:33:12.931554426 +0400
++++ b/src/Makefile.am 2013-07-27 19:33:30.534299490 +0400
+@@ -23,7 +23,6 @@
# $prefix/bin and $prefix/sbin, no install-data hacks...)
bin_PROGRAMS = groups login su
@@ -18,7 +18,7 @@ index 6a1e46b..3cabcb2 100644
ubin_PROGRAMS = faillog lastlog chage chfn chsh expiry gpasswd newgrp passwd
usbin_PROGRAMS = \
cppw \
-@@ -38,6 +37,7 @@ usbin_PROGRAMS = \
+@@ -38,6 +37,7 @@
grpunconv \
logoutd \
newusers \
diff --git a/debian/patches/0014-505_useradd_recommend_adduser.patch b/debian/patches/0014-505_useradd_recommend_adduser.patch
index 4521dff..f75daf3 100644
--- a/debian/patches/0014-505_useradd_recommend_adduser.patch
+++ b/debian/patches/0014-505_useradd_recommend_adduser.patch
@@ -10,11 +10,11 @@ Status wrt upstream: Debian specific patch.
man/userdel.8.xml | 6 ++++++
2 files changed, 12 insertions(+)
-diff --git a/man/useradd.8.xml b/man/useradd.8.xml
-index 3ee0e38..3cdeefe 100644
---- a/man/useradd.8.xml
-+++ b/man/useradd.8.xml
-@@ -84,6 +84,12 @@
+Index: b/man/useradd.8.xml
+===================================================================
+--- a/man/useradd.8.xml 2013-07-27 19:33:19.823730279 +0400
++++ b/man/useradd.8.xml 2013-07-27 19:33:32.593387116 +0400
+@@ -103,6 +103,12 @@
<refsect1 id='description'>
<title>DESCRIPTION</title>
<para>
@@ -27,11 +27,11 @@ index 3ee0e38..3cdeefe 100644
When invoked without the <option>-D</option> option, the
<command>useradd</command> command creates a new user account using
the values specified on the command line plus the default values from
-diff --git a/man/userdel.8.xml b/man/userdel.8.xml
-index 56218a1..51843d0 100644
---- a/man/userdel.8.xml
-+++ b/man/userdel.8.xml
-@@ -64,6 +64,12 @@
+Index: b/man/userdel.8.xml
+===================================================================
+--- a/man/userdel.8.xml 2013-07-27 19:32:45.067199593 +0400
++++ b/man/userdel.8.xml 2013-07-27 19:33:32.594577199 +0400
+@@ -83,6 +83,12 @@
<refsect1 id='description'>
<title>DESCRIPTION</title>
<para>
diff --git a/debian/patches/0015-utmp.c.patch b/debian/patches/0015-utmp.c.patch
index 70e2a23..dc5cafb 100644
--- a/debian/patches/0015-utmp.c.patch
+++ b/debian/patches/0015-utmp.c.patch
@@ -7,10 +7,10 @@ Subject: utmp.c
libmisc/utmp.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
-diff --git a/libmisc/utmp.c b/libmisc/utmp.c
-index 437c3d5..8bb70ce 100644
---- a/libmisc/utmp.c
-+++ b/libmisc/utmp.c
+Index: b/libmisc/utmp.c
+===================================================================
+--- a/libmisc/utmp.c 2013-07-27 19:32:44.088967990 +0400
++++ b/libmisc/utmp.c 2013-07-27 19:33:34.795643614 +0400
@@ -32,15 +32,19 @@
#include <config.h>
@@ -35,7 +35,7 @@ index 437c3d5..8bb70ce 100644
#include <assert.h>
#include <netdb.h>
#include <stdio.h>
-@@ -281,6 +285,10 @@ static void updwtmpx (const char *filename, const struct utmpx *utx)
+@@ -283,6 +287,10 @@
/* ut_exit is only for DEAD_PROCESS */
utent->ut_session = getsid (0);
if (gettimeofday (&tv, NULL) == 0) {
@@ -46,7 +46,7 @@ index 437c3d5..8bb70ce 100644
#ifdef HAVE_STRUCT_UTMP_UT_TIME
utent->ut_time = tv.tv_sec;
#endif /* HAVE_STRUCT_UTMP_UT_TIME */
-@@ -291,6 +299,7 @@ static void updwtmpx (const char *filename, const struct utmpx *utx)
+@@ -293,6 +301,7 @@
utent->ut_tv.tv_sec = tv.tv_sec;
utent->ut_tv.tv_usec = tv.tv_usec;
#endif /* HAVE_STRUCT_UTMP_UT_TV */
diff --git a/debian/patches/0016-getspnam_r.patch b/debian/patches/0016-getspnam_r.patch
index 36c29da..dab21a8 100644
--- a/debian/patches/0016-getspnam_r.patch
+++ b/debian/patches/0016-getspnam_r.patch
@@ -9,11 +9,11 @@ Subject: getspnam_r
libmisc/xgetspnam.c | 4 ++++
3 files changed, 29 insertions(+)
-diff --git a/configure.in b/configure.in
-index c7ef3bf..b85b571 100644
---- a/configure.in
-+++ b/configure.in
-@@ -45,6 +45,25 @@ AC_CHECK_FUNCS(l64a fchmod fchown fsync futimes getgroups gethostname getspnam \
+Index: b/configure.in
+===================================================================
+--- a/configure.in 2013-07-27 19:32:43.118157577 +0400
++++ b/configure.in 2013-07-27 19:33:36.882720394 +0400
+@@ -44,6 +44,25 @@
getpwnam_r getpwuid_r getgrnam_r getgrgid_r getspnam_r getaddrinfo)
AC_SYS_LARGEFILE
@@ -39,10 +39,10 @@ index c7ef3bf..b85b571 100644
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_UID_T
-diff --git a/libmisc/xgetXXbyYY.c b/libmisc/xgetXXbyYY.c
-index 1b0b001..23d74ee 100644
---- a/libmisc/xgetXXbyYY.c
-+++ b/libmisc/xgetXXbyYY.c
+Index: b/libmisc/xgetXXbyYY.c
+===================================================================
+--- a/libmisc/xgetXXbyYY.c 2013-07-27 19:32:43.118120432 +0400
++++ b/libmisc/xgetXXbyYY.c 2013-07-27 19:33:36.883792543 +0400
@@ -89,9 +89,15 @@
exit (13);
}
@@ -59,10 +59,10 @@ index 1b0b001..23d74ee 100644
/* Build a result structure that can be freed by
* the shadow *_free functions. */
LOOKUP_TYPE *ret_result = DUP_FUNCTION(result);
-diff --git a/libmisc/xgetspnam.c b/libmisc/xgetspnam.c
-index 287e97f..b8df928 100644
---- a/libmisc/xgetspnam.c
-+++ b/libmisc/xgetspnam.c
+Index: b/libmisc/xgetspnam.c
+===================================================================
+--- a/libmisc/xgetspnam.c 2013-07-27 19:32:43.118048032 +0400
++++ b/libmisc/xgetspnam.c 2013-07-27 19:33:36.884478544 +0400
@@ -60,5 +60,9 @@
#define DUP_FUNCTION __spw_dup
#define HAVE_FUNCTION_R (defined HAVE_GETSPNAM_R)
diff --git a/debian/patches/0017-environ.patch b/debian/patches/0017-environ.patch
index b4cd428..350f1c0 100644
--- a/debian/patches/0017-environ.patch
+++ b/debian/patches/0017-environ.patch
@@ -8,10 +8,10 @@ Subject: environ
src/su.c | 2 ++
2 files changed, 4 insertions(+)
-diff --git a/lib/spawn.c b/lib/spawn.c
-index da98401..dd52399 100644
---- a/lib/spawn.c
-+++ b/lib/spawn.c
+Index: b/lib/spawn.c
+===================================================================
+--- a/lib/spawn.c 2013-07-27 19:32:42.140004373 +0400
++++ b/lib/spawn.c 2013-07-27 19:33:39.281177833 +0400
@@ -38,6 +38,8 @@
#include "exitcodes.h"
#include "prototypes.h"
@@ -21,10 +21,10 @@ index da98401..dd52399 100644
int run_command (const char *cmd, const char *argv[],
/*@null@*/const char *envp[], /*@out@*/int *status)
{
-diff --git a/src/su.c b/src/su.c
-index 7405e24..7239ba9 100644
---- a/src/su.c
-+++ b/src/su.c
+Index: b/src/su.c
+===================================================================
+--- a/src/su.c 2013-07-27 19:33:28.454184918 +0400
++++ b/src/su.c 2013-07-27 19:33:39.283350594 +0400
@@ -78,6 +78,8 @@
/*@-exitarg@*/
#include "exitcodes.h"
diff --git a/debian/patches/0018-putgrent.patch b/debian/patches/0018-putgrent.patch
index 41852a6..f0b87d8 100644
--- a/debian/patches/0018-putgrent.patch
+++ b/debian/patches/0018-putgrent.patch
@@ -7,10 +7,10 @@ Subject: putgrent
lib/groupio.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
-diff --git a/lib/groupio.c b/lib/groupio.c
-index 4644496..3302d37 100644
---- a/lib/groupio.c
-+++ b/lib/groupio.c
+Index: b/lib/groupio.c
+===================================================================
+--- a/lib/groupio.c 2013-07-27 19:32:41.145129417 +0400
++++ b/lib/groupio.c 2013-07-27 19:33:41.599009065 +0400
@@ -44,6 +44,46 @@
#include "getdef.h"
#include "groupio.h"
diff --git a/debian/patches/0019-putpwent-segfault.patch b/debian/patches/0019-putpwent-segfault.patch
index 093a762..b3e2cd0 100644
--- a/debian/patches/0019-putpwent-segfault.patch
+++ b/debian/patches/0019-putpwent-segfault.patch
@@ -7,10 +7,10 @@ Subject: putpwent-segfault
lib/pwmem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/lib/pwmem.c b/lib/pwmem.c
-index e23a6dc..af0162e 100644
---- a/lib/pwmem.c
-+++ b/lib/pwmem.c
+Index: b/lib/pwmem.c
+===================================================================
+--- a/lib/pwmem.c 2013-07-27 19:32:40.145321915 +0400
++++ b/lib/pwmem.c 2013-07-27 19:33:43.616469907 +0400
@@ -44,7 +44,7 @@
{
struct passwd *pw;
diff --git a/debian/patches/0020-No-RAND_MAX-for-random.patch b/debian/patches/0020-No-RAND_MAX-for-random.patch
index 89890fe..9e313b8 100644
--- a/debian/patches/0020-No-RAND_MAX-for-random.patch
+++ b/debian/patches/0020-No-RAND_MAX-for-random.patch
@@ -6,25 +6,37 @@ Subject: No RAND_MAX for random()
libmisc/salt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
-diff --git a/libmisc/salt.c b/libmisc/salt.c
-index e0f278e..1b650c2 100644
---- a/libmisc/salt.c
-+++ b/libmisc/salt.c
-@@ -90,7 +90,7 @@ static size_t SHA_salt_size (void)
+Index: b/libmisc/salt.c
+===================================================================
+--- a/libmisc/salt.c 2013-07-27 19:32:39.176063851 +0400
++++ b/libmisc/salt.c 2013-07-27 19:33:45.703451890 +0400
+@@ -27,6 +27,11 @@
+ static /*@observer@*/const char *SHA_salt_rounds (/*@null@*/int *prefered_rounds);
+ #endif /* USE_SHA_CRYPT */
+
++#ifdef _RANDOM_MAX
++#undef _RANDOM_MAX
++#endif
++#define _RANDOM_MAX 2147483647L /* 2^31 - 1 */
++
+ #ifndef HAVE_L64A
+ static /*@observer@*/char *l64a(long value)
+ {
+@@ -90,7 +95,7 @@
{
double rand_size;
seedRNG ();
- rand_size = (double) 9.0 * random () / RAND_MAX;
-+ rand_size = (double) 9.0 * random () / LONG_MAX;
++ rand_size = (double) 9.0 * random () / _RANDOM_MAX;
return (size_t) (8 + rand_size);
}
-@@ -132,7 +132,7 @@ static /*@observer@*/const char *SHA_salt_rounds (/*@null@*/int *prefered_rounds
+@@ -132,7 +137,7 @@
seedRNG ();
rand_rounds = (double) (max_rounds-min_rounds+1.0) * random ();
- rand_rounds /= RAND_MAX;
-+ rand_rounds /= LONG_MAX;
++ rand_rounds /= _RANDOM_MAX;
rounds = min_rounds + rand_rounds;
} else if (0 == *prefered_rounds) {
return "";
diff --git a/debian/patches/series b/debian/patches/series
index dfc3104..25fe818 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -18,3 +18,4 @@
0018-putgrent.patch
0019-putpwent-segfault.patch
0020-No-RAND_MAX-for-random.patch
+solaris-ttymon.patch
diff --git a/debian/patches/solaris-ttymon.patch b/debian/patches/solaris-ttymon.patch
new file mode 100644
index 0000000..ac74593
--- /dev/null
+++ b/debian/patches/solaris-ttymon.patch
@@ -0,0 +1,65 @@
+Index: b/src/login.c
+===================================================================
+--- a/src/login.c 2013-07-27 19:33:24.107846041 +0400
++++ b/src/login.c 2013-07-27 19:33:47.744886053 +0400
+@@ -517,6 +517,7 @@
+ int main (int argc, char **argv)
+ {
+ const char *tmptty;
++ const char *ttyprompt;
+ char tty[BUFSIZ];
+
+ #ifdef RLOGIN
+@@ -628,6 +629,8 @@
+
+ setup_tty ();
+
++ ttyprompt = getenv("TTYPROMPT");
++
+ #ifndef USE_PAM
+ (void) umask (getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
+
+@@ -735,19 +738,33 @@
+ char hostn[256];
+ char loginprompt[256]; /* That's one hell of a prompt :) */
+
+- /* Make the login prompt look like we want it */
+- if (gethostname (hostn, sizeof (hostn)) == 0) {
+- snprintf (loginprompt,
+- sizeof (loginprompt),
+- _("%s login: "), hostn);
++ if (ttyprompt == NULL || ttyprompt[0] == '\0') {
++ /* Make the login prompt look like we want it */
++ if (gethostname (hostn, sizeof (hostn)) == 0) {
++ snprintf (loginprompt,
++ sizeof (loginprompt),
++ _("%s login: "), hostn);
++ } else {
++ strncpy (loginprompt, _("login: "),
++ sizeof (loginprompt));
++ }
++
++ retcode = pam_set_item (pamh, PAM_USER_PROMPT, loginprompt);
++ PAM_FAIL_CHECK;
+ } else {
+- strncpy (loginprompt, _("login: "),
+- sizeof (loginprompt));
++ ssize_t r;
++ size_t n;
++ retcode = pam_set_item (pamh, PAM_USER_PROMPT, ttyprompt);
++ PAM_FAIL_CHECK;
++ r = getline(&username, &n, stdin);
++ if (r > 0) {
++ if (username[r-1] == '\n')
++ username[r-1] = '\0';
++ retcode = pam_set_item (pamh, PAM_USER, username);
++ PAM_FAIL_CHECK;
++ }
+ }
+
+- retcode = pam_set_item (pamh, PAM_USER_PROMPT, loginprompt);
+- PAM_FAIL_CHECK;
+-
+ /* if we didn't get a user on the command line,
+ set it to NULL */
+ get_pam_user (&pam_user);