fixes that decrypt-name can decrypt a path and not only the name

Thu, 28 Jun 2018 21:41:05 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 28 Jun 2018 21:41:05 +0200
changeset 437
70c7d8e437f9
parent 436
daea53362170
child 438
329d57cddae8
child 441
99c26b1b7327

fixes that decrypt-name can decrypt a path and not only the name

libidav/session.c file | annotate | diff | comparison | revisions
--- a/libidav/session.c	Thu Jun 28 20:11:53 2018 +0200
+++ b/libidav/session.c	Thu Jun 28 21:41:05 2018 +0200
@@ -297,7 +297,7 @@
 
 
 char* dav_session_create_plain_href(DavSession *sn, char *path) {
-    if(!DAV_ENCRYPT_NAME(sn)) {
+    if(!DAV_ENCRYPT_NAME(sn) && !DAV_DECRYPT_NAME(sn)) {
         // non encrypted file names
         char *url = util_path_to_url(sn, path);
         char *href = dav_session_strdup(sn, util_url_path(url));
@@ -309,7 +309,7 @@
 }
 
 char* dav_session_get_href(DavSession *sn, char *path) {
-    if(DAV_ENCRYPT_NAME(sn)) {
+    if(DAV_DECRYPT_NAME(sn) || DAV_ENCRYPT_NAME(sn)) {
         sstr_t p = sstr(path);
         UcxBuffer *href = ucx_buffer_new(NULL, 256, UCX_BUFFER_AUTOEXTEND);
         UcxBuffer *pbuf = ucx_buffer_new(NULL, 256, UCX_BUFFER_AUTOEXTEND);

mercurial