From: Andre Noll Date: Sun, 6 Aug 2023 16:38:05 +0000 (+0200) Subject: Merge topic branch t/fd into master X-Git-Tag: v0.7.3~13 X-Git-Url: http://git.tuebingen.mpg.de/?a=commitdiff_plain;h=420a1f30cc06482f36371d096635846f8800e198;hp=-c;p=paraslash.git Merge topic branch t/fd into master A rash of patches which clean up a good part of fd.c. Nothing major here, mostly simplifications and documentation improvements. * refs/heads/t/fd: fd: Simplify and move for_each_file_in_dir(). fd.c: Improve error checking of para_mkdir(). fd: Revamp para_mkdir(). fd: Improve read_pattern(), rename it to read_and_compare(). fd: Remove log message from para_munmap(). fd: Open-code para_chdir(). fd: Remove file_exists(). fd: Improve documentation of xwritev(). fd: Improve documentation of write_all(). fd: Improve documentation of write_va_buffer(). --- 420a1f30cc06482f36371d096635846f8800e198 diff --combined NEWS.md index a259ef3e,598db71f..a0484f09 --- a/NEWS.md +++ b/NEWS.md @@@ -1,20 -1,6 +1,21 @@@ NEWS ==== +---------------------------------------------- +0.7.3 (to be announced) "weighted correctness" +---------------------------------------------- + +- Old style PEM keys are now deprecated. They still work but their + use results in a run-time warning. The removal of PEM key support is + scheduled for paraslash-0.8.0. +- Version 1.0 of the openssl library has been deprecated. A warning + is printed at compile-time on systems which have this outdated version + because it will no longer be supported once paraslash-0.8.0 comes out. ++- A spring cleanup for the senescent code in fd.c. + +Downloads: +[tarball](./releases/paraslash-git.tar.xz) + ------------------------------------- 0.7.2 (2023-03-08) "optical friction" ------------------------------------- diff --combined afs.c index 83889bb9,8bd52c9a..865effde --- a/afs.c +++ b/afs.c @@@ -448,7 -448,7 +448,7 @@@ static int activate_mood_or_playlist(co mode = PLAY_MODE_MOOD; } else { ret = -ERRNO_TO_PARA_ERROR(EINVAL); - msg = make_message("%s: parse error", arg); + msg = make_message("%s: parse error\n", arg); } if (pb) para_printf(pb, "%s", msg); @@@ -529,8 -529,8 +529,8 @@@ static void init_admissible_files(cons { int ret = activate_mood_or_playlist(arg, NULL); if (ret < 0) { - PARA_WARNING_LOG("could not activate %s: %s\n", arg, - para_strerror(-ret)); + PARA_WARNING_LOG("could not activate %s: %s\n", arg? + arg : "dummy", para_strerror(-ret)); if (arg) activate_mood_or_playlist(NULL, NULL); } @@@ -580,17 -580,6 +580,6 @@@ static void get_database_dir(void PARA_INFO_LOG("afs_database dir %s\n", database_dir); } - static int make_database_dir(void) - { - int ret; - - get_database_dir(); - ret = para_mkdir(database_dir, 0777); - if (ret >= 0 || ret == -ERRNO_TO_PARA_ERROR(EEXIST)) - return 1; - return ret; - } - static int open_afs_tables(void) { int i, ret; @@@ -963,7 -952,6 +952,7 @@@ __noreturn void afs_init(int socket_fd ret = schedule(&s); sched_shutdown(&s); mood_unload(); + playlist_unload(); out_close: close_afs_tables(); out: @@@ -1062,7 -1050,8 +1051,8 @@@ static int com_init(struct command_cont .size = sizeof(table_mask)}; unsigned num_inputs = lls_num_inputs(lpr); - ret = make_database_dir(); + get_database_dir(); + ret = para_mkdir(database_dir); if (ret < 0) return ret; if (num_inputs > 0) { diff --combined client_common.c index 43527ddb,642852ec..3b90000f --- a/client_common.c +++ b/client_common.c @@@ -262,7 -262,7 +262,7 @@@ static bool has_feature(const char *fea return false; for (int i = 0; ct->features[i]; i++) if (strcmp(feature, ct->features[i]) == 0) - return i; + return true; return false; } @@@ -578,8 -578,9 +578,9 @@@ int client_parse_config(int argc, char if (CLIENT_OPT_GIVEN(KEY_FILE, lpr)) kf = para_strdup(CLIENT_OPT_STRING_VAL(KEY_FILE, lpr)); else { + struct stat statbuf; kf = make_message("%s/.paraslash/key.%s", home, user); - if (!file_exists(kf)) { + if (stat(kf, &statbuf) != 0) { /* assume file does not exist */ free(kf); kf = make_message("%s/.ssh/id_rsa", home); }