940 fprintf(stderr, "Key %s not found!\nAbort.\n", keyname); |
940 fprintf(stderr, "Key %s not found!\nAbort.\n", keyname); |
941 // TODO: free |
941 // TODO: free |
942 return -1; |
942 return -1; |
943 } |
943 } |
944 } |
944 } |
|
945 |
|
946 // if encryption is requested, but we still don't know the key, abort |
|
947 if (DAV_IS_ENCRYPTED(sn) && !(sn->key)) { |
|
948 fprintf(stderr, "Encryption has been requested, " |
|
949 "but no default key is configured.\n" |
|
950 "You may specify a custom key with the '-k' option.\n"); |
|
951 return -1; |
|
952 } |
945 |
953 |
946 char *tar = cmd_getoption(a, "tar"); |
954 char *tar = cmd_getoption(a, "tar"); |
|
955 |
947 int ret; |
956 int ret; |
948 if(!tar) { |
957 if(!tar) { |
949 if(!strcmp(file, "-")) { |
958 if(!strcmp(file, "-")) { |
950 FILE *in = stdin; |
959 FILE *in = stdin; |
951 ret = put_file(repo, a, sn, path, "stdin", in, 0); |
960 ret = put_file(repo, a, sn, path, "stdin", in, 0); |