Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
7e08add9
Commit
7e08add9
authored
Dec 05, 2000
by
Kristin Wright
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Copy of mkprojdir_wrapper for mkacct-ctrl.
parent
8f28aa32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
tbsetup/mkacct-ctrl_wrapper
tbsetup/mkacct-ctrl_wrapper
+43
-0
No files found.
tbsetup/mkacct-ctrl_wrapper
0 → 100755
View file @
7e08add9
#!/usr/local/bin/perl -wT
# Wrapper for running mkacct-ctrl from the web page. See comment in
# mkprojdir-wrapper for logic.
# un-taint path
$ENV
{'
PATH
'}
=
'
/bin:/usr/bin
';
delete
@ENV
{'
IFS
',
'
CDPATH
',
'
ENV
',
'
BASH_ENV
'};
#
# Check args.
#
if
(
$#ARGV
<
0
)
{
die
("
Usage: mkacct-ctrl_wrapper <pid> <username>
\n
");
}
my
$pid
=
$ARGV
[
0
];
my
$username
=
$ARGV
[
1
];
#
# Untaint the pid.
#
if
(
$pid
=~
/^([A-Z0-9-]+)$/i
)
{
$pid
=
$
1
;
}
else
{
die
("
Invalid pid '
$pid
' contains illegal characters.
\n
");
}
#
# Untaint the username
#
if
(
$ARGV
[
1
]
=~
/^([a-z0-9]+)$/
)
{
$username
=
$
1
;
}
else
{
die
"
$0: User argument
$ARGV
[1] has invalid characters.
\n
";
}
exec
"
/usr/testbed/bin/mkacct-ctrl
$pid
$username
";
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment