$NetBSD: patch-ak,v 1.1.6.1 2011/12/08 04:01:09 sbd Exp $ --- src/in.fingerd.c.orig 1996-01-10 19:26:24.000000000 +0000 +++ src/in.fingerd.c @@ -33,9 +33,7 @@ static char *rcsid = "$Id: in.fingerd.c, #include #include #include -#ifndef X_OK #include -#endif #include #include #include @@ -805,12 +803,12 @@ finger_users (user, options, stream) fprintf (stream, "%s (%s) seen at %s on %s", upackets[i]->real_name, upackets[i]->name, strip_hostname (upackets[i]->host), - ctime (&upackets[i]->idle_time)); + ctime32 (&upackets[i]->idle_time)); else fprintf (stream, "%s seen at %s on %s", upackets[i]->name, strip_hostname (upackets[i]->host), - ctime (&upackets[i]->idle_time)); + ctime32 (&upackets[i]->idle_time)); } else { @@ -888,7 +886,6 @@ finger_clients (user, options, stream) else { status = ""; - idle_time = ""; } @@ -1262,7 +1259,7 @@ show_unlogged_packet (packet, stream) /* In SunOS4 getpwnam() seems to call ctime(), so we move this call down * here to be sure the intended result doesn't get overwritten. */ - char *the_time = ctime(&packet->idle_time); + char *the_time = ctime32(&packet->idle_time); the_time[strlen(the_time) - 1] = '\0'; /* delete newline */ if (*(packet->real_name)) @@ -1406,14 +1403,7 @@ run_target_script(script, target, cd, in char *arg; { int pid; -#ifdef SYSV int status; -#else -#ifndef WEXITSTATUS -# define WEXITSTATUS(w) ((w).w_retcode) -#endif - union wait status; -#endif if (access (script, X_OK) >= 0) { @@ -1528,6 +1518,7 @@ maybe_user_script (entry, stream, packet FILE *long_output; int result; extern char *mktemp(); + int temp_fd; #ifndef FINGERRC return (0); @@ -1571,8 +1562,9 @@ maybe_user_script (entry, stream, packet /* Collect regular long finger output in file */ strcpy (temp_file, TEMPFILE); - if (!mktemp (temp_file) || - !(long_output = fopen (temp_file, "w+"))) + temp_fd = mkstemp (temp_file); + if (temp_fd < 0 || + !(long_output = fdopen (temp_fd, "w+"))) { file_error (WARNING, temp_file); free (user_script);