summaryrefslogtreecommitdiff
path: root/lib/ZCkAuth.c
diff options
context:
space:
mode:
authorGravatar John Kohl <jtkohl@mit.edu>1988-06-28 14:13:13 +0000
committerGravatar John Kohl <jtkohl@mit.edu>1988-06-28 14:13:13 +0000
commitff6ad002d7db0b11e61f7943b3aa3436bedd0d94 (patch)
tree3e6111135a8dfd710515f2bb1f03b98d0d98998b /lib/ZCkAuth.c
parentcfa30a1a94c9b46742fae240e89d3f7d64b8b9bc (diff)
use symbolic return values
Diffstat (limited to 'lib/ZCkAuth.c')
-rw-r--r--lib/ZCkAuth.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/ZCkAuth.c b/lib/ZCkAuth.c
index 6bfd6ba..6d0cdb2 100644
--- a/lib/ZCkAuth.c
+++ b/lib/ZCkAuth.c
@@ -40,14 +40,14 @@ int ZCheckAuthentication(notice, from)
CREDENTIALS cred;
if (!notice->z_auth)
- return (0);
+ return (ZAUTH_NO);
if (__Zephyr_server) {
if (ZReadAscii(notice->z_ascii_authent,
strlen(notice->z_ascii_authent)+1,
(unsigned char *)authent.dat,
notice->z_authent_len) == ZERR_BADFIELD) {
- return (0);
+ return (ZAUTH_NO);
}
authent.length = notice->z_authent_len;
result = krb_rd_req(&authent, SERVER_SERVICE,
@@ -59,15 +59,15 @@ int ZCheckAuthentication(notice, from)
(void) sprintf(srcprincipal, "%s%s%s@%s", dat.pname,
dat.pinst[0]?".":"", dat.pinst, dat.prealm);
if (strcmp(srcprincipal, notice->z_sender))
- return (0);
- return(1);
+ return (ZAUTH_NO);
+ return(ZAUTH_YES);
} else
- return (-1); /* didn't decode correctly */
+ return (ZAUTH_FAILED); /* didn't decode correctly */
}
if (result = krb_get_cred(SERVER_SERVICE, SERVER_INSTANCE,
__Zephyr_realm, &cred))
- return (0);
+ return (ZAUTH_NO);
our_checksum = (ZChecksum_t)quad_cksum(notice->z_packet, NULL,
notice->z_default_format+
@@ -75,9 +75,9 @@ int ZCheckAuthentication(notice, from)
notice->z_packet, 0, cred.session);
/* if mismatched checksum, then the packet was corrupted */
- return ((our_checksum == notice->z_checksum) ? 0 : -1);
+ return ((our_checksum == notice->z_checksum) ? ZAUTH_YES : ZAUTH_FAILED);
#else
- return (notice->z_auth ? 1 : 0);
+ return (notice->z_auth ? ZAUTH_YES : ZAUTH_NO);
#endif
}