2009-07-20 16:03:35 +0200, Nicolas François:
[...]
> login is the easiest, su is more complex because the behavior of
> "su -c <command>" must be defined in this case. So I will just make it as
> "/bin/sh <shell> -c <command>"
[..]
> +     if (access (file, R_OK|X_OK) == 0) {
> +             /*
> +              * Assume this is a shell script (with no shebang).
> +              * Interpret it with /bin/sh
> +              */
> +             execle ("/bin/sh", "sh", file, (char *)0, envp);
[...]

There should be a macro that defines the PATH to "sh". On some
systems (like Solaris), the standard sh is not in /bin. And you
might find that some will have several "sh", one for every
standard or version of standard they conform to, and that being
defined either at compile time or run time.

Using execvp() would make sure you do the same choice of a shell
as the libc and would avoid potential problems in future
hypothetical versions of debian that support several standards.

You may want to do:

execle ("/bin/sh", "sh", "-", file, (char *)0, envp);

regards,
Stephane



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to