Age | Commit message (Collapse) | Author | Files | Lines |
|
This is the first of a series of patches that change path based
operations to operate on a struct smb_filename instead of a char *.
This same concept already exists in source4.
My goals for this series of patches are to eventually:
1) Solve the stream vs. posix filename that contains a colon ambiguity
that currently exists.
2) Make unix_convert the only function that parses the stream name.
3) Clean up the unix_convert API.
4) Change all path based vfs operation to take a struct smb_filename.
5) Make is_ntfs_stream_name() a constant operation that can simply
check the state of struct smb_filename rather than re-parse the
filename.
6) Eliminate the need for split_ntfs_stream_name() to exist.
My strategy is to start from the inside at unix_convert() and work my
way out through the vfs layer, call by call. This first patch does
just that, by changing unix_convert and all of its callers to operate
on struct smb_filename. Since this is such a large change, I plan on
pushing the patches in phases, where each phase keeps full
compatibility and passes make test.
The API of unix_convert has been simplified from:
NTSTATUS unix_convert(TALLOC_CTX *ctx,
connection_struct *conn,
const char *orig_path,
bool allow_wcard_last_component,
char **pp_conv_path,
char **pp_saved_last_component,
SMB_STRUCT_STAT *pst)
to:
NTSTATUS unix_convert(TALLOC_CTX *ctx,
connection_struct *conn,
const char *orig_path,
struct smb_filename *smb_fname,
uint32_t ucf_flags)
Currently the smb_filename struct looks like:
struct smb_filename {
char *base_name;
char *stream_name;
char *original_lcomp;
SMB_STRUCT_STAT st;
};
One key point here is the decision to break up the base_name and
stream_name. I have introduced a helper function called
get_full_smb_filename() that takes an smb_filename struct and
allocates the full_name. I changed the callers of unix_convert() to
subsequently call get_full_smb_filename() for the time being, but I
plan to eventually eliminate get_full_smb_filename().
|
|
Guenther
|
|
Guenther
|
|
Jeremy, we cannot just access cache_path() here without calling lp_load and
friends as well as parsing configfile from the commandline in order to make
"make test/selftest" find the correct conffile with path, etc.
I just changed it to pass the target tdbfilename as an argument, ok ?
Guenther
|
|
I used to track down the vlp problem, change the vlp test printer
not to use a static path of /tmp/vlp.tdb for the virtual print
database (as this will eventually fill up). Cause it to use
a virtual print database inside the cachepath.
Jeremy.
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Michael
|
|
Michael
|
|
This paves the way for hiding the typedef and the implementation
from the surface.
Michael
|
|
the system one is broken.
|
|
Guenther
|
|
Another babystep in order to make us pass RPC-SPOOLSS.
Guenther
|
|
Guenther
|
|
Guenther
|
|
Also remove ads_memfree(), which was only ever a wrapper around
SAFE_FREE, used only to free the DN from ads_get_ds().
This actually makes libgpo more consistant, as it mixed a talloc and a
malloc based string on the same element.
Andrew Bartlett
Signed-off-by: Günther Deschner <gd@samba.org>
|
|
In particular, this removes one more user of pull_utf8_allocate()
Andrew Bartlett
Signed-off-by: Günther Deschner <gd@samba.org>
|
|
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
metze
|
|
metze
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Why?? :-)
Another one of the little micro-optimizations that I just came across: If you
allocate a variable in a sub-block like the "fstring sharename" in
write_file(), gcc even with -O3 will allocate this variable unconditionally on
the stack at the beginning of the routine. So with eliminating this fstring we
cut 256 bytes of stack in a very hot code path writing to a file. It might make
us a bit more cache-friendly.
This would probably not be worth a second look if it involved larger code
changes, but this one was just too simple to let it pass :-)
|
|
Guenther
|
|
Günther, please check...
Michael
|
|
Jeremy.
|
|
Guenther
|
|
This took me almost a week to find, so here a little longer explanation:
When a windows client registers printer *status* change notifies using
spoolss_RemoteFindFirstChangeNotify, it registers them to a print server handle,
not a printer handle. We were then correctly monitoring the printer status
changes but were sending out the spoolss_RouterReplyPrinterEx via the back-channel
connection with job_id set to 0 (which we only may do for monitored printer
change status notifies on printer handlers, not print server handles). Windows
was then showing a new empty dummy printer icon in the explorer as it cannot
route the notify event to the approriate local handle. It also discarded the
content of the notify event message of course. With this, printer change notify for
pausing, resuming and purging printers nicely works again here.
Jerry, Tim and all other printing gurus, please check.
Guenther
|
|
Jeremy.
|
|
This was uncovered when the MAX FD limit was hit, causing an instant core
and invoking error reporting. This fix causes SMBD to exit, but without
building a core.
|
|
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
Guenther
|
|
metze
|
|
metze
|
|
metze
|
|
Michael
|
|
Jeremy.
|
|
|
|
metze
|