aboutsummaryrefslogtreecommitdiffstats
path: root/devel/p5-PPerl/files/patch-main.c
blob: 79795b564c627d20b5b01f78e113fbc89ef093e4 (plain) (blame)
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
--- main.c.orig Wed Mar  3 01:06:15 2004
+++ main.c  Mon Dec 13 18:22:53 2004
@@ -223,6 +223,8 @@
     /* strict C compilers can't/won't do char foo[variant]; */
     char *fullpath = my_malloc(path_max);
     int i = 0;
+    char euid[sizeof(uid_t)+2];
+    sprintf(euid, "_%d", geteuid());
 
     if (realpath(scriptname, fullpath) == NULL) {
         perror("pperl: resolving full pathname to script failed");
@@ -230,7 +232,7 @@
     }
     Dx(Debug("realpath returned: %s\n", fullpath));
     /* Ugh. I am a terrible C programmer! */
-    sockname = my_malloc(strlen(P_tmpdir) + strlen(fullpath) + 3);
+    sockname = my_malloc(strlen(P_tmpdir) + strlen(fullpath) + 3 + strlen(euid));
     save = sockname;
     sprintf(sockname, "%s/", P_tmpdir);
     sockname += strlen(P_tmpdir) + 1;
@@ -246,7 +248,7 @@
         }
         sockname++; i++;
     }
-    *sockname = '\0';
+    strcat(sockname, euid);
     free(fullpath);
     return save;
 }