Bug 273342

Summary: Permissions of /root are changed to 0755 during "make installworld"
Product: Base System Reporter: Thomas Eberhardt <sneakywumpus>
Component: confAssignee: Gordon Bergling <gbe>
Status: Closed FIXED    
Severity: Affects Some People CC: emaste, gbe, i.dani, trasz
Priority: --- Flags: i.dani: maintainer-feedback? (emaste)
gbe: exp-run-
Version: CURRENT   
Hardware: Any   
OS: Any   
See Also: https://reviews.freebsd.org/D42395
Attachments:
Description Flags
Patch to set expected permissions of /root during "make installworld" none

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!