Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[xsrc/trunk]: xsrc/external/mit/MesaLib/dist/src Wherever we test for setuid, ...
details: https://anonhg.NetBSD.org/xsrc/rev/aee39b99dc69
branches: trunk
changeset: 10411:aee39b99dc69
user: maya <maya%NetBSD.org@localhost>
date: Thu Dec 05 17:41:10 2019 +0000
description:
Wherever we test for setuid, also test for setgid.
Inspired by a diff to openbsd but with a few more instances.
diffstat:
external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c | 2 +-
external/mit/MesaLib/dist/src/loader/loader.c | 4 ++--
external/mit/MesaLib/dist/src/mesa/main/context.c | 2 +-
external/mit/MesaLib/dist/src/util/disk_cache.c | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
diffs (57 lines):
diff -r 13026c576414 -r aee39b99dc69 external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c
--- a/external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c Sun Dec 01 20:21:21 2019 +0000
+++ b/external/mit/MesaLib/dist/src/intel/dev/gen_device_info.c Thu Dec 05 17:41:10 2019 +0000
@@ -83,7 +83,7 @@
int
gen_get_pci_device_id_override(void)
{
- if (geteuid() == getuid()) {
+ if (!issetugid()) {
const char *devid_override = getenv("INTEL_DEVID_OVERRIDE");
if (devid_override) {
const int id = gen_device_name_to_pci_device_id(devid_override);
diff -r 13026c576414 -r aee39b99dc69 external/mit/MesaLib/dist/src/loader/loader.c
--- a/external/mit/MesaLib/dist/src/loader/loader.c Sun Dec 01 20:21:21 2019 +0000
+++ b/external/mit/MesaLib/dist/src/loader/loader.c Thu Dec 05 17:41:10 2019 +0000
@@ -445,7 +445,7 @@
* user's problem, but this allows vc4 simulator to run on an i965 host,
* and may be useful for some touch testing of i915 on an i965 host.
*/
- if (geteuid() == getuid()) {
+ if (!issetugid()) {
driver = getenv("MESA_LOADER_DRIVER_OVERRIDE");
if (driver)
return strdup(driver);
@@ -533,7 +533,7 @@
const struct __DRIextensionRec **(*get_extensions)(void);
search_paths = NULL;
- if (geteuid() == getuid() && search_path_vars) {
+ if (!issetugid() && search_path_vars) {
for (int i = 0; search_path_vars[i] != NULL; i++) {
search_paths = getenv(search_path_vars[i]);
if (search_paths)
diff -r 13026c576414 -r aee39b99dc69 external/mit/MesaLib/dist/src/mesa/main/context.c
--- a/external/mit/MesaLib/dist/src/mesa/main/context.c Sun Dec 01 20:21:21 2019 +0000
+++ b/external/mit/MesaLib/dist/src/mesa/main/context.c Thu Dec 05 17:41:10 2019 +0000
@@ -1240,7 +1240,7 @@
*/
if (env_var_as_boolean("MESA_NO_ERROR", false)) {
#if !defined(_WIN32)
- if (geteuid() == getuid())
+ if (!issetugid())
#endif
ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
}
diff -r 13026c576414 -r aee39b99dc69 external/mit/MesaLib/dist/src/util/disk_cache.c
--- a/external/mit/MesaLib/dist/src/util/disk_cache.c Sun Dec 01 20:21:21 2019 +0000
+++ b/external/mit/MesaLib/dist/src/util/disk_cache.c Thu Dec 05 17:41:10 2019 +0000
@@ -212,7 +212,7 @@
size_t cv_size = sizeof(cache_version);
/* If running as a users other than the real user disable cache */
- if (geteuid() != getuid())
+ if (issetugid())
return NULL;
/* A ralloc context for transient data during this invocation. */
Home |
Main Index |
Thread Index |
Old Index