summaryrefslogtreecommitdiff
path: root/openbsd-compat/bsd-cray.c
diff options
context:
space:
mode:
authorKevin Steves <stevesk@pobox.com>2001-08-14 21:02:15 +0000
committerKevin Steves <stevesk@pobox.com>2001-08-14 21:02:15 +0000
commit4da21abd24856fe6dc3cc89d2ccf870f46dd5029 (patch)
tree5e6ad734259348d0439fc109d1842e587c932a6e /openbsd-compat/bsd-cray.c
parent72992afb264bb7601e98e34f02fc524145081fe7 (diff)
- (stevesk) bsd-cray.c: more cleanup; ok wendyp@cray.com
Diffstat (limited to 'openbsd-compat/bsd-cray.c')
-rw-r--r--openbsd-compat/bsd-cray.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c
index a03344f72..fa76641c8 100644
--- a/openbsd-compat/bsd-cray.c
+++ b/openbsd-compat/bsd-cray.c
@@ -35,9 +35,7 @@ char cray_tmpdir[TPATHSIZ+1]; /* job TMPDIR path */
35 * Functions. 35 * Functions.
36 */ 36 */
37void cray_retain_utmp(struct utmp *, int); 37void cray_retain_utmp(struct utmp *, int);
38void cray_create_tmpdir(int, uid_t, gid_t); 38void cray_delete_tmpdir(char *, int, uid_t);
39void cray_delete_tmpdir(char *, int , uid_t);
40void cray_job_termination_handler (int);
41void cray_init_job(struct passwd *); 39void cray_init_job(struct passwd *);
42void cray_set_tmpdir(struct utmp *); 40void cray_set_tmpdir(struct utmp *);
43 41
@@ -73,8 +71,8 @@ cray_setup(uid_t uid, char *username)
73 if (p == NULL) 71 if (p == NULL)
74 fatal("No UDB entry for %.100s", username); 72 fatal("No UDB entry for %.100s", username);
75 if (uid != p->ue_uid) 73 if (uid != p->ue_uid)
76 fatal("UDB etnry %.100s uid(%d) does not match uid %d", 74 fatal("UDB entry %.100s uid(%d) does not match uid %d",
77 username, p->ue_uid, uid); 75 username, (int) p->ue_uid, (int) uid);
78 for (j = 0; p->ue_acids[j] != -1 && j < MAXVIDS; j++) { 76 for (j = 0; p->ue_acids[j] != -1 && j < MAXVIDS; j++) {
79 accts[naccts] = p->ue_acids[j]; 77 accts[naccts] = p->ue_acids[j];
80 naccts++; 78 naccts++;
@@ -133,13 +131,13 @@ drop_cray_privs()
133 131
134 memset(&usrv, 0, sizeof(usrv)); 132 memset(&usrv, 0, sizeof(usrv));
135 if (setusrv(&usrv) < 0) 133 if (setusrv(&usrv) < 0)
136 fatal("%s(%d): setusrv(): %s\n", __FILE__, __LINE__, 134 fatal("%s(%d): setusrv(): %s", __FILE__, __LINE__,
137 strerror(errno)); 135 strerror(errno));
138 136
139 if ((privstate = priv_init_proc()) != NULL) { 137 if ((privstate = priv_init_proc()) != NULL) {
140 result = priv_set_proc(privstate); 138 result = priv_set_proc(privstate);
141 if (result != 0 ) 139 if (result != 0 )
142 fatal("%s(%d): priv_set_proc(): %s\n", 140 fatal("%s(%d): priv_set_proc(): %s",
143 __FILE__, __LINE__, strerror(errno)); 141 __FILE__, __LINE__, strerror(errno));
144 priv_free_proc(privstate); 142 priv_free_proc(privstate);
145 } 143 }
@@ -202,7 +200,7 @@ cray_delete_tmpdir(char *login, int jid, uid_t uid)
202 return; 200 return;
203 201
204 if ((child = fork()) == 0) { 202 if ((child = fork()) == 0) {
205 execl(CLEANTMPCMD, CLEANTMPCMD, login, jtmp, 0); 203 execl(CLEANTMPCMD, CLEANTMPCMD, login, jtmp, (char *)NULL);
206 fatal("cray_delete_tmpdir: execl of CLEANTMPCMD failed"); 204 fatal("cray_delete_tmpdir: execl of CLEANTMPCMD failed");
207 } 205 }
208 206