[PATCH xserver 2/4] os: use PrivsElevated instead of a manual check

Nicolai Hähnle nhaehnle at gmail.com
Fri Jan 27 13:37:36 UTC 2017


From: Nicolai Hähnle <nicolai.haehnle at amd.com>

Signed-off-by: Nicolai Hähnle <nicolai.haehnle at amd.com>
---
 os/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/os/utils.c b/os/utils.c
index 024989e..05733b0 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1861,21 +1861,21 @@ enum BadCode {
 #endif
 
 void
 CheckUserParameters(int argc, char **argv, char **envp)
 {
     enum BadCode bad = NotBad;
     int i = 0, j;
     char *a, *e = NULL;
 
 #if CHECK_EUID
-    if (geteuid() == 0 && getuid() != geteuid())
+    if (PrivsElevated())
 #endif
     {
         /* Check each argv[] */
         for (i = 1; i < argc; i++) {
             if (strcmp(argv[i], "-fp") == 0) {
                 i++;            /* continue with next argument. skip the length check */
                 if (i >= argc)
                     break;
             }
             else {
-- 
2.7.4



More information about the xorg-devel mailing list