summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lib: Fix array size in audit_loggingAndreas Schneider2018-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ../lib/audit_logging/audit_logging.c: In function ‘json_add_timestamp’: ../lib/audit_logging/audit_logging.c:603:12: error: ‘%s’ directive output may be truncated writing up to 9 bytes into a region of size between 0 and 43 [-Werror=format-truncation=] "%s.%06ld%s", ^~ ../lib/audit_logging/audit_logging.c:606:3: tz); ~~ ../lib/audit_logging/audit_logging.c:600:2: note: ‘snprintf’ output between 8 and 70 bytes into a destination of size 50 snprintf( ^~~~~~~~~ timestamp, ~~~~~~~~~~ sizeof(timestamp), ~~~~~~~~~~~~~~~~~~ "%s.%06ld%s", ~~~~~~~~~~~~~ buffer, ~~~~~~~ tv.tv_usec, ~~~~~~~~~~~ tz); ~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu May 17 20:17:35 CEST 2018 on sn-devel-144
* s4:ntvfs: Fix string copy of share_nameAndreas Schneider2018-05-171-2/+7
| | | | | | | | | | | | | ../source4/ntvfs/ipc/rap_server.c:70:3: error: ‘strncpy’ specified bound 13 equals destination size [-Werror=stringop-truncation] strncpy((char *)r->out.info[j].info1.share_name, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ snames[i], ~~~~~~~~~~ sizeof(r->out.info[0].info1.share_name)); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib:util: Fix size types in debug.cAndreas Schneider2018-05-171-7/+7
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib:util: Fix parameter aliasing in tfork testAndreas Schneider2018-05-171-5/+2
| | | | | | | | | | | | | | | ../lib/util/tests/tfork.c:483:24: error: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Werror=restrict] ret = pthread_create(&threads[i], ^~~~~~~~~~~ ../lib/util/tests/tfork.c:486:10: (void *)&threads[i]); ~~~~~~~~~~~~~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:winbind: Fix uninitialzed variable warningAndreas Schneider2018-05-171-1/+1
| | | | | | | | | Raised by GCC8. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:passdb: Fix size of ascii_p16Andreas Schneider2018-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | ../source3/passdb/pdb_smbpasswd.c: In function ‘mod_smbfilepwd_entry’: ../source3/passdb/pdb_smbpasswd.c:1015:7: error: ‘:LCT-’ directive output may be truncated writing 5 bytes into a region of size between 0 and 255 [-Werror=format-truncat ion=] "%s:LCT-%08X:", ^~~~~ ../source3/passdb/pdb_smbpasswd.c:1015:4: note: using the range [0, 4294967295] for directive argument "%s:LCT-%08X:", ^~~~~~~~~~~~~~ In file included from ../source3/include/includes.h:23, from ../source3/passdb/pdb_smbpasswd.c:23: ../lib/replace/../replace/replace.h:514:18: note: ‘snprintf’ output between 15 and 270 bytes into a destination of size 255 #define slprintf snprintf ../source3/passdb/pdb_smbpasswd.c:1013:3: note: in expansion of macro ‘slprintf’ slprintf(&ascii_p16[strlen(ascii_p16)], ^~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:lib: Use memcpy() in escape_ldap_string()Andreas Schneider2018-05-171-1/+1
| | | | | | | | | | | | | | | | | ../source3/lib/ldap_escape.c: In function ‘escape_ldap_string’: ../source3/lib/ldap_escape.c:79:4: error: ‘strncpy’ output truncated before terminating nul copying 3 bytes from a string of the same length [-Werror=stringop-truncation] strncpy (p, sub, 3); ^~~~~~~~~~~~~~~~~~~ We concatenat and do not care about NUL-termination till the loop has finished. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s4:torture: Use strlcpy() in gen_name()Andreas Schneider2018-05-171-1/+1
| | | | | | | | | | | | | | ../source4/torture/basic/mangle_test.c: In function ‘gen_name’: ../source4/torture/basic/mangle_test.c:148:3: error: ‘strncpy’ output truncated before terminating nul copying 5 bytes from a string of the same length [-Werror=stringop-truncation] strncpy(p, "ABCDE", 5); ^~~~~~~~~~~~~~~~~~~~~~ BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* lib:util: Fix string check in mkdir_p()Andreas Schneider2018-05-171-2/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3-utils: fix format-truncation in smbpasswdGünther Deschner2018-05-171-23/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ../source3/utils/smbpasswd.c: In function ‘process_root’: ../source3/utils/smbpasswd.c:414:37: error: ‘$’ directive output may be truncated writing 1 byte into a region of size between 0 and 255 [-Werror=format-truncation=] slprintf(buf, sizeof(buf) - 1, "%s$", user_name); ^ In file included from ../source3/include/includes.h:23, from ../source3/utils/smbpasswd.c:19: ../lib/replace/../replace/replace.h:514:18: note: ‘snprintf’ output between 2 and 257 bytes into a destination of size 255 #define slprintf snprintf ../source3/utils/smbpasswd.c:414:3: note: in expansion of macro ‘slprintf’ slprintf(buf, sizeof(buf) - 1, "%s$", user_name); ^~~~~~~~ ../source3/utils/smbpasswd.c:397:35: error: ‘$’ directive output may be truncated writing 1 byte into a region of size between 0 and 255 [-Werror=format-truncation=] slprintf(buf, sizeof(buf)-1, "%s$", user_name); ^ In file included from ../source3/include/includes.h:23, from ../source3/utils/smbpasswd.c:19: ../lib/replace/../replace/replace.h:514:18: note: ‘snprintf’ output between 2 and 257 bytes into a destination of size 255 #define slprintf snprintf ../source3/utils/smbpasswd.c:397:3: note: in expansion of macro ‘slprintf’ slprintf(buf, sizeof(buf)-1, "%s$", user_name); ^~~~~~~~ cc1: some warnings being treated as errors BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
* s4-torture: fix format-truncation warning in smb2 session tests.Günther Deschner2018-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | ../source4/torture/smb2/session.c: In function ‘test_session_reauth5’: ../source4/torture/smb2/session.c:645:36: error: ‘\file.dat’ directive output may be truncated writing 9 bytes into a region of size between 1 and 256 [-Werror=format-truncation=] snprintf(fname, sizeof(fname), "%s\\file.dat", dname); ^~~~~~~~~~ ../source4/torture/smb2/session.c:645:2: note: ‘snprintf’ output between 10 and 265 bytes into a destination of size 256 snprintf(fname, sizeof(fname), "%s\\file.dat", dname); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../source4/torture/smb2/session.c:696:38: error: ‘\file2.dat’ directive output may be truncated writing 10 bytes into a region of size between 1 and 256 [-Werror=format-truncation=] snprintf(fname2, sizeof(fname2), "%s\\file2.dat", dname); ^~~~~~~~~~~ ../source4/torture/smb2/session.c:696:2: note: ‘snprintf’ output between 11 and 266 bytes into a destination of size 256 snprintf(fname2, sizeof(fname2), "%s\\file2.dat", dname); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-printing: fix format-truncation in print_queue_update()Günther Deschner2018-05-171-1/+1
| | | | | | | | | | | | | | | | ../source3/printing/printing.c: In function ‘print_queue_update’: ../source3/printing/printing.c:1809:42: error: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 244 [-Werror=format-truncation=] snprintf(key, sizeof(key), "MSG_PENDING/%s", sharename); ^~ ~~~~~~~~~ ../source3/printing/printing.c:1809:2: note: ‘snprintf’ output between 13 and 268 bytes into a destination of size 256 snprintf(key, sizeof(key), "MSG_PENDING/%s", sharename); BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-winbindd: remove unused fill_domain_username()Günther Deschner2018-05-172-21/+0
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3-winbindd: use fill_domain_username_talloc() in winbind.Günther Deschner2018-05-175-17/+46
| | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:winbind: Check if we have an open file descriptorAndreas Schneider2018-05-171-1/+4
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:winbind: Add sanity check when closing fdAndreas Schneider2018-05-171-2/+4
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* s3:utils: Do not segfault on error in DoDNSUpdate()Andreas Schneider2018-05-171-0/+1
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13440 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu May 17 17:28:28 CEST 2018 on sn-devel-144
* FIXUP: Improve memory handling on py_net_change_passwordAndrew Bartlett2018-05-171-2/+7
| | | | | | | | Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Noel Power <noel.power@suse.com> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Thu May 17 14:28:19 CEST 2018 on sn-devel-144
* python/samba/netcmd: net.change_password should be passed stringNoel Power2018-05-171-2/+4
| | | | | | | | | | | | password param which in python2 (is str) is incorrectly encoded before passing to net.change_password. python2 - password is either unicode or str, if str we should decode to get unicode (and then pass to net.change_password). python3 - password is either str or bytes, if bytes then decode (and pass as 'str' to net.change_password). Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/libnet: Allow passwords containing non ascii characters to be passedNoel Power2018-05-171-9/+14
| | | | | | | | | | | | Although we can pass unicode to py_net_change_password unfortunately in Python2 unicode strings are encoded with the default encoding (e.g. ascii) when extracting the unicode string to buffer. In Python3 the default encoding for "s" format is utf8. Use the "es" format instead of "s" so we can specify the encoding so behaviour is correct in py2/py3. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* testprogs/blackbox: Add test to set and use password with non-asciiNoel Power2018-05-171-0/+17
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* python/samba: Fix incorrect encode of passwordNoel Power2018-05-171-1/+5
| | | | | | | | | | | | | | In python2 you can encode a 'str' type which doesn't really make sense since it is already bytes (as such). In python3 this isn't possible you can't encode bytes or decode strings. Also because you can call encode on 'str' in python2 it tries to to what you wanted and it implicity calls decode('ascii') before performing the encode. This is why we get mention of ascii codec in the error. This patch should future proof for python3 also. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13435 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s4/setup/tests: Add test for non ascii password setting samba-toolNoel Power2018-05-171-0/+2
| | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=13435 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* winbindd: Remove an unused function prototypeVolker Lendecke2018-05-171-1/+0
| | | | | | | | | | This has been moved to async in 2009 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu May 17 11:30:18 CEST 2018 on sn-devel-144
* winbindd: Make "request_error()" static to winbindd.cVolker Lendecke2018-05-172-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: Make "request_ok()" static to winbindd.cVolker Lendecke2018-05-172-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: Remove the "old" non-bool dispatch tableVolker Lendecke2018-05-171-27/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: Make DOMAIN_INFO a proper async requestVolker Lendecke2018-05-175-111/+139
| | | | | | | This has an async code path hidden inside. Expose that properly. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_list_trusted_domains() -> bool_dispatch_tableVolker Lendecke2018-05-173-7/+8
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_priv_pipe_dir() -> bool_dispatch_tableVolker Lendecke2018-05-173-6/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_ccache_save() -> bool_dispatch_tableVolker Lendecke2018-05-173-12/+10
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_ccache_ntlm_auth() -> bool_dispatch_tableVolker Lendecke2018-05-173-14/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_dc_info() -> bool_dispatch_tableVolker Lendecke2018-05-173-10/+9
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_netbios_name() -> bool_dispatch_tableVolker Lendecke2018-05-173-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_domain_name() -> bool_dispatch_tableVolker Lendecke2018-05-173-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_ping() -> bool_dispatch_tableVolker Lendecke2018-05-173-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_info() -> bool_dispatch_tableVolker Lendecke2018-05-173-4/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: winbindd_interface_version() -> bool_dispatch_tableVolker Lendecke2018-05-173-5/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbindd: Introduce "bool_dispatch_table"Volker Lendecke2018-05-171-1/+28
| | | | | | | | | | | | | | This is meant to replace the synchronous "dispatch_table". The current dispatch_table assumes that every synchronous function does the request_ok or request_error itself. This mixes two concerns: Doing the work and shipping the reply to the winbind client. This new dispatch table will make it possible to centralize shipping the reply to the client. At a later stage this will enable easier statistics on how long request processing took precisely. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* ctdb: Drop configuration file ctdbd.confMartin Schwenke2018-05-1714-835/+1
| | | | | | | | | | | | | Drop function loadconfig(), replacing uses with "load_system_config ctdb". Drop translation of old-style configuration to new configuration file. Drop export of debugging variables. Drop documentation and configuration examples. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu May 17 07:03:04 CEST 2018 on sn-devel-144
* ctdb-tests: Switch local daemons to use new style configuration fileMartin Schwenke2018-05-171-8/+13
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-config: Add default ctdb.conf fileMartin Schwenke2018-05-172-0/+19
| | | | | | | Install it in RPM. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-docs: Add example configuration filesMartin Schwenke2018-05-174-2/+117
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-docs: Add ctdb.conf(5) cross references and documentation tweaksMartin Schwenke2018-05-177-26/+42
| | | | | | | Minor updates to other manual pages for compatibility. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-docs: Add ctdb.conf(5)Martin Schwenke2018-05-173-0/+595
| | | | | | | This documents the new Samba-style configuration file. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Clean up tests to not expose script optionsMartin Schwenke2018-05-172-4/+4
| | | | | | | | | | The tests still use the script options but the event scripts no longer see them exported from the test infrastructure. Testing now depends on the event scripts successfully fetching the options from the configuration file. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fetch recovery lock option from config file in 01.reclockMartin Schwenke2018-05-171-0/+18
| | | | | | | | Put it in a function so it is easy to move to common code just in case it is needed somewhere else. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Fetch database options from config file in scriptsMartin Schwenke2018-05-173-6/+8
| | | | | Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-scripts: Add function ctdb_get_db_options()Martin Schwenke2018-05-171-0/+37
| | | | | | | | This pulls database options from the configuration file, caches then and makes the values available in scripts. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
* ctdb-tests: Add ctdb-config wrapper stub for event script testsMartin Schwenke2018-05-171-0/+2
| | | | | | | | | | | | Create a shim helper around that simply invokes ctdb-config via its real location. This is needed because the event script tests set CTDB_HELPER_BINDIR to the stubs directory because all other helpers used by event script testing are currently stubs. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>