From: Barry Jaspan Date: Fri, 18 Oct 1996 18:25:04 +0000 (+0000) Subject: * adb_openclose.c (osa_adb_rename_db): create the destination X-Git-Tag: krb5-1.0-freeze1~219 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=129c85bcaf43c0f3eaaa79fb5edfbd0abf37dfef;p=krb5.git * adb_openclose.c (osa_adb_rename_db): create the destination database if necessary before renaming [krb5-admin/58] git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9203 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/srv/ChangeLog b/src/lib/kadm5/srv/ChangeLog index 5bfe96b20..34c6727d1 100644 --- a/src/lib/kadm5/srv/ChangeLog +++ b/src/lib/kadm5/srv/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 18 14:24:12 1996 Barry Jaspan + + * adb_openclose.c (osa_adb_rename_db): create the destination + database if necessary before renaming [krb5-admin/58] + Thu Oct 17 16:22:07 1996 Barry Jaspan * svr_principal.c: update for new pw_expiration semantics diff --git a/src/lib/kadm5/srv/adb_openclose.c b/src/lib/kadm5/srv/adb_openclose.c index 0417be53b..0f0bec7e5 100644 --- a/src/lib/kadm5/srv/adb_openclose.c +++ b/src/lib/kadm5/srv/adb_openclose.c @@ -65,6 +65,11 @@ osa_adb_ret_t osa_adb_rename_db(char *filefrom, char *lockfrom, osa_adb_db_t fromdb, todb; osa_adb_ret_t ret; + /* make sure todb exists */ + if ((ret = osa_adb_create_db(fileto, lockto, magic)) && + ret != EEXIST) + return ret; + if (ret = osa_adb_init_db(&fromdb, filefrom, lockfrom, magic)) return ret; if (ret = osa_adb_init_db(&todb, fileto, lockto, magic)) {