From 8f63caa1973bb714fd80357b46d57f328e928b14 Mon Sep 17 00:00:00 2001 From: Kevin Steves Date: Wed, 4 Jul 2001 18:23:02 +0000 Subject: - (stevesk) more sync for session.c --- ChangeLog | 3 ++- session.c | 70 ++++++++++++++++++++++++++++++++------------------------------- 2 files changed, 38 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index 161c4dde7..b939819c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -133,6 +133,7 @@ - (bal) forget a few new files in sync up. - (bal) Makefile fix up requires scard.c - (stevesk) sync misc.h + - (stevesk) more sync for session.c 20010629 - (bal) Removed net_aton() since we don't use it any more @@ -5960,4 +5961,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1379 2001/07/04 17:25:54 stevesk Exp $ +$Id: ChangeLog,v 1.1380 2001/07/04 18:23:03 stevesk Exp $ diff --git a/session.c b/session.c index 04b940721..8b9b7cc4b 100644 --- a/session.c +++ b/session.c @@ -121,20 +121,21 @@ struct Session { /* func */ Session *session_new(void); -void session_set_fds(Session *, int, int, int); -static void session_pty_cleanup(void *); -void session_proctitle(Session *); -int session_setup_x11fwd(Session *); -void do_exec_pty(Session *, const char *); -void do_exec_no_pty(Session *, const char *); -void do_exec(Session *, const char *); -void do_login(Session *, const char *); -void do_child(Session *, const char *); +void session_set_fds(Session *, int, int, int); +static void session_pty_cleanup(void *); +void session_proctitle(Session *); +int session_setup_x11fwd(Session *); +void do_exec_pty(Session *, const char *); +void do_exec_no_pty(Session *, const char *); +void do_exec(Session *, const char *); +void do_login(Session *, const char *); +void do_child(Session *, const char *); void do_motd(void); +int check_quietlogin(Session *, const char *); static void do_authenticated1(Authctxt *); static void do_authenticated2(Authctxt *); - + static void session_close(Session *); static int session_pty_req(Session *); @@ -670,30 +671,6 @@ 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 do_login(Session *s, const char *command) @@ -792,6 +769,31 @@ 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. -- cgit v1.2.3