If I run vadddomain from the command line every thing is fine.
 
But if I call it from a perl script the assign file ends up like this
 
+dawson12.com-:dawson12.com:89:89:/var/vpopmail/domains/
/dawson12.com:-::
.
 
And the new domain ends up under a directory called "?" under ~vpopmail/domains
 
total 112
drwx------   27 vpopmail vchkpw       4096 Jul 14 21:41 .
drwxr-xr-x    9 vpopmail vchkpw       4096 Jun 26 08:57 ..
drwx------    6 vpopmail vchkpw       4096 Jul 14 21:33 ?
drwx------    2 vpopmail vchkpw       4096 Jul 14 20:10 dawson1.com
drwx------    2 vpopmail vchkpw       4096 Jul 14 21:13 dawson4.com
 
Does anyone have any ideas?
 
I am using version 4.9.10
 
I am using a suid perl script with taint checking as follows, you will also notice in the script I have tried it several different ways but I am really hoping to get the vpopmail.pm perl module to work with this. Please don't heckle me, I am not a programmer.
 
 
#!/usr/bin/perl -Tw
#BEGIN { print "Content-type: text/html\n\n" }
#use strict;
#use diagnostics;
 
use CGI qw/:standard/;
use Fcntl qw(:DEFAULT :flock);
 
use vpopmail;
 
my $query = new CGI;
 

# Let's get rid of some environment variables. Just for caution
 
$ENV{PATH} = '/bin:/usr/bin';
$ENV{SHELL} = '/bin/sh' if exists $ENV{SHELL};
delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
 
my $domain = $query->param('domain');
my $password = $query->param('password');
 
# Untaint $DOMAIN variable
if($domain =~ /([-\w\d.]+)/ and $domain !~ /\.\.+/){
        $domain = $1;
}
# Untaint $password variable
if($password =~ /([-\w\d.]+)/ and $password !~ /\.\.+/){
        $password = $1;
}
 
my $dom = $domain;
my $pass = $password;
$add = adddomain ($dom);
#        system("~vpopmail/bin/vadddomain","$dom","$pass");
#        $cmd = "/var/vpopmail/bin/vadddomain $dom $pass";
#        system "sh", '-c', $cmd;
#        my $adduser = `/var/vpopmail/bin/vadddomain $dom $pass`;
 
print header(), start_html("Done."), end_html();

Reply via email to