Index | Thread | Search

From:
David Leadbeater <dgl@dgl.cx>
Subject:
Re: Improve OpenBSD::Unveil perldoc
To:
Andrew Hewus Fresh <andrew@afresh1.com>
Cc:
tech@openbsd.org
Date:
Mon, 30 Mar 2026 10:47:43 +1100

Download raw body.

Thread
On Sun, Mar 29, 2026 at 12:32:41PM -0700, Andrew Hewus Fresh wrote:
> I heard some confusion about the first argument to `unveil` in the
> OpenBSD::Unveil docs and re-reading them, I can see that.
> 
> https://man.openbsd.org/OpenBSD::Unveil.3p
> 
> Comments, suggestions, OK?

ok dgl

> Index: gnu/usr.bin/perl/cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm
> ===================================================================
> RCS file: /cvs/src/gnu/usr.bin/perl/cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm,v
> diff -u -p -r1.1 Unveil.pm
> --- gnu/usr.bin/perl/cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm	9 Jul 2019 20:41:54 -0000	1.1
> +++ gnu/usr.bin/perl/cpan/OpenBSD-Unveil/lib/OpenBSD/Unveil.pm	29 Mar 2026 19:10:15 -0000
> @@ -12,7 +12,7 @@ our %EXPORT_TAGS = ( 'all' => [qw( unvei
>  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 Open
>    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</unveil> by default.
>  
>  Perl interface to L<unveil(2)>.
>  
> -	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<unveil>.
>  Returns true on success, returns false and sets $! on failure.
>  Throws an exception on incorrect number of parameters.
>  
> @@ -71,6 +74,8 @@ Throws an exception on incorrect number 
>  L<unveil(2)>
>  
>  L<http://man.openbsd.org/unveil.2>
> +
> +L<OpenBSD::Pledge>
>  
>  =head1 AUTHOR
>  
>