Ticket #8121: 8121-23521_setuid_win.patch

File 8121-23521_setuid_win.patch, 887 bytes (added by Jeff Lu <jll544@…>, 15 years ago)
  • programs/mythbackend/main.cpp

     
    66#include <fcntl.h>
    77#include <libgen.h>
    88#include <signal.h>
     9#ifndef _WIN32
    910#include <pwd.h>
     11#endif
    1012
    1113#include "mythconfig.h"
    1214#if CONFIG_DARWIN
     
    869871
    870872    if (!username.isEmpty())
    871873    {
     874#ifdef _WIN32
     875        VERBOSE(VB_IMPORTANT, "--user option is not supported on Windows");
     876        return BACKEND_EXIT_INVALID_CMDLINE;
     877#else // ! _WIN32
    872878        struct passwd *user_info = getpwnam(username.toLocal8Bit().constData());
    873879        const uid_t user_id = geteuid();
    874880
     
    908914                    .arg(username));
    909915            return BACKEND_EXIT_PERMISSIONS_ERROR;
    910916        }
     917#endif // ! _WIN32
    911918    }
    912919
    913920    if (pidfs)