X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=tools%2Fdebianqueued-0.9%2Fdebianqueued;h=c19c1c3311e546305caf8f5c4e09f0befc022164;hb=85cdc5c8b9bff015cc07c6cc2daf8f176a1f1b7b;hp=e9c0a5db308c7a2d9fed3912a172ee938798feb5;hpb=9b132eb8a3352962981b7ac3cf20a84b89bfddd2;p=dak.git diff --git a/tools/debianqueued-0.9/debianqueued b/tools/debianqueued-0.9/debianqueued index e9c0a5db..c19c1c33 100755 --- a/tools/debianqueued-0.9/debianqueued +++ b/tools/debianqueued-0.9/debianqueued @@ -1649,25 +1649,31 @@ sub pgp_check($) { $stat = 1; if ( -x $conf::gpg ) { - debug( "executing $conf::gpg --no-options --batch " - . "--no-default-keyring --always-trust " - . "--keyring " - . join( " --keyring ", @conf::keyrings ) - . " --verify '$file'" ); - if ( - !open( PIPE, - "$conf::gpg --no-options --batch " - . "--no-default-keyring --always-trust " - . "--keyring " - . join( " --keyring ", @conf::keyrings ) - . " --verify '$file'" - . " 2>&1 |" - ) - ) - { - msg( "log", "Can't open pipe to $conf::gpg: $!\n" ); + my @command = ("$conf::gpg", "--no-options", "--batch", "--no-tty", + "--trust-model", "always", "--no-default-keyring", + (map +("--keyring" => $_), @conf::keyrings), + "--verify", "-"); + debug( "executing " . join(" ", @command) ); + + my $child = open(PIPE, "-|"); + if (!defined($child)) { + msg("log", "Can't open pipe to $conf::gpg: $!\n"); return "LOCAL ERROR"; - } ## end if ( !open( PIPE, "$conf::gpg --no-options --batch "... + } + if ($child == 0) { + unless (open(STDERR, ">&", \*STDOUT)) { + print "Could not redirect STDERR."; + exit(-1); + } + unless (open(STDIN, "<", $file)) { + print "Could not open $file: $!"; + exit(-1); + } + { exec(@command) }; # BLOCK avoids warning about likely unreachable code + print "Could not exec gpg: $!"; + exit(-1); + } + $output .= $_ while (); close(PIPE); $stat = $?; @@ -2089,17 +2095,9 @@ sub check_incoming_writable() { unlink $file; ftp_cmd( "delete", $file ); } elsif ( $conf::upload_method eq "copy" ) { - unlink("$main::current_targetdir/$testfile"); - unless (open my $fh, ">>", "$main::current_targetdir/$testfile") { + unless(POSIX::access($main::current_targetdir, &POSIX::W_OK)) { + $msg = "No write access: $!"; $stat = 1; - $msg = "Could not create $testfile: $!"; - } - else { - close $fh; - unless (unlink("$main::current_targetdir/$testfile")) { - $stat = 1; - $msg = "Could not unlink file $testfile: $!"; - } } } chomp($msg);