summaryrefslogtreecommitdiff
path: root/lib/smbconf
Commit message (Collapse)AuthorAgeFilesLines
* lib:smbconf: Fix code spellingAndreas Schneider2023-04-142-5/+5
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* s3:lib: Change file_modtime() to return an error code and a struct timespec.Jeremy Allison2023-01-271-2/+16
| | | | | | | | | | Removes need for external stat() code when checking for timechange. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jan 27 08:30:35 UTC 2023 on atb-devel-224
* spelling fixes for 4.18 (errror implemenation proces Controler)Michael Tokarev2023-01-261-1/+1
| | | | | | | | | | | | | | One of changes is somewhat interesting, it is "tfork waiter proces" process title in tfork.c. I wonder why no one noticed this before. There's another similar process title in there, "tfork waiter process(%d)". Hopefully no one does grep for "proces$" (and there's no reason to). Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jan 26 20:46:11 UTC 2023 on atb-devel-224
* lib/smbconf: expose smbconf error codes to python wrapperJohn Mulligan2022-06-081-5/+34
| | | | | | | | | | | | | | | | | | | | The smbconf library defines an enum of error codes that can be returned from the C calls. The error codes were getting stored in the python SMBConfError type but it was not easy to access or obvious what the integer code represented. This change makes it easier to get the returned error code: via a `error_code` attribute on the exception value. It also exposes the integer constants to the module. Simple tests for a few of the more obvious error codes check that this new error handling correctly exposes the error code values. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Wed Jun 8 13:13:10 UTC 2022 on sn-devel-184
* lib/smbconf: add python wrapper functions for transaction managementJohn Mulligan2022-05-061-0/+52
| | | | | | | | | | | | | | The smbconf API supports transactions. This changes adds wrapper functions transaction_start, transaction_commit, and transaction_cancel. It also adds tests for the functions, one of which demonstrates a semi-pythonic way to use said functions. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri May 6 18:14:30 UTC 2022 on sn-devel-184
* lib/smbconf: add delete_global_parameter method to SMBConfJohn Mulligan2022-05-061-0/+24
| | | | | | | | Add a delete_global_parameter method wrapping smbconf_delete_global_parameter. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: add delete_parameter method to SMBConfJohn Mulligan2022-05-061-0/+24
| | | | | | | | Add a delete_parameter method wrapping smbconf_delete_parameter. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: add create_set_share method to SMBConfJohn Mulligan2022-05-061-0/+124
| | | | | | | | | | | Add the create_set_share method wrapping smbconf_create_set_share. This method is one of the most complex as it must "unpack" the list of key-value pairs from python and convert that to a `struct smbconf_service` for the smbconfig C API. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: add delete_share method to SMBConfJohn Mulligan2022-05-061-0/+23
| | | | | | | | Add a delete_share method wrapping smbconf_delete_share. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: add set_global_parameter method to SMBConfJohn Mulligan2022-05-061-0/+26
| | | | | | | | Add a set_global_parameter method wrapping smbconf_set_global_parameter. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: add set_parameter method to SMBConfJohn Mulligan2022-05-061-0/+26
| | | | | | | | Add a set_parameter method wrapping smbconf_set_parameter. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: add drop method to SMBConfJohn Mulligan2022-05-061-0/+19
| | | | | | | | Add a drop method wrapping smbconf_drop. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: add create_share method to SMBConfJohn Mulligan2022-05-061-0/+24
| | | | | | | | Add a create_share method wrapping smbconf_create_share. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: add a python function for raising smbconf exceptionsJohn Mulligan2022-05-061-0/+15
| | | | | | | | | | | | | | | | | The previous implementation in C was private to the module. Add a small python wrapper function so that a different python module may reuse the implementation. The python level function is prefixed with "_" to mark it as "private". Only future cooperating modules in the samba sources should make use of it. The function is shared at the python level as per the recommendation: https://stackoverflow.com/a/2136670 Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* lib/smbconf: move python smbconf type definition to headerJohn Mulligan2022-05-062-8/+37
| | | | | | | | | | Moving the definition of the type to a header file will allow future reuse of the C-type fields in a different C-API python module. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* libsmbconf: Avoid initial declaration inside 'for' loopAnoop C S2022-04-251-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Building Samba on CentOS 7 with GCC version 4.8.5 results in the following error: [2725/3398] Compiling libcli/echo/tests/echo.c ../../lib/smbconf/pysmbconf.c: In function 'py_from_smbconf_service': ../../lib/smbconf/pysmbconf.c:72:2: error: 'for' loop initial declarations are only allowed in C99 mode for (uint32_t i = 0; i < svc->num_params; i++) { ^ ../../lib/smbconf/pysmbconf.c:72:2: note: use option -std=c99 or -std=gnu99 to compile your code ../../lib/smbconf/pysmbconf.c: In function 'obj_share_names': ../../lib/smbconf/pysmbconf.c:181:2: error: 'for' loop initial declarations are only allowed in C99 mode for (uint32_t i = 0; i < num_shares; i++) { ^ ../../lib/smbconf/pysmbconf.c: In function 'obj_get_config': ../../lib/smbconf/pysmbconf.c:267:2: error: 'for' loop initial declarations are only allowed in C99 mode for (uint32_t i = 0; i < num_shares; i++) { ^ Therefore declare variables right at the start aligning to default C90 standard available with GCC version on CentOS 7. Signed-off-by: Anoop C S <anoopcs@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Apr 25 13:23:18 UTC 2022 on sn-devel-184
* lib/smbconf: add an initial set of python bindingsJohn Mulligan2022-04-212-0/+436
| | | | | | | | | | | | | | | | | | | The smbconf library provides a generic interface for Samba configuration backends. In order to access these backends, including the read-write registry backend, we add a new python binding for smbconf - the general interface library. This initial set of bindings covers some basic read-only calls. This includes function calls for listing shares (config sections) and getting the parameters of the shares. The `init_txt` construction function must be used to get a new SMBConf object. This is done so that other backends, specifically the registry backend from source3 can be used in the future. Those will provide their own construction funcs. Signed-off-by: John Mulligan <jmulligan@redhat.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz Reviewed-by: David Mulder <dmulder@suse.com> Reviewed-by: Guenther Deschner <gd@samba.org>
* waf: add library dependency for sendfile on SolarisBjörn Jacke2019-02-171-1/+1
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* Correct "occured" typos.Chris Lamb2017-02-221-22/+22
| | | | | | Signed-off-by: Chris Lamb <chris@chris-lamb.co.uk> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* lib/smbconf: remove const warningStefan Metzmacher2014-11-141-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmbconf: add smbconf_create_set_shareDavid Disseldorp2013-05-282-0/+90
| | | | | | | | | | | | | | This call creates a new share definition, using the parameters provided with a smbconf_service structure. Such an interface allows for simple cloning of services with: smbconf_get_share(conf_ctx, mem_ctx, base_sharename, &base_service_def); base_service_def->name = clone_sharename; smbconf_create_set_share(conf_ctx, base_service_def); Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: fix documentation of transaction calls.Michael Adam2013-05-281-2/+7
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* smbconf: remove python shebang from wscript_buildMichael Adam2012-05-111-2/+0
| | | | | Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri May 11 22:05:32 CEST 2012 on sn-devel-104
* libsmbconf: Define a doxygen group for libsmbconf.Andreas Schneider2011-05-101-0/+11
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_transaction_cancel().Andreas Schneider2011-05-101-0/+10
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_transaction_commit().Andreas Schneider2011-05-101-0/+13
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_transaction_start().Andreas Schneider2011-05-101-0/+11
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_delete_global_includes().Andreas Schneider2011-05-101-0/+8
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_delete_includes().Andreas Schneider2011-05-101-0/+12
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_set_global_includes().Andreas Schneider2011-05-101-0/+12
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_set_includes().Andreas Schneider2011-05-101-0/+15
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_get_global_includes().Andreas Schneider2011-05-101-0/+15
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_get_includes().Andreas Schneider2011-05-101-0/+17
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_delete_global_parameter().Andreas Schneider2011-05-101-0/+13
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_delete_parameter().Andreas Schneider2011-05-101-0/+13
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_get_global_parameter().Andreas Schneider2011-05-101-0/+17
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_get_parameter().Andreas Schneider2011-05-101-0/+17
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_set_global_parameter().Andreas Schneider2011-05-101-0/+16
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_set_parameter().Andreas Schneider2011-05-101-0/+15
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_delete_share().Andreas Schneider2011-05-101-0/+11
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_get_share().Andreas Schneider2011-05-101-0/+18
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_create_share().Andreas Schneider2011-05-101-0/+11
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_share_exists().Andreas Schneider2011-05-101-0/+10
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_get_share_names().Andreas Schneider2011-05-101-0/+15
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_get_config().Andreas Schneider2011-05-101-4/+22
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_drop().Andreas Schneider2011-05-101-0/+9
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_changed().Andreas Schneider2011-05-101-0/+20
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_shutdown().Andreas Schneider2011-05-101-0/+6
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_is_writeable().Andreas Schneider2011-05-101-0/+8
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* libsmbconf: Document smbconf_backend_requires_messaging().Andreas Schneider2011-05-101-2/+14
| | | | Signed-off-by: Michael Adam <obnox@samba.org>