(main): check for file being specified
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9616 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
11
kdc/hprop.c
11
kdc/hprop.c
@@ -836,7 +836,11 @@ main(int argc, char **argv)
|
|||||||
switch(type) {
|
switch(type) {
|
||||||
#ifdef KRB4
|
#ifdef KRB4
|
||||||
case HPROP_KRB4_DB: {
|
case HPROP_KRB4_DB: {
|
||||||
int e = kerb_db_set_name (database);
|
int e;
|
||||||
|
|
||||||
|
if (database == NULL)
|
||||||
|
krb5_errx(context, 1, "no database specified");
|
||||||
|
e = kerb_db_set_name (database);
|
||||||
if(e)
|
if(e)
|
||||||
krb5_errx(context, 1, "kerb_db_set_name: %s",
|
krb5_errx(context, 1, "kerb_db_set_name: %s",
|
||||||
krb_get_err_text(e));
|
krb_get_err_text(e));
|
||||||
@@ -849,7 +853,8 @@ main(int argc, char **argv)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case HPROP_KRB4_DUMP:
|
case HPROP_KRB4_DUMP:
|
||||||
/* nothing to do */
|
if (database == NULL)
|
||||||
|
krb5_errx(context, 1, "no dump file specified");
|
||||||
break;
|
break;
|
||||||
#ifdef KASERVER_DB
|
#ifdef KASERVER_DB
|
||||||
case HPROP_KASERVER:
|
case HPROP_KASERVER:
|
||||||
@@ -864,6 +869,8 @@ main(int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
#endif /* KRB4 */
|
#endif /* KRB4 */
|
||||||
case HPROP_MIT_DUMP:
|
case HPROP_MIT_DUMP:
|
||||||
|
if (database == NULL)
|
||||||
|
krb5_errx(context, 1, "no dump file specified");
|
||||||
break;
|
break;
|
||||||
case HPROP_HEIMDAL:
|
case HPROP_HEIMDAL:
|
||||||
ret = hdb_create (context, &db, database);
|
ret = hdb_create (context, &db, database);
|
||||||
|
Reference in New Issue
Block a user