Bug 203268 - [bsd.port.mk] home directory of USERS conflict with plist
Summary: [bsd.port.mk] home directory of USERS conflict with plist
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Port Management Team
URL: https://reviews.freebsd.org/D3720
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-22 21:12 UTC by Dmitry Marakasov
Modified: 2015-09-23 18:47 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Marakasov freebsd_committer 2015-09-22 21:12:30 UTC
Problem: www/rejik ports breaks permissions of /var/squid (750->755), even though it doesn't touch the directory.

====>> Checking for extra files and directories
====>> Error: Files or directories modified:
/var/squid permissions (0750, 0755)
====>> Cleaning up wrkdir

Full log: http://poudriere.amdmi3.ru/data/10-amd64-default/failures_all_2015_09_20/logs/errors/rejik-3.2.11_1.log

Thus happens because:

a) squid creates directory and sets custom permissions:

    @dir(squid,squid,750) /var/squid

b) UIDs entry for squid has homedir defined:

    squid:*:100:100::0:0:squid caching-proxy pseudo user:/var/squid:/usr/sbin/nologin

c) rejik has USERS=squid, and ports infrastructure tries to create home directory for specified users:

    bsd.port.mk:3647:        case $$homedir in /|/nonexistent|/var/empty) ;; *) ${ECHO_CMD} "${INSTALL} -d -g $$gid -o $$uid $$homedir" >> ${_UG_OUTPUT};; esac; \

Thus, when rejik is installed, infrastructure resets /var/squid to 755

Possible solutions:
1) Don't automatically create homedir for USERS (seems the best for me)
   - may lead to non-existing homedir
   - which, however, may be OK if it's not needed for specific port; also ports may depend on other ports to create homedir, like rejik does by run-depending on squid
   - need to synchronize permissions for all ports which create a directory, still that's possible
2) Always set users's home directory to /var/empty.
   - will likely break some ports
3) Include homedir permissions into UIDs file
   - makes it non-standard layout
   - maintained in a centralized way
   - still needs duplicated plist @dir entries in ports (or not?)
Comment 1 Antoine Brodin freebsd_committer 2015-09-23 08:03:24 UTC
For solution 1),  I believe this could break ports at run time?

Possible patch implementing 3):

https://reviews.freebsd.org/D3720
Comment 2 Dmitry Marakasov freebsd_committer 2015-09-23 18:47:18 UTC
Hmm, it seems like this is wrong path after all. See munin-master, it depends on munin-common, which has USERS, but munin-master uses directory which is home for munin user. In result, on deinstallation munin-master removes the directory, while the user is still there. Looks like we should not autocreate the directory and each port should manage it individually.

So I'd go #1.