Assaf Gordon <assafgordon@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 27269) by debbugs.gnu.org; 9 Oct 2018 11:24:29 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Oct 09 07:24:29 2018 Received: from localhost ([127.0.0.1]:41241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1g9q7o-0008NF-VW for submit <at> debbugs.gnu.org; Tue, 09 Oct 2018 07:24:29 -0400 Received: from mail-it1-f193.google.com ([209.85.166.193]:51107) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <assafgordon@HIDDEN>) id 1g9q7n-0008Mw-FF; Tue, 09 Oct 2018 07:24:27 -0400 Received: by mail-it1-f193.google.com with SMTP id j81-v6so2027960ite.0; Tue, 09 Oct 2018 04:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=shijodR9GCcXarIWIHOoB2h/dn7GjTD0WMmO0D8sMLI=; b=Tja7sSLrzKvqfTK1pSjBw5F+kUc+nEmslGa4tcBvQwFxcF3O1z5kSJ+Jfa7zcmVoKn Im2jFPH3D1TopP+ZC0giMuVhaS+137t7miQGWqipXgGVXrR4w1NiIGNq2zLPby/vRTZk uNiFCa3tliiYoDQxmtwBfyhM5AyA/JWRcCj+zb/kq3q5SH6QHGrYIMrcLctl3MjgVIRV v+GKTQLKvTMn8wZg1DdLpanAcAqZMevEPs4Y2QjoVG2S/wjBHovWUvYkzrxT26wAjULA sTYf3FzFBDe6OLlEC9w/7q2MEyaLjH9fXgycjhTj+xM91YjISeh8sWvqEHuu/mBczgNK jgmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=shijodR9GCcXarIWIHOoB2h/dn7GjTD0WMmO0D8sMLI=; b=WkrLaaJ3kXjD1Z9jFkUJSyhC+NiagBE7nBEPJgq0ldXPEmZPbfYVS3jYx51KF+lDmP hsxcoEB5m9qHBZ64BDQ0ZJqZ3vkix9Febhulf79Q2mPHlRjO8ActW+TiD9YXX+lkngZ3 wMSqPi/abURSwi5j9lXbdkDC5BdF8seoaP8uXgaaAaBi6pH575mPCP1gqkGxdRO2uLan KRXOx6U28orlxxYLzWVJadEU7rqjml422BJ60TPiEMcM6n2fvxk2EW2qNqFTLUCISZJY s2/uHKvI8DJPYBxUqOO2T6gDL69GNFJyhOnSbPzq4gj4uaj80P5+cQWzp3NDxpTnOAxo HovA== X-Gm-Message-State: ABuFfohkITLKnsgpdqqOrMRSGzpOkkBLLoBceNAMDFeVjVLQCSfArlcW RR+8j0JIqDtVdPtROOa5dSeJl5Rd X-Google-Smtp-Source: ACcGV63zOThs33xsS74hymK2kqrynURGzBMzD79hNWqcpDRJQj5doog6gYWDSg6E1z/5XIssUM973A== X-Received: by 2002:a24:ce02:: with SMTP id v2-v6mr1237010itg.18.1539084261281; Tue, 09 Oct 2018 04:24:21 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id f8-v6sm6071156ioh.11.2018.10.09.04.24.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 04:24:19 -0700 (PDT) Subject: Re: bug#27269: Sed --in-place is messing NTFS file permissions To: Jim Meyering <jim@HIDDEN> References: <CAJFYRRkoXk_Jqv=wg-2-NnevazuZZDZhBj5WL8nhPiuAr2LW0g@HIDDEN> <9f3ac097-b1b3-338e-c134-278e53f08f9b@HIDDEN> <aace9ca0-1cbb-923a-4321-95bdf0434ce3@HIDDEN> <CA+8g5KGDPDBQEissjBPSY_rTjoEX3-DN5cW6oCwM8jPGwjFz7w@HIDDEN> From: Assaf Gordon <assafgordon@HIDDEN> Message-ID: <5132d3dc-f8f2-97eb-664d-8c090dbe3de7@HIDDEN> Date: Tue, 9 Oct 2018 05:24:18 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <CA+8g5KGDPDBQEissjBPSY_rTjoEX3-DN5cW6oCwM8jPGwjFz7w@HIDDEN> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 27269 Cc: 27269 <at> debbugs.gnu.org, Maiko Cezar Rodrigues Costa <maiko.cezar@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) severity 27269 wishlist stop Hello, > On Wed, Nov 15, 2017 at 2:43 AM, Assaf Gordon <assafgordon@HIDDEN> wrote: >> One can perhaps infer that fsetxattr/fgetxattr do not work on NTFS >> mounts, but also don't fail with ENOTSUP. In a follow-up thread in bug-gnulib@ [1], Paul Eggert wrote [2]: "This sounds like a bug inside the kernel then, in the ntfs code presumably. Perhaps we could work around the bug in Gnulib, but that sounds a bit expensive." [1] https://lists.gnu.org/archive/html/bug-gnulib/2017-11/msg00031.html [2] https://lists.gnu.org/archive/html/bug-gnulib/2017-11/msg00035.html I'm therefore marking this as a "wishlist" item (but keeping it open, for future improvements). regards, - assaf
bug-sed@HIDDEN
:bug#27269
; Package sed
.
Full text available.Received: (at 27269) by debbugs.gnu.org; 17 Nov 2017 06:23:08 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 17 01:23:08 2017 Received: from localhost ([127.0.0.1]:44124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1eFa3Q-0003lw-BX for submit <at> debbugs.gnu.org; Fri, 17 Nov 2017 01:23:08 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:34797) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <meyering@HIDDEN>) id 1eFa3O-0003lP-Sd for 27269 <at> debbugs.gnu.org; Fri, 17 Nov 2017 01:23:07 -0500 Received: by mail-qt0-f193.google.com with SMTP id 8so3624308qtv.1 for <27269 <at> debbugs.gnu.org>; Thu, 16 Nov 2017 22:23:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=RpytZiJXP94E5J1Fu9KIwYWJb/eYOwKEJ2158PA+XB0=; b=gMD6eB/+lqdBWI7Al1K0FdCyFXljbMmTbZy8TUPSLY9LS3fOXhF0lxYkQrkIV0aws0 AX7xhwXuq6vkFdDBiCrlvos4gamln8LI93iG5UtKnN+vyHmheKBjobTDZDluyqwInvLu bqbGCkhUYQDtEhGO+uZMdr5q3I6jDGtso7bvVfdk8XaunfGt0eW8q/gUD715YRo30rhO reRx1FgmCaD6RneVii2vZsy8W7LrC8+6XQVBqaUD2z+mvqozljMly+diLLlu+wNps+lN ifTW4SIXN3ZCezYcdz8Ru4FSNzs4pYCMs2IjptqrBl1yhcpX2n/ZGuk8WhE9NYUhXqrf hovg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=RpytZiJXP94E5J1Fu9KIwYWJb/eYOwKEJ2158PA+XB0=; b=Je4ORyZl1DBHTZHsUJUI+JvLWuTIG7qva5UxlLVjk9gXyo5rdkVLeGWdW54I9h9fLH 5rXUvDGx5BJRRJR3TV/sA4bBoVjG3ZYV9D/xaoOk//fWF0vDZBi4aYtCCC3/H+BT3n8+ FnwadljH9vVi6gGhu8yMYTTl7IJ1VlGD3DAX/Datmkj0JGA6VhAKVMzuIP45FauWk3lr LlxjOQ/tq1YcQoIrl+1Yxjsb0Enxtqf3v88Bfgw8Lfi6uDhPMPw1Q5ofHpLfe0fwZOC9 JZ31g7IR3xWwdZU40A0LoCuVfJRBza1Nf2g/jan+7B2friTckYuqe6Bl4ta6JaCDQfPM CxNQ== X-Gm-Message-State: AJaThX77hLGt8JdDkOple9zHOeOIejOEOW9jGQK+f/oGD9/anx+CAs6y tt3+0J/mkQqgsubOEBIn8P/PXKkvu347PZ081ao= X-Google-Smtp-Source: AGs4zMbPD3L5q9Xam96TfwiF/6ZyKVo2SJpv+E1GC1bpiMSMP7fi6L8i/n7Xrfqr4optyH0OJKoL4omrEk7n5DYROm0= X-Received: by 10.200.40.54 with SMTP id 51mr6793643qtq.339.1510899781255; Thu, 16 Nov 2017 22:23:01 -0800 (PST) MIME-Version: 1.0 Received: by 10.55.9.17 with HTTP; Thu, 16 Nov 2017 22:22:40 -0800 (PST) In-Reply-To: <aace9ca0-1cbb-923a-4321-95bdf0434ce3@HIDDEN> References: <CAJFYRRkoXk_Jqv=wg-2-NnevazuZZDZhBj5WL8nhPiuAr2LW0g@HIDDEN> <9f3ac097-b1b3-338e-c134-278e53f08f9b@HIDDEN> <aace9ca0-1cbb-923a-4321-95bdf0434ce3@HIDDEN> From: Jim Meyering <jim@HIDDEN> Date: Thu, 16 Nov 2017 22:22:40 -0800 X-Google-Sender-Auth: XXh56bIYAJsG1oFuAMxRyiELXTA Message-ID: <CA+8g5KGDPDBQEissjBPSY_rTjoEX3-DN5cW6oCwM8jPGwjFz7w@HIDDEN> Subject: Re: bug#27269: Sed --in-place is messing NTFS file permissions To: Assaf Gordon <assafgordon@HIDDEN> Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: 27269 Cc: 27269 <at> debbugs.gnu.org, Maiko Cezar Rodrigues Costa <maiko.cezar@HIDDEN> X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: 0.2 (/) On Wed, Nov 15, 2017 at 2:43 AM, Assaf Gordon <assafgordon@HIDDEN> wrote: ... > 3. > If ACL support is compiled in sed, using "--in-place" > leads to the following syscalls: > > fchown(4, 1000, 1000) = 0 > fgetxattr(3, "system.posix_acl_access", "", 132) = 0 > fstat(3, {st_mode=S_IFREG|0664, st_size=6, ...}) = 0 > fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\37....", 28, 0) = 0 > close(3) = 0 > close(4) = 0 > rename("world", "world.bak") = 0 > rename("./sedcrOmKi", "world") = 0 > > 4. > If ACL support is not compiled in sed, using "--in-place" > leads to the following syscalls: > > fchown(4, 1000, 1000) = 0 > fchmod(4, 0100664) = 0 > close(3) = 0 > close(4) = 0 > rename("world", "world.bak") = 0 > rename("./sednDUqpF", "world") = 0 > > > One can perhaps infer that fsetxattr/fgetxattr do not work on NTFS > mounts, but also don't fail with ENOTSUP. ... > Is this a bug? > and if so, is it in sed or gnulib or libacl ? > Not sure about this. Hi Assaf, Thank you for the thorough analysis. Following your instructions in https://debbugs.gnu.org/27269#8, I reproduced the failure on Fedora 26 with Linux 4.13.12. That looks like either we're somehow telling f[gs]etxattr to do the wrong thing, or it's a bug that they fail to do what we want, yet they return 0/success.
bug-sed@HIDDEN
:bug#27269
; Package sed
.
Full text available.Received: (at 27269) by debbugs.gnu.org; 15 Nov 2017 10:43:41 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 15 05:43:41 2017 Received: from localhost ([127.0.0.1]:41020 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1eEvAT-0007Jo-F1 for submit <at> debbugs.gnu.org; Wed, 15 Nov 2017 05:43:41 -0500 Received: from mail-it0-f49.google.com ([209.85.214.49]:40970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <assafgordon@HIDDEN>) id 1eEvAS-0007Jc-26 for 27269 <at> debbugs.gnu.org; Wed, 15 Nov 2017 05:43:40 -0500 Received: by mail-it0-f49.google.com with SMTP id x28so1242106ita.0 for <27269 <at> debbugs.gnu.org>; Wed, 15 Nov 2017 02:43:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=xf4OJ6sp451/OCBA0E4nocAC3y2qcrq2TUe9PlT/TIc=; b=BGQbAD0HAnIwMBkFubvYb5cGXVUzgZSe5SMIMdyfrJPTBHkzDp5+3t3uHPyyGKkCuM hioVVPrzFShq8bLGED2pvcBM8KrL74Gy8ehA/c1N3w1YOOCtw48Yxa4R4LuFc5IkZHa0 CIVnihnu0SfIfG/d3o75aBKMpq+EPAqSimaRU/jzGXkVJHjTwvvBuzLaL+nzQOuSPvIc Z5SB+cVtqgkj6Sk7YwDnTildiWvwM7EOBWn4TZlYOcFEoz7CDt62u2Gl6NzKk7yxBtwk 1efE7aMM3nYX7GzpWy01F6zQKf5Oc3M8kCD0q9WSp1iGqKcoC1db7oLIvhT2TRal1f6s eqvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=xf4OJ6sp451/OCBA0E4nocAC3y2qcrq2TUe9PlT/TIc=; b=OZSxTZa0YcnGgoLYSDUbwnvJTIuQz8vKtzgl+luXB2POmgxT8PvEE39dYh/3CqBSeD dz87pZYezGFTRDJqWNKTpnIHLpMU3zInAr5TxnyqlwnhDuElpis0PkuH+Kp0YMTNN8vG NocsRU51d5hVa+avPP/OVByjZIGy73nw6cJnKUt/TeklJDu6MuoQH6d+OcgwKlO46jHX eyjE0npp8LRLyXmH8+WcTaMQmhJjEf8twc1rN32Hx2QkobKO5unjQa+Nf0nwg03lPDlz 4VtRlwLvGReUeXRQONJv5SPu/kYap7bbQ/JTJw9s/9awKPeIKsaqKEJZsHOjgOmC9KK9 LPxw== X-Gm-Message-State: AJaThX5t2bTxCrmHGmRZzMdaUdiD4WNb/QRbwDWYPaRO7T3z+J54vYWU EgV9YoH3lig1L5ztCu1HE62zrk8I X-Google-Smtp-Source: AGs4zMYWdV/Bk4PNWa4PVdvH54L0VR3twQ0XZzjAVZMwr7AYIynknjq2R6S0uAd5Xgi0VVy/cgKNtw== X-Received: by 10.36.108.67 with SMTP id w64mr18683246itb.126.1510742613705; Wed, 15 Nov 2017 02:43:33 -0800 (PST) Received: from [192.168.88.239] (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id q191sm8889336itb.1.2017.11.15.02.43.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 02:43:32 -0800 (PST) Subject: Re: bug#27269: Sed --in-place is messing NTFS file permissions From: Assaf Gordon <assafgordon@HIDDEN> To: Maiko Cezar Rodrigues Costa <maiko.cezar@HIDDEN>, 27269 <at> debbugs.gnu.org References: <CAJFYRRkoXk_Jqv=wg-2-NnevazuZZDZhBj5WL8nhPiuAr2LW0g@HIDDEN> <9f3ac097-b1b3-338e-c134-278e53f08f9b@HIDDEN> Message-ID: <aace9ca0-1cbb-923a-4321-95bdf0434ce3@HIDDEN> Date: Wed, 15 Nov 2017 03:43:30 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <9f3ac097-b1b3-338e-c134-278e53f08f9b@HIDDEN> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 27269 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.0 (/) Hello, On 2017-11-15 02:23 AM, Assaf Gordon wrote: > 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; > > 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". The above statement is incorrect. It is not a regression in sed-4.4 compared to sed-4.2 but a different issue relating to ACL support during compilation ("./configure --disable-acl"). If ACL support is included, NTFS permissions DO NOT work. If ACL support is NOT included, NTFS permissions DO work. What confused me before is that on Debian/Ubuntu systems the default sed (/bin/sed) is compiled without ACL and using it "just worked", while compiling from source code did include ACL and it never worked. Current Work around: 1. Use the system's default sed (e.g /bin/sed) which is likely compiled without ACL, or 2. Build sed with "./configure --disable-acl". This of course will lose the ability to copy other ACLs on non-NTFS file systems. ---- Technical reason: 1. If "./configure" finds the header file <sys/acl.h>, ACL support is included. 2. Another way to test ACL support is by checking if the sed binary requires the acl shared library: $ ldd /bin/sed | grep acl $ ldd ~/projects/sed/sed/sed | grep acl libacl.so.1 => /lib/x86_64-linux-gnu/libacl.so.1 3. If ACL support is compiled in sed, using "--in-place" leads to the following syscalls: fchown(4, 1000, 1000) = 0 fgetxattr(3, "system.posix_acl_access", "", 132) = 0 fstat(3, {st_mode=S_IFREG|0664, st_size=6, ...}) = 0 fsetxattr(4, "system.posix_acl_access", "\2\0\0\0\37....", 28, 0) = 0 close(3) = 0 close(4) = 0 rename("world", "world.bak") = 0 rename("./sedcrOmKi", "world") = 0 4. If ACL support is not compiled in sed, using "--in-place" leads to the following syscalls: fchown(4, 1000, 1000) = 0 fchmod(4, 0100664) = 0 close(3) = 0 close(4) = 0 rename("world", "world.bak") = 0 rename("./sednDUqpF", "world") = 0 One can perhaps infer that fsetxattr/fgetxattr do not work on NTFS mounts, but also don't fail with ENOTSUP. ---- Code flow: sed's execute.c calls gnulib's "copy_acl" [1]. copy_acl calls qcopy_acl [2]. qcopy_acl calls set_permissions [3] set_permissions uses the USE_ACL #define to either call "set_acls" or call chmod/fchmod directly [4]. [1] https://opengrok.housegordon.com/source/xref/sed/sed/execute.c#677 [2] https://opengrok.housegordon.com/source/xref/gnulib/lib/copy-acl.c#43 [3] https://opengrok.housegordon.com/source/xref/gnulib/lib/qcopy-acl.c#39 [4] https://opengrok.housegordon.com/source/xref/gnulib/lib/set-permissions.c#776 ---- Is this a bug? and if so, is it in sed or gnulib or libacl ? Not sure about this. Jim and all, What do you think? regards, - assaf
bug-sed@HIDDEN
:bug#27269
; Package sed
.
Full text available.Received: (at 27269) by debbugs.gnu.org; 15 Nov 2017 09:23:44 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Wed Nov 15 04:23:44 2017 Received: from localhost ([127.0.0.1]:40972 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1eEtv6-0005UW-Hu for submit <at> debbugs.gnu.org; Wed, 15 Nov 2017 04:23:44 -0500 Received: from mail-io0-f182.google.com ([209.85.223.182]:44393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <assafgordon@HIDDEN>) id 1eEtv4-0005UI-Cj for 27269 <at> debbugs.gnu.org; Wed, 15 Nov 2017 04:23:42 -0500 Received: by mail-io0-f182.google.com with SMTP id w127so904480iow.11 for <27269 <at> debbugs.gnu.org>; Wed, 15 Nov 2017 01:23:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=pO1uWsC+Vqt6vR6FgRmyyXQL0B8UbZsv43Eu/N9X9kM=; b=LOa5TmSB7O7DAnAKhkBsuDFL2H1PXS3t6BVwxmlnZd0RaCUAazURfxBbl/Y88Krifx Ky4ZFHPL/4SHlf+IrwAp8EFHDCSbVlGnTcn26qyK28jg0LNfOFtfAx7EpVDCbVPRoBW0 3DNED9sRMjtUdIsb1MODkRznv4Q9+pOq6euFjETnj1lqiT9mrT/gFGo0fTlbeEoUtDi0 xaU4dLn05ezij6hAk4P8Cxl5ZAKt/rSxQOcXTNFhuz/uoReinZpSoe6VmkkaXLhXyBS/ jOlDg/41DIE668iLvNXc6cnyW4vdAVATiI6Sf2jELHG1okWiuDhLoSF/gXU10Bn98QYw PmSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=pO1uWsC+Vqt6vR6FgRmyyXQL0B8UbZsv43Eu/N9X9kM=; b=sdbvWXd+ReLZ03GzcMiGqUBcb7og+ZX3iaIAAyqz1r08sQkhAzAMLvcDOi+UOi6xhh wMutxoF1LcZKWkdS9T6cRr/fkiV/rhwniyx5/2ByBmLC9aDG2h5IvOpO/pTSCKZeeBS+ BvmCy0wIsXiGqXD5KXme47B64cF7SeBHCVu5kCbUOL0ibx9GimjraAAo3EjgvoM1cYGL dvURl8yU859l9j+Z6RVcLV7MY78QnWkBW2AQNuZk3eJbj71VUBlxa2DlfGqOfTNFE6gm 45xSImUWZxd00AFQRo1EZi26oIEEFftWI74TlKCz/Kjkohf9gMpeuLinsJ+EVHasS2lv zNWg== X-Gm-Message-State: AJaThX7qx16RQgVvFQvbkuthokU2VmUnrskPuENCFGEvW5QcXOypBt+T lktnf6R0Haf+oNIj306MOZHbi3H9 X-Google-Smtp-Source: AGs4zMaHT7Ca6B6X5qckbb78J0xcISIPwUdq0V+AVbqDLROq4WXo/N2yl3uDULM3MZv1N5mqCXgEeQ== X-Received: by 10.107.151.19 with SMTP id z19mr18048087iod.248.1510737816129; Wed, 15 Nov 2017 01:23:36 -0800 (PST) Received: from [192.168.88.239] (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id v198sm7880665ita.4.2017.11.15.01.23.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Nov 2017 01:23:35 -0800 (PST) Subject: Re: bug#27269: Sed --in-place is messing NTFS file permissions To: Maiko Cezar Rodrigues Costa <maiko.cezar@HIDDEN>, 27269 <at> debbugs.gnu.org References: <CAJFYRRkoXk_Jqv=wg-2-NnevazuZZDZhBj5WL8nhPiuAr2LW0g@HIDDEN> From: Assaf Gordon <assafgordon@HIDDEN> Message-ID: <9f3ac097-b1b3-338e-c134-278e53f08f9b@HIDDEN> Date: Wed, 15 Nov 2017 02:23:31 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <CAJFYRRkoXk_Jqv=wg-2-NnevazuZZDZhBj5WL8nhPiuAr2LW0g@HIDDEN> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.8 (--) X-Debbugs-Envelope-To: 27269 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.8 (--) 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
bug-sed@HIDDEN
:bug#27269
; Package sed
.
Full text available.Received: (at submit) by debbugs.gnu.org; 7 Jun 2017 03:22:00 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jun 06 23:22:00 2017 Received: from localhost ([127.0.0.1]:60119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1dIRXk-0000Ux-E0 for submit <at> debbugs.gnu.org; Tue, 06 Jun 2017 23:22:00 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41511) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maiko.cezar@HIDDEN>) id 1dIQyw-00087d-6l for submit <at> debbugs.gnu.org; Tue, 06 Jun 2017 22:46:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <maiko.cezar@HIDDEN>) id 1dIQyp-0005jG-JK for submit <at> debbugs.gnu.org; Tue, 06 Jun 2017 22:45:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, HTML_MESSAGE,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <maiko.cezar@HIDDEN>) id 1dIQyp-0005jC-Fs for submit <at> debbugs.gnu.org; Tue, 06 Jun 2017 22:45:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <maiko.cezar@HIDDEN>) id 1dIQyn-0003gU-Sh for bug-sed@HIDDEN; Tue, 06 Jun 2017 22:45:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <maiko.cezar@HIDDEN>) id 1dIQym-0005hy-M6 for bug-sed@HIDDEN; Tue, 06 Jun 2017 22:45:53 -0400 Received: from mail-vk0-x233.google.com ([2607:f8b0:400c:c05::233]:35916) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <maiko.cezar@HIDDEN>) id 1dIQym-0005gx-Ev for bug-sed@HIDDEN; Tue, 06 Jun 2017 22:45:52 -0400 Received: by mail-vk0-x233.google.com with SMTP id p85so215401vkd.3 for <bug-sed@HIDDEN>; Tue, 06 Jun 2017 19:45:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=pm32X1+msZRwH2VG3T//6WWTlmYv/yf7dTlkuYnS6Zg=; b=ZvlgUHOO/UYvRUOcXKbGYYF+AWuegZzRWQmvc/CxSXV8KOkQCTDjYF/xS9kTkztW3A hrQuzhfM0SYs9OYKkn25JdoKE38wByRrI9391s61IXWbUh01WT3L6EbNWMRzixIodXPq U42DvET8Oy6F30w/Fv/5zta8YTiMQspCjvOBEsSkVUS+kKNmfxm9hk4jA3+7gYCcoN47 0oKctFgn6q1YgZvpDdpcyPcsfJ5fgJZys4vFOnsGeb7A1hQNhW+lzrOTCxcEhk3Vmer9 GegTyEf4S+zJUDd2du+Vb45pdrqtxkdWctYLB21PxIRVCkYpZAAH6J0YJKvf2JdSUflx PwSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=pm32X1+msZRwH2VG3T//6WWTlmYv/yf7dTlkuYnS6Zg=; b=jpzV4TjMoMgJcSVbOUTK8IX64cOTbK6onjMV4N0bJwrRRgATavyWyNBChc98rrs8rV Lcos1HnWdhyRLd+P0kvd/bMkL1vnF1d+iXloTsWuCi9YQBGs1M2g0i6puE0qNZZSZ7q8 HMHTrdT3wfoIihrpsTqX1T2sg7PQlSCEyik+R9A7dLekqnWVSVB0LhoJdvqjAtMt06wR 8DwX2L2RnihMuimTmLC9Yqsyi2NuYlNmytQHouZZjG+jwli2DY1TJ9Z/G+3eLMblAJfP K5wAK6wAfRve5dl5lVWBMSCLbn0vorCUUZ/CEBbfjiYcDviLRdaIAV9H6//1jDAOqhge Tt/g== X-Gm-Message-State: AODbwcDn5Gn78yYVS7uxLW3PZ3hda0vIDmLwN0lkpqJ6xf9b9mUptoLd VscNXAH08uDVgicvu3MXx9p37kJpEA== X-Received: by 10.31.79.65 with SMTP id d62mr14685848vkb.54.1496803549840; Tue, 06 Jun 2017 19:45:49 -0700 (PDT) MIME-Version: 1.0 From: Maiko Cezar Rodrigues Costa <maiko.cezar@HIDDEN> Date: Wed, 07 Jun 2017 02:45:39 +0000 Message-ID: <CAJFYRRkoXk_Jqv=wg-2-NnevazuZZDZhBj5WL8nhPiuAr2LW0g@HIDDEN> Subject: Sed --in-place is messing NTFS file permissions To: bug-sed@HIDDEN Content-Type: multipart/alternative; boundary="001a114dfc36e30dca055155bba6" X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 06 Jun 2017 23:21:59 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -4.0 (----) --001a114dfc36e30dca055155bba6 Content-Type: text/plain; charset="UTF-8" Hi, I've a problem with sed when using the --in-place option in a mounted NTFS partition; $ sed --version sed (GNU sed) 4.4 Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html >. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Jay Fenlason, Tom Lord, Ken Pizzini, and Paolo Bonzini. GNU sed home page: <http://www.gnu.org/software/sed/>. General help using GNU software: <http://www.gnu.org/gethelp/>. E-mail bug reports to: <bug-sed@HIDDEN>. $ echo " test string teste" > x $ sed --in-place=.bak 's@tes.*string@TESTE@g' x $ ls -l -rw-r--r-- 1 maiko users 13 jun 6 23:39 x -rw-r--r-- 1 maiko users 19 jun 6 23:39 x.bak $ cat x TESTE teste $ cat x.bak test string teste So far, so good. my /etc/fstab UUID=1CACB8ABACB88136 /media/FILES ntfs defaults,permissions,noatime 0 0 $ cd /media/FILES $ echo " test string teste" > x $ sed --in-place=.bak 's@tes.*string@TESTE@g' x $ ls -l ---------- 1 maiko users 13 jun 6 23:42 x -rw-r--r-- 1 maiko users 19 jun 6 23:42 x.bak $ sudo cat x TESTE teste $ cat x.bak test string teste This guy has a very similar problem too https://unix.stackexchange.com/questions/244603/why-is-sed-changing-permissions-of-a-file-on-a-cifs-mounted-share Thanks -- Maiko Cezar R Costa PGP Public Key <http://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0xB69302C5F63F5F84> --001a114dfc36e30dca055155bba6 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi, I've a problem with sed when using the --in-place = option in a mounted NTFS partition;=C2=A0<br><div>$ sed --version</div><div= >sed (GNU sed) 4.4</div><div>Copyright (C) 2017 Free Software Foundation, I= nc.</div><div>License GPLv3+: GNU GPL version 3 or later <<a href=3D"htt= p://gnu.org/licenses/gpl.html">http://gnu.org/licenses/gpl.html</a>>.</d= iv><div>This is free software: you are free to change and redistribute it.<= /div><div>There is NO WARRANTY, to the extent permitted by law.</div><div><= br></div><div>Written by Jay Fenlason, Tom Lord, Ken Pizzini,</div><div>and= Paolo Bonzini.</div><div>GNU sed home page: <<a href=3D"http://www.gnu.= org/software/sed/">http://www.gnu.org/software/sed/</a>>.</div><div>Gene= ral help using GNU software: <<a href=3D"http://www.gnu.org/gethelp/">ht= tp://www.gnu.org/gethelp/</a>>.</div><div>E-mail bug reports to: <<a = href=3D"mailto:bug-sed@HIDDEN">bug-sed@HIDDEN</a>>.</div><div><br></di= v><br><div><div>$ echo " test string teste" > x =C2=A0 =C2=A0 = =C2=A0 =C2=A0</div><div><br></div><div>$ sed --in-place=3D.bak 's@tes.*= string@TESTE@g' x</div><div><br></div><div>$ ls -l</div><div>-rw-r--r--= 1 maiko users =C2=A0 13 jun =C2=A06 23:39 =C2=A0x</div><div>-rw-r--r-- 1 m= aiko users =C2=A0 19 jun =C2=A06 23:39 =C2=A0x.bak</div><div><br></div><div= >$ cat x</div><div>=C2=A0TESTE teste</div><div><br></div><div>$ cat x.bak= =C2=A0</div><div>=C2=A0test string teste</div><div><br></div><div>=C2=A0So = far, so good.</div><div><br></div><div>=C2=A0my /etc/fstab</div><div><br></= div><div>UUID=3D1CACB8ABACB88136 /media/FILES ntfs defaults,permissions,noa= time 0 0</div><div><br></div><div><br></div><div>$ cd /media/FILES=C2=A0</d= iv><div><br></div><div>$ echo " test string teste" > x =C2=A0 = =C2=A0 =C2=A0 =C2=A0</div><div><br></div><div>$ sed --in-place=3D.bak '= s@tes.*string@TESTE@g' x</div><div><br></div><div>$ ls -l</div><div>---= ------- 1 maiko users =C2=A0 13 jun =C2=A06 23:42 =C2=A0x</div><div>-rw-r--= r-- 1 maiko users =C2=A0 19 jun =C2=A06 23:42 =C2=A0x.bak</div><div><br></d= iv><div>$ sudo cat x</div><div>=C2=A0TESTE teste</div><div><br></div><div>$= cat x.bak=C2=A0</div><div>=C2=A0test string teste</div><div><br></div><br>= This guy has a very similar problem too=C2=A0<a href=3D"https://unix.stacke= xchange.com/questions/244603/why-is-sed-changing-permissions-of-a-file-on-a= -cifs-mounted-share">https://unix.stackexchange.com/questions/244603/why-is= -sed-changing-permissions-of-a-file-on-a-cifs-mounted-share</a><br><br>Than= ks</div></div><div dir=3D"ltr">-- <br></div><div data-smartmail=3D"gmail_si= gnature"><div dir=3D"ltr"><span><p style=3D"margin:0px 0px 10px;font-family= :helvetica,arial,sans-serif;font-size:12px;line-height:14px"><span style=3D= "color:rgb(153,153,153)"><span style=3D"font-weight:bold">Maiko Cezar R Cos= ta</span>=C2=A0</span></p><p style=3D"margin:0px 0px 10px;font-family:helve= tica,arial,sans-serif;font-size:12px;line-height:14px"><a href=3D"http://ke= yserver1.pgp.com/vkd/DownloadKey.event?keyid=3D0xB69302C5F63F5F84" style=3D= "font-size:11.2px" target=3D"_blank">PGP Public Key</a><span style=3D"color= :rgb(153,153,153)"><br></span></p></span></div></div> --001a114dfc36e30dca055155bba6--
Maiko Cezar Rodrigues Costa <maiko.cezar@HIDDEN>
:bug-sed@HIDDEN
.
Full text available.bug-sed@HIDDEN
:bug#27269
; Package sed
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.