source:
npl/system/netkit-ftp/patches/13-netkit-ftp-0.17-longnames.patch
@
ca72aba
Last change on this file since ca72aba was c5c522c, checked in by , 8 years ago | |
---|---|
|
|
File size: 3.2 KB |
-
netkit-ftp-0.17/ftp/cmds.c
old new 1057 1057 status(void) 1058 1058 { 1059 1059 int i; 1060 1061 if (connected) 1060 if (connected) 1062 1061 printf("Connected to %s.\n", hostname); 1063 else 1062 else 1064 1063 printf("Not connected.\n"); 1065 1064 if (!proxy) { 1066 1065 pswitch(1); … … 1081 1080 onoff(runique)); 1082 1081 printf("Case: %s; CR stripping: %s\n",onoff(mcase),onoff(crflag)); 1083 1082 if (ntflag) { 1084 printf("Ntrans: (in) %s (out) %s\n", 1083 printf("Ntrans: (in) %s (out) %s\n",ntin,ntout); 1085 1084 } 1086 1085 else { 1087 1086 printf("Ntrans: off\n"); … … 1948 1947 } 1949 1948 ntflag++; 1950 1949 code = ntflag; 1951 (void) strncpy(ntin, argv[1], 16);1952 ntin[ 16] = '\0';1950 (void) strncpy(ntin, argv[1], NTRANS_MAX); 1951 ntin[NTRANS_MAX] = '\0'; 1953 1952 if (argc == 2) { 1954 1953 ntout[0] = '\0'; 1955 1954 return; 1956 1955 } 1957 (void) strncpy(ntout, argv[2], 16);1958 ntout[16] = '\0';1956 (void) strncpy(ntout, argv[2], NTRANS_MAX); 1957 ntout[NTRANS_MAX] = '\0'; 1959 1958 } 1960 1959 1961 1960 static char * … … 1965 1964 char *cp1, *cp2 = new; 1966 1965 register int i, ostop, found; 1967 1966 1968 for (ostop = 0; *(ntout + ostop) && ostop < 16; ostop++);1967 for (ostop = 0; *(ntout + ostop) && ostop < NTRANS_MAX; ostop++); 1969 1968 for (cp1 = name; *cp1; cp1++) { 1970 1969 found = 0; 1971 for (i = 0; *(ntin + i) && i < 16; i++) {1970 for (i = 0; *(ntin + i) && i < NTRANS_MAX; i++) { 1972 1971 if (*cp1 == *(ntin + i)) { 1973 1972 found++; 1974 1973 if (i < ostop) { -
netkit-ftp-0.17/ftp/ftp.c
old new 1656 1656 int runqe; 1657 1657 int mcse; 1658 1658 int ntflg; 1659 char nti[ 17];1660 char nto[ 17];1659 char nti[NTRANS_MAX+1]; 1660 char nto[NTRANS_MAX+1]; 1661 1661 int mapflg; 1662 1662 char mi[MAXPATHLEN]; 1663 1663 char mo[MAXPATHLEN]; … … 1712 1712 mcase = op->mcse; 1713 1713 ip->ntflg = ntflag; 1714 1714 ntflag = op->ntflg; 1715 (void) strncpy(ip->nti, ntin, 16);1716 (ip->nti)[ 16] = '\0'; /* shouldn't use strlen */1715 (void) strncpy(ip->nti, ntin, NTRANS_MAX); 1716 (ip->nti)[NTRANS_MAX] = '\0'; /* shouldn't use strlen */ 1717 1717 (void) strcpy(ntin, op->nti); 1718 (void) strncpy(ip->nto, ntout, 16);1719 (ip->nto)[ 16] = '\0';1718 (void) strncpy(ip->nto, ntout, NTRANS_MAX); 1719 (ip->nto)[NTRANS_MAX] = '\0'; 1720 1720 (void) strcpy(ntout, op->nto); 1721 1721 ip->mapflg = mapflag; 1722 1722 mapflag = op->mapflg; -
netkit-ftp-0.17/ftp/ftp_var.h
old new 42 42 43 43 #include <setjmp.h> 44 44 #include <sys/param.h> 45 #define NTRANS_MAX 64 45 46 46 47 /* 47 48 * Tick counter step size. … … 82 83 Extern char pasv[64]; /* passive port for proxy data connection */ 83 84 Extern int passivemode; /* passive mode enabled */ 84 85 Extern char *altarg; /* argv[1] with no shell-like preprocessing */ 85 Extern char ntin[ 17]; /* input translation table */86 Extern char ntout[ 17]; /* output translation table */86 Extern char ntin[NTRANS_MAX+1]; /* input translation table */ 87 Extern char ntout[NTRANS_MAX+1]; /* output translation table */ 87 88 Extern char mapin[MAXPATHLEN]; /* input map template */ 88 89 Extern char mapout[MAXPATHLEN]; /* output map template */ 89 90 Extern char typename[32]; /* name of file transfer type */
Note: See TracBrowser
for help on using the repository browser.