chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
pam_systemd: Properly check kdbus availability
[elogind.git]
/
src
/
login
/
pam_elogind.c
diff --git
a/src/login/pam_elogind.c
b/src/login/pam_elogind.c
index 3a4cb03f7493ba8e0e831678f289842b1b4b8eaf..6f941f836fbb23094d14b20682eff49ef782a0d1 100644
(file)
--- a/
src/login/pam_elogind.c
+++ b/
src/login/pam_elogind.c
@@
-42,6
+42,7
@@
#include "bus-error.h"
#include "formats-util.h"
#include "terminal-util.h"
#include "bus-error.h"
#include "formats-util.h"
#include "terminal-util.h"
+#include "hostname-util.h"
static int parse_argv(
pam_handle_t *handle,
static int parse_argv(
pam_handle_t *handle,
@@
-176,12
+177,11
@@
static int export_legacy_dbus_address(
uid_t uid,
const char *runtime) {
uid_t uid,
const char *runtime) {
-#ifdef ENABLE_KDBUS
_cleanup_free_ char *s = NULL;
int r;
/* skip export if kdbus is not active */
_cleanup_free_ char *s = NULL;
int r;
/* skip export if kdbus is not active */
- if (
access("/sys/fs/kdbus", F_OK) < 0
)
+ if (
!is_kdbus_available()
)
return PAM_SUCCESS;
if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0) {
return PAM_SUCCESS;
if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0) {
@@
-194,7
+194,7
@@
static int export_legacy_dbus_address(
pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
return r;
}
pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
return r;
}
-#endif
+
return PAM_SUCCESS;
}
return PAM_SUCCESS;
}
@@
-336,7
+336,7
@@
_public_ PAM_EXTERN int pam_sm_open_session(
/* If this fails vtnr will be 0, that's intended */
if (!isempty(cvtnr))
/* If this fails vtnr will be 0, that's intended */
if (!isempty(cvtnr))
- safe_atou32(cvtnr, &vtnr);
+
(void)
safe_atou32(cvtnr, &vtnr);
if (!isempty(display) && !vtnr) {
if (isempty(seat))
if (!isempty(display) && !vtnr) {
if (isempty(seat))