[systemd-commits] 3 commits - TODO man/sysusers.d.xml src/sysusers
Lennart Poettering
lennart at kemper.freedesktop.org
Wed Jul 9 10:24:19 PDT 2014
TODO | 2 ++
man/sysusers.d.xml | 2 +-
src/sysusers/sysusers.c | 10 +++++++++-
3 files changed, 12 insertions(+), 2 deletions(-)
New commits:
commit 38c74dad1c3d605018e61074e0b80f6b9523b1c8
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Jul 9 19:21:42 2014 +0200
sysusers: don't allow control characters in gecos fields
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index 40a6697..129493a 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -1107,7 +1107,11 @@ static bool valid_gecos(const char *d) {
if (!utf8_is_valid(d))
return false;
- if (strpbrk(d, ":\n"))
+ if (string_has_cc(d, NULL))
+ return false;
+
+ /* Colons are used as field separators, and hence not OK */
+ if (strchr(d, ':'))
return false;
return true;
commit 932ad62b84165b0acf690ea34c4b8083657ae244
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Jul 9 19:20:58 2014 +0200
sysusers: don't allow user names longer than UT_NAMESIZE
As pointed out by Miloslav TrmaÄ it might be a good idea to make sure
that usernames stay with in the utmp-defined limits.
diff --git a/man/sysusers.d.xml b/man/sysusers.d.xml
index 549b3f6..40f8715 100644
--- a/man/sysusers.d.xml
+++ b/man/sysusers.d.xml
@@ -142,7 +142,7 @@ m authd input</programlisting>
<title>Name</title>
<para>The name field specifies the user or
- group name. It should be be shorter than 256
+ group name. It should be be shorter than 31
characters and avoid any non-ASCII characters,
and not begin with a numeric character. It is
strongly recommended to pick user and group
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index 1765f31..40a6697 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -24,6 +24,7 @@
#include <grp.h>
#include <shadow.h>
#include <getopt.h>
+#include <utmp.h>
#include "util.h"
#include "hashmap.h"
@@ -1095,6 +1096,9 @@ static bool valid_user_group_name(const char *u) {
if ((size_t) (i-u) > (size_t) sz)
return false;
+ if ((size_t) (i-u) > UT_NAMESIZE - 1)
+ return false;
+
return true;
}
commit e2a69298819b58f008be61d314f8ab95ccaec427
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Jul 9 19:20:48 2014 +0200
update TODO
diff --git a/TODO b/TODO
index 857e2fd..8d6c83e 100644
--- a/TODO
+++ b/TODO
@@ -24,6 +24,8 @@ External:
Features:
+* Allow multiple ExecStart= for all Type= settings, so that we can cover rescue.service nicely
+
* the resolv.conf tmpfiles line should be covered by ENABLE_NETWORKD...
* sysusers: also create entries in /etc/shadow, /etc/gshadow
More information about the systemd-commits
mailing list