From nobody Tue Mar 5 00:16:25 2024 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 4TpbhV2f97z5DYwW for ; Tue, 5 Mar 2024 00:16:26 +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 4TpbhV1cvMz4K1t for ; Tue, 5 Mar 2024 00:16:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1709597786; a=rsa-sha256; cv=none; b=llzJ6xUnJQPmza2nYtgGkkiKFtclIHX5B20zFw83sxrlsaVgRISZHkHR0t4MscPUPOVPbF xrinJd8A8Dc3aFhi76OG6Bl9ObSfBINRVd0zYrJfyJbP7k0nyg2UwDtC8GrLa0zlq+sMtk RuPPwb2bAzH3d3UucwOQ9/JZSN16ltiCYgA9JjJPjSUDDuh4J6gUmyF8GmZfYIiELcnfqy oHZ+SUc6cClvk0UE8LJvAL1htL8pa2lCvG/z8nmnzVNmKfUJi8ZEEtcZH4929pI1O1xEho QgWtTYc7tRv58l8T54LkM7iBhSVqtV8SjBPwc9pDnAtLPTf2RjtOoKCzFNh40w== 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=1709597786; 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=HAysWRb4sLjFJxHbKQTOSE/jfF4b9MI4juoiRBQImxs=; b=XSq4JuMS7KSEdfjIyT27niL182tgYHRV/vJEtCPY/oQwLpx5UZSJXhRCZdDTX+iAA27spK sPfr0S1wc/fjKF9IDNX/BwNDDqBZYwdHihYi+BiKP4gwTqzLK8iZlz48bnCSTbltdW4pjv hhqF7eJux+21G2TJVKhJmUCwwD/yvvRmEmWES0E3xXZ2YmuhwquURusQ3RUU0s12ICsw2y bFiv6oKATJqhITEcASxwB08r5Palb8ORyef+MnsjNHJ/Y8t0I5OIkVkxlEm9xYRadbvIOw riu1y1Pkil/Vndt5inr0N0f7GmpEK3maO6bG64riJqU12XiZGdCqyDRXzwf1cw== 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 4TpbhV16zszjjL for ; Tue, 5 Mar 2024 00:16:26 +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 4250GQoF010320 for ; Tue, 5 Mar 2024 00:16:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 4250GQOA010319 for bugs@FreeBSD.org; Tue, 5 Mar 2024 00:16:26 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 272120] touch(1) -r modifies file's birthtime Date: Tue, 05 Mar 2024 00:16:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: bin X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: mp@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D272120 Mark Peek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mp@FreeBSD.org --- Comment #2 from Mark Peek --- I looked into this a little bit and here is what I discovered. Running "tou= ch -m" uses utimensat(2) and passes in just the modification date. This system call then calls an internal setutimes() https://github.com/freebsd/freebsd-src/blob/main/sys/kern/vfs_syscalls.c#L3= 211. In 2002 this change was added: =20=20=20 https://github.com/freebsd/freebsd-src/commit/fb36a3d8472e3b7c446b5501635ec= 34eb1ebaa00 Change utimes to set the file creation time (for filesystems that support creation times such as UFS2) to the value of the modification time if the value of the modification time is older than the current creation time. See utimes(2) for further details. If a birthtime is not passed into setutimes() and the birthtime is younger = than the modification time, then the birthtime is set to the modification time. = The utimensat(2) man page documents this behavior. This makes a little bit of sense given a modification time usually should n= ot be older than the birthtime of the file. But the utimes man page does talk about the need for a new system call allowing for setting access, modificat= ion, *and* birthtime so that might be an alternative. Options: 1. Document this behavior in the touch(1) man page. 2. Add a new system call to allow setting all three times and modify touch(= 1) to use it. --=20 You are receiving this mail because: You are the assignee for the bug.=