VirtualBox

Ignore:
Timestamp:
May 4, 2012 5:02:07 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77794
Message:

Main/Network: Pass error messages from VBoxNetAdpCtl all the way up to frontends.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/generic/NetIf-generic.cpp

    r39429 r41174  
    166166            else
    167167                strcat(szAdpCtl, "add");
     168            if (strlen(szAdpCtl) < RTPATH_MAX - sizeof(" 2>&1"))
     169                strcat(szAdpCtl, " 2>&1");
    168170            FILE *fp = popen(szAdpCtl, "r");
    169171
    170172            if (fp)
    171173            {
    172                 char szBuf[VBOXNET_MAX_SHORT_NAME];
     174                char szBuf[128]; /* We are not interested in long error messages. */
    173175                if (fgets(szBuf, sizeof(szBuf), fp))
    174176                {
     177                    if (!strncmp(VBOXNETADPCTL_NAME ":", szBuf, sizeof(VBOXNETADPCTL_NAME)))
     178                    {
     179                        progress->notifyComplete(E_FAIL,
     180                                                 COM_IIDOF(IHostNetworkInterface),
     181                                                 HostNetworkInterface::getStaticComponentName(),
     182                                                 "%s", szBuf);
     183                        return E_FAIL;
     184                    }
    175185                    char *pLast = szBuf + strlen(szBuf) - 1;
    176186                    if (pLast >= szBuf && *pLast == '\n')
Note: See TracChangeset for help on using the changeset viewer.

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