Hi!
Thought this one done already, fortune(6) only needs "stdio rpath" from
the beginning and "rpath" can be dropped once the fortune file is loaded.
I tested all the command line parameters and didn't see any regressions,
anything I might have missed?
Index: fortune.c
===================================================================
RCS file: /cvs/src/games/fortune/fortune/fortune.c,v
retrieving revision 1.44
diff -u -p -u -r1.44 fortune.c
--- fortune.c 24 Oct 2015 18:02:28 -0000 1.44
+++ fortune.c 10 Nov 2015 11:48:02 -0000
@@ -149,6 +149,9 @@ regex_t regex;
int
main(int ac, char *av[])
{
+ if (pledge("stdio rpath", NULL) == -1)
+ err(1, "pledge");
+
getargs(ac, av);
if (Match)
@@ -193,6 +196,10 @@ display(FILEDESC *fp)
char line[BUFSIZ];
open_fp(fp);
+
+ if (pledge("stdio", NULL) == -1)
+ err(1, "pledge");
+
(void) fseek(fp->inf, (long)Seekpts[0], SEEK_SET);
for (Fort_len = 0; fgets(line, sizeof line, fp->inf) != NULL &&
!STR_ENDSTRING(line, fp->tbl); Fort_len++) {
Best regards,
Ricardo Mestre