Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
a05d2fae
Commit
a05d2fae
authored
Feb 12, 2005
by
Timothy Stack
Browse files
Add webcopy script for copying uploaded files to a /proj or /groups
directory.
parent
dc995f64
Changes
3
Hide whitespace changes
Inline
Side-by-side
configure
View file @
a05d2fae
...
...
@@ -2155,7 +2155,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
utils/nsgen/GNUmakefile utils/nsgen/webnsgen
\
utils/link_config utils/import_commitlog utils/dhcpd_wrapper
\
utils/opsreboot utils/deletenode utils/webdeletenode utils/spewleds
\
utils/grabwebcams utils/loghole
\
utils/grabwebcams utils/loghole
utils/webcopy
\
www/GNUmakefile www/defs.php3 www/dbdefs.php3
\
www/swish.conf www/websearch www/garcia-telemetry/GNUmakefile
\
vis/GNUmakefile vis/webvistopology vis/dbvistopology
\
...
...
configure.in
View file @
a05d2fae
...
...
@@ -738,7 +738,7 @@ outfiles="$outfiles Makeconf GNUmakefile \
utils/nsgen/GNUmakefile utils/nsgen/webnsgen \
utils/link_config utils/import_commitlog utils/dhcpd_wrapper \
utils/opsreboot utils/deletenode utils/webdeletenode utils/spewleds \
utils/grabwebcams utils/loghole \
utils/grabwebcams utils/loghole
utils/webcopy
\
www/GNUmakefile www/defs.php3 www/dbdefs.php3 \
www/swish.conf www/websearch www/garcia-telemetry/GNUmakefile \
vis/GNUmakefile vis/webvistopology vis/dbvistopology \
...
...
utils/webcopy.in
0 → 100644
View file @
a05d2fae
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2005 University of Utah and the Flux Group.
# All rights reserved.
#
use
English
;
#
# Configure variables
#
my
$TB
=
"
@prefix
@
";
my
$FSDIR_PROJ
=
"
@FSDIR_PROJ
@
";
my
$FSDIR_GROUPS
=
"
@FSDIR_GROUPS
@
";
use
lib
"
@prefix
@/lib
";
use
libdb
;
use
libtestbed
;
if
(
$UID
==
0
)
{
die
("
*** $0: Cannot be run as root
\n
");
}
# un-taint path
$ENV
{'
PATH
'}
=
"
/bin:/usr/bin:/usr/local/bin:
$TB
/bin
";
delete
@ENV
{'
IFS
',
'
CDPATH
',
'
ENV
',
'
BASH_ENV
'};
#
# Handle command-line arguments
# TODO: Allow a user to specify some of their own arguments to uisp
#
sub
usage
()
{
warn
"
Usage: $0 <src> <dst>
\n
";
exit
(
-
1
);
}
if
(
@ARGV
!=
2
)
{
usage
();
}
$src
=
`
realpath
$ARGV
[0]
`;
if
(
$src
=~
/^([-\w\/.]+)$/
)
{
$src
=
$
1
;
}
else
{
die
("
*** Tainted source:
$src
\n
");
}
$dst
=
`
realpath
$ARGV
[1]
`;
if
(
$dst
=~
/^([-\w\/.]+)$/
)
{
$dst
=
$
1
;
}
else
{
die
("
*** Tainted destination:
$dst
\n
");
}
my
$tmpdir
=
$ENV
{'
TMPDIR
'};
$tmpdir
=
"
/tmp
"
if
(
!
defined
(
$tmpdir
));
if
(
$src
=~
/^($tmpdir\/[-\w\/.]+)$/
)
{
$src
=
$
1
;
}
else
{
die
("
*** Source isn't a php temp file.
\n
");
}
my
$pr
=
PROJROOT
();
my
$gr
=
GROUPROOT
();
if
(
$dst
=~
/^(($pr|$FSDIR_PROJ|$gr|$FSDIR_GROUPS)\/[-\w\/.]+)$/
)
{
$dst
=
$
1
;
}
else
{
die
("
*** Destination must be in
"
.
PROJROOT
()
.
"
or
"
.
GROUPROOT
()
.
"
\n
");
}
system
("
cp
$src
$dst
");
if
(
$dst
)
{
chmod
(
0644
,
$dst
);
}
exit
$?
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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