VirtualBox

Ignore:
Timestamp:
Feb 6, 2009 8:03:54 PM (16 years ago)
Author:
vboxsync
Message:

XPCOM/Unix: try getpwuid() first to get the user name for the IPC socket

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/shared/src/ipcConfig.cpp

    r4106 r16561  
    4040#else
    4141#include <string.h>
     42#ifdef XP_UNIX
     43#include <unistd.h>
     44#include <sys/types.h>
     45#include <pwd.h>
     46#endif
    4247#include "ipcConfig.h"
    4348#include "ipcLog.h"
     
    7176
    7277    logName = PR_GetEnv("VBOX_IPC_SOCKETID");
     78#if defined(VBOX) && defined(XP_UNIX)
     79    if (!logName || !logName[0]) {
     80        struct passwd *passStruct = getpwuid(getuid());
     81        if (passStruct)
     82            logName = passStruct->pw_name;
     83    }
     84#endif
    7385    if (!logName || !logName[0]) {
    7486        logName = PR_GetEnv("LOGNAME");
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