chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fsckd: the error code is actually returned in 'fd'
[elogind.git]
/
src
/
login
/
pam_systemd.c
diff --git
a/src/login/pam_systemd.c
b/src/login/pam_systemd.c
index 262621d43fd3631eaa14b5d033d7be0f58217ac4..d7a708fd0a8e05ebb7c964ef5c80d0dad8c22bdc 100644
(file)
--- a/
src/login/pam_systemd.c
+++ b/
src/login/pam_systemd.c
@@
-24,7
+24,6
@@
#include <sys/file.h>
#include <pwd.h>
#include <endian.h>
#include <sys/file.h>
#include <pwd.h>
#include <endian.h>
-#include <sys/capability.h>
#include <security/pam_modules.h>
#include <security/_pam_macros.h>
#include <security/pam_modules.h>
#include <security/_pam_macros.h>
@@
-114,7
+113,7
@@
static int get_user_data(
}
*ret_pw = pw;
}
*ret_pw = pw;
- *ret_username = username
? username : pw->pw_name
;
+ *ret_username = username;
return PAM_SUCCESS;
}
return PAM_SUCCESS;
}
@@
-180,11
+179,10
@@
static int export_legacy_dbus_address(
int r;
/* skip export if kdbus is not active */
int r;
/* skip export if kdbus is not active */
- if (access("/
dev
/kdbus", F_OK) < 0)
+ if (access("/
sys/fs
/kdbus", F_OK) < 0)
return PAM_SUCCESS;
return PAM_SUCCESS;
- if (asprintf(&s, KERNEL_USER_BUS_FMT ";" UNIX_USER_BUS_FMT,
- uid, runtime) < 0) {
+ if (asprintf(&s, KERNEL_USER_BUS_ADDRESS_FMT ";" UNIX_USER_BUS_ADDRESS_FMT, uid, runtime) < 0) {
pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
return PAM_BUF_ERR;
}
pam_syslog(handle, LOG_ERR, "Failed to set bus variable.");
return PAM_BUF_ERR;
}
@@
-213,7
+211,7
@@
_public_ PAM_EXTERN int pam_sm_open_session(
*seat = NULL,
*type = NULL, *class = NULL,
*class_pam = NULL, *type_pam = NULL, *cvtnr = NULL, *desktop = NULL;
*seat = NULL,
*type = NULL, *class = NULL,
*class_pam = NULL, *type_pam = NULL, *cvtnr = NULL, *desktop = NULL;
- _cleanup_bus_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_
close_
unref_ sd_bus *bus = NULL;
int session_fd = -1, existing, r;
bool debug = false, remote;
struct passwd *pw;
int session_fd = -1, existing, r;
bool debug = false, remote;
struct passwd *pw;
@@
-346,7
+344,7
@@
_public_ PAM_EXTERN int pam_sm_open_session(
}
if (seat && !streq(seat, "seat0") && vtnr != 0) {
}
if (seat && !streq(seat, "seat0") && vtnr != 0) {
- pam_syslog(handle, LOG_DEBUG, "Ignoring vtnr %
d
for %s which is not seat0", vtnr, seat);
+ pam_syslog(handle, LOG_DEBUG, "Ignoring vtnr %
"PRIu32"
for %s which is not seat0", vtnr, seat);
vtnr = 0;
}
vtnr = 0;
}
@@
-357,9
+355,7
@@
_public_ PAM_EXTERN int pam_sm_open_session(
if (isempty(class))
class = streq(type, "unspecified") ? "background" : "user";
if (isempty(class))
class = streq(type, "unspecified") ? "background" : "user";
- remote = !isempty(remote_host) &&
- !streq_ptr(remote_host, "localhost") &&
- !streq_ptr(remote_host, "localhost.localdomain");
+ remote = !isempty(remote_host) && !is_localhost(remote_host);
/* Talk to logind over the message bus */
/* Talk to logind over the message bus */
@@
-371,7
+367,7
@@
_public_ PAM_EXTERN int pam_sm_open_session(
if (debug)
pam_syslog(handle, LOG_DEBUG, "Asking logind to create session: "
if (debug)
pam_syslog(handle, LOG_DEBUG, "Asking logind to create session: "
- "uid=
%u pid=%u service=%s type=%s class=%s desktop=%s seat=%s vtnr=%u
tty=%s display=%s remote=%s remote_user=%s remote_host=%s",
+ "uid=
"UID_FMT" pid="PID_FMT" service=%s type=%s class=%s desktop=%s seat=%s vtnr=%"PRIu32"
tty=%s display=%s remote=%s remote_user=%s remote_host=%s",
pw->pw_uid, getpid(),
strempty(service),
type, class, strempty(desktop),
pw->pw_uid, getpid(),
strempty(service),
type, class, strempty(desktop),
@@
-498,7
+494,7
@@
_public_ PAM_EXTERN int pam_sm_close_session(
int argc, const char **argv) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
int argc, const char **argv) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
- _cleanup_bus_unref_ sd_bus *bus = NULL;
+ _cleanup_bus_
close_
unref_ sd_bus *bus = NULL;
const void *existing = NULL;
const char *id;
int r;
const void *existing = NULL;
const char *id;
int r;