*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.134 2002/03/29 18:59:31 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.135 2002/05/16 22:09:59 stevesk Exp $");
#include "ssh.h"
#include "ssh1.h"
* needed for loading shared libraries. So the path better
* remains intact here.
*/
+# ifdef SUPERUSER_PATH
+ child_set_env(&env, &envsize, "PATH",
+ s->pw->pw_uid == 0 ? SUPERUSER_PATH : _PATH_STDPATH);
+# else
child_set_env(&env, &envsize, "PATH", _PATH_STDPATH);
+# endif /* SUPERUSER_PATH */
# endif /* HAVE_CYGWIN */
#endif /* HAVE_LOGIN_CAP */
/* Add authority data to .Xauthority if appropriate. */
if (debug_flag) {
fprintf(stderr,
- "Running %.100s add "
+ "Running %.500s add "
"%.100s %.100s %.100s\n",
options.xauth_location, s->auth_display,
s->auth_proto, s->auth_data);
{
/* Launch login(1). */
- execl("/usr/bin/login", "login", "-h", hostname,
+ execl(LOGIN_PROGRAM, "login", "-h", hostname,
#ifdef xxxLOGIN_NEEDS_TERM
- (s->term ? s->term : "unknown"),
+ (s->term ? s->term : "unknown"),
#endif /* LOGIN_NEEDS_TERM */
+#ifdef LOGIN_NO_ENDOPT
+ "-p", "-f", pw->pw_name, (char *)NULL);
+#else
"-p", "-f", "--", pw->pw_name, (char *)NULL);
+#endif
/* Login couldn't be executed, die. */