From 2d5ac08f13a8e1f52f00c8ad67f9f03736371cc2 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Mon, 25 Jun 2001 17:07:59 +1000 Subject: [PATCH] -Wall --- ChangeLog | 4 ++-- session.c | 48 +++++++++++++++++++++++------------------------- 2 files changed, 25 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0388c47e1..932d6f757 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,6 @@ o) better -mdoc style; o) typo; o) sort SEE ALSO; - aaron@ ok - provos@cvs.openbsd.org 2001/06/22 21:27:08 [dh.c pathnames.h] @@ -105,6 +104,7 @@ - markus@cvs.openbsd.org 2001/06/24 17:18:31 [ttymodes.c] passing modes works fine: debug2->3 + - (djm) -Wall fix for session.c 20010622 - (stevesk) handle systems without pw_expire and pw_change. @@ -5789,4 +5789,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1323 2001/06/25 05:24:16 mouring Exp $ +$Id: ChangeLog,v 1.1324 2001/06/25 07:07:59 djm Exp $ diff --git a/session.c b/session.c index 92870a111..0571c2f64 100644 --- a/session.c +++ b/session.c @@ -607,6 +607,29 @@ do_exec(Session *s, const char *command) original_command = NULL; } +/* + * Check for quiet login, either .hushlogin or command given. + */ +static int +check_quietlogin(Session *s, const char *command) +{ + char buf[256]; + struct passwd * pw = s->pw; + struct stat st; + + /* Return 1 if .hushlogin exists or a command given. */ + if (command != NULL) + return 1; + snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir); +#ifdef HAVE_LOGIN_CAP + if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0) + return 1; +#else + if (stat(buf, &st) >= 0) + return 1; +#endif + return 0; +} /* administrative, login(1)-like work */ void @@ -706,31 +729,6 @@ do_motd(void) } } - -/* - * Check for quiet login, either .hushlogin or command given. - */ -int -check_quietlogin(Session *s, const char *command) -{ - char buf[256]; - struct passwd * pw = s->pw; - struct stat st; - - /* Return 1 if .hushlogin exists or a command given. */ - if (command != NULL) - return 1; - snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir); -#ifdef HAVE_LOGIN_CAP - if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0) - return 1; -#else - if (stat(buf, &st) >= 0) - return 1; -#endif - return 0; -} - /* * Sets the value of the given variable in the environment. If the variable * already exists, its value is overriden.