Skip Menu |
 

This queue is for tickets about the PPerl CPAN distribution.

Report information
The Basics
Id: 5485
Status: new
Priority: 0/
Queue: PPerl

People
Owner: Nobody in particular
Requestors: sf [...] flacks.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)

Attachments


MIME-Version: 1.0
X-Mailer: MIME-tools 5.405 (Entity 5.404)
Subject: add UID to socketname
Content-Type: multipart/mixed; boundary="----------=_1078000766-5948-0"
Content-Length: 0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 444
Download (untitled) / with headers
text/plain 444b
Hello, I've attached a small patch to add the user's effective UID to the socket name used by PPerl. This will make it create a new socket for each user. I added this because I wanted to be run my spamassasin script for several users. However with --anyuser on, $> and $< are always set to the first user who spawned the process. Without --anyuser, only one person can run the script. I hope you find this useful. Thanks for PPerl, --simonflk
Content-Type: text/plain; name="pperl_euid.diff"
Content-Disposition: inline; filename="pperl_euid.diff"
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: iso-8859-1
Content-Length: 795
Download pperl_euid.diff
text/x-diff 795b
--- main.c.orig Sun Nov 17 21:04:05 2002 +++ main.c Sat Feb 28 20:27:35 2004 @@ -225,4 +225,7 @@ int i = 0; + char euid[12]; + sprintf(euid, "_%d", geteuid()); + if (realpath(scriptname, fullpath) == NULL) { perror("pperl: resolving full pathname to script failed"); @@ -231,5 +234,5 @@ 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); @@ -247,5 +250,5 @@ sockname++; i++; } - *sockname = '\0'; + strcat(sockname, euid); free(fullpath); return save;
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: binary
MIME-Version: 1.0
X-Mailer: MIME-tools 5.411 (Entity 5.404)
From: cubic [...] acronis.com
X-RT-Original-Encoding: iso-8859-1
Content-Length: 674
Download (untitled) / with headers
text/plain 674b
Patch works for me fine. And I hope this patch or another that allow start same app by different users would be applied into recent upcoming releases. [guest - Sat Feb 28 15:39:26 2004]: Show quoted text
> Hello, > > I've attached a small patch to add the user's effective UID to the > socket name used by PPerl. This will make it create a new socket > for each user. I added this because I wanted to be run my > spamassasin script for several users. However with --anyuser on, $> > and $< are always set to the first user who spawned the process. > Without --anyuser, only one person can run the script. > > I hope you find this useful. > Thanks for PPerl, > --simonflk


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.