public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: Philippe Cerfon <philcerf@gmail.com>
Cc: cygwin-patches@cygwin.com
Subject: Re: [PATCH] include/cygwin/limits.h: add XATTR_{NAME,SIZE,LIST}_MAX
Date: Tue, 6 Jun 2023 15:28:54 +0200	[thread overview]
Message-ID: <ZH80lgpsfWwCZp+R@calimero.vinschen.de> (raw)
In-Reply-To: <CAN+za=MTBHNWV+-4rMoBb_zefPO7OG2grySUFdV-Eoa2aQg_uw@mail.gmail.com>

Hi Philippe,

On Jun  6 03:14, Philippe Cerfon wrote:
> Hey Corinna, et al.
> 
> On Mon, Jun 5, 2023 at 9:05 PM Corinna Vinschen
> <corinna-cygwin@cygwin.com> wrote:
> > - Whatever that's good for, we actually allow bigger values right
> >   now.  For compat reasons we only allow attributes starting with
> >   the "user." prefix, and the *trailing* part after "user." is
> >   allowed to be 255 bytes long, because we don't store the "user."
> >   prefix in the EA name on disk.  So in fact, XATTR_NAME_MAX should
> >   be 255 + strlen("user.") == 260.
> 
> I haven't given to much though into that right now (just about to go
> for 2 weeks on vacation), but if "we" (Cygwin) allow now names up to
> 260 bytes, because we don't store the "user." .. doesn't that mean
> users could set XATTRs, that in the end couldn't be read by e.g. Linux
> (should there be, or ever be in the future, support for reading
> FAT/NTFS' EAs as XATTRs.... e.g. from the Linux FAT/NTFS fs drivers)?

No, that's no problem.  The names on disk are actually just 255 chars
long, so the Linux kernel will handle them just fine.  It's only Cygwin
which should expose 260 chars to user space to emulate the "user."
prefix.

> > - If we actually define these values in limits.h, it would also be a
> >   good idea to use them in ntea.cc and to throw away the MAX_EA_*_LEN
> >   macros.
> 
> Done so in a 2nd commit.
> But that commit, right now, really just replaces the name!
> MAX_EA_NAME_LEN was set 256, so presumably with the null terminator...
> while now it would be set to 260, which seems wrong.

Yes, it is wrong, because the value of MAX_EA_NAME_LEN / XATTR_NAME_MAX
is used for array size definitions as well as comparisons.

> Please just adapt if necessary,... or at least I won't likely be able
> to update the patch until in about 2 weeks or so.

No worries, we're in no hurry.


Thanks,
Corinna

  reply	other threads:[~2023-06-06 13:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAN+za=MhQdD2mzYxqVAm9ZwBUBKsyPiH+9T5xfGXtgxq1X1LAA@mail.gmail.com>
2023-05-30 20:04 ` Brian Inglis
2023-06-05 19:05   ` Corinna Vinschen
2023-06-06  1:04     ` Philippe Cerfon
2023-06-06  1:14     ` Philippe Cerfon
2023-06-06 13:28       ` Corinna Vinschen [this message]
2023-06-06 15:17         ` Philippe Cerfon
2023-06-07 10:06           ` Corinna Vinschen
2023-06-16 14:09             ` Philippe Cerfon
2023-06-16 15:04               ` Corinna Vinschen
2023-06-16 15:43                 ` Philippe Cerfon
2023-06-16 19:49                   ` Corinna Vinschen
2023-06-16 19:52                     ` Philippe Cerfon
2023-06-19  8:53                       ` Corinna Vinschen

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=ZH80lgpsfWwCZp+R@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    --cc=philcerf@gmail.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).