diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | auth-sia.c | 25 |
2 files changed, 12 insertions, 18 deletions
@@ -1,3 +1,6 @@ | |||
1 | 20020411 | ||
2 | - (stevesk) [auth-sia.c] cleanup | ||
3 | |||
1 | 20020410 | 4 | 20020410 |
2 | - (stevesk) [configure.ac monitor.c] HAVE_SOCKETPAIR | 5 | - (stevesk) [configure.ac monitor.c] HAVE_SOCKETPAIR |
3 | - (stevesk) [auth-sia.c] compile fix Chris Adams <cmadams@hiwaay.net> | 6 | - (stevesk) [auth-sia.c] compile fix Chris Adams <cmadams@hiwaay.net> |
@@ -8215,4 +8218,4 @@ | |||
8215 | - Wrote replacements for strlcpy and mkdtemp | 8218 | - Wrote replacements for strlcpy and mkdtemp |
8216 | - Released 1.0pre1 | 8219 | - Released 1.0pre1 |
8217 | 8220 | ||
8218 | $Id: ChangeLog,v 1.2044 2002/04/10 22:04:54 stevesk Exp $ | 8221 | $Id: ChangeLog,v 1.2045 2002/04/11 20:39:40 stevesk Exp $ |
diff --git a/auth-sia.c b/auth-sia.c index 3a4159448..26b62aadf 100644 --- a/auth-sia.c +++ b/auth-sia.c | |||
@@ -41,7 +41,7 @@ auth_sia_password(Authctxt *authctxt, char *pass) | |||
41 | return(0); | 41 | return(0); |
42 | 42 | ||
43 | if ((ret = sia_ses_authent(NULL, pass, ent)) != SIASUCCESS) { | 43 | if ((ret = sia_ses_authent(NULL, pass, ent)) != SIASUCCESS) { |
44 | error("couldn't authenticate %s from %s", user, host); | 44 | error("Couldn't authenticate %s from %s", user, host); |
45 | if (ret & SIASTOP) | 45 | if (ret & SIASTOP) |
46 | sia_ses_release(&ent); | 46 | sia_ses_release(&ent); |
47 | return(0); | 47 | return(0); |
@@ -55,7 +55,6 @@ auth_sia_password(Authctxt *authctxt, char *pass) | |||
55 | void | 55 | void |
56 | session_setup_sia(char *user, char *tty) | 56 | session_setup_sia(char *user, char *tty) |
57 | { | 57 | { |
58 | int ret; | ||
59 | struct passwd *pw; | 58 | struct passwd *pw; |
60 | SIAENTITY *ent = NULL; | 59 | SIAENTITY *ent = NULL; |
61 | const char *host; | 60 | const char *host; |
@@ -64,46 +63,38 @@ session_setup_sia(char *user, char *tty) | |||
64 | 63 | ||
65 | if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, tty, 0, | 64 | if (sia_ses_init(&ent, saved_argc, saved_argv, host, user, tty, 0, |
66 | NULL) != SIASUCCESS) { | 65 | NULL) != SIASUCCESS) { |
67 | error("sia_ses_init failed"); | 66 | fatal("sia_ses_init failed"); |
68 | exit(1); | ||
69 | } | 67 | } |
70 | 68 | ||
71 | if ((pw = getpwnam(user)) == NULL) { | 69 | if ((pw = getpwnam(user)) == NULL) { |
72 | sia_ses_release(&ent); | 70 | sia_ses_release(&ent); |
73 | error("getpwnam(%s) failed: %s", user, strerror(errno)); | 71 | fatal("getpwnam: no user: %s", user); |
74 | exit(1); | ||
75 | } | 72 | } |
76 | if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) { | 73 | if (sia_make_entity_pwd(pw, ent) != SIASUCCESS) { |
77 | sia_ses_release(&ent); | 74 | sia_ses_release(&ent); |
78 | error("sia_make_entity_pwd failed"); | 75 | fatal("sia_make_entity_pwd failed"); |
79 | exit(1); | ||
80 | } | 76 | } |
81 | 77 | ||
82 | ent->authtype = SIA_A_NONE; | 78 | ent->authtype = SIA_A_NONE; |
83 | if (sia_ses_estab(sia_collect_trm, ent) != SIASUCCESS) { | 79 | if (sia_ses_estab(sia_collect_trm, ent) != SIASUCCESS) { |
84 | error("couldn't establish session for %s from %s", user, | 80 | fatal("Couldn't establish session for %s from %s", user, |
85 | host); | 81 | host); |
86 | exit(1); | ||
87 | } | 82 | } |
88 | 83 | ||
89 | if (setpriority(PRIO_PROCESS, 0, 0) == -1) { | 84 | if (setpriority(PRIO_PROCESS, 0, 0) == -1) { |
90 | sia_ses_release(&ent); | 85 | sia_ses_release(&ent); |
91 | error("setpriority failed: %s", strerror (errno)); | 86 | fatal("setpriority: %s", strerror (errno)); |
92 | exit(1); | ||
93 | } | 87 | } |
94 | 88 | ||
95 | if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS) { | 89 | if (sia_ses_launch(sia_collect_trm, ent) != SIASUCCESS) { |
96 | error("couldn't launch session for %s from %s", user, host); | 90 | fatal("Couldn't launch session for %s from %s", user, host); |
97 | exit(1); | ||
98 | } | 91 | } |
99 | 92 | ||
100 | sia_ses_release(&ent); | 93 | sia_ses_release(&ent); |
101 | 94 | ||
102 | if (setreuid(geteuid(), geteuid()) < 0) { | 95 | if (setreuid(geteuid(), geteuid()) < 0) { |
103 | error("setreuid failed: %s", strerror (errno)); | 96 | fatal("setreuid: %s", strerror(errno)); |
104 | exit(1); | ||
105 | } | 97 | } |
106 | } | 98 | } |
107 | 99 | ||
108 | #endif /* HAVE_OSF_SIA */ | 100 | #endif /* HAVE_OSF_SIA */ |
109 | |||