suid perl alternatives
2012-01-03 20:41:01.005274+01 by
Dan Lyke
4 comments
So apparently, somewhere between Ubuntu 11.10 and the Perl community, perl-suid has disappeared. What's the modern accepted alternative if you want to, say, have a CGI script (run from Apache as www-data) write data to a directory (like an image upload)?
I had been piping in to a suid Perl script whose job it was to do the security and data integrity checks before writing the file. Do I now build a C wrapper to do this?
[ related topics:
Free Software Interactive Drama Perl Open Source Writing Heinlein Community hubris
]
comments in descending chronological order (reverse):
#Comment Re: made: 2012-01-04 15:23:40.365443+01 by:
Dan Lyke
The directory gets written from enough different processes that although I could do chmod a+w, it seems much smarter to me to have something that gets a token, and that verifies that what gets put in the directory is indeed a JPEG, and all the thumbnails and such get created appropriately.
#Comment Re: made: 2012-01-04 12:20:54.703683+01 by:
John Anderson
Maybe I don't understand exactly what you're trying to do, but wouldn't it be easier to just chown the
directory to www-data? (Or do the same with group-write permissions?)
#Comment Re: made: 2012-01-04 04:04:27.66618+01 by:
Dan Lyke
Yeah. In fact my Perl program was kind of structured that way, it loads a library in which all of the real development is done so that I don't actually have to tweak the file in question.
Just a pain in the ass.
#Comment Re: made: 2012-01-04 03:46:49.653399+01 by:
spc476
It's what I would do. And it wouldn't have to be very much C code. Pretty much just a call to exec() and set the suid bit on the program.
We will not edit your comments. However, we may delete your
comments, or cause them to be hidden behind another link, if we feel
they detract from the conversation. Commercial plugs are fine,
if they are relevant to the conversation, and if you don't
try to pretend to be a consumer. Annoying endorsements will be deleted
if you're lucky, if you're not a whole bunch of people smarter and
more articulate than you will ridicule you, and we will leave
such ridicule in place.