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
+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
SETENVOBJ=setenv.o
AC_SUBST([SETENVSRC])
AC_SUBST([SETENVOBJ])
+AC_DEFINE([NEED_SETENV])
fi
dnl
dnl
krb5_data *inbuf, krb5_ticket *ticket,
krb5_ccache *ccache);
+#ifdef NEED_SETENV
+extern int setenv(char *, char *, int);
+#endif
* 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);
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);
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
-/*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);
}
#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 */
#endif
static
-int sendoob(fd, byte)
+void sendoob(fd, byte)
int fd;
char *byte;
{
#include <kerberosIV/krb.h>
Key_schedule v4_schedule;
#endif
+#include <k5-util.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
#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.
/* 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:"));
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);
}
}
}
(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);