* SUCH DAMAGE.
*
* from: @(#)amq_subr.c 8.1 (Berkeley) 6/6/93
- * $Id: amq_subr.c,v 1.1.1.1 1995/10/18 08:47:10 deraadt Exp $
+ * $Id: amq_subr.c,v 1.2 1997/01/31 14:41:57 graichen Exp $
*/
/*
if (!xdr_amq_string(xdrs, &mp->am_mnt->mf_ops->fs_type)) {
return (FALSE);
}
- if (!xdr_long(xdrs, &mp->am_stats.s_mtime)) {
+ /* XXX really a time_t, but need to transmit a 32-bit integer */
+ if (!xdr_int(xdrs, (int *)&mp->am_stats.s_mtime)) {
return (FALSE);
}
if (!xdr_u_short(xdrs, &mp->am_stats.s_uid)) {
-/* $OpenBSD: host_ops.c,v 1.2 1996/03/25 15:54:46 niklas Exp $ */
+/* $OpenBSD: host_ops.c,v 1.3 1997/01/31 14:41:58 graichen Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
return mount_nfs_fh(fhp, dir, fs_name, opts, mf);
}
-static int sortfun P((exports *a, exports *b));
-static int sortfun(a, b)
-exports *a,*b;
+static int sortfun P((const void *arg1, const void *arg2));
+static int sortfun(arg1, arg2)
+const void *arg1, *arg2;
{
+ const exports *a = arg1, *b = arg2;
return strcmp((*a)->ex_dir, (*b)->ex_dir);
}
* SUCH DAMAGE.
*
* from: @(#)info_hes.c 8.1 (Berkeley) 6/6/93
- * $Id: info_hes.c,v 1.1.1.1 1995/10/18 08:47:10 deraadt Exp $
+ * $Id: info_hes.c,v 1.2 1997/01/31 14:41:58 graichen Exp $
*/
/*
int qdcount, ancount;
char key[PACKETSZ];
char *key_cpy, *value, *hs_make_value();
- short type;
+ int16_t type;
hp = (HEADER *)msg;
if (hp->rcode != NOERROR || hp->opcode != QUERY) {
if ((type = _getshort(cp)) == T_SOA) {
soacnt++;
}
- cp += 2*sizeof(u_short) + sizeof(u_long);
+ cp += 2*sizeof(u_int16_t) + sizeof(u_int32_t);
len = _getshort(cp);
- cp += sizeof(u_short);
+ cp += sizeof(u_int16_t);
/* Check to see if key is in our domain */
if (type == T_TXT && hs_strip_our_domain(key)) {
value = hs_make_value(cp, len);
-/* $OpenBSD: map.c,v 1.2 1996/03/25 15:54:48 niklas Exp $ */
+/* $OpenBSD: map.c,v 1.3 1997/01/31 14:41:59 graichen Exp $ */
/*-
* Copyright (c) 1990 Jan-Simon Pendry
#ifndef lint
/*static char sccsid[] = "from: @(#)map.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$OpenBSD: map.c,v 1.2 1996/03/25 15:54:48 niklas Exp $";
+static char *rcsid = "$OpenBSD: map.c,v 1.3 1997/01/31 14:41:59 graichen Exp $";
#endif /* not lint */
#include "am.h"
* Patch up PID to match main server...
*/
if (!foreground) {
- long pid = getppid();
+ pid_t pid = getppid();
((struct am_fh *) &nfh)->fhh_pid = pid;
#ifdef DEBUG
- dlog("root_fh substitutes pid %d", pid);
+ dlog("root_fh substitutes pid %d", (int)pid);
#endif
}
return &nfh;
* SUCH DAMAGE.
*
* from: @(#)mount_fs.c 8.1 (Berkeley) 6/6/93
- * $Id: mount_fs.c,v 1.3 1997/01/21 17:14:42 bitblt Exp $
+ * $Id: mount_fs.c,v 1.4 1997/01/31 14:42:00 graichen Exp $
*/
#include "am.h"
xopts = mnt->mnt_opts;
if (sizeof(stb.st_dev) == 2) {
/* e.g. SunOS 4.1 */
- sprintf(zopts, "%s,%s=%s%04lx", xopts, MNTINFO_DEV,
- MNTINFO_PREF, (u_long) stb.st_dev & 0xffff);
+ sprintf(zopts, "%s,%s=%s%04x", xopts, MNTINFO_DEV,
+ MNTINFO_PREF, (u_int) stb.st_dev & 0xffff);
} else {
/* e.g. System Vr4 */
- sprintf(zopts, "%s,%s=%s%08lx", xopts, MNTINFO_DEV,
- MNTINFO_PREF, (u_long) stb.st_dev);
+ sprintf(zopts, "%s,%s=%s%08x", xopts, MNTINFO_DEV,
+ MNTINFO_PREF, (u_int) stb.st_dev);
}
mnt->mnt_opts = zopts;
}
-/* $OpenBSD: nfs_ops.c,v 1.5 1996/05/24 09:22:06 deraadt Exp $ */
+/* $OpenBSD: nfs_ops.c,v 1.6 1997/01/31 14:42:00 graichen Exp $ */
/*-
* Copyright (c) 1990 Jan-Simon Pendry
#ifndef lint
/*static char sccsid[] = "from: @(#)nfs_ops.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$OpenBSD: nfs_ops.c,v 1.5 1996/05/24 09:22:06 deraadt Exp $";
+static char *rcsid = "$OpenBSD: nfs_ops.c,v 1.6 1997/01/31 14:42:00 graichen Exp $";
#endif /* not lint */
#include "am.h"
int done;
{
fh_cache *fp, *fp2 = 0;
- int id = (int) idv;
+ /* XXX EVIL XXX */
+ int id = (int) ((long)idv);
ITER(fp, fh_cache, &fh_head) {
if (fp->fh_id == id) {
len = make_rpc_packet(iobuf, sizeof(iobuf), proc,
&mnt_msg, (voidp) &fp->fh_path, xdr_nfspath, nfs_auth);
+ /*
+ * XXX EVIL! We case fh_id to a pointer, then back to an int
+ * XXX later.
+ */
if (len > 0) {
error = fwd_packet(MK_RPC_XID(RPC_XID_MOUNTD, fp->fh_id),
- (voidp) iobuf, len, &fp->fh_sin, &fp->fh_sin, (voidp) fp->fh_id, f);
+ (voidp) iobuf, len, &fp->fh_sin, &fp->fh_sin, (voidp) ((long)fp->fh_id), f);
} else {
error = -len;
}
* SUCH DAMAGE.
*
* from: @(#)nfs_start.c 8.1 (Berkeley) 6/6/93
- * $Id: nfs_start.c,v 1.1.1.1 1995/10/18 08:47:11 deraadt Exp $
+ * $Id: nfs_start.c,v 1.2 1997/01/31 14:42:01 graichen Exp $
*/
#include "am.h"
/*if (max_mem == 0) {
max_mem = next_mem;
} else*/ if (max_mem < next_mem) {
- dlog("%#x bytes of memory allocated; total is %#x (%d pages)",
- next_mem - max_mem,
- next_mem,
- ((int)next_mem+getpagesize()-1)/getpagesize());
+ dlog("%#lx bytes of memory allocated; total is %#lx (%ld pages)",
+ (unsigned long)(next_mem - max_mem),
+ (unsigned long)next_mem,
+ ((unsigned long)next_mem+getpagesize()-1)/getpagesize());
max_mem = next_mem;
}
}
* SUCH DAMAGE.
*
* from: @(#)srvr_nfs.c 8.1 (Berkeley) 6/6/93
- * $Id: srvr_nfs.c,v 1.1.1.1 1995/10/18 08:47:12 deraadt Exp $
+ * $Id: srvr_nfs.c,v 1.2 1997/01/31 14:42:02 graichen Exp $
*/
/*
voidp idv;
int done;
{
- int xid = (int) idv;
+ /* XXX EVIL! XXX */
+ int xid = (int) ((long)idv);
fserver *fs;
#ifdef DEBUG
int found_map = 0;
/*
* Queue the packet...
*/
+ /*
+ * XXX EVIL! We cast xid to a pointer, then back to an int when
+ * XXX we get the reply.
+ */
error = fwd_packet(MK_RPC_XID(RPC_XID_NFSPING, np->np_xid), (voidp) ping_buf,
- ping_len, fs->fs_ip, (struct sockaddr_in *) 0, (voidp) np->np_xid, nfs_pinged);
+ ping_len, fs->fs_ip, (struct sockaddr_in *) 0, (voidp) ((long)np->np_xid), nfs_pinged);
/*
* See if a hard error occured
* SUCH DAMAGE.
*
* from: @(#)util.c 8.1 (Berkeley) 6/6/93
- * $Id: util.c,v 1.2 1996/08/10 21:39:43 deraadt Exp $
+ * $Id: util.c,v 1.3 1997/01/31 14:42:02 graichen Exp $
*/
/*
* addr is in network byte order.
* sizeof(buf) needs to be at least 16.
*/
-char *inet_dquad P((char *buf, unsigned long addr));
+char *inet_dquad P((char *buf, u_int32_t addr));
char *inet_dquad(buf, addr)
char *buf;
-unsigned long addr;
+u_int32_t addr;
{
addr = ntohl(addr);
sprintf(buf, "%d.%d.%d.%d",
* SUCH DAMAGE.
*
* from: @(#)wire.c 8.1 (Berkeley) 6/6/93
- * $Id: wire.c,v 1.1.1.1 1995/10/18 08:47:12 deraadt Exp $
+ * $Id: wire.c,v 1.2 1997/01/31 14:42:03 graichen Exp $
*/
/*
typedef struct addrlist addrlist;
struct addrlist {
addrlist *ip_next;
- unsigned long ip_addr;
- unsigned long ip_mask;
+ u_int32_t ip_addr;
+ u_int32_t ip_mask;
};
static addrlist *localnets = 0;
struct ifconf ifc;
struct ifreq *ifr;
caddr_t cp, cplim;
- unsigned long address, netmask, subnet;
+ u_int32_t address, netmask, subnet;
char buf[GFBUFLEN], *s;
int sk = -1;
char *netname = 0;
localnets = al;
if (netname == 0) {
- unsigned long net;
- unsigned long mask;
- unsigned long subnetshift;
+ u_int32_t net;
+ u_int32_t mask;
+ u_int32_t subnetshift;
/*
* Figure out the subnet's network address
*/
* Determine whether a network is on a local network
* (addr) is in network byte order.
*/
-int islocalnet P((unsigned long addr));
+int islocalnet P((u_int32_t addr));
int islocalnet(addr)
-unsigned long addr;
+u_int32_t addr;
{
addrlist *al;
* SUCH DAMAGE.
*
* from: @(#)xutil.c 8.1 (Berkeley) 6/6/93
- * $Id: xutil.c,v 1.1.1.1 1995/10/18 08:47:12 deraadt Exp $
+ * $Id: xutil.c,v 1.2 1997/01/31 14:42:04 graichen Exp $
*/
#include "config.h"
#include <string.h>
#endif
+#include <stdlib.h>
+
FILE *logfp = stderr; /* Log errors to stderr initially */
#ifdef HAS_SYSLOG
int syslogging;
* SUCH DAMAGE.
*
* from: @(#)fsi_data.h 8.1 (Berkeley) 6/6/93
- * $Id: fsi_data.h,v 1.1.1.1 1995/10/18 08:47:18 deraadt Exp $
+ * $Id: fsi_data.h,v 1.2 1997/01/31 14:42:10 graichen Exp $
*/
typedef struct auto_tree auto_tree;
#define EF_INADDR 0
struct in_addr e_inaddr;
#define EF_NETMASK 1
- u_long e_netmask;
+ u_int32_t e_netmask;
#define EF_HWADDR 2
char *e_hwaddr;
};
* SUCH DAMAGE.
*
* from: @(#)fsi_util.c 8.1 (Berkeley) 6/6/93
- * $Id: fsi_util.c,v 1.1.1.1 1995/10/18 08:47:18 deraadt Exp $
+ * $Id: fsi_util.c,v 1.2 1997/01/31 14:42:11 graichen Exp $
*/
#include "../fsinfo/fsinfo.h"
exit(1);
}
+#ifndef __NetBSD__
/*
* Dup a string
*/
return sp;
}
+#endif /* __NetBSD__ */
/*
* Debug log
free(v);
} break;
case EF_NETMASK: {
- u_long nm = 0;
- if ((sscanf(v, "0x%lx", &nm) == 1 || sscanf(v, "%lx", &nm) == 1) && nm != 0)
+ u_int32_t nm = 0;
+ if ((sscanf(v, "0x%x", &nm) == 1 || sscanf(v, "%x", &nm) == 1) && nm != 0)
ep->e_netmask = htonl(nm);
else
yyerror("malformed netmask: %s", v);
* SUCH DAMAGE.
*
* from: @(#)fsinfo.h 8.1 (Berkeley) 6/6/93
- * $Id: fsinfo.h,v 1.1.1.1 1995/10/18 08:47:19 deraadt Exp $
+ * $Id: fsinfo.h,v 1.2 1997/01/31 14:42:11 graichen Exp $
*/
/*
#include <net/if.h>
#include <netinet/if_ether.h>
+#include <string.h>
+#include <stdlib.h>
+
#include "fsi_data.h"
-extern char* strchr P((Const char*, int)); /* C */
-extern char* strrchr P((Const char*, int)); /* C */
-extern char *strdup P((char*)); /* C */
extern void fatal();
extern void warning();
extern void error();
-/* $OpenBSD: am.h,v 1.2 1996/03/25 15:54:54 niklas Exp $ */
+/* $OpenBSD: am.h,v 1.3 1997/01/31 14:42:18 graichen Exp $ */
/*
* Copyright (c) 1990 Jan-Simon Pendry
#include <sys/socket.h>
#include <rpc/rpc.h>
#include <sys/mount.h>
+#include <string.h>
+#include <stdlib.h>
#ifdef MNTENT_HDR
#include MNTENT_HDR
#endif /* MNTENT_HDR */
#endif /* NEED_MNTOPT_PARSER */
extern int hasmntval P((struct mntent*, char*));
extern void host_normalize P((char **));
-extern char *inet_dquad P((char*, unsigned long));
+extern char *inet_dquad P((char*, u_int32_t));
extern void init_map P((am_node*, char*));
extern void insert_am P((am_node*, am_node*));
extern void ins_que P((qelem*, qelem*));
-extern int islocalnet P((unsigned long));
+extern int islocalnet P((u_int32_t));
extern int make_nfs_auth P((void));
extern void make_root_node(P_void);
extern int make_rpc_packet P((char*, int, u_long, struct rpc_msg*, voidp, xdrproc_t, AUTH*));
extern char* strcat P((char*, Const char*)); /* C */
extern int strcmp P((Const char*, Const char*)); /* C */
extern char* strdup P((Const char*));
-extern int strlen P((Const char*)); /* C */
extern char* strnsave P((Const char*, int));
extern char* strrchr P((Const char*, int)); /* C */
extern char* strealloc P((char*, char *));
* SUCH DAMAGE.
*
* from: @(#)amq.h 8.1 (Berkeley) 6/6/93
- * $Id: amq.h,v 1.1.1.1 1995/10/18 08:47:22 deraadt Exp $
+ * $Id: amq.h,v 1.2 1997/01/31 14:42:22 graichen Exp $
*
*/
bool_t xdr_amq_string();
-typedef long *time_type;
+typedef int *time_type;
bool_t xdr_time_type();
* SUCH DAMAGE.
*
* from: @(#)amq.x 8.1 (Berkeley) 6/6/93
- * $Id: amq.x,v 1.1.1.1 1995/10/18 08:47:22 deraadt Exp $
+ * $Id: amq.x,v 1.2 1997/01/31 14:42:22 graichen Exp $
*
*/
/*
* The type time_type should correspond to the system time_t
+ * XXX int/long time_t garbage; this needs to be a 32-bit integer
*/
-typedef long time_type;
+typedef int time_type;
/*
* A tree of what is mounted
* SUCH DAMAGE.
*
* from: @(#)amq_xdr.c 8.1 (Berkeley) 6/6/93
- * $Id: amq_xdr.c,v 1.1.1.1 1995/10/18 08:47:23 deraadt Exp $
+ * $Id: amq_xdr.c,v 1.2 1997/01/31 14:42:23 graichen Exp $
*
*/
XDR *xdrs;
time_type *objp;
{
- if (!xdr_long(xdrs, (long *) objp)) {
+ if (!xdr_int(xdrs, (int *) objp)) {
return (FALSE);
}
return (TRUE);