Commit 3f0c3934 authored by Leigh B Stoller's avatar Leigh B Stoller

Add flag to mark key as internal, as for sslcert derived key.

parent 007faed8
#!/usr/bin/perl -wT #!/usr/bin/perl -wT
# #
# Copyright (c) 2000-2012 University of Utah and the Flux Group. # Copyright (c) 2000-2014 University of Utah and the Flux Group.
# #
# {{{EMULAB-LICENSE # {{{EMULAB-LICENSE
# #
...@@ -48,7 +48,7 @@ sub usage() ...@@ -48,7 +48,7 @@ sub usage()
print " -r Force a regenerate of initial key for user\n"; print " -r Force a regenerate of initial key for user\n";
exit(-1); exit(-1);
} }
my $optlist = "dkniwfu:rX:sRNC:S:"; my $optlist = "dkniwfu:rX:sRNC:S:I";
my $iskey = 0; my $iskey = 0;
my $verify = 0; my $verify = 0;
my $initmode = 0; my $initmode = 0;
...@@ -58,6 +58,7 @@ my $nobody = 0; ...@@ -58,6 +58,7 @@ my $nobody = 0;
my $noemail = 0; my $noemail = 0;
my $remove = 0; my $remove = 0;
my $nodelete = 0; my $nodelete = 0;
my $internal = 0;
my $Comment; my $Comment;
my $xmlfile; my $xmlfile;
...@@ -170,6 +171,9 @@ if (defined($options{"i"})) { ...@@ -170,6 +171,9 @@ if (defined($options{"i"})) {
if (defined($options{"N"})) { if (defined($options{"N"})) {
$nodelete = 1; $nodelete = 1;
} }
if (defined($options{"I"})) {
$internal = 1;
}
if (defined($options{"r"})) { if (defined($options{"r"})) {
$force = 1; $force = 1;
} }
...@@ -426,7 +430,7 @@ sub ParseKey($) { ...@@ -426,7 +430,7 @@ sub ParseKey($) {
} }
DBQueryFatal("replace into user_pubkeys set ". DBQueryFatal("replace into user_pubkeys set ".
" uid='$user_uid', uid_idx='$user_dbid', ". " uid='$user_uid', uid_idx='$user_dbid', ".
" internal='0', nodelete='$nodelete', ". " internal='$internal', nodelete='$nodelete', ".
" idx=NULL, stamp=now(), ". " idx=NULL, stamp=now(), ".
" pubkey=$safe_key, comment=$safe_comment"); " pubkey=$safe_key, comment=$safe_comment");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment