(file) Return to SystemUnix.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/SystemUnix.cpp between version 1.24 and 1.25

version 1.24, 2002/02/20 23:12:05 version 1.25, 2002/02/23 00:27:20
Line 55 
Line 55 
 #include <time.h> #include <time.h>
 #include <netdb.h> #include <netdb.h>
 #include <Pegasus/Common/Tracer.h> #include <Pegasus/Common/Tracer.h>
   #include <Pegasus/Common/Destroyer.h>
  
 #ifdef PEGASUS_PLATFORM_LINUX_IX86_GNU #ifdef PEGASUS_PLATFORM_LINUX_IX86_GNU
 #include <pwd.h> #include <pwd.h>
Line 340 
Line 341 
     return true;     return true;
 } }
  
 Boolean System::isPrivilegedUser()  Boolean System::isPrivilegedUser(const String userName)
   {
       //
       // Check if username has been passed
       //
       if ( userName != String::EMPTY )
       {
           //
           // Check if the given user is a privileged user
           //
           struct passwd   pwd;
           struct passwd   *result;
           char            pwdBuffer[1024];
   
           ArrayDestroyer<char> userName_(userName.allocateCString());
           if (getpwnam_r(userName_.getPointer(), &pwd, pwdBuffer, 1024, &result) == 0)
           {
               if ( pwd.pw_uid == 0 )
               {
                   return true;
               }
               return false;
           }
       }
       else
 { {
     //     //
     // Get the effective UID for the user     // Get the effective UID for the user
Line 351 
Line 376 
     }     }
     return true;     return true;
 } }
   }
  
 Uint32 System::getPID() Uint32 System::getPID()
 { {


Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2