projects
/
simpleserver-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
For open style auth, set username ("USER") always.
[simpleserver-moved-to-github.git]
/
SimpleServer.xs
diff --git
a/SimpleServer.xs
b/SimpleServer.xs
index
c945f50
..
566e817
100644
(file)
--- a/
SimpleServer.xs
+++ b/
SimpleServer.xs
@@
-1,5
+1,5
@@
/*
/*
- * $Id: SimpleServer.xs,v 1.37 2006-03-09 17:13:43 mike Exp $
+ * $Id: SimpleServer.xs,v 1.39 2006-04-09 23:01:00 adam Exp $
* ----------------------------------------------------------------------
*
* Copyright (c) 2000-2004, Index Data.
* ----------------------------------------------------------------------
*
* Copyright (c) 2000-2004, Index Data.
@@
-1192,8
+1192,6
@@
bend_initresult *bend_init(bend_initrequest *q)
bend_initresult *r = (bend_initresult *)
odr_malloc (q->stream, sizeof(*r));
char *ptr;
bend_initresult *r = (bend_initresult *)
odr_malloc (q->stream, sizeof(*r));
char *ptr;
- char *user = NULL;
- char *passwd = NULL;
CV* handler_cv = 0;
dSP;
STRLEN len;
CV* handler_cv = 0;
dSP;
STRLEN len;
@@
-1239,22
+1237,25
@@
bend_initresult *bend_init(bend_initrequest *q)
hv_store(href, "HANDLE", 6, newSVsv(&sv_undef), 0);
hv_store(href, "PID", 3, newSViv(getpid()), 0);
if (q->auth) {
hv_store(href, "HANDLE", 6, newSVsv(&sv_undef), 0);
hv_store(href, "PID", 3, newSViv(getpid()), 0);
if (q->auth) {
+ char *user = NULL;
+ char *passwd = NULL;
if (q->auth->which == Z_IdAuthentication_open) {
if (q->auth->which == Z_IdAuthentication_open) {
- char *openpass = xstrdup (q->auth->u.open);
- char *cp = strchr (openpass, '/');
+ user = nmem_strdup (odr_getmem (q->stream), q->auth->u.open);
+ char *cp = strchr (user, '/');
if (cp) {
if (cp) {
+ /* password after / given */
*cp = '\0';
*cp = '\0';
- user = nmem_strdup (odr_getmem (q->stream), openpass);
- passwd = nmem_strdup (odr_getmem (q->stream), cp + 1);
+ passwd = cp+1;
}
}
- xfree(openpass);
} else if (q->auth->which == Z_IdAuthentication_idPass) {
user = q->auth->u.idPass->userId;
passwd = q->auth->u.idPass->password;
}
/* ### some code paths have user/password unassigned here */
} else if (q->auth->which == Z_IdAuthentication_idPass) {
user = q->auth->u.idPass->userId;
passwd = q->auth->u.idPass->password;
}
/* ### some code paths have user/password unassigned here */
- hv_store(href, "USER", 4, newSVpv(user, 0), 0);
- hv_store(href, "PASS", 4, newSVpv(passwd, 0), 0);
+ if (user)
+ hv_store(href, "USER", 4, newSVpv(user, 0), 0);
+ if (passwd)
+ hv_store(href, "PASS", 4, newSVpv(passwd, 0), 0);
}
PUSHMARK(sp);
}
PUSHMARK(sp);