When I register more than one callback function for authentication credentials using *ne_add_server_auth* only the last callback function is registered.

Reason: ne_add_server_auth does not append the handler to the list, but *overwrites* the last registered handler with the new one.

Version: neon 0.26.3 taken from litmus-0.11.tar.gz

The bug is in ne_auth.c, auth_register, line 1312:

    /* Find the end of the handler list, and add a new one. */
    hdl = &ahs->handlers;
    while (*hdl && (*hdl)->next)
        hdl = &(*hdl)->next;

    *hdl = ne_malloc(sizeof **hdl);

hdl points to the last handler in the list, but it should point to the *next-field* of the last handler in the list. So the last handler will be replaced.

Bug fix: Remove the '&& (*hdl)->next'-condition, like

    /* Find the end of the handler list, and add a new one. */
    hdl = &ahs->handlers;
    while (*hdl)
        hdl = &(*hdl)->next;

    *hdl = ne_malloc(sizeof **hdl);


Cheers
Werner
_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to