From nobody Wed May 22 17:18:46 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Vkyh62nqyz5M4jW; Wed, 22 May 2024 17:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vkyh62FlLz4g4v; Wed, 22 May 2024 17:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716398326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lXyvRHmFpgzSxbl7qOxvVjpYA/yAfeHXo6w+TMlpDUA=; b=vhSt3Ri3FMLwAJFiEKdfxW1y8GhLzyEIekca++2FWlLJ3v+52Ih9SJon0hzhaSY75WU6EF YBavjBlujPGYa1HFlV5a912gifKFJkV05HbWzkZmZ4g00raIYHNHoiSwruyxf/21kp+T3r iEWreeHIWH5LztYCmsHEkyYQT/5afQfwdRu1CWTHhksKlXYi5pgscNdfoP9dGp3Uc5B/U4 TBVJhssak+PrXNOuhbYbaf77XhJEGfnzMXw4LIkUkCMfmL8/LbAqG2h29D3QUO5vImukNh dnGHLoVkSP/MhpZCPIACwd1qXFbLlLTkILt9SLeNgApOtf9QpnC6m1YD2I3pNA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716398326; a=rsa-sha256; cv=none; b=AO8ZIIEaNnxAdrJ9n07miC+5KnNjkMj+Us8GXnm6yixuPu4SHeAcpD98zt8uKuFdPfjRhb ybAt2cgx++ExJqMD7ndvgJNqdklREzcIPvdHJzXEwEjDWcH8hSV1jLpU8oPOaiSm3UHhO0 Y9P/oGxGwtiX8gsT9A78b/bq2/BUnkWUm5ybIEyLV/CA3ESHKfkIzkr/ISiy9+pXslvrqz ZeTh1FVguMTGvYaZ6Puwu79EaZ9boBZJ4Oumr44KzqGd04kAr4uNSysllVGy3ObuLUe7JG XXf7EXD+55ogDTvZ7NPkRyhDO2F3hG8GsudAdanxzMTXIm0V8F/Sfyqwggm+6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716398326; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lXyvRHmFpgzSxbl7qOxvVjpYA/yAfeHXo6w+TMlpDUA=; b=rLSOkU3PI2Jfbg98QUep3sKiPO0Tai8/XX2kVtAys3S5Z/GPeRK3lVYH1a/TtaC3MdatEv s/B6bjO+rCJPJWHqRUgViVgx8PZVqpdI3MRt+upb2TrQDlV65zGeE+KQPp062p/V/Tz9i4 AOjzqdgPJRCU8fME9HAzQdhSFRYhqc2LZsuiu4hkEm3FOGSGFhmKReAkL1Y4r2iE8L/I7B WiJRwhzwcxMJPFomvXd0jdsVzcBoGTjyz3K9w6FKDS+KKZgcsRPlRFp5Y3b9xaUreSgU6A lsv+fqQ/IN4vLx6BlaZTNc4c1JeLoS1fN0N6CHrMUentFUWvXLAMzKoCYEqUGA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vkyh61S06zF9v; Wed, 22 May 2024 17:18:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MHIklr092888; Wed, 22 May 2024 17:18:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MHIkdU092885; Wed, 22 May 2024 17:18:46 GMT (envelope-from git) Date: Wed, 22 May 2024 17:18:46 GMT Message-Id: <202405221718.44MHIkdU092885@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Allan Jude Subject: git: 207e8cef0b36 - releng/14.1 - ftpd: stop using -g flag for /bin/ls List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: allanjude X-Git-Repository: src X-Git-Refname: refs/heads/releng/14.1 X-Git-Reftype: branch X-Git-Commit: 207e8cef0b363603d68a226bb03f0ff421d30dd2 Auto-Submitted: auto-generated The branch releng/14.1 has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=207e8cef0b363603d68a226bb03f0ff421d30dd2 commit 207e8cef0b363603d68a226bb03f0ff421d30dd2 Author: Allan Jude AuthorDate: 2024-05-21 22:58:21 +0000 Commit: Allan Jude CommitDate: 2024-05-22 17:18:07 +0000 ftpd: stop using -g flag for /bin/ls In 3bfbb521 the behaviour of ls was changed such that -g was no longer a noop for compatibility with BSD 4.3, but instead changed the output of long mode to exclude the owner of the file and display only the group. Update how FTPd invokes ls to restore the previous behaviour Reported-by: Andrew Fengler Reviewed-by: jrtc27, des, imp Approved by: re (cperciva) MFC after: 3 days Sponsored-by: ScaleEngine Inc. Fixes: 3bfbb521fef5 ("ls: Improve POSIX compatibility for -g and -n.") (cherry picked from commit 5af3225e0448be6af7f0312e10d2a1dfbe150c25) (cherry picked from commit e5fadc41b48045d8978993d6c4ac72c64542b470) --- libexec/ftpd/ftpcmd.y | 4 ++-- libexec/ftpd/ftpd.8 | 2 +- libexec/ftpd/ftpd.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 9d57017e2f19..827ceda03272 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -460,12 +460,12 @@ cmd | LIST check_login CRLF { if ($2) - retrieve(_PATH_LS " -lgA", ""); + retrieve(_PATH_LS " -lA", ""); } | LIST check_login SP pathstring CRLF { if ($2) - retrieve(_PATH_LS " -lgA %s", $4); + retrieve(_PATH_LS " -lA %s", $4); free($4); } | STAT check_login SP pathname CRLF diff --git a/libexec/ftpd/ftpd.8 b/libexec/ftpd/ftpd.8 index ec4ce0c65100..44f8a2e00835 100644 --- a/libexec/ftpd/ftpd.8 +++ b/libexec/ftpd/ftpd.8 @@ -278,7 +278,7 @@ is specified. .It EPSV Ta "prepare for server-to-server transfer, multiprotocol" .It FEAT Ta "give information on extended features of server" .It HELP Ta "give help information" -.It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA" +.It LIST Ta "give list files in a directory" Pq Dq Li "ls -lA" .It LPRT Ta "specify data connection port, multiprotocol" .It LPSV Ta "prepare for server-to-server transfer, multiprotocol" .It MDTM Ta "show last modification time of file" diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index a41a23ab1184..11811da35cb5 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -2336,7 +2336,7 @@ statfilecmd(char *filename) struct stat st; code = lstat(filename, &st) == 0 && S_ISDIR(st.st_mode) ? 212 : 213; - (void)snprintf(line, sizeof(line), _PATH_LS " -lgA %s", filename); + (void)snprintf(line, sizeof(line), _PATH_LS " -lA %s", filename); fin = ftpd_popen(line, "r"); if (fin == NULL) { perror_reply(551, filename);