Bug 213574

Summary: Try to mitigate archives with bad modes for files and directories a bit
Product: Ports & Packages Reporter: Mathieu Arnold <mat>
Component: Ports FrameworkAssignee: Mathieu Arnold <mat>
Status: Closed FIXED    
Severity: Affects Only Me CC: portmgr
Priority: --- Flags: mat: exp-run?
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 213743    
Attachments:
Description Flags
v1
none
v2
none
v3
none
v4 none

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