bin/71661: [PATCH] cleanup of the usr.sbin/keyserv code

Dan Lukes dan at obluda.cz
Sun Sep 12 10:40:26 PDT 2004


>Number:         71661
>Category:       bin
>Synopsis:       [PATCH] cleanup of the usr.sbin/keyserv code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 12 17:40:24 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD 5.3-BETA3 i386
>Organization:
Obludarium
>Environment:
System: FreeBSD kulesh.obluda.cz 5.3-BETA3 FreeBSD 5.3-BETA3 #8: Sun Sep 5 07:06:40 CEST 2004 dan at kulesh.obluda.cz:/usr/obj/usr/src/sys/Dan i386
usr.sbin/keyserv/keyserv.c,v 1.11 2003/02/18 01:35:58 kris

>Description:
	There are more than 5000 warnings issued during "make buildworld".
Some of them are false positives, but some of them are sign of true errors.

	Nobody is upset by warnings due it's amount, so some errors remain
uncorrected.

	I want to cleanup the code-base from warnings, so warnings will
become "attention mark" again.

usr.sbin/keyserv/keyserv.c:365: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:385: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:413: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:463: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:493: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:522: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:550: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:792: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:804: warning: long int format, uid_t arg (arg 3)
usr.sbin/keyserv/keyserv.c:804: warning: long int format, unsigned int arg (arg 4)

>How-To-Repeat:
	N/A
>Fix:
*** usr.sbin/keyserv/keyserv.c.ORIG	Tue Feb 18 20:12:59 2003
--- usr.sbin/keyserv/keyserv.c	Sun Sep 12 05:11:38 2004
***************
*** 361,367 ****
  	static keystatus status;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "set(%ld, %.*s) = ", uid,
  				(int) sizeof (keybuf), key);
  	}
  	status = pk_setkey(uid, key);
--- 361,367 ----
  	static keystatus status;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "set(%ld, %.*s) = ", (long)uid,
  				(int) sizeof (keybuf), key);
  	}
  	status = pk_setkey(uid, key);
***************
*** 380,386 ****
  	static cryptkeyres res;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "encrypt(%ld, %s, %08x%08x) = ", uid,
  				arg->remotename, arg->deskey.key.high,
  				arg->deskey.key.low);
  	}
--- 380,386 ----
  	static cryptkeyres res;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "encrypt(%ld, %s, %08x%08x) = ", (long)uid,
  				arg->remotename, arg->deskey.key.high,
  				arg->deskey.key.low);
  	}
***************
*** 408,414 ****
  	static cryptkeyres res;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "decrypt(%ld, %s, %08x%08x) = ", uid,
  				arg->remotename, arg->deskey.key.high,
  				arg->deskey.key.low);
  	}
--- 408,414 ----
  	static cryptkeyres res;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "decrypt(%ld, %s, %08x%08x) = ", (long)uid,
  				arg->remotename, arg->deskey.key.high,
  				arg->deskey.key.low);
  	}
***************
*** 460,466 ****
  	static key_netstres keynetname;
  
  	if (debugging)
! 		(void) fprintf(stderr, "net_get(%ld) = ", uid);
  
  	keynetname.status = pk_netget(uid, &keynetname.key_netstres_u.knet);
  	if (debugging) {
--- 460,466 ----
  	static key_netstres keynetname;
  
  	if (debugging)
! 		(void) fprintf(stderr, "net_get(%ld) = ", (long)uid);
  
  	keynetname.status = pk_netget(uid, &keynetname.key_netstres_u.knet);
  	if (debugging) {
***************
*** 489,495 ****
  	static cryptkeyres  res;
  
  	if (debugging)
! 		(void) fprintf(stderr, "get_conv(%ld, %.*s) = ", uid,
  			(int)sizeof (arg), arg);
  
  
--- 489,495 ----
  	static cryptkeyres  res;
  
  	if (debugging)
! 		(void) fprintf(stderr, "get_conv(%ld, %.*s) = ", (long)uid,
  			(int)sizeof (arg), arg);
  
  
***************
*** 517,523 ****
  	static cryptkeyres res;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "encrypt(%ld, %s, %08x%08x) = ", uid,
  				arg->remotename, arg->deskey.key.high,
  				arg->deskey.key.low);
  	}
--- 517,523 ----
  	static cryptkeyres res;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "encrypt(%ld, %s, %08x%08x) = ", (long)uid,
  				arg->remotename, arg->deskey.key.high,
  				arg->deskey.key.low);
  	}
***************
*** 545,551 ****
  	static cryptkeyres res;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "decrypt(%ld, %s, %08x%08x) = ", uid,
  				arg->remotename, arg->deskey.key.high,
  				arg->deskey.key.low);
  	}
--- 545,551 ----
  	static cryptkeyres res;
  
  	if (debugging) {
! 		(void) fprintf(stderr, "decrypt(%ld, %s, %08x%08x) = ", (long)uid,
  				arg->remotename, arg->deskey.key.high,
  				arg->deskey.key.low);
  	}
***************
*** 789,795 ****
  	}
  
  	if (debugging)
! 		fprintf(stderr, "local_uid  %ld\n", uid);
  	if (uid == 0)
  		return (1);
  	if (rqstp->rq_cred.oa_flavor == AUTH_SYS) {
--- 789,795 ----
  	}
  
  	if (debugging)
! 		fprintf(stderr, "local_uid  %ld\n", (long)uid);
  	if (uid == 0)
  		return (1);
  	if (rqstp->rq_cred.oa_flavor == AUTH_SYS) {
***************
*** 800,807 ****
  		} else {
  			if (debugging)
  				fprintf(stderr,
! 			"local_uid  %ld mismatches auth %ld\n", uid,
! ((uid_t) ((struct authunix_parms *)rqstp->rq_clntcred)->aup_uid));
  			return (0);
  		}
  	} else {
--- 800,807 ----
  		} else {
  			if (debugging)
  				fprintf(stderr,
! 			"local_uid  %ld mismatches auth %ld\n", (long)uid,
! (long)((uid_t) ((struct authunix_parms *)rqstp->rq_clntcred)->aup_uid));
  			return (0);
  		}
  	} else {
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list