config_h.set10('HAVE_INPUT_SET_DEFAULT_PROPERTY', 1)
endif
+############ check setcure_getenv function ############
+
+if cc.has_header_symbol('stdlib.h', 'secure_getenv', prefix: prefix)
+ config_h.set('HAVE_SECURE_GETENV', 1)
+elif cc.has_header_symbol('stdlib.h', '__secure_getenv', prefix: prefix)
+ config_h.set('HAVE___SECURE_GETENV', 1)
+else
+ message('C library does not support secure_getenv, using getenv instead')
+endif
+
############ udev bits ############
if get_option('udev-enable')
}
if (udev_tags & EVDEV_UDEV_TAG_JOYSTICK) {
- env = getenv("LIBINPUT_IGNORE_JOYSTICK");
+ env = secure_getenv("LIBINPUT_IGNORE_JOYSTICK");
if (env && atoi(env) == 1) {
evdev_log_info(device,
"input device '%s' have joystick, ignoring\n",
if (value && !streq(value, "0")) return true;
// for TIZEN, add checking if joystick should be ignored or not.
- env = getenv("LIBINPUT_IGNORE_JOYSTICK");
+ env = secure_getenv("LIBINPUT_IGNORE_JOYSTICK");
if (env && atoi(env) == 1) {
value = udev_device_get_property_value(udev_device,
"ID_INPUT_JOYSTICK");
#define TRACE_INPUT_END()
#endif
+#if defined(HAVE_SECURE_GETENV)
+# define secure_getenv secure_getenv
+#elif defined(HAVE___SECURE_GETENV)
+# define secure_getenv __secure_getenv
+#else
+# define secure_getenv getenv
+#endif
+
struct libinput_source;
/* A coordinate pair in device coordinates */
bool
ignore_litest_test_suite_device(struct udev_device *device)
{
- if (!getenv("LIBINPUT_RUNNING_TEST_SUITE") &&
+ if (!secure_getenv("LIBINPUT_RUNNING_TEST_SUITE") &&
udev_device_get_property_value(device, "LIBINPUT_TEST_DEVICE"))
return true;