Bug 273342 - Permissions of /root are changed to 0755 during "make installworld"
Summary: Permissions of /root are changed to 0755 during "make installworld"
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Gordon Bergling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-25 09:03 UTC by Thomas Eberhardt
Modified: 2023-12-01 07:19 UTC (History)
4 users (show)

See Also:
i.dani: maintainer-feedback? (emaste)
gbe: exp-run-


Attachments
Patch to set expected permissions of /root during "make installworld" (680 bytes, application/x-csh)
2023-08-25 09:03 UTC, Thomas Eberhardt
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Eberhardt 2023-08-25 09:03:01 UTC
Created attachment 244331 [details]
Patch to set expected permissions of /root during "make installworld"

According to /etc/mtree/BSD.root.dist /root should have 0750 permissions, but "make installworld" changes these to 0755.

This is caused by the installation of configuration directories of "csh" and "sh".

Small patch to correct this is attached.
Comment 1 Dani I. 2023-09-07 10:45:45 UTC
Tagged emaste, gbe and cem - as they discussed and implemented review D23392

Imho the patch shouldn't be that static and should take in "BSD.root.dist" for setting the correct permission.
Comment 2 Gordon Bergling freebsd_committer freebsd_triage 2023-10-09 05:36:45 UTC
I can confirm that issue on head and releng/14.0 and that the attached patch fixes the issue.

I would also recommend an MFC to releng/14.0 for people which are not tracking stable/14.
Comment 3 Gordon Bergling freebsd_committer freebsd_triage 2023-10-11 19:53:25 UTC
If anyone is fine with that patch, I would like to commit it, but I would need approval from a src committer. Anyone?
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-11-16 10:00:39 UTC
A commit in branch main references this bug:

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

commit a6ed8c9593031abf6fa73661be55c226caa362d6
Author:     Thomas Eberhardt <sneakywumpus@gmail.com>
AuthorDate: 2023-11-16 09:59:38 +0000
Commit:     Gordon Bergling <gbe@FreeBSD.org>
CommitDate: 2023-11-16 09:59:38 +0000

    Fix /root permissions after 'make installworld'

    According to /etc/mtree/BSD.root.dist /root should have
    0750 permissions, but the build target 'make installworld'
    changes these to 0755.

    This is caused by the installation of the configuration
    files of sh(1) and csh(1).

    Correct this by specifying the correct default /root permissions.

    PR:     273342
    Reviewed by:    jilles
    Approved by:    jilles
    MFC after:      2 weeks
    Differential Revision:https://reviews.freebsd.org/D42395

 bin/csh/Makefile | 1 +
 bin/sh/Makefile  | 1 +
 2 files changed, 2 insertions(+)
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-12-01 07:17:05 UTC
A commit in branch stable/14 references this bug:

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

commit c9ceff3c1fa6854627427235db4e9c6a7c583965
Author:     Thomas Eberhardt <sneakywumpus@gmail.com>
AuthorDate: 2023-11-16 09:59:38 +0000
Commit:     Gordon Bergling <gbe@FreeBSD.org>
CommitDate: 2023-12-01 07:15:25 +0000

    Fix /root permissions after 'make installworld'

    According to /etc/mtree/BSD.root.dist /root should have
    0750 permissions, but the build target 'make installworld'
    changes these to 0755.

    This is caused by the installation of the configuration
    files of sh(1) and csh(1).

    Correct this by specifying the correct default /root permissions.

    PR:     273342
    Reviewed by:    jilles
    Approved by:    jilles
    MFC after:      2 weeks
    Differential Revision:https://reviews.freebsd.org/D42395

    (cherry picked from commit a6ed8c9593031abf6fa73661be55c226caa362d6)

 bin/csh/Makefile | 1 +
 bin/sh/Makefile  | 1 +
 2 files changed, 2 insertions(+)
Comment 6 commit-hook freebsd_committer freebsd_triage 2023-12-01 07:17:07 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=1023abd5b60f82360ea9f09b9af06dd30d6d8c18

commit 1023abd5b60f82360ea9f09b9af06dd30d6d8c18
Author:     Thomas Eberhardt <sneakywumpus@gmail.com>
AuthorDate: 2023-11-16 09:59:38 +0000
Commit:     Gordon Bergling <gbe@FreeBSD.org>
CommitDate: 2023-12-01 07:16:38 +0000

    Fix /root permissions after 'make installworld'

    According to /etc/mtree/BSD.root.dist /root should have
    0750 permissions, but the build target 'make installworld'
    changes these to 0755.

    This is caused by the installation of the configuration
    files of sh(1) and csh(1).

    Correct this by specifying the correct default /root permissions.

    PR:     273342
    Reviewed by:    jilles
    Approved by:    jilles
    MFC after:      2 weeks
    Differential Revision:https://reviews.freebsd.org/D42395

    (cherry picked from commit a6ed8c9593031abf6fa73661be55c226caa362d6)

 bin/csh/Makefile | 1 +
 bin/sh/Makefile  | 1 +
 2 files changed, 2 insertions(+)
Comment 7 Gordon Bergling freebsd_committer freebsd_triage 2023-12-01 07:19:57 UTC
Committed to HEAD, stable/13 and stable/14. Thanks for the patch!