summaryrefslogtreecommitdiff
path: root/sysdeps/posix/spawni.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/posix/spawni.c')
-rw-r--r--sysdeps/posix/spawni.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/sysdeps/posix/spawni.c b/sysdeps/posix/spawni.c
index 27699f4df8..29803a8461 100644
--- a/sysdeps/posix/spawni.c
+++ b/sysdeps/posix/spawni.c
@@ -1,5 +1,5 @@
/* Guts of POSIX spawn interface. Generic POSIX.1 version.
- Copyright (C) 2000,2001,2002,2003,2004,2005 Free Software Foundation, Inc.
+ Copyright (C) 2000-2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -26,6 +26,7 @@
#include <unistd.h>
#include "spawn_int.h"
#include <not-cancel.h>
+#include <local-setxid.h>
/* The Unix standard contains a long explanation of the way to signal
@@ -155,7 +156,8 @@ __spawni (pid_t *pid, const char *file,
/* Set the effective user and group IDs. */
if ((flags & POSIX_SPAWN_RESETIDS) != 0
- && (seteuid (__getuid ()) != 0 || setegid (__getgid ()) != 0))
+ && (local_seteuid (__getuid ()) != 0
+ || local_setegid (__getgid ()) != 0))
_exit (SPAWN_ERROR);
/* Execute the file actions. */
@@ -177,9 +179,10 @@ __spawni (pid_t *pid, const char *file,
case spawn_do_open:
{
- int new_fd = __open64 (action->action.open_action.path,
- action->action.open_action.oflag,
- action->action.open_action.mode);
+ int new_fd = open_not_cancel (action->action.open_action.path,
+ action->action.open_action.oflag
+ | O_LARGEFILE,
+ action->action.open_action.mode);
if (new_fd == -1)
/* The `open' call failed. */
@@ -193,7 +196,7 @@ __spawni (pid_t *pid, const char *file,
/* The `dup2' call failed. */
_exit (SPAWN_ERROR);
- if (__close (new_fd) != 0)
+ if (close_not_cancel (new_fd) != 0)
/* The `close' call failed. */
_exit (SPAWN_ERROR);
}