projects
/
pazpar2-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0f6803c
)
pz:authentication may carry user group password PAZ-885
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 13 Aug 2013 09:07:28 +0000
(11:07 +0200)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 13 Aug 2013 09:07:28 +0000
(11:07 +0200)
If pz:authentication has at least one blank in it, that forces
Pazpar2 to use idPass Z39.50 authentication. Two forms are allowed
user password
user group password
If no blanks are present, open authentication is in use.
src/connection.c
patch
|
blob
|
history
diff --git
a/src/connection.c
b/src/connection.c
index
d5b5be2
..
465693e
100644
(file)
--- a/
src/connection.c
+++ b/
src/connection.c
@@
-441,7
+441,24
@@
static int connection_connect(struct connection *con, iochan_man_t iochan_man)
ZOOM_options_set(zoptions, "apdulog", apdulog);
if ((auth = session_setting_oneval(sdb, PZ_AUTHENTICATION)))
ZOOM_options_set(zoptions, "apdulog", apdulog);
if ((auth = session_setting_oneval(sdb, PZ_AUTHENTICATION)))
- ZOOM_options_set(zoptions, "user", auth);
+ {
+ const char *cp1 = strchr(auth, ' ');
+ if (!cp1)
+ ZOOM_options_set(zoptions, "user", auth);
+ else
+ {
+ const char *cp2 = strchr(cp1 + 1, ' ');
+
+ ZOOM_options_setl(zoptions, "user", auth, cp1 - auth);
+ if (!cp2)
+ ZOOM_options_set(zoptions, "password", cp1 + 1);
+ else
+ {
+ ZOOM_options_setl(zoptions, "group", cp1 + 1, cp2 - cp1 - 1);
+ ZOOM_options_set(zoptions, "password", cp2 + 1);
+ }
+ }
+ }
if ((sru = session_setting_oneval(sdb, PZ_SRU)) && *sru)
ZOOM_options_set(zoptions, "sru", sru);
if ((sru_version = session_setting_oneval(sdb, PZ_SRU_VERSION))
if ((sru = session_setting_oneval(sdb, PZ_SRU)) && *sru)
ZOOM_options_set(zoptions, "sru", sru);
if ((sru_version = session_setting_oneval(sdb, PZ_SRU_VERSION))