Skip to content

Commit 2d17459

Browse files
committed
shuf-2.7
I'm not sure I did unveil correctly, and not sure it's necessary.
1 parent 4f03f1b commit 2d17459

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

configure

-24
Original file line numberDiff line numberDiff line change
@@ -185,21 +185,6 @@ EOF
185185
fi
186186
}
187187

188-
unveilcheck() {
189-
cat << EOF > conftest.c
190-
#include <unistd.h>
191-
int main(void){unveil(NULL,NULL);return 0;}
192-
EOF
193-
$cc $cflags $ldflags -o conftest conftest.c > /dev/null 2>&1
194-
if [ $? -eq 0 ] ; then
195-
rm -f conftest conftest.o conftest.c
196-
return 0
197-
else
198-
rm -f conftest conftest.o conftest.c
199-
return 1
200-
fi
201-
}
202-
203188
prefix="/usr/local"
204189
libs=""
205190
libbsd=0
@@ -308,15 +293,6 @@ else
308293
echo "no"
309294
fi
310295

311-
printf "checking for unveil... "
312-
unveilcheck
313-
if [ $? -eq 0 ] ; then
314-
cflags="$cflags -DHAVE_UNVEIL"
315-
echo "yes"
316-
else
317-
echo "no"
318-
fi
319-
320296
if [ $libbsd -eq 1 ] ; then
321297
printf "checking for libbsd... "
322298
libbsdcheck

shuf.c

+1-15
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ static void __dead
184184
version(void)
185185
{
186186

187-
fputs("shuf 2.6\n"
187+
fputs("shuf 2.7\n"
188188
"Copyright (c) 2017-2019 Brian Callahan <[email protected]>\n"
189189
"\nPermission to use, copy, modify, and distribute this software"
190190
" for any\npurpose with or without fee is hereby granted, "
@@ -213,11 +213,7 @@ main(int argc, char *argv[])
213213
size_t buflen = 0, bufsize = 8192, nbufsize;
214214

215215
#ifdef HAVE_PLEDGE
216-
#ifdef HAVE_UNVEIL
217-
if (pledge("stdio rpath wpath cpath unveil", NULL) == -1)
218-
#else
219216
if (pledge("stdio rpath wpath cpath", NULL) == -1)
220-
#endif
221217
errx(1, "pledge");
222218
#endif
223219

@@ -265,19 +261,9 @@ main(int argc, char *argv[])
265261
if (oflag++)
266262
errx(1, "cannot have multiple -o");
267263

268-
#ifdef HAVE_UNVEIL
269-
if (unveil(optarg, "wc") == -1)
270-
err(1, "unveil");
271-
#endif
272-
273264
if ((ofile = fopen(optarg, "w")) == NULL)
274265
err(1, "couldn't open output file %s", optarg);
275266

276-
#ifdef HAVE_UNVEIL
277-
if (unveil(NULL, NULL) == -1)
278-
err(1, "unveil");
279-
#endif
280-
281267
break;
282268
case 'r':
283269
rflag = 1;

0 commit comments

Comments
 (0)