summaryrefslogtreecommitdiff
path: root/source3/utils/net.c
AgeCommit message (Collapse)AuthorFilesLines
2019-07-12s3:net: add 'vfs' hierarchy with 'stream2adouble' commandRalph Boehme1-0/+27
This adds a new top-level command hierarchy 'vfs' that can be used to add commands that access the smbd VFS stack. The first command to be implemented is 'stream2adouble' which can be used to convert stream metadata to AppleDouble files. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2019-01-28s3:utils: Use C99 initializer in functable in netAndreas Schneider1-9/+15
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2019-01-28s3:utils: Use C99 initializer for poptOption in netAndreas Schneider1-50/+302
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-12-07net: Use dom_sid_str_bufVolker Lendecke1-8/+10
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-30net: Add support for a credentials fileOlly Betts1-0/+25
Add support for the same -A authfile/--authentication-file authfile option that most of the other tools already do. Signed-off-by: Olly Betts <olly@survex.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-11-06gencache: Remove transaction-based tdbVolker Lendecke1-2/+0
At more than one large site I've seen significant problems due to gencache_stabilize. gencache_stabilize was mainly introduced to survive machine crashes with the cache still being in place. Given that most installations crash rarely and this is still a cache, this safety is overkill and causes real problems. With the recent changes to tdb, we should be safe enough to run on completely corrupted databases and properly detect errors. A further commit will introduce code that wipes the gencache.tdb if such a corruption is detected. There is one kind of corruption that we don't properly handle: Orphaned space in the database. I don't have a good idea yet how to handle this in a graceful and efficient way during normal operations, but maybe this idea pops up at some point. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-10-19lib: Remove gencache.h from proto.hVolker Lendecke1-0/+1
It's a pain to recompile the world if gencache.h changes Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Oct 19 18:52:50 CEST 2018 on sn-devel-144
2018-09-22s3: net: implement json output for ads infoPhilipp Gesang1-0/+1
Add the switch '--json' to 'net' to format the output as JSON. The rationale is to supply the information in a machine-readable fashion to complement the text version of the output which is neither particularly well defined nor locale-safe. The output differs from that of plain 'info' in that times are not formatted as timestamps. Currently affects only the 'net ads info' subcommand. Reviewed-by: Gary Lockyer <gary@catalyst.net.nz> Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-07s3:net: Use cmdline_messaging_contextChristof Schmitt1-27/+2
Use cmdline_messaging_context with its error checking instead of open coding the same steps. 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-07s3:lib: Move popt_common_credentials to separate fileChristof Schmitt1-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>
2018-07-30s3:libads: Add net ads leave keep-account optionJustin Stephenson1-1/+2
Add the ability to leave the domain with --keep-account argument to avoid removal of the host machine account. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13498 Signed-off-by: Justin Stephenson <jstephen@redhat.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-03-29net: Fix CID 1128559 Dereference null return valueVolker Lendecke1-3/+7
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-27net: make use of secrets_*_password_change() for "net changesecretpw"Stefan Metzmacher1-7/+44
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-06-27net: add "net primarytrust dumpinfo" command that dumps the details of the ↵Stefan Metzmacher1-0/+85
workstation trust BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-06-27s3:secrets: rename secrets_delete() to secrets_delete_entry()Stefan Metzmacher1-3/+3
secrets_delete_entry() fails if the key doesn't exist. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-05-08net: Add net tdb command to print information from tdb recordsChristof Schmitt1-0/+8
The main purpose is to debug "hot" records from ctdb. ctdb tracks contended records and identifies them by key in the dbstatistics: DB Statistics: locking.tdb [...] Num Hot Keys: 1 Count:3 Key:6a4128e3ced4681b02a00000000000000000000000000000 This command allows querying additional information for the associated key to identify the affected file. For now this only adds a subcommand for the locking.tdb, but could be extended to others: net tdb locking 6a4128e3ced4681b02a00000000000000000000000000000 Share path: /test/share Name: testfile Number of share modes: 2 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2016-11-16s3:net: Use messaging_init_client()Andreas Schneider1-5/+17
Pair-Programmed-With: Jeremy Allison <jra@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org>
2015-12-22s3: fix encryption help messagesRalph Boehme1-1/+1
Encryption is a SMB3 feature and not tied to UNIX extensions, so fix the help messages of various utilities. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Dec 22 02:22:50 CET 2015 on sn-devel-144
2015-09-30net: Fix some tiny memleaksVolker Lendecke1-2/+2
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-09net: add option --no-dns-updates for net ads joinMichael Adam1-0/+2
If called with this option, 'net ads join' will not attempt to perform dns updates. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2015-07-07utils: add net notifyVolker Lendecke1-0/+8
A little tool to play with the notify daemon Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-15net: Fix messaging_init for clusteringVolker Lendecke1-6/+17
A full loadparm with include=registry implicitly initializes a messaging_context. We need to use that. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Mon Jun 15 22:44:57 CEST 2015 on sn-devel-104
2015-05-07s3: utils: Convert all uses of uint32/16/8 to _t.Richard Sharpe1-5/+5
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-03-24lib: load_case_tables() -> smb_init_locale()Volker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-02s3:utils: avoid argv related const warningsStefan Metzmacher1-3/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-12-16s3: smbpasswd - fix crashes on invalid input.Jeremy Allison1-0/+5
get_pass can return NULL on error. Ensure that this is always the case and fix all callers to cope (some already did). Reported by Joonas Kuorilehto <joneskoo@codenomicon.com> BUG: https://bugzilla.samba.org/show_bug.cgi?id=10320 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Dec 16 15:17:58 CET 2013 on sn-devel-104
2013-02-19s3:utils: make use of samba_tevent_context_init()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-08s3fs-client: Burn commandline password of client utils.Andreas Schneider1-0/+2
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-10-30s3fs-net: Use talloc for memory allocation.Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed by: Jeremy Allison <jra@samba.org>
2012-10-19s3:utils/net: remove unused "net connections"Stefan Metzmacher1-7/+0
The connections.tdb will go away. metze Signed-off-by: Michael Adam <obnox@samba.org>
2012-08-16s3:net add command "connections cleanup"Gregor Beck1-0/+7
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-06-26s3:net registry import: add option --precheckGregor Beck1-0/+2
Signed-off-by: Michael Adam <obnox@samba.org>
2012-04-30net: Let get*sid return error from passdb initChristof Schmitt1-6/+4
When initialize_password_db returns an error this means that the SID stored in the backend cannot be read. Return this error directly instead of creating a random SID through get_global_sam_sid. Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Mon Apr 30 13:07:20 CEST 2012 on sn-devel-104
2011-12-12s3: Remove a bunch of calls to procid_self()Volker Lendecke1-2/+1
All callers to messaging_[re]init only used procid_self()
2011-11-17s3-net Do not look for a local SID when we are a DCAndrew Bartlett1-7/+8
If we are actually a DC, then the only SID we have is the domain SID, and looking for it under the local name fails if we are a Samba4 AD DC. Andrew Bartlett
2011-10-12s3:net: add command registry checkGregor Beck1-0/+4
Signed-off-by: Michael Adam <obnox@samba.org>
2011-07-28s3:net: use lp_load_global()Michael Adam1-1/+1
2011-06-23s3-net: Bind our gettext results to 'unix charset'Andrew Bartlett1-0/+10
This ensures that the translations and any embedded strings are in the same charset. It won't be the one from the user's locale (we no longer auto-detect that), but it will be self-consistent. Thanks to Steve Langasek for pointing this function out! Andrew Bartlett
2011-06-09s3-param Remove special case for global_myname(), rename to lp_netbios_name()Andrew Bartlett1-5/+5
There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett
2011-04-13s3-build Remove distinct LOCALEDIR subsystemAndrew Bartlett1-1/+1
This is no different to the rest of dynconfig, and so should be dealt with there. Andrew Bartlett
2011-04-04s3-net: add command "net idmap check"Gregor Beck1-0/+3
This is a tool to check the consistency of an idmap tdb database. The default mode is to scan the database and list invalid entries, e.g. records with an invalid format, or records which are valid but for which the reverse mapping entry is missing. With the "--repair" switch, one can enter an interactive repair mode which will prompt for each invalid entry found with the option to delete, skip or edit the record. There is also a non-interactive repair mode triggered by "--auto" which will remove all records with invalid content and fill up mappings which are missing the reverse entry. The "--test" parameter lets "net idmap check" only list the changes that would be written and not actually commit them to the database. The "--lock" option allows to lock the database already in the first reading traverse, in order to remove the race when the database has to be closed and reopened again before writing the changes. Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Mon Apr 4 18:21:09 CEST 2011 on sn-devel-104
2011-03-30s3-messages: only include messages.h where needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3-passdb: add passdb.h where needed.Günther Deschner1-0/+1
Guenther
2011-02-09s3:net add option --dbGregor Beck1-1/+2
2011-02-02s3: Fix a typoVolker Lendecke1-1/+1
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Feb 2 14:58:52 CET 2011 on sn-devel-104
2010-12-15Fix bug 7866 - "net" in v3-6-test broken.Jeremy Allison1-3/+3
Someone wasn't careful about testing when not running as root :-). Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Dec 15 20:45:25 CET 2010 on sn-devel-104
2010-11-02s3-debug Remove 'AllowDebugChange' and use lp_set_cmdline() insteadAndrew Bartlett1-8/+1
By removing this global variable, the API between the two different debug systems is made more similar. Both s3 and s4 now have lp_set_cmdline() which ensures that the smb.conf cannot overwrite these the user-specified log level. Andrew Bartlett
2010-11-02s3-debug Impove setup_logging() to specify logging to stderrAndrew Bartlett1-1/+2
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-10-12libcli/security Provide a common, top level libcli/security/security.hAndrew Bartlett1-0/+1
This will reduce the noise from merges of the rest of the libcli/security code, without this commit changing what code is actually used. This includes (along with other security headers) dom_sid.h and security_token.h Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-09-23s3-dsgetdcname: always pass in messaging context.Günther Deschner1-0/+6
Volker, please check. Guenther