Consistently call userdel -f

This commit is contained in:
Matthias Clasen 2014-01-10 13:05:20 -05:00
parent 8b27c78fe2
commit 3a7a6b05de
2 changed files with 38 additions and 1 deletions

View File

@ -2,7 +2,7 @@
Name: accountsservice
Version: 0.6.35
Release: 3%{?dist}
Release: 4%{?dist}
Summary: D-Bus interfaces for querying and manipulating user account information
Group: System Environment/Daemons
@ -28,6 +28,7 @@ Requires(preun): systemd-units
Requires(postun): systemd-units
Patch0: fix-user-classification.patch
Patch1: userdel-f.patch
%package libs
Summary: Client-side library to talk to accountsservice
@ -59,6 +60,7 @@ of these interfaces, based on the useradd, usermod and userdel commands.
%prep
%setup -q
%patch0 -p1 -b .fix-user-classification
%patch1 -p1 -b .userdel-f
%build
%configure --enable-user-heuristics
@ -112,6 +114,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/*.a
%{_datadir}/gtk-doc/html/libaccountsservice/*
%changelog
* Fri Jan 10 2014 Matthias Clasen <mclasen@redhat.com> - 0.6.35-4
- Consistently call userdel with -f
* Wed Nov 20 2013 Ray Strode <rstrode@redhat.com> 0.6.35-3
- Only treat users < 1000 as system users
- only use user heuristics on the range 500-1000

32
userdel-f.patch Normal file
View File

@ -0,0 +1,32 @@
From 77e2d73723aaef376d97597a61328619b8a204c3 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 10 Jan 2014 12:38:55 -0500
Subject: [PATCH] Call userdel consistently
When deleting the users files, we use -f, otherwise we don't. This
leads to inconsistent behaviour. Always pass -f.
---
src/daemon.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/daemon.c b/src/daemon.c
index b2720f4..cb36f01 100644
--- a/src/daemon.c
+++ b/src/daemon.c
@@ -1289,9 +1289,10 @@ daemon_delete_user_authorized_cb (Daemon *daemon,
argv[5] = NULL;
}
else {
- argv[1] = "--";
- argv[2] = pwent->pw_name;
- argv[3] = NULL;
+ argv[1] = "-f";
+ argv[2] = "--";
+ argv[3] = pwent->pw_name;
+ argv[4] = NULL;
}
error = NULL;
--
1.8.4.2