patch-urlview_c 878 B

1234567891011121314151617181920212223242526272829
  1. $OpenBSD: patch-urlview_c,v 1.4 2016/03/21 17:41:52 mestre Exp $
  2. --- urlview.c.orig Tue Jul 4 11:14:30 2000
  3. +++ urlview.c Mon Mar 21 12:38:33 2016
  4. @@ -46,9 +46,11 @@
  5. #include <rx/rxposix.h>
  6. #endif
  7. +#include "quote.h"
  8. +
  9. #define DEFAULT_REGEXP "(((https?|ftp|gopher)://|(mailto|file|news):)[^' \t<>\"]+|(www|web|w3)\\.[-a-z0-9.]+)[^' \t.,;<>\"\\):]"
  10. #define DEFAULT_COMMAND "url_handler.sh %s"
  11. -#define SYSTEM_INITFILE "/etc/urlview.conf"
  12. +#define SYSTEM_INITFILE "${SYSCONFDIR}/urlview.conf"
  13. #define OFFSET 2
  14. #define PAGELEN (LINES - 1 - OFFSET)
  15. @@ -187,6 +189,11 @@ int main (int argc, char **argv)
  16. pw = getpwuid (getuid ());
  17. snprintf (buf, sizeof (buf), "%s/.urlview", pw->pw_dir);
  18. +
  19. + if (pledge("stdio rpath tty proc exec", NULL) == -1) {
  20. + perror("pledge");
  21. + exit(1);
  22. + }
  23. /*** Check for users rc-file ***/
  24. if (stat (buf,&stat_buf) == -1)