summaryrefslogtreecommitdiff
path: root/net/icsi-finger/patches/patch-ak
blob: 1269899f63ff2ae22565cdfe8d8a6c77f2ed78fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
$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 <sys/types.h>
 #include <fcntl.h>
 #include <sys/file.h>
-#ifndef X_OK
 #include <unistd.h>
-#endif
 #include <sys/stat.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -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);