On cygwin, disable the check that the output is not group or world

writable. File permissions on Cygwin are rather complex, and in this
case this check introduced a problem with build jobs invoke from
outside of Cygwin (MSYS). It seemed almost impossible to fix the
permissions of the directory, so for now this safety check is disabled
on Cygwin.
This commit is contained in:
Martin Bravenboer 2006-08-15 21:37:48 +00:00
parent 7455fd8835
commit 3e5b68068b

View file

@ -1400,6 +1400,7 @@ void DerivationGoal::computeClosure()
% path % algo % printHash(h) % printHash(h2)); % path % algo % printHash(h) % printHash(h2));
} }
#ifndef __CYGWIN__
/* Check that the output is not group or world writable, as /* Check that the output is not group or world writable, as
that means that someone else can have interfered with the that means that someone else can have interfered with the
build. Also, the output should be owned by the build build. Also, the output should be owned by the build
@ -1407,6 +1408,7 @@ void DerivationGoal::computeClosure()
if ((st.st_mode & (S_IWGRP | S_IWOTH)) || if ((st.st_mode & (S_IWGRP | S_IWOTH)) ||
(buildUser.getUID() != 0 && st.st_uid != buildUser.getUID())) (buildUser.getUID() != 0 && st.st_uid != buildUser.getUID()))
throw Error(format("suspicious ownership or permission on `%1%'; rejecting this build output") % path); throw Error(format("suspicious ownership or permission on `%1%'; rejecting this build output") % path);
#endif
/* Get rid of all weird permissions. */ /* Get rid of all weird permissions. */
canonicalisePathMetaData(path); canonicalisePathMetaData(path);