summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2001-07-04 18:23:02 +0000
committerKevin Steves <stevesk@pobox.com>2001-07-04 18:23:02 +0000
commit8f63caa1973bb714fd80357b46d57f328e928b14 (patch)
tree61b4ee1a5b87a9efa40d7186c66d76a41d056eec /session.c
parent08ccf9d08c44a622166ccae6b80495391d649df0 (diff)
- (stevesk) more sync for session.c
Diffstat (limited to 'session.c')
-rw-r--r--session.c70
1 files changed, 36 insertions, 34 deletions
diff --git a/session.c b/session.c
index 04b940721..8b9b7cc4b 100644
--- a/session.c
+++ b/session.c
@@ -121,20 +121,21 @@ struct Session {
121/* func */ 121/* func */
122 122
123Session *session_new(void); 123Session *session_new(void);
124void session_set_fds(Session *, int, int, int); 124void session_set_fds(Session *, int, int, int);
125static void session_pty_cleanup(void *); 125static void session_pty_cleanup(void *);
126void session_proctitle(Session *); 126void session_proctitle(Session *);
127int session_setup_x11fwd(Session *); 127int session_setup_x11fwd(Session *);
128void do_exec_pty(Session *, const char *); 128void do_exec_pty(Session *, const char *);
129void do_exec_no_pty(Session *, const char *); 129void do_exec_no_pty(Session *, const char *);
130void do_exec(Session *, const char *); 130void do_exec(Session *, const char *);
131void do_login(Session *, const char *); 131void do_login(Session *, const char *);
132void do_child(Session *, const char *); 132void do_child(Session *, const char *);
133void do_motd(void); 133void do_motd(void);
134int check_quietlogin(Session *, const char *);
134 135
135static void do_authenticated1(Authctxt *); 136static void do_authenticated1(Authctxt *);
136static void do_authenticated2(Authctxt *); 137static void do_authenticated2(Authctxt *);
137 138
138static void session_close(Session *); 139static void session_close(Session *);
139static int session_pty_req(Session *); 140static int session_pty_req(Session *);
140 141
@@ -670,30 +671,6 @@ do_exec(Session *s, const char *command)
670 original_command = NULL; 671 original_command = NULL;
671} 672}
672 673
673/*
674 * Check for quiet login, either .hushlogin or command given.
675 */
676static int
677check_quietlogin(Session *s, const char *command)
678{
679 char buf[256];
680 struct passwd *pw = s->pw;
681 struct stat st;
682
683 /* Return 1 if .hushlogin exists or a command given. */
684 if (command != NULL)
685 return 1;
686 snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
687#ifdef HAVE_LOGIN_CAP
688 if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0)
689 return 1;
690#else
691 if (stat(buf, &st) >= 0)
692 return 1;
693#endif
694 return 0;
695}
696
697/* administrative, login(1)-like work */ 674/* administrative, login(1)-like work */
698void 675void
699do_login(Session *s, const char *command) 676do_login(Session *s, const char *command)
@@ -792,6 +769,31 @@ do_motd(void)
792 } 769 }
793} 770}
794 771
772
773/*
774 * Check for quiet login, either .hushlogin or command given.
775 */
776int
777check_quietlogin(Session *s, const char *command)
778{
779 char buf[256];
780 struct passwd *pw = s->pw;
781 struct stat st;
782
783 /* Return 1 if .hushlogin exists or a command given. */
784 if (command != NULL)
785 return 1;
786 snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir);
787#ifdef HAVE_LOGIN_CAP
788 if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0)
789 return 1;
790#else
791 if (stat(buf, &st) >= 0)
792 return 1;
793#endif
794 return 0;
795}
796
795/* 797/*
796 * Sets the value of the given variable in the environment. If the variable 798 * Sets the value of the given variable in the environment. If the variable
797 * already exists, its value is overriden. 799 * already exists, its value is overriden.