diff --git a/0005-do-not-convert-empty-uid-gid-to-0.patch b/0005-do-not-convert-empty-uid-gid-to-0.patch new file mode 100644 index 0000000..01e60a9 --- /dev/null +++ b/0005-do-not-convert-empty-uid-gid-to-0.patch @@ -0,0 +1,34 @@ +From 34e3accfcbf1d5dd08468f0e7a8aa6ceb0a7828e Mon Sep 17 00:00:00 2001 +From: Bin Liu +Date: Mon, 6 Nov 2017 16:59:30 +0800 +Subject: [PATCH] do not convert empty uid, gid to 0 + +--- + exec/coroparse.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/exec/coroparse.c b/exec/coroparse.c +index 374ed7dd..f27ead1a 100644 +--- a/exec/coroparse.c ++++ b/exec/coroparse.c +@@ -140,7 +140,7 @@ static int uid_determine (const char *req_user) + char *ep; + + id = strtol(req_user, &ep, 10); +- if (*ep == '\0' && id >= 0 && id <= UINT_MAX) { ++ if (*req_user != '\0' && *ep == '\0' && id >= 0 && id <= UINT_MAX) { + return (id); + } + +@@ -194,7 +194,7 @@ static int gid_determine (const char *req_group) + char *ep; + + id = strtol(req_group, &ep, 10); +- if (*ep == '\0' && id >= 0 && id <= UINT_MAX) { ++ if (*req_group != '\0' && *ep == '\0' && id >= 0 && id <= UINT_MAX) { + return (id); + } + +-- +2.13.6 + diff --git a/corosync.changes b/corosync.changes index 9d8b917..7e4f83c 100644 --- a/corosync.changes +++ b/corosync.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 6 09:14:55 UTC 2017 - bliu@suse.com + +- coroparse: uidgid with empty uid or gid results into add uid 0(bsc#1066585) + Added: 0005-do-not-convert-empty-uid-gid-to-0.patch + ------------------------------------------------------------------- Mon Oct 23 03:12:42 UTC 2017 - bliu@suse.com diff --git a/corosync.spec b/corosync.spec index 9354440..db2c39f 100644 --- a/corosync.spec +++ b/corosync.spec @@ -61,6 +61,7 @@ Patch8: 0001-coroapi-Use-size_t-for-private_data_size.patch Patch9: 0002-fix-ifdown-udp.patch Patch10: 0003-fix-tmpfiles-create.patch Patch11: 0004-mark-corosync-as-a-static-service.patch +Patch12: 0005-do-not-convert-empty-uid-gid-to-0.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build # openais is indeed gone and should be uninstalled. Yes, we do not @@ -137,6 +138,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build %patch9 -p1 %patch10 -p1 %patch11 -p1 +%patch12 -p1 %build %if %{with runautogen}