Don't allow @ in usernames, cause it doesn't work anyway
authorJamie Cameron <jcameron@webmin.com>
Thu, 22 May 2008 20:11:14 +0000 (20:11 +0000)
committerJamie Cameron <jcameron@webmin.com>
Thu, 22 May 2008 20:11:14 +0000 (20:11 +0000)
fsdump/backup.pl
fsdump/freebsd-lib.pl
fsdump/lang/en
fsdump/linux-lib.pl

index 26aaf5d..2c036c8 100755 (executable)
@@ -74,7 +74,7 @@ else {
        if ($status{'status'} = 'complete') {
                # Execute the post-backup script
                $bok = &execute_after($dump, OUT, 0);
-               if (!$bok && && !$dump->{'afterfok'}) {
+               if (!$bok && !$dump->{'afterfok'}) {
                        print OUT "\n$text{'email_eafter'}\n";
                        $status{'status'} = 'failed';
                        $ok = 0;
index ab84c82..935294f 100644 (file)
@@ -148,6 +148,7 @@ else {
                &error($text{'dump_ehost'});
        $_[0]->{'host'} = $in{'host'};
        $in{'huser'} =~ /^\S+$/ || &error($text{'dump_ehuser'});
+       $in{'huser'} =~ /\@/ && &error($text{'dump_ehuser2'});
        $_[0]->{'huser'} = $in{'huser'};
        $in{'hfile'} || &error($text{'dump_ehfile'});
        $_[0]->{'hfile'} = $in{'hfile'};
index b63e47b..a810d1d 100644 (file)
@@ -42,6 +42,7 @@ dump_edir=Missing or invalid directory to backup
 dump_efile=Missing file or device to backup to
 dump_ehost=Missing or invalid host to backup to
 dump_ehuser=Invalid username on host to backup to
+dump_ehuser2=Username cannot contain the @ character
 dump_ehfile=Missing or invalid file or device on host to backup to
 dump_elabel=Invalid backup label (can be at most 15 characters)
 dump_elabel2=Invalid backup label (can be at most 255 characters)
index e8619c2..e6ebd07 100644 (file)
@@ -208,6 +208,7 @@ else {
                &error($text{'dump_ehost'});
        $_[0]->{'host'} = $in{'host'};
        $in{'huser'} =~ /^\S*$/ || &error($text{'dump_ehuser'});
+       $in{'huser'} =~ /\@/ && &error($text{'dump_ehuser2'});
        $_[0]->{'huser'} = $in{'huser'};
        $in{'hfile'} || &error($text{'dump_ehfile'});
        $_[0]->{'hfile'} = $in{'hfile'};