Page MenuHomeFreeBSD

create sticky bit /usr/obj/home dir
Needs ReviewPublic

Authored by emaste on Jun 10 2024, 8:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 14 2025, 10:59 PM
Unknown Object (File)
Oct 26 2025, 1:50 AM
Unknown Object (File)
Sep 26 2025, 9:21 PM
Unknown Object (File)
Sep 23 2025, 12:21 PM
Unknown Object (File)
Sep 15 2025, 6:21 AM
Unknown Object (File)
Sep 11 2025, 1:20 AM
Unknown Object (File)
Sep 4 2025, 6:23 AM
Unknown Object (File)
Sep 2 2025, 4:27 PM
Subscribers

Details

Reviewers
imp
jhb
markj
Summary

This allows users to transparently build FreeBSD from, for example, ~/src/freebsd-src.

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

emaste created this revision.

I like the idea, but I wonder if it'd be better to modify pw(8) to create a directory under /usr/obj/home with the correct ownership?

I don't object it, but I somehow feel it might be overkill to create a directory which is not very useful for most of users and systems that are not building codes from their home. Also this is only useful for the code resides under /home/**. How about adding some checks and print information and instructions (of setting MAKEOBJDIRPREFIX or asking superuser to create that directory for them) in Makefile.* or *.mk files?

From a sysadm's perspective, I also not very sure it's a good idea to add one more (and uncommon) place other than /tmp (and /var/tmp) where non-superuser can write files to by default. It might cause a DoS issue to the system.

I like the idea, but I wonder if it'd be better to modify pw(8) to create a directory under /usr/obj/home with the correct ownership?

I'm not wedded to this patch, I'd just like us to have one standardized and documented preferred method. Maybe we suggest

mkdir -p /usr/obj/home/${USER}
chown ${USER}:${USER} /usr/obj/home/$USER

and pw(8) could offer to do that as @markj suggests

I somehow feel it might be overkill to create a directory which is not very useful for most of users

This is also somewhat true for /usr/obj though I'd say

I'd rather not add new uses of the sticky bit.

and pw(8) could offer to do that as @markj suggests

Do you mean adduser? pw isn't interactive.

From a sysadm's perspective, I also not very sure it's a good idea to add one more (and uncommon) place other than /tmp (and /var/tmp) where non-superuser can write files to by default. It might cause a DoS issue to the system.

Maybe /usr/obj/home/foo can be a symlink to /home/foo/obj instead, though that's perhaps a bit sneaky.

I'd rather not add new uses of the sticky bit.

and pw(8) could offer to do that as @markj suggests

Do you mean adduser? pw isn't interactive.

From a sysadm's perspective, I also not very sure it's a good idea to add one more (and uncommon) place other than /tmp (and /var/tmp) where non-superuser can write files to by default. It might cause a DoS issue to the system.

Maybe /usr/obj/home/foo can be a symlink to /home/foo/obj instead, though that's perhaps a bit sneaky.

That would run afoul of other setups. For example, on my desktop /usr/home (still old school) is a ZFS dataset on a mirror of SSDs, whereas /usr/obj is a M.2 drive I use for scratch data, so that symlink would be cross-purposes.

I think that we should just document /usr/obj (as we do today) and let users figure out how to configure it. We might document some best practices somewhere, but I'm leery to hardcode anything by default.