|
|
@ -590,17 +590,22 @@ int runDCOP( QCStringList args, UserList users, Session session,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if( users.count() > 1 || ( users.count() == 1 &&
|
|
|
|
if ((users.count() > 1) || ((users.count() == 1) &&
|
|
|
|
( getenv( "ICEAUTHORITY" ) == 0 || getenv( "DISPLAY" ) == 0 ) ) )
|
|
|
|
((getenv("ICEAUTHORITY") == 0) || (getenv("DISPLAY") == 0))))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Check for ICE authority file and if the file can be read by us
|
|
|
|
// Check for ICE authority file and if the file can be read by us
|
|
|
|
TQString iceFileBase = "ICEauthority";
|
|
|
|
TQString iceFileBase = "ICEauthority";
|
|
|
|
TQString iceFile;
|
|
|
|
TQString iceFile;
|
|
|
|
TQFileInfo fi;
|
|
|
|
TQFileInfo fi;
|
|
|
|
|
|
|
|
|
|
|
|
if (getenv("XDG_RUNTIME_DIR") != 0 )
|
|
|
|
TQString xdgRuntimeDir = TQString::fromLocal8Bit(getenv("XDG_RUNTIME_DIR"));
|
|
|
|
|
|
|
|
if (xdgRuntimeDir.isEmpty())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
xdgRuntimeDir = "/run/user/<uid>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!xdgRuntimeDir.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQFileInfo xdgRuntime(getenv("XDG_RUNTIME_DIR"));
|
|
|
|
TQFileInfo xdgRuntime(xdgRuntimeDir);
|
|
|
|
passwd* pstruct = getpwnam(it.key().local8Bit());
|
|
|
|
passwd* pstruct = getpwnam(it.key().local8Bit());
|
|
|
|
if (pstruct)
|
|
|
|
if (pstruct)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -628,7 +633,7 @@ int runDCOP( QCStringList args, UserList users, Session session,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (fi.isReadable())
|
|
|
|
if (fi.isReadable())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
char *envStr = strdup( ( "ICEAUTHORITY=" + iceFile ).ascii() );
|
|
|
|
char *envStr = strdup(("ICEAUTHORITY=" + iceFile).local8Bit());
|
|
|
|
putenv(envStr);
|
|
|
|
putenv(envStr);
|
|
|
|
//cerr_ << "ice: " << envStr << endl;
|
|
|
|
//cerr_ << "ice: " << envStr << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -643,7 +648,9 @@ int runDCOP( QCStringList args, UserList users, Session session,
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (users.count() > 1)
|
|
|
|
if (users.count() > 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cerr_ << "WARNING: Cannot find ICE authority file "
|
|
|
|
cerr_ << "WARNING: Cannot find ICE authority file "
|
|
|
|