From: Petr Vorel <pvorel@suse.cz>
To: Martin Doucha <mdoucha@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v1] chdir01.c: set umask to 0 within setup
Date: Mon, 11 Mar 2024 15:11:47 +0100 [thread overview]
Message-ID: <20240311141147.GA431476@pevik> (raw)
In-Reply-To: <c7027971-9aab-4261-bbd7-f9f221c9387c@suse.cz>
> On 08. 03. 24 0:21, Wei Gao wrote:
> > On Thu, Mar 07, 2024 at 04:18:35PM +0100, Martin Doucha wrote:
> > > Hi,
> > > you're trying to fix a vfat mount quirk. We should fix that in the LTP
> > > library instead, e.g. by setting umask(0) and then restoring the original
> > > value inside safe_mount().
> > Thanks for your feedback.
> > For chdir case i just use Petr's below suggestion(Detail info you can check patch link
> > in below):
> > "2) tests, which set .mount_device = 1 and have more restrictive umask will not
> > work. Workaround would be to not use it and mount manually in the setup().
> > Or, reset umask with umask(0)."
> > https://patchwork.ozlabs.org/project/ltp/patch/20240219134845.22171-1-wegao@suse.com/
> I'd rather avoid mounting in setup unless you need to set special mount
> parameters.
> Mount-time umask does not matter for most filesystem. The exception are vfat
> and exfat which don't have any internal concept of access permissions and
> instead you need to either pass mount options that'll define access
> permissions for all files and directories, otherwise current process umask
> value will be used as the default.
+1
> So resetting umask to 0 before mount and restoring immediately after is
> perfectly safe. But we should later fix it properly by implementing
> per-filesystem mount options.
Yeah, I was thinking about it, but haven't implement it yet because not many
tests need it and it can be mostly workarounded. Do you know tests (beside this
one) which need it?
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-03-11 14:12 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-06 10:46 [LTP] [PATCH v1] chdir01.c: set umask to 0 within setup Wei Gao via ltp
2024-03-07 15:18 ` Martin Doucha
2024-03-07 21:33 ` Petr Vorel
2024-03-07 23:08 ` Petr Vorel
2024-03-07 23:21 ` Wei Gao via ltp
2024-03-08 9:31 ` Martin Doucha
2024-03-11 14:11 ` Petr Vorel [this message]
2024-03-08 8:32 ` [LTP] [PATCH v2] safe_macros.c: set umask to 0 within safe_mount Wei Gao via ltp
2024-03-08 9:16 ` Petr Vorel
2024-03-08 10:00 ` Martin Doucha
2024-03-15 10:31 ` Petr Vorel
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=20240311141147.GA431476@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=mdoucha@suse.cz \
/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