From d445a01e1906101fa8377c780ed66c9c526ba36d Mon Sep 17 00:00:00 2001 From: afresh1 Date: Wed, 9 Jun 2021 23:21:34 +0000 Subject: [PATCH] Remove pledgenames() from OpenBSD::Pledge perl module Pointed out by deraadt@, this is not what that that incomplete table is for. While the code has been there for several years, I haven't found a use for it, which is good because it would have been wrong. While here, update my name. --- gnu/usr.bin/perl/cpan/OpenBSD-Pledge/Pledge.xs | 18 ++---------------- .../cpan/OpenBSD-Pledge/lib/OpenBSD/Pledge.pm | 18 +++++------------- .../cpan/OpenBSD-Pledge/t/OpenBSD-Pledge.t | 17 +---------------- 3 files changed, 8 insertions(+), 45 deletions(-) diff --git a/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/Pledge.xs b/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/Pledge.xs index c2bec57a86b..0d719dcb20c 100644 --- a/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/Pledge.xs +++ b/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/Pledge.xs @@ -1,7 +1,7 @@ -/* $OpenBSD: Pledge.xs,v 1.2 2017/09/09 14:53:57 afresh1 Exp $ */ +/* $OpenBSD: Pledge.xs,v 1.3 2021/06/09 23:21:34 afresh1 Exp $ */ /* - * Copyright (c) 2015 Andrew Fresh + * Copyright (c) 2015,2021 Andrew Hewus Fresh * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -21,22 +21,8 @@ #include "perl.h" #include "XSUB.h" -#define PLEDGENAMES -#include - MODULE = OpenBSD::Pledge PACKAGE = OpenBSD::Pledge -AV * -pledgenames() - INIT: - int i; - CODE: - for (i = 0; pledgenames[i].bits != 0; i++) - XPUSHs( sv_2mortal( - newSVpv(pledgenames[i].name, strlen(pledgenames[i].name)) - ) ); - XSRETURN(i); - int _pledge(const char * promises) CODE: diff --git a/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/lib/OpenBSD/Pledge.pm b/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/lib/OpenBSD/Pledge.pm index 6512423c12e..5b564b2a4fc 100644 --- a/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/lib/OpenBSD/Pledge.pm +++ b/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/lib/OpenBSD/Pledge.pm @@ -1,4 +1,4 @@ -# $OpenBSD: Pledge.pm,v 1.5 2019/12/30 02:15:17 afresh1 Exp $ # +# $OpenBSD: Pledge.pm,v 1.6 2021/06/09 23:21:34 afresh1 Exp $ # package OpenBSD::Pledge; use 5.020002; @@ -6,11 +6,9 @@ use strict; use warnings; use parent 'Exporter'; -our %EXPORT_TAGS = ( 'all' => [qw( pledge pledgenames )] ); -our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); -our @EXPORT = qw( pledge ); ## no critic 'export' +our @EXPORT = qw( pledge ); ## no critic 'export' -our $VERSION = '0.02'; +our $VERSION = '0.03'; require XSLoader; XSLoader::load( 'OpenBSD::Pledge', $VERSION ); @@ -60,8 +58,6 @@ interfaces. Exports L by default. -C<:all> will also export L - =head1 FUNCTIONS =head2 pledge @@ -75,10 +71,6 @@ as L itself is useless without it. Returns true on success, returns false and sets $! on failure -=head2 pledgenames - -Returns a list of the possible promises you can pass to L. - =head1 BUGS AND LIMITATIONS Perl is particularly fond of C so that promise is always added by @@ -92,11 +84,11 @@ L =head1 AUTHOR -Andrew Fresh, Eafresh1@OpenBSD.orgE +Andrew Hewus Fresh, Eafresh1@OpenBSD.orgE =head1 LICENSE AND COPYRIGHT -Copyright (C) 2015 by Andrew Fresh Eafresh1@OpenBSD.orgE +Copyright (C) 2015,2021 by Andrew Hewus Fresh Eafresh1@OpenBSD.orgE Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above diff --git a/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/t/OpenBSD-Pledge.t b/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/t/OpenBSD-Pledge.t index b63f9109851..d7c6ce5042a 100644 --- a/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/t/OpenBSD-Pledge.t +++ b/gnu/usr.bin/perl/cpan/OpenBSD-Pledge/t/OpenBSD-Pledge.t @@ -1,4 +1,4 @@ -# $OpenBSD: OpenBSD-Pledge.t,v 1.3 2017/09/09 14:53:57 afresh1 Exp $ # +# $OpenBSD: OpenBSD-Pledge.t,v 1.4 2021/06/09 23:21:34 afresh1 Exp $ # ## no critic 'version' ## no critic 'package' # Before 'make install' is performed this script should be runnable with @@ -21,21 +21,6 @@ BEGIN { use_ok('OpenBSD::Pledge') } ## no critic 'private' ## no critic 'punctuation' -######################### -# PLEDGENAMES -######################### - -# Here we just test that we get a small subset of names back -# because there is no point in failing if someone adds new names. - -my %names = map { $_ => 1 } OpenBSD::Pledge::pledgenames(); -ok $names{$_}, "$_ pledge name exists" for qw( - stdio - rpath - wpath - cpath -); - ######################### # _PLEDGE ######################### -- 2.20.1