When synchronizing two directories on the same NTFS-formatted drive, unison 
(with -perms 0o1777) fails to set execute permissions on new files.  (It also 
fails to detect changes in execute permissions and to set them on existing 
files.)

I am running Cygwin 64-bit from setup version 2.873.  Below is a script to test 
this phenomenon for new files.  It creates and later destroys a sandbox 
directory under /tmp/.

Thank you all for your time and efforts on the Cygwin project.  I have been a 
happy user for over 10 years.

Alex Hankins


----------
#!/usr/bin/bash

# File:  test-whether-unison-preserves-execute-permissions.bash

# Test whether unison (and the filesystem housing /tmp)
# synchronizes execute-bits on new, local files.

# Comment out to turn off script debugging:
#set -x

# We need to clean up after the test is done, so we use this flag to
# determine the exit status later.
#
success="false"

umask 700

# Try to create a temporary directory to store all test files.
#
tmpDir="/tmp/unison.$$"
if ! mkdir "${tmpDir}"; then
  echo >&2 "${0}": cannot make temporary directory.
  exit 1
fi

export UNISON="${tmpDir}/.unison"  # Keep ~/.unison clean.
mkdir "${UNISON}"

mkdir "${tmpDir}/a" "${tmpDir}/b"
touch "${tmpDir}/a/foo"
chmod u+rwx,go= "${tmpDir}/a/foo"

echo "----- Before synchronization:"
ls -lRa "${tmpDir}"
echo

echo "----- Running unison."
unison -batch -debug all -log=false -perms 0o1777 "${tmpDir}/a" "${tmpDir}/b"
echo

echo "----- After synchronization:"
ls -lRa "${tmpDir}"
echo

if [ -x "${tmpDir}/b/foo" ]; then
  success="true"
else
  echo >&2 "${0}: test failed (for filesystem housing /tmp): execute bit not 
preserved"
  success="false"
fi

# Clean up the temporary directory we made.
rm -r "${tmpDir}"

if [ "${success}" = "false" ]; then
  exit 1
fi


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

Reply via email to