File kdm-fix-greeteruid.patch of Package kdebase4-workspace.3366
commit c44df47be1ddf69df381ff44595c2332c83fab60
Author: Raymond Wooninck <tittiatcoke@gmail.com>
Date: Sun May 5 15:29:53 2013 +0200
Unify the approach on how to create the GreeterUID and utilize useradd for this.
REVIEW: 110315
CCMAIL: ossi@kde.org
diff --git a/kdm/kfrontend/genkdmconf.c b/kdm/kfrontend/genkdmconf.c
index 69b42f1..05a19e7 100644
--- a/kdm/kfrontend/genkdmconf.c
+++ b/kdm/kfrontend/genkdmconf.c
@@ -2101,7 +2101,7 @@ static void
upd_greeteruid(Entry *ce, Section *cs ATTR_UNUSED)
{
struct passwd *pw;
- char *ok, *adduser;
+ char *ok, *useradd;
int uid;
if (use_destdir || !ce->active)
@@ -2109,11 +2109,10 @@ upd_greeteruid(Entry *ce, Section *cs ATTR_UNUSED)
if (!(pw = getpwnam(ce->value))) {
uid = strtol(ce->value, &ok, 10);
if (*ok || !(pw = getpwuid(uid))) {
- if (!access("/etc/debian_version", R_OK)
- && (adduser = locate("adduser"))) {
+ if ((useradd = locate("useradd"))) {
const char *args[] = {
- adduser, "--system", "--group",
- "--home", "/var", "--no-create-home",
+ useradd, "--system", "--user-group", "-s", "/bin/false",
+ "--home-dir", "/var/lib/kdm", "--no-create-home", "-c", "KDM Display Manager daemon",
ce->value, 0
};
if (runAndWait((char **)args)) {