Bug 264376 - [patch] rc.d/hostid needlessly re-cats /etc/hostid
Summary: [patch] rc.d/hostid needlessly re-cats /etc/hostid
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2022-05-31 19:16 UTC by наб
Modified: 2023-12-27 16:57 UTC (History)
3 users (show)

See Also:


Attachments
[PATCH] rc.d/hostid: remove useless cat (686 bytes, text/plain)
2022-05-31 19:16 UTC, наб
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description наб 2022-05-31 19:16:45 UTC
Created attachment 234357 [details]
[PATCH] rc.d/hostid: remove useless cat

I tried to post this to freebsd-rc@freebsd.org, but your MX really didn't like mine (unrelated reasons, I'll have to call my g.d. ISP again).

I'm attaching a patch that just re-uses the already-read-and-validated ID (and avoids a TOCTTOU, technically, but meh), based on yesterday's git HEAD.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2022-06-01 14:35:22 UTC
Patch lgtm, thanks
I'll take it
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-06-18 01:29:23 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=11bd40d04af59daa7ae7feea0518081a35f07053

commit 11bd40d04af59daa7ae7feea0518081a35f07053
Author:     наб <nabijaczleweli@nabijaczleweli.xyz>
AuthorDate: 2022-05-30 23:18:12 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2022-06-18 01:27:19 +0000

    rc.d/hostid: remove useless cat

    We've already read it and validated it ‒ re-reading is wasteful

    PR:             264376

 libexec/rc/rc.d/hostid | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 3 Graham Perrin freebsd_committer freebsd_triage 2022-10-17 12:40:29 UTC
Keyword: 

    patch
or  patch-ready

– in lieu of summary line prefix: 

    [patch]

* bulk change for the keyword
* summary lines may be edited manually (not in bulk). 

Keyword descriptions and search interface: 

    <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-09-24 15:50:17 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=7af7a0d1b14e669277f704eac0b8d3f82d327a9b

commit 7af7a0d1b14e669277f704eac0b8d3f82d327a9b
Author:     наб <nabijaczleweli@nabijaczleweli.xyz>
AuthorDate: 2022-05-30 23:18:12 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-09-24 15:48:34 +0000

    rc.d/hostid: remove useless cat

    We've already read it and validated it ‒ re-reading is wasteful

    PR:             264376
    (cherry picked from commit 11bd40d04af59daa7ae7feea0518081a35f07053)

 libexec/rc/rc.d/hostid | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 5 Mark Linimon freebsd_committer freebsd_triage 2023-12-27 16:57:42 UTC
^Triage: committed to all supported branches.