Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 417031

Summary: sys-freebsd/freebsd-mk-defs can cause build system to set 444 permissions on directories
Product: Gentoo/Alt Reporter: Richard Yao (RETIRED) <ryao>
Component: FreeBSDAssignee: Gentoo/BSD Team <bsd+disabled>
Status: RESOLVED FIXED    
Severity: QA    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: FreeBSD   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 409269    
Attachments: Revision to freebsd-mk-defs-9.0-gentoo.patch

Description Richard Yao (RETIRED) gentoo-dev 2012-05-22 08:42:16 UTC
Created attachment 312633 [details, diff]
Revision to freebsd-mk-defs-9.0-gentoo.patch

I modified sys-freebsd/freebsd-lib to build some additional libraries as part of a solution to bug #409269 that I am developing. Unfortunately, I hit an issue where include directories were being created with 444 permissions, which prevented the portage user from creating includes.

I made a slight change to the freebsd-mk-defs-9.0-gentoo.patch being applied, which fixed it. Many of the modifications made in freebsd-mk-defs-9.0-gentoo.patch are intended to address issues with src_install(), because FreeBSD's build system expects the directories to have already been made. As such, the same change is made in many places and it could be a good idea to review the permissions being set on those directories in all such instances.

Alternatively, we could just apply my tweak to all such places. At the moment, my change only affects share/mk/bsd.incs.mk.
Comment 1 Alexis Ballier gentoo-dev 2012-05-22 13:25:57 UTC
diff to existing patch ? its impossible to review like that
Comment 2 Richard Yao (RETIRED) gentoo-dev 2012-05-22 17:37:05 UTC
Sorry about that. Here is the diff. It is a simple change, so I am posting it inline. All I did was remove the -m option in the extra ${INSTALL} line that was added in share/mk/bsd.incs.mk because ${${group}MODE_${.ALLSRC:T}} is 444.

--- freebsd-mk-defs-9.0-gentoo.patch    2011-11-07 07:48:14.000000000 -0500
+++ freebsd-mk-defs-9.0-gentoo-r1.patch 2012-05-22 01:36:57.031266703 -0400
@@ -46,7 +46,7 @@
  installincludes: _${group}INS_${header:T}
  _${group}INS_${header:T}: ${header}
 +      ${INSTALL} -d -o ${${group}OWN_${.ALLSRC:T}} \
-+               -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \
++               -g ${${group}GRP_${.ALLSRC:T}} \
 +               ${DESTDIR}${${group}DIR_${.ALLSRC:T}}
        ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \
            -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \
Comment 3 Alexis Ballier gentoo-dev 2012-05-22 18:11:38 UTC
(In reply to comment #2)
> Sorry about that. Here is the diff. It is a simple change, so I am posting
> it inline. All I did was remove the -m option in the extra ${INSTALL} line
> that was added in share/mk/bsd.incs.mk because ${${group}MODE_${.ALLSRC:T}}
> is 444.
> 
> --- freebsd-mk-defs-9.0-gentoo.patch    2011-11-07 07:48:14.000000000 -0500
> +++ freebsd-mk-defs-9.0-gentoo-r1.patch 2012-05-22 01:36:57.031266703 -0400
> @@ -46,7 +46,7 @@
>   installincludes: _${group}INS_${header:T}
>   _${group}INS_${header:T}: ${header}
>  +      ${INSTALL} -d -o ${${group}OWN_${.ALLSRC:T}} \
> -+               -g ${${group}GRP_${.ALLSRC:T}} -m
> ${${group}MODE_${.ALLSRC:T}} \
> ++               -g ${${group}GRP_${.ALLSRC:T}} \
>  +               ${DESTDIR}${${group}DIR_${.ALLSRC:T}}
>         ${INSTALL} -C -o ${${group}OWN_${.ALLSRC:T}} \
>             -g ${${group}GRP_${.ALLSRC:T}} -m ${${group}MODE_${.ALLSRC:T}} \

oh, yeah, please commit this and make a -r1 of -mk-defs
Comment 4 Richard Yao (RETIRED) gentoo-dev 2012-05-22 18:53:08 UTC
Committed to CVS.