summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--session.c48
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 @@
11 o) better -mdoc style; 11 o) better -mdoc style;
12 o) typo; 12 o) typo;
13 o) sort SEE ALSO; 13 o) sort SEE ALSO;
14
15 aaron@ ok 14 aaron@ ok
16 - provos@cvs.openbsd.org 2001/06/22 21:27:08 15 - provos@cvs.openbsd.org 2001/06/22 21:27:08
17 [dh.c pathnames.h] 16 [dh.c pathnames.h]
@@ -105,6 +104,7 @@
105 - markus@cvs.openbsd.org 2001/06/24 17:18:31 104 - markus@cvs.openbsd.org 2001/06/24 17:18:31
106 [ttymodes.c] 105 [ttymodes.c]
107 passing modes works fine: debug2->3 106 passing modes works fine: debug2->3
107 - (djm) -Wall fix for session.c
108 108
10920010622 10920010622
110 - (stevesk) handle systems without pw_expire and pw_change. 110 - (stevesk) handle systems without pw_expire and pw_change.
@@ -5789,4 +5789,4 @@
5789 - Wrote replacements for strlcpy and mkdtemp 5789 - Wrote replacements for strlcpy and mkdtemp
5790 - Released 1.0pre1 5790 - Released 1.0pre1
5791 5791
5792$Id: ChangeLog,v 1.1323 2001/06/25 05:24:16 mouring Exp $ 5792$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)
607 original_command = NULL; 607 original_command = NULL;
608} 608}
609 609
610/*
611 * Check for quiet login, either .hushlogin or command given.
612 */
613static int
614check_quietlogin(Session *s, const char *command)
615{
616 char buf[256];
617 struct passwd * pw = s->pw;
618 struct stat st;
619
620 /* Return 1 if .hushlogin exists or a command given. */
621 if (command != NULL)
622 return 1;
623 snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
624#ifdef HAVE_LOGIN_CAP
625 if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0)
626 return 1;
627#else
628 if (stat(buf, &st) >= 0)
629 return 1;
630#endif
631 return 0;
632}
610 633
611/* administrative, login(1)-like work */ 634/* administrative, login(1)-like work */
612void 635void
@@ -706,31 +729,6 @@ do_motd(void)
706 } 729 }
707} 730}
708 731
709
710/*
711 * Check for quiet login, either .hushlogin or command given.
712 */
713int
714check_quietlogin(Session *s, const char *command)
715{
716 char buf[256];
717 struct passwd * pw = s->pw;
718 struct stat st;
719
720 /* Return 1 if .hushlogin exists or a command given. */
721 if (command != NULL)
722 return 1;
723 snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
724#ifdef HAVE_LOGIN_CAP
725 if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0)
726 return 1;
727#else
728 if (stat(buf, &st) >= 0)
729 return 1;
730#endif
731 return 0;
732}
733
734/* 732/*
735 * Sets the value of the given variable in the environment. If the variable 733 * Sets the value of the given variable in the environment. If the variable
736 * already exists, its value is overriden. 734 * already exists, its value is overriden.