330 |
330 |
331 return 0; |
331 return 0; |
332 } |
332 } |
333 |
333 |
334 |
334 |
335 int get_location_credentials(DavCfgRepository *repo, const char *path, char **user, char **password) { |
335 const char* get_location_credentials(DavCfgRepository *repo, const char *path) { |
336 PwdStore *secrets = get_pwdstore(); |
336 PwdStore *secrets = get_pwdstore(); |
337 if(!secrets) { |
337 if(!secrets) { |
338 return 0; |
338 return NULL; |
339 } |
339 } |
340 |
340 |
341 /* |
341 /* |
342 * The list secrets->location contains urls or repo names as |
342 * The list secrets->location contains urls or repo names as |
343 * location strings. We need a list, that contains only urls |
343 * location strings. We need a list, that contains only urls |
369 req_url = cx_strsubs(req_url, 8); |
369 req_url = cx_strsubs(req_url, 8); |
370 } |
370 } |
371 |
371 |
372 // iterate over sorted locations and check if a location is a prefix |
372 // iterate over sorted locations and check if a location is a prefix |
373 // of the requested url |
373 // of the requested url |
374 char *id = NULL; |
374 const char *id = NULL; |
375 int ret = 0; |
|
376 i = cxListIterator(locations); |
375 i = cxListIterator(locations); |
377 cx_foreach(CredLocation*, cred, i) { |
376 cx_foreach(CredLocation*, cred, i) { |
378 cxstring cred_url = cx_str(cred->location); |
377 cxstring cred_url = cx_str(cred->location); |
379 |
378 |
380 // remove protocol prefix |
379 // remove protocol prefix |