(kauth): set private level earlier
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7217 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -54,6 +54,8 @@ kauth(int argc, char **argv)
|
|||||||
char passwd[100];
|
char passwd[100];
|
||||||
int tmp;
|
int tmp;
|
||||||
|
|
||||||
|
int save;
|
||||||
|
|
||||||
if(argc > 2){
|
if(argc > 2){
|
||||||
printf("usage: %s [principal]\n", argv[0]);
|
printf("usage: %s [principal]\n", argv[0]);
|
||||||
code = -1;
|
code = -1;
|
||||||
@@ -67,9 +69,11 @@ kauth(int argc, char **argv)
|
|||||||
overbose = verbose;
|
overbose = verbose;
|
||||||
verbose = 0;
|
verbose = 0;
|
||||||
|
|
||||||
|
save = set_command_prot(prot_private);
|
||||||
ret = command("SITE KAUTH %s", name);
|
ret = command("SITE KAUTH %s", name);
|
||||||
if(ret != CONTINUE){
|
if(ret != CONTINUE){
|
||||||
verbose = overbose;
|
verbose = overbose;
|
||||||
|
set_command_prot(save);
|
||||||
code = -1;
|
code = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -77,6 +81,7 @@ kauth(int argc, char **argv)
|
|||||||
p = strstr(reply_string, "T=");
|
p = strstr(reply_string, "T=");
|
||||||
if(!p){
|
if(!p){
|
||||||
printf("Bad reply from server.\n");
|
printf("Bad reply from server.\n");
|
||||||
|
set_command_prot(save);
|
||||||
code = -1;
|
code = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -84,6 +89,7 @@ kauth(int argc, char **argv)
|
|||||||
tmp = base64_decode(p, &tkt.dat);
|
tmp = base64_decode(p, &tkt.dat);
|
||||||
if(tmp < 0){
|
if(tmp < 0){
|
||||||
printf("Failed to decode base64 in reply.\n");
|
printf("Failed to decode base64 in reply.\n");
|
||||||
|
set_command_prot(save);
|
||||||
code = -1;
|
code = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -94,6 +100,7 @@ kauth(int argc, char **argv)
|
|||||||
if(!p){
|
if(!p){
|
||||||
printf("Bad reply from server.\n");
|
printf("Bad reply from server.\n");
|
||||||
verbose = overbose;
|
verbose = overbose;
|
||||||
|
set_command_prot(save);
|
||||||
code = -1;
|
code = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -124,17 +131,14 @@ kauth(int argc, char **argv)
|
|||||||
memset(passwd, 0, sizeof(passwd));
|
memset(passwd, 0, sizeof(passwd));
|
||||||
if(base64_encode(tktcopy.dat, tktcopy.length, &p) < 0) {
|
if(base64_encode(tktcopy.dat, tktcopy.length, &p) < 0) {
|
||||||
printf("Out of memory base64-encoding.\n");
|
printf("Out of memory base64-encoding.\n");
|
||||||
|
set_command_prot(save);
|
||||||
code = -1;
|
code = -1;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
memset (tktcopy.dat, 0, tktcopy.length);
|
memset (tktcopy.dat, 0, tktcopy.length);
|
||||||
{
|
ret = command("SITE KAUTH %s %s", name, p);
|
||||||
int save;
|
free(p);
|
||||||
save = set_command_prot(prot_private);
|
set_command_prot(save);
|
||||||
ret = command("SITE KAUTH %s %s", name, p);
|
|
||||||
free(p);
|
|
||||||
set_command_prot(save);
|
|
||||||
}
|
|
||||||
if(ret != COMPLETE){
|
if(ret != COMPLETE){
|
||||||
code = -1;
|
code = -1;
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user