delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/29/13:44:06

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-498008.0 required=5.0 tests=AWL,BAYES_50
X-Spam-Check-By: sourceware.org
X-MDAV-Processed: mail1.multiplay.co.uk, Sun, 29 Nov 2009 18:43:53 +0000
X-Spam-Processed: mail1.multiplay.co.uk, Sun, 29 Nov 2009 18:43:53 +0000 (not processed: message from trusted or authenticated source)
X-MDRemoteIP: 213.123.247.160
X-Return-Path: prvs=1584594039=killing AT multiplay DOT co DOT uk
X-Envelope-From: killing AT multiplay DOT co DOT uk
X-MDaemon-Deliver-To: cygwin AT cygwin DOT com
Message-ID: <BE3716D1FE6B45B6A50DEB1B448E71ED@multiplay.co.uk>
From: "Steven Hartland" <killing AT multiplay DOT co DOT uk>
To: "Cygwin List" <cygwin AT cygwin DOT com>
Subject: Nasty permissions / pathing bug in perl on 1.7
Date: Sun, 29 Nov 2009 18:43:49 -0000
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019