summaryrefslogtreecommitdiff
path: root/auth-sia.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2002-04-11 20:39:40 +0000
committerKevin Steves <stevesk@pobox.com>2002-04-11 20:39:40 +0000
commit0c283d8444cace9aad1793b9ebdbceb4726c6d9a (patch)
tree4285fc466513a192ce0bc1afcd19137e6d9a9dc2 /auth-sia.c
parente0f2ca46518a1d4c48102b547b13aeee636e80a6 (diff)
- (stevesk) [auth-sia.c] cleanup
Diffstat (limited to 'auth-sia.c')
-rw-r--r--auth-sia.c25
1 files changed, 8 insertions, 17 deletions
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)
55void 55void
56session_setup_sia(char *user, char *tty) 56session_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