bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 4/5] exec: Remove #ifdef 0-out code for user specified exec serve


From: Justus Winter
Subject: [PATCH 4/5] exec: Remove #ifdef 0-out code for user specified exec servers.
Date: Thu, 15 Aug 2013 18:41:53 +0200

This code was meant to allow the user to specify alternative exec
servers using an environment variable. The Hurd uses the file system
as namespace for server lookups, so the proper way to use one's own
exec server seems to be the remap translator.

* exec/exec.c (S_exec_exec): Remove unused code.
---
 exec/exec.c |   81 -----------------------------------------------------------
 1 file changed, 81 deletions(-)

diff --git a/exec/exec.c b/exec/exec.c
index 48409c0..c02222b 100644
--- a/exec/exec.c
+++ b/exec/exec.c
@@ -1816,87 +1816,6 @@ S_exec_exec (struct trivfs_protid *protid,
   if (! protid)
     return EOPNOTSUPP;
 
-#if 0
-  if (!(flags & EXEC_SECURE))
-    {
-      char *list = envz_get (envp, envplen, "EXECSERVERS");
-
-      if (list)
-       {
-         int tried = 0;
-         list = strdupa (list);
-         while ((p = strsep (&list, ":")))
-           {
-             /* Open the named file using the appropriate directory ports for
-                the user.  */
-             error_t user_port (int which, error_t (*operate) (mach_port_t))
-               {
-                 return (*operate) (nports > which
-                                    ? portarray[which] : MACH_PORT_NULL);
-               }
-             file_t user_fd (int fd)
-               {
-                 if (fd < 0 || fd >= dtablesize ||
-                     dtable[fd] == MACH_PORT_NULL)
-                   {
-                     errno = EBADF;
-                     return MACH_PORT_NULL;
-                   }
-                 return dtable[fd];
-               }
-             file_t server;
-             if (!hurd_file_name_lookup (user_port, user_fd, 0, p, 0,0, 
&server))
-               {
-                 error_t err;
-                 struct trivfs_protid *protid
-                   = ports_lookup_port (port_bucket, server,
-                                        trivfs_protid_portclasses[0]);
-                 if (protid)
-                   {
-                     err = do_exec (file, oldtask, 0,
-                                    argv, argvlen, argv_copy,
-                                    envp, envplen, envp_copy,
-                                    dtable, dtablesize, dtable_copy,
-                                    portarray, nports, portarray_copy,
-                                    intarray, nints, intarray_copy,
-                                    deallocnames, ndeallocnames,
-                                    destroynames, ndestroynames);
-                     ports_port_deref (protid);
-                   }
-                 else
-                   {
-                     int n;
-                     err = exec_exec (server,
-                                      file, MACH_MSG_TYPE_COPY_SEND,
-                                      oldtask, 0,
-                                      argv, argvlen,
-                                      envp, envplen,
-                                      dtable, MACH_MSG_TYPE_COPY_SEND,
-                                      dtablesize,
-                                      portarray, MACH_MSG_TYPE_COPY_SEND,
-                                      nports,
-                                      intarray, nints,
-                                      deallocnames, ndeallocnames,
-                                      destroynames, ndestroynames);
-                     mach_port_deallocate (mach_task_self (), file);
-                     for (n = 0; n < dtablesize; n++)
-                       mach_port_deallocate (mach_task_self (), dtable[n]);
-                     for (n = 0; n < nports; n++)
-                       mach_port_deallocate (mach_task_self (), portarray[n]);
-                   }
-                 mach_port_deallocate (mach_task_self (), server);
-                 if (err != ENOEXEC)
-                   return err;
-                 tried = 1;
-               }
-           }
-         if (tried)
-           /* At least one exec server got a crack at it and gave up.  */
-           return ENOEXEC;
-       }
-    }
-#endif
-
   /* There were no user-specified exec servers,
      or none of them could be found.  */
 
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]