From 630bd11dcd1518217607091130c5cdd7b3ab10a0 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 12 May 2005 10:01:54 +0000 Subject: [PATCH] Log permission for the active user --- index/zebraapi.c | 4 +++- index/zserver.c | 13 ++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/index/zebraapi.c b/index/zebraapi.c index 21e73a3..ee390c7 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.120.2.5 2005-05-06 18:59:23 adam Exp $ +/* $Id: zebraapi.c,v 1.120.2.6 2005-05-12 10:01:54 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -1026,6 +1026,8 @@ int zebra_auth (ZebraHandle zh, const char *user, const char *pass) xfree (zh->user_perm); zh->user_perm = xstrdup(p ? p : "r"); + yaz_log(LOG_LOG, "User perm for %s: %s", u, zh->user_perm); + /* users that don't require a password .. */ if (zh->user_perm && strchr(zh->user_perm, 'a')) return 0; diff --git a/index/zserver.c b/index/zserver.c index b727e71..0083e71 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -1,4 +1,4 @@ -/* $Id: zserver.c,v 1.117.2.2 2005-01-16 23:13:29 adam Exp $ +/* $Id: zserver.c,v 1.117.2.3 2005-05-12 10:01:54 adam Exp $ Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004 Index Data Aps @@ -489,6 +489,7 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) Z_IUUpdateEsRequest *esRequest = up->u.esRequest; Z_IUOriginPartToKeep *toKeep = esRequest->toKeep; Z_IUSuppliedRecords *notToKeep = esRequest->notToKeep; + int res; yaz_log (LOG_LOG, "action"); if (toKeep->action) @@ -534,11 +535,13 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) rr->errstring = "database"; return 0; } - if (notToKeep) + res = zebra_begin_trans (zh, 1); + if (res) + zebra_result(zh, &rr->errcode, &rr->errstring); + else { int i; - zebra_begin_trans (zh, 1); - for (i = 0; i < notToKeep->num; i++) + for (i = 0; notToKeep && i < notToKeep->num; i++) { Z_External *rec = notToKeep->elements[i]->record; struct oident *oident = 0; @@ -691,7 +694,7 @@ int bend_esrequest (void *handle, bend_esrequest_rr *rr) } } } - zebra_end_trans (zh); + zebra_end_trans (zh); } } } -- 1.7.10.4