Comment 2 for bug 1020872

Revision history for this message
Roland Hughes (original-seasoned-geek) wrote :

dropping perror() is not going to fix this by itself. I have a QT application. Thank you dearly for your explanation found here:

http://lukasz.langa.pl/5/error-opening-file-for-reading-permission-denied/

I tried to work around this as follows:

    // Code to get around a bogus Ubuntu protection problem with the
    // sticky "s" permision on executable file.
    //
    QDir d("/proc/self");
    QFileInfoList dLst = d.entryInfoList();
    int cx;

    foreach( const QFileInfo flInfo, dLst)
    {
        if (flInfo.isFile())
        {
            FILE_LOG(logINFO) << "changing ownership of " << qPrintable(flInfo.absoluteFilePath());
            cx = chown(qPrintable(flInfo.absoluteFilePath()), ruid, ruid);
        }
    }
    errno = 0; // don't let stale errors impact us later

    if (seteuid(ruid) != 0)
    {
        FILE_LOG(logINFO) << "seteuid failed errno " << errno;
    }

STILL no love.

What is interesting is that I run at root yet cannot change owner on the directories.

I think a more accurate fix would be for the sticky bit processes to create all /proc/self entries with owners of "user:root" but don't have a method of testing this.

WE REALLY NEED A FIX. Under the compiler shipped with Mint 14 (and probably included with 12.10) this "benign" error is now fatal.