I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2008-11-16 06:40:11-08 by userlame
chown in post_bind_hook
Howdy, I would think this is something that has come up before (surely?)...I am running Net::Server to create a unix socket, and would like to chown the socket to change group ownership. My only opportunity to do so would be in post_bind_hook (just before dropping privs), however post_bind goes through and chowns everything when dropping permissions. That's sensible and all, but makes it impossible for me to control socket ownership.

Has anyone come up with a good way to do this? I'd rather not chmod to world-writeable, and I'd also rather not have a different version of Net::Server hanging around being different.

As of now, I'm just going to override post_bind and copy most of the code to my module. Ick.
Direct Responses: 9329 | Write a response
Posted on 2008-11-16 10:00:17-08 by userlame in response to 9328
Re: chown in post_bind_hook
If anyone is interested, I've submitted a patch to Rob Brown (maintainer).

The patch is available at: https://ulppd.svn.sourceforge.net/svnroot/ulppd/trunk/errata/Net-Server.sock_owner.patch
(can't link it; filename must contain characters the link parser can't handle)

Just pass the options sock_owner and/or sock_group to Net::Server to change the owner and group (respectively) of unix sockets. If either or both options are omitted, the previous behavior is unchanged. Hope someone finds this useful.
Direct Responses: Write a response