From 7ceaea95b1460361ac3424042acfcbde78105f8d Mon Sep 17 00:00:00 2001 From: xlei1030 Date: Mon, 11 Apr 2022 09:06:54 +0800 Subject: [PATCH] =?UTF-8?q?paramCheck=E4=B8=BAroot=E6=97=B6=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xlei1030 --- services/param/adapter/param_dac.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/param/adapter/param_dac.c b/services/param/adapter/param_dac.c index d55a8c29..f2c46a1e 100644 --- a/services/param/adapter/param_dac.c +++ b/services/param/adapter/param_dac.c @@ -230,7 +230,9 @@ static int CheckParamPermission(const ParamSecurityLabel *srcLabel, const ParamA int ret = DAC_RESULT_FORBIDED; PARAM_CHECK(srcLabel != NULL && auditData != NULL && auditData->name != NULL, return ret, "Invalid param"); PARAM_CHECK((mode & (DAC_READ | DAC_WRITE | DAC_WATCH)) != 0, return ret, "Invalid mode %x", mode); - + if (srcLabel->cred.uid = 0) { + return DAC_RESULT_PERMISSION; + } /** * DAC group 实现的label的定义 * user:group:read|write|watch -- GitLab