Bug 213574 - Try to mitigate archives with bad modes for files and directories a bit
Summary: Try to mitigate archives with bad modes for files and directories a bit
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mathieu Arnold
URL:
Keywords:
Depends on:
Blocks: 213743
  Show dependency treegraph
 
Reported: 2016-10-17 16:39 UTC by Mathieu Arnold
Modified: 2016-10-29 10:51 UTC (History)
1 user (show)

See Also:
mat: exp-run?


Attachments
v1 (1.45 KB, patch)
2016-10-17 16:39 UTC, Mathieu Arnold
no flags Details | Diff
v2 (1.27 KB, patch)
2016-10-17 20:15 UTC, Mathieu Arnold
no flags Details | Diff
v3 (3.02 KB, patch)
2016-10-27 16:47 UTC, Mathieu Arnold
no flags Details | Diff
v4 (2.70 KB, patch)
2016-10-27 17:31 UTC, Mathieu Arnold
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Arnold freebsd_committer freebsd_triage 2016-10-17 16:39:02 UTC
Created attachment 175871 [details]
v1
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2016-10-17 18:23:12 UTC
Why not ${CHMOD} -R a+rX ?  It's faster, and maybe better  (sets executable bit too).
Comment 2 Mathieu Arnold freebsd_committer freebsd_triage 2016-10-17 19:53:54 UTC
Yeah, I stumbled upon a port doing that after submitting the patch, I wanted to do a few tests to see if it would fix some other stuff.
Comment 3 Mathieu Arnold freebsd_committer freebsd_triage 2016-10-17 20:15:17 UTC
Created attachment 175878 [details]
v2

This way will also fix ports like converters/p5-Unicode-IMAPUtf7 where the directories are 0644 in the distfile.
Comment 5 Mathieu Arnold freebsd_committer freebsd_triage 2016-10-27 16:10:18 UTC
Just to be sure, those three were the only fallout ?
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2016-10-27 16:26:20 UTC
(In reply to Mathieu Arnold from comment #5)
So far yes, I am doing a few more tests.
Comment 7 Mathieu Arnold freebsd_committer freebsd_triage 2016-10-27 16:47:21 UTC
Created attachment 176220 [details]
v3

Fix current fallout.
Comment 8 Mathieu Arnold freebsd_committer freebsd_triage 2016-10-27 17:31:19 UTC
Created attachment 176221 [details]
v4

Don't chmod CONFIGURE_CMD in the end.
Comment 9 Antoine Brodin freebsd_committer freebsd_triage 2016-10-29 05:43:21 UTC
Exp-run looks fine.
Comment 10 commit-hook freebsd_committer freebsd_triage 2016-10-29 09:30:35 UTC
A commit references this bug:

Author: mat
Date: Sat Oct 29 09:30:14 UTC 2016
New revision: 424898
URL: https://svnweb.freebsd.org/changeset/ports/424898

Log:
  Fix file modes after extracting.

  Some port's archives contains files modes that are a bit too restrictive
  for some usage.  For example:
  BUILD_DEPENDS=		${NONEXISTENT}:foo/bar:configure
  When building as a regular user, dependencies are installed/built as
  root, so if the archive contains files that have a mode of, say, 600,
  they will not be readable by the port requesting the dependency.
  This will also fix broken distribution files where directories don't
  have the executable bit on.

  OSVERSION 1100077 is after base r283997:

    Change directory permissions in pre-order.
    In this order, it won't try to recurse into a directory for which it
    doesn't have permission, before changing that permission.
    This follows an existing behavior in other BSDs, linux, OS X.

  PR:		213574
  Submitted by:	mat
  Exp-run by:	antoine
  Sponsored by:	Absolight

Changes:
  head/Mk/bsd.port.mk
  head/misc/compat4x/Makefile
  head/security/bugs/Makefile
  head/x11/fluxbg/Makefile