From nobody Thu Jan 27 18:03:06 2022 X-Original-To: bugs@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 1164D198F20F for ; Thu, 27 Jan 2022 18:03:08 +0000 (UTC) (envelope-from bugzilla-noreply@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 4Jl7jl4hJbz3Ktp for ; Thu, 27 Jan 2022 18:03:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4AD7F1B2BC for ; Thu, 27 Jan 2022 18:03:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 20RI37GM058697 for ; Thu, 27 Jan 2022 18:03:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from bugzilla@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 20RI37AE058696 for bugs@FreeBSD.org; Thu, 27 Jan 2022 18:03:07 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: bugzilla set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 235438] cp -R command not working properly Date: Thu, 27 Jan 2022 18:03:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 12.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: commit-hook@FreeBSD.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: kevans@freebsd.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1643306587; 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: in-reply-to:in-reply-to:references:references; bh=usgfdoEZo9s8FJXR0QqT11QA3FqgUTHtMryWGnceInY=; b=xNC25fp1HEArKBk+gIBrVdhhIReUDamVWTm///jc8xdet6qaWJPSTyYtaYSQiBzmB2PUQW R4Qroh9ODCgLYauYrnHKrtXBJP/KUuDB5HmHDFLMzKllQhUUFcQn1jsxGMDIfsQFRC1ffX WoKj0I1fnQz7ikhm5FREydd6dwr6k/zdlROpsYJsxWeHoOkQKIr4xSJ5X6/p8u9PAuUzAW VS90ihKp1DmiIPjr/wGaxCHr8Xvcbp6kND7cKCtrhHZObxKeuZ1giattqMCq0T/oWtP9OP evYpZ5QU8lXcu9BBAPw0oWU4qvt2giAQxJDLxaaFvLGpZT9t00JzsvP/uUItZQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1643306587; a=rsa-sha256; cv=none; b=Xh5ODlL3zVpAGkUruQku9XpMLz1RWRbuOdk/QYO5NKNATiaoOMjZLxaDhnAdy/CNsi8BZO T6xFtjgZIca4uqVMw4O7pFVl8ValPm+iSlISzDKCQJqoTJVLRZH1g1wCU/1GgZ8MyCsXj6 5j468Jxdhw1QNi4yaXjXbtiQM5Nb2iMYVzqLITYiyLnEKxdXUGvJf+OgRI9kjOv7lfqO9e lm5lRyIy00Zm2jJ1mWjB312URaSPoGy/1uwVHgywC0w0jpqOczDdEXmA+5eW1AuamWfQbI NB3wZc20edNFMvZ2gnyaRdDMMy3dTrGXUEjA6QHjNU7omH5p90xvQbJs89Yuig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D235438 --- Comment #2 from commit-hook@FreeBSD.org --- A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=3D848263aad129c8f9de75b58a5ab9a0106= 11b75ac commit 848263aad129c8f9de75b58a5ab9a010611b75ac Author: Kyle Evans AuthorDate: 2022-01-27 18:02:17 +0000 Commit: Kyle Evans CommitDate: 2022-01-27 18:02:17 +0000 cp: fix some cases with infinite recursion As noted in the PR, cp -R has some surprising behavior. Typically, when you `cp -R foo bar` where both foo and bar exist, foo is cleanly copied to foo/bar. When you `cp -R foo foo` (where foo clearly exists), cp(1) goes a little off the rails as it creates foo/foo, then discovers that and creates foo/foo/foo, so on and so forth, until it eventually fails. POSIX doesn't seem to disallow this behavior, but it isn't very useful. GNU cp(1) will detect the recursion and squash it, but emit a message in the process that it has done so. This change seemingly follows the GNU behavior, but it currently doesn't warn about the situation -- the author feels that the final product is about what one might expect from doing this and thus, doesn't need a warning. The author doesn't feel strongly about this. PR: 235438 Reviewed by: bapt Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D33944 bin/cp/cp.c | 75 +++++++++++++++++++++++++++++++++++++++++++--= -- bin/cp/tests/cp_test.sh | 77 +++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 147 insertions(+), 5 deletions(-) --=20 You are receiving this mail because: You are on the CC list for the bug.=