Description: pass CPPFLAGS to compile flags for server And then the build fails with an unused-return-value error. So let's handle setgid/setuid results. Origin: vendor Forwarded: no Author: gregor herrmann Last-Update: 2014-06-24 --- a/inc/My/Builder.pm +++ b/inc/My/Builder.pm @@ -127,6 +127,7 @@ '-I' . $server_directory, # does not seem to be necessary $cbuilder->split_like_shell(`pkg-config glib-2.0 --cflags`), $cbuilder->split_like_shell(`pkg-config glib-2.0 --libs`), + $cbuilder->split_like_shell($ENV{CPPFLAGS}), ], ); } --- a/server/tools.c +++ b/server/tools.c @@ -261,8 +261,12 @@ if (user_to_switch != NULL) { struct passwd* user = getpwnam(user_to_switch); if (user) { - setgid(user->pw_gid); - setuid(user->pw_uid); + if (setgid(user->pw_gid) < 0) { + l3(OUTPUT_TYPE_ERROR, "Cannot set gid to %u for user %s: %s", (unsigned)user->pw_gid, user_to_switch, strerror(errno)); + } + if (setuid(user->pw_uid) < 0) { + l3(OUTPUT_TYPE_ERROR, "Cannot set uid to %u for user %s: %s", (unsigned)user->pw_uid, user_to_switch, strerror(errno)); + } } else { l2(OUTPUT_TYPE_ERROR, "Cannot switch user to %s: %s", user_to_switch, strerror(errno)); }