summaryrefslogtreecommitdiff
path: root/source3/utils/smbtree.c
Commit message (Collapse)AuthorAgeFilesLines
* s3:utils: Migrate smbtree to new cmdline option parserAndreas Schneider2021-05-281-16/+25
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* utils: Convert smbtree to use libsmbclientVolker Lendecke2020-04-181-301/+165
| | | | | | | | | | | | | We have the domain browsing functionality in libsmbclient, don't duplicate it in smbtree with special code. Not too much gain in lines of code, but the new code is much more regular and reuses functionality provided elsewhere. This removes the "-b" option from smbtree, libsmbclient always does that. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbtree: Add "fail:" target, more failure paths with followVolker Lendecke2020-04-181-4/+7
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbtree: Align integer typesVolker Lendecke2020-04-081-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Apr 8 16:22:17 UTC 2020 on sn-devel-184
* libsmb: Move get_ipc_connect_master_ip_bcast() to smbtree.cVolker Lendecke2020-04-081-0/+45
| | | | | | | ... the only user Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3/utils: Fix double free error with smbtreeNoel Power2020-04-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | ==3632== WORKGROUP \\ATP \\ATP\IPC$ IPC Service () ==3632== Invalid read of size 8 ==3632== at 0x773C926: poptResetContext (in /usr/lib64/libpopt.so.0.0.0) ==3632== by 0x773E5DD: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0) ==3632== by 0x10A8BC: main (smbtree.c:354) ==3632== Address 0x16085e00 is 640 bytes inside a block of size 784 free'd ==3632== at 0x4C2F1AD: free (vg_replace_malloc.c:530) ==3632== by 0x773E6F7: poptFreeContext (in /usr/lib64/libpopt.so.0.0.0) ==3632== by 0x10A84B: main (smbtree.c:342) ==3632== Block was alloc'd at ==3632== at 0x4C2FE45: calloc (vg_replace_malloc.c:711) ==3632== by 0x773C79A: poptGetContext (in /usr/lib64/libpopt.so.0.0.0) ==3632== by 0x10A829: main (smbtree.c:339) ==3632== BUG: https://bugzilla.samba.org/show_bug.cgi?id=14332 Signed-off-by: Noel Power <npower@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Wed Apr 1 18:51:43 UTC 2020 on sn-devel-184
* s3: utils: smbtree. Ensure we don't call cli_RNetShareEnum() on an SMB1 ↵Jeremy Allison2019-10-301-0/+5
| | | | | | | | | | | | | connection. Last unprotected call of cli_RNetShareEnum(). Not a libsmbclient bug here but might as well fix the last caller as part of the fix for the bug. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14174 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: free popt context in utilsSwen Schillig2019-08-221-0/+2
| | | | | | | | If done with popt context it should be free'd. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s3:utils: Use C99 initializer for poptOption in smbtreeAndreas Schneider2019-01-281-3/+24
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:lib: Move popt_common_credentials to separate fileChristof Schmitt2018-09-071-1/+1
| | | | | | | | | | | This is only used by command line utilities and has additional dependencies. Move to a separate file to contain the dependencies to the command line tools. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* libsmb: Give namequery.c its own headerVolker Lendecke2018-04-111-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: client tools: Call popt_free_cmdline_auth_info() on all normal exits.Jeremy Allison2017-05-091-0/+1
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: client tools. Remove direct access to struct user_auth_info ↵Jeremy Allison2017-05-091-1/+1
| | | | | | | | | | *cmdline_auth_info. Only access through utility functions. Remove all the local pointer aliases that were just being set to cmdline_auth_info in the client tools. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:popt_common: let POPT_COMMON_CREDENTIALS imply logfile and conffile loadingStefan Metzmacher2016-12-201-3/+2
| | | | | | | | | | | All users of POPT_COMMON_CREDENTIALS basically need the same logic, while some ignore a broken smb.conf and some complain about it. This will allow the future usage of config options in the credential post processing. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:popt_common: simplify popt_common_credentials handlingStefan Metzmacher2016-11-151-22/+5
| | | | | | | | | | | | | | | | This offers a global 'struct user_auth_info *cmdline_auth_info', similar to the 'cmdline_credentials' we have in source4/lib/cmdline/popt_common.c. And we create that in the POPT_CALLBACK_REASON_PRE stage and finalize it in the POPT_CALLBACK_REASON_POST stage. That means much less boring work for the callers and more freedom to change the user_auth_info internals in future. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: utils: Convert all uses of uint32/16/8 to _t.Richard Sharpe2015-05-071-3/+3
| | | | | | | | Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 7 04:53:39 CEST 2015 on sn-devel-104
* lib: load_case_tables() -> smb_init_locale()Volker Lendecke2015-03-241-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:utils: avoid argv related const warningsStefan Metzmacher2014-04-021-3/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbtree: use the correct count variable from NetShareEnum result.Michael Adam2013-08-211-1/+1
| | | | | | | Fixes potential segfault, as for rpcclient from bug #10100 Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-rpc_cli: pass down ndr_interface_table to cli_rpc_pipe_open_noauth().Günther Deschner2013-08-051-1/+1
| | | | | | | | Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3fs-client: Burn commandline password of client utils.Andreas Schneider2012-11-081-0/+1
| | | | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Nov 8 21:24:21 CET 2012 on sn-devel-104
* s3:smbtree: use lp_load_global()Michael Adam2011-07-281-1/+1
|
* s3:smbtree: try to fix completely broken logic in get_workgroups()Stefan Metzmacher2011-07-221-15/+23
| | | | metze
* s3-libsmb: move protos to libsmb/proto.hGünther Deschner2011-05-061-0/+1
| | | | Guenther
* s3-libsmb: only include rap client when needed.Günther Deschner2011-03-151-0/+1
| | | | Guenther
* s3-rpc_client: Move client pipe functions to own header.Andreas Schneider2011-02-281-0/+1
|
* s3-smbtree: prefer dcerpc_srvsvc_X functions.Günther Deschner2011-01-131-2/+5
| | | | | | Guenther Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-debug Impove setup_logging() to specify logging to stderrAndrew Bartlett2010-11-021-3/+1
| | | | | | | | This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
* s3-popt: Only include popt-common.h when needed.Andreas Schneider2010-08-051-0/+1
|
* s3-rpc: Avoid including every pipe's client and server stubs everywhere in ↵Günther Deschner2009-11-261-0/+1
| | | | | | samba. Guenther
* Ensure all callers to the rpc_client/cli_pipe functions correctlyJeremy Allison2009-11-121-1/+1
| | | | | initialize return variables. Jeremy.
* Remove the global "struct cm_cred_struct" and associated calls, makeJeremy Allison2009-03-171-6/+1
| | | | | | | | | callers pass in a struct user_auth_info * instead. This commit causes smbc_set_credentials() to print out a message telling callers to use smbc_set_credentials_with_fallback() instead, as smbc_set_credentials() has a broken API (no SMBCCTX * pointer). No more global variables used in the connection manager API for client dfs calls. Jeremy.
* Remove the global "cmdline_auth_info" from source3/lib/util.cVolker Lendecke2008-12-141-10/+12
| | | | This involves changing all our clients, that's why it's so large.
* Fix bug #5914 - Build failure: redefinition of struct name_listJeremy Allison2008-11-251-8/+8
| | | | Jeremy.
* Refactoring: Change calling conventions for cli_rpc_pipe_open_noauthVolker Lendecke2008-07-201-2/+3
| | | | | Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS (This used to be commit 9abc9dc4dc13bd3e42f98eff64eacf24b51f5779)
* Fix client authentication with -P switch in client tools (Bug 5435).Günther Deschner2008-05-051-0/+6
| | | | | Guenther (This used to be commit d077ef64cd1d9bbaeb936566c2c70da508de829f)
* Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_structVolker Lendecke2008-04-201-2/+2
| | | | (This used to be commit 99fc3283c4ecc791f5a242bd1983b4352ce3e6cf)
* Add "desthost" to rpc_pipe_clientVolker Lendecke2008-04-201-1/+1
| | | | | This reduces the dependency on cli_state (This used to be commit 783afab9c891dd7bcb78895b2a639b6f3a0edf5b)
* Use rpccli_srvsvc_NetShareEnumAll in smbtree.Günther Deschner2008-03-101-15/+21
| | | | | Guenther (This used to be commit 0cf761f604975930f38213233e4bbf48d7ae7283)
* Remove the char[1024] strings from dynconfig. ReplaceJeremy Allison2007-12-101-1/+1
| | | | | | | them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy. (This used to be commit 52dc5eaef2106015b3a8b659e818bdb15ad94b05)
* Fix typos in auth change.Jeremy Allison2007-12-061-2/+2
| | | | | Jeremy. (This used to be commit 440e9f5b51e42e5dc5ce3f8d10b9e43ca31e87ef)
* Get closer to building with smbmount. Move parameter line changesJeremy Allison2007-12-061-6/+8
| | | | | | into lib/util.c Jeremy. (This used to be commit 6ac5d81655927ba8eabea35adaae5adfcbb821c9)
* Getting to the home stretch for elimination of pstrings...Jeremy Allison2007-12-031-8/+17
| | | | | Jeremy. (This used to be commit 041163551194102ca67fef52c57d87020a1d09bc)
* Remove the explicit TALLOC_CTX * from cli_struct.Jeremy Allison2007-11-291-3/+9
| | | | | | | Make us very explicit about how long a talloc ctx should last. Jeremy. (This used to be commit ba9e2be2b5a59684e854609f9d82ea1633448c62)
* Fixed missing in_addr -> sockaddr_storage conversion (how didJeremy Allison2007-10-251-10/+14
| | | | | | I miss this...). Jeremy. (This used to be commit f982774c8d95c48355bbd821c8224fadb8bb303e)
* Fix the popt / bool issues. Some places we used BOOLJeremy Allison2007-10-191-1/+1
| | | | | | | where we meant int. Fix this. Thanks to metze for pointing this out. Jeremy. (This used to be commit 793a9d24a163cb6cf5a3a0aa5ae30e9f8cf4744a)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-6/+6
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.Gerald (Jerry) Carter2007-10-101-17/+16
| | | | (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
* r25402: BUG 4997 (3.2 only): Fix enumration level for smbtreeGerald Carter2007-10-101-1/+0
| | | | (This used to be commit f387e0f256e3f8a8c4a67f7fcc847a9dabaff8da)
* r24943: Some stackframesVolker Lendecke2007-10-101-1/+5
| | | | (This used to be commit cddb9f11d5fafcd3797cb242775c37f0c04d4f15)