svn commit: r229221 - stable/9/usr.sbin/keyserv

Dimitry Andric dim at FreeBSD.org
Sun Jan 1 22:26:56 UTC 2012


Author: dim
Date: Sun Jan  1 22:26:56 2012
New Revision: 229221
URL: http://svn.freebsd.org/changeset/base/229221

Log:
  MFC r228662:
  
  In usr.sbin/keyserv, fix some implicit enum conversions, and use the
  correct printf length modifiers for uid_t.

Modified:
  stable/9/usr.sbin/keyserv/crypt_server.c
  stable/9/usr.sbin/keyserv/keyserv.c
Directory Properties:
  stable/9/usr.sbin/keyserv/   (props changed)

Modified: stable/9/usr.sbin/keyserv/crypt_server.c
==============================================================================
--- stable/9/usr.sbin/keyserv/crypt_server.c	Sun Jan  1 22:17:12 2012	(r229220)
+++ stable/9/usr.sbin/keyserv/crypt_server.c	Sun Jan  1 22:26:56 2012	(r229221)
@@ -223,8 +223,8 @@ des_crypt_1_svc(desargs *argp, struct sv
 
 	bcopy(argp->des_key, dparm.des_key, 8);
 	bcopy(argp->des_ivec, dparm.des_ivec, 8);
-	dparm.des_mode = argp->des_mode;
-	dparm.des_dir = argp->des_dir;
+	dparm.des_mode = (argp->des_mode == CBC_DES) ? CBC : ECB;
+	dparm.des_dir = (argp->des_dir == ENCRYPT_DES) ? ENCRYPT : DECRYPT;
 #ifdef BROKEN_DES
 	dparm.UDES.UDES_buf = argp->desbuf.desbuf_val;
 #endif

Modified: stable/9/usr.sbin/keyserv/keyserv.c
==============================================================================
--- stable/9/usr.sbin/keyserv/keyserv.c	Sun Jan  1 22:17:12 2012	(r229220)
+++ stable/9/usr.sbin/keyserv/keyserv.c	Sun Jan  1 22:26:56 2012	(r229221)
@@ -361,7 +361,7 @@ key_set_1_svc_prog(uid, key)
 	static keystatus status;
 
 	if (debugging) {
-		(void) fprintf(stderr, "set(%ld, %.*s) = ", uid,
+		(void) fprintf(stderr, "set(%u, %.*s) = ", uid,
 				(int) sizeof (keybuf), key);
 	}
 	status = pk_setkey(uid, key);
@@ -380,7 +380,7 @@ key_encrypt_pk_2_svc_prog(uid, arg)
 	static cryptkeyres res;
 
 	if (debugging) {
-		(void) fprintf(stderr, "encrypt(%ld, %s, %08x%08x) = ", uid,
+		(void) fprintf(stderr, "encrypt(%u, %s, %08x%08x) = ", uid,
 				arg->remotename, arg->deskey.key.high,
 				arg->deskey.key.low);
 	}
@@ -408,7 +408,7 @@ key_decrypt_pk_2_svc_prog(uid, arg)
 	static cryptkeyres res;
 
 	if (debugging) {
-		(void) fprintf(stderr, "decrypt(%ld, %s, %08x%08x) = ", uid,
+		(void) fprintf(stderr, "decrypt(%u, %s, %08x%08x) = ", uid,
 				arg->remotename, arg->deskey.key.high,
 				arg->deskey.key.low);
 	}
@@ -460,7 +460,7 @@ key_net_get_2_svc_prog(uid, arg)
 	static key_netstres keynetname;
 
 	if (debugging)
-		(void) fprintf(stderr, "net_get(%ld) = ", uid);
+		(void) fprintf(stderr, "net_get(%u) = ", uid);
 
 	keynetname.status = pk_netget(uid, &keynetname.key_netstres_u.knet);
 	if (debugging) {
@@ -489,8 +489,8 @@ key_get_conv_2_svc_prog(uid, arg)
 	static cryptkeyres  res;
 
 	if (debugging)
-		(void) fprintf(stderr, "get_conv(%ld, %.*s) = ", uid,
-			(int)sizeof (arg), arg);
+		(void) fprintf(stderr, "get_conv(%u, %.*s) = ", uid,
+			(int)sizeof (keybuf), arg);
 
 
 	res.status = pk_get_conv_key(uid, arg, &res);
@@ -517,7 +517,7 @@ key_encrypt_1_svc_prog(uid, arg)
 	static cryptkeyres res;
 
 	if (debugging) {
-		(void) fprintf(stderr, "encrypt(%ld, %s, %08x%08x) = ", uid,
+		(void) fprintf(stderr, "encrypt(%u, %s, %08x%08x) = ", uid,
 				arg->remotename, arg->deskey.key.high,
 				arg->deskey.key.low);
 	}
@@ -545,7 +545,7 @@ key_decrypt_1_svc_prog(uid, arg)
 	static cryptkeyres res;
 
 	if (debugging) {
-		(void) fprintf(stderr, "decrypt(%ld, %s, %08x%08x) = ", uid,
+		(void) fprintf(stderr, "decrypt(%u, %s, %08x%08x) = ", uid,
 				arg->remotename, arg->deskey.key.high,
 				arg->deskey.key.low);
 	}
@@ -789,7 +789,7 @@ root_auth(trans, rqstp)
 	}
 
 	if (debugging)
-		fprintf(stderr, "local_uid  %ld\n", uid);
+		fprintf(stderr, "local_uid  %u\n", uid);
 	if (uid == 0)
 		return (1);
 	if (rqstp->rq_cred.oa_flavor == AUTH_SYS) {
@@ -800,7 +800,7 @@ root_auth(trans, rqstp)
 		} else {
 			if (debugging)
 				fprintf(stderr,
-			"local_uid  %ld mismatches auth %ld\n", uid,
+			"local_uid  %u mismatches auth %u\n", uid,
 ((uid_t) ((struct authunix_parms *)rqstp->rq_clntcred)->aup_uid));
 			return (0);
 		}


More information about the svn-src-stable-9 mailing list