Incorporate into kadmin.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4033 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -36,7 +36,8 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "admin_locl.h"
|
||||
#include "kadmin_locl.h"
|
||||
#include <kadm5/private.h>
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
@@ -73,6 +74,29 @@ append_hex(char *str, krb5_data *data)
|
||||
free(p);
|
||||
}
|
||||
|
||||
char *
|
||||
time2str(time_t t)
|
||||
{
|
||||
static char buf[128];
|
||||
strftime(buf, sizeof(buf), "%Y%m%d%H%M%S", gmtime(&t));
|
||||
return buf;
|
||||
}
|
||||
|
||||
void
|
||||
event2string(Event *ev, char **str)
|
||||
{
|
||||
char *p;
|
||||
char *pr;
|
||||
if(ev == NULL){
|
||||
*str = strdup("-");
|
||||
return;
|
||||
}
|
||||
krb5_unparse_name(context, ev->principal, &pr);
|
||||
asprintf(&p, "%s:%s", time2str(ev->time), pr);
|
||||
free(pr);
|
||||
*str = p;
|
||||
}
|
||||
|
||||
static int
|
||||
hdb_entry2string(hdb_entry *ent, char **str)
|
||||
{
|
||||
@@ -172,6 +196,8 @@ dump(int argc, char **argv)
|
||||
krb5_error_code ret;
|
||||
FILE *f;
|
||||
|
||||
HDB *db = _kadm5_s_get_db(kadm_handle);
|
||||
|
||||
if(argc < 2)
|
||||
f = stdout;
|
||||
else
|
||||
|
@@ -36,7 +36,8 @@
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "admin_locl.h"
|
||||
#include "kadmin_locl.h"
|
||||
#include <kadm5/private.h>
|
||||
|
||||
RCSID("$Id$");
|
||||
|
||||
@@ -192,6 +193,7 @@ doit(char *filename, int merge)
|
||||
int flags = O_RDWR;
|
||||
struct entry e;
|
||||
hdb_entry ent;
|
||||
HDB *db = _kadm5_s_get_db(kadm_handle);
|
||||
|
||||
f = fopen(filename, "r");
|
||||
if(f == NULL){
|
||||
|
Reference in New Issue
Block a user