From 3f7e6bfbf9e9cc1d5b0e2a5ca89b5b5629fd4861 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Thu, 22 May 2008 20:11:14 +0000 Subject: [PATCH] Don't allow @ in usernames, cause it doesn't work anyway --- fsdump/backup.pl | 2 +- fsdump/freebsd-lib.pl | 1 + fsdump/lang/en | 1 + fsdump/linux-lib.pl | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/fsdump/backup.pl b/fsdump/backup.pl index 26aaf5d72..2c036c82a 100755 --- a/fsdump/backup.pl +++ b/fsdump/backup.pl @@ -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; diff --git a/fsdump/freebsd-lib.pl b/fsdump/freebsd-lib.pl index ab84c82cc..935294fa6 100644 --- a/fsdump/freebsd-lib.pl +++ b/fsdump/freebsd-lib.pl @@ -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'}; diff --git a/fsdump/lang/en b/fsdump/lang/en index b63e47b60..a810d1d5f 100644 --- a/fsdump/lang/en +++ b/fsdump/lang/en @@ -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) diff --git a/fsdump/linux-lib.pl b/fsdump/linux-lib.pl index e8619c205..e6ebd0776 100644 --- a/fsdump/linux-lib.pl +++ b/fsdump/linux-lib.pl @@ -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'};