VirtualBox

Changeset 24512 in vbox


Ignore:
Timestamp:
Nov 9, 2009 3:37:36 PM (15 years ago)
Author:
vboxsync
Message:

VBoxServiceVMInfo.cpp: r=bird: Added a todo about unwanted namefiltering.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r24506 r24512  
    192192
    193193#ifdef RT_OS_WINDOWS
    194  #ifndef TARGET_NT4
     194# ifndef TARGET_NT4
    195195        PLUID pSessions = NULL;
    196196        ULONG ulCount = 0;
     
    235235
    236236        ::LsaFreeReturnBuffer(pSessions);
    237  #endif /* TARGET_NT4 */
     237# endif /* TARGET_NT4 */
    238238#elif defined(RT_OS_FREEBSD)
    239239        /** @todo FreeBSD: Port logged on user info retrival. */
     
    241241        /** @todo OS/2: Port logged on (LAN/local/whatever) user info retrival. */
    242242#else
    243         utmp* ut_user;
    244243        rc = utmpname(UTMP_FILE);
    245  #ifdef RT_OS_SOLARIS
    246         if (rc == 0)
    247  #else
     244# ifdef RT_OS_SOLARIS
     245        if (rc != 1)
     246# else
    248247        if (rc != 0)
    249  #endif /* !RT_OS_SOLARIS */
     248# endif
    250249        {
    251250            VBoxServiceError("Could not set UTMP file! Error: %ld\n", errno);
    252251        }
    253252        setutent();
    254         while ((ut_user=getutent()))
     253        utmp *ut_user;
     254        while ((ut_user = getutent()))
    255255        {
    256256            /* Make sure we don't add user names which are not
    257257             * part of type USER_PROCESS and don't add same users twice. */
    258             if (   (ut_user->ut_type == USER_PROCESS)
    259                 && (strstr(szUserList, ut_user->ut_user) == NULL))
     258            if (   ut_user->ut_type == USER_PROCESS
     259                && strstr(szUserList, ut_user->ut_user) == NULL)
    260260            {
    261                 /** @todo Do we really want to filter out double user names? (Same user logged in twice) */
     261                /** @todo Do we really want to filter out double user names? (Same user logged in twice)
     262                 *  bird: If we do, then we must add checks for buffer overflows here!  */
     263                /** @todo r=bird: strstr will filtering out users with similar names. For
     264                 *        example: smith, smithson, joesmith and bobsmith */
    262265                if (uiUserCount > 0)
    263266                    strcat(szUserList, ",");
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette