Permalink
Browse files

If a platform allows hyphens before usernames, we need a -- passed to…

… /bin/login. (@EdSchouten in #219)
  • Loading branch information...
1 parent 46b7052 commit b26e5b200155625e5ee215eff9aa6722d18e96c1 @saurik committed Apr 19, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 src/frontend/mosh-server.cc
@@ -303,7 +303,7 @@ int run_server( const char *desired_ip, const char *desired_port,
}
/* Get shell */
- char *my_argv[ 6 ];
+ char *my_argv[ 7 ];
if ( !command ) {
const char *login = "/usr/bin/login";
if ( access( "/bin/login", X_OK ) == 0 ) {
@@ -334,8 +334,9 @@ int run_server( const char *desired_ip, const char *desired_port,
my_argv[ 1 ] = strdup( "-f" );
my_argv[ 2 ] = strdup( "-h" );
my_argv[ 3 ] = strdup( host );
- my_argv[ 4 ] = strdup( user );
- my_argv[ 5 ] = NULL;
+ my_argv[ 4 ] = strdup( "--" );
+ my_argv[ 5 ] = strdup( user );
+ my_argv[ 6 ] = NULL;
command = my_argv;
}

0 comments on commit b26e5b2

Please sign in to comment.