GNU bug report logs - #27269
Sed --in-place is messing NTFS file permissions

Previous Next

Package: sed;

Reported by: Maiko Cezar Rodrigues Costa <maiko.cezar <at> gmail.com>

Date: Wed, 7 Jun 2017 03:22:02 UTC

Severity: wishlist

Full log


Message #8 received at 27269 <at> debbugs.gnu.org (full text, mbox):

From: Assaf Gordon <assafgordon <at> gmail.com>
To: Maiko Cezar Rodrigues Costa <maiko.cezar <at> gmail.com>, 27269 <at> debbugs.gnu.org
Subject: Re: bug#27269: Sed --in-place is messing NTFS file permissions
Date: Wed, 15 Nov 2017 02:23:31 -0700
Hello,

On 2017-06-06 08:45 PM, Maiko Cezar Rodrigues Costa wrote:
> Hi, I've a problem with sed when using the --in-place option in a mounted
> NTFS partition;

Thank you for the report.

I can reproduce this and I believe it is a regression in sed-4.4 that 
happens when an ntfs partition is mounted with "-o permissions".

To reproduce:

Create dummy NTFS partition and mount it:

  cd /tmp/
  dd if=/dev/zero of=ntfs.partition.bin bs=1M count=20
  mkfs.ntfs --force ./ntfs.partition.bin
  mkdir /tmp/mnt
  sudo mount -t ntfs -o permissions ./ntfs.partition.bin /tmp/mnt/
  cd /tmp/mnt

Create first file:

  $ echo hello > world
  $ ls -l
  total 1
  -rw-rw-r-- 1 gordon gordon 6 Nov 15 02:16 world

Use sed-4.2, permissions retained:

  $ sed-4.2.2 -i.bak-sed4.2 's/e/x/' world
  $ ls -l
  total 1
  -rw-rw-r-- 1 gordon gordon 6 Nov 15 02:16 world
  -rw-rw-r-- 1 gordon gordon 6 Nov 15 02:16 world.bak-sed4.2

Same with sed-4.4, permissions lost:

  $ sed-4.4 -i.bak-sed4.4 's/e/x/' world
  $ ls -l
  total 2
  ---------- 1 gordon gordon 6 Nov 15 02:16 world
  -rw-rw-r-- 1 gordon gordon 6 Nov 15 02:16 world.bak-sed4.2
  -rw-rw-r-- 1 gordon gordon 6 Nov 15 02:16 world.bak-sed4.4



I will investigate further to try and pinpoint the offending code.

regards,
 - assaf




This bug report was last modified 6 years and 340 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.