|
|
d06a0e |
From a2cbd1f7bf100d11c56b72952b782a37d4a3e9de Mon Sep 17 00:00:00 2001
|
|
|
d06a0e |
From: Ewald van Geffen <ewald@abcdef.be>
|
|
|
d06a0e |
Date: Fri, 12 Aug 2016 17:41:53 +0200
|
|
|
d06a0e |
Subject: [PATCH] config.c: fix parsing of 'su' directive
|
|
|
d06a0e |
|
|
|
d06a0e |
... to accept usernames starting with numeric symbols
|
|
|
d06a0e |
|
|
|
d06a0e |
Closes #53
|
|
|
d06a0e |
|
|
|
d06a0e |
Upstream-commit: 6c0dfc4a3d3b0535a4848d4ccb92631016a20a2d
|
|
|
d06a0e |
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
|
|
|
d06a0e |
---
|
|
|
d06a0e |
config.c | 7 ++++++-
|
|
|
d06a0e |
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
d06a0e |
|
|
|
d06a0e |
diff --git a/config.c b/config.c
|
|
|
d06a0e |
index 64bb935..5e7951e 100644
|
|
|
d06a0e |
--- a/config.c
|
|
|
d06a0e |
+++ b/config.c
|
|
|
d06a0e |
@@ -230,7 +230,12 @@ static int readModeUidGid(const char *configFile, int lineNum, char *key,
|
|
|
d06a0e |
struct group *group;
|
|
|
d06a0e |
struct passwd *pw = NULL;
|
|
|
d06a0e |
|
|
|
d06a0e |
- rc = sscanf(key, "%o %199s %199s%c", &m, u, g, &tmp);
|
|
|
d06a0e |
+ if (!strcmp("su", directive))
|
|
|
d06a0e |
+ /* do not read <mode> for the 'su' directive */
|
|
|
d06a0e |
+ rc = 0;
|
|
|
d06a0e |
+ else
|
|
|
d06a0e |
+ rc = sscanf(key, "%o %199s %199s%c", &m, u, g, &tmp);
|
|
|
d06a0e |
+
|
|
|
d06a0e |
/* We support 'key <owner> <group> notation now */
|
|
|
d06a0e |
if (rc == 0) {
|
|
|
d06a0e |
rc = sscanf(key, "%199s %199s%c", u, g, &tmp);
|
|
|
d06a0e |
--
|
|
|
d06a0e |
2.7.4
|
|
|
d06a0e |
|