s/geteuid/getuid/ for correct user lookups
Addresses an issue mentioned in #193.
This commit is contained in:
@@ -124,7 +124,7 @@ int main( int argc, char *argv[] )
|
|||||||
/* get shell name */
|
/* get shell name */
|
||||||
my_argv[ 0 ] = getenv( "SHELL" );
|
my_argv[ 0 ] = getenv( "SHELL" );
|
||||||
if ( my_argv[ 0 ] == NULL || *my_argv[ 0 ] == '\0' ) {
|
if ( my_argv[ 0 ] == NULL || *my_argv[ 0 ] == '\0' ) {
|
||||||
struct passwd *pw = getpwuid( geteuid() );
|
struct passwd *pw = getpwuid( getuid() );
|
||||||
if ( pw == NULL ) {
|
if ( pw == NULL ) {
|
||||||
perror( "getpwuid" );
|
perror( "getpwuid" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
|
|||||||
@@ -282,7 +282,7 @@ int main( int argc, char *argv[] )
|
|||||||
/* get shell name */
|
/* get shell name */
|
||||||
const char *shell = getenv( "SHELL" );
|
const char *shell = getenv( "SHELL" );
|
||||||
if ( shell == NULL ) {
|
if ( shell == NULL ) {
|
||||||
struct passwd *pw = getpwuid( geteuid() );
|
struct passwd *pw = getpwuid( getuid() );
|
||||||
if ( pw == NULL ) {
|
if ( pw == NULL ) {
|
||||||
perror( "getpwuid" );
|
perror( "getpwuid" );
|
||||||
exit( 1 );
|
exit( 1 );
|
||||||
@@ -906,7 +906,7 @@ static void chdir_homedir( void )
|
|||||||
{
|
{
|
||||||
const char *home = getenv( "HOME" );
|
const char *home = getenv( "HOME" );
|
||||||
if ( home == NULL ) {
|
if ( home == NULL ) {
|
||||||
struct passwd *pw = getpwuid( geteuid() );
|
struct passwd *pw = getpwuid( getuid() );
|
||||||
if ( pw == NULL ) {
|
if ( pw == NULL ) {
|
||||||
perror( "getpwuid" );
|
perror( "getpwuid" );
|
||||||
return; /* non-fatal */
|
return; /* non-fatal */
|
||||||
@@ -941,7 +941,7 @@ static void warn_unattached( const string & ignore_entry )
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_UTMPX_H
|
#ifdef HAVE_UTMPX_H
|
||||||
/* get username */
|
/* get username */
|
||||||
const struct passwd *pw = getpwuid( geteuid() );
|
const struct passwd *pw = getpwuid( getuid() );
|
||||||
if ( pw == NULL ) {
|
if ( pw == NULL ) {
|
||||||
perror( "getpwuid" );
|
perror( "getpwuid" );
|
||||||
/* non-fatal */
|
/* non-fatal */
|
||||||
|
|||||||
Reference in New Issue
Block a user