fix error in dav add-user, if .dav dir doesn't exists

Sun, 08 Aug 2021 14:40:26 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 08 Aug 2021 14:40:26 +0200
changeset 732
b0eb645cd26e
parent 731
e0358fa1a3b1
child 733
a7883961b5f4

fix error in dav add-user, if .dav dir doesn't exists

dav/config.c file | annotate | diff | comparison | revisions
dav/main.c file | annotate | diff | comparison | revisions
--- a/dav/config.c	Sun Aug 08 12:45:31 2021 +0200
+++ b/dav/config.c	Sun Aug 08 14:40:26 2021 +0200
@@ -808,6 +808,10 @@
 }
 
 int pwdstore_save(PwdStore *pwdstore) {
+    if(check_config_dir()) {
+        return 1;
+    }
+    
     char *pwfile = util_concat_path(ENV_HOME, ".dav/secrets.crypt");
     int ret = pwdstore_store(pwdstore, pwfile);
     free(pwfile);
--- a/dav/main.c	Sun Aug 08 12:45:31 2021 +0200
+++ b/dav/main.c	Sun Aug 08 14:40:26 2021 +0200
@@ -2903,7 +2903,7 @@
     }
     
     int ret = 1;
-    if(user && password) {
+    if(user && password) {    
         pwdstore_put_index(secrets, id, locations);
         pwdstore_put(secrets, id, user, password);
         ret = pwdstore_save(secrets);

mercurial