From: Robert Yang <liezhi.yang@windriver.com>
To: Seebs <seebs@seebs.net>,
oe-core <openembedded-core@lists.openembedded.org>
Subject: Re: About pseudo's chmod
Date: Mon, 1 Aug 2016 16:57:12 +0800 [thread overview]
Message-ID: <579F0EE8.3080009@windriver.com> (raw)
In-Reply-To: <F5BAFB71-1FCC-4F9D-999C-5960E8CD7213@seebs.net>
On 08/01/2016 04:42 PM, Seebs wrote:
> On 1 Aug 2016, at 0:57, Robert Yang wrote:
>
>> Sorry, the steps were wrong, they should be:
>> 1) Out of pseudo:
>> $ umask 0022
>> $ touch file1
>> 2) Under pseudo:
>> $ ln file1 file2
>> $ chmod 777 file2
>> $ ls -l file1 file2
>> We can see that both file1 and file2's mode is 0777.
>> But if we remove file2:
>> $ rm -f file2
>> $ ls file1
>> Now file1's permission is 0755, not 0777 or 0644, it should be 0777 here.
>
> The short answer is: If you aren't tracking a file in pseudo, we don't make
> promises about its behavior. Normally, we don't touch them, but if there's hard
> links to them that are being touched, well. And having a hard link that is
> tracked, and another that isn't, is probably impossible to support. I definitely
> don't want to keep database entries for files that have been deleted, that way
> lies madness and possible database corruption; for instance, if we do that, and
> you make a new file of the same type, it'll show up as having those permissions,
> with only a path-mismatch warning in the database to suggest what went wrong.
>
> I would say that the probable correct answer is either "make the original file
> be tracked" or "don't use hard links in this case".
Hi Peter,
How about we track the src when hardlink, for example:
$ ln oldpath newpath
Track both oldpath and newpath. The patch for pseudo is:
diff --git a/ports/unix/guts/linkat.c b/ports/unix/guts/linkat.c
index ec27e47..521b8fa 100644
--- a/ports/unix/guts/linkat.c
+++ b/ports/unix/guts/linkat.c
@@ -62,6 +62,10 @@
* if the thing linked is a symlink.
*/
pseudo_client_op(OP_LINK, 0, -1, -1, newpath, &buf);
+ /*
+ * Track oldpath in case it isn't tracked.
+ */
+ pseudo_client_op(OP_LINK, 0, -1, -1, oldpath, &buf);
errno = save_errno;
// Robert
>
> Note that, under older pseudo, the file would have ended up 0777. The behavior
> of silently masking out 022 from underlying filesystem permissions is entirely
> intentional. During some debugging quite a while back, we discovered a quirk in
> oe-core, plus a strange behavior of
> GNU tar, which between them resulted in some sstage directories getting
> unpacked with mode 0777.
>
> And we *really* don't want the build system generating files which other users
> can modify, especially not in stuff that's intended to go into a root
> filesystem. So stripping out those bits in the underlying filesystem is
> intentional.
>
> If you were actually root, yes, the original file would have its mode changed to
> 0777. But we should never be *caring* about the mode bits on
> raw files outside of pseudo, except that we want them to allow owner
> write permissions and not allow group or other write permissions. If the
> file's permissions matter to the build system or generated stuff, the
> file should be tracked by pseudo.
>
> -s
next prev parent reply other threads:[~2016-08-01 8:57 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-05 10:23 About pseudo's chmod Robert Yang
2016-07-05 13:10 ` Mark Hatle
2016-07-05 14:10 ` Robert Yang
2016-07-29 7:38 ` Robert Yang
2016-07-29 7:40 ` Robert Yang
2016-07-29 16:02 ` Seebs
2016-08-01 5:57 ` Robert Yang
2016-08-01 8:42 ` Seebs
2016-08-01 8:57 ` Robert Yang [this message]
2016-08-01 18:17 ` Seebs
2016-08-01 20:01 ` Richard Purdie
2016-08-01 20:17 ` Seebs
2016-08-01 22:55 ` Richard Purdie
2016-08-01 23:36 ` Mark Hatle
2016-08-02 3:39 ` Seebs
2016-08-02 1:52 ` Robert Yang
2016-08-02 3:43 ` Seebs
2016-08-02 6:07 ` Robert Yang
2016-08-02 6:08 ` Robert Yang
2016-08-02 6:30 ` Seebs
2016-08-02 6:44 ` Robert Yang
2016-08-02 6:50 ` Seebs
2016-08-02 8:32 ` Robert Yang
2016-08-02 19:16 ` Seebs
2016-08-02 19:18 ` Burton, Ross
2016-08-02 15:12 ` Mark Hatle
2016-08-02 19:19 ` Seebs
2016-08-02 19:39 ` Mark Hatle
2016-08-02 19:53 ` Seebs
2016-08-02 3:37 ` Seebs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=579F0EE8.3080009@windriver.com \
--to=liezhi.yang@windriver.com \
--cc=openembedded-core@lists.openembedded.org \
--cc=seebs@seebs.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox