This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Nasty permissions / pathing bug in perl on 1.7


Just been chasing my tail for hours trying to figure out why the permissions
on a file weren't being set even though no error was being thrown.

It turns out that giving a dos like path to chmod in perl under 1.7
although doesn't error it doesn't do anything either.

Here's my little test case:
[script]
#!/usr/bin/perl -w
use strict;

unlink '/tmp/test.exe';

print `touch /tmp/test.exe; ls -l /tmp/test.exe`;

if ( ! chmod 0777, 'C:/cygwin/tmp/test.exe' )
{
       print STDERR "Failed to chmod ($!)\n";
       exit 1;
}

print `ls -l /tmp/test.exe`;

if ( ! chmod 0777, '/tmp/test.exe' )
{
       print STDERR "Failed to chmod ($!)\n";
       exit 1;
}
print `ls -l /tmp/test.exe`;
[/script]

The output of this here is:
./t.pl -rw-r--r-- 1 root None 0 Nov 29 18:41 /tmp/test.exe
-rw-r--r-- 1 root None 0 Nov 29 18:41 /tmp/test.exe
-rwxrwxrwx 1 root None 0 Nov 29 18:41 /tmp/test.exe


As you can see after the first chmod using a dos like path no error is
generated but the operation silently fails.

This is using 1.7 from about a month back, so would be good if someone with
a current version could test to see if this is still an issue as its very
nasty imo.

CYGWIN_NT-6.1-WOW64 blade23 1.7.0(0.212/5/3) 2009-09-11 01:25 i686 Cygwin

   Regards
   Steve


-- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]