diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | session.c | 70 |
2 files changed, 38 insertions, 35 deletions
@@ -133,6 +133,7 @@ | |||
133 | - (bal) forget a few new files in sync up. | 133 | - (bal) forget a few new files in sync up. |
134 | - (bal) Makefile fix up requires scard.c | 134 | - (bal) Makefile fix up requires scard.c |
135 | - (stevesk) sync misc.h | 135 | - (stevesk) sync misc.h |
136 | - (stevesk) more sync for session.c | ||
136 | 137 | ||
137 | 20010629 | 138 | 20010629 |
138 | - (bal) Removed net_aton() since we don't use it any more | 139 | - (bal) Removed net_aton() since we don't use it any more |
@@ -5960,4 +5961,4 @@ | |||
5960 | - Wrote replacements for strlcpy and mkdtemp | 5961 | - Wrote replacements for strlcpy and mkdtemp |
5961 | - Released 1.0pre1 | 5962 | - Released 1.0pre1 |
5962 | 5963 | ||
5963 | $Id: ChangeLog,v 1.1379 2001/07/04 17:25:54 stevesk Exp $ | 5964 | $Id: ChangeLog,v 1.1380 2001/07/04 18:23:03 stevesk Exp $ |
@@ -121,20 +121,21 @@ struct Session { | |||
121 | /* func */ | 121 | /* func */ |
122 | 122 | ||
123 | Session *session_new(void); | 123 | Session *session_new(void); |
124 | void session_set_fds(Session *, int, int, int); | 124 | void session_set_fds(Session *, int, int, int); |
125 | static void session_pty_cleanup(void *); | 125 | static void session_pty_cleanup(void *); |
126 | void session_proctitle(Session *); | 126 | void session_proctitle(Session *); |
127 | int session_setup_x11fwd(Session *); | 127 | int session_setup_x11fwd(Session *); |
128 | void do_exec_pty(Session *, const char *); | 128 | void do_exec_pty(Session *, const char *); |
129 | void do_exec_no_pty(Session *, const char *); | 129 | void do_exec_no_pty(Session *, const char *); |
130 | void do_exec(Session *, const char *); | 130 | void do_exec(Session *, const char *); |
131 | void do_login(Session *, const char *); | 131 | void do_login(Session *, const char *); |
132 | void do_child(Session *, const char *); | 132 | void do_child(Session *, const char *); |
133 | void do_motd(void); | 133 | void do_motd(void); |
134 | int check_quietlogin(Session *, const char *); | ||
134 | 135 | ||
135 | static void do_authenticated1(Authctxt *); | 136 | static void do_authenticated1(Authctxt *); |
136 | static void do_authenticated2(Authctxt *); | 137 | static void do_authenticated2(Authctxt *); |
137 | 138 | ||
138 | static void session_close(Session *); | 139 | static void session_close(Session *); |
139 | static int session_pty_req(Session *); | 140 | static 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 | */ | ||
676 | static int | ||
677 | check_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 */ |
698 | void | 675 | void |
699 | do_login(Session *s, const char *command) | 676 | do_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 | */ | ||
776 | int | ||
777 | check_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. |