ports/devel/p5-PPerl/files/patch-main.c
Vanilla I. Shu 690b0b75cd - Take maintainership
- add multiuser support from
  http://rt.cpan.org/NoAuth/Bug.html?id=5485
  With this patch, we can allow multiuser
  run devel/svk on a shared box.

PR:		ports/71572
Submitted by:	rafan at infor_dot_org_
2004-12-13 10:34:45 +00:00

29 lines
949 B
C

--- 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;
}