Use MaxHostNameLen and MaxPathLen
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@536 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -423,7 +423,7 @@ mput(int argc, char **argv)
|
||||
oldintr = signal(SIGINT, mabort);
|
||||
(void) setjmp(jabort);
|
||||
if (proxy) {
|
||||
char *cp, *tp2, tmpbuf[MAXPATHLEN];
|
||||
char *cp, *tp2, tmpbuf[MaxPathLen];
|
||||
|
||||
while ((cp = remglob(argv,0)) != NULL) {
|
||||
if (*cp == 0) {
|
||||
@@ -566,7 +566,7 @@ usage:
|
||||
return (0);
|
||||
}
|
||||
if (loc && mcase) {
|
||||
char *tp = argv[1], *tp2, tmpbuf[MAXPATHLEN];
|
||||
char *tp = argv[1], *tp2, tmpbuf[MaxPathLen];
|
||||
|
||||
while (*tp && !islower(*tp)) {
|
||||
tp++;
|
||||
@@ -672,7 +672,7 @@ mget(int argc, char **argv)
|
||||
{
|
||||
sighand oldintr;
|
||||
int ch, ointer;
|
||||
char *cp, *tp, *tp2, tmpbuf[MAXPATHLEN];
|
||||
char *cp, *tp, *tp2, tmpbuf[MaxPathLen];
|
||||
|
||||
if (argc < 2 && !another(&argc, &argv, "remote-files")) {
|
||||
printf("usage: %s remote-files\n", argv[0]);
|
||||
@@ -722,7 +722,7 @@ char *
|
||||
remglob(char **argv, int doswitch)
|
||||
{
|
||||
char temp[16];
|
||||
static char buf[MAXPATHLEN];
|
||||
static char buf[MaxPathLen];
|
||||
static FILE *ftemp = NULL;
|
||||
static char **args;
|
||||
int oldverbose, oldhash;
|
||||
@@ -990,7 +990,7 @@ cd(int argc, char **argv)
|
||||
void
|
||||
lcd(int argc, char **argv)
|
||||
{
|
||||
char buf[MAXPATHLEN];
|
||||
char buf[MaxPathLen];
|
||||
|
||||
if (argc < 2)
|
||||
argc++, argv[1] = home;
|
||||
@@ -1656,7 +1656,7 @@ setntrans(int argc, char **argv)
|
||||
char *
|
||||
dotrans(char *name)
|
||||
{
|
||||
static char new[MAXPATHLEN];
|
||||
static char new[MaxPathLen];
|
||||
char *cp1, *cp2 = new;
|
||||
int i, ostop, found;
|
||||
|
||||
@@ -1707,16 +1707,16 @@ setnmap(int argc, char **argv)
|
||||
cp = strchr(altarg, ' ');
|
||||
}
|
||||
*cp = '\0';
|
||||
(void) strncpy(mapin, altarg, MAXPATHLEN - 1);
|
||||
(void) strncpy(mapin, altarg, MaxPathLen - 1);
|
||||
while (*++cp == ' ')
|
||||
continue;
|
||||
(void) strncpy(mapout, cp, MAXPATHLEN - 1);
|
||||
(void) strncpy(mapout, cp, MaxPathLen - 1);
|
||||
}
|
||||
|
||||
char *
|
||||
domap(char *name)
|
||||
{
|
||||
static char new[MAXPATHLEN];
|
||||
static char new[MaxPathLen];
|
||||
char *cp1 = name, *cp2 = mapin;
|
||||
char *tp[9], *te[9];
|
||||
int i, toks[9], toknum = 0, match = 1;
|
||||
|
@@ -1269,7 +1269,7 @@ pswitch(int flag)
|
||||
sighand oldintr;
|
||||
static struct comvars {
|
||||
int connect;
|
||||
char name[MAXHOSTNAMELEN];
|
||||
char name[MaxHostNameLen];
|
||||
struct sockaddr_in mctl;
|
||||
struct sockaddr_in hctl;
|
||||
FILE *in;
|
||||
@@ -1284,8 +1284,8 @@ pswitch(int flag)
|
||||
char nti[17];
|
||||
char nto[17];
|
||||
int mapflg;
|
||||
char mi[MAXPATHLEN];
|
||||
char mo[MAXPATHLEN];
|
||||
char mi[MaxPathLen];
|
||||
char mo[MaxPathLen];
|
||||
} proxstruct, tmpstruct;
|
||||
struct comvars *ip, *op;
|
||||
|
||||
@@ -1342,10 +1342,10 @@ pswitch(int flag)
|
||||
(void) strcpy(ntout, op->nto);
|
||||
ip->mapflg = mapflag;
|
||||
mapflag = op->mapflg;
|
||||
(void) strncpy(ip->mi, mapin, MAXPATHLEN - 1);
|
||||
(void) strncpy(ip->mi, mapin, MaxPathLen - 1);
|
||||
(ip->mi)[strlen(ip->mi)] = '\0';
|
||||
(void) strcpy(mapin, op->mi);
|
||||
(void) strncpy(ip->mo, mapout, MAXPATHLEN - 1);
|
||||
(void) strncpy(ip->mo, mapout, MaxPathLen - 1);
|
||||
(ip->mo)[strlen(ip->mo)] = '\0';
|
||||
(void) strcpy(mapout, op->mo);
|
||||
(void) signal(SIGINT, oldintr);
|
||||
@@ -1508,7 +1508,7 @@ reset(int argc, char **argv)
|
||||
char *
|
||||
gunique(char *local)
|
||||
{
|
||||
static char new[MAXPATHLEN];
|
||||
static char new[MaxPathLen];
|
||||
char *cp = strrchr(local, '/');
|
||||
int d, count=0;
|
||||
char ext = '1';
|
||||
|
@@ -72,8 +72,8 @@ extern int passivemode; /* passive mode enabled */
|
||||
extern char *altarg; /* argv[1] with no shell-like preprocessing */
|
||||
extern char ntin[17]; /* input translation table */
|
||||
extern char ntout[17]; /* output translation table */
|
||||
extern char mapin[MAXPATHLEN]; /* input map template */
|
||||
extern char mapout[MAXPATHLEN]; /* output map template */
|
||||
extern char mapin[MaxPathLen]; /* input map template */
|
||||
extern char mapout[MaxPathLen]; /* output map template */
|
||||
extern char typename[32]; /* name of file transfer type */
|
||||
extern int type; /* requested file transfer type */
|
||||
extern int curtype; /* current file transfer type */
|
||||
|
@@ -28,8 +28,8 @@ int passivemode; /* passive mode enabled */
|
||||
char *altarg; /* argv[1] with no shell-like preprocessing */
|
||||
char ntin[17]; /* input translation table */
|
||||
char ntout[17]; /* output translation table */
|
||||
char mapin[MAXPATHLEN]; /* input map template */
|
||||
char mapout[MAXPATHLEN]; /* output map template */
|
||||
char mapin[MaxPathLen]; /* input map template */
|
||||
char mapout[MaxPathLen]; /* output map template */
|
||||
char typename[32]; /* name of file transfer type */
|
||||
int type; /* requested file transfer type */
|
||||
int curtype; /* current file transfer type */
|
||||
|
@@ -42,7 +42,7 @@ main(int argc, char **argv)
|
||||
{
|
||||
int ch, top;
|
||||
struct passwd *pw = NULL;
|
||||
char *cp, homedir[MAXPATHLEN];
|
||||
char *cp, homedir[MaxPathLen];
|
||||
struct servent *sp;
|
||||
|
||||
sp = getservbyname("ftp", "tcp");
|
||||
|
@@ -137,8 +137,8 @@ off_t byte_count;
|
||||
#endif
|
||||
int defumask = CMASK; /* default umask value */
|
||||
char tmpline[10240];
|
||||
char hostname[MAXHOSTNAMELEN];
|
||||
char remotehost[MAXHOSTNAMELEN];
|
||||
char hostname[MaxHostNameLen];
|
||||
char remotehost[MaxHostNameLen];
|
||||
static char ttyline[20];
|
||||
char *tty = ttyline; /* for klogin */
|
||||
|
||||
@@ -206,7 +206,7 @@ static struct passwd * sk_getpwnam (char *);
|
||||
static char *
|
||||
curdir(void)
|
||||
{
|
||||
static char path[MAXPATHLEN+1+1]; /* path + '/' + '\0' */
|
||||
static char path[MaxPathLen+1+1]; /* path + '/' + '\0' */
|
||||
|
||||
if (getcwd(path, sizeof(path)-2) == NULL)
|
||||
return ("");
|
||||
@@ -1447,7 +1447,7 @@ removedir(char *name)
|
||||
void
|
||||
pwd(void)
|
||||
{
|
||||
char path[MAXPATHLEN + 1];
|
||||
char path[MaxPathLen + 1];
|
||||
char *ret;
|
||||
|
||||
/* SunOS has a broken getcwd that does popen(pwd) (!!!), this
|
||||
@@ -1624,7 +1624,7 @@ pasv_error:
|
||||
static char *
|
||||
gunique(char *local)
|
||||
{
|
||||
static char new[MAXPATHLEN];
|
||||
static char new[MaxPathLen];
|
||||
struct stat st;
|
||||
int count;
|
||||
char *cp;
|
||||
@@ -1740,7 +1740,7 @@ send_file_list(char *whichf)
|
||||
continue;
|
||||
|
||||
while ((dir = readdir(dirp)) != NULL) {
|
||||
char nbuf[MAXPATHLEN];
|
||||
char nbuf[MaxPathLen];
|
||||
|
||||
if (!strcmp(dir->d_name, "."))
|
||||
continue;
|
||||
|
@@ -16,7 +16,7 @@ klogin(char *name, char *password)
|
||||
int kerror;
|
||||
KTEXT_ST tkt;
|
||||
AUTH_DAT ad;
|
||||
char hostname[MAXHOSTNAMELEN];
|
||||
char hostname[MaxHostNameLen];
|
||||
char realm[REALM_SZ];
|
||||
|
||||
char *phost;
|
||||
|
@@ -81,7 +81,7 @@ pop_init(POP *p,int argcount,char **argmessage)
|
||||
p->myname = argmessage[0];
|
||||
|
||||
/* Get the name of our host */
|
||||
(void)gethostname(p->myhost,MAXHOSTNAMELEN);
|
||||
(void)gethostname(p->myhost,MaxHostNameLen);
|
||||
|
||||
/* Open the log file */
|
||||
#ifdef SYSLOG42
|
||||
|
@@ -71,9 +71,6 @@
|
||||
#define FALSE 0
|
||||
#define NEWLINE '\n'
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
#define MAXHOSTNAMELEN 256
|
||||
#endif
|
||||
#define MAXUSERNAMELEN 65
|
||||
#define MAXDROPLEN 64
|
||||
#define MAXLINELEN 1024
|
||||
@@ -190,7 +187,7 @@ typedef struct { /* POP parameter block */
|
||||
int debug; /* Debugging requested */
|
||||
char * myname; /* The name of this POP
|
||||
daemon program */
|
||||
char myhost[MAXHOSTNAMELEN]; /* The name of our host
|
||||
char myhost[MaxHostNameLen]; /* The name of our host
|
||||
computer */
|
||||
char * client; /* Canonical name of client
|
||||
computer */
|
||||
|
@@ -72,8 +72,8 @@ RCSID("$Id$");
|
||||
#include <netinet/ip.h>
|
||||
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
#define MAXHOSTNAMELEN 64
|
||||
#ifndef MaxHostNameLen
|
||||
#define MaxHostNameLen 64
|
||||
#endif
|
||||
|
||||
#if defined(IPPROTO_IP) && defined(IP_TOS)
|
||||
@@ -81,7 +81,7 @@ int tos = -1;
|
||||
#endif /* defined(IPPROTO_IP) && defined(IP_TOS) */
|
||||
|
||||
char *hostname;
|
||||
static char _hostname[MAXHOSTNAMELEN];
|
||||
static char _hostname[MaxHostNameLen];
|
||||
|
||||
extern char *getenv();
|
||||
|
||||
|
@@ -48,7 +48,7 @@ RCSID("$Id$");
|
||||
|
||||
#ifdef NEWINIT
|
||||
#include <initreq.h>
|
||||
int utmp_len = MAXHOSTNAMELEN; /* sizeof(init_request.host) */
|
||||
int utmp_len = MaxHostNameLen; /* sizeof(init_request.host) */
|
||||
#else /* NEWINIT*/
|
||||
# ifdef HAVE_UTMPX_H
|
||||
# include <utmpx.h>
|
||||
|
@@ -789,13 +789,10 @@ terminaltypeok(s)
|
||||
return(1);
|
||||
}
|
||||
|
||||
#ifndef MAXHOSTNAMELEN
|
||||
#define MAXHOSTNAMELEN 64
|
||||
#endif /* MAXHOSTNAMELEN */
|
||||
|
||||
char *hostname;
|
||||
char host_name[MAXHOSTNAMELEN];
|
||||
char remote_host_name[MAXHOSTNAMELEN];
|
||||
char host_name[MaxHostNameLen];
|
||||
char remote_host_name[MaxHostNameLen];
|
||||
|
||||
#ifndef convex
|
||||
extern void telnet P((int, int));
|
||||
|
@@ -8,7 +8,7 @@ RCSID("$Id$");
|
||||
char*
|
||||
getcwd(char *path, int size)
|
||||
{
|
||||
char xxx[MAXPATHLEN];
|
||||
char xxx[MaxPathLen];
|
||||
char *ret;
|
||||
ret = getwd(xxx);
|
||||
if(ret)
|
||||
|
@@ -77,8 +77,8 @@ __ivaliduser(FILE *hostf, u_int32_t raddr, const char *luser, const char *ruser)
|
||||
{
|
||||
register char *user, *p;
|
||||
int ch;
|
||||
char buf[MAXHOSTNAMELEN + 128]; /* host + login */
|
||||
char hname[MAXHOSTNAMELEN];
|
||||
char buf[MaxHostNameLen + 128]; /* host + login */
|
||||
char hname[MaxHostNameLen];
|
||||
struct hostent *hp;
|
||||
/* Presumed guilty until proven innocent. */
|
||||
int userok = 0, hostok = 0;
|
||||
|
Reference in New Issue
Block a user