From owner-freebsd-bugs Sun Oct 22 7:20: 5 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 9852737B4C5 for ; Sun, 22 Oct 2000 07:20:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id HAA35315; Sun, 22 Oct 2000 07:20:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from racine.cybercable.fr (racine.cybercable.fr [212.198.0.201]) by hub.freebsd.org (Postfix) with SMTP id 5DE7F37B479 for ; Sun, 22 Oct 2000 07:17:06 -0700 (PDT) Received: (qmail 1138600 invoked from network); 22 Oct 2000 14:16:53 -0000 Received: from r227m167.cybercable.tm.fr (HELO gits.dyndns.org) ([195.132.227.167]) (envelope-sender ) by racine.cybercable.fr (qmail-ldap-1.03) with SMTP for ; 22 Oct 2000 14:16:53 -0000 Received: (from root@localhost) by gits.dyndns.org (8.11.0/8.11.0) id e9MEGq816551; Sun, 22 Oct 2000 16:16:52 +0200 (CEST) (envelope-from root) Message-Id: <200010221416.e9MEGq816551@gits.dyndns.org> Date: Sun, 22 Oct 2000 16:16:52 +0200 (CEST) From: Cyrille Lefevre Reply-To: clefevre@citeweb.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/22210: typeof(passwd->pw_gid) != typeof(group->gr_gid) Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 22210 >Category: bin >Synopsis: typeof(passwd->pw_gid) != typeof(group->gr_gid) >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Oct 22 07:20:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Cyrille Lefevre >Release: FreeBSD 4.1-STABLE i386 >Organization: ACME >Environment: FreeBSD gits 4.1-STABLE FreeBSD 4.1-STABLE #3: Sat Sep 23 10:20:30 CEST 2000 root@gits:/disk2/4.0-stable/src/sys/compile/CUSTOM i386 >Description: the type of the gr_gid member of struct group doesn't match the type of the pw_gid member of struct passwd which prevent a simple comparison such as passwd->pw_gid == group->gr_gid w/o a compiler warning. >How-To-Repeat: cat << EOF > /tmp/c.c #include #include #include int main () { struct passwd *passwd; struct group *group; passwd = getpwnam("root"); group = getgrnam("wheel"); printf ("%d\n", passwd->pw_gid == group->gr_gid); return (0); } EOF cc -W -Wall /tmp/c.c -o /tmp/c /tmp/c.c: In function `main': /tmp/c.c:11: warning: comparison between signed and unsigned >Fix: Index: grp.h =================================================================== RCS file: /home/ncvs/src/include/grp.h,v retrieving revision 1.3 diff -u -r1.3 grp.h --- grp.h 1997/05/07 19:59:59 1.3 +++ grp.h 2000/10/22 14:09:14 @@ -41,6 +41,8 @@ #ifndef _GRP_H_ #define _GRP_H_ +#include + #ifndef _POSIX_SOURCE #define _PATH_GROUP "/etc/group" #endif @@ -48,7 +50,7 @@ struct group { char *gr_name; /* group name */ char *gr_passwd; /* group password */ - int gr_gid; /* group id */ + gid_t gr_gid; /* group id */ char **gr_mem; /* group members */ }; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message