raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8b95b78dee42bf1f10ff48c9be4c34e5db8e6581
commit 8b95b78dee42bf1f10ff48c9be4c34e5db8e6581 Author: Bryce Harrington <br...@osg.samsung.com> Date: Thu Apr 13 16:41:02 2017 +0900 efl vpath: Check and terminate execution if set*uid() calls fail Summary: Quells warnings: lib/efl/interfaces/efl_vpath_core.c:117:9: warning: ignoring return value of ‘setuid’, declared with attribute warn_unused_result [-Wunused-result] setuid(geteuid()); ^ lib/efl/interfaces/efl_vpath_core.c:169:9: warning: ignoring return value of ‘setreuid’, declared with attribute warn_unused_result [-Wunused-result] setreuid(uid, geteuid()); ^ Reviewers: raster, jpeg Reviewed By: raster Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4768 --- src/lib/efl/interfaces/efl_vpath_core.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/efl/interfaces/efl_vpath_core.c b/src/lib/efl/interfaces/efl_vpath_core.c index f3bff42..d6b1363 100644 --- a/src/lib/efl/interfaces/efl_vpath_core.c +++ b/src/lib/efl/interfaces/efl_vpath_core.c @@ -114,7 +114,13 @@ _efl_vpath_core_efl_object_constructor(Eo *obj, Efl_Vpath_Core_Data *pd) #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) uid = getuid(); - setuid(geteuid()); + if (setuid(geteuid()) != 0) + { + fprintf(stderr, + "FATAL: Cannot setuid - errno=%i\n", + errno); + abort(); + } #endif // fallback - make ~/.run snprintf(buf, sizeof(buf), "%s/.run", home); @@ -166,7 +172,13 @@ _efl_vpath_core_efl_object_constructor(Eo *obj, Efl_Vpath_Core_Data *pd) } } #if defined(HAVE_GETUID) && defined(HAVE_GETEUID) - setreuid(uid, geteuid()); + if (setreuid(uid, geteuid()) != 0) + { + fprintf(stderr, + "FATAL: Cannot setreuid - errno=%i\n", + errno); + abort(); + }; #endif } if (!s) s = (char *)efl_vpath_core_meta_get(obj, "tmp"); --