We messed up smbc_readdirplus :-(

Jeremy Allison jra at samba.org
Mon Jan 7 23:11:18 UTC 2019


On Mon, Jan 07, 2019 at 02:20:30PM -0800, Jeremy Allison wrote:
> Hi Puran,
> 
> I'm looking at Red Hat bug:
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1569868
> 
> and realized we made a mistake in the
> implementation of smbc_readdirplus().
> 
> struct libsmb_file_info
> 
> should have been defined as a *superset*
> of the stat struct that smbc_stat
> returns, but currently it is missing
> the st_ino, st_dev, st_mode and st_blocks
> fields in order to be a superset of struct stat.
> 
> We actually *have* this data as returned
> from the SMB2_FIND_ID_BOTH_DIRECTORY_INFO
> call when enumerating the directory, but
> then throw it away when populating the
> struct libsmb_file_info struct.
> 
> I think the best way forward is to
> add a smbc_readdirplus_ex() call that
> returns a new 'struct libsmb_file_info_ex'
> struct that includes these extra fields.
> 
> Comments from other Samba Team members ?
> 
> I wish we'd gotten it right the first
> time though, but that's probably my (our?)
> fault :-(.

Or what about smbc_readdirstat() that
just returns a name plus a filled-in
stat struct using the same internal
algorithms that smbc_stat does ?

Jeremy.



More information about the samba-technical mailing list