spf-discuss
[Top] [All Lists]

Re: Starting spfd (FreeBSD)

2003-12-18 16:39:48
----- Original Message ----- 
From: "Hans Dieter Pearcey" <hdp(_at_)icgroup(_dot_)com>
To: <spf-discuss(_at_)v2(_dot_)listbox(_dot_)com>
Sent: Thursday, December 18, 2003 5:56 PM
Subject: Re: [spf-discuss] Starting spfd (FreeBSD)

Actually, it's an OS difference. I don't have a freebsd machine, so
I can't test exhaustively, but freebsd requires more hoop-jumping
than either linux or solaris, both of which are happy with the
'$< = $> = foo' form.

You know, I have not even checked out spfd yet; but I can tell you, for
sure, that FreeBSD has no problem, whatsoever, dropping root privileges. I
wrote the following code snippet in spf-milter, on a FreeBSD 4.7R box, and
it works exactly as it should. :)

- Mark

        System Administrator Asarian-host.org

---
"If you were supposed to understand it,
we wouldn't call it code." - FedEx


------------------------
  # Get info on the user we want to run as. If $uid is undefined, the user
  # does not exist on the system; if zero, it is the UID of root!

 ($login, $pass, $uid, $gid) = getpwnam ($user);
  if (not defined ($uid)) {
      log_error_and_exit ("$user is not a valid user on this system!");
  } elsif (not $uid) {
      log_error_and_exit ("You cannot run spf-milter as root!");
  }

  # Drop the Sendmail::Milter privileges!

  $) = $gid;
  $( = $gid;
  $> = $uid;
  $< = $uid;

-------
Sender Permitted From: http://spf.pobox.com/
Archives at http://archives.listbox.com/spf-discuss/current/
Latest draft at http://spf.pobox.com/draft-mengwong-spf-02.9.4.txt
To unsubscribe, change your address, or temporarily deactivate your 
subscription, 
please go to 
http://v2.listbox.com/member/?listname(_at_)©#«Mo\¯HÝÜîU;±¤Ö¤Íµø?¡


<Prev in Thread] Current Thread [Next in Thread>