Sat, 23 Nov 2019 11:46:45 +0100
fix -c option for dav rm command
dav/main.c | file | annotate | diff | comparison | revisions |
--- a/dav/main.c Wed Nov 20 12:17:55 2019 +0100 +++ b/dav/main.c Sat Nov 23 11:46:45 2019 +0100 @@ -1577,7 +1577,9 @@ static int cmd_operation_on_resources(CmdArgs* a, int(*operation)(DavResource*), const char* command, - const char* message) { + const char* message, + DavBool check_key) +{ if(a->argc < 1) { fprintf(stderr, "Too few arguments\n"); fprintf(stderr, "Usage: dav %s\n", find_usage_str(command)); @@ -1598,7 +1600,7 @@ set_session_lock(sn, a); - if(check_encryption_key(a, sn)) { + if(check_key && check_encryption_key(a, sn)) { goto cmd_oponres_exit; } @@ -1634,12 +1636,12 @@ int cmd_remove(CmdArgs *a) { return cmd_operation_on_resources(a, dav_delete, - "remove", "delete resource"); + "remove", "delete resource", FALSE); } int cmd_mkdir(CmdArgs *a) { return cmd_operation_on_resources(a, dav_create_col, - "mkdir", "create collection"); + "mkdir", "create collection", TRUE); } int cmd_move(CmdArgs *a, int cp) {