diff --git a/gnu/usr.bin/perl/cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm b/gnu/usr.bin/perl/cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm index e167df0e4e2..0f76a365d43 100644 --- a/gnu/usr.bin/perl/cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm +++ b/gnu/usr.bin/perl/cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm @@ -1,4 +1,4 @@ -# $OpenBSD: Unveil.pm,v 1.1 2019/07/09 20:41:54 afresh1 Exp $ # +# $OpenBSD: Unveil.pm,v 1.2 2026/03/30 00:00:04 afresh1 Exp $ # package OpenBSD::Unveil; use 5.028; @@ -12,7 +12,7 @@ our %EXPORT_TAGS = ( 'all' => [qw( unveil )] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( unveil ); ## no critic 'export' -our $VERSION = '0.02'; +our $VERSION = '0.03'; require XSLoader; XSLoader::load( 'OpenBSD::Unveil', $VERSION ); @@ -38,10 +38,11 @@ OpenBSD::Unveil - Perl interface to OpenBSD unveil(2) use OpenBSD::Unveil; my $file = "/usr/share/dict/words"; + unveil( $file, "r" ) || die "Unable to unveil: $!"; unveil() || die "Unable to lock unveil: $!"; - open my $fh, '<', $file or die "Unable to open $file: $!"; + open my $fh, '<', $file or die "Unable to open $file: $!"; print grep { /unveil/i } readline($fh); close $fh; @@ -60,9 +61,11 @@ Exports L by default. Perl interface to L. - unveil($paths, $permissions) + unveil($path, $permissions) unveil() # to lock +Takes a string C<$path> and a string of C<$permissions>. +Calling with no arguments disables future calls to C. Returns true on success, returns false and sets $! on failure. Throws an exception on incorrect number of parameters. @@ -72,6 +75,8 @@ L L +L + =head1 AUTHOR Andrew Fresh, Eafresh1@OpenBSD.orgE