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.
A.i386-unknown-freebsd5.2.1
A.i386-pc-linux-suse9.1
A.i386-unknown-freebsd4.10
+A.i386-pc-linux-suse8.2
+2004-07-23 Erez Zadok <ezk@cs.sunysb.edu>
+
+ * 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 <ezk@cs.sunysb.edu>
* minor new port: i386-pc-linux-suse9.1.
*** 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
* 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 $
*
*/
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 *);
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 */
struct am_fh {
int fhh_pid; /* process id */
int fhh_id; /* map id */
- int fhh_gen; /* generation number */
+ u_int fhh_gen; /* generation number */
};
/*
*/
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);
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 */
/*
* 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 $
*
*/
* 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;
}
* 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 $
*
*/
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).
* 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 $
*
*/
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);
* 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;
* 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 $
*
*/
****************************************************************************/
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);
/****************************************************************************
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;
/* 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;
* 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;
* 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 $
*
*/
}
#ifdef MNTTAB_OPT_PROTO
else {
- int proto_nfs_version;
+ u_int proto_nfs_version;
char **p;
for (p = protocols; *p; p++) {
* 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 $
*
*/
@(#)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 */
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) {
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");
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);
* 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 $
*
*/
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))
* 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 $
*/
/*
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)) {
* 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 $
*
*/
* 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;
* 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 <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
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;
* 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 <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
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);
* 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 <ezk@cs.columbia.edu> and Alexander Dupuy <dupuy@cs.columbia.edu>
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 */
* 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;
* return entry in lookup table
*/
uid2home_t *
-plt_search(int u)
+plt_search(u_int u)
{
int max, min, mid;
* 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 $
*
*/
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];
buf[0] = '\0';
memset(&arr[0], 0, (64 * sizeof(short int)));
memcpy(&arr[0], &fhdata[0], len);
- for (i=0; i<len/sizeof(short int); i++) {
+ for (i=0; i<len/sizeof(unsigned short int); i++) {
sprintf(str, "%04x", ntohs(arr[i]));
strcat(buf, str);
}