s/geteuid/getuid/ for correct user lookups
Addresses an issue mentioned in #193.
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user