patch-main_c 948 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. $OpenBSD: patch-main_c,v 1.6 2017/06/13 11:32:01 sthen Exp $
  2. Pledge
  3. Index: main.c
  4. --- main.c.orig
  5. +++ main.c
  6. @@ -412,6 +412,30 @@ int main(int argc, char **argv, char **env)
  7. }
  8. }
  9. +#ifdef USE_SASL
  10. + {
  11. + int ret;
  12. + if ((ret = mutt_sasl_start()) != SASL_OK) {
  13. + fprintf(stderr, "%s: mutt_sasl_start: %d\n", argv[0], ret);
  14. + exit(1);
  15. + }
  16. + }
  17. +#endif
  18. +
  19. +#ifdef CRYPT_BACKEND_GPGME
  20. + if (pledge("stdio rpath wpath cpath flock fattr getpw tty inet dns "
  21. + "proc exec sendfd recvfd", NULL) == -1) {
  22. + fprintf(stderr, "%s: pledge: %s\n", argv[0], strerror(errno));
  23. + exit(1);
  24. + }
  25. +#else
  26. + if (pledge("stdio rpath wpath cpath flock fattr getpw tty inet dns "
  27. + "proc exec", NULL) == -1) {
  28. + fprintf(stderr, "%s: pledge: %s\n", argv[0], strerror(errno));
  29. + exit(1);
  30. + }
  31. +#endif /* CRYPT_BACKEND_GPGME */
  32. +
  33. /* collapse remaining argv */
  34. while (optind < argc)
  35. argv[nargc++] = argv[optind++];