#!/usr/bin/perl # @groups = ("vchkpw"); %users = ('vpopmail', "vchkpw"); # daemon, local, pop, queue, remote, deliver, respectively. # alias is a special case above... %gids = ("vchkpw", 89); %uids = ('vpopmail', 89); sub checkenv () { my ($u, $g); # Users foreach $u (keys %users) { $var = uc($u)."_UID"; if (defined($ENV{$var})) { $uids{$u} = $ENV{$var}; } } # Groups foreach $g (@groups) { $var = uc($g)."_GID"; if (defined($ENV{$var})) { $gids{$g} = $ENV{$var}; } } } if ($ENV{PACKAGE_BUILDING} || $ARGV[1] eq "PRE-INSTALL") { $doguid=1; # Make sure we get the assigned guids. } checkenv(); foreach $group (@groups) { if (! getgrnam ($group)) { do checkrpw; # May exit $x = "-g $gids{$group}"; $result = system ("/usr/sbin/pw groupadd $group $x"); if ($result) { die "Failed to add group $group as gid $gids{$group}\n"; } } } if (! getpwnam ("alias")) { do checkrpw; # May exit $x = "-u $uids{'alias'}"; $result = system ("/usr/sbin/pw useradd alias -g qnofiles -d \"$ENV{PKG_PREFIX}/alias\" -s /nonexistent $x"); if ($result) { die "Failed to add user alias as uid $uids{'alias'}\n"; } } foreach $user (keys %users) { if (! getpwnam ($user)) { do checkrpw; # May exit $x = "-u $uids{$user}"; $result = system ("/usr/sbin/pw useradd $user -g $users{$user} -d \"$ENV{PKG_PREFIX}\" -s /nonexistent $x"); if ($result) { die "Failed to add user $user as uid $uids{$user}\n"; } } } # Check that all gids/uids are as they should be... # If we are being installed as a package... if ($doguid) { foreach $group (@groups) { if (getgrnam($group) != $gids{$group}) { die "Group $group should have gid $gids{$group}\n"; } } foreach $user (keys %users) { if (getpwnam($user) != $uids{$user}) { die "User $user should have uid $uids{$user}\n"; } } } exit 0; sub checkrpw { if (! -x "/usr/sbin/pw") { print <<'EOM'; This system looks like a pre-2.2 version of FreeBSD. We see that it is missing the "pw" utility. We need this utility. Please get and install it, and try again. You can get the source from: ftp://ftp.freebsd.org/pub/FreeBSD/FreeBSD-current/src/usr.sbin/pw.tar.gz EOM die "No /usr/sbin/pw"; } if ($> != 0) { print "It is necessary to add missing vpopmail users/groups at"; print "this stage. Please either add them manually or retry"; print "as root."; # Let pw(1) signal the failure so the user can see which # group/user is actually missing. } } 3'>dependabot/npm_and_yarn/devel/electron4/files/minimist-1.2.3 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
path: root/databases/p5-ResourcePool-Resource-DBI
Commit message (Expand)AuthorAgeFilesLines
* Fix every instance of RUN_DEPENDS:=${BUILD_DEPENDS} in p5 ports, exceptdes2018-10-061-2/+2
* Update WWWsunpoet2018-05-281-1/+1
* Remove ${PORTSDIR}/ from dependencies, categories d, e, f, and g.mat2016-04-011-2/+2
* Some OCD cleanups on some of the perl@ ports.adamw2015-03-131-5/+5
* Change the way Perl modules are installed, update the default Perl to 5.18.mat2014-11-262-1/+1
* Cleanup plistbapt2014-10-201-8/+0
* Support STAGEDIR.vanilla2013-11-032-14/+17
* Add NO_STAGE all over the place in preparation for the staging support (cat: ...bapt2013-09-211-0/+1
* - Convert to new perl frameworkmat2013-08-031-6/+3
* - Remove SITE_PERL from *_DEPENDSaz2012-06-041-2/+2
* At the moment 1385 ports use BUILD_DEPENDS= ${RUN_DEPENDS} and 450eadler2012-01-221-1/+1
* - Replace ../../authors in MASTER_SITE_SUBDIR with CPAN:CPANID macro.az2011-09-081-1/+1
* - Get Rid MD5 supportmiwi2011-03-201-1/+0
* Reassign my p5-* ports to perl@ so more than one personerwin2009-01-301-1/+1
* - Take advantage of CPAN macro from bsd.sites.mk, change ${MASTER_SITE_PERL_C...araujo2008-04-171-1/+1