Page MenuHomeFreeBSD

Makefile.inc1: suppress user->root warning about unsafe .git ownership
AbandonedPublic

Authored by dch on Tue, Mar 11, 12:18 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 14, 5:08 AM
Unknown Object (File)
Thu, Mar 13, 12:19 PM
Unknown Object (File)
Thu, Mar 13, 3:43 AM
Unknown Object (File)
Thu, Mar 13, 1:44 AM
Unknown Object (File)
Tue, Mar 11, 12:42 PM
Subscribers

Details

Summary

Björn reports:

make installworld runs git again but if build as user and owning the
files as user and installing as root that gives the obvious warning:

make[1]: "/usr/obj/usr/src/amd64.amd64/toolchain-metadata.mk" line 1: 
Using cached toolchain metadata from build at lab-top on Mon Mar 10 
22:35:33 UTC 2025

fatal: detected dubious ownership in repository at '/usr/src'
To add an exception for this directory, call:
         git config --global --add safe.directory /usr/src
make[1]: "/usr/src/Makefile.inc1" line 601: warning: Command 
"/usr/local/bin/git -C /usr/src show -s --format=%ct HEAD" exited with 
status 128
Test Plan

e.g.

root@wintermute /u/src# /usr/local/bin/git  -C /usr/src show -s --format=%ct HEAD
fatal: detected dubious ownership in repository at '/usr/src'
To add an exception for this directory, call:

        git config --global --add safe.directory /usr/src
root@wintermute /u/src# /usr/local/bin/git -c safe.directory=/usr/src -C /usr/src show -s --format=%ct HEAD
1741695465
root@wintermute /u/src#

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 62867
Build 59751: arc lint + arc unit

Event Timeline

dch requested review of this revision.Tue, Mar 11, 12:18 PM
dch retitled this revision from Makefile.inc1: suppress user->root warning about unsafe .git permissions to Makefile.inc1: suppress user->root warning about unsafe .git ownership.Tue, Mar 11, 12:19 PM
dch edited the summary of this revision. (Show Details)
dch added reviewers: bz, cperciva.
dch edited the test plan for this revision. (Show Details)

It looks like this predates db6f2bb93a9706963f66d270edb5ee62c37a9296; the message shouldn't be emitted for "normal" make installworld and the *package* targets shouldn't be run as root. I don't object to this change but it should not be necessary now.

jhb already dealt with this