Fix prohibit_dirent_without_use, sc_unsigned_short, sc_unsigned_long sc_unsigned_char checks.

This commit is contained in:
Alfred M. Szmidt
2011-12-30 18:40:12 +01:00
parent 0e7ee45b08
commit 1a343be8d0
40 changed files with 148 additions and 131 deletions

View File

@@ -26,6 +26,25 @@
[!WITH_IRUSEROK && WITH_RUSEROK]: Do authorization with ruserok
composed with inet_ntoa.
2011-12-30 Alfred M. Szmidt <ams@gnu.org>
Fix prohibit_dirent_without_use, sc_unsigned_short,
sc_unsigned_long sc_unsigned_char checks.
* ftpd/ftpd.c, libicmp/icmp.h, libicmp/icmp_address.c,
libicmp/icmp_cksum.c, libicmp/icmp_echo.c,
libicmp/icmp_timestamp.c, libinetutils/des_rw.c,
libinetutils/kcmd.c, libinetutils/krcmd.c, libinetutils/ttymsg.c,
libls/fts.c, libls/fts.h, libls/ls.c, libls/ls.h, libls/print.c,
libtelnet/kerberos.c, ping/libping.c, ping/ping.c, ping/ping.h,
ping/ping6.c, ping/ping_common.c, ping/ping_common.h,
ping/ping_echo.c, ping/ping_impl.h, src/inetd.c, src/rcp.c,
src/rexecd.c, src/rlogin.c, src/rlogind.c, src/rshd.c,
src/syslogd.c, src/tftp.c, src/tftpd.c, src/traceroute.c,
talk/ctl.c, talk/talk_ctl.h, telnet/krb4-proto.h, telnet/ring.c,
telnet/ring.h: Silence Fix prohibit_dirent_without_use,
sc_unsigned_short, sc_unsigned_long sc_unsigned_char checks.
2011-12-30 Alfred M. Szmidt <ams@gnu.org>
Fix sc_prohibit_test_minus_ao check.

View File

@@ -1419,7 +1419,7 @@ void
statcmd (void)
{
struct sockaddr_in *sin;
u_char *a, *p;
unsigned char *a, *p;
lreply (211, "%s FTP server status:", hostname);
if (!no_version)
@@ -1467,8 +1467,8 @@ statcmd (void)
printf (" PORT");
sin = &data_dest;
printaddr:
a = (u_char *) & sin->sin_addr;
p = (u_char *) & sin->sin_port;
a = (unsigned char *) & sin->sin_addr;
p = (unsigned char *) & sin->sin_port;
#define UC(b) (((int) b) & 0xff)
printf (" (%d,%d,%d,%d,%d,%d)\r\n", UC (a[0]),
UC (a[1]), UC (a[2]), UC (a[3]), UC (p[0]), UC (p[1]));

View File

@@ -24,33 +24,33 @@ typedef struct icmp_header icmphdr_t;
struct icmp_header
{
u_char icmp_type; /* type of message, see below */
u_char icmp_code; /* type sub code */
u_short icmp_cksum; /* ones complement cksum of struct */
unsigned char icmp_type; /* type of message, see below */
unsigned char icmp_code; /* type sub code */
unsigned short icmp_cksum; /* ones complement cksum of struct */
union
{
u_char ih_pptr; /* ICMP_PARAMPROB */
unsigned char ih_pptr; /* ICMP_PARAMPROB */
struct in_addr ih_gwaddr; /* ICMP_REDIRECT */
struct ih_idseq
{
u_short icd_id;
u_short icd_seq;
unsigned short icd_id;
unsigned short icd_seq;
} ih_idseq;
int ih_void;
/* ICMP_UNREACH_NEEDFRAG -- Path MTU discovery as per rfc 1191 */
struct ih_pmtu
{
u_short ipm_void;
u_short ipm_nextmtu;
unsigned short ipm_void;
unsigned short ipm_nextmtu;
} ih_pmtu;
/* ICMP_ROUTERADV -- RFC 1256 */
struct ih_rtradv
{
u_char irt_num_addrs; /* Number of addresses following the msg */
u_char irt_wpa; /* Address Entry Size (32-bit words) */
u_short irt_lifetime; /* Lifetime */
unsigned char irt_num_addrs; /* Number of addresses following the msg */
unsigned char irt_wpa; /* Address Entry Size (32-bit words) */
unsigned short irt_lifetime; /* Lifetime */
} ih_rtradv;
} icmp_hun;
@@ -78,7 +78,7 @@ struct icmp_header
struct ip idi_ip;
/* options and then 64 bits of data */
} id_ip;
u_long id_mask; /* ICMP_ADDRESS, ICMP_ADDRESSREPLY */
unsigned long id_mask; /* ICMP_ADDRESS, ICMP_ADDRESSREPLY */
char id_data[1];
} icmp_dun;
#define icmp_otime icmp_dun.id_ts.its_otime
@@ -140,22 +140,22 @@ struct icmp_header
#define MAXIPLEN 60
#define MAXICMPLEN 76
#define ICMP_MINLEN 8 /* abs minimum */
#define ICMP_TSLEN (8 + 3 * sizeof (u_long)) /* timestamp */
#define ICMP_TSLEN (8 + 3 * sizeof (unsigned long)) /* timestamp */
#define ICMP_MASKLEN 12 /* address mask */
#define ICMP_ADVLENMIN (8 + sizeof (struct ip) + 8) /* min */
#define ICMP_ADVLEN(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8)
/* N.B.: must separately check that ip_hl >= 5 */
u_short icmp_cksum (u_char * addr, int len);
int icmp_generic_encode (u_char * buffer, size_t bufsize, int type, int ident,
unsigned short icmp_cksum (unsigned char * addr, int len);
int icmp_generic_encode (unsigned char * buffer, size_t bufsize, int type, int ident,
int seqno);
int icmp_generic_decode (u_char * buffer, size_t bufsize,
int icmp_generic_decode (unsigned char * buffer, size_t bufsize,
struct ip **ipp, icmphdr_t ** icmpp);
int icmp_echo_encode (u_char * buffer, size_t bufsize, int ident, int seqno);
int icmp_echo_decode (u_char * buffer, size_t bufsize,
int icmp_echo_encode (unsigned char * buffer, size_t bufsize, int ident, int seqno);
int icmp_echo_decode (unsigned char * buffer, size_t bufsize,
struct ip **ip, icmphdr_t ** icmp);
int icmp_timestamp_encode (u_char * buffer, size_t bufsize,
int icmp_timestamp_encode (unsigned char * buffer, size_t bufsize,
int ident, int seqno);
int icmp_address_encode (u_char * buffer, size_t bufsize, int ident,
int icmp_address_encode (unsigned char * buffer, size_t bufsize, int ident,
int seqno);

View File

@@ -31,7 +31,7 @@
#include <icmp.h>
int
icmp_address_encode (u_char * buffer, size_t bufsize, int ident, int seqno)
icmp_address_encode (unsigned char * buffer, size_t bufsize, int ident, int seqno)
{
icmphdr_t *icmp;

View File

@@ -22,20 +22,20 @@
#include <sys/types.h>
#include <unistd.h>
u_short
icmp_cksum (u_char * addr, int len)
unsigned short
icmp_cksum (unsigned char * addr, int len)
{
register int sum = 0;
u_short answer = 0;
u_short *wp;
unsigned short answer = 0;
unsigned short *wp;
for (wp = (u_short *) addr; len > 1; wp++, len -= 2)
for (wp = (unsigned short *) addr; len > 1; wp++, len -= 2)
sum += *wp;
/* Take in an odd byte if present */
if (len == 1)
{
*(u_char *) & answer = *(u_char *) wp;
*(unsigned char *) & answer = *(unsigned char *) wp;
sum += answer;
}

View File

@@ -31,7 +31,7 @@
#include <icmp.h>
int
icmp_generic_encode (u_char * buffer, size_t bufsize, int type, int ident,
icmp_generic_encode (unsigned char * buffer, size_t bufsize, int type, int ident,
int seqno)
{
icmphdr_t *icmp;
@@ -50,11 +50,11 @@ icmp_generic_encode (u_char * buffer, size_t bufsize, int type, int ident,
}
int
icmp_generic_decode (u_char * buffer, size_t bufsize,
icmp_generic_decode (unsigned char * buffer, size_t bufsize,
struct ip **ipp, icmphdr_t ** icmpp)
{
size_t hlen;
u_short cksum;
unsigned short cksum;
struct ip *ip;
icmphdr_t *icmp;
@@ -74,20 +74,20 @@ icmp_generic_decode (u_char * buffer, size_t bufsize,
/* Recompute checksum */
cksum = icmp->icmp_cksum;
icmp->icmp_cksum = 0;
icmp->icmp_cksum = icmp_cksum ((u_char *) icmp, bufsize - hlen);
icmp->icmp_cksum = icmp_cksum ((unsigned char *) icmp, bufsize - hlen);
if (icmp->icmp_cksum != cksum)
return 1;
return 0;
}
int
icmp_echo_encode (u_char * buffer, size_t bufsize, int ident, int seqno)
icmp_echo_encode (unsigned char * buffer, size_t bufsize, int ident, int seqno)
{
return icmp_generic_encode (buffer, bufsize, ICMP_ECHO, ident, seqno);
}
int
icmp_echo_decode (u_char * buffer, size_t bufsize,
icmp_echo_decode (unsigned char * buffer, size_t bufsize,
struct ip **ipp, icmphdr_t ** icmpp)
{
return icmp_generic_decode (buffer, bufsize, ipp, icmpp);

View File

@@ -33,7 +33,7 @@
#include <icmp.h>
int
icmp_timestamp_encode (u_char * buffer, size_t bufsize, int ident, int seqno)
icmp_timestamp_encode (unsigned char * buffer, size_t bufsize, int ident, int seqno)
{
icmphdr_t *icmp;
struct timeval tv;

View File

@@ -62,7 +62,7 @@
static unsigned char des_inbuf[10240], storage[10240], *store_ptr;
static bit_64 *key;
static u_char *key_schedule;
static unsigned char *key_schedule;
/* XXX these should be in a kerberos include file */
int krb_net_read (int, char *, int);

View File

@@ -86,14 +86,14 @@ int getport (int *);
# if defined KERBEROS
int
kcmd (int *sock, char **ahost, u_short rport, char *locuser,
kcmd (int *sock, char **ahost, unsigned short rport, char *locuser,
char *remuser, char *cmd, int *fd2p, KTEXT ticket,
char *service, char *realm,
CREDENTIALS * cred, Key_schedule schedule, MSG_DAT * msg_data,
struct sockaddr_in *laddr, struct sockaddr_in *faddr, long authopts)
# elif defined(SHISHI)
int
kcmd (Shishi ** h, int *sock, char **ahost, u_short rport, char *locuser,
kcmd (Shishi ** h, int *sock, char **ahost, unsigned short rport, char *locuser,
char **remuser, char *cmd, int *fd2p, char *service, char *realm,
Shishi_key ** key,
struct sockaddr_in *laddr, struct sockaddr_in *faddr, long authopts)
@@ -229,7 +229,7 @@ kcmd (Shishi ** h, int *sock, char **ahost, u_short rport, char *locuser,
goto bad;
}
*fd2p = s3;
from.sin_port = ntohs ((u_short) from.sin_port);
from.sin_port = ntohs ((unsigned short) from.sin_port);
if (from.sin_family != AF_INET || from.sin_port >= IPPORT_RESERVED)
{
fprintf (stderr,
@@ -349,7 +349,7 @@ getport (int *alport)
return (-1);
for (;;)
{
sin.sin_port = htons ((u_short) * alport);
sin.sin_port = htons ((unsigned short) * alport);
if (bind (s, (struct sockaddr *) &sin, sizeof (sin)) >= 0)
return (s);
if (errno != EADDRINUSE)

View File

@@ -69,11 +69,11 @@
# define SERVICE_NAME "rcmd"
# if defined SHISHI
int kcmd (Shishi **, int *, char **, u_short, char *, char **,
int kcmd (Shishi **, int *, char **, unsigned short, char *, char **,
char *, int *, char *, char *, Shishi_key **,
struct sockaddr_in *, struct sockaddr_in *, long);
# else
int kcmd (int *, char **, u_short, char *, char *, char *, int *,
int kcmd (int *, char **, unsigned short, char *, char *, char *, int *,
KTEXT, char *, char *, CREDENTIALS *, Key_schedule,
MSG_DAT *, struct sockaddr_in *, struct sockaddr_in *, long);
# endif
@@ -86,7 +86,7 @@ int kcmd (int *, char **, u_short, char *, char *, char *, int *,
# if defined SHISHI
int
krcmd (Shishi ** h, char **ahost, u_short rport, char **remuser, char *cmd,
krcmd (Shishi ** h, char **ahost, unsigned short rport, char **remuser, char *cmd,
int *fd2p, char *realm)
{
int sock = -1, err = 0;
@@ -110,7 +110,7 @@ krcmd (Shishi ** h, char **ahost, u_short rport, char **remuser, char *cmd,
# elif defined(KERBEROS)
int
krcmd (char **ahost, u_short rport, char *remuser, char *cmd, int *fd2p,
krcmd (char **ahost, unsigned short rport, char *remuser, char *cmd, int *fd2p,
char *realm)
{
int sock = -1, err = 0;
@@ -140,7 +140,7 @@ krcmd (char **ahost, u_short rport, char *remuser, char *cmd, int *fd2p,
# if defined SHISHI
int
krcmd_mutual (Shishi ** h, char **ahost, u_short rport, char **remuser,
krcmd_mutual (Shishi ** h, char **ahost, unsigned short rport, char **remuser,
char *cmd, int *fd2p, char *realm, Shishi_key ** key)
{
int sock = -1, err = 0;
@@ -166,7 +166,7 @@ krcmd_mutual (Shishi ** h, char **ahost, u_short rport, char **remuser,
# elif defined(KERBEROS)
int
krcmd_mutual (char **ahost, u_short rport, char *remuser, char *cmd,
krcmd_mutual (char **ahost, unsigned short rport, char *remuser, char *cmd,
int *fd2p, char *realm, CREDENTIALS * cred, Key_schedule sched)
{
int sock, err;

View File

@@ -53,7 +53,6 @@
#include <sys/uio.h>
#include <signal.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>

View File

@@ -66,7 +66,7 @@ static size_t fts_maxarglen (char *const *);
static void fts_padjust (FTS *, void *);
static int fts_palloc (FTS *, size_t);
static FTSENT *fts_sort (FTS *, FTSENT *, int);
static u_short fts_stat (FTS *, struct dirent *, FTSENT *, int);
static unsigned short fts_stat (FTS *, struct dirent *, FTSENT *, int);
#ifndef MAX
# define MAX(a, b) (((a) > (b)) ? (a) : (b))
@@ -852,7 +852,7 @@ fts_build (register FTS *sp, int type)
return (head);
}
static u_short
static unsigned short
fts_stat (FTS *sp, struct dirent *dp, register FTSENT *p, int follow)
{
register FTSENT *t;

View File

@@ -92,8 +92,8 @@ typedef struct _ftsent
char *fts_path; /* root path */
int fts_errno; /* errno for this node */
int fts_symfd; /* fd for symlink */
u_short fts_pathlen; /* strlen(fts_path) */
u_short fts_namelen; /* strlen(fts_name) */
unsigned short fts_pathlen; /* strlen(fts_path) */
unsigned short fts_namelen; /* strlen(fts_name) */
ino_t fts_ino; /* inode */
dev_t fts_dev; /* device */
@@ -117,17 +117,17 @@ typedef struct _ftsent
# define FTS_SL 12 /* symbolic link */
# define FTS_SLNONE 13 /* symbolic link without target */
# define FTS_W 14 /* whiteout object */
u_short fts_info; /* user flags for FTSENT structure */
unsigned short fts_info; /* user flags for FTSENT structure */
# define FTS_DONTCHDIR 0x01 /* don't chdir .. to the parent */
# define FTS_SYMFOLLOW 0x02 /* followed a symlink to get here */
u_short fts_flags; /* private flags for FTSENT structure */
unsigned short fts_flags; /* private flags for FTSENT structure */
# define FTS_AGAIN 1 /* read node again */
# define FTS_FOLLOW 2 /* follow symbolic link */
# define FTS_NOINSTR 3 /* no instructions */
# define FTS_SKIP 4 /* discard node */
u_short fts_instr; /* fts_set() instructions */
unsigned short fts_instr; /* fts_set() instructions */
struct stat *fts_statp; /* stat(2) information */
char fts_name[1]; /* file name */

View File

@@ -55,7 +55,6 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <dirent.h>
#include <errno.h>
#include "fts.h"
#include <stdio.h>
@@ -427,7 +426,7 @@ display (FTSENT *p, FTSENT *list)
FTSENT *cur;
NAMES *np;
unsigned long long maxsize;
u_long btotal, maxblock, maxinode, maxlen, maxnlink;
unsigned long btotal, maxblock, maxinode, maxlen, maxnlink;
int bcfile, flen, glen, ulen, maxflags, maxgroup, maxuser;
int entries, needstats;
char *user = NULL, *group = NULL, buf[INT_BUFSIZE_BOUND (uintmax_t)];

View File

@@ -67,7 +67,7 @@ extern int f_typedir; /* add type character for directories */
typedef struct
{
FTSENT *list;
u_long btotal;
unsigned long btotal;
int bcfile;
int entries;
int maxlen;

View File

@@ -88,7 +88,7 @@
# define minor(x) ((int)((x)&0377))
#endif
static int printaname (FTSENT *, u_long, u_long);
static int printaname (FTSENT *, unsigned long, unsigned long);
static void printlink (FTSENT *);
static void printtime (time_t);
static int printtype (u_int);
@@ -246,7 +246,7 @@ printcol (DISPLAY *dp)
* return # of characters printed, no trailing characters.
*/
static int
printaname (FTSENT *p, u_long inodefield, u_long sizefield)
printaname (FTSENT *p, unsigned long inodefield, unsigned long sizefield)
{
struct stat *sp;
int chcnt;

View File

@@ -83,8 +83,8 @@
# include "misc.h"
int kerberos4_cksum (unsigned char *, int);
int krb_mk_req (KTEXT, char *, char *, char *, u_long);
int krb_rd_req (KTEXT, char *, char *, u_long, AUTH_DAT *, char *);
int krb_mk_req (KTEXT, char *, char *, char *, unsigned long);
int krb_rd_req (KTEXT, char *, char *, unsigned long, AUTH_DAT *, char *);
int krb_kntoln (AUTH_DAT *, char *);
int krb_get_cred (char *, char *, char *, CREDENTIALS *);
int krb_get_lrealm (char *, int);

View File

@@ -83,7 +83,7 @@ ping_init (int type, int ident)
p->ping_count = 0;
p->ping_interval = PING_DEFAULT_INTERVAL;
p->ping_datalen = sizeof (icmphdr_t);
/* Make sure we use only 16 bits in this field, id for icmp is a u_short. */
/* Make sure we use only 16 bits in this field, id for icmp is a unsigned short. */
p->ping_ident = ident & 0xFFFF;
p->ping_cktab_size = PING_CKTABSIZE;
gettimeofday (&p->ping_start_time, NULL);

View File

@@ -55,8 +55,8 @@ extern int ping_router (char *hostname);
PING *ping;
bool is_root = false;
u_char *data_buffer;
u_char *patptr;
unsigned char *data_buffer;
unsigned char *patptr;
int pattern_len = 16;
int socket_type;
size_t count = DEFAULT_PING_COUNT;
@@ -133,7 +133,7 @@ static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
char *endptr;
static u_char pattern[16];
static unsigned char pattern[16];
double v;
switch (key)

View File

@@ -25,7 +25,7 @@ void ping_reset (PING * p);
void ping_set_type (PING * p, int type);
void ping_set_packetsize (PING * ping, size_t size);
int ping_set_dest (PING * ping, char *host);
int ping_set_pattern (PING * p, int len, u_char * pat);
int ping_set_pattern (PING * p, int len, unsigned char * pat);
void ping_set_event_handler (PING * ping, ping_efp fp, void *closure);
int ping_recv (PING * p);
int ping_xmit (PING * p);

View File

@@ -49,7 +49,7 @@
static PING *ping;
bool is_root = false;
unsigned char *data_buffer;
u_char *patptr;
unsigned char *patptr;
int one = 1;
int pattern_len = 16;
size_t data_length = PING_DATALEN;
@@ -102,7 +102,7 @@ static error_t
parse_opt (int key, char *arg, struct argp_state *state)
{
char *endptr;
static u_char pattern[16];
static unsigned char pattern[16];
switch (key)
{
@@ -752,7 +752,7 @@ ping_init (int type, int ident)
p->ping_count = DEFAULT_PING_COUNT;
p->ping_interval = PING_DEFAULT_INTERVAL;
p->ping_datalen = sizeof (struct icmp6_hdr);
/* Make sure we use only 16 bits in this field, id for icmp is a u_short. */
/* Make sure we use only 16 bits in this field, id for icmp is a unsigned short. */
p->ping_ident = ident & 0xFFFF;
p->ping_cktab_size = PING_CKTABSIZE;
gettimeofday (&p->ping_start_time, NULL);

View File

@@ -54,10 +54,10 @@ ping_cvt_number (const char *optarg, size_t maxval, int allow_zero)
}
void
init_data_buffer (u_char * pat, int len)
init_data_buffer (unsigned char * pat, int len)
{
int i = 0;
u_char *p;
unsigned char *p;
if (data_length == 0)
return;

View File

@@ -110,7 +110,7 @@ struct ping_data
int ping_cktab_size;
char *ping_cktab;
u_char *ping_buffer; /* I/O buffer */
unsigned char *ping_buffer; /* I/O buffer */
union ping_address ping_from;
long ping_num_xmit; /* Number of packets transmitted */
long ping_num_recv; /* Number of packets received */

View File

@@ -282,10 +282,10 @@ static void
print_ip_header (struct ip *ip)
{
int hlen;
u_char *cp;
unsigned char *cp;
hlen = ip->ip_hl << 2;
cp = (u_char *) ip + 20; /* point to options */
cp = (unsigned char *) ip + 20; /* point to options */
printf
("Vr HL TOS Len ID Flg off TTL Pro cks Src Dst Data\n");
@@ -306,13 +306,13 @@ void
print_ip_data (icmphdr_t * icmp, void *data)
{
int hlen;
u_char *cp;
unsigned char *cp;
struct ip *ip = &icmp->icmp_ip;
print_ip_header (ip);
hlen = ip->ip_hl << 2;
cp = (u_char *) ip + hlen;
cp = (unsigned char *) ip + hlen;
if (ip->ip_p == 6)
printf ("TCP: from port %u, to port %u (decimal)\n",
@@ -392,12 +392,12 @@ print_icmp_header (struct sockaddr_in *from,
void
print_ip_opt (struct ip *ip, int hlen)
{
u_char *cp;
unsigned char *cp;
int i, j, l;
static int old_rrlen;
static char old_rr[MAX_IPOPTLEN];
cp = (u_char *) (ip + 1);
cp = (unsigned char *) (ip + 1);
for (; hlen > (int) sizeof (struct ip); --hlen, ++cp)
switch (*cp)
@@ -449,7 +449,7 @@ print_ip_opt (struct ip *ip, int hlen)
if (i <= 0)
continue;
if (i == old_rrlen
&& cp == (u_char *) (ip + 1) + 2
&& cp == (unsigned char *) (ip + 1) + 2
&& !memcmp ((char *) cp, old_rr, i) && !(options & OPT_FLOOD))
{
printf ("\t (same route)");

View File

@@ -21,7 +21,7 @@
extern unsigned options;
extern PING *ping;
extern u_char *data_buffer;
extern unsigned char *data_buffer;
extern size_t data_length;
extern int ping_run (PING * ping, int (*finish) ());

View File

@@ -1583,7 +1583,7 @@ machtime (void)
fprintf (stderr, "Unable to get time of day\n");
return 0L;
}
#define OFFSET ((u_long)25567 * 24*60*60)
#define OFFSET ((unsigned long)25567 * 24*60*60)
return (htonl ((long) (tv.tv_sec + OFFSET)));
#undef OFFSET
}

View File

@@ -226,7 +226,7 @@ static struct argp argp = {
};
struct passwd *pwd;
u_short port;
unsigned short port;
uid_t userid;
int errs, rem;

View File

@@ -162,7 +162,7 @@ doit (int f, struct sockaddr_in *fromp)
char *user, *pass, *pw_password;
struct passwd *pwd;
int s;
u_short port;
unsigned short port;
int pv[2], pid, cc;
fd_set readfrom, ready;
char buf[BUFSIZ], sig;

View File

@@ -169,7 +169,7 @@ int dflag = 0;
int noescape;
char * host = NULL;
char * user = NULL;
u_char escapechar = '~';
unsigned char escapechar = '~';
#ifdef OLDSUN

View File

@@ -592,7 +592,7 @@ rlogind_auth (int fd, struct auth_data *ap)
}
#ifdef IP_OPTIONS
{
u_char optbuf[BUFSIZ / 3], *cp;
unsigned char optbuf[BUFSIZ / 3], *cp;
char lbuf[BUFSIZ], *lp;
socklen_t optsize = sizeof (optbuf);
int ipproto;
@@ -918,8 +918,8 @@ do_krb4_login (int infd, struct auth_data *ap, const char **err_msg)
char instance[INST_SZ], version[VERSION_SZ];
long authopts = 0L; /* !mutual */
struct sockaddr_in faddr;
u_char auth_buf[sizeof (AUTH_DAT)];
u_char tick_buf[sizeof (KTEXT_ST)];
unsigned char auth_buf[sizeof (AUTH_DAT)];
unsigned char tick_buf[sizeof (KTEXT_ST)];
Key_schedule schedule;
AUTH_DAT *kdata;
KTEXT ticket;

View File

@@ -301,7 +301,7 @@ doit (int sockfd, struct sockaddr_in *fromp)
#endif
struct hostent *hp;
struct passwd *pwd;
u_short port;
unsigned short port;
fd_set ready, readfrom;
int cc, nfd, pv[2], pid, s = sockfd;
int one = 1;
@@ -351,7 +351,7 @@ doit (int sockfd, struct sockaddr_in *fromp)
}
#ifdef IP_OPTIONS
{
u_char optbuf[BUFSIZ / 3], *cp;
unsigned char optbuf[BUFSIZ / 3], *cp;
char lbuf[BUFSIZ], *lp;
socklen_t optsize = sizeof (optbuf);
int ipproto;
@@ -416,7 +416,7 @@ doit (int sockfd, struct sockaddr_in *fromp)
#endif
/* Need host byte ordered port# to compare */
fromp->sin_port = ntohs ((u_short) fromp->sin_port);
fromp->sin_port = ntohs ((unsigned short) fromp->sin_port);
/* Verify that the client's address was bound to a reserved port */
#if defined KERBEROS || defined SHISHI
if (!use_kerberos)

View File

@@ -168,7 +168,7 @@ struct filed
short f_type; /* Entry type, see below. */
short f_file; /* File descriptor. */
time_t f_time; /* Time this was last written. */
u_char f_pmask[LOG_NFACILITIES + 1]; /* Priority mask. */
unsigned char f_pmask[LOG_NFACILITIES + 1]; /* Priority mask. */
union
{
struct

View File

@@ -969,8 +969,8 @@ send_file (int fd, char *name, char *mode)
nak (errno + 100);
break;
}
dp->th_opcode = htons ((u_short) DATA);
dp->th_block = htons ((u_short) block);
dp->th_opcode = htons ((unsigned short) DATA);
dp->th_block = htons ((unsigned short) block);
}
timeout = 0;
setjmp (timeoutbuf);
@@ -1080,8 +1080,8 @@ recvfile (int fd, char *name, char *mode)
}
else
{
ap->th_opcode = htons ((u_short) ACK);
ap->th_block = htons ((u_short) (block));
ap->th_opcode = htons ((unsigned short) ACK);
ap->th_block = htons ((unsigned short) (block));
size = 4;
block++;
}
@@ -1158,8 +1158,8 @@ recvfile (int fd, char *name, char *mode)
while (size == SEGSIZE);
abort: /* ok to ack, since user */
ap->th_opcode = htons ((u_short) ACK); /* has seen err msg */
ap->th_block = htons ((u_short) block);
ap->th_opcode = htons ((unsigned short) ACK); /* has seen err msg */
ap->th_block = htons ((unsigned short) block);
sendto (f, ackbuf, 4, 0, (struct sockaddr *) &peeraddr, peerlen);
write_behind (file, convert); /* flush last buffer */
fclose (file);
@@ -1174,7 +1174,7 @@ makerequest (int request, const char *name, struct tftphdr *tp,
{
register char *cp;
tp->th_opcode = htons ((u_short) request);
tp->th_opcode = htons ((unsigned short) request);
#if HAVE_STRUCT_TFTPHDR_TH_U
cp = tp->th_stuff;
#else
@@ -1220,8 +1220,8 @@ nak (int error)
int length;
tp = (struct tftphdr *) ackbuf;
tp->th_opcode = htons ((u_short) ERROR);
tp->th_code = htons ((u_short) error);
tp->th_opcode = htons ((unsigned short) ERROR);
tp->th_code = htons ((unsigned short) error);
for (pe = errmsgs; pe->e_code >= 0; pe++)
if (pe->e_code == error)
break;
@@ -1245,7 +1245,7 @@ tpacket (const char *s, struct tftphdr *tp, int n)
{
static char *opcodes[] = { "#0", "RRQ", "WRQ", "DATA", "ACK", "ERROR" };
register char *cp, *file;
u_short op = ntohs (tp->th_opcode);
unsigned short op = ntohs (tp->th_opcode);
if (op < RRQ || op > ERROR)
printf ("%s opcode=%x ", s, op);

View File

@@ -557,8 +557,8 @@ send_file (struct formats *pf)
nak (errno + 100);
goto abort;
}
dp->th_opcode = htons ((u_short) DATA);
dp->th_block = htons ((u_short) block);
dp->th_opcode = htons ((unsigned short) DATA);
dp->th_block = htons ((unsigned short) block);
timeout = 0;
sigsetjmp (timeoutbuf, SIGALRM);
@@ -580,19 +580,19 @@ send_file (struct formats *pf)
syslog (LOG_ERR, "tftpd: read: %m\n");
goto abort;
}
ap->th_opcode = ntohs ((u_short) ap->th_opcode);
ap->th_block = ntohs ((u_short) ap->th_block);
ap->th_opcode = ntohs ((unsigned short) ap->th_opcode);
ap->th_block = ntohs ((unsigned short) ap->th_block);
if (ap->th_opcode == ERROR)
goto abort;
if (ap->th_opcode == ACK)
{
if ((u_short) ap->th_block == (u_short) block)
if ((unsigned short) ap->th_block == (unsigned short) block)
break;
/* Re-synchronize with the other side */
synchnet (peer);
if ((u_short) ap->th_block == (u_short) (block - 1))
if ((unsigned short) ap->th_block == (unsigned short) (block - 1))
goto send_data;
}
@@ -629,8 +629,8 @@ recvfile (struct formats *pf)
do
{
timeout = 0;
ap->th_opcode = htons ((u_short) ACK);
ap->th_block = htons ((u_short) block);
ap->th_opcode = htons ((unsigned short) ACK);
ap->th_block = htons ((unsigned short) block);
block++;
sigsetjmp (timeoutbuf, SIGALRM);
send_ack:
@@ -650,8 +650,8 @@ recvfile (struct formats *pf)
syslog (LOG_ERR, "tftpd: read: %m\n");
goto abort;
}
dp->th_opcode = ntohs ((u_short) dp->th_opcode);
dp->th_block = ntohs ((u_short) dp->th_block);
dp->th_opcode = ntohs ((unsigned short) dp->th_opcode);
dp->th_block = ntohs ((unsigned short) dp->th_block);
if (dp->th_opcode == ERROR)
goto abort;
if (dp->th_opcode == DATA)
@@ -681,8 +681,8 @@ recvfile (struct formats *pf)
write_behind (file, pf->f_convert);
fclose (file); /* close data file */
ap->th_opcode = htons ((u_short) ACK); /* send the "final" ack */
ap->th_block = htons ((u_short) (block));
ap->th_opcode = htons ((unsigned short) ACK); /* send the "final" ack */
ap->th_block = htons ((unsigned short) (block));
sendto (peer, ackbuf, 4, 0, (struct sockaddr *) &from, fromlen);
signal (SIGALRM, justquit); /* just quit on timeout */
@@ -744,8 +744,8 @@ nak (int error)
register struct errmsg *pe;
tp = (struct tftphdr *) buf;
tp->th_opcode = htons ((u_short) ERROR);
tp->th_code = htons ((u_short) error);
tp->th_opcode = htons ((unsigned short) ERROR);
tp->th_code = htons ((unsigned short) error);
for (pe = errmsgs; pe->e_code >= 0; pe++)
if (pe->e_code == error)
break;

View File

@@ -384,7 +384,7 @@ int
trace_read (trace_t * t)
{
int len;
u_char data[56]; /* For a TIME_EXCEEDED datagram. */
unsigned char data[56]; /* For a TIME_EXCEEDED datagram. */
struct ip *ip;
icmphdr_t *ic;
socklen_t siz;
@@ -486,7 +486,7 @@ trace_write (trace_t * t)
{
icmphdr_t hdr;
/* FIXME: We could use the pid as the icmp seqno/ident. */
if (icmp_echo_encode ((u_char *) &hdr, sizeof (hdr), pid, pid))
if (icmp_echo_encode ((unsigned char *) &hdr, sizeof (hdr), pid, pid))
return -1;
len = sendto (t->icmpfd, (char *) &hdr, sizeof (hdr),

View File

@@ -76,7 +76,7 @@ struct sockaddr_in my_addr = { AF_INET };
struct in_addr my_machine_addr;
struct in_addr his_machine_addr;
u_short daemon_port; /* port number of the talk daemon */
unsigned short daemon_port; /* port number of the talk daemon */
int ctl_sockt;
int sockt;

View File

@@ -52,7 +52,7 @@ extern struct sockaddr_in ctl_addr;
extern struct sockaddr_in my_addr;
extern struct in_addr my_machine_addr;
extern struct in_addr his_machine_addr;
extern u_short daemon_port;
extern unsigned short daemon_port;
extern int ctl_sockt;
extern CTL_MSG msg;

View File

@@ -22,7 +22,7 @@
int add_ticket (KTEXT, int, char *, int, char *, char *, char *, int, KTEXT);
/* cr_err_reply.c */
void cr_err_reply (KTEXT, char *, char *, char *, u_long, u_long, char *);
void cr_err_reply (KTEXT, char *, char *, char *, unsigned long, unsigned long, char *);
/* create_auth_reply.c */
KTEXT create_auth_reply (char *, char *, char *, long, int, unsigned long,
@@ -136,10 +136,10 @@ int set_logfile (char *);
int new_log (long, char *);
/* mk_err.c */
long krb_mk_err (u_char *, long, char *);
long krb_mk_err (unsigned char *, long, char *);
/* mk_priv.c */
long krb_mk_priv (u_char *, u_char *, u_long, Key_schedule, C_Block,
long krb_mk_priv (unsigned char *, unsigned char *, unsigned long, Key_schedule, C_Block,
struct sockaddr_in *, struct sockaddr_in *);
/* mk_req.c */
@@ -147,7 +147,7 @@ int krb_mk_req (KTEXT, char *, char *, char *, long);
int krb_set_lifetime (int);
/* mk_safe.c */
long krb_mk_safe (u_char *, u_char *, u_long, C_Block *, struct sockaddr_in *,
long krb_mk_safe (unsigned char *, unsigned char *, unsigned long, C_Block *, struct sockaddr_in *,
struct sockaddr_in *);
/* month_sname.c */
@@ -168,10 +168,10 @@ KTEXT pkt_cipher (KTEXT);
int pkt_clen (KTEXT);
/* rd_err.c */
int krb_rd_err (u_char *, u_long, long *, MSG_DAT *);
int krb_rd_err (unsigned char *, unsigned long, long *, MSG_DAT *);
/* rd_priv.c */
long krb_rd_priv (u_char *, u_long, Key_schedule, C_Block,
long krb_rd_priv (unsigned char *, unsigned long, Key_schedule, C_Block,
struct sockaddr_in *, struct sockaddr_in *, MSG_DAT *);
/* rd_req.c */
@@ -179,7 +179,7 @@ int krb_set_key (char *, int);
int krb_rd_req (KTEXT, char *, char *, long, AUTH_DAT *, char *);
/* rd_safe.c */
long krb_rd_safe (u_char *, u_long, C_Block *, struct sockaddr_in *,
long krb_rd_safe (unsigned char *, unsigned long, C_Block *, struct sockaddr_in *,
struct sockaddr_in *, MSG_DAT *);
/* read_service_key.c */
@@ -197,7 +197,7 @@ int save_credentials (char *, char *, char *, C_Block, int, int, KTEXT, long);
int send_to_kdc (KTEXT, KTEXT, char *);
/* sendauth.c */
int krb_sendauth (long, int, KTEXT, char *, char *, char *, u_long, MSG_DAT *,
int krb_sendauth (long, int, KTEXT, char *, char *, char *, unsigned long, MSG_DAT *,
CREDENTIALS *, Key_schedule, struct sockaddr_in *,
struct sockaddr_in *, char *);
int krb_sendsvc (int, char *);

View File

@@ -101,7 +101,7 @@
* to ZERO on allocation, we need to make sure, when interpreting the
* clock, that when the times are EQUAL, then the buffer is FULL.
*/
static u_long ring_clock = 0;
static unsigned long ring_clock = 0;
#define ring_empty(d) (((d)->consume == (d)->supply) && \

View File

@@ -69,7 +69,7 @@ typedef struct
unsigned char *encryyptedto; /* Data is encrypted to here */
#endif /* ENCRYPTION */
int size; /* size in bytes of buffer */
u_long consumetime, /* help us keep straight full, empty, etc. */
unsigned long consumetime, /* help us keep straight full, empty, etc. */
supplytime;
} Ring;