Bug 27760

Summary: pkg_add -r hangs when fetching via ftp
Product: Base System Reporter: seb <seb>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description seb 2001-05-30 02:50:00 UTC
When using pkg_add -r to install a package pkg_add just hangs.

Fix: After a bit of debugging it turns out the fork() that is done to set up
the pipeline for tar doesn't close the file descriptor that is used for
the ftp data channel (I guess there is a bit of a timing issue there,
although for me it occurs every time).

Here is a one line fix to version 1.40.2.5 of the file
/usr/src/usr.sbin/pkg_install/lib/file.c that takes care of the
problem. Feel free to beautify my fix. (The fix is relevant to both
HEAD and RELENG_4). Thanks!
How-To-Repeat: Run for example this:

  % env FTP_PASSIVE_MODE=1 PACKAGESITE=ftp://ftp5.freebsd.org/pub/FreeBSD/ports/i386/packages-4-stable/All/ pkg_add -v -r xbatt-1.2.1
Comment 1 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-06-11 15:18:33 UTC
State Changed
From-To: open->feedback

Similar fix committed to -CURRENT, awaiting MFC.
Comment 2 Dag-Erling Smørgrav freebsd_committer freebsd_triage 2001-06-18 20:06:04 UTC
State Changed
From-To: feedback->closed

MFCed.
Comment 3 commit-hook freebsd_committer freebsd_triage 2024-05-28 08:12:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=600c83f389932163135592b08d80df4a7296eef8

commit 600c83f389932163135592b08d80df4a7296eef8
Author:     Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2024-05-28 08:10:31 +0000
Commit:     Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2024-05-28 08:11:38 +0000

    databases/mysql81-client: fix package without SASLCLIENT

    fix package without SASLCLIENT

    PR:     27760
    Sponsored by:   Netzkommune GmbH

 databases/mysql81-client/Makefile  | 2 +-
 databases/mysql81-client/pkg-plist | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2024-06-26 15:01:38 UTC
(In reply to commit-hook from comment #3)
^Triage: not that this commit message was misfiled.  It should have been
part of 277600 (two zeroes).