From 2d9e9e03cf024ca3a55cd43328ac8507a26ddd09 Mon Sep 17 00:00:00 2001 From: Levi Neely <141506390+lneely@users.noreply.github.com> Date: Sat, 15 Mar 2025 09:11:34 +0100 Subject: [PATCH] bugfixes --- pclsync/psynclib.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pclsync/psynclib.c b/pclsync/psynclib.c index a725462..7081f75 100644 --- a/pclsync/psynclib.c +++ b/pclsync/psynclib.c @@ -752,20 +752,23 @@ int psync_add_sync_by_path_delayed(const char *localpath, struct stat st; int unsigned mbedtls_md; if (pdbg_unlikely(synctype < PSYNC_SYNCTYPE_MIN || - synctype > PSYNC_SYNCTYPE_MAX)) + synctype > PSYNC_SYNCTYPE_MAX)) { psync_error = PERROR_INVALID_SYNCTYPE; - return -1; + return -1; + } if (pdbg_unlikely(stat(localpath, &st)) || - pdbg_unlikely(!pfile_stat_isfolder(&st))) + pdbg_unlikely(!pfile_stat_isfolder(&st))) { psync_error = PERROR_LOCAL_FOLDER_NOT_FOUND; - return -1; + return -1; + } if (synctype & PSYNC_DOWNLOAD_ONLY) mbedtls_md = 7; else mbedtls_md = 5; - if (pdbg_unlikely(!pfile_stat_mode_ok(&st, mbedtls_md))) + if (pdbg_unlikely(!pfile_stat_mode_ok(&st, mbedtls_md))) { psync_error = PERROR_LOCAL_FOLDER_ACC_DENIED; - return -1; + return -1; + } res = psync_sql_prep_statement("INSERT INTO syncfolderdelayed (localpath, " "remotepath, synctype) VALUES (?, ?, ?)"); psync_sql_bind_string(res, 1, localpath);