Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 38ff660b authored by Adriaan de Groot's avatar Adriaan de Groot 💬

Handle differences in PAM headers

Summary:
FreeBSD has neither pam_ext.h nor pam_syslog(), so check for headers
and add defines as appropriate.

Test Plan: Builds on FreeBSD, now. Needs a test-build on Linux.

Reviewers: jriddell, #plasma

Reviewed By: jriddell, #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6000
parent 340ed86d
......@@ -45,6 +45,19 @@ LIST(APPEND pam_kwallet_SRCS
)
endif()
# Handle different PAM header styles:
# - "Linux style" has pam_ext.h
# - "BSD style" has pam_appl.h
#
find_file(PAM_EXT_PATH security/pam_ext.h)
find_file(PAM_APPL_PATH security/pam_appl.h)
if (PAM_EXT_PATH)
add_definitions(-DHAVE_PAM_EXT)
endif()
if (PAM_APPL_PATH)
add_definitions(-DHAVE_PAM_APPL)
endif()
add_library (${library_name} SHARED ${pam_kwallet_SRCS})
set_target_properties (${library_name} PROPERTIES PREFIX "")
target_link_libraries (${library_name}
......
......@@ -31,17 +31,37 @@
#include <sys/stat.h>
#include <sys/syslog.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
/* PAM headers.
*
* There are three styles in play:
* - Apple, which has no pam_ext.h, does have pam_appl.h, does have pam_syslog
* - Linux, which has pam_ext.h, does have pam_appl.h, does have pam_syslog
* - BSD, which has no pam_ext.h, does have pam_appl.h, but no pam_syslog
* In the latter case, #define pam_syslog away.
*/
#ifdef __APPLE__
#include "pam_darwin.h"
#include <security/pam_appl.h>
#else
#include <security/pam_modules.h>
#ifdef HAVE_PAM_EXT
/* "Linux style" */
#include <security/pam_ext.h>
#include <security/_pam_types.h>
#endif
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#ifdef HAVE_PAM_APPL
/* "BSD style" .. see also __APPLE__, above */
#include <security/pam_appl.h>
#ifndef HAVE_PAM_EXT
/* FreeBSD has no pam_syslog(), va-macro it away */
#define pam_syslog(...)
#endif
#endif
#endif
#define KWALLET_PAM_KEYSIZE 56
#define KWALLET_PAM_SALTSIZE 56
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment