Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
package-helpers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eliab Andi Artz
package-helpers
Commits
6b5ae172
Commit
6b5ae172
authored
2 years ago
by
Luis Guzmán
Browse files
Options
Downloads
Patches
Plain Diff
accountsservice: enable users with low uid to be configured as non-systemusers
parent
56bfb431
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
helpers/DATA/accountsservice/daemon_Allow_SystemAccount-false_to_be_set_in_cache_file.patch
+70
-0
70 additions, 0 deletions
...n_Allow_SystemAccount-false_to_be_set_in_cache_file.patch
helpers/make-accountsservice
+29
-0
29 additions, 0 deletions
helpers/make-accountsservice
with
99 additions
and
0 deletions
helpers/DATA/accountsservice/daemon_Allow_SystemAccount-false_to_be_set_in_cache_file.patch
0 → 100644
+
70
−
0
View file @
6b5ae172
From 985aed055313f968003c2515087974b2b934cf83 Mon Sep 17 00:00:00 2001
From: Ray Strode <rstrode@redhat.com>
Date: Wed, 8 Sep 2021 16:38:17 -0400
Subject: [PATCH] daemon: Allow SystemAccount=false to be set in cache file
At the moment we do dodgy checks based on uid to decide whether or not
an account is a system account.
For legacy reasons, sometimes normal users have really low UIDs.
This commit reshuffles things, so the cache file "wins" for deciding
whether or not a user is a system user.
---
src/daemon.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/daemon.c b/src/daemon.c
index 122b652..1760ef2 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -247,6 +247,14 @@
entry_generator_fgetpwent (Daemon *daemon,
if (shadow_entry_buffers != NULL) {
*spent = &shadow_entry_buffers->spbuf;
}
+
+ /* Skip system users... */
+ if (!user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, (*spent)? (*spent)->sp_pwdp : NULL)) {
+ g_debug ("skipping user: %s", pwent->pw_name);
+
+ return entry_generator_fgetpwent (daemon, users, state, spent);
+ }
+
return pwent;
}
}
@@ -401,12 +409,6 @@
load_entries (Daemon *daemon,
if (pwent == NULL)
break;
- /* Skip system users... */
- if (!explicitly_requested && !user_classify_is_human (pwent->pw_uid, pwent->pw_name, pwent->pw_shell, spent? spent->sp_pwdp : NULL)) {
- g_debug ("skipping user: %s", pwent->pw_name);
- continue;
- }
-
/* Only process users that haven't been processed yet.
* We do always make sure entries get promoted
* to "cached" status if they are supposed to be
@@ -990,7 +992,6 @@
finish_list_cached_users (ListUserData *data)
GHashTableIter iter;
gpointer key, value;
uid_t uid;
- const gchar *shell;
object_paths = g_ptr_array_new ();
@@ -1000,9 +1001,8 @@
finish_list_cached_users (ListUserData *data)
User *user = value;
uid = user_get_uid (user);
- shell = user_get_shell (user);
- if (!user_classify_is_human (uid, name, shell, NULL)) {
+ if (user_get_system_account (user)) {
g_debug ("user %s %ld excluded", name, (long) uid);
continue;
}
--
GitLab
This diff is collapsed.
Click to expand it.
helpers/make-accountsservice
0 → 100644
+
29
−
0
View file @
6b5ae172
#!/bin/sh
#
# Copyright (C) 2022 Alexandre Oliva <oliva@gnu.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
VERSION
=
1
.
./config
#Patch to enable users with low uid to be configured as non-systemusers.
patch
-p1
<
$DATA
/daemon_Allow_SystemAccount-false_to_be_set_in_cache_file.patch
changelog
"Enable users with low uid to be configured as non-systemusers."
compile
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment