diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | auth-sia.c | 33 | ||||
-rw-r--r-- | session.c | 8 |
3 files changed, 32 insertions, 14 deletions
@@ -34,6 +34,9 @@ | |||
34 | [session.c] | 34 | [session.c] |
35 | Split motd and hushlogin checks into seperate functions, helps for | 35 | Split motd and hushlogin checks into seperate functions, helps for |
36 | portable. From Chris Adams <cmadams@hiwaay.net>; ok markus@ | 36 | portable. From Chris Adams <cmadams@hiwaay.net>; ok markus@ |
37 | - Fix OSF SIA support displaying too much information for quiet | ||
38 | logins and logins where access was denied by SIA. Patch from Chris Adams | ||
39 | <cmadams@hiwaay.net> | ||
37 | 40 | ||
38 | 20010415 | 41 | 20010415 |
39 | - OpenBSD CVS Sync | 42 | - OpenBSD CVS Sync |
@@ -5119,4 +5122,4 @@ | |||
5119 | - Wrote replacements for strlcpy and mkdtemp | 5122 | - Wrote replacements for strlcpy and mkdtemp |
5120 | - Released 1.0pre1 | 5123 | - Released 1.0pre1 |
5121 | 5124 | ||
5122 | $Id: ChangeLog,v 1.1127 2001/04/16 08:29:15 djm Exp $ | 5125 | $Id: ChangeLog,v 1.1128 2001/04/16 08:37:05 djm Exp $ |
diff --git a/auth-sia.c b/auth-sia.c index 6fece555d..4e947cd4e 100644 --- a/auth-sia.c +++ b/auth-sia.c | |||
@@ -61,35 +61,46 @@ session_setup_sia(char *user, char *tty) | |||
61 | host = get_canonical_hostname (options.reverse_mapping_check); | 61 | host = get_canonical_hostname (options.reverse_mapping_check); |
62 | 62 | ||
63 | if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, tty, 0, | 63 | if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, tty, 0, |
64 | NULL) != SIASUCCESS) | 64 | NULL) != SIASUCCESS) { |
65 | fatal("sia_ses_init failed"); | 65 | error("sia_ses_init failed"); |
66 | exit(1); | ||
67 | } | ||
66 | 68 | ||
67 | if ((pw = getpwnam(user)) == NULL) { | 69 | if ((pw = getpwnam(user)) == NULL) { |
68 | sia_ses_release(&ent); | 70 | sia_ses_release(&ent); |
69 | fatal("getpwnam(%s) failed: %s", user, strerror(errno)); | 71 | error("getpwnam(%s) failed: %s", user, strerror(errno)); |
72 | exit(1); | ||
70 | } | 73 | } |
71 | if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) { | 74 | if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) { |
72 | sia_ses_release(&ent); | 75 | sia_ses_release(&ent); |
73 | fatal("sia_make_entity_pwd failed"); | 76 | error("sia_make_entity_pwd failed"); |
77 | exit(1); | ||
74 | } | 78 | } |
75 | 79 | ||
76 | ent->authtype = SIA_A_NONE; | 80 | ent->authtype = SIA_A_NONE; |
77 | if (sia_ses_estab(sia_collect_trm, ent) != SIASUCCESS) | 81 | if (sia_ses_estab(sia_collect_trm, ent) != SIASUCCESS) { |
78 | fatal("couldn't establish session for %s from %s", user, | 82 | error("couldn't establish session for %s from %s", user, |
79 | host); | 83 | host); |
84 | exit(1); | ||
85 | } | ||
80 | 86 | ||
81 | if (setpriority(PRIO_PROCESS, 0, 0) == -1) { | 87 | if (setpriority(PRIO_PROCESS, 0, 0) == -1) { |
82 | sia_ses_release(&ent); | 88 | sia_ses_release(&ent); |
83 | fatal("setpriority failed: %s", strerror (errno)); | 89 | error("setpriority failed: %s", strerror (errno)); |
90 | exit(1); | ||
84 | } | 91 | } |
85 | 92 | ||
86 | if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS) | 93 | if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS) { |
87 | fatal("couldn't launch session for %s from %s", user, host); | 94 | error("couldn't launch session for %s from %s", user, host); |
95 | exit(1); | ||
96 | } | ||
88 | 97 | ||
89 | sia_ses_release(&ent); | 98 | sia_ses_release(&ent); |
90 | 99 | ||
91 | if (setreuid(geteuid(), geteuid()) < 0) | 100 | if (setreuid(geteuid(), geteuid()) < 0) { |
92 | fatal("setreuid failed: %s", strerror (errno)); | 101 | error("setreuid failed: %s", strerror (errno)); |
102 | exit(1); | ||
103 | } | ||
93 | } | 104 | } |
94 | 105 | ||
95 | #endif /* HAVE_OSF_SIA */ | 106 | #endif /* HAVE_OSF_SIA */ |
@@ -635,8 +635,10 @@ do_exec_pty(Session *s, const char *command) | |||
635 | close(ttyfd); | 635 | close(ttyfd); |
636 | 636 | ||
637 | /* record login, etc. similar to login(1) */ | 637 | /* record login, etc. similar to login(1) */ |
638 | #ifndef HAVE_OSF_SIA | ||
638 | if (!(options.use_login && command == NULL)) | 639 | if (!(options.use_login && command == NULL)) |
639 | do_login(s, command); | 640 | do_login(s, command); |
641 | #endif | ||
640 | 642 | ||
641 | /* Do common processing for the child, such as execing the command. */ | 643 | /* Do common processing for the child, such as execing the command. */ |
642 | do_child(s, command); | 644 | do_child(s, command); |
@@ -1052,7 +1054,7 @@ do_child(Session *s, const char *command) | |||
1052 | if (options.use_login && command != NULL) | 1054 | if (options.use_login && command != NULL) |
1053 | options.use_login = 0; | 1055 | options.use_login = 0; |
1054 | 1056 | ||
1055 | #ifndef USE_PAM /* pam_nologin handles this */ | 1057 | #if !defined(USE_PAM) && !defined(HAVE_OSF_SIA) |
1056 | if (!options.use_login) { | 1058 | if (!options.use_login) { |
1057 | # ifdef HAVE_LOGIN_CAP | 1059 | # ifdef HAVE_LOGIN_CAP |
1058 | if (!login_getcapbool(lc, "ignorenologin", 0) && pw->pw_uid) | 1060 | if (!login_getcapbool(lc, "ignorenologin", 0) && pw->pw_uid) |
@@ -1070,7 +1072,7 @@ do_child(Session *s, const char *command) | |||
1070 | exit(254); | 1072 | exit(254); |
1071 | } | 1073 | } |
1072 | } | 1074 | } |
1073 | #endif /* USE_PAM */ | 1075 | #endif /* USE_PAM || HAVE_OSF_SIA */ |
1074 | 1076 | ||
1075 | /* Set login name, uid, gid, and groups. */ | 1077 | /* Set login name, uid, gid, and groups. */ |
1076 | /* Login(1) does this as well, and it needs uid 0 for the "-h" | 1078 | /* Login(1) does this as well, and it needs uid 0 for the "-h" |
@@ -1078,6 +1080,8 @@ do_child(Session *s, const char *command) | |||
1078 | if (!options.use_login) { | 1080 | if (!options.use_login) { |
1079 | #ifdef HAVE_OSF_SIA | 1081 | #ifdef HAVE_OSF_SIA |
1080 | session_setup_sia(pw->pw_name, s->ttyfd == -1 ? NULL : s->tty); | 1082 | session_setup_sia(pw->pw_name, s->ttyfd == -1 ? NULL : s->tty); |
1083 | if (!check_quietlogin(s, command)) | ||
1084 | do_motd(); | ||
1081 | #else /* HAVE_OSF_SIA */ | 1085 | #else /* HAVE_OSF_SIA */ |
1082 | #ifdef HAVE_CYGWIN | 1086 | #ifdef HAVE_CYGWIN |
1083 | if (is_winnt) { | 1087 | if (is_winnt) { |