Ticket #8121: 8121-23521_setuid_win.patch
File 8121-23521_setuid_win.patch, 887 bytes (added by , 15 years ago) |
---|
-
programs/mythbackend/main.cpp
6 6 #include <fcntl.h> 7 7 #include <libgen.h> 8 8 #include <signal.h> 9 #ifndef _WIN32 9 10 #include <pwd.h> 11 #endif 10 12 11 13 #include "mythconfig.h" 12 14 #if CONFIG_DARWIN … … 869 871 870 872 if (!username.isEmpty()) 871 873 { 874 #ifdef _WIN32 875 VERBOSE(VB_IMPORTANT, "--user option is not supported on Windows"); 876 return BACKEND_EXIT_INVALID_CMDLINE; 877 #else // ! _WIN32 872 878 struct passwd *user_info = getpwnam(username.toLocal8Bit().constData()); 873 879 const uid_t user_id = geteuid(); 874 880 … … 908 914 .arg(username)); 909 915 return BACKEND_EXIT_PERMISSIONS_ERROR; 910 916 } 917 #endif // ! _WIN32 911 918 } 912 919 913 920 if (pidfs)