This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
ownership of files when running gcc under setuid
- From: Patrick Healy <Patrick dot Healy at ul dot ie>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 24 Oct 2007 14:48:46 +0100
- Subject: ownership of files when running gcc under setuid
- Reply-to: "P. Healy" <patrick dot healy at ul dot ie>
Hello,
I'm having a problem that I cannot track down and I'm hoping that there
might be an answer here. I'm writing a program to allow students submit
programming assignments and have them compiled and run automatically as
part of the submission process.
The student will run a setuid-enabled program, handin, which will copy
the files from his/her space in to mine. It's written in perl and my
idea is to make a perl "system" call to the appropriate compilation
command. My difficulty lies with the ownership of the files created as
a result. Even though the effective UID is the class account right
before the perl system functino call, the ownership of the .o files and
executable is the student's.
If I understand UNIX correctly this should not be, as the files should
be owned by the EUID at the time. Could anybody comment on this -- or
even better, help me out :-).
Many thanks,
Patrick healy
--
http://garryowen.csisdmz.ul.ie/~healyp/