=================================================================== RCS file: /cvs2/early-roguelike/rogue5/mdport.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- early-roguelike/rogue5/mdport.c 2021/03/09 20:01:38 1.1 +++ early-roguelike/rogue5/mdport.c 2021/04/02 23:46:00 1.2 @@ -131,6 +131,54 @@ md_init(void) ESCDELAY=64; #endif +#if defined(__OpenBSD__) + if ( unveil("/usr","r")==-1 ) + { + perror("Unveil failure. Aborting."); + exit (1); + } +#ifdef SCOREFILE + if ( unveil(SCOREFILE,"rwc")==-1 ) + { + perror("Unveil failure. Aborting."); + exit (1); + } +#endif +#ifdef LOGFILE + if ( unveil(LOGFILE,"rwc")==-1 ) + { + perror("Unveil failure. Aborting."); + exit(1); + } +#endif +#if defined(SCOREFILE) && defined(LOCKFILE) + if ( unveil(LOCKFILE,"rwc")==-1 ) + { + perror("Unveil failure. Aborting."); + exit(1); + } +#endif +#ifdef SAVEDIR + if ( unveil(SAVEDIR,"rwc")==-1 ) + { + perror("Unveil failure. Aborting."); + exit(1); + } +#else + if ( unveil(md_gethomedir(),"rwc")==-1 ) + { + perror("Unveil failure. Aborting."); + exit(1); + } +#endif + if ( pledge("stdio rpath wpath cpath fattr flock " + "getpw id tty proc", NULL )==-1 ) + { + perror("Pledge failure. Aborting."); + exit (1); + } +#endif /* OpenBSD*/ + #if defined(DUMP) md_onsignal_default(); #else