[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 12/16: Use the new _hurd_exec_file_name function
From: |
Samuel Thibault |
Subject: |
[hurd] 12/16: Use the new _hurd_exec_file_name function |
Date: |
Tue, 09 Jan 2018 01:35:30 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit f7c3556e627bd6ede22255defb55084d21e4dca6
Author: Emilio Pozuelo Monfort <address@hidden>
Date: Wed May 26 23:32:16 2010 +0200
Use the new _hurd_exec_file_name function
* configure.in: Check for _hurd_exec_paths.
* utils/fakeauth.c: Call _hurd_exec_paths instead of
_hurd_exec if it's available.
* utils/shd.c: Likewise.
* utils/rpctrace.c: Get prefixed_name from file_name_path_lookup and pass
it to
_hurd_exec_paths instead of calling _hurd_exec.
---
configure.ac | 2 +-
utils/fakeauth.c | 9 +++++++--
utils/rpctrace.c | 4 ++++
utils/shd.c | 9 ++++++---
4 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/configure.ac b/configure.ac
index 73cfa47..89107a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,7 +163,7 @@ else
fi
AC_SUBST(VERSIONING)
# Check if libc contains these functions.
-AC_CHECK_FUNCS(file_exec_paths exec_exec_paths)
+AC_CHECK_FUNCS(file_exec_paths exec_exec_paths _hurd_exec_paths)
# From glibc HEAD, 2007-11-07.
diff --git a/utils/fakeauth.c b/utils/fakeauth.c
index 5a349a8..264be22 100644
--- a/utils/fakeauth.c
+++ b/utils/fakeauth.c
@@ -1,5 +1,5 @@
/* fakeauth -- proxy auth server to lie to users about what their IDs are
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2010 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -397,7 +397,7 @@ believe it has restricted them to different identities or
no identity at all.\
/* We cannot use fork because it doesn't do the right thing with our send
rights that point to our own receive rights, i.e. the new auth port.
Since posix_spawn might be implemented with fork (prior to glibc 2.3),
- we cannot use that simple interface either. We use _hurd_exec
+ we cannot use that simple interface either. We use _hurd_exec_paths
directly to effect what posix_spawn does in the simple case. */
{
task_t newtask;
@@ -426,7 +426,12 @@ believe it has restricted them to different identities or
no identity at all.\
if (err)
error (3, err, "proc_child");
+#ifdef HAVE__HURD_EXEC_PATHS
+ err = _hurd_exec_paths (newtask, execfile, argv[argi], argv[argi],
+ &argv[argi], environ);
+#else
err = _hurd_exec (newtask, execfile, &argv[argi], environ);
+#endif
mach_port_deallocate (mach_task_self (), newtask);
mach_port_deallocate (mach_task_self (), execfile);
if (err)
diff --git a/utils/rpctrace.c b/utils/rpctrace.c
index 0aecfc4..1690ae1 100644
--- a/utils/rpctrace.c
+++ b/utils/rpctrace.c
@@ -1661,7 +1661,11 @@ traced_spawn (char **argv, char **envp)
/* Now actually run the command they told us to trace. We do the exec on
the actual task, so the RPCs to map in the program itself do not get
traced. Could have an option to use TASK_WRAPPER here instead. */
+#ifdef HAVE__HURD_EXEC_PATHS
+ err = _hurd_exec_paths (traced_task, file, *argv, *argv, argv, envp);
+#else
err = _hurd_exec (traced_task, file, argv, envp);
+#endif
if (err)
error (2, err, "cannot exec `%s'", argv[0]);
diff --git a/utils/shd.c b/utils/shd.c
index 09a4790..e978061 100644
--- a/utils/shd.c
+++ b/utils/shd.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1994,95,99,2002 Free Software Foundation
+ Copyright (C) 1994, 1995, 1999, 2002, 2010 Free Software Foundation
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -160,15 +160,18 @@ run (char **argv, int fd0, int fd1)
movefd (fd1, 1, &save1))
return -1;
+#ifdef HAVE__HURD_EXEC_PATHS
+ err = _hurd_exec_paths (task, file, program, program, argv, environ);
+#else
err = _hurd_exec (task, file, argv, environ);
-
+#endif
if (restorefd (fd0, 0, &save0) ||
restorefd (fd1, 1, &save1))
return -1;
if (err)
{
- error (0, err, "_hurd_exec");
+ error (0, err, "_hurd_exec_paths");
err = task_terminate (task);
if (err)
error (0, err, "task_terminate");
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (83fef6c -> 104f312), Samuel Thibault, 2018/01/08
- [hurd] 07/16: libfshelp/get-identity.c: Avoid spurious ihash removal, Samuel Thibault, 2018/01/08
- [hurd] 09/16: libfshelp/get-identity.c: Simplify checking weak references, Samuel Thibault, 2018/01/08
- [hurd] 06/16: libfshelp/get-identity: Use 64bit hashing for inodes, Samuel Thibault, 2018/01/08
- [hurd] 08/16: libihash: Make sure we do not remove a locp several times, Samuel Thibault, 2018/01/08
- [hurd] 02/16: Record executable entry for PIE core dumps, Samuel Thibault, 2018/01/08
- [hurd] 04/16: libfshelp: Add weak reference for hash table reference, Samuel Thibault, 2018/01/08
- [hurd] 13/16: rpctrace: Pass prefixed_name to _hurd_exec_paths., Samuel Thibault, 2018/01/08
- [hurd] 05/16: libfshelp/get-identity.c: add FIXME, Samuel Thibault, 2018/01/08
- [hurd] 01/16: Reserve IDs for proc_set_exe and proc_get_exe, Samuel Thibault, 2018/01/08
- [hurd] 12/16: Use the new _hurd_exec_file_name function,
Samuel Thibault <=
- [hurd] 16/16: Implement /proc/<pid>/exe, Samuel Thibault, 2018/01/08
- [hurd] 14/16: Fix exec_paths through fakeroot or chroot, Samuel Thibault, 2018/01/08
- [hurd] 10/16: Add a new exec_exec_paths RPC, Samuel Thibault, 2018/01/08
- [hurd] 15/16: Add support for $ORIGIN rpath expansion, Samuel Thibault, 2018/01/08
- [hurd] 11/16: Add a file_exec_file_name RPC, Samuel Thibault, 2018/01/08
- [hurd] 03/16: lwip: Add LwIP-based TCP/IP translator, Samuel Thibault, 2018/01/08