1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 00:51:24 +03:00

Merge pull request #7567 from yuwata/fix-nobody

nobody related fixes
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-12-07 11:07:02 +01:00 committed by GitHub
commit e97b7b5a9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View File

@ -680,9 +680,16 @@ if id_result.returncode() == 0
' Your build will result in an group table setup that is incompatible with the local system.') ' Your build will result in an group table setup that is incompatible with the local system.')
endif endif
endif endif
if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
message('WARNING:\n' +
' The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
' Please re-check that both "nobody-user" and "nobody-group" options are correctly set.')
endif
conf.set_quoted('NOBODY_USER_NAME', nobody_user) conf.set_quoted('NOBODY_USER_NAME', nobody_user)
conf.set_quoted('NOBODY_GROUP_NAME', nobody_group) conf.set_quoted('NOBODY_GROUP_NAME', nobody_group)
substs.set('NOBODY_USER_NAME', nobody_user)
substs.set('NOBODY_GROUP_NAME', nobody_group)
tty_gid = get_option('tty-gid') tty_gid = get_option('tty-gid')
conf.set('TTY_GID', tty_gid) conf.set('TTY_GID', tty_gid)

View File

@ -49,7 +49,7 @@ static void test_add_acls_for_user(void) {
assert_se(system(cmd) == 0); assert_se(system(cmd) == 0);
if (getuid() == 0) { if (getuid() == 0) {
const char *nobody = "nobody"; const char *nobody = NOBODY_USER_NAME;
r = get_user_creds(&nobody, &uid, NULL, NULL, NULL); r = get_user_creds(&nobody, &uid, NULL, NULL, NULL);
if (r < 0) if (r < 0)
uid = 0; uid = 0;

View File

@ -108,7 +108,7 @@ static int setup_tests(bool *run_ambient) {
struct passwd *nobody; struct passwd *nobody;
int r; int r;
nobody = getpwnam("nobody"); nobody = getpwnam(NOBODY_USER_NAME);
if (!nobody) { if (!nobody) {
log_error_errno(errno, "Could not find nobody user: %m"); log_error_errno(errno, "Could not find nobody user: %m");
return -EXIT_TEST_SKIP; return -EXIT_TEST_SKIP;

View File

@ -9,7 +9,7 @@
u root 0 "Super User" /root u root 0 "Super User" /root
# The nobody user for NFS file systems # The nobody user for NFS file systems
u nobody 65534 "Nobody" - u @NOBODY_USER_NAME@ 65534 "Nobody" -
# Administrator group: can *see* more than normal users # Administrator group: can *see* more than normal users
g adm - - - g adm - - -