App-Milter-Limit

 view release on metacpan or  search on metacpan

lib/App/Milter/Limit/Config.pm  view on Meta::CPAN

    my $self = shift;

    no warnings 'uninitialized';

    my $conf = $self->global;
    if (my $user = $$conf{user}) {
        $$conf{user} = App::Milter::Limit::Util::get_uid($user);
    }

    if (my $group = $$conf{group}) {
        $$conf{group} = App::Milter::Limit::Util::get_gid($group);
    }
}


sub global {
    my $self = shift;
    $self->instance->config->{_};
}


lib/App/Milter/Limit/Util.pm  view on Meta::CPAN

        }

        return $uid;
    }
    else {
        return $user;
    }
}


sub get_gid {
    my $group = shift;

    unless ($group =~ /^\d+$/) {
        my $gid = getgrnam($group);
        unless (defined $gid) {
            die qq{no such group "$group"\n};
        }

        return $gid;
    }
    else {
        return $group;
    }
}


sub make_path {
    my $path = shift;

lib/App/Milter/Limit/Util.pm  view on Meta::CPAN

=head2 daemonize

This daemonizes the program.  When you call this, the program will fork(),
detach from the controlling TTY, close STDIN, STDOUT, and STDERR, and change to
the root directory.

=head2 get_uid ($username)

return the UID for the given C<$username>

=head2 get_gid ($groupname)

return the GID for the given C<$groupname>

=head2 make_path ($path)

create the given directory path if necessary, creating intermediate directories
as necessary.  The final directory will be C<chown()>'ed as the user/group from
the config file.

=head1 SOURCE



( run in 0.417 second using v1.01-cache-2.11-cpan-ceb78f64989 )