aboutsummaryrefslogtreecommitdiff
path: root/nxcomp/Pipe.cpp
diff options
context:
space:
mode:
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')
{