diff --git a/src/examples/termemu.cc b/src/examples/termemu.cc index c8ae0da..17958bc 100644 --- a/src/examples/termemu.cc +++ b/src/examples/termemu.cc @@ -124,7 +124,7 @@ int main( int argc, char *argv[] ) /* get shell name */ my_argv[ 0 ] = getenv( "SHELL" ); if ( my_argv[ 0 ] == NULL || *my_argv[ 0 ] == '\0' ) { - struct passwd *pw = getpwuid( geteuid() ); + struct passwd *pw = getpwuid( getuid() ); if ( pw == NULL ) { perror( "getpwuid" ); exit( 1 ); diff --git a/src/frontend/mosh-server.cc b/src/frontend/mosh-server.cc index d5419ea..d040a18 100644 --- a/src/frontend/mosh-server.cc +++ b/src/frontend/mosh-server.cc @@ -282,7 +282,7 @@ int main( int argc, char *argv[] ) /* get shell name */ const char *shell = getenv( "SHELL" ); if ( shell == NULL ) { - struct passwd *pw = getpwuid( geteuid() ); + struct passwd *pw = getpwuid( getuid() ); if ( pw == NULL ) { perror( "getpwuid" ); exit( 1 ); @@ -906,7 +906,7 @@ static void chdir_homedir( void ) { const char *home = getenv( "HOME" ); if ( home == NULL ) { - struct passwd *pw = getpwuid( geteuid() ); + struct passwd *pw = getpwuid( getuid() ); if ( pw == NULL ) { perror( "getpwuid" ); return; /* non-fatal */ @@ -941,7 +941,7 @@ static void warn_unattached( const string & ignore_entry ) { #ifdef HAVE_UTMPX_H /* get username */ - const struct passwd *pw = getpwuid( geteuid() ); + const struct passwd *pw = getpwuid( getuid() ); if ( pw == NULL ) { perror( "getpwuid" ); /* non-fatal */