pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/42043: Installing sysutils/libgtop with USE_DESTDIR results in wrong setgid binary



>Number:         42043
>Category:       pkg
>Synopsis:       Installing sysutils/libgtop with USE_DESTDIR results in wrong 
>setgid binary
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 10 21:25:00 +0000 2009
>Originator:     Joachim Kuebart
>Release:        NetBSD-current
>Organization:
>Environment:
NetBSD yacht 5.99.16 NetBSD 5.99.16 (YACHT) #2: Thu Sep 10 10:16:00 BST 2009  
joki@yacht:/usr/obj/amd64/usr/src/sys/arch/amd64/compile/YACHT amd64

>Description:
When building and installing libgtop with USE_DESTDIR=yes, the file 
bin/libgtop_server2 gets installed with mode 2555 and group wheel. When 
installed without USE_DESTDIR, it is correctly assigned group kmem.

>How-To-Repeat:
Install libgtop with USE_DESTDIR=yes.
$ ls -l /usr/pkg/bin/libgtop_server2
-r-xr-sr-x  1 root  wheel  25928 Sep 10 13:24 /usr/pkg/bin/libgtop_server2
The group should be "kmem".

>Fix:
The mode and group are set manually (as opposed to using /bin/install), 
specifically in ${WRKSRC}/src/daemon/Makefile in the target install-exec-hook. 
The binary is accessed using $(bindir) which resolves to /usr/pkg/bin. The 
following patch changes the chgrp and chmod calls to use ${DESTDIR}$(bindir) 
instead.

This patch replaces the existing file patches/patch-da:

$NetBSD$

--- configure.orig      2009-04-13 20:32:32.000000000 +0100
+++ configure
@@ -21525,35 +21525,35 @@ echo $ECHO_N "checking for libgtop sysde
          libgtop_sysdeps_dir=bsd
          libgtop_use_machine_h=yes
          libgtop_need_server=yes
-         libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 
2755 $(bindir)/libgtop_server2'
+         libgtop_postinstall='chgrp kmem ${DESTDIR}$(bindir)/libgtop_server2 
&& chmod 2755 ${DESTDIR}$(bindir)/libgtop_server2'
          ;;
-       freebsd*|kfreebsd*)
+       freebsd*|kfreebsd*|dragonfly*)
          libgtop_sysdeps_dir=freebsd
          libgtop_use_machine_h=yes
          libgtop_need_server=yes
          libgtop_sysdeps_private_mountlist=yes
          libgtop_sysdeps_private_fsusage=yes
-         libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 
2755 $(bindir)/libgtop_server2'
+         libgtop_postinstall='chgrp kmem ${DESTDIR}$(bindir)/libgtop_server2 
&& chmod 2755 ${DESTDIR}$(bindir)/libgtop_server2'
          ;;
        solaris*)
          libgtop_sysdeps_dir=solaris
          libgtop_use_machine_h=yes
          libgtop_need_server=yes
-         libgtop_postinstall='chgrp sys $(bindir)/libgtop_server && chmod 2755 
$(bindir)/libgtop_server'
+         libgtop_postinstall='chgrp sys ${DESTDIR}$(bindir)/libgtop_server && 
chmod 2755 ${DESTDIR}$(bindir)/libgtop_server'
          ;;
        aix*)
          libgtop_sysdeps_dir=aix
          libgtop_use_machine_h=yes
          libgtop_need_server=yes
          libgtop_have_sysinfo=yes
-         libgtop_postinstall='chgrp system $(bindir)/libgtop_server && chmod 
g+s $(bindir)/libgtop_server2'
+         libgtop_postinstall='chgrp system ${DESTDIR}$(bindir)/libgtop_server 
&& chmod g+s ${DESTDIR}$(bindir)/libgtop_server2'
          ;;
        darwin*)
          libgtop_sysdeps_dir=darwin
          libgtop_use_machine_h=yes
          libgtop_need_server=yes
          libgtop_have_sysinfo=yes
-         libgtop_postinstall='chgrp kmem $(bindir)/libgtop_server2 && chmod 
g+s $(bindir)/libgtop_server2'
+         libgtop_postinstall='chgrp kmem ${DESTDIR}$(bindir)/libgtop_server2 
&& chmod g+s ${DESTDIR}$(bindir)/libgtop_server2'
          ;;
        *)
          if test x$hacker_mode = xyes ; then
@@ -21594,7 +21594,7 @@ echo "${ECHO_T}$libgtop_sysdeps_dir" >&6
 
 
        case "$host_os" in
-       *bsd*)
+       *bsd*|dragonfly*)
                case "$host_os" in
                *kfreebsd*)
                { echo "$as_me:$LINENO: checking for kvm_open in -lkvm" >&5
@@ -33191,6 +33191,8 @@ do
   case $ac_option in
   # Handling of the options.
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+       : Avoid regenerating within pkgsrc
+       exit 0
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
     echo "$ac_cs_version"; exit ;;



Home | Main Index | Thread Index | Old Index