Bug 255697 - OpenBSD Compile failure in kdebase-runtime 4.4.5 kdesu/kdesud/secure.cpp [patch included]
Summary: OpenBSD Compile failure in kdebase-runtime 4.4.5 kdesu/kdesud/secure.cpp [pat...
Status: RESOLVED FIXED
Alias: None
Product: kdesu
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources OpenBSD
: NOR normal
Target Milestone: ---
Assignee: kdesu bugs tracker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-30 22:04 UTC by Onteria
Modified: 2011-02-28 09:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 4.6.2


Attachments
Patch to make secure.cpp compile by using getpeereid (1.27 KB, patch)
2010-10-30 22:05 UTC, Onteria
Details
Patch to add the HAVE_GETPEEREID check to the cmake file (573 bytes, patch)
2010-10-30 22:06 UTC, Onteria
Details

Note You need to log in before you can comment on or make changes to this bug.
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