This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=380a333813cc08dfa97d5554a20c7ab3fbc5a50d

commit 380a333813cc08dfa97d5554a20c7ab3fbc5a50d
Author: Guillem Jover <[email protected]>
AuthorDate: Fri Sep 12 01:24:48 2025 +0200

    dselect: Close file descriptors in method scripts
    
    Changelog: internal
---
 dselect/methods/file/install.sh  | 2 ++
 dselect/methods/media/install.sh | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/dselect/methods/file/install.sh b/dselect/methods/file/install.sh
index 6ad45204a..3190887b9 100755
--- a/dselect/methods/file/install.sh
+++ b/dselect/methods/file/install.sh
@@ -52,6 +52,7 @@ while true; do
                 $version = $_ if s{^Version: }{}i;
                @filename = split(/ /,$_) if s/^Filename: //i;
        }
+        close $predep_fh;
        die "internal error - no package" if length($package) == 0;
        die "internal error - no filename" if not @filename;
        @invoke = (); $| = 1;
@@ -77,6 +78,7 @@ while true; do
                         while (chop($invoke = <$find_fh>)) {
                             last if -f $invoke;
                         }
+                        close $find_fh;
                        $print = $invoke;
                        if (substr($print,0,length($binaryprefix)+1) eq
                            "$binaryprefix/") {
diff --git a/dselect/methods/media/install.sh b/dselect/methods/media/install.sh
index d99279790..133e2bb5d 100755
--- a/dselect/methods/media/install.sh
+++ b/dselect/methods/media/install.sh
@@ -94,6 +94,7 @@ while true; do
                /^X-Medium:\s+(.*)\s*/ and $medium = $1;
                @filename = split(/ /,$_) if s/^Filename: //i;
        }
+        close $predep_fh;
        die "internal error - no package" if length($package) == 0;
        die "internal error - no filename" if not @filename;
        if ($medium && ($medium ne $thisdisk)) {
@@ -130,6 +131,7 @@ INFO
                         while (chop($invoke = <$find_fh>)) {
                               last if -f $invoke;
                         }
+                        close $find_fh;
                        $print = $invoke;
                        if (substr($print,0,length($binaryprefix)+1) eq
                            "$binaryprefix/") {
@@ -190,6 +192,7 @@ perl -MDpkg::Version -MDselect::Method::Media -e '
                }
             }
         }
+        close $status_fh;
        print "\nGot ", scalar keys %Installed, " installed/pending packages\n";
        print "Scanning available packages...";
        $line = 0;
@@ -218,6 +221,7 @@ perl -MDpkg::Version -MDselect::Method::Media -e '
                 push @{${Medium{$avail{"X-Medium"}}}}, $avail{Package};
             }
         }
+        close $avail_fh;
        print "\n";
 
        if (@_ = keys(%Medium)) {

-- 
Dpkg.Org's dpkg

Reply via email to