1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-08-13 17:03:46 -04:00

Disable geteuid in cygwin.

This is one of those rare cases where we actually want to code in a
platform-specific #ifdef. Because you don't need to be the root user on a
Windows box, and fakeroot doesn't exist so we can do easy testing, lets
disable any checking of the UID.

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Xavier Chantry 2008-04-15 17:10:39 +02:00 committed by Dan McGee
parent 33e3182dbd
commit fb09d35e6a

View File

@ -763,7 +763,7 @@ int main(int argc, char *argv[])
{ {
int ret = 0; int ret = 0;
struct sigaction new_action, old_action; struct sigaction new_action, old_action;
#if defined(HAVE_GETEUID) #if defined(HAVE_GETEUID) && !defined(CYGWIN)
/* geteuid undefined in CYGWIN */ /* geteuid undefined in CYGWIN */
uid_t myuid = geteuid(); uid_t myuid = geteuid();
#endif #endif
@ -844,7 +844,7 @@ int main(int argc, char *argv[])
cleanup(ret); cleanup(ret);
} }
#if defined(HAVE_GETEUID) #if defined(HAVE_GETEUID) && !defined(CYGWIN)
/* check if we have sufficient permission for the requested operation */ /* check if we have sufficient permission for the requested operation */
if(myuid > 0 && needs_transaction()) { if(myuid > 0 && needs_transaction()) {
pm_printf(PM_LOG_ERROR, _("you cannot perform this operation unless you are root.\n")); pm_printf(PM_LOG_ERROR, _("you cannot perform this operation unless you are root.\n"));