1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## 26_edit_only_writable.dpatch by Roland Rosenfeld <roland@debian.org>
4 ## All lines beginning with `## DP:' are a description of the patch.
5 ## DP: Hide the edit button on http://p.p/show-status if action file can
6 ## DP: not be written by the privoxy user.
9 diff -urNad privoxy~/cgisimple.c privoxy/cgisimple.c
10 --- privoxy~/cgisimple.c
11 +++ privoxy/cgisimple.c
16 +#if !defined(_WIN32) && !defined(__OS2__)
21 #define snprintf _snprintf
22 #endif /* def _WIN32 */
23 @@ -1030,8 +1034,14 @@
24 #ifdef FEATURE_CGI_EDIT_ACTIONS
25 if (NULL == strstr(csp->actions_list[i]->filename, "standard.action") && NULL != csp->config->actions_file_short[i])
27 +#if !defined(_WIN32) && !defined(__OS2__)
28 + if (access(csp->config->actions_file[i], W_OK) == 0) {
30 snprintf(buf, 100, " <a href=\"/edit-actions-list?f=%s\">Edit</a>", csp->config->actions_file_short[i]);
31 if (!err) err = string_append(&s, buf);
32 +#if !defined(_WIN32) && !defined(__OS2__)