Michael Adam [Thu, 3 Jan 2008 10:33:17 +0000 (11:33 +0100)]
Fix a comment.
Michael
Michael Adam [Thu, 3 Jan 2008 10:32:00 +0000 (11:32 +0100)]
Rename libnet_smbconf_reg_createkey_internal to libnet_smbconf_reg_create_service_key.
Michael
Michael Adam [Thu, 3 Jan 2008 10:30:14 +0000 (11:30 +0100)]
Add libnet_conf API function libnet_smbconf_create_share().
And make libnet_smbconf_setparm() return error if the share
does not already exist. Adapt net_conf_addshare to this new
situation.
Michael
Günther Deschner [Thu, 3 Jan 2008 09:39:19 +0000 (10:39 +0100)]
Remove unused vars.
Guenther
Volker Lendecke [Thu, 3 Jan 2008 09:24:45 +0000 (10:24 +0100)]
Trivial simplification
... things you come across when you review code
Volker Lendecke [Thu, 3 Jan 2008 09:24:11 +0000 (10:24 +0100)]
Add comments
Jeremy was able to use this correctly without comments, so the code can't be
*that* bad :-)
Jeremy Allison [Thu, 3 Jan 2008 02:20:23 +0000 (18:20 -0800)]
Fix for bug #5163 from Laurent Pinchart <pinchart@skynet.be>
Failure to change password in ldap is mapped to NT_STATUS_UNSUCCESSFUL unconditionally.
Jeremy.
Jeremy Allison [Thu, 3 Jan 2008 01:37:39 +0000 (17:37 -0800)]
Convert the little caches in util_sock.c to use
the singleton memcache. Vl please check (passes
make valgrindtest).
Jeremy.
Michael Adam [Thu, 3 Jan 2008 00:26:31 +0000 (01:26 +0100)]
Don't leak: Use a temporary context for the admin token and free it.
Michael
Michael Adam [Thu, 3 Jan 2008 00:12:23 +0000 (01:12 +0100)]
Use libnet_smbconf_reg_open_path() in libnet_smbconf_drop().
Replaces creation of token and direct use of reg_open_path.
Michael
Michael Adam [Thu, 3 Jan 2008 00:07:30 +0000 (01:07 +0100)]
Abstract opening of registry path out of libnet_smbconf_reg_open_service_key().
Creates new function libnet_smbconf_reg_open_path().
Use libnet_smbconf_reg_open_path() directly in libnet_smbconf_reg_open_basekey().
Return error in libnet_smbconf_reg_open_service_key() when NULL
servicename is given.
Michael
Michael Adam [Wed, 2 Jan 2008 23:53:34 +0000 (00:53 +0100)]
Add debug output in error path.
Michael
Michael Adam [Wed, 2 Jan 2008 23:52:55 +0000 (00:52 +0100)]
Fix setting of error code in error path.
Michael
Michael Adam [Wed, 2 Jan 2008 23:51:36 +0000 (00:51 +0100)]
Use a better parameter name.
Michael
Michael Adam [Wed, 2 Jan 2008 23:49:53 +0000 (00:49 +0100)]
Rename libnet_smbconf_reg_open_path() to libnet_smbconf_reg_open_service_key().
Michael
Michael Adam [Wed, 2 Jan 2008 23:44:47 +0000 (00:44 +0100)]
Hey, it is 2008 now.
:-)
Michael
Michael Adam [Wed, 2 Jan 2008 23:43:29 +0000 (00:43 +0100)]
Choose a more apropriate parameter name.
Michael
Michael Adam [Wed, 2 Jan 2008 23:35:09 +0000 (00:35 +0100)]
Rename libnet_smbconf_reg_open_basepath() to libnet_smbconf_reg_open_basekey().
Michael
Gerald (Jerry) Carter [Wed, 2 Jan 2008 23:34:41 +0000 (17:34 -0600)]
Fix some C++ warnings (patch was Volker's) - implicit case from void* to char*
Gerald (Jerry) Carter [Wed, 2 Jan 2008 23:15:10 +0000 (17:15 -0600)]
Merge branch 'work/v3-2-test' into v3-2-test
Gerald (Jerry) Carter [Wed, 2 Jan 2008 20:54:25 +0000 (14:54 -0600)]
use C99 bool return types (true & false).
Gerald (Jerry) Carter [Wed, 2 Jan 2008 20:50:59 +0000 (14:50 -0600)]
Make sure that wbcLookupSid() and wbcLookupRids() use talloc()'d memory.
Follows existing convention that all returned memory should be freed with
wbcFreeMemory() and not directly with free(). Noticed by Volker. Txs.
Jeremy Allison [Wed, 2 Jan 2008 19:56:07 +0000 (11:56 -0800)]
Attempt to fix bug #3617. Mix of patches from Volker and
myself. Use standard dlinklist macros.
Jeremy.
Michael Adam [Wed, 2 Jan 2008 16:08:28 +0000 (17:08 +0100)]
Use the proper boolean constants.
Michael
Günther Deschner [Wed, 2 Jan 2008 12:50:31 +0000 (13:50 +0100)]
Fix libnetapi (resolve dependency on libwbclient).
Guenther
Günther Deschner [Wed, 2 Jan 2008 12:50:13 +0000 (13:50 +0100)]
Fix libsmbclient (resolve dependency on libwbclient).
Guenther
Günther Deschner [Wed, 2 Jan 2008 12:48:54 +0000 (13:48 +0100)]
Make libsmbsharemodes.so work again (fix unresolved tdb symbols).
Guenther
Volker Lendecke [Sat, 8 Dec 2007 11:29:09 +0000 (12:29 +0100)]
Convert call_trans2open to create_file()
Volker Lendecke [Sat, 8 Dec 2007 11:05:41 +0000 (12:05 +0100)]
Convert reply_mknew to create_file
Volker Lendecke [Fri, 7 Dec 2007 13:23:10 +0000 (14:23 +0100)]
Convert reply_open_and_X to create_file
Volker Lendecke [Fri, 7 Dec 2007 13:19:07 +0000 (14:19 +0100)]
Convert reply_open to create_file
Günther Deschner [Wed, 2 Jan 2008 12:22:19 +0000 (13:22 +0100)]
Add test_shlibs to Makefile.
Guenther
Günther Deschner [Wed, 2 Jan 2008 11:55:53 +0000 (12:55 +0100)]
Happy new year !
Guenther
Volker Lendecke [Tue, 1 Jan 2008 11:55:29 +0000 (12:55 +0100)]
Use NULL instead of 0
"struct security_descriptor" has pointers, not integers inside
Michael Adam [Mon, 31 Dec 2007 02:57:45 +0000 (03:57 +0100)]
Make the last two helper functions in libnet_conf.c static.
Now the registry backend is completely hidden from the API.
Michael
Michael Adam [Mon, 31 Dec 2007 02:55:22 +0000 (03:55 +0100)]
Make grouping in if statement more explicit.
Michael
Michael Adam [Mon, 31 Dec 2007 02:25:54 +0000 (03:25 +0100)]
Fix a permissions error in reg_deletekey_recursive().
Michael
Michael Adam [Mon, 31 Dec 2007 02:02:39 +0000 (03:02 +0100)]
Change net_conf_import() to only use libnet_conf API functions.
More precisely, only import_process_service() is changed.
This removes all references to registry code from net_conf.c.
net_conf_import() is currently -- like net_conf_addshare() -- also
considered a high-level add-on, not an API function.
Michael
Michael Adam [Mon, 31 Dec 2007 00:56:18 +0000 (01:56 +0100)]
Rewrite net_conf_addshare() to only use libnet_conf API functions.
Also exit on error if the share already exists.
net_conf_addshare() is considered a high level utility function.
It should not be an libnet_conf API function in itself since it is
kind of arbitrary.
Michael
Michael Adam [Mon, 31 Dec 2007 00:14:44 +0000 (01:14 +0100)]
Rename libnet_smbconf_key_exists() to libnet_smbconf_share_exists()
and move it to the api section of libnet_conf.c
Michael
Michael Adam [Sun, 30 Dec 2007 21:30:21 +0000 (22:30 +0100)]
Remove an unused variable.
Michael
Michael Adam [Sun, 30 Dec 2007 21:29:54 +0000 (22:29 +0100)]
Remove an unused variable.
Michael
Michael Adam [Sun, 30 Dec 2007 21:27:45 +0000 (22:27 +0100)]
Remove all d_fprintf-s from libnet_conf.c
Replacing them buy DEBUG statements and filling in
d_fprintfs in callers in net_conf.c.
Michael
Jeremy Allison [Sun, 30 Dec 2007 21:10:29 +0000 (13:10 -0800)]
As the encryption is stream based there's no reason
oplock breaks can't be encrypted. If we have multiple
contexts I should probably attach them to the connection
struct, but for now use the global context number.
Jeremy.
Jeremy Allison [Sun, 30 Dec 2007 06:42:20 +0000 (22:42 -0800)]
Fix error message.
Jeremy.
Jeremy Allison [Sun, 30 Dec 2007 06:39:52 +0000 (22:39 -0800)]
Added -e, --encrypt option to smbclient that immediately
forces encrypted smb after initial connect. Will document
for 3.2 official release.
Jeremy.
Jeremy Allison [Sun, 30 Dec 2007 06:36:49 +0000 (22:36 -0800)]
Allow encryption context setup on IPC$.
Jeremy.
Michael Adam [Sun, 30 Dec 2007 02:12:11 +0000 (03:12 +0100)]
Make pdb_tdb honour a private dir overridden in smb.conf.
One lp_private_dir() has to be used instead of get_dyn_PRIVATE_DIR()
to determine the location of the passdb.tdb.
I noticed this when running make test as a "normal user" from a
build, where I had done "make install" as root before, and so
the passdb.tdb could not be accessed during the startup phase
"CREATE TEST ENVIRONMENT IN ./st ..." in selftest.sh.
Michael
Michael Adam [Sat, 29 Dec 2007 21:29:33 +0000 (22:29 +0100)]
Make libnet_smbconf_reg_open_path() static.
Michael
Michael Adam [Sat, 29 Dec 2007 21:29:00 +0000 (22:29 +0100)]
Make libnet_smbconf_reg_open_basepath() static.
Michael
Michael Adam [Sat, 29 Dec 2007 21:11:09 +0000 (22:11 +0100)]
Remove list_values() from net_conf.c - it is not needed any more.
Also make libnet.c:libnet_smbconf_format_registry_value() static.
(There are nor more external callers.)
Michael
Michael Adam [Sat, 29 Dec 2007 21:09:51 +0000 (22:09 +0100)]
Use libnet_smbconf_get_config() in net_conf_list().
This leaves only output logic in net_conf_list().
Michael
Michael Adam [Sat, 29 Dec 2007 21:08:11 +0000 (22:08 +0100)]
Add a function libnet_smbconf_get_config() to libnet_conf.c
This gets the whole config as a set of lists (of share names
and corresponding lists of parameter names and values). The function
is an aggregate of libnet_smbconf_get_share_names() and
libnet_smbconf_getshare().
Michael
Michael Adam [Sat, 29 Dec 2007 20:59:28 +0000 (21:59 +0100)]
Include libnet/libnet.h in libnet_conf.c to have prototypes available.
Michael
Jeremy Allison [Sat, 29 Dec 2007 22:43:32 +0000 (14:43 -0800)]
Use correct size value for linearize call.
Jeremy.
Volker Lendecke [Sat, 29 Dec 2007 22:00:49 +0000 (23:00 +0100)]
Remove tiny code duplication
ndr_size_security_descriptor does the same as sec_desc_size
Volker Lendecke [Sat, 29 Dec 2007 21:54:51 +0000 (22:54 +0100)]
Make [un]marshall_sec_desc use librpc/ndr
Volker Lendecke [Sat, 29 Dec 2007 21:47:03 +0000 (22:47 +0100)]
Make use of [un]marshall_sec_desc
Volker Lendecke [Sat, 29 Dec 2007 21:16:31 +0000 (22:16 +0100)]
Remove tiny code duplication
sid_size did the same as ndr_size_dom_sid
Volker Lendecke [Sat, 29 Dec 2007 20:41:23 +0000 (21:41 +0100)]
Fix a panic
get_root_nt_token asks for "struct nt_user_token". talloc_get_type is not smart
enough to see that this is the same as NT_USER_TOKEN... :-)
Volker Lendecke [Thu, 27 Dec 2007 19:00:13 +0000 (20:00 +0100)]
Apply some const
Michael Adam [Sat, 29 Dec 2007 16:06:49 +0000 (17:06 +0100)]
Return NULL (instead of unchanged) for no shares/parameters defined.
Michael
Michael Adam [Sat, 29 Dec 2007 16:02:27 +0000 (17:02 +0100)]
Dont return count - 1 but count from libnet_smbconf_reg_get_values().
Michael
Michael Adam [Sat, 29 Dec 2007 13:38:42 +0000 (14:38 +0100)]
Make sure libnet_smbconf_get_share_names() always lists "global" first.
And don't return count-1 but count.
Michael
Michael Adam [Sat, 29 Dec 2007 13:32:13 +0000 (14:32 +0100)]
Move talloc-appending a string to an array to its own helper function
libnet_smbconf_add_string_to_array().
Michael
Volker Lendecke [Sat, 29 Dec 2007 15:35:51 +0000 (16:35 +0100)]
Fix uninitalized variables
Volker Lendecke [Sat, 29 Dec 2007 12:10:25 +0000 (13:10 +0100)]
Attempt to fix the AIX make test failures
For some reason AIX does not return the sender address in the AF_UNIX recvfrom.
So the faked netbios name lookup does not work with socket wrapper, nmbd can't
know where to send the reply. This patch works around this by telling smbclient
explicitly where to connect.
If there's any AIX experts listening -- how do I get the sender address from
AF_UNIX recvfrom?
Volker
Michael Adam [Sat, 29 Dec 2007 12:02:22 +0000 (13:02 +0100)]
Fix a const warning.
Michael
Michael Adam [Sat, 29 Dec 2007 11:55:42 +0000 (12:55 +0100)]
Rename libnet_smbconf_getshares() to libnet_smbconf_get_share_names().
Michael
Michael Adam [Sat, 29 Dec 2007 11:53:19 +0000 (12:53 +0100)]
Add a comment header for libnet_smbconf_getshares().
Michael
Michael Adam [Sat, 29 Dec 2007 11:52:09 +0000 (12:52 +0100)]
Move functionality of net_conf_listshares() to libnet_conf.c
into new function libnet_smbconf_getshares().
Michael
Michael Adam [Sat, 29 Dec 2007 02:38:13 +0000 (03:38 +0100)]
Move functionality of net_conf_showshare() to libnet_conf.c
The functionality is moved to a new function libnet_smbconf_getshare().
This returns the parameters of the given share as two lists: the list
of parameter names and the list of matching (formatted) parameter values.
The retrieval and formatting is done in a new internal helper function
libnet_smbconf_reg_get_values() that is to become the replacement for
list_values() from net_conf.c once functionality of net_conf_list() has
been moved to libnet_conf, too.
Michael
Volker Lendecke [Mon, 24 Dec 2007 13:12:54 +0000 (14:12 +0100)]
passdb.tdb is located in the private directory
Jerry, as part of
d6cdbfd87 the default location of passdb.tdb has changed from
the private directory to the state directory. I think because passdb.tdb holds
the password hashes, it is reasonable to keep this next to the smbpasswd file.
Please review and potentially push.
Thanks,
Volker
Michael Adam [Sat, 29 Dec 2007 01:27:20 +0000 (02:27 +0100)]
Make the main net_conf functions static in net_conf.c
Michael
Michael Adam [Sat, 29 Dec 2007 01:26:33 +0000 (02:26 +0100)]
Add a couple of comment headers to the main libnet_conf functions.
Michael
Michael Adam [Sat, 29 Dec 2007 01:18:44 +0000 (02:18 +0100)]
Add a comment header for libnet_smbconf_format_registry_value().
Michael
Michael Adam [Sat, 29 Dec 2007 01:16:38 +0000 (02:16 +0100)]
Handle NULL talloc context in libnet_smbconf_format_registry_value().
Maybe we should generate a new context instead of returning NULL?
Michael
Michael Adam [Sat, 29 Dec 2007 01:12:33 +0000 (02:12 +0100)]
Hide the registry backend from libnet_smbconf_getparm().
Return a formatted string of the value instead.
Michael
Michael Adam [Sat, 29 Dec 2007 00:17:39 +0000 (01:17 +0100)]
Rename format_value() to libnet_smbconf_format_registry_value().
Michael
Michael Adam [Fri, 28 Dec 2007 23:05:23 +0000 (00:05 +0100)]
Move format_value() to libnet_conf.c.
Michael
Volker Lendecke [Fri, 28 Dec 2007 16:24:39 +0000 (17:24 +0100)]
Convert get_root_nt_token to memcache
Volker Lendecke [Fri, 28 Dec 2007 16:16:35 +0000 (17:16 +0100)]
Remove a global
Volker Lendecke [Fri, 28 Dec 2007 16:09:57 +0000 (17:09 +0100)]
don't store cache_readonly in gencache
tdb won't allow us to write anyway
Volker Lendecke [Fri, 28 Dec 2007 16:02:34 +0000 (17:02 +0100)]
Remove static zeros
Volker Lendecke [Fri, 28 Dec 2007 16:02:07 +0000 (17:02 +0100)]
Remove a static array
This might be worth it, mangle_hash is hardly used these days
Volker Lendecke [Fri, 28 Dec 2007 12:13:29 +0000 (13:13 +0100)]
Convert csamuser to memcache
Volker Lendecke [Sat, 22 Dec 2007 11:02:33 +0000 (12:02 +0100)]
bin/vlp needs a dependency on @LIBWBCLIENT_SHARED@
This failed to link if you compile with -j.
Karolin Seeger [Thu, 27 Dec 2007 13:08:40 +0000 (14:08 +0100)]
Improve error messages of 'net rpc user [add|delete]' commands.
Karolin
Jeremy Allison [Fri, 28 Dec 2007 08:02:13 +0000 (00:02 -0800)]
Ensure we turn off POSIX large read/write if encryption
is mandatory or signing is on.
Jeremy.
Jeremy Allison [Fri, 28 Dec 2007 07:51:03 +0000 (23:51 -0800)]
Add the capability to set "smb encrypt = required"
on a share (or global) and have the server reply with
ACCESS_DENIED for all non-encrypted traffic (except
that used to query encryption requirements and set
encryption state).
Jeremy.
Volker Lendecke [Thu, 27 Dec 2007 20:31:08 +0000 (21:31 +0100)]
Fix setting the initial permission bits
This fixes a make test failure on Solaris. When creating a new file,
file_set_dosmode() called from open_file_ntcreate calculates a new permission
mask, very likely different from what had been calculated in
open_file_ntcreate. Further down we overwrote the newly calculated value with
SMB_FCHMOD_ACL, ignoring what file_set_dosmode had calculated.
Why did Linux not see this? fchmod_acl on a newly created file without acls
would not retrieve an acl at all, whereas under Solaris acl(2) returns
something even for files with just posix permissions returns something.
Jeremy, given that we have very similar code in 3.0.28 this might also explain
some of the bug reports that people have concerning ACLs on new files.
Volker
P.S: This one took a while to find...
Jeremy Allison [Fri, 28 Dec 2007 00:54:07 +0000 (16:54 -0800)]
Add "smb encrypt" parameter. Can be set to "no, yes, required".
Currently if set required this is not enforced. I'll be adding
that soon.
Jeremy.
Volker Lendecke [Thu, 27 Dec 2007 23:12:14 +0000 (00:12 +0100)]
Fix the non-gcc branch of "likely"
Volker Lendecke [Thu, 27 Dec 2007 20:30:15 +0000 (21:30 +0100)]
Remove a silly static
Volker Lendecke [Thu, 27 Dec 2007 18:56:44 +0000 (19:56 +0100)]
Fix the build
Volker Lendecke [Thu, 27 Dec 2007 16:41:19 +0000 (17:41 +0100)]
Wrap the DEBUG checks in a "unlikely"
On my Laptop with some limited netbench runs this gains about 1.5% of
performance. When looking at the assembler output I would suspect the biggest
gain is by the fact that with this in place the calls to the debug functions is
moved to the function end, out of the way of the normal code paths. valgrind
tests pending I would suspect this to be much more cache friendly.
Comments?
Volker
Jeremy Allison [Thu, 27 Dec 2007 18:18:22 +0000 (10:18 -0800)]
Add CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP capability to
our reported caps.
Jeremy.
Jeremy Allison [Thu, 27 Dec 2007 01:17:36 +0000 (17:17 -0800)]
Encryption works better when you add the client decrypt code :-).
Jeremy.
Jeremy Allison [Thu, 27 Dec 2007 01:12:36 +0000 (17:12 -0800)]
Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
Volker Lendecke [Wed, 26 Dec 2007 23:22:07 +0000 (00:22 +0100)]
typos