From c2733c7d4cd80c3dee20e60fc93af1259aa51c57 Mon Sep 17 00:00:00 2001
From: "Leigh B. Stoller" <stoller@flux.utah.edu>
Date: Mon, 9 Feb 2004 20:51:41 +0000
Subject: [PATCH] Fix taint check which was not allowing - in usernames. We
 allow it via the web interface, so better allow it here.

---
 account/addpubkey.in | 4 ++--
 account/addsfskey.in | 4 ++--
 account/tbacct.in    | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/account/addpubkey.in b/account/addpubkey.in
index 31834f61ea..f7bf73420b 100644
--- a/account/addpubkey.in
+++ b/account/addpubkey.in
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -wT
 #
 # EMULAB-COPYRIGHT
-# Copyright (c) 2000-2003 University of Utah and the Flux Group.
+# Copyright (c) 2000-2004 University of Utah and the Flux Group.
 # All rights reserved.
 #
 use English;
@@ -126,7 +126,7 @@ $user = $ARGV[0];
 #
 # Untaint the arguments.
 #
-if ($user =~ /^([a-z0-9]+)$/i) {
+if ($user =~ /^([-\w]+)$/i) {
     $user = $1;
 }
 else {
diff --git a/account/addsfskey.in b/account/addsfskey.in
index 92e3d20d76..6fe38c5d6e 100644
--- a/account/addsfskey.in
+++ b/account/addsfskey.in
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -wT
 #
 # EMULAB-COPYRIGHT
-# Copyright (c) 2000-2003 University of Utah and the Flux Group.
+# Copyright (c) 2000-2004 University of Utah and the Flux Group.
 # All rights reserved.
 #
 use English;
@@ -104,7 +104,7 @@ $user = $ARGV[0];
 #
 # Untaint the arguments.
 #
-if ($user =~ /^([a-z0-9]+)$/i) {
+if ($user =~ /^([-\w]+)$/i) {
     $user = $1;
 }
 else {
diff --git a/account/tbacct.in b/account/tbacct.in
index aa5d954a8f..c3dcef346e 100644
--- a/account/tbacct.in
+++ b/account/tbacct.in
@@ -2,7 +2,7 @@
 
 #
 # EMULAB-COPYRIGHT
-# Copyright (c) 2000-2003 University of Utah and the Flux Group.
+# Copyright (c) 2000-2004 University of Utah and the Flux Group.
 # All rights reserved.
 #
 use English;
@@ -122,7 +122,7 @@ my $user = $ARGV[1];
 #
 # Untaint the arguments.
 #
-if ($user =~ /^([a-z0-9]+)$/i) {
+if ($user =~ /^([-\w]+)$/i) {
     $user = $1;
 }
 else {
-- 
GitLab