register struct rx_call *acall;
register struct afsconf_dir *adir;
{
- LOCK_GLOBAL_MUTEX return ((afsconf_SuperUser(adir, acall, NULL) == 0) ?
- 10029 : 0);
-UNLOCK_GLOBAL_MUTEX}
+ LOCK_GLOBAL_MUTEX;
+ return ((afsconf_SuperUser(adir, acall, NULL) == 0) ? 10029 : 0);
+ UNLOCK_GLOBAL_MUTEX;
+}
#endif /* !defined(UKERNEL) */
static int
{
int rc;
- LOCK_GLOBAL_MUTEX rc = GetNoAuthFlag(adir);
- UNLOCK_GLOBAL_MUTEX return rc;
+ LOCK_GLOBAL_MUTEX;
+ rc = GetNoAuthFlag(adir);
+ UNLOCK_GLOBAL_MUTEX;
+ return rc;
}
void
{
register afs_int32 code;
- LOCK_GLOBAL_MUTEX if (aflag == 0) {
+ LOCK_GLOBAL_MUTEX;
+ if (aflag == 0) {
/* turn off noauth flag */
code = (unlink(AFSDIR_SERVER_NOAUTH_FILEPATH) ? errno : 0);
osi_audit(NoAuthDisableEvent, code, AUD_END);
} else
osi_audit(NoAuthEnableEvent, errno, AUD_END);
}
-UNLOCK_GLOBAL_MUTEX}
+ UNLOCK_GLOBAL_MUTEX;
+}
/* deletes a user from the UserList file */
int
struct stat tstat;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX strcompose(tbuffer, sizeof tbuffer, adir->name, "/",
- AFSDIR_ULIST_FILE, NULL);
+ LOCK_GLOBAL_MUTEX;
+ strcompose(tbuffer, sizeof tbuffer, adir->name, "/",
+ AFSDIR_ULIST_FILE, NULL);
#ifndef AFS_NT40_ENV
{
/*
#endif /* AFS_NT40_ENV */
tf = fopen(tbuffer, "r");
if (!tf) {
- UNLOCK_GLOBAL_MUTEX return -1;
+ UNLOCK_GLOBAL_MUTEX;
+ return -1;
}
code = stat(tbuffer, &tstat);
if (code < 0) {
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
strcpy(nbuffer, tbuffer);
strcat(nbuffer, ".NXX");
nf = fopen(nbuffer, "w+");
if (!nf) {
fclose(tf);
- UNLOCK_GLOBAL_MUTEX return EIO;
+ UNLOCK_GLOBAL_MUTEX;
+ return EIO;
}
flag = 0;
found = 0;
unlink(nbuffer);
/* finally, decide what to return to the caller */
- UNLOCK_GLOBAL_MUTEX if (flag)
- return EIO; /* something mysterious went wrong */
+ UNLOCK_GLOBAL_MUTEX;
+ if (flag)
+ return EIO; /* something mysterious went wrong */
if (!found)
return ENOENT; /* entry wasn't found, no changes made */
return 0; /* everything was fine */
register int flag;
register afs_int32 code;
- LOCK_GLOBAL_MUTEX strcompose(tbuffer, sizeof tbuffer, adir->name, "/",
- AFSDIR_ULIST_FILE, NULL);
+ LOCK_GLOBAL_MUTEX;
+ strcompose(tbuffer, sizeof tbuffer, adir->name, "/",
+ AFSDIR_ULIST_FILE, NULL);
tf = fopen(tbuffer, "r");
if (!tf) {
- UNLOCK_GLOBAL_MUTEX return 1;
+ UNLOCK_GLOBAL_MUTEX;
+ return 1;
}
flag = 1;
while (1) {
if (flag == 0)
strcpy(abuffer, tname);
fclose(tf);
- UNLOCK_GLOBAL_MUTEX return flag;
+ UNLOCK_GLOBAL_MUTEX;
+ return flag;
}
/* returns true iff user is in the UserList file */
register afs_int32 code;
char tbuffer[256];
- LOCK_GLOBAL_MUTEX if (FindUser(adir, aname)) {
- UNLOCK_GLOBAL_MUTEX return EEXIST; /* already in the list */
+ LOCK_GLOBAL_MUTEX;
+ if (FindUser(adir, aname)) {
+ UNLOCK_GLOBAL_MUTEX;
+ return EEXIST; /* already in the list */
}
strcompose(tbuffer, sizeof tbuffer, adir->name, "/", AFSDIR_ULIST_FILE,
NULL);
tf = fopen(tbuffer, "a+");
if (!tf) {
- UNLOCK_GLOBAL_MUTEX return EIO;
+ UNLOCK_GLOBAL_MUTEX;
+ return EIO;
}
fprintf(tf, "%s\n", aname);
code = 0;
code = EIO;
if (fclose(tf))
code = EIO;
- UNLOCK_GLOBAL_MUTEX return code;
+ UNLOCK_GLOBAL_MUTEX;
+ return code;
}
/* special CompFindUser routine that builds up a princ and then
register afs_int32 code;
int flag;
- LOCK_GLOBAL_MUTEX if (!adir) {
- UNLOCK_GLOBAL_MUTEX return 0;
+ LOCK_GLOBAL_MUTEX;
+ if (!adir) {
+ UNLOCK_GLOBAL_MUTEX;
+ return 0;
}
if (afsconf_GetNoAuthFlag(adir)) {
if (namep)
strcpy(namep, "<NoAuth>");
- UNLOCK_GLOBAL_MUTEX return 1;
+ UNLOCK_GLOBAL_MUTEX;
+ return 1;
}
tconn = rx_ConnectionOf(acall);
code = rx_SecurityClassOf(tconn);
if (code == 0) {
- UNLOCK_GLOBAL_MUTEX return 0; /* not authenticated at all, answer is no */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* not authenticated at all, answer is no */
} else if (code == 1) {
/* bcrypt tokens */
- UNLOCK_GLOBAL_MUTEX return 0; /* not supported any longer */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* not supported any longer */
} else if (code == 2) {
char tname[MAXKTCNAMELEN]; /* authentication from ticket */
char tinst[MAXKTCNAMELEN];
rxkad_GetServerInfo(acall->conn, NULL, &exp, tname, tinst, tcell,
NULL);
if (code) {
- UNLOCK_GLOBAL_MUTEX return 0; /* bogus connection/other error */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* bogus connection/other error */
}
/* don't bother checking anything else if tix have expired */
#else
if (exp < FT_ApproxTime()) {
#endif
- UNLOCK_GLOBAL_MUTEX return 0; /* expired tix */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* expired tix */
}
/* generate lowercased version of cell name */
if (namep)
strcpy(namep, uname);
- UNLOCK_GLOBAL_MUTEX return flag;
+ UNLOCK_GLOBAL_MUTEX;
+ return flag;
} else { /* some other auth type */
- UNLOCK_GLOBAL_MUTEX return 0; /* mysterious, just say no */
+ UNLOCK_GLOBAL_MUTEX;
+ return 0; /* mysterious, just say no */
}
}