[1272] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

krb5b4pl3: kadmin/v4server/acl_files.c: type fix, fix to return-value checking

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Fri Mar 24 12:49:07 1995

From: "Jonathan I. Kamens" <jik@cam.ov.com>
Date: Fri, 24 Mar 1995 12:52:09 -0500
To: krb5-bugs@MIT.EDU

Two fixes, one minor, one major, in kadmin/v4server/acl_files.c:

1) acl_abort needs to be declared before it is used.

2) fputs returns EOF, not NULL, on error.

--- acl_files.c	1995/03/24 17:48:40	1.1
+++ acl_files.c	1995/03/24 17:50:51
@@ -25,6 +25,7 @@
 #include <sys/fcntl.h>
 #endif
 #include "krb.h"
+#include <krb5/krb5.h>
 
 #ifndef KRB_REALM
 #define KRB_REALM	"ATHENA.MIT.EDU"
@@ -54,6 +55,8 @@
 extern char *malloc(), *calloc();
 extern time_t time();
 
+static int acl_abort PROTOTYPE((char *acl_file, FILE *f));
+
 /* Canonicalize a principal name */
 /* If instance is missing, it becomes "" */
 /* If realm is missing, it becomes the local realm */
@@ -492,8 +495,8 @@
     /* It isn't there yet, copy the file and put it in */
     for(i = 0; i < acl_cache[idx].acl->size; i++) {
 	if(acl_cache[idx].acl->tbl[i] != NULL) {
-	    if(fputs(acl_cache[idx].acl->tbl[i], new) == NULL
-	       || putc('\n', new) != '\n') {
+	    if((fputs(acl_cache[idx].acl->tbl[i], new) == EOF)
+	       || (putc('\n', new) != '\n')) {
 		   acl_abort(acl, new);
 		   return(-1);
 	       }

home help back first fref pref prev next nref lref last post