From b99e6ad7030871fbd673f84aced0191d78e919b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 15 Jan 2008 19:20:11 +0000 Subject: [PATCH] Add debug. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22448 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/softp11.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/hx509/softp11.c b/lib/hx509/softp11.c index ca94fda42..c2696bfad 100644 --- a/lib/hx509/softp11.c +++ b/lib/hx509/softp11.c @@ -202,6 +202,7 @@ attributes_match(const struct st_object *obj, { CK_ULONG i; int j; + st_logf("attributes_match: %ld\n", (unsigned long)OBJECT_ID(obj)); for (i = 0; i < num_attributes; i++) { @@ -746,6 +747,22 @@ read_conf_file(const char *fn, CK_USER_TYPE userType, const char *pin) ret = add_certificate(cert, pin, id, label); if (ret) goto out; + } else if (strcasecmp("debug", type) == 0) { + char *name; + + name = strtok_r(NULL, "\t", &s); + if (name == NULL) { + st_logf("no filename\n"); + continue; + } + + if (strcasecmp(name, "stdout") == 0) + soft_token.logfile = stdout; + else + soft_token.logfile = fopen(name, "a"); + if (soft_token.logfile == NULL) + st_logf("failed to open file: %s\n", name); + } else { st_logf("unknown type: %s\n", type); }