(search_path): Function removed (was already #if 0'd out).
authorRoland McGrath <roland@redhat.com>
Tue, 21 Mar 1995 21:24:36 +0000 (21:24 +0000)
committerRoland McGrath <roland@redhat.com>
Tue, 21 Mar 1995 21:24:36 +0000 (21:24 +0000)
job.c

diff --git a/job.c b/job.c
index 8e979fc6129da4e27f8ba479b9e05bfaadda2c9e..b7daf2d0dcb29358a33c8b4c25fd36665925d4f6 100644 (file)
--- a/job.c
+++ b/job.c
@@ -1071,111 +1071,6 @@ child_execute_job (stdin_fd, stdout_fd, argv, envp)
   exec_command (argv, envp);
 }
 \f
-#if 0
-
-/* Default path to search for executables.  */
-static char default_path[] = ":/bin:/usr/bin";
-
-/* Search PATH for FILE.
-   If successful, store the full pathname in PROGRAM and return 1.
-   If not sucessful, return zero.  */
-
-static int
-search_path (file, path, program)
-     char *file, *path, *program;
-{
-  if (path == 0 || path[0] == '\0')
-    path = default_path;
-
-  if (
-#ifdef __MSDOS__
-      strpbrk (file, "/\\:")
-#else
-      index (file, '/') 
-#endif
-      != 0)
-    {
-      strcpy (program, file);
-      return 1;
-    }
-  else
-    {
-      unsigned int len;
-
-#ifdef HAVE_GETGROUPS
-#ifndef        HAVE_UNISTD_H
-      extern int getgroups ();
-#endif
-      static int ngroups = -1;
-#ifdef NGROUPS_MAX
-      static GETGROUPS_T groups[NGROUPS_MAX];
-#define        ngroups_max     NGROUPS_MAX
-#else
-      static GETGROUPS_T *groups = 0;
-      static int ngroups_max;
-      if (groups == 0)
-       {
-         ngroups_max = GET_NGROUPS_MAX;
-         groups = (GETGROUPS_T *) malloc (ngroups_max * sizeof (GETGROUPS_T));
-       }
-#endif
-      if (groups != 0 && ngroups == -1)
-       ngroups = getgroups (ngroups_max, groups);
-#endif /* Have getgroups.  */
-
-      len = strlen (file) + 1;
-      do
-       {
-         struct stat st;
-         int perm;
-         char *p;
-
-         p = index (path, PATH_SEPARATOR_CHAR);
-         if (p == 0)
-           p = path + strlen (path);
-
-         if (p == path)
-           bcopy (file, program, len);
-         else
-           {
-             bcopy (path, program, p - path);
-             program[p - path] = '/';
-             bcopy (file, program + (p - path) + 1, len);
-           }
-
-         if (safe_stat (program, &st) == 0
-             && S_ISREG (st.st_mode))
-           {
-             if (st.st_uid == geteuid ())
-               perm = (st.st_mode & 0100);
-             else if (st.st_gid == getegid ())
-               perm = (st.st_mode & 0010);
-             else
-               {
-#ifdef HAVE_GETGROUPS
-                 register int i;
-                 for (i = 0; i < ngroups; ++i)
-                   if (groups[i] == st.st_gid)
-                     break;
-                 if (i < ngroups)
-                   perm = (st.st_mode & 0010);
-                 else
-#endif /* Have getgroups.  */
-                   perm = (st.st_mode & 0001);
-               }
-
-             if (perm != 0)
-               return 1;
-           }
-
-         path = p + 1;
-       } while (*path != '\0');
-    }
-
-  return 0;
-}
-#endif /* search_path commented out */
-
 /* Replace the current process with one running the command in ARGV,
    with environment ENVP.  This function does not return.  */