random fixes to make it build with socks

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5028 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1998-06-13 00:06:56 +00:00
parent a5f54865d4
commit e9fea047b0
15 changed files with 526 additions and 508 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -119,7 +119,12 @@
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
extern int LIBPREFIX(fclose) __P((FILE *)); extern int LIBPREFIX(fclose) (FILE *);
/* This doesn't belong here. */
struct tm *localtime(const time_t *);
struct hostent *gethostbyname(const char *);
#endif #endif
#include "ftp_var.h" #include "ftp_var.h"

View File

@@ -203,6 +203,7 @@ mk_auth(struct krb4_data *d, KTEXT adat,
int ret; int ret;
CREDENTIALS cred; CREDENTIALS cred;
char sname[SNAME_SZ], inst[INST_SZ], realm[REALM_SZ]; char sname[SNAME_SZ], inst[INST_SZ], realm[REALM_SZ];
strcpy_truncate(sname, service, sizeof(sname)); strcpy_truncate(sname, service, sizeof(sname));
strcpy_truncate(inst, krb_get_phost(host), sizeof(inst)); strcpy_truncate(inst, krb_get_phost(host), sizeof(inst));
strcpy_truncate(realm, krb_realmofhost(host), sizeof(realm)); strcpy_truncate(realm, krb_realmofhost(host), sizeof(realm));

View File

@@ -1100,7 +1100,7 @@ yylex(void)
#ifdef HAVE_SETPROCTITLE #ifdef HAVE_SETPROCTITLE
if (strncasecmp(cbuf, "PASS", 4) != NULL) if (strncasecmp(cbuf, "PASS", 4) != NULL)
setproctitle("%s: %s", proctitle, cbuf); setproctitle("%s: %s", proctitle, cbuf);
#endif #endif /* HAVE_SETPROCTITLE */
if ((cp = strchr(cbuf, '\r'))) { if ((cp = strchr(cbuf, '\r'))) {
*cp++ = '\n'; *cp++ = '\n';
*cp = '\0'; *cp = '\0';
@@ -1385,7 +1385,8 @@ sizecmd(char *filename)
reply(550, "%s: not a plain file.", filename); reply(550, "%s: not a plain file.", filename);
else else
reply(213, "%lu", (unsigned long)stbuf.st_size); reply(213, "%lu", (unsigned long)stbuf.st_size);
break; } break;
}
case TYPE_A: { case TYPE_A: {
FILE *fin; FILE *fin;
int c; int c;
@@ -1411,7 +1412,8 @@ sizecmd(char *filename)
fclose(fin); fclose(fin);
reply(213, "%lu", (unsigned long)count); reply(213, "%lu", (unsigned long)count);
break; } break;
}
default: default:
reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]);
} }

View File

@@ -158,7 +158,7 @@
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
extern int LIBPREFIX(fclose) __P((FILE *)); extern int LIBPREFIX(fclose) (FILE *);
#endif #endif
int yyparse(); int yyparse();

View File

@@ -88,7 +88,7 @@ store_ticket(KTEXT cip)
len = strnlen(ptr, left); len = strnlen(ptr, left);
if (len == left) if (len == left)
return(INTK_BADPW); return(INTK_BADPW);
/* extract server's instance */ /* extract server's instance */
strcpy_truncate(sp.instance, ptr, sizeof(sp.instance)); strcpy_truncate(sp.instance, ptr, sizeof(sp.instance));
ptr += len + 1; ptr += len + 1;
@@ -97,7 +97,7 @@ store_ticket(KTEXT cip)
len = strnlen(ptr, left); len = strnlen(ptr, left);
if (len == left) if (len == left)
return(INTK_BADPW); return(INTK_BADPW);
/* extract server's realm */ /* extract server's realm */
strcpy_truncate(sp.realm, ptr, sizeof(sp.realm)); strcpy_truncate(sp.realm, ptr, sizeof(sp.realm));
ptr += len + 1; ptr += len + 1;

View File

@@ -107,6 +107,9 @@
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
/* This doesn't belong here. */
struct tm *localtime(const time_t *);
struct hostent *gethostbyname(const char *);
#endif #endif
#include <krb.h> #include <krb.h>

View File

@@ -67,12 +67,13 @@ RCSID("$Id$");
#endif #endif
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <roken.h>
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
#endif #endif
#include <roken.h>
#include "encrypt.h" #include "encrypt.h"
#include "auth.h" #include "auth.h"
#include "misc-proto.h" #include "misc-proto.h"

View File

@@ -42,13 +42,13 @@ RCSID("$Id$");
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#endif #endif
#include <roken.h>
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
#endif #endif
#include "encrypt.h" #include "encrypt.h"
#include "misc-proto.h" #include "misc-proto.h"
#include <roken.h>
#include <des.h> #include <des.h>

View File

@@ -67,11 +67,11 @@ RCSID("$Id$");
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <roken.h>
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
#endif #endif
#include <roken.h>
/* /*
* These functions pointers point to the current routines * These functions pointers point to the current routines

View File

@@ -70,11 +70,11 @@ RCSID("$Id$");
#include <pwd.h> #include <pwd.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <roken.h>
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
#endif #endif
#include <roken.h>
#include "encrypt.h" #include "encrypt.h"
#include "auth.h" #include "auth.h"

View File

@@ -68,11 +68,11 @@ RCSID("$Id$");
#define Authenticator k5_Authenticator #define Authenticator k5_Authenticator
#include <krb5.h> #include <krb5.h>
#undef Authenticator #undef Authenticator
#include <roken.h>
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
#endif #endif
#include <roken.h>
#include "encrypt.h" #include "encrypt.h"
#include "auth.h" #include "auth.h"

View File

@@ -38,6 +38,7 @@ RCSID("$Id$");
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <roken.h>
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
#endif #endif
@@ -45,7 +46,6 @@ RCSID("$Id$");
#include "auth.h" #include "auth.h"
#include "encrypt.h" #include "encrypt.h"
#include <roken.h>
char *RemoteHostName; char *RemoteHostName;
char *LocalHostName; char *LocalHostName;

View File

@@ -160,6 +160,9 @@
#ifdef SOCKS #ifdef SOCKS
#include <socks.h> #include <socks.h>
/* This doesn't belong here. */
struct tm *localtime(const time_t *);
struct hostent *gethostbyname(const char *);
#endif #endif
#ifdef KRB4 #ifdef KRB4

View File

@@ -259,8 +259,11 @@ netflush(void)
* old 4.2 client (and thus unable to survive TCP urgent data), * old 4.2 client (and thus unable to survive TCP urgent data),
* write the entire buffer in non-OOB mode. * write the entire buffer in non-OOB mode.
*/ */
#if 1 /* remove this to make it work between solaris 2.6 and linux */
if ((neturg == 0) || (not42 == 0)) { if ((neturg == 0) || (not42 == 0)) {
#endif
n = write(net, nbackp, n); /* normal write */ n = write(net, nbackp, n); /* normal write */
#if 1 /* remove this to make it work between solaris 2.6 and linux */
} else { } else {
n = neturg - nbackp; n = neturg - nbackp;
/* /*
@@ -277,6 +280,7 @@ netflush(void)
n = send(net, nbackp, n, MSG_OOB); /* URGENT data */ n = send(net, nbackp, n, MSG_OOB); /* URGENT data */
} }
} }
#endif
} }
if (n < 0) { if (n < 0) {
if (errno == EWOULDBLOCK || errno == EINTR) if (errno == EWOULDBLOCK || errno == EINTR)