(renew): return correct status
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1479 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -81,7 +81,7 @@ usage (void)
|
|||||||
static int
|
static int
|
||||||
renew (int argc, char **argv, OtpAlgorithm *alg, char *user)
|
renew (int argc, char **argv, OtpAlgorithm *alg, char *user)
|
||||||
{
|
{
|
||||||
OtpContext oldctx, newctx, *ctx;
|
OtpContext newctx, *ctx;
|
||||||
char prompt[128];
|
char prompt[128];
|
||||||
char pw[64];
|
char pw[64];
|
||||||
void *dbm;
|
void *dbm;
|
||||||
@@ -103,7 +103,9 @@ renew (int argc, char **argv, OtpAlgorithm *alg, char *user)
|
|||||||
if (des_read_pw_string (pw, sizeof(pw), prompt, 0) == 0 &&
|
if (des_read_pw_string (pw, sizeof(pw), prompt, 0) == 0 &&
|
||||||
otp_parse (newctx.key, pw, alg) == 0) {
|
otp_parse (newctx.key, pw, alg) == 0) {
|
||||||
ctx = &newctx;
|
ctx = &newctx;
|
||||||
}
|
ret = 0;
|
||||||
|
} else
|
||||||
|
ret = 1;
|
||||||
|
|
||||||
dbm = otp_db_open ();
|
dbm = otp_db_open ();
|
||||||
if (dbm == NULL) {
|
if (dbm == NULL) {
|
||||||
@@ -261,7 +263,6 @@ static int
|
|||||||
list_otps (int argc, char **argv, char *user)
|
list_otps (int argc, char **argv, char *user)
|
||||||
{
|
{
|
||||||
void *db;
|
void *db;
|
||||||
OtpContext ctx;
|
|
||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
|
|
||||||
if (argc != 0)
|
if (argc != 0)
|
||||||
@@ -292,7 +293,6 @@ main (int argc, char **argv)
|
|||||||
int uid = getuid();
|
int uid = getuid();
|
||||||
OtpAlgorithm *alg = otp_find_alg (OTP_ALG_DEFAULT);
|
OtpAlgorithm *alg = otp_find_alg (OTP_ALG_DEFAULT);
|
||||||
char *user = NULL;
|
char *user = NULL;
|
||||||
struct passwd *pwd;
|
|
||||||
|
|
||||||
prog = argv[0];
|
prog = argv[0];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user