1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
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 <gregoa@debian.org>
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));
}
|