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

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

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Thu, 28 Jun 2018 21:41:05 +0200
branch
v1.2
changeset 450
cf98e5691309
parent 429
1607450065ba
child 451
3e77615273d3

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	Sun Jun 24 12:18:12 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