Ticket #8121: 8121-23521_setuid_win.2.patch

File 8121-23521_setuid_win.2.patch, 906 bytes (added by Jeff Lu <jll544@…>, 10 years ago)

Updated for [23835]

  • programs/mythbackend/main.cpp

     
    66#include <fcntl.h>
    77#include <libgen.h>
    88#include <signal.h>
     9#ifndef _WIN32
    910#include <pwd.h>
    1011#include <grp.h>
     12#endif
    1113
    1214#include "mythconfig.h"
    1315#if CONFIG_DARWIN
     
    870872
    871873    if (!username.isEmpty())
    872874    {
     875#ifdef _WIN32
     876        VERBOSE(VB_IMPORTANT, "--user option is not supported on Windows");
     877        return BACKEND_EXIT_INVALID_CMDLINE;
     878#else // ! _WIN32
    873879        struct passwd *user_info = getpwnam(username.toLocal8Bit().constData());
    874880        const uid_t user_id = geteuid();
    875881
     
    914920                    .arg(username));
    915921            return BACKEND_EXIT_PERMISSIONS_ERROR;
    916922        }
     923#endif // ! _WIN32
    917924    }
    918925
    919926    if (pidfs)