summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2001-06-11 20:10:01 +0000
committerEzra Peisach <epeisach@mit.edu>2001-06-11 20:10:01 +0000
commit02a38199507d89173b8e8f26ad347d64c9f45114 (patch)
tree2e4e9d679ff289269c02d39a8186f6b22cd733d3
parentbdbce5a9ea28615ffe09897fce00ff4103174606 (diff)
downloadkrb5-02a38199507d89173b8e8f26ad347d64c9f45114.tar.gz
krb5-02a38199507d89173b8e8f26ad347d64c9f45114.tar.xz
krb5-02a38199507d89173b8e8f26ad347d64c9f45114.zip
* configure.in (SETENVOBJ): If setenv is not present on system,
define NEED_SETENV as well as linking in local sources. * defines.h: Include prototype for setenv() if NEED_SETENV defined. * krlogin.c (prf): Declare as void. Used only with one argument - get rid of pseudo-varargs behaviour. * krlogind.c (recvauth): Include k5-util.h for krb5_compat_recvauth_version() prototype. Declare sendoob() void. * krshd.c: Include k5-util.h for krb5_compat_recvauth_version() prototype. * login.c: Include setenv prototype if NEED_SETENV defined. Cast arguments to printf to match format string. * v4rcp.c (source): Cast argument to sprintf() to match format string. * krcp.c (rsource): Likewise. * forward.c (rd_and_store_for_creds): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13334 dc483132-0cff-0310-8789-dd5450dbe970
-rw-r--r--src/appl/bsd/ChangeLog23
-rw-r--r--src/appl/bsd/configure.in1
-rw-r--r--src/appl/bsd/defines.h3
-rw-r--r--src/appl/bsd/forward.c2
-rw-r--r--src/appl/bsd/krcp.c2
-rw-r--r--src/appl/bsd/krlogin.c8
-rw-r--r--src/appl/bsd/krlogind.c3
-rw-r--r--src/appl/bsd/krshd.c1
-rw-r--r--src/appl/bsd/login.c11
-rw-r--r--src/appl/bsd/v4rcp.c2
10 files changed, 45 insertions, 11 deletions
diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog
index 6e158b9ff..f7afdf6d2 100644
--- a/src/appl/bsd/ChangeLog
+++ b/src/appl/bsd/ChangeLog
@@ -1,5 +1,28 @@
2001-06-11 Ezra Peisach <epeisach@mit.edu>
+ * configure.in (SETENVOBJ): If setenv is not present on system,
+ define NEED_SETENV as well as linking in local sources.
+
+ * defines.h: Include prototype for setenv() if NEED_SETENV defined.
+
+ * krlogin.c (prf): Declare as void. Used only with one argument -
+ get rid of pseudo-varargs behaviour.
+
+ * krlogind.c (recvauth): Include k5-util.h for
+ krb5_compat_recvauth_version() prototype. Declare sendoob() void.
+
+ * krshd.c: Include k5-util.h for krb5_compat_recvauth_version()
+ prototype.
+
+ * login.c: Include setenv prototype if NEED_SETENV defined. Cast
+ arguments to printf to match format string.
+
+ * v4rcp.c (source): Cast argument to sprintf() to match format string.
+ * krcp.c (rsource): Likewise.
+ * forward.c (rd_and_store_for_creds): Likewise.
+
+2001-06-11 Ezra Peisach <epeisach@mit.edu>
+
* krshd.c: Include <grp.h>, <libpty.h>, and <sys/wait.h> for
initgroups(), pty_logwtmp()/pty_make_sane_hostname(), and wait()
prototypes. For local initgroups definition, conditionalize on
diff --git a/src/appl/bsd/configure.in b/src/appl/bsd/configure.in
index 058068eae..a556cfb75 100644
--- a/src/appl/bsd/configure.in
+++ b/src/appl/bsd/configure.in
@@ -135,6 +135,7 @@ SETENVSRC=setenv.c
SETENVOBJ=setenv.o
AC_SUBST([SETENVSRC])
AC_SUBST([SETENVOBJ])
+AC_DEFINE([NEED_SETENV])
fi
dnl
dnl
diff --git a/src/appl/bsd/defines.h b/src/appl/bsd/defines.h
index 4259f1398..62f6882bc 100644
--- a/src/appl/bsd/defines.h
+++ b/src/appl/bsd/defines.h
@@ -65,3 +65,6 @@ krb5_error_code rd_and_store_for_creds(krb5_context context,
krb5_data *inbuf, krb5_ticket *ticket,
krb5_ccache *ccache);
+#ifdef NEED_SETENV
+extern int setenv(char *, char *, int);
+#endif
diff --git a/src/appl/bsd/forward.c b/src/appl/bsd/forward.c
index d1bbeccd9..53f67e667 100644
--- a/src/appl/bsd/forward.c
+++ b/src/appl/bsd/forward.c
@@ -54,7 +54,7 @@ rd_and_store_for_creds(context, auth_context, inbuf, ticket, ccache)
* the rlogind or rshd. Set the environment variable as well.
*/
- sprintf(ccname, "FILE:/tmp/krb5cc_p%d", getpid());
+ sprintf(ccname, "FILE:/tmp/krb5cc_p%ld", (long) getpid());
setenv("KRB5CCNAME", ccname, 1);
retval = krb5_cc_resolve(context, ccname, ccache);
diff --git a/src/appl/bsd/krcp.c b/src/appl/bsd/krcp.c
index 63d6bf0ef..21852046e 100644
--- a/src/appl/bsd/krcp.c
+++ b/src/appl/bsd/krcp.c
@@ -887,7 +887,7 @@ void rsource(name, statp)
return;
}
}
- (void) sprintf(buf, "D%04o %d %s\n", statp->st_mode&07777, 0, last);
+ (void) sprintf(buf, "D%04lo %d %s\n", statp->st_mode&07777, 0, last);
(void) rcmd_stream_write(rem, buf, strlen(buf), 0);
if (response() < 0) {
closedir(d);
diff --git a/src/appl/bsd/krlogin.c b/src/appl/bsd/krlogin.c
index a4f6fb8c8..3f72d9df4 100644
--- a/src/appl/bsd/krlogin.c
+++ b/src/appl/bsd/krlogin.c
@@ -263,6 +263,7 @@ void oob KRB5_PROTOTYPE((void));
krb5_sigtype lostpeer KRB5_PROTOTYPE((int));
void setsignal KRB5_PROTOTYPE((int sig, krb5_sigtype (*act)()));
static int read_wrapper(int fd, char *buf, int size, int *got_esc);
+static void prf(char *f);
void try_normal(char **);
static void mode(int);
#ifdef POSIX_SIGNALS
@@ -1782,12 +1783,11 @@ int f;
-/*VARARGS*/
-prf(f, a1, a2, a3, a4, a5)
+static void
+prf(f)
char *f;
- char *a1, *a2, *a3, *a4, *a5;
{
- fprintf(stderr, f, a1, a2, a3, a4, a5);
+ fprintf(stderr, f);
fprintf(stderr, CRLF);
}
diff --git a/src/appl/bsd/krlogind.c b/src/appl/bsd/krlogind.c
index e9b4ad072..4f0b1f818 100644
--- a/src/appl/bsd/krlogind.c
+++ b/src/appl/bsd/krlogind.c
@@ -236,6 +236,7 @@ struct winsize {
#include <libpty.h>
#ifdef HAVE_UTMP_H
#include <utmp.h>
+#include <k5-util.h>
#endif
int auth_sys = 0; /* Which version of Kerberos used to authenticate */
@@ -906,7 +907,7 @@ char oobdata[] = {0};
#endif
static
-int sendoob(fd, byte)
+void sendoob(fd, byte)
int fd;
char *byte;
{
diff --git a/src/appl/bsd/krshd.c b/src/appl/bsd/krshd.c
index cd5cd3b7b..ef3508c2c 100644
--- a/src/appl/bsd/krshd.c
+++ b/src/appl/bsd/krshd.c
@@ -162,6 +162,7 @@ char copyright[] =
#include <kerberosIV/krb.h>
Key_schedule v4_schedule;
#endif
+#include <k5-util.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c
index d6ba8967c..46a6c6467 100644
--- a/src/appl/bsd/login.c
+++ b/src/appl/bsd/login.c
@@ -291,6 +291,10 @@ static const char *krb_get_err_text(kerror)
#define MAXENVIRON 32
+#ifdef NEED_SETENV
+extern int setenv(char *, char *, int);
+#endif
+
/*
* This bounds the time given to login. Not a define so it can
* be patched on machines where it's too small.
@@ -523,7 +527,7 @@ void k_init (ttyn)
/* Set up the credential cache environment variable */
if (!getenv(KRB5_ENV_CCNAME)) {
- sprintf(ccfile, "FILE:/tmp/krb5cc_p%d", getpid());
+ sprintf(ccfile, "FILE:/tmp/krb5cc_p%ld", (long) getpid());
setenv(KRB5_ENV_CCNAME, ccfile, 1);
krb5_cc_set_default_name(kcontext, ccfile);
unlink(ccfile+strlen("FILE:"));
@@ -2128,9 +2132,10 @@ void dolastlog(quiet, tty)
printf("Last login: %.*s ", 24-5, (char *)ctime(&ll.ll_time));
if (*ll.ll_host != '\0')
- printf("from %.*s\n", sizeof(ll.ll_host), ll.ll_host);
+ printf("from %.*s\n", (int) sizeof(ll.ll_host),
+ ll.ll_host);
else
- printf("on %.*s\n", sizeof(ll.ll_line), ll.ll_line);
+ printf("on %.*s\n", (int) sizeof(ll.ll_line), ll.ll_line);
}
(void)lseek(fd, (off_t)pwd->pw_uid * sizeof(ll), SEEK_SET);
}
diff --git a/src/appl/bsd/v4rcp.c b/src/appl/bsd/v4rcp.c
index 4bff50fea..894dc1a5d 100644
--- a/src/appl/bsd/v4rcp.c
+++ b/src/appl/bsd/v4rcp.c
@@ -524,7 +524,7 @@ notreg:
}
}
(void) sprintf(buf, "C%04o %ld %s\n",
- (unsigned int) stb.st_mode&07777, stb.st_size, last);
+ (unsigned int) stb.st_mode&07777, (long) stb.st_size, last);
kstream_write (krem, buf, strlen (buf));
if (response() < 0) {
(void) close(f);