Bug 5285 - missing capget/capset detection leading to compile errors with libcap-2.x
missing capget/capset detection leading to compile errors with libcap-2.x
Status: RESOLVED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.28
Other Linux
: P3 normal
: none
Assigned To: Tim Potter
Samba QA Contact
:
: 5537 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-27 10:49 UTC by Tiziano Müller
Modified: 2008-06-11 15:57 UTC (History)
2 users (show)

See Also:


Attachments
3.0.28-libcap_detection.patch (1.64 KB, patch)
2008-02-27 10:50 UTC, Tiziano Müller
no flags Details
Different approach for fixing compilation problems (731 bytes, patch)
2008-04-22 02:47 UTC, Michal Soltys
no flags Details
move to portable capability functions (3-0-test) (2.90 KB, patch)
2008-05-28 06:34 UTC, Guenther Deschner
no flags Details
move to portable capability functions (3-2-test/3-3-test) (3.12 KB, patch)
2008-05-28 06:34 UTC, Guenther Deschner
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tiziano Müller 2008-02-27 10:49:28 UTC
The recent libcap-2.x versions actually define capget and capset without having to undefine _POSIX_SOURCE.
This leads to compile errors due to different signatures (static vs non-static defined capget/capset).

Therefore, configure should properly detect this.
Comment 1 Tiziano Müller 2008-02-27 10:50:28 UTC
Created attachment 3153 [details]
3.0.28-libcap_detection.patch

This patch adds the necessary check and the #ifdef ... #endif stuff.
Comment 2 Tiziano Müller 2008-03-08 05:24:40 UTC
samba-3.2_pre2 is also affected and doesn't build without the patch.
Comment 3 Volker Lendecke 2008-03-20 04:21:38 UTC
Applied your patch -- now it does not compile on my OpenSUSE 10.2 anymore.

Volker
Comment 4 Tiziano Müller 2008-03-20 04:53:56 UTC
hmm, strange. What's the error?
Comment 5 Michal Soltys 2008-04-22 02:47:53 UTC
Created attachment 3268 [details]
Different approach for fixing compilation problems

This patch:

- removes explicit declarations of capget/capset from oplock_linux.c
- removes struct definitions, relying on the definitions in linux/capabilities.h (also static is added, as they are not used outside oplock_linux.c)

Samba will compile fine both under libcap-1.x and libcap-2.x w/o any warnings.
Comment 6 Tiziano Müller 2008-04-22 04:19:02 UTC
Sure it will compile fine since linux/capabilities.h is provided by the kernel and not libcap. If they once differ you've got a problem and this is (from my understanding) not what's wanted.
Comment 7 Bartlomiej Solarz-Niesluchowski 2008-05-25 10:23:21 UTC
(In reply to comment #3)
> Applied your patch -- now it does not compile on my OpenSUSE 10.2 anymore.
> Volker

On FC9 with patch https://bugzilla.samba.org/attachment.cgi?id=3153 compiled successfully
Comment 8 Guenther Deschner 2008-05-28 06:17:17 UTC
We should move away from capget/capset and use the portable equivalents.
Comment 9 Guenther Deschner 2008-05-28 06:34:29 UTC
Created attachment 3314 [details]
move to portable capability functions (3-0-test)
Comment 10 Guenther Deschner 2008-05-28 06:34:54 UTC
Created attachment 3315 [details]
move to portable capability functions (3-2-test/3-3-test)
Comment 11 Guenther Deschner 2008-05-29 05:29:53 UTC
Ok, I checked in these patches for 3-0-test, 3-2-test and 3-3-test. Build should be fine everywhere now. Thanks for the report!
Comment 12 Guenther Deschner 2008-06-11 15:57:21 UTC
*** Bug 5537 has been marked as a duplicate of this bug. ***