From: Erez Zadok Date: Fri, 23 Jul 2004 18:29:22 +0000 (+0000) Subject: * Minor new port i386-pc-linux-suse8.2: minor new port to SuSE X-Git-Tag: before-retrans-udp-tcp-split~30 X-Git-Url: https://git.fsl.cs.stonybrook.edu/?a=commitdiff_plain;h=cc9c2aca4f2333011a056bdf3c9e03156d5d300f;p=am-utils-6.0.git * Minor new port i386-pc-linux-suse8.2: minor new port to SuSE 8.2. This systems' latest GCC (gcc version 3.3 20030226 prerelease) correctly caught a lot of possibly bad comparisons between signed and unsigned quantities. * hlfsd/homedir.c (table_add, plt_search): changed first arg of both functions to u_int. * hlfsd/hlfsd.h, hlfsd/hlfsd.c: change 'cache_interval' to u_int. Changed proto for plt_search arg to u_int. * amq/amq.c (show_mi, main): change 'i' to u_int. * amq/pawd.c (find_mlp): change 'i' to u_int. * amd/srvr_nfs.c (find_nfs_srvr): change proto_nfs_version to u_int. * amd/amd.h: change prototype of vreaddir and amfs_error_readdir to use u_int count parameter. * amd/ops_TEMPLATE.c (foofs_readdir), amd/amfs_error.c (amfs_error_readdir): change 'count' parameter in proto to u_int. * amd/amd.h: change proto of amfs_generic_readdir() to use u_int count parameter. * amd/readdir.c (make_entry_chain): preflen should be u_int. (amfs_readdir_browsable): change 'count' to u_int. (amfs_generic_readdir): change 'count' to u_int. * amd/amd.h: amu_global_options's portmap_program field should be u_long, not int (to match RPC conventions). Change am_fh's fhh_gen field to u_int, to match am_gen field in struct am_node. * amd/conf.c (gopt_portmap_program): use atol() instead of atoi() to avoid size differences. * conf/mount/mount_linux.c (find_unused_loop_device): cast to int to avoid comparison between chars and integers. * libamu/mount_fs.c (get_hex_string): change 'i' to u_int to avoid comparisons between signed and unsigned integers. --- diff --git a/.cvsignore b/.cvsignore index 36f3a5c..d541412 100644 --- a/.cvsignore +++ b/.cvsignore @@ -121,3 +121,4 @@ A.sparc64-unknown-linux-deb3.0 A.i386-unknown-freebsd5.2.1 A.i386-pc-linux-suse9.1 A.i386-unknown-freebsd4.10 +A.i386-pc-linux-suse8.2 diff --git a/ChangeLog b/ChangeLog index 7596c6d..d158931 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,49 @@ +2004-07-23 Erez Zadok + + * Minor new port i386-pc-linux-suse8.2: minor new port to SuSE + 8.2. This systems' latest GCC (gcc version 3.3 20030226 + prerelease) correctly caught a lot of possibly bad comparisons + between signed and unsigned quantities. + + * hlfsd/homedir.c (table_add, plt_search): changed first arg of + both functions to u_int. + + * hlfsd/hlfsd.h, hlfsd/hlfsd.c: change 'cache_interval' to u_int. + Changed proto for plt_search arg to u_int. + + * amq/amq.c (show_mi, main): change 'i' to u_int. + + * amq/pawd.c (find_mlp): change 'i' to u_int. + + * amd/srvr_nfs.c (find_nfs_srvr): change proto_nfs_version to + u_int. + + * amd/amd.h: change prototype of vreaddir and amfs_error_readdir + to use u_int count parameter. + + * amd/ops_TEMPLATE.c (foofs_readdir), amd/amfs_error.c + (amfs_error_readdir): change 'count' parameter in proto to u_int. + + * amd/amd.h: change proto of amfs_generic_readdir() to use u_int + count parameter. + + * amd/readdir.c (make_entry_chain): preflen should be u_int. + (amfs_readdir_browsable): change 'count' to u_int. + (amfs_generic_readdir): change 'count' to u_int. + + * amd/amd.h: amu_global_options's portmap_program field should be + u_long, not int (to match RPC conventions). Change am_fh's + fhh_gen field to u_int, to match am_gen field in struct am_node. + + * amd/conf.c (gopt_portmap_program): use atol() instead of atoi() + to avoid size differences. + + * conf/mount/mount_linux.c (find_unused_loop_device): cast to int + to avoid comparison between chars and integers. + + * libamu/mount_fs.c (get_hex_string): change 'i' to u_int to avoid + comparisons between signed and unsigned integers. + 2004-07-13 Erez Zadok * minor new port: i386-pc-linux-suse9.1. diff --git a/NEWS b/NEWS index 2c8cc0a..3b971b2 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ *** Notes specific to am-utils version 6.1b5pre - minor new ports: + i386-pc-linux-suse8.2 i386-pc-linux-suse9.1 i386-pc-solaris2.10 i386-unknown-freebsd4.8 diff --git a/amd/amd.h b/amd/amd.h index 491ba5f..c82d716 100644 --- a/amd/amd.h +++ b/amd/amd.h @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: amd.h,v 1.52 2004/01/22 05:01:06 ezk Exp $ + * $Id: amd.h,v 1.53 2004/07/23 18:29:22 ezk Exp $ * */ @@ -224,7 +224,7 @@ typedef int (*vmount_fs) (am_node *, mntfs *); typedef int (*vumount_fs) (am_node *, mntfs *); typedef am_node *(*vlookup_child) (am_node *, char *, int *, int); typedef am_node *(*vmount_child) (am_node *, int *); -typedef int (*vreaddir) (am_node *, nfscookie, nfsdirlist *, nfsentry *, int); +typedef int (*vreaddir) (am_node *, nfscookie, nfsdirlist *, nfsentry *, u_int); typedef am_node *(*vreadlink) (am_node *, int *); typedef void (*vmounted) (mntfs *); typedef void (*vumounted) (mntfs *); @@ -262,7 +262,7 @@ struct amu_global_options { int amfs_auto_timeo; /* NFS retry interval */ int am_timeo; /* cache duration */ int am_timeo_w; /* dismount interval */ - int portmap_program; /* amd RPC program number */ + u_long portmap_program; /* amd RPC program number */ #ifdef HAVE_MAP_HESIOD char *hesiod_base; /* Hesiod rhs */ #endif /* HAVE_MAP_HESIOD */ @@ -485,7 +485,7 @@ struct am_node { struct am_fh { int fhh_pid; /* process id */ int fhh_id; /* map id */ - int fhh_gen; /* generation number */ + u_int fhh_gen; /* generation number */ }; /* @@ -740,7 +740,7 @@ extern am_ops amfs_root_ops; /* Root file system */ */ extern am_node *amfs_generic_lookup_child(am_node *mp, char *fname, int *error_return, int op); extern am_node *amfs_generic_mount_child(am_node *ap, int *error_return); -extern int amfs_generic_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, int count); +extern int amfs_generic_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count); extern int amfs_generic_umount(am_node *mp, mntfs *mf); extern void amfs_generic_mounted(mntfs *mf); extern char *amfs_generic_match(am_opts *fo); @@ -776,7 +776,7 @@ extern am_ops amfs_direct_ops; /* Direct Automount file system (this too) */ extern am_ops amfs_error_ops; /* Error file system */ extern am_node *amfs_error_lookup_child(am_node *mp, char *fname, int *error_return, int op); extern am_node *amfs_error_mount_child(am_node *ap, int *error_return); -extern int amfs_error_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, int count); +extern int amfs_error_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count); #endif /* HAVE_AMU_FS_ERROR */ /* diff --git a/amd/amfs_error.c b/amd/amfs_error.c index e84efcd..29720c7 100644 --- a/amd/amfs_error.c +++ b/amd/amfs_error.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: amfs_error.c,v 1.16 2004/01/06 03:56:19 ezk Exp $ + * $Id: amfs_error.c,v 1.17 2004/07/23 18:29:22 ezk Exp $ * */ @@ -145,7 +145,7 @@ amfs_error_mount_child(am_node *ap, int *error_return) * If we do then just give an error. */ int -amfs_error_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, int count) +amfs_error_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count) { return ESTALE; } diff --git a/amd/conf.c b/amd/conf.c index 02cdb39..de69b11 100644 --- a/amd/conf.c +++ b/amd/conf.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: conf.c,v 1.24 2004/04/28 04:22:13 ib42 Exp $ + * $Id: conf.c,v 1.25 2004/07/23 18:29:22 ezk Exp $ * */ @@ -678,7 +678,7 @@ gopt_mount_type(const char *val) static int gopt_portmap_program(const char *val) { - gopt.portmap_program = atoi(val); + gopt.portmap_program = atol(val); /* * allow alternate program numbers to be no more than 10 offset from * official amd program number (300019). diff --git a/amd/ops_TEMPLATE.c b/amd/ops_TEMPLATE.c index 3827f0e..63a190b 100644 --- a/amd/ops_TEMPLATE.c +++ b/amd/ops_TEMPLATE.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: ops_TEMPLATE.c,v 1.14 2004/01/06 03:56:20 ezk Exp $ + * $Id: ops_TEMPLATE.c,v 1.15 2004/07/23 18:29:22 ezk Exp $ * */ @@ -64,7 +64,7 @@ static int foofs_init(mntfs *mf); static int foofs_mount(am_node *mp, mntfs *mf); static int foofs_umount(am_node *mp, mntfs *mf); static am_node *foofs_lookuppn(am_node *mp, char *fname, int *error_return, int op); -static int foofs_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, int count); +static int foofs_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count); static am_node *foofs_readlink(am_node *mp, int *error_return); static void foofs_mounted(am_node *am, mntfs *mf); static void foofs_umounted(am_node *mp, mntfs *mf); @@ -220,7 +220,7 @@ foofs_lookuppn(am_node *mp, char *fname, int *error_return, int op) * If OK, fills in ep with chain of directory entries. */ static int -foofs_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, int count) +foofs_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count) { int error = 0; diff --git a/amd/readdir.c b/amd/readdir.c index e9da527..0332265 100644 --- a/amd/readdir.c +++ b/amd/readdir.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: readdir.c,v 1.2 2004/01/06 03:56:20 ezk Exp $ + * $Id: readdir.c,v 1.3 2004/07/23 18:29:22 ezk Exp $ * */ @@ -61,7 +61,7 @@ ****************************************************************************/ static int key_already_in_chain(char *keyname, const nfsentry *chain); static nfsentry *make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable); -static int amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, int count, int fully_browsable); +static int amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count, int fully_browsable); /**************************************************************************** @@ -98,7 +98,8 @@ make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable static nfsentry chain[MAX_CHAIN]; static int max_entries = MAX_CHAIN; char *key; - int num_entries = 0, preflen = 0, i; + int num_entries = 0, i; + u_int preflen = 0; nfsentry *retval = (nfsentry *) NULL; mntfs *mf; mnt_map *mmp; @@ -200,7 +201,7 @@ make_entry_chain(am_node *mp, const nfsentry *current_chain, int fully_browsable /* This one is called only if map is browsable */ static int -amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, int count, int fully_browsable) +amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count, int fully_browsable) { u_int gen = *(u_int *) cookie; int chain_length, i; @@ -367,7 +368,7 @@ amfs_readdir_browsable(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry * * browsing if browsable_dirs=yes was set on the map. */ int -amfs_generic_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, int count) +amfs_generic_readdir(am_node *mp, nfscookie cookie, nfsdirlist *dp, nfsentry *ep, u_int count) { u_int gen = *(u_int *) cookie; am_node *xp; diff --git a/amd/srvr_nfs.c b/amd/srvr_nfs.c index 9f475f1..d9aba35 100644 --- a/amd/srvr_nfs.c +++ b/amd/srvr_nfs.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: srvr_nfs.c,v 1.35 2004/01/06 03:56:20 ezk Exp $ + * $Id: srvr_nfs.c,v 1.36 2004/07/23 18:29:22 ezk Exp $ * */ @@ -793,7 +793,7 @@ find_nfs_srvr(mntfs *mf) } #ifdef MNTTAB_OPT_PROTO else { - int proto_nfs_version; + u_int proto_nfs_version; char **p; for (p = protocols; *p; p++) { diff --git a/amq/amq.c b/amq/amq.c index b1969f1..a7f4517 100644 --- a/amq/amq.c +++ b/amq/amq.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: amq.c,v 1.18 2004/01/06 03:56:20 ezk Exp $ + * $Id: amq.c,v 1.19 2004/07/23 18:29:22 ezk Exp $ * */ @@ -53,7 +53,7 @@ char copyright[] = "\ @(#)Copyright (c) 1990 The Regents of the University of California.\n\ @(#)All rights reserved.\n"; #if __GNUC__ < 2 -static char rcsid[] = "$Id: amq.c,v 1.18 2004/01/06 03:56:20 ezk Exp $"; +static char rcsid[] = "$Id: amq.c,v 1.19 2004/07/23 18:29:22 ezk Exp $"; #endif /* __GNUC__ < 2 */ #endif /* not lint */ @@ -216,7 +216,7 @@ show_mt(amq_mount_tree *mt, enum show_opt e, int *mwid, int *dwid, int *pwid) static void show_mi(amq_mount_info_list *ml, enum show_opt e, int *mwid, int *dwid, int *twid) { - int i; + u_int i; switch (e) { @@ -552,7 +552,8 @@ Usage: %s [-fmpsvwHTU] [-h hostname] [-l log_file|\"syslog\"]\n\ char *wd = getcwd(path, MAXPATHLEN+1); amq_mount_tree_list *mlp = amqproc_export_1((voidp) 0, clnt); amq_mount_tree_p mt; - int i, flag; + u_int i; + int flag; if (!wd) { perror("getcwd"); @@ -676,8 +677,9 @@ Usage: %s [-fmpsvwHTU] [-h hostname] [-l log_file|\"syslog\"]\n\ if (mlp) { enum show_opt e = Calc; int mwid = 0, dwid = 0, pwid = 0; + while (e != ShowDone) { - int i; + u_int i; for (i = 0; i < mlp->amq_mount_tree_list_len; i++) { show_mt(mlp->amq_mount_tree_list_val[i], e, &mwid, &dwid, &pwid); diff --git a/amq/pawd.c b/amq/pawd.c index 7bf4fb9..be7d1c2 100644 --- a/amq/pawd.c +++ b/amq/pawd.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: pawd.c,v 1.11 2004/01/06 03:56:20 ezk Exp $ + * $Id: pawd.c,v 1.12 2004/07/23 18:29:22 ezk Exp $ * */ @@ -90,7 +90,7 @@ find_mt(amq_mount_tree *mt, char *dir) static int find_mlp(amq_mount_tree_list *mlp, char *dir) { - int i; + u_int i; for (i = 0; i < mlp->amq_mount_tree_list_len; i++) { if (find_mt(mlp->amq_mount_tree_list_val[i], dir)) diff --git a/conf/mount/mount_linux.c b/conf/mount/mount_linux.c index ac34e01..ff03ff8 100644 --- a/conf/mount/mount_linux.c +++ b/conf/mount/mount_linux.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: mount_linux.c,v 1.38 2004/01/06 03:56:20 ezk Exp $ + * $Id: mount_linux.c,v 1.39 2004/07/23 18:29:22 ezk Exp $ */ /* @@ -733,7 +733,7 @@ find_unused_loop_device(void) FILE *procdev; #define LOOP_FMT_SIZE(a) (sizeof(a)/sizeof(a[0])) - for (j = 0; j < LOOP_FMT_SIZE(loop_formats); j++) { + for (j = 0; j < (int) LOOP_FMT_SIZE(loop_formats); j++) { for(i = 0; i < 256; i++) { sprintf(dev, loop_formats[j], i); if (stat(dev, &statbuf) == 0 && S_ISBLK(statbuf.st_mode)) { diff --git a/fsinfo/wr_atab.c b/fsinfo/wr_atab.c index 2c99299..2c043a4 100644 --- a/fsinfo/wr_atab.c +++ b/fsinfo/wr_atab.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: wr_atab.c,v 1.8 2004/01/06 03:56:20 ezk Exp $ + * $Id: wr_atab.c,v 1.9 2004/07/23 18:29:22 ezk Exp $ * */ @@ -53,7 +53,7 @@ * Write a sequence of automount mount map entries */ static int -write_amount_info(FILE *af, automount *ap, int sk) +write_amount_info(FILE *af, automount *ap, u_int sk) { int errors = 0; diff --git a/hlfsd/hlfsd.c b/hlfsd/hlfsd.c index 1a2b224..66e7475 100644 --- a/hlfsd/hlfsd.c +++ b/hlfsd/hlfsd.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: hlfsd.c,v 1.27 2004/01/22 05:01:06 ezk Exp $ + * $Id: hlfsd.c,v 1.28 2004/07/23 18:29:22 ezk Exp $ * * HLFSD was written at Columbia University Computer Science Department, by * Erez Zadok and Alexander Dupuy @@ -84,7 +84,7 @@ char *logfile = DEFAULT_LOGFILE; char *passwdfile = NULL; /* alternate passwd file to use */ char *slinkname = 0; char hostname[MAXHOSTNAMELEN + 1] = "localhost"; -int cache_interval = DEFAULT_CACHE_INTERVAL; +u_int cache_interval = DEFAULT_CACHE_INTERVAL; gid_t hlfs_gid = (gid_t) INVALIDID; int masterpid = 0; int noverify = 0; diff --git a/hlfsd/hlfsd.h b/hlfsd/hlfsd.h index ba44b54..6e78b60 100644 --- a/hlfsd/hlfsd.h +++ b/hlfsd/hlfsd.h @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: hlfsd.h,v 1.14 2004/01/06 03:56:20 ezk Exp $ + * $Id: hlfsd.h,v 1.15 2004/07/23 18:29:22 ezk Exp $ * * HLFSD was written at Columbia University Computer Science Department, by * Erez Zadok and Alexander Dupuy @@ -142,14 +142,14 @@ extern char *mailbox(int, char *); extern char *passwdfile; extern char *slinkname; extern gid_t hlfs_gid; -extern int cache_interval; +extern u_int cache_interval; extern int noverify; extern int serverpid; extern int untab_index(char *username); extern am_nfs_fh *root_fhp; extern am_nfs_fh root; extern nfstime startup; -extern uid2home_t *plt_search(int); +extern uid2home_t *plt_search(u_int); extern username2uid_t *untab; /* user name table */ extern void fatal(char *); extern void plt_init(void); diff --git a/hlfsd/homedir.c b/hlfsd/homedir.c index 9b1080c..bf06e7d 100644 --- a/hlfsd/homedir.c +++ b/hlfsd/homedir.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: homedir.c,v 1.18 2004/01/06 03:56:20 ezk Exp $ + * $Id: homedir.c,v 1.19 2004/07/23 18:29:22 ezk Exp $ * * HLFSD was written at Columbia University Computer Science Department, by * Erez Zadok and Alexander Dupuy @@ -65,7 +65,7 @@ static struct passwd passwd_ent; static uid2home_t *lastchild; static uid2home_t *pwtab; static void delay(uid2home_t *, int); -static void table_add(int, const char *, const char *); +static void table_add(u_int, const char *, const char *); static char mboxfile[MAXPATHLEN]; static char *root_home; /* root's home directory */ @@ -636,7 +636,7 @@ plt_reset(void) * n: user ID name */ static void -table_add(int u, const char *h, const char *n) +table_add(u_int u, const char *h, const char *n) { int i; @@ -701,7 +701,7 @@ table_add(int u, const char *h, const char *n) * return entry in lookup table */ uid2home_t * -plt_search(int u) +plt_search(u_int u) { int max, min, mid; diff --git a/libamu/mount_fs.c b/libamu/mount_fs.c index 0a06d9b..92466ac 100644 --- a/libamu/mount_fs.c +++ b/libamu/mount_fs.c @@ -37,7 +37,7 @@ * SUCH DAMAGE. * * - * $Id: mount_fs.c,v 1.41 2004/01/06 03:56:20 ezk Exp $ + * $Id: mount_fs.c,v 1.42 2004/07/23 18:29:22 ezk Exp $ * */ @@ -801,7 +801,7 @@ compute_automounter_nfs_args(nfs_args_t *nap, mntent_t *mntp) static char * get_hex_string(u_int len, const char *fhdata) { - int i; + u_int i; static char buf[128]; /* better not go over it! */ char str[16]; short int arr[64]; @@ -811,7 +811,7 @@ get_hex_string(u_int len, const char *fhdata) buf[0] = '\0'; memset(&arr[0], 0, (64 * sizeof(short int))); memcpy(&arr[0], &fhdata[0], len); - for (i=0; i