# HG changeset patch # User Olaf Wintermann # Date 1729672335 -7200 # Node ID 8aa2dc02d9b746cd3c7f4e7a3890fbeb88120fe4 # Parent dff5f4c23aa70428ca11771e6c5b7ef008a3be83 fix build diff -r dff5f4c23aa7 -r 8aa2dc02d9b7 dav/config.c --- a/dav/config.c Wed Oct 23 09:46:33 2024 +0200 +++ b/dav/config.c Wed Oct 23 10:32:15 2024 +0200 @@ -35,9 +35,7 @@ #include #include -#include "pwd.h" #include "config.h" -#include "main.h" #include "pwd.h" #include "system.h" diff -r dff5f4c23aa7 -r 8aa2dc02d9b7 dav/config.h --- a/dav/config.h Wed Oct 23 09:46:33 2024 +0200 +++ b/dav/config.h Wed Oct 23 10:32:15 2024 +0200 @@ -32,7 +32,6 @@ #include #include #include -#include "opt.h" #include #include @@ -65,12 +64,6 @@ int get_stored_credentials(char *credid, char **user, char **password); int get_location_credentials(DavCfgRepository *repo, const char *path, char **user, char **password); -//Repository* url2repo_s(cxstring url, char **path); -//Repository* url2repo(const char *url, char **path); - -DavSession* connect_to_repo(DavContext *ctx, DavCfgRepository *repo, const char *path, dav_auth_func authfunc, CmdArgs *a); - -int request_auth(DavSession *sn, void *userdata); #ifdef __cplusplus } diff -r dff5f4c23aa7 -r 8aa2dc02d9b7 dav/connect.h --- a/dav/connect.h Wed Oct 23 09:46:33 2024 +0200 +++ b/dav/connect.h Wed Oct 23 10:32:15 2024 +0200 @@ -30,6 +30,7 @@ #define DAV_CONNECT_H #include "config.h" +#include "opt.h" #ifdef __cplusplus extern "C" { @@ -37,6 +38,7 @@ DavSession* connect_to_repo(DavContext *ctx, DavCfgRepository *repo, const char *path, dav_auth_func authfunc, CmdArgs *a); +int request_auth(DavSession *sn, void *userdata); #ifdef __cplusplus } diff -r dff5f4c23aa7 -r 8aa2dc02d9b7 dav/main.c --- a/dav/main.c Wed Oct 23 09:46:33 2024 +0200 +++ b/dav/main.c Wed Oct 23 10:32:15 2024 +0200 @@ -53,9 +53,9 @@ #include "error.h" #include "assistant.h" #include "system.h" -#include "pwd.h" #include "finfo.h" #include "main.h" +#include "connect.h" static DavContext *ctx; @@ -139,6 +139,9 @@ print_usage(argv[0]); return -1; } + if(cmd_getoption(args, "noinput")) { + pwdstore_set_pwinput_func(NULL, NULL); + } sys_init(); xmlGenericErrorFunc fnc = xmlerrorfnc; diff -r dff5f4c23aa7 -r 8aa2dc02d9b7 dav/sync.c --- a/dav/sync.c Wed Oct 23 09:46:33 2024 +0200 +++ b/dav/sync.c Wed Oct 23 10:32:15 2024 +0200 @@ -68,6 +68,7 @@ #include "assistant.h" #include "libxattr.h" #include "tags.h" +#include "connect.h" #include "system.h" diff -r dff5f4c23aa7 -r 8aa2dc02d9b7 libidav/pwdstore.c --- a/libidav/pwdstore.c Wed Oct 23 09:46:33 2024 +0200 +++ b/libidav/pwdstore.c Wed Oct 23 10:32:15 2024 +0200 @@ -52,6 +52,11 @@ return util_password_input(prompt); } +void pwdstore_set_pwinput_func(pwdstore_pwinput_func func, void *userdata) { + pw_input = func; + pw_input_data = userdata; +} + PwdStore* pwdstore_open(const char *file) { FILE *in = fopen(file, "r"); if(!in) {