aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/Pipe.cpp
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-04-27 13:54:56 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2016-04-27 13:54:56 +0200
commit416fc186b0c5d56e176cd2c2a263cf08a94f47f9 (patch)
treebcbcc29b01a86d2035e7397ded5b24b90c841645 /nxcomp/Pipe.cpp
parent12104a232a6de163f7e871be288ac933083c4226 (diff)
parenta436cba04834da945d4a2be5335d1d7e95c6bf08 (diff)
downloadnx-libs-416fc186b0c5d56e176cd2c2a263cf08a94f47f9.tar.gz
nx-libs-416fc186b0c5d56e176cd2c2a263cf08a94f47f9.tar.bz2
nx-libs-416fc186b0c5d56e176cd2c2a263cf08a94f47f9.zip
Merge branch 'fcarvajaldev-3.6.x-nxcomp-amend-compiler-warnings' into 3.6.x
Diffstat (limited to 'nxcomp/Pipe.cpp')
-rw-r--r--nxcomp/Pipe.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/nxcomp/Pipe.cpp b/nxcomp/Pipe.cpp
index aacbbaeb3..15c7a31b3 100644
--- a/nxcomp/Pipe.cpp
+++ b/nxcomp/Pipe.cpp
@@ -237,8 +237,14 @@ FILE *Popen(char * const parameters[], const char *type)
struct passwd *pwent = getpwuid(getuid());
if (pwent) initgroups(pwent->pw_name,getgid());
- setgid(getgid());
- setuid(getuid());
+ if (setgid(getgid()) == -1)
+ {
+ _exit(127);
+ }
+ if (setuid(getuid()) == -1)
+ {
+ _exit(127);
+ }
if (*type == 'r')
{