Bug 255697

Summary: OpenBSD Compile failure in kdebase-runtime 4.4.5 kdesu/kdesud/secure.cpp [patch included]
Product: [Applications] kdesu Reporter: Onteria <onteria>
Component: generalAssignee: kdesu bugs tracker <kdesu-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: OpenBSD   
Latest Commit: Version Fixed In: 4.6.2
Attachments: Patch to make secure.cpp compile by using getpeereid
Patch to add the HAVE_GETPEEREID check to the cmake file

Description Onteria 2010-10-30 22:04:29 UTC
Version:           4.4 (using KDE 4.4.5) 
OS:                OpenBSD

secure.cpp checks against SO_PEERCRED define to see whether or not getsockopt is usable. Unfortunately while OpenBSD has a getsockopt and SO_PEERCRED defined, the ucred struct is different. 

It's actually better to utilise getpeereid.  Since the SO_PEERCRED define will be hit first, I've moved it below the HAVE_GETPEEREID check. Also I changed some of the #else #if branching to use #elif for easier readability.

Finally, the check for HAVE_GETPEEREID was added to the cmake build files.

Let me know if you have any questions/concerns regarding this patch.

Reproducible: Didn't try
Comment 1 Onteria 2010-10-30 22:05:21 UTC
Created attachment 52999 [details]
Patch to make secure.cpp compile by using getpeereid
Comment 2 Onteria 2010-10-30 22:06:19 UTC
Created attachment 53000 [details]
Patch to add the HAVE_GETPEEREID check to the cmake file
Comment 3 Onteria 2010-10-30 22:09:43 UTC
Specific build failure point:

/usr/obj/ports/kdebase-runtime-4.4.5/kdebase-runtime-4.4.5/kdesu/kdesud/secure.cpp: In constructor 'SocketSecurity::SocketSecurity(int)':
/usr/obj/ports/kdebase-runtime-4.4.5/kdebase-runtime-4.4.5/kdesu/kdesud/secure.cpp:37: error: 'ucred' was not declared in this scope 
/usr/obj/ports/kdebase-runtime-4.4.5/kdebase-runtime-4.4.5/kdesu/kdesud/secure.cpp:37: error: expected `;' before 'cred' 
/usr/obj/ports/kdebase-runtime-4.4.5/kdebase-runtime-4.4.5/kdesu/kdesud/secure.cpp:39: error: 'cred' was not declared in this scope
/usr/obj/ports/kdebase-runtime-4.4.5/kdebase-runtime-4.4.5/kdesu/kdesud/secure.cpp:43: error: 'cred' was not declared in this scope *** Error code 1
Comment 4 Oswald Buddenhagen 2010-11-07 00:09:00 UTC
related to bug 199320
Comment 5 Oswald Buddenhagen 2011-02-27 17:23:46 UTC
Git commit e405055d73bb02747a5b06a5669f1f1c491ec155 by Oswald Buddenhagen.
Committed on 27/02/2011 at 17:09.
Pushed by ossi into branch 'KDE/4.6'.

add peer identification on openbsd

BUG: 255697
FIXED-IN: 4.6.2

M  +0    -3    config-runtime.h.cmake     
M  +4    -0    kdesu/kdesud/CMakeLists.txt     
A  +4    -0    kdesu/kdesud/config-kdesud.h.cmake         [License: GENERATED FILE]  *
M  +14   -15   kdesu/kdesud/secure.cpp     

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/kde-runtime/e405055d73bb02747a5b06a5669f1f1c491ec155
Comment 6 Oswald Buddenhagen 2011-02-28 09:37:19 UTC
Git commit 8c95718b9e195e0f6071a34ba39b1bc69ce33894 by Oswald Buddenhagen.
Committed on 28/02/2011 at 09:30.
Pushed by ossi into branch 'KDE/4.6'.

actually include the new config header ...

CCBUG: 199320
CCBUG: 255697

M  +1    -0    kdesu/kdesud/secure.cpp     

http://commits.kde.org/kde-runtime/8c95718b9e195e0f6071a34ba39b1bc69ce33894