Hi Chris,

You are absolutely correct .. and in fact I noticed this same bug a couple of weeks ago, when someone reported an related issue to me.
You should try Webmin 1.345 from http://www.webmin.com/devel.html  , which should already include the fix.

 - Jamie

On 24/May/2007 12:33 Chris Mckenzie wrote ..

Hi all.
I'm using Webmin 1.330 on RHEL4 and in the Postfix module's postfix-lib.pl, the save_options() funct has a regex check that never seems to work. (for the permitted path/file access check) Its the $value check against /^(\S+):/. (see the source clip at the bottom of this e-mail)
I did some debugging and determined that my $access{'dir'} is definitely set and being read (I set it to /etc/postfix), but the $value for the "Check sender access map table" (its form KEY is "smtpd_client_restrictions_def") most likely would never match the regex test. Here's the KEY and VALUE for the value that should be directory access checked:
key -> smtpd_client_restrictions_def
value -> permit_mynetworks, check_sender_access hash:/testing/hostings, permit
I'm not sure what the regex is supposed to do exactly, but if I assume you're looking for any non-space characters until a :, the 2 spaces before the : would make this fail each time.
This key/value might be a special case, but it is the only path/file field the Postfix module has. (that I can recall)
As a fix, I usually like to not match on the target delimiter before the delimiter, like:
    if ($value =~ /^([^:]+):/ && $access{'dir'} ne '/') {
I don't know if this is fixed already but I thought I would report it anyways.
- Chris
sub save_options
    if (check_postfix()) { &error("$text{'check_error'}"); }
    my %options = %{$_[0]};
    foreach $key (keys %options)
        if ($key =~ /_def/)
            (my $param = $key) =~ s/_def//;
            my $value = $options{$key} eq "__USE_FREE_FIELD__" ?
                        $options{$param} : $options{$key};
            if ($value =~ /^(\S+):/ && $access{'dir'} ne '/') {
                foreach my $f (&get_maps_files($value)) {