initial commit of file from CVS for e-smith-qmail on Wed 12 Jul 09:06:46 BST 2023
This commit is contained in:
36
root/etc/e-smith/templates/var/qmail/users/assign/45shared
Normal file
36
root/etc/e-smith/templates/var/qmail/users/assign/45shared
Normal file
@@ -0,0 +1,36 @@
|
||||
{
|
||||
$OUT = '';
|
||||
|
||||
# Generate qmail user assignments for the shared group. This will
|
||||
# be handled by ~alias/.qmail-shared and ~alias/.qmail-shared-ext.
|
||||
|
||||
my (undef, undef, $uid, $gid, undef, undef, undef, $dir, undef)
|
||||
= getpwnam("alias");
|
||||
|
||||
# It is almost impossible to get Text::Template to output nothing
|
||||
# on failure. It can be done by removing the newline at the end of
|
||||
# this file but that is messy. Therefore, we'll simply return an
|
||||
# error message that will make qmail-newu fail. Also send a
|
||||
# warning message that will be captured in the logs.
|
||||
|
||||
unless (defined $uid && defined $gid && defined $dir)
|
||||
{
|
||||
my $msg =
|
||||
"Failed to obtain user details for \'alias\' "
|
||||
. "while processing shared assignment.";
|
||||
|
||||
warn "$msg\n";
|
||||
$OUT = $msg;
|
||||
return;
|
||||
}
|
||||
|
||||
my $alias_assign = "alias:${uid}:${gid}:${dir}";
|
||||
|
||||
$OUT .= "=shared:${alias_assign}:-:shared:\n";
|
||||
$OUT .= "+shared-:${alias_assign}:-shared-::\n";
|
||||
|
||||
# Need to remove the final newline character. Blank lines in
|
||||
# /var/qmail/users/assign are prohibited.
|
||||
|
||||
chomp($OUT);
|
||||
}
|
Reference in New Issue
Block a user