Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: Effective, Real and Group id switching for daemons

From: <lists(at)notatla.demon.co.uk>
Date: Sat Jan 25 2003 - 07:16:06 EST

From: "John Hanna" <jhanna@cproject.com>

> One of the important features is to be able to run as non-root after we

I can think of 2 other options:

    use a high port as non-root with port-forwarding to get SMTP traffic     bind as non-root to port 25 (simple in open-source *nix)

> First is it important to switch the real uid as well? It might be nice to

Exactly - you need to do that.

> Secondly do I need to give the option to switch effective and real group id

Do you need help?X

A few moments with "man perlvar" should lead you to something like this which you can test by running it as root.

#!/usr/bin/perl -w

system("id");
$)="500 500"; # set group IDs, appears twice to call setgroups() $(=500;
system("id");
$>=500; # set user IDs
$<=500;
system("id"); Received on Sat Jan 25 12:12:42 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 14:02:45 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library