return filename_from_str(data);
}
+char filename_char_sanitise(char c)
+{
+ if (c == '/')
+ return '.';
+ return c;
+}
+
#ifdef DEBUG
static FILE *debug_fp = NULL;
"one. See the manual for more information.\n"
"(Note: these fingerprints have nothing to do with SSH!)\n"
"\n"
- "PuTTY Master Key (RSA), 1024-bit:\n"
+ "PuTTY Master Key as of 2015 (RSA, 4096-bit):\n"
+ " " PGP_MASTER_KEY_FP "\n\n"
+ "Original PuTTY Master Key (RSA, 1024-bit):\n"
" " PGP_RSA_MASTER_KEY_FP "\n"
- "PuTTY Master Key (DSA), 1024-bit:\n"
+ "Original PuTTY Master Key (DSA, 1024-bit):\n"
" " PGP_DSA_MASTER_KEY_FP "\n", stdout);
}
return NULL;
}
+
+char *make_dir_path(const char *path, mode_t mode)
+{
+ int pos = 0;
+ char *prefix;
+
+ while (1) {
+ pos += strcspn(path + pos, "/");
+
+ if (pos > 0) {
+ prefix = dupprintf("%.*s", pos, path);
+
+ if (mkdir(prefix, mode) < 0 && errno != EEXIST) {
+ char *ret = dupprintf("%s: mkdir: %s",
+ prefix, strerror(errno));
+ sfree(prefix);
+ return ret;
+ }
+
+ sfree(prefix);
+ }
+
+ if (!path[pos])
+ return NULL;
+ pos += strspn(path + pos, "/");
+ }
+}