]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: disable is_vmware_platform() for non-root users
authorKarel Zak <kzak@redhat.com>
Thu, 3 Nov 2016 09:53:09 +0000 (10:53 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 3 Nov 2016 09:53:09 +0000 (10:53 +0100)
References: http://www.spinics.net/lists/util-linux-ng/msg13302.html
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/lscpu.c

index 52a944d3a99c8ce9c9d1fd9ac241580b8585e0af..bd702b0ae13f5a9699365e125546e06e2c2a8493 100644 (file)
@@ -861,6 +861,15 @@ is_vmware_platform(void)
        uint32_t eax, ebx, ecx, edx;
        struct sigaction act, oact;
 
+       /*
+        * FIXME: Not reliable for non-root users. Note it works as expected if
+        * vmware_bdoor() is not optimized for PIE, but then it fails to build
+        * on 32bit x86 systems. See lscpu git log for more details (commit
+        * 7845b91dbc7690064a2be6df690e4aaba728fb04).     kzak [3-Nov-2016]
+        */
+       if (getuid() != 0)
+               return 0;
+
        /*
         * The assembly routine for vmware detection works
         * fine under vmware, even if ran as regular user. But