When expanding templates that retrieve the usernames from /home/e-smith/accounts a warning is given. As an example I created a template /etc/e-smith/templates-custom/root/test.txt that merely lists existing users. The output does seem to be correct, but the warningmessage points out something is not functioning as it should:
[root@meterkast test.txt]# /sbin/e-smith/expand-template /root/test.txt
WARNING in /etc/e-smith/templates-custom//root/test.txt/10test: Use of uninitialized value in string eq at /etc/e-smith/templates//root/test.txt/10test line 18.
WARNING: Template processing succeeded for //root/test.txt: 1 fragment generated warnings
at /sbin/e-smith/expand-template line 49
Contents of the template: /etc/e-smith/templates-custom/root/test.txt/10test:
{
# This script lists all known users on the server.
# But generates an warning at line if ($type eq 'user')
# output is correct though
}
{
my %accounts;
tie %accounts, 'esmith::config', '/home/e-smith/accounts';
my $key;
my $value;
$OUT .= "users:";
while (($key,$value) = each %accounts)
{
my ($type, %properties) = split (/\|/, $value, -1);
if ($type eq 'user')
{
$OUT .= " " . $key;
}
}
}
Is there a fault in the accounts file or should the expand-template script be checked?
Greetings,
sqlerror