Re: "./Amanda/Recovery/Clerk/Feedback.pm: Permission denied at" error messages

Jean-Louis Martineau <[email protected]> Thu, 16 Nov 2017 08:28:38 -0500
Newsgroups gmane.comp.archivers.amanda.devel
Message-ID <[email protected]>
Nathan,

I committed the attached patch. It also use 'use parent -norequire' for 
Tie::StdHash.

Jean-Louis

On 15/11/17 05:33 PM, Nathan Stratton Treadway wrote:
> On Wed, Nov 15, 2017 at 17:27:03 -0500, Jean-Louis Martineau wrote:
> > Sorry, a missing comma,i it must be:
> >
> > use parent -norequire, qw(
>
> Yep, that allows amvault to run using "su backup -c" from root's home
> directory.
>
> Nathan
>
> ----------------------------------------------------------------------------
> Nathan Stratton Treadway - [email protected] - Mid-Atlantic region
> Ray Ontko & Co. - Software consulting services - http://www.ontko.com/ 
> <http://www.ontko.com/>
> GPG Key: http://www.ontko.com/~nathanst/gpg_key.txt 
> <http://www.ontko.com/~nathanst/gpg_key.txt> 
> ID: 1023D/ECFB6239
> Key fingerprint = 6AD8 485E 20B9 5C71 231C 0C32 15F3 ADCD ECFB 6239
This message is the property of CARBONITE, INC. and may contain confidential or privileged information.
If this message has been delivered to you by mistake, then do not copy or deliver this message to anyone.  Instead, destroy it and notify me by reply e-mail
use-parent-r2.diff (text/x-patch, 6.7 KB)
diff --git a/installcheck/Amanda_Recovery_Clerk.pl b/installcheck/Amanda_Recovery_Clerk.pl
index 219b14b..8589b83 100644
--- a/installcheck/Amanda_Recovery_Clerk.pl
+++ b/installcheck/Amanda_Recovery_Clerk.pl
@@ -305,7 +305,8 @@ sub fake_dump {
 
 package main::Feedback;
 
-use base 'Amanda::Recovery::Clerk::Feedback';
+use Amanda::Recovery::Clerk;
+use parent -norequire, 'Amanda::Recovery::Clerk::Feedback';
 
 sub new {
     my $class = shift;
diff --git a/installcheck/Amanda_Taper_Scribe.pl b/installcheck/Amanda_Taper_Scribe.pl
index a712ccd..1c7ebea 100644
--- a/installcheck/Amanda_Taper_Scribe.pl
+++ b/installcheck/Amanda_Taper_Scribe.pl
@@ -170,7 +170,8 @@ sub scan {
 }
 
 package Mock::Feedback;
-use base qw( Amanda::Taper::Scribe::Feedback );
+use Amanda::Taper::Scribe;
+use parent -norequire, qw( Amanda::Taper::Scribe::Feedback );
 use Test::More;
 use Data::Dumper;
 use Installcheck::Config;
diff --git a/perl/Amanda/CheckDump.pm b/perl/Amanda/CheckDump.pm
index 5bc5c43..faf6a01 100644
--- a/perl/Amanda/CheckDump.pm
+++ b/perl/Amanda/CheckDump.pm
@@ -91,7 +91,7 @@ use Amanda::Recovery::Clerk;
 use Amanda::Restore;
 use Amanda::Extract;
 
-use base 'Amanda::Recovery::Clerk::Feedback';
+use parent -norequire, 'Amanda::Recovery::Clerk::Feedback';
 
 sub new {
     my $class = shift;
diff --git a/perl/Amanda/Chunker/Controller.pm b/perl/Amanda/Chunker/Controller.pm
index 704b31f..3a1e387 100644
--- a/perl/Amanda/Chunker/Controller.pm
+++ b/perl/Amanda/Chunker/Controller.pm
@@ -55,7 +55,7 @@ use Amanda::Tapelist;
 use File::Temp;
 use Carp;
 
-use base qw( Amanda::Chunker::Scribe::Feedback );
+use parent -norequire,  qw( Amanda::Chunker::Scribe::Feedback );
 
 sub new {
     my $class           = shift;
diff --git a/perl/Amanda/Chunker/Scribe.pm b/perl/Amanda/Chunker/Scribe.pm
index 376d2f3..df8a952 100644
--- a/perl/Amanda/Chunker/Scribe.pm
+++ b/perl/Amanda/Chunker/Scribe.pm
@@ -226,7 +226,8 @@ via C<scribe_notif_log_info>:
 A typical Feedback subclass might begin like this:
 
   package main::Feedback;
-  use base 'Amanda::Chunker::Scribe::Feedback';
+  use Amanda::Chunker::Scribe;
+  use parent -norequire, 'Amanda::Chunker::Scribe::Feedback';
 
   sub request_more_disk {
     my $self = shift;
diff --git a/perl/Amanda/Config/FoldingHash.pm b/perl/Amanda/Config/FoldingHash.pm
index db11e81..69fe221 100644
--- a/perl/Amanda/Config/FoldingHash.pm
+++ b/perl/Amanda/Config/FoldingHash.pm
@@ -1,7 +1,6 @@
 package Amanda::Config::FoldingHash;
 use Tie::Hash;
-eval {require 'Tie::StdHash';};
-our @ISA = 'Tie::StdHash';
+use parent -norequire, 'Tie::StdHash';
 require Amanda::Config;
 require Amanda::Debug;
 
diff --git a/perl/Amanda/FetchDump.pm b/perl/Amanda/FetchDump.pm
index 9d5cb5e..c2b9f45 100644
--- a/perl/Amanda/FetchDump.pm
+++ b/perl/Amanda/FetchDump.pm
@@ -55,7 +55,7 @@ sub local_message {
 package Amanda::FetchDump;
 
 use Amanda::Recovery::Clerk;
-use base 'Amanda::Recovery::Clerk::Feedback';
+use parent -norequire, 'Amanda::Recovery::Clerk::Feedback';
 
 use POSIX qw(strftime);
 use Amanda::Device qw( :constants );
diff --git a/perl/Amanda/Recovery/Clerk.pm b/perl/Amanda/Recovery/Clerk.pm
index 57b4c26..b230ffc 100644
--- a/perl/Amanda/Recovery/Clerk.pm
+++ b/perl/Amanda/Recovery/Clerk.pm
@@ -190,7 +190,8 @@ immediately when the transfer is started.
 
 A typical Clerk feedback class might look like:
 
-    use base 'Amanda::Recovery::Clerk::Feedback';
+    use 'Amanda::Recovery::Clerk';
+    use parent -norequire, 'Amanda::Recovery::Clerk::Feedback';
 
     sub clerk_notif_part {
 	my $self = shift;
diff --git a/perl/Amanda/Rest/Runs.pm b/perl/Amanda/Rest/Runs.pm
index e0d603d..5675f57 100644
--- a/perl/Amanda/Rest/Runs.pm
+++ b/perl/Amanda/Rest/Runs.pm
@@ -696,7 +696,8 @@ sub checkdump {
 }
 
 package Amanda::Rest::Runs::FetchFeedback;
-use base 'Amanda::Recovery::Clerk::Feedback';
+use Amanda::Recovery::Clerk;
+use parent -norequire, 'Amanda::Recovery::Clerk::Feedback';
 
 sub new {
     my $class = shift;
diff --git a/perl/Amanda/Service/Amidxtaped.pm b/perl/Amanda/Service/Amidxtaped.pm
index 7ecd446..52b877f 100644
--- a/perl/Amanda/Service/Amidxtaped.pm
+++ b/perl/Amanda/Service/Amidxtaped.pm
@@ -202,7 +202,7 @@ package Amanda::Service::Amidxtaped;
 use vars qw( @ISA );
 use Amanda::ClientService;
 use Amanda::Recovery::Clerk;
-@ISA = qw( Amanda::ClientService Amanda::Recovery::Clerk::Feedback);
+use parent -norequire, qw( Amanda::ClientService Amanda::Recovery::Clerk::Feedback);
 
 use Sys::Hostname;
 use IPC::Open2;
diff --git a/perl/Amanda/Service/Restore.pm b/perl/Amanda/Service/Restore.pm
index eedc150..5c5c096 100644
--- a/perl/Amanda/Service/Restore.pm
+++ b/perl/Amanda/Service/Restore.pm
@@ -80,7 +80,8 @@ package Amanda::Service::Restore;
 use vars qw( @ISA );
 use Amanda::ClientService;
 use Amanda::Recovery::Clerk;
-@ISA = qw( Amanda::ClientService Amanda::Recovery::Clerk::Feedback);
+
+use parent -norequire, qw( Amanda::ClientService Amanda::Recovery::Clerk::Feedback);
 
 use Sys::Hostname;
 use IPC::Open2;
diff --git a/perl/Amanda/Taper/Scribe.pm b/perl/Amanda/Taper/Scribe.pm
index 554ceca..71cf854 100644
--- a/perl/Amanda/Taper/Scribe.pm
+++ b/perl/Amanda/Taper/Scribe.pm
@@ -411,7 +411,8 @@ via C<scribe_notif_log_info>:
 A typical Feedback subclass might begin like this:
 
   package main::Feedback;
-  use base 'Amanda::Taper::Scribe::Feedback';
+  use Amanda::Taper::Scribe;
+  use parent -norequire, 'Amanda::Taper::Scribe::Feedback';
 
   sub request_volume_permission {
     my $self = shift;
diff --git a/perl/Amanda/Taper/Worker.pm b/perl/Amanda/Taper/Worker.pm
index c501a20..c9073cc 100644
--- a/perl/Amanda/Taper/Worker.pm
+++ b/perl/Amanda/Taper/Worker.pm
@@ -60,7 +60,7 @@ use Amanda::Recovery::Scan;
 use Amanda::Recovery::Clerk;
 use File::Temp;
 
-use base qw( Amanda::Taper::Scribe::Feedback Amanda::Recovery::Clerk::Feedback);
+use parent -norequire, qw( Amanda::Taper::Scribe::Feedback Amanda::Recovery::Clerk::Feedback);
 
 our $tape_num = 0;
 
diff --git a/perl/Amanda/Vault.pm b/perl/Amanda/Vault.pm
index 562dd3c..10f38d6 100644
--- a/perl/Amanda/Vault.pm
+++ b/perl/Amanda/Vault.pm
@@ -107,7 +107,7 @@ use Amanda::Logfile qw( :logtype_t log_add log_add_full
 			log_rename $amanda_log_trace_log make_stats );
 use Amanda::Util qw ( match_datestamp match_level );
 
-use base qw(
+use parent -norequire,  qw(
     Amanda::Recovery::Clerk::Feedback
     Amanda::Taper::Scribe::Feedback
 );
diff --git a/server-src/amreindex.pl b/server-src/amreindex.pl
index b33f61d..e84ad80 100644
--- a/server-src/amreindex.pl
+++ b/server-src/amreindex.pl
@@ -188,7 +188,7 @@ sub user_request {
 package main::Feedback;
 
 use Amanda::Recovery::Clerk;
-use base 'Amanda::Recovery::Clerk::Feedback';
+use parent -norequire, 'Amanda::Recovery::Clerk::Feedback';
 use Amanda::MainLoop;
 
 sub new {