* Note: Root logins are always logged.
*/
-/* This is usually done in site.def. If not, then uncomment this.
-#define KERBEROS
-*/
+/*
+ * This is usually done in the Makefile. Actually, these sources may
+ * not work without the KERBEROS #defined.
+ *
+ * #define KERBEROS
+ */
#define LOG_REMOTE_REALM
#define CRYPT
#define SERVE_V4
#include <netdb.h>
#include <syslog.h>
#include <strings.h>
+#include <ctype.h>
#include <sys/param.h>
#include <utmp.h>
extern int errno;
int reapchild();
struct passwd *getpwnam();
-#ifndef ultrix
+#if (!defined(__STDC__) && !defined(ultrix))
char *malloc();
#endif
char *progname;
int argc;
char **argv;
{
- extern int opterr, optind, optarg;
+ extern int opterr, optind;
+ char * optarg;
int on = 1, fromlen, ch, i;
struct sockaddr_in from;
char *options;
if (!strcmp(progname+i, "logind")) {
char **newargv;
- newargv = (char **) malloc(sizeof(char *) 3);
+ newargv = (char **) malloc(sizeof(char *) * 3);
strcpy(options, "-");
strncat(options, progname, i);
cleanup();
}
-
-
-char magic[2] = { 0377, 0377 };
+unsigned char magic[2] = { 0377, 0377 };
#ifdef TIOCSWINSZ
#ifndef TIOCPKT_WINDOW
#define TIOCPKT_WINDOW 0x80
#endif
-char oobdata[] = {TIOCPKT_WINDOW};
+unsigned char oobdata[] = {TIOCPKT_WINDOW};
#else
char oobdata[] = {0};
#endif
{
krb5_error_code status;
struct sockaddr_in peersin;
- char hostname[100];
char krb_vers[KRB_SENDAUTH_VLEN + 1];
int len;
peeraddr.length = SIZEOF_INADDR;
peeraddr.contents = (krb5_octet *)&peersin.sin_addr;
- gethostname(hostname, 100);
- if (status = krb5_sname_to_principal(hostname,"host", KRB5_NT_SRV_HST,
+ if (status = krb5_sname_to_principal(NULL, "host", KRB5_NT_SRV_HST,
&server)) {
syslog(LOG_ERR, "parse server name %s: %s", "host",
error_message(status));
exit(1);
}
- krb5_princ_type(server) = KRB5_NT_SRV_HST;
if (status = v5_recvauth(&netf,
"KCMDV0.1",