patch-CPP_7zip_Bundles_SFXCon_SfxCon_cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. $OpenBSD: patch-CPP_7zip_Bundles_SFXCon_SfxCon_cpp,v 1.3 2016/08/14 16:29:20 jca Exp $
  2. Pledge self-extracting archives
  3. --- CPP/7zip/Bundles/SFXCon/SfxCon.cpp.orig Fri May 20 04:38:40 2016
  4. +++ CPP/7zip/Bundles/SFXCon/SfxCon.cpp Fri Jul 15 07:49:33 2016
  5. @@ -250,6 +250,21 @@ int Main2(
  6. #endif
  7. )
  8. {
  9. +
  10. +#ifndef EXTERNAL_CODECS
  11. +
  12. +#ifdef PLEDGE_DEBUG
  13. + printf("pledge: 7za 7zr SFX\n");
  14. +#endif //PLEDGE_DEBUG
  15. +
  16. + if (pledge("stdio rpath wpath cpath fattr tty", NULL) == -1) {
  17. + perror("pledge");
  18. + exit(2);
  19. + }
  20. +
  21. +#endif
  22. +
  23. +
  24. #if defined(_WIN32) && !defined(UNDER_CE)
  25. SetFileApisToOEM();
  26. #endif
  27. @@ -372,6 +387,20 @@ int Main2(
  28. HRESULT result = codecs->Load();
  29. if (result != S_OK)
  30. throw CSystemException(result);
  31. +#ifdef EXTERNAL_CODECS
  32. +
  33. +#ifdef PLEDGE_DEBUG
  34. +
  35. + printf("pledge: 7z SFX\n");
  36. +
  37. +#endif //PLEDGE_DEBUG
  38. +
  39. + if (pledge("stdio rpath wpath cpath fattr tty", NULL) == -1) {
  40. + perror("pledge");
  41. + exit(2);
  42. + }
  43. +
  44. +#endif
  45. }
  46. if (command.CommandType != NCommandType::kList)