1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

129 Commits

Author SHA1 Message Date
Michael Adam
2722dd357c s3:fix bug #6371, unsuccessful net conf setparm leaves empty share
Wrap creation of share and setting of parameter into a transaction.

Michael
2009-05-17 22:19:24 +02:00
Michael Adam
38d02c5d85 s3:net conf: support dangling parameters by specifying "" as the section name.
for {get,set,del}parm

Michael
2009-04-27 11:21:02 +02:00
Martin Schwenke
448b434a86 In net_conf_import, start a transaction when importing a single share.
Commit d69c3db9d44ad5d9fd1f5d7a9499f3bd79ecfb47 caused the transaction
start to be conditional but the commit is still unconditional, so an
error occurs when importing a single share.

An alternate fix would be to return the transaction start to be
unconditional but then it would occur before other error checking.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Michael Adam <obnox@samba.org>
2009-04-16 10:38:38 +02:00
Andrew Bartlett
3b3e21bd9b Convert Samba3 to use the common lib/util/charset API
This removes calls to push_*_allocate() and pull_*_allocate(), as well
as convert_string_allocate, as they are not in the common API

To allow transition to a common charcnv in future, provide Samba4-like
strupper functions in source3/lib/charcnv.c

(the actual implementation remains distinct, but the API is now shared)

Andrew Bartlett
2009-04-14 12:53:56 +10:00
Michael Adam
36c1a52a57 s3:net conf: don't store share names as lower case, but as given.
Michael
2009-04-02 00:30:13 +02:00
Michael Adam
0945789031 s3:net conf: reduce memory usage of "net conf import".
"net conf import" was wrapped in one big transaction.
This lead to MAX_TALLOC_SIZE being exceeded at roughly
1500 shares. This patch resolves that problem by
limiting the top level transactions in "net conf import"
to 100 shares.

Michael
2009-03-04 22:49:24 +01:00
Michael Adam
42b8d6b308 s3:net: wrap net conf import into one big transaction
This speeds up "net conf import" of a file with 2000 shares
from 11 minutest to 1m50s on my box.

Michael
2009-02-26 11:05:23 +01:00
Michael Adam
55f2cb18ad s3:net conf: remove check for sharename being a usernam in "net conf addshare"
This is useless and can be overriden by "net conf setparm" anyways.

Michael
2009-02-06 11:05:50 +01:00
Jelmer Vernooij
ddcab787c4 Rename dos_errstr() to win_errstr() for consistency with Samba 4. 2008-11-01 17:19:26 +01:00
Kai Blin
255bdb2602 net: Rename functable3 to functable, get rid of old functables
(This used to be commit bb7c5fc4ec)
2008-06-10 09:48:21 +02:00
Kai Blin
1be1be3334 net: Make "net conf" use a functable similar to functable3
(This used to be commit b8382bc3af)
2008-06-10 09:48:03 +02:00
Kai Blin
f576910944 net: Remove globals
(This used to be commit 1e9319cf88)
2008-05-10 09:22:27 +02:00
Michael Adam
fb9232c0a9 libsmbconf: rewrite API to use smbconf_service struct
instead of lists of strings and counters directly...

Michael
(This used to be commit 17415e2dc4)
2008-04-23 01:43:31 +02:00
Michael Adam
ed85ea4248 net conf: adapt output of NULL share params in net conf list.
don't list NULL share name and don't indent these parameters

Michael
(This used to be commit 0212b38913)
2008-04-15 17:40:27 +02:00
Michael Adam
770b1923dc net conf: simplify logic in test output of net conf import.
Michael
(This used to be commit 367c8b133b)
2008-04-15 17:40:27 +02:00
Michael Adam
7624bab963 net conf: fix output of out-of-share parameters in test mode import
Michael
(This used to be commit 5424e07e7d)
2008-04-15 17:40:27 +02:00
Michael Adam
d2d82394a4 net conf: use the new smbconf_init() dispatcher instead of explicit backend init.
Michael
(This used to be commit 281c9287a3)
2008-04-13 20:04:44 +02:00
Michael Adam
35d6068f25 libsmbconf: remove the bool verbatim parameter from txt backend init function.
Always be verbatim for now. Backend config options may be added later
via some private data pointer.

Michael
(This used to be commit e8bafcfbf4)
2008-04-13 20:04:43 +02:00
Michael Adam
bfc4aba398 net conf: use talloc and talloc_strdup_lower throughout all net conf functions.
Michael
(This used to be commit 977cc98989)
2008-04-10 01:29:03 +02:00
Michael Adam
6f7fcdcda5 net conf: implement "net conf delincludes".
usage: "net conf delincludes <servicename>"

This is equivalent to "net conf setincludes <servicename>"
(without further arguments).

Michael
(This used to be commit a1d09f34ec)
2008-04-10 01:29:03 +02:00
Michael Adam
f3cfc1446e net conf: implement a "net conf setincludes" command.
given zero or more filenames as command line parameters

Michael
(This used to be commit ab51e4d44c)
2008-04-10 01:29:03 +02:00
Michael Adam
68fb75857b net conf: implement "net conf getincludes".
Michael
(This used to be commit 30bc48623c)
2008-04-10 01:29:02 +02:00
Michael Adam
9765828d97 net conf: add diagnostic message for failure to load text file.
Michael
(This used to be commit 8f2c3efa67)
2008-04-10 01:29:02 +02:00
Michael Adam
52a16b4945 net conf: reduce indentation by grouping testmode code together.
Michael
(This used to be commit 97f9cb8575)
2008-04-10 01:29:02 +02:00
Michael Adam
2a94369946 net conf: don't drop config in testmode
Michael
(This used to be commit 74e87b9775)
2008-04-10 01:29:02 +02:00
Michael Adam
a98c08c151 net conf: fix import to correctly add includes (at the end)
Michael
(This used to be commit 3e81db8370)
2008-04-10 01:29:02 +02:00
Michael Adam
3d38f143df libsmbconf: add a "verbatim" parameter to smbconf_init_txt_simple().
Michael
(This used to be commit b9e72b402d)
2008-04-10 01:28:56 +02:00
Michael Adam
65b4a93c4a net_conf: fix non-testmode import function.
Michael
(This used to be commit cd17cc745a)
2008-03-27 00:32:09 +01:00
Michael Adam
0bdcc557ee net_conf: reformat - re-indent one function call.
Michael
(This used to be commit 9ef9d4c4e7)
2008-03-26 14:55:06 +01:00
Michael Adam
3253cffced net_conf: add casts to avoid compiler warnings.
Michael
(This used to be commit 1c6b9a0ac3)
2008-03-26 14:55:06 +01:00
Michael Adam
0234cc8bdd net_conf: rename "ctx" to "mem_ctx" for clarity.
There are also smbconf contexts arount...

Michael
(This used to be commit 5171df66eb)
2008-03-26 14:55:06 +01:00
Michael Adam
c2acc30bcb net_conf: use talloc_stackframe() instead of talloc_init().
Michael
(This used to be commit ab4fd03705)
2008-03-26 14:55:06 +01:00
Michael Adam
ca2f9297c2 net_conf: fix import function by using the new text backend of smbconf.
Originally, lp_load() was used to import files to registry.
This had several bugs. Most notably, options explicitly set to
default values were silently dropped, and all parametric options
were ignored.

This new implementation reads config from the text backend and
stuffs everything verbatim in to the registry backend.

Michael
(This used to be commit e41c6650f8)
2008-03-26 14:55:06 +01:00
Michael Adam
6f7cfeddd6 libsmbconf: add a "path" variable to the conf context.
This is passed to the module init routines.
In case of the registry, this is the path of the
basekey in registry, that is to be used, defaulting
to KEY_SMBCONF (HKLM\software\samba\smbconf), when
NULL is given. This is the only case currently used.

In order to support other keys, registry initialization
for smbconf has to be changed to support different keys.

Michael
(This used to be commit 96434d9dc7)
2008-03-21 18:19:24 +01:00
Michael Adam
fececde181 libsmbconf: add backend specific init function.
Hide generic init function taking smbconf_ops argument
from public api.

Michael
(This used to be commit b3f6920ccb)
2008-03-21 02:25:56 +01:00
Michael Adam
23b1d721b8 libsmbconf: rename smbconf_close() to smbconf_shutdown().
Michael
(This used to be commit 797b26ad3f)
2008-03-21 02:25:56 +01:00
Michael Adam
adf5bf554c libsmbconf: rename smbconf_open() to smbconf_init().
That's more appropriate.

Michael
(This used to be commit d7bd9bb8aa)
2008-03-21 02:25:56 +01:00
Michael Adam
153ed797e6 libsmbconf: change the API to always take the smbconf_ctx parameter first.
..for consistency. Exception: the open/init function, where the smbconf_ctx
is created from the given talloc context.

Michael
(This used to be commit 304dba6cb2)
2008-03-21 02:25:55 +01:00
Michael Adam
6274929b1e libsmbconf: rename all occurrences of libnet_conf_ to smbconf_ .
Michael
(This used to be commit 097af0309d)
2008-03-17 18:03:02 +01:00
Michael Adam
801eeaec09 Add and modify comments in net_conf.c
Michael
(This used to be commit b3afc8391d)
2008-01-13 23:45:57 +01:00
Michael Adam
a6bf13ce97 Add explicit creation of shares to net conf import function.
It has been removed from libnet_conf_set_parameter().

Michael
(This used to be commit b5c533b06c)
2008-01-13 23:30:08 +01:00
Michael Adam
1ee6d3e1ee Introduce a libnet_conf context created by libnet_conf_open().
The libnet_conf_ctx stores the information necessary to interoperate
with the configuration. It is created by calling libnet_conf_open()
and destroyed by calling libnet_conf_close(). The context is passed
to all the libnet_conf functions. It currently stores the token to
access the registry. Later, it could store more data, e.g. the server
to connect to, credentials, and so on. For support of other backends
than registry or support of remote configuration, only the open
function will have to be changed.

In net_conf, the calls to the actual net_conf functions is wrapped
into a function that calls libnet_conf_open()/_close(). Thus an
individual variant of net_conf_runfunction2() and functable2 is
used to cope with functions being called by the wrapper with the
additional libnet_conf_ctx argument.

Michael
(This used to be commit c2a9346faa)
2008-01-13 02:14:34 +01:00
Michael Adam
517ad5318d Fix spacing - spaces mixed with tabs.
Michael
(This used to be commit a4ef828102)
2008-01-04 21:16:48 +01:00
Michael Adam
dbdaa5eeec Fix a comment.
Michael
(This used to be commit fc9c3f39b5)
2008-01-04 21:09:55 +01:00
Michael Adam
dee8e32d8d Remove the word "registry" from the help output of the "net conf" command.
Michael
(This used to be commit 8d9e3e08f3)
2008-01-04 21:05:59 +01:00
Michael Adam
34fb783965 Update the introductory comment to net_conf.c to mention linbet_conf.
Michael
(This used to be commit e166b88637)
2008-01-04 21:05:59 +01:00
Michael Adam
b1472c0956 Remove the final regdb_close() from net_conf.c
This is to hide the registry from net_conf.
Right now, it does not harm if "net conf" does not close
the registry file explicitly just before exiting.
I am working out a proper way of handling open/close
operations transparently in the libnet_conf library.

Michael
(This used to be commit 790ef78944)
2008-01-04 19:52:22 +01:00
Michael Adam
2a8722d4c3 Fix the behaviour of "net conf setparm" to create the share if necessary.
This moves functionality taken away from libnet_conf_set_parameter() to the
higher level user frontend function. (Somehow I thought I had done this
already ... :-)

Michael
(This used to be commit fc0fca980f)
2008-01-04 19:49:57 +01:00
Günther Deschner
77219ddd22 Fix build warning.
Guenther
(This used to be commit a43125d9e9)
2008-01-04 17:43:23 +01:00
Michael Adam
5470f8f638 Make libnet_conf handle opening/initialization of the registry.
Open state is currently tracked by a global variable
to avoid double initialization.

Later, this can possibly be replaced by a conf-context
created by an initialization function and passed around
to the other api functions.

Michael
(This used to be commit 77713e7764)
2008-01-03 15:33:09 +01:00