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

83 Commits

Author SHA1 Message Date
Andreas Schneider
4d411cf5ce s3:utils: Call gfree_all() before exit in smbtree
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-25 22:23:37 +00:00
Ralph Boehme
5562674a21 smbtree: don't ignore unknown options
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14828

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-09-10 15:10:30 +00:00
Andreas Schneider
1f047831c1 s3:utils: Use better error message for smbtree
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): Fri Jul 16 03:45:19 UTC 2021 on sn-devel-184
2021-07-16 03:45:19 +00:00
Andreas Schneider
e8ba85b4a8 s3:utils: Migrate smbtree to new cmdline option parser
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-05-28 02:55:31 +00:00
Volker Lendecke
595e3f2566 utils: Convert smbtree to use libsmbclient
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>
2020-04-18 02:29:34 +00:00
Volker Lendecke
9ff5968a7f smbtree: Add "fail:" target, more failure paths with follow
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2020-04-18 02:29:34 +00:00
Volker Lendecke
37059e4518 smbtree: Align integer types
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
2020-04-08 16:22:17 +00:00
Volker Lendecke
67b097b823 libsmb: Move get_ipc_connect_master_ip_bcast() to smbtree.c
... the only user

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2020-04-08 14:46:40 +00:00
Noel Power
24b03fd28e s3/utils: Fix double free error with smbtree
==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
2020-04-01 18:51:43 +00:00
Jeremy Allison
f30b8b3aa1 s3: utils: smbtree. Ensure we don't call cli_RNetShareEnum() on an SMB1 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>
2019-10-30 20:44:31 +00:00
Swen Schillig
968f720410 s3: free popt context in utils
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>
2019-08-22 00:21:50 +00:00
Andreas Schneider
0de35fd3f6 s3:utils: Use C99 initializer for poptOption in smbtree
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-01-28 10:29:14 +01:00
Christof Schmitt
b7464fd89b s3:lib: Move popt_common_credentials to separate file
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>
2018-09-07 17:26:14 +02:00
Volker Lendecke
39bdd175e9 libsmb: Give namequery.c its own header
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-11 01:06:39 +02:00
Jeremy Allison
47dc643b0d s3: client tools: Call popt_free_cmdline_auth_info() on all normal exits.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-09 09:56:09 +02:00
Jeremy Allison
bec0cd2ee2 s3: client tools. Remove direct access to struct user_auth_info *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>
2017-05-09 09:56:09 +02:00
Stefan Metzmacher
4fb0e65a85 s3:popt_common: let POPT_COMMON_CREDENTIALS imply logfile and conffile loading
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>
2016-12-20 01:11:25 +01:00
Stefan Metzmacher
d6d8893d56 s3:popt_common: simplify popt_common_credentials handling
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>
2016-11-15 11:00:26 +01:00
Richard Sharpe
57941aa044 s3: utils: Convert all uses of uint32/16/8 to _t.
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
2015-05-07 04:53:39 +02:00
Volker Lendecke
c51300ad89 lib: load_case_tables() -> smb_init_locale()
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-24 00:00:20 +01:00
Stefan Metzmacher
c2a26fe5e7 s3:utils: avoid argv related const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:43 +02:00
Michael Adam
122609affb smbtree: use the correct count variable from NetShareEnum result.
Fixes potential segfault, as for rpcclient from bug #10100

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-21 10:31:19 -07:00
Günther Deschner
9813fe2b04 s3-rpc_cli: pass down ndr_interface_table to cli_rpc_pipe_open_noauth().
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-08-05 10:30:00 +02:00
Andreas Schneider
50d47fc081 s3fs-client: Burn commandline password of client utils.
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
2012-11-08 21:24:21 +01:00
Michael Adam
b9fdfbad2e s3:smbtree: use lp_load_global() 2011-07-28 11:17:40 +02:00
Stefan Metzmacher
5bd80b20a1 s3:smbtree: try to fix completely broken logic in get_workgroups()
metze
2011-07-22 17:06:07 +02:00
Günther Deschner
27022587e3 s3-libsmb: move protos to libsmb/proto.h
Guenther
2011-05-06 16:37:18 +02:00
Günther Deschner
7a91282c9f s3-libsmb: only include rap client when needed.
Guenther
2011-03-15 21:16:35 +01:00
Andreas Schneider
bf18403c81 s3-rpc_client: Move client pipe functions to own header. 2011-02-28 18:15:04 +01:00
Günther Deschner
1ea6dd35f4 s3-smbtree: prefer dcerpc_srvsvc_X functions.
Guenther

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-01-13 14:12:23 +01:00
Andrew Bartlett
9da4ace1d9 s3-debug Impove setup_logging() to specify logging to stderr
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
2010-11-02 04:36:04 +00:00
Andreas Schneider
ce2a086119 s3-popt: Only include popt-common.h when needed. 2010-08-05 12:08:31 +02:00
Günther Deschner
3d679a3b5f s3-rpc: Avoid including every pipe's client and server stubs everywhere in samba.
Guenther
2009-11-26 20:03:17 +01:00
Jeremy Allison
5363d6e62c Ensure all callers to the rpc_client/cli_pipe functions correctly
initialize return variables.
Jeremy.
2009-11-12 13:56:33 -08:00
Jeremy Allison
8dd1faaa29 Remove the global "struct cm_cred_struct" and associated calls, make
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.
2009-03-17 14:53:06 -07:00
Volker Lendecke
daeb3a190d Remove the global "cmdline_auth_info" from source3/lib/util.c
This involves changing all our clients, that's why it's so large.
2008-12-14 14:00:43 +01:00
Jeremy Allison
d3fa3c080f Fix bug #5914 - Build failure: redefinition of struct name_list
Jeremy.
2008-11-25 15:53:56 -08:00
Volker Lendecke
1335da2a7c Refactoring: Change calling conventions for cli_rpc_pipe_open_noauth
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
(This used to be commit 9abc9dc4dc)
2008-07-20 17:37:11 +02:00
Günther Deschner
4d8836ab96 Fix client authentication with -P switch in client tools (Bug 5435).
Guenther
(This used to be commit d077ef64cd)
2008-05-05 16:59:53 +02:00
Volker Lendecke
e73e8297f5 Replace cli_rpc_pipe_close by a talloc destructor on rpc_pipe_struct
(This used to be commit 99fc3283c4)
2008-04-20 14:08:16 +02:00
Volker Lendecke
2a2188591b Add "desthost" to rpc_pipe_client
This reduces the dependency on cli_state
(This used to be commit 783afab9c8)
2008-04-20 00:13:09 +02:00
Günther Deschner
d09f0d281c Use rpccli_srvsvc_NetShareEnumAll in smbtree.
Guenther
(This used to be commit 0cf761f604)
2008-03-10 05:05:37 +01:00
Jeremy Allison
7faee02d0d Remove the char[1024] strings from dynconfig. Replace
them with malloc'ing accessor functions. Should save a
lot of static space :-).
Jeremy.
(This used to be commit 52dc5eaef2)
2007-12-10 11:30:37 -08:00
Jeremy Allison
79c3aef7ea Fix typos in auth change.
Jeremy.
(This used to be commit 440e9f5b51)
2007-12-06 18:52:36 -08:00
Jeremy Allison
9fdf2d0586 Get closer to building with smbmount. Move parameter line changes
into lib/util.c
Jeremy.
(This used to be commit 6ac5d81655)
2007-12-06 18:49:39 -08:00
Jeremy Allison
adf6d848de Getting to the home stretch for elimination of pstrings...
Jeremy.
(This used to be commit 0411635511)
2007-12-03 18:48:41 -08:00
Jeremy Allison
d2cf97aeba Remove the explicit TALLOC_CTX * from cli_struct.
Make us very explicit about how long a talloc ctx
should last.
Jeremy.
(This used to be commit ba9e2be2b5)
2007-11-29 13:24:54 -08:00
Jeremy Allison
42f9694139 Fixed missing in_addr -> sockaddr_storage conversion (how did
I miss this...).
Jeremy.
(This used to be commit f982774c8d)
2007-10-25 18:11:29 -07:00
Jeremy Allison
9a85533914 Fix the popt / bool issues. Some places we used BOOL
where we meant int. Fix this. Thanks to metze for
pointing this out.
Jeremy.
(This used to be commit 793a9d24a1)
2007-10-19 11:38:36 -07:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
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 f35a266b3c)
2007-10-18 17:40:25 -07:00