[PATCH] Fix bug #9130 - Certain xattrs cause Windows error 0x800700FF
Jeremy Allison
jra at samba.org
Thu Mar 28 13:13:53 MDT 2013
On Thu, Mar 28, 2013 at 12:12:04PM -0700, Jeremy Allison wrote:
> On Thu, Mar 28, 2013 at 07:42:01PM +0100, David Disseldorp wrote:
> > On Thu, 28 Mar 2013 10:55:05 -0700
> > Jeremy Allison <jra at samba.org> wrote:
> >
> > > On Thu, Mar 28, 2013 at 10:42:55AM -0700, Jeremy Allison wrote:
> > > >
> > > > New version that fixes these issues (and adds one code
> > > > clarification change Andreas mailed to me privately).
> > > >
> > > > Please review and push if you're happy.
> > >
> > > Scratch that - a request from David crossed in the email :-).
> > >
> > > Here's a version with both David and Andreas's suggestions
> > > included.
> >
> > Looks good Jeremy. One variation for ntvfs:
> >
> > diff --git a/source4/ntvfs/posix/pvfs_qfileinfo.c b/source4/ntvfs/posix/pvfs_qfileinfo.c
> > index 4309f3b..f3bd791 100644
> > --- a/source4/ntvfs/posix/pvfs_qfileinfo.c
> > +++ b/source4/ntvfs/posix/pvfs_qfileinfo.c
> > @@ -96,16 +96,17 @@ NTSTATUS pvfs_query_ea_list(struct pvfs_state *pvfs, TALLOC_CTX *mem_ctx,
> > eas->num_eas = 0;
> > for (i=0;i<num_names;i++) {
> > int j;
> > - eas->eas[i].flags = 0;
> > - eas->eas[i].name.s = names[i].name.s;
> > - eas->eas[i].value = data_blob(NULL, 0);
> > + eas->eas[eas->num_eas].flags = 0;
> > + eas->eas[eas->num_eas].name.s = names[i].name.s;
> > + eas->eas[eas->num_eas].value = data_blob(NULL, 0);
> > for (j=0;j<ealist->num_eas;j++) {
> > - if (strcasecmp_m(eas->eas[i].name.s,
> > + if (strcasecmp_m(eas->eas[eas->num_eas].name.s,
> > ealist->eas[j].name) == 0) {
> > - if (ealist->eas[i].value.length == 0) {
> > + if (ealist->eas[j].value.length == 0) {
> > continue;
> > }
> > - eas->eas[i].value = ealist->eas[j].value;
> > + eas->eas[eas->num_eas].value
> > + = ealist->eas[j].value;
> > eas->num_eas++;
> > break;
> > }
> >
> > What do you think?
>
> No, that's actually incorrect. smbtorture raw.eas actually
> tests for asking for an EA that dosn't exist by name using
> an SMB1 EA list query, and Windows returns an EA entry containing
> the requested name, with a zero length. So the current code
> in both smbd and ntvfs for that case is correct.
>
> We could expand the test to ask for 2 EA's in a list, one
> that exists and one that doesn't, but my guess is it does
> return an entry for each EA name requested, with a zero
> length showing that value doesn't exist (if you want to
> add that test feel free :-).
Ah. Actually thinking about it that means your request
to update eas->num_eas++ inside the strcasecmp_m test
was an error, as we need to return a NULL value for a
non existing EA.
Jeremy.
More information about the samba-technical
mailing list