diff -Nru geeqie-2.5/debian/changelog geeqie-2.5/debian/changelog --- geeqie-2.5/debian/changelog 2025-06-07 13:44:17.000000000 +0200 +++ geeqie-2.5/debian/changelog 2025-06-15 17:31:21.000000000 +0200 @@ -1,3 +1,9 @@ +geeqie (1:2.5-7) unstable; urgency=medium + + * Add patch to fix warning when deleting symlinks (Closes: #1104737) + + -- Andreas Rönnquist Sun, 15 Jun 2025 17:31:21 +0200 + geeqie (1:2.5-6) unstable; urgency=medium * Add patch to fix crash on keyword autocomplete (Closes: #1107397) diff -Nru geeqie-2.5/debian/patches/Fix-1771-Deleting-not-write-protected-symlinks-to-write-p.patch geeqie-2.5/debian/patches/Fix-1771-Deleting-not-write-protected-symlinks-to-write-p.patch --- geeqie-2.5/debian/patches/Fix-1771-Deleting-not-write-protected-symlinks-to-write-p.patch 1970-01-01 01:00:00.000000000 +0100 +++ geeqie-2.5/debian/patches/Fix-1771-Deleting-not-write-protected-symlinks-to-write-p.patch 2025-06-15 17:29:26.000000000 +0200 @@ -0,0 +1,105 @@ +From: Colin Clark +Date: Sun, 15 Jun 2025 15:59:19 +0100 +Subject: Fix #1771: Deleting (not write protected) symlinks to write + protected images gives warning + +https://github.com/BestImageViewer/geeqie/issues/1771 + +Function access() was used, but this function follows symlinks. + +Instead use lstat for delete/move/rename operations. +--- + src/filedata/filedata.cc | 59 ++++++++++++++++++++++++++++++++++++++++++++++-- + 1 file changed, 57 insertions(+), 2 deletions(-) + +diff --git a/src/filedata/filedata.cc b/src/filedata/filedata.cc +index 76f8866..ee779ff 100644 +--- a/src/filedata/filedata.cc ++++ b/src/filedata/filedata.cc +@@ -23,6 +23,7 @@ + + #include "filedata.h" + ++#include + #include + #include + +@@ -1997,6 +1998,60 @@ gboolean FileData::file_data_sc_update_ci_unspecified_list(GList *fd_list, const + * it should detect all possible problems with the planned operation + */ + ++/** ++ * @brief Determine if file is readable, do not follow symlinks ++ * @param path ++ * @returns ++ * ++ * ++ */ ++static gboolean file_is_readable_no_follow(const gchar *path) ++{ ++ gboolean readable = FALSE; ++ GStatBuf statbuf; ++ ++ if (g_lstat(path, &statbuf) != 0) ++ { ++ log_printf("g_lstat failed: %s\n", strerror(errno)); ++ ++ return readable; ++ } ++ ++ if (S_IRUSR & statbuf.st_mode) ++ { ++ readable = TRUE; ++ } ++ ++ return readable; ++} ++ ++/** ++ * @brief Determine if file is writable, do not follow symlinks ++ * @param path ++ * @returns ++ * ++ * ++ */ ++static gboolean file_is_writable_no_follow(const gchar *path) ++{ ++ gboolean writable = FALSE; ++ GStatBuf statbuf; ++ ++ if (g_lstat(path, &statbuf) != 0) ++ { ++ log_printf("g_lstat failed: %s\n", strerror(errno)); ++ ++ return writable; ++ } ++ ++ if (S_IWUSR & statbuf.st_mode) ++ { ++ writable = TRUE; ++ } ++ ++ return writable; ++} ++ + gint FileData::file_data_verify_ci(FileData *fd, GList *list) + { + gint ret = CHANGE_OK; +@@ -2032,7 +2087,7 @@ gint FileData::file_data_verify_ci(FileData *fd, GList *list) + + if (fd->change->type != FILEDATA_CHANGE_DELETE && + fd->change->type != FILEDATA_CHANGE_WRITE_METADATA && +- !access_file(fd->path, R_OK)) ++ !file_is_readable_no_follow(fd->path)) + { + ret |= CHANGE_NO_READ_PERM; + DEBUG_1("Change checked: no read permission: %s", fd->path); +@@ -2046,7 +2101,7 @@ gint FileData::file_data_verify_ci(FileData *fd, GList *list) + else if (fd->change->type != FILEDATA_CHANGE_COPY && + fd->change->type != FILEDATA_CHANGE_UNSPECIFIED && + fd->change->type != FILEDATA_CHANGE_WRITE_METADATA && +- !access_file(fd->path, W_OK)) ++ !file_is_writable_no_follow(fd->path)) + { + ret |= CHANGE_WARN_NO_WRITE_PERM; + DEBUG_1("Change checked: no write permission: %s", fd->path); diff -Nru geeqie-2.5/debian/patches/series geeqie-2.5/debian/patches/series --- geeqie-2.5/debian/patches/series 2025-06-07 13:33:53.000000000 +0200 +++ geeqie-2.5/debian/patches/series 2025-06-15 17:29:26.000000000 +0200 @@ -5,3 +5,4 @@ Check-for-GNU-user-space-instead-of-Linux-kernel.patch Fix-1692-Hide-Bars-and-Files-nukes-toolbar-customizations.patch Fix-1768-Crash-on-keyword-autocomplete-command.patch +Fix-1771-Deleting-not-write-protected-symlinks-to-write-p.patch