| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The libsmbclient interface has suffered from difficulty of improvement and
feature enrichment without causing ABI breakage. Although there were a number
of issues, the primary ones were:
(a) the user of the library would manually manipulate the context structure
members, meaning that nothing in the context structure could change other
than adding stuff at the end;
(b) there were three methods of setting options: setting bits in a flags field
within the context structure, setting explicit options variables within an
options structure in the context structure, and by calling the
smbc_option_set() function;
(c) the authentication callback did not traditionally provide enough
information to the callee which required adding an option for a callback
with a different signature, and now there are requests for even more
information at the callback, requiring yet a third signature and option to
set it (if we implement that feature).
This commit provides a reorganization of the code which fixes (a) and (b).
The context structure is now entirely opaque, and there are setter and getter
functions for manipulating it. This makes maintaining ABI consistency much,
much easier.
Additionally, the options setting/getting has been unified into a single
mechanism using smbc_option_set() and smbc_option_get().
Yet to be completed is a refactoring of the authentication callback (c).
The test programs in examples/libsmbclient have been modified (if necessary;
some applications require no changes at all) for the new API and a few have
been minimally tested.
Derrell
(cherry picked from commit d4b4bae8ded824d06ad5ab0e219f71187ee5c771)
|
| |
|
|
|
|
| |
Karolin
|
|
|
|
|
|
|
|
|
| |
Windows. If the requested mode is zero, we instead send the appropriate one
of 0x80 (NORMAL) or 0x10 (DIRECTORY).
Thanks Jeremy!
Derrell
|
| |
|
|
|
|
|
|
|
| |
If we're going to cache connections to IPC$, we'd better also cache the policy
handle and not use a stack-based handle that's invalid on subsequent calls.
Derrell
|
|
|
|
|
|
|
|
|
|
| |
We create a kludged inode based on the checksum of the path. We therefore
need to use the same (full) path when calculating it in both smbc_stat() and
smbc_fstat().
If struct stat has an rdev field, set it to zero.
Derrell
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
passing 3 fstrings/sizeof(fstrings) as 3.0.x did. Found
by Derrell. Derrell please test !
Thanks,
Jeremy.
|
|/
|
|
|
|
|
|
|
|
| |
When the capability of using full names for DOS attributes was added, a bug
was introduced which caused the wrong number of bytes to be returned. This
patch to smbc_listxattr_ctx() fixes the problem.
Thanks to Jack Schmidt for this patch.
Derrell
|
|
|
|
|
| |
encrypt level and smb_encrypt_on to query it.
Jeremy.
|
|
|
|
| |
least surprise for callers
|
|
|
|
|
|
| |
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
|
|
|
|
|
| |
No more temptations to use static length strings.
Jeremy.
|
|
|
|
|
|
| |
Remove all vestiges of pstring (except for smbctool as noted
in previous commit).
Jeremy
|
| |
|
|
|
|
| |
Jeremy.
|
|
|
|
|
| |
check. Passes valgrind tests I've run in examples/libsmbclient.
Jeremy.
|
|
|
|
|
| |
Now I can really start removing fixed length strings...
Jeremy.
|
|
|
|
|
|
|
| |
Remove pstring from libsmb/clidfs.c except for a nasty
hack (that will be removed when pstrings are gone from
client/).
Jeremy.
|
|
|
|
|
|
| |
Make us very explicit about how long a talloc ctx
should last.
Jeremy.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As we use talloc_tos() in inner libsmbclient/ functions more and more, we need
to make sure not to create memleaks by not free'ing talloc stackframes. This
patch wraps all calls in libsmbclient.c that are publically exported into a
talloc_stackframe()/talloc_free() pair.
Jeremy, Derrell, can you check this?
Thanks,
Volker
|
| |
|
|
|
|
|
|
|
| |
This is a different fix than the bug reporter (Evgeniy Dushistov
<dushistov at mail.ru>, thanks!) created, but it lives without the boolean
status variable. Untested so far, but I can not add attachments to bugs right
now. But to me this looks really obvious.
|
|
|
|
|
|
|
|
| |
zero_addr(&ss). All current uses were always of the
AF_INET form, so simplify the call. If in the future
we need to zero an addr to AF_INET6 this can be
done separately.
Jeremy.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
|
|
|
|
|
|
|
| |
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
|
|
|
|
|
|
|
|
|
|
| |
IPv6 in winbindd, but moves most of the socket functions that were
wrongly in lib/util.c into lib/util_sock.c and provides generic
IPv4/6 independent versions of most things. Still lots of work
to do, but now I can see how I'll fix the access check code.
Nasty part that remains is the name resolution code which is
used to returning arrays of in_addr structs.
Jeremy.
|
| |
|
|
|
|
|
|
|
|
|
| |
I've wanted
to make this change for ages, but now with the issue of "open" requiring it,
this is the time to just do all of them.
Derrell
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
on a NAS
device. The device resets a NBT connection on port 139 when it receives a
NetBIOS keepalive request. That request should be supported when NetBIOS is
in use; Windows is behaving badly.
libsmbclient needs a way to determine if a connection is still alive, and
was using a NetBIOS keepalive request if port 139 was in use (on the
assumption that it was probably NBT), and getpeername() when port 139 was
not being used (assuming naked transport).
This patch simplifies the code by exclusively using getpeername() to check
whether a connection is still alive. The NetBIOS keepalive request is
optional anyway (with preference being given to using TCP mechanisms for the
same purpose), so this should be both simpler and more reliable.
Derrell
|
|
|
|
| |
Michael
|
| |
|
|
|
|
|
|
|
| |
Windows Explorer doesn't complain about the order (and so that they get
interpreted properly).
Derrell
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Win2000 ignored
the request, presumably due to the PROTECTED flag not being set. Setting
that flag (in make_sec_desc()) has much wider implications than just to
libsmbclient, so instead of modifying that, we'll remove security
descriptors by setting the number of ACEs to zero. At some point, we might
want to look into whether we should actually be setting the PROTECTED flag
in the DACL.
Reference http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/distrib/dsce_ctl_qxju.mspx?mfr=true
Derrell
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to me,
prs_mem_free() is not the function to be called to free memory allocated by
prs_alloc_mem(). I've added a comment so others may not get bitten too.
- Remove incorrect memory free calls added yesterday to replace SAFE_FREE.
The memory is actually now on a talloc context, so gets freed by the caller
when that context is freed. We don't need to free it iternally.
Derrell
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pointer was
incremented too far in some circumstances. In these cases, only the first
of multiple concatenated strings would be seen.
- Working on bug 4649 pertaining to delete an ACL, this fixes the reported
crash. It appears to have been an incomplete switchover from malloc to
talloc, as the memory was still being freed with SAFE_FREE.
Deleting ACLs still doesn't work. Although a valid request is sent to the
server and a SUCCESS response is returned, the method that's used in
libsmbclient for deleting ACLs seems to be incorrect. In looking at the
samba4 torture tests, it appears that we should be turning on the INHERIT
flag if we want to delete the ACL. (I could use some assistance on the
proper flags to send, from anyone familiar with this stuff.)
- Apply patch from SATOH Fumiyasu to fix bug 4750. smbc_telldir_ctx() was not
returning a value useful to smbc_lseekdir_ctx().
Derrell
|
| |
|
|
|
|
| |
Jeremy.
|
|
|
|
| |
Guenther
|
|
|
|
|
| |
Long overdue fix....
Jeremy.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
subseqeuent
attempts to set attributes to fail.
- I also noticed that missing attributes were setting an invalid return string
by getxattr(), e.g. if there was not group, the return string had "GROUP:;"
instead of excluding the GROUP attribute entirely as it should. The big
problem with the way it was, is that the string could not then be passed to
setxattr() and parsed.
|
|
|
|
|
|
| |
return the
required size of a buffer needed to contain the extended attributes.
|
|
|
|
|
|
| |
maybe also for 3.0.25
metze
|
|
|
|
|
|
|
|
|
| |
process deep dfs links (ie. links that go to non root
parts of a share). Make the directory handling conanonical
in POSIX and Windows pathname processing.
dfs should not be fully working in client tools. Please
bug me if not.
Jeremy.
|
|
|
|
|
|
|
|
| |
string
server_len is usually 256 (fstring).
Correctly terminate saving the lenght
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Should fix bug 4115 (but needs confirmation from OP). If the kerberos use
flag is set in the context, then also pass it to smbc_attr_server for use by
cli_full_connection()
- Should fix bug 4309 (but needs confirmation from OP). We no longer send a
keepalive packet unconditionally. Instead, we assume (yes, possibly
incorrectly, but it's the best guess we can make) that if the connection is
on port 139, it's netbios and otherwise, it isn't. If netbios is in use, we
send a keepalive packet. Otherwise, we check that the connection is alive
using getpeername().
|
|
|
|
|
|
|
|
|
| |
Instead,
add [ref] pointers where necessary (top-level [ref] pointers,
by spec, don't appear on the wire).
This brings us closer to the DCE/RPC standard again.
|