Page MenuHomeFreeBSD

Add warnings for writable WWWDIR to qa.sh
Needs ReviewPublic

Authored by feld on Jul 6 2015, 8:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Jan 1 2024, 3:47 AM
Unknown Object (File)
Sep 11 2023, 1:26 PM
Unknown Object (File)
Aug 27 2023, 2:42 PM
Unknown Object (File)
Apr 14 2017, 4:30 AM
Unknown Object (File)
Apr 11 2017, 10:47 AM
Unknown Object (File)
Apr 4 2017, 10:50 AM
Unknown Object (File)
Oct 23 2016, 5:45 PM
Unknown Object (File)
Jul 22 2016, 6:23 PM
Subscribers
None
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is my 5 minute mock-up of trying to detect when a port creates a
WWWDIR that is writable by WWWOWN or WWWGRP. It doesn't seem to work
here, but this same concept works if I manually run this against
my own test cases. (outside of poudriere)

Any ideas on how to properly integrate this into qa.sh would be great!
One weird thing it's doing right now besides not detecting correctly is
it seems that the WWWGRP variable doesn't make it to qa.sh ?

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

feld retitled this revision from to Add warnings for writable WWWDIR to qa.sh.
feld updated this object.
feld edited the test plan for this revision. (Show Details)
feld updated this object.
feld edited edge metadata.

I think bsd.port.mk has to be changed so that QA_ENV would include WWWOWN/WWWGRP.

How do we make this work if uidfix is used though: perhaps we should really check plist instead?

Actually the real issue on web related ports is that they should not be owned at all by WWWOWN/WWWGRP, but owned by root:wheel if you are willing to make a qa test it should actually test for those ownership and warn about it.

Because 99% of the time the number of directories that really needs write access should be really isolated

You're absolutely right @bapt, I was over-engineering this

I passed WWWDIR to QA_ENV but that doesn't help because in ${STAGEDIR} the permissions are always going to be correct (unless you were running poudriere as non-root, but that's a different story).

They're only different at install-time as dictated by the pkg-plist. I have no idea how to detect this because it's not a simple as looking for @dir(nonroot,,) %%WWWDIR%% -- you have to also consider people setting @owner and @group around sections in the plist.

This is harder than I thought it would be.

In D3005#59408, @feld wrote:

(unless you were running poudriere as non-root, but that's a different story).

Running poudriere as non root is going to be the default very soon, so, it'd be so much better if it worked in that case.

Should'nt those kind of checks be done by pkg plugins instead of in the stage? With @(user,group,perm) in plist permission of what is in stage can be different from what is packaged