View Issue Details

IDProjectCategoryView StatusLast Update
0002996SOGowith SOGopublic2014-12-16 13:26
Reportersmarth Assigned Toludovic  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx86_64OSGentoo 
Product Version2.2.10 
Target Version2.2.12Fixed in Version2.2.12 
Summary0002996: improper / inconsistent definition of rpath in source
Description

At build time in my Gentoo-system with a overlay ebuild the SOGO_SYSLIBDIR variable references to a wrong path. I get some warnings:

  • QA Notice: The following files contain insecure RUNPATHs
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/sogo/libSOGoUI.so.2.2.0
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/Frameworks/SOGo.framework/Versions/2/sogo/libSOGo.so.2.2.10
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/Mailer.SOGo/Mailer
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/ContactsUI.SOGo/ContactsUI
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/Appointments.SOGo/Appointments
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/AdministrationUI.SOGo/AdministrationUI
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/CommonUI.SOGo/CommonUI
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/Contacts.SOGo/Contacts
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/SchedulerUI.SOGo/SchedulerUI
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/MailerUI.SOGo/MailerUI
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/MailPartViewers.SOGo/MailPartViewers
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/PreferencesUI.SOGo/PreferencesUI
  • /var/tmp/portage/gnustep-apps/sogo-2.2.10/image/usr/lib64/GNUstep/SOGo/MainUI.SOGo/MainUI

Take a look inside:

readelf --dynamic libSOGoUI.so.2.2.0 | grep RUNPATH
0x000000000000001d (RUNPATH) Library runpath: [/var/tmp/portage/gnustep-apps/sogo-2.2.10/image///usr/lib64/sogo]

...RUNPATH should be [/usr/lib64/sogo].

In "configure" is "SOGO_SYSLIBDIR=\${GNUSTEP_LIBRARIES}". Everything works fine if I set it to "SOGO_SYSLIBDIR=\${GNUSTEP_SYSTEM_LIBRARIES}":

readelf --dynamic libSOGoUI.so.2.2.0 | grep RUNPATH
0x000000000000001d (RUNPATH) Library runpath: [/usr/lib64/sogo]

Before 2.2.10 SOGO_SYSLIBDIR is unused. As of 2.2.10 it is used in the rpath definitions of GNUmakefiles. Also GNUSTEP_SYSTEM_LIBRARIES is used as rpath definition (ActiveSync/common.make). What is the right way? Let SOGO_SYSLIBDIR unused and set all rpath definitions to GNUSTEP_SYSTEM_LIBRARIES rpath_libdir.patch) or set SOGO_SYSLIBDIR=GNUSTEP_SYSTEM_LIBRARIES in configure and use SOGO_SYSLIBDIR for all rpath definitions?

Sven

TagsNo tags attached.

Activities

smarth

smarth

2014-11-24 08:38

reporter  

rpath_libdir.patch (6,317 bytes)   
diff -uNr a/OpenChange/GNUmakefile b/OpenChange/GNUmakefile
--- a/OpenChange/GNUmakefile	2014-11-21 15:27:18.000000000 +0100
+++ b/OpenChange/GNUmakefile	2014-11-24 11:11:43.572921752 +0100
@@ -179,7 +179,7 @@
 	-DBACKEND_BUNDLE_NAME="@\"$(BUNDLE_NAME)$(BUNDLE_EXTENSION)\"" \
 	-DSOGO_BUNDLES_DIR="@\"$(BUNDLE_INSTALL_DIR)\""
 
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/SoObjects/common.make b/SoObjects/common.make
--- a/SoObjects/common.make	2014-11-21 15:27:19.000000000 +0100
+++ b/SoObjects/common.make	2014-11-24 11:11:56.931937812 +0100
@@ -23,7 +23,7 @@
 	-L../../SOPE/NGCards/$(GNUSTEP_OBJ_DIR)/ -lNGCards \
         -L../../SOPE/GDLContentStore/$(GNUSTEP_OBJ_DIR)/ -lGDLContentStore \
         -L/usr/local/lib \
-        -Wl,-rpath,$(SOGO_SYSLIBDIR)/sogo
+        -Wl,-rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 BUNDLE_LIBS += \
 	-lGDLAccess				\
diff -uNr a/SoObjects/SOGo/GNUmakefile b/SoObjects/SOGo/GNUmakefile
--- a/SoObjects/SOGo/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/SoObjects/SOGo/GNUmakefile	2014-11-24 11:12:12.043955962 +0100
@@ -11,7 +11,7 @@
 #SOGo_INSTALL_DIR = $(SOGO_LIBDIR)
 SOGo_INSTALL_DIR = $(DESTDIR)$(GNUSTEP_$(GNUSTEP_INSTALLATION_DOMAIN)_FRAMEWORKS)
 
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 SOGo_HEADER_FILES = \
 	SOGoBuild.h \
diff -uNr a/UI/AdministrationUI/GNUmakefile b/UI/AdministrationUI/GNUmakefile
--- a/UI/AdministrationUI/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/UI/AdministrationUI/GNUmakefile	2014-11-24 11:24:42.215834978 +0100
@@ -25,7 +25,7 @@
 
 ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/UI/Common/GNUmakefile b/UI/Common/GNUmakefile
--- a/UI/Common/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/UI/Common/GNUmakefile	2014-11-24 11:13:33.052052940 +0100
@@ -33,7 +33,7 @@
 
 ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/UI/Contacts/GNUmakefile b/UI/Contacts/GNUmakefile
--- a/UI/Contacts/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/UI/Contacts/GNUmakefile	2014-11-24 11:24:28.095818807 +0100
@@ -38,7 +38,7 @@
 
 ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/UI/MailerUI/GNUmakefile b/UI/MailerUI/GNUmakefile
--- a/UI/MailerUI/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/UI/MailerUI/GNUmakefile	2014-11-24 11:12:26.531973345 +0100
@@ -46,7 +46,7 @@
 
 ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/ -L../MailPartViewers/obj/
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/UI/MailPartViewers/GNUmakefile b/UI/MailPartViewers/GNUmakefile
--- a/UI/MailPartViewers/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/UI/MailPartViewers/GNUmakefile	2014-11-24 11:13:20.852038369 +0100
@@ -37,7 +37,7 @@
 
 ADDITIONAL_INCLUDE_DIRS += $(shell xml2-config --cflags)
 ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/ -L../../SoObjects/Mailer/obj -L../../SoObjects/Appointments/obj
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/UI/MainUI/GNUmakefile b/UI/MainUI/GNUmakefile
--- a/UI/MainUI/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/UI/MainUI/GNUmakefile	2014-11-24 11:13:07.420022312 +0100
@@ -32,7 +32,7 @@
 
 ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/UI/PreferencesUI/GNUmakefile b/UI/PreferencesUI/GNUmakefile
--- a/UI/PreferencesUI/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/UI/PreferencesUI/GNUmakefile	2014-11-24 11:24:55.503850184 +0100
@@ -28,7 +28,7 @@
 
 ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/UI/Scheduler/GNUmakefile b/UI/Scheduler/GNUmakefile
--- a/UI/Scheduler/GNUmakefile	2014-11-21 15:27:20.000000000 +0100
+++ b/UI/Scheduler/GNUmakefile	2014-11-24 11:12:41.851991707 +0100
@@ -72,7 +72,7 @@
 
 ADDITIONAL_INCLUDE_DIRS += -I../../SOPE/
 ADDITIONAL_LIB_DIRS += -L../../SOPE/GDLContentStore/obj/
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 -include GNUmakefile.preamble
 include $(GNUSTEP_MAKEFILES)/bundle.make
diff -uNr a/UI/SOGoUI/GNUmakefile b/UI/SOGoUI/GNUmakefile
--- a/UI/SOGoUI/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/UI/SOGoUI/GNUmakefile	2014-11-24 11:12:54.532006892 +0100
@@ -11,7 +11,7 @@
 libSOGoUI_HEADER_FILES_INSTALL_DIR = /SOGoUI
 libSOGoUI_INTERFACE_VERSION	   = $(MAJOR_VERSION).$(MINOR_VERSION)
 
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
 
 libSOGoUI_HEADER_FILES +=	\
 	\
rpath_libdir.patch (6,317 bytes)   
smarth

smarth

2014-11-24 08:39

reporter  

rpath3.patch (2,358 bytes)   
diff -uNr a/ActiveSync/common.make b/ActiveSync/common.make
--- a/ActiveSync/common.make	2014-11-21 15:27:17.000000000 +0100
+++ b/ActiveSync/common.make	2014-11-24 11:58:42.005532616 +0100
@@ -20,7 +20,7 @@
 	-L../SoObjects/SOGo/$(GNUSTEP_OBJ_DIR)/ \
 	-L../SOPE/NGCards/$(GNUSTEP_OBJ_DIR)/ \
         -L/usr/local/lib \
-	-Wl,-rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
+	-Wl,-rpath,$(SOGO_SYSLIBDIR)/sogo
 
 BUNDLE_LIBS += \
 	-lSOGo					\
diff -uNr a/configure b/configure
--- a/configure	2014-11-21 15:27:20.000000000 +0100
+++ b/configure	2014-11-24 11:53:37.441128345 +0100
@@ -270,7 +270,7 @@
   fi
 
   cfgwrite "HOSTNAME=${HOSTNAME}"
-  cfgwrite "SOGO_SYSLIBDIR=\${GNUSTEP_LIBRARIES}"
+  cfgwrite "SOGO_SYSLIBDIR=\${GNUSTEP_SYSTEM_LIBRARIES}"
   cfgwrite "SOGO_LIBDIR=\${GNUSTEP_LIBRARY}/SOGo"
   cfgwrite "SOGO_TEMPLATESDIR=\${SOGO_LIBDIR}/Templates"
   cfgwrite "SOGO_WEBSERVERRESOURCESDIR=\${SOGO_LIBDIR}/WebServerResources"
diff -uNr a/Main/GNUmakefile b/Main/GNUmakefile
--- a/Main/GNUmakefile	2014-11-21 15:27:18.000000000 +0100
+++ b/Main/GNUmakefile	2014-11-24 11:59:05.588563673 +0100
@@ -6,7 +6,7 @@
 
 ADDITIONAL_OBJCFLAGS += -fPIE
 ADDITIONAL_INCLUDE_DIRS +=
-ADDITIONAL_LDFLAGS += -Wl,--no-as-needed -fPIE -pie -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--no-as-needed -fPIE -pie -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
 
 SOGOD     = sogod
 TOOL_NAME = $(SOGOD)
diff -uNr a/Tests/Integration/GNUmakefile.preamble b/Tests/Integration/GNUmakefile.preamble
--- a/Tests/Integration/GNUmakefile.preamble	2014-11-21 15:27:19.000000000 +0100
+++ b/Tests/Integration/GNUmakefile.preamble	2014-11-24 11:59:26.644591373 +0100
@@ -16,4 +16,4 @@
 	-L/usr/local/lib/sogo -L/usr/lib/sogo -L/usr/lib64/sogo -lEOControl -lNGStreams -lNGMime -lNGExtensions
 
 
-ADDITIONAL_LDFLAGS += -Wl,--no-as-needed -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--no-as-needed -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
diff -uNr a/Tools/GNUmakefile b/Tools/GNUmakefile
--- a/Tools/GNUmakefile	2014-11-21 15:27:19.000000000 +0100
+++ b/Tools/GNUmakefile	2014-11-24 11:58:01.317478951 +0100
@@ -4,7 +4,7 @@
 include $(GNUSTEP_MAKEFILES)/common.make
 include ../Version
 
-ADDITIONAL_LDFLAGS += -Wl,--rpath,$(GNUSTEP_SYSTEM_LIBRARIES)/sogo
+ADDITIONAL_LDFLAGS += -Wl,--rpath,$(SOGO_SYSLIBDIR)/sogo
 
 ###
 SOGO_TOOL = sogo-tool
rpath3.patch (2,358 bytes)   
ludovic

ludovic

2014-12-16 13:26

administrator   ~0007852

Patch pushed with slight modification:

https://github.com/inverse-inc/sogo/commit/68655deabd942718c318feeb29e407a4c5b499c2

https://github.com/inverse-inc/sogo/commit/bfaaf6eb3436cbfca5e8ede5963cd53012eff92a

Issue History

Date Modified Username Field Change
2014-11-24 08:38 smarth New Issue
2014-11-24 08:38 smarth File Added: rpath_libdir.patch
2014-11-24 08:39 smarth File Added: rpath3.patch
2014-12-04 14:26 ludovic Target Version => 2.2.11
2014-12-09 08:57 ludovic Target Version 2.2.11 => 2.2.12
2014-12-16 13:26 ludovic Note Added: 0007852
2014-12-16 13:26 ludovic Status new => resolved
2014-12-16 13:26 ludovic Fixed in Version => 2.2.12
2014-12-16 13:26 ludovic Resolution open => fixed
2014-12-16 13:26 ludovic Assigned To => ludovic