Anyone have any thoughts on this?

Thanks,

DR

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Behalf Of Rosenstrauch, David
> Sent: Tuesday, August 09, 2005 9:34 AM
> To: 'General Discusson about Arch Linux'
> Subject: RE: [arch] run perl script daemon as non-root user
> 
> 
> Just curious:  would something like this be a good idea, or 
> would it be very frowned upon?
> 
> 
> #include <unistd.h>
> #include <sys/types.h>
> 
> #define REAL_PATH "/usr/sbin/ddclient"
> int main(ac, av)
> char **av;
>         {
>                 setreuid(99, 99);
>                 setregid(99, 99);
>                 execv(REAL_PATH, av);
>                 return 1;
>         }
> 
> 
> I tried it last night, and it pretty much worked.  (Except 
> that the daemon could no longer write a pid file to /var/run 
> when it was running as user nobody.)
> 
> Thanks,
> 
> DR
> 
> 
> > > On Mon, Aug 08, 2005 at 14:25:14 +0100, Rosenstrauch, David wrote:
> > > > Maybe launching the script from a C program ... which would 
> > > first do a setuid on the process?
> > > > 
> > > Yeah, that's prbaly the way to do it. I know tpowa and me 
> > were working
> > > on such a thing for the KDE samba stuff. It should be 
> > somwhere in the
> > > CVS for the KDE stuff. Good luck on finding it, I dun 
> remeber which
> > > package it was.
> > > 
> > >  tobbi
> > 
> > 
> > > Found it,
> > > 
> > > http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/kde/kdelibs/files
> > > hareset-wrapper.c?rev=1.1&cvsroot=Extra&only_with_tag=CURRENT&
> > > content-type=text/vnd.viewcvs-markup
> > > 
> > > 
> > > -tobbi
> 
> ==============================================================
> ================
> Please access the attached hyperlink for an important 
> electronic communications disclaimer: 
> 
> http://www.csfb.com/legal_terms/disclaimer_external_email.shtml
> 
> ==============================================================
> ================
> 
> 
> _______________________________________________
> arch mailing list
> [email protected]
> http://www.archlinux.org/mailman/listinfo/arch
> 

==============================================================================
Please access the attached hyperlink for an important electronic communications 
disclaimer: 

http://www.csfb.com/legal_terms/disclaimer_external_email.shtml

==============================================================================


_______________________________________________
arch mailing list
[email protected]
http://www.archlinux.org/mailman/listinfo/arch

Reply via email to