Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
547e685a
Commit
547e685a
authored
Sep 18, 2014
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to use the SA database to find the slice and user.
Add output file option.
parent
880dbad8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
7 deletions
+19
-7
protogeni/scripts/genextendcred.in
protogeni/scripts/genextendcred.in
+19
-7
No files found.
protogeni/scripts/genextendcred.in
View file @
547e685a
...
...
@@ -37,7 +37,7 @@ use Data::Dumper;
#
sub
usage
()
{
print
"
Usage: $0 -t <days> [-e <days>] -s <slice>
"
.
print
"
Usage: $0
[-o filename]
-t <days> [-e <days>] -s <slice>
"
.
"
[-u <user> | -c <cert>]
";
print
"
\n
";
print
"
$0 -t <days> [-e <days>] -u <user> | -c <cert>
\n
";
...
...
@@ -49,10 +49,13 @@ sub usage()
print
"
-c - Issue to user via his public certificate
\n
";
print
"
-t - How many days to allow extension for
\n
";
print
"
-e - How many days before credential expires; default 5 days
\n
";
print
"
-o - Output to file instead of STDOUT
\n
";
print
"
-a - Use SA database instead of CM
\n
";
exit
(
1
);
}
my
$optlist
=
"
t:s:u:c:e:
";
my
$optlist
=
"
t:s:u:c:e:
o:a
";
my
$expires
=
5
;
my
$filename
;
my
$slice_urn
;
my
$user_urn
;
my
$user_cert
;
...
...
@@ -72,9 +75,6 @@ use GeniResponse;
use
GeniUser
;
use
GeniSlice
;
# Connect to the proper DB.
DBConnect
(
GENICM_DBNAME
());
sub
fatal
($)
{
my
(
$msg
)
=
@_
;
...
...
@@ -99,7 +99,9 @@ my $numdays = $options{"t"};
if
(
defined
(
$options
{"
e
"}))
{
$expires
=
$options
{"
e
"};
}
if
(
defined
(
$options
{"
o
"}))
{
$filename
=
$options
{"
o
"};
}
if
(
defined
(
$options
{"
s
"}))
{
$slice_urn
=
$options
{"
s
"};
}
...
...
@@ -110,6 +112,9 @@ elsif (defined($options{"c"})) {
$user_cert
=
$options
{"
c
"};
}
# Connect to the proper DB.
DBConnect
((
defined
(
$options
{"
a
"})
?
GENISA_DBNAME
()
:
GENICM_DBNAME
()));
#
# Load the CM cert to act as the signer.
#
...
...
@@ -197,7 +202,14 @@ $credential->AddExtension($policy_excep);
fatal
("
Could not sign credential
")
if
(
$credential
->
Sign
(
$
GeniCredential::
LOCALCM_FLAG
));
print
$credential
->
{'
string
'};
if
(
defined
(
$filename
))
{
open
(
OUT
,
"
>
$filename
")
or
fatal
("
Could not open
$filename
: $!
");
print
OUT
$credential
->
{'
string
'}
.
"
\n
";
close
(
OUT
);
}
else
{
print
$credential
->
{'
string
'};
}
exit
(
0
);
...
...
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