2018-04-19 11:12:27 +02:00
|
|
|
From 31d931be66ef9ebf0aeb8e1dffa33e3280bfe732 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Bin Liu <bliu@suse.com>
|
|
|
|
Date: Tue, 17 Apr 2018 17:06:20 +0800
|
|
|
|
Subject: [PATCH] do not convert empty uid gid to 0
|
|
|
|
|
|
|
|
---
|
|
|
|
exec/coroparse.c | 12 ++++++++++++
|
|
|
|
1 file changed, 12 insertions(+)
|
|
|
|
|
2017-11-06 10:28:09 +01:00
|
|
|
diff --git a/exec/coroparse.c b/exec/coroparse.c
|
2018-04-19 11:12:27 +02:00
|
|
|
index 96bb83a..da82d54 100644
|
2017-11-06 10:28:09 +01:00
|
|
|
--- a/exec/coroparse.c
|
|
|
|
+++ b/exec/coroparse.c
|
2017-11-21 04:17:50 +01:00
|
|
|
@@ -139,6 +139,12 @@ static int uid_determine (const char *req_user)
|
|
|
|
long int id;
|
2017-11-06 10:28:09 +01:00
|
|
|
char *ep;
|
|
|
|
|
2017-11-21 04:17:50 +01:00
|
|
|
+ if(*req_user == '\0') {
|
2018-04-19 11:12:27 +02:00
|
|
|
+ sprintf (error_string_response,
|
|
|
|
+ "The user can not be empty, please read the documentation.");
|
|
|
|
+ return (-1);
|
2017-11-21 04:17:50 +01:00
|
|
|
+ }
|
|
|
|
+
|
2017-11-06 10:28:09 +01:00
|
|
|
id = strtol(req_user, &ep, 10);
|
2018-04-19 11:12:27 +02:00
|
|
|
if (*req_user != '\0' && *ep == '\0' && id >= 0 && id <= UINT_MAX) {
|
2017-11-06 10:28:09 +01:00
|
|
|
return (id);
|
2017-11-21 04:17:50 +01:00
|
|
|
@@ -193,6 +199,12 @@ static int gid_determine (const char *req_group)
|
|
|
|
long int id;
|
2017-11-06 10:28:09 +01:00
|
|
|
char *ep;
|
|
|
|
|
2017-11-21 04:17:50 +01:00
|
|
|
+ if(*req_group == '\0') {
|
2018-04-19 11:12:27 +02:00
|
|
|
+ sprintf (error_string_response,
|
|
|
|
+ "The group can not be empty, please read the documentation.");
|
|
|
|
+ return (-1);
|
2017-11-21 04:17:50 +01:00
|
|
|
+ }
|
|
|
|
+
|
2017-11-06 10:28:09 +01:00
|
|
|
id = strtol(req_group, &ep, 10);
|
2018-04-19 11:12:27 +02:00
|
|
|
if (*req_group != '\0' && *ep == '\0' && id >= 0 && id <= UINT_MAX) {
|
2017-11-06 10:28:09 +01:00
|
|
|
return (id);
|
|
|
|
--
|
|
|
|
2.13.6
|
|
|
|
|