my @options=();
my $did_defaults=0;
+my $order = 0;
# parse sudoers one line at a time
while (<>){
print "objectClass: top\n";
print "objectClass: sudoRole\n";
print "cn: defaults\n";
- print "description: Default sudoOption's go here\n";
+ print "description: Default sudoOption's go here\n";
print "sudoOption: $_\n" foreach @options;
+ printf "sudoOrder: %d\n", ++$order;
print "\n";
}
# Definition
}
print "sudoCommand: $_\n" foreach expand(\%CA,@cmds);
print "sudoOption: $_\n" foreach @options;
+ printf "sudoOrder: %d\n", ++$order;
print "\n";
}
s/EXEC:\s*// && push @options,"!noexec";
s/SETENV:\s*// && push @options,"setenv";
s/NOSETENV:\s*// && push @options,"!setenv";
+ s/LOG_INPUT:\s*// && push @options,"log_input";
+ s/NOLOG_INPUT:\s*// && push @options,"!log_input";
+ s/LOG_OUTPUT:\s*// && push @options,"log_output";
+ s/NOLOG_OUTPUT:\s*// && push @options,"!log_output";
s/\w+://; # silently remove other directives
s/\s+$//; # right trim
}