From nobody Tue May 21 22:52:58 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 4VkV8B5fP0z5L1RC; Tue, 21 May 2024 22:52:58 +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 4VkV8B3lJtz4Zcp; Tue, 21 May 2024 22:52:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716331978; 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=iUiOPg2wSuMdEbz29Rdcvud63elmr3NThtq+1wH9vKY=; b=ixOs6T7znsEykmbk/jPgIpeuGAxlP4MkHGJCUW4XdIW4aV0lfUzd13jA6W3CMSmnus0S8I xbx+m0BePC1eifU2f3boOPfCVJ/Aun+Se7uWtwByao2xPbFAuyqyR/3JsJBRfEdw/XzagQ cmnNNLOyJ5nRhpLsFFzYQo3PjSYb0DZCCtGGNcNDyWmEslnbgJ3EyPPPidvGzLhrlwZxIC 1l9Bvy9UEmT0DISAv8lFp0E3wxGcozFVk5k4TlecAXSJCEyuVKrbJLKpdH2hmKo6BBz16b PayOH4HSSmUR/kl4pN6+wVhv1rQfr/s7fPp0fiI9anqkIu3IuVJlMw9Mx4dPlA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716331978; a=rsa-sha256; cv=none; b=dEs4zwZYevVoDjuVYKxPhyZ+eS2FvUk9VXnWsm0FRODGgFIfV+KJ/sq5B9ZS0VgkMj45eo 1+cu1qp5VbZSHMxf6m9/uSART1pDejxPnBaaQ+BEWpmH+ccCJSx2cb4jNNO20Q+e+5wQS3 kDG854y2hTgobq+nefc0lNP7JJYMJ8Z6XnDgFX6rJwMGc/r/0vw2Zsy+LfPrnUEjtAhnJ2 fmtNrXPNJwThyIaNWd/ksgCcSlndMJhhqgE09F+l2qsfxl/z1DdmgQhKGFLJPqtp2xNcoY ki3dRlsYBNBFgfy2gwc9qGqbsQznhqjgaJY2vWhiGw/seP4XOeBS4sWVUG83cw== 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=1716331978; 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=iUiOPg2wSuMdEbz29Rdcvud63elmr3NThtq+1wH9vKY=; b=j0XJXg/XR/AMeSi/VaFJgj+/nwcRG9YI+WZizaxRuZRNFPZ9/r7oy1Pi01aH3cULcaIwWc Z3me/n1KUPsdCIO0R55Wd4oZg0JJTp3JcLCD4mj6qja7aGudoHmAl4qaUl7MdeyHeRpbkJ 4HuACF+6caz3eDpjuHDvPO3DqfbtBpnPHIuYVTcHsQEESJsjxa+jSbl3+hjh90ENvD/xL2 0rTvlpc+STozGB3vxDLMxhTkNoRfs+SezXDsMprgxy5Swz7qwJ3qEzvgwdb1cVDwyuKr36 Tt0+DOJNJZbbfSAMfCl4KMvvYiNgdWJZij/2rCONxlYSU1kuPQJZ49Asz/8eaw== 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 4VkV8B3M66zhLk; Tue, 21 May 2024 22:52:58 +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 44LMqwWT029225; Tue, 21 May 2024 22:52:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44LMqwXe029222; Tue, 21 May 2024 22:52:58 GMT (envelope-from git) Date: Tue, 21 May 2024 22:52:58 GMT Message-Id: <202405212252.44LMqwXe029222@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Allan Jude Subject: git: e20971500194 - main - 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/main X-Git-Reftype: branch X-Git-Commit: e20971500194d2f7299e9d01ca3b20e9bc6b4009 Auto-Submitted: auto-generated The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/src/commit/?id=e20971500194d2f7299e9d01ca3b20e9bc6b4009 commit e20971500194d2f7299e9d01ca3b20e9bc6b4009 Author: Allan Jude AuthorDate: 2024-05-21 22:40:12 +0000 Commit: Allan Jude CommitDate: 2024-05-21 22:50:14 +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 MFC after: 3 days Sponsored-by: ScaleEngine Inc. Fixes: 3bfbb521fef5 ("ls: Improve POSIX compatibility for -g and -n.") --- 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 742de2f4c086..c090130d8137 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -451,12 +451,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 fcc5da0b6db1..2241ea78de81 100644 --- a/libexec/ftpd/ftpd.8 +++ b/libexec/ftpd/ftpd.8 @@ -276,7 +276,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 8004d51a4579..f3a1105f6437 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -2321,7 +2321,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);