summaryrefslogtreecommitdiff
path: root/source3/utils
Commit message (Collapse)AuthorAgeFilesLines
* s3:printing: Fix %J substitionRalph Boehme2019-11-071-1/+1
| | | | | | | | | | | | | | | | | | | | | print_run_command() uses lp_print_command() which internally performs basic substition by calling talloc_sub_basic(). As a result. any of the variables in the "basic set", including "%J" are already substituted. To prevent the unwanted subtitution, we declare all affected configuration options as const, which disabled the basic substition. As a result print_run_command() can run manual substitution on all characters, including %J, in the variadic argument list *before* calling lp_string() to run basic substition which we had disabled before with the const. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13745 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Nov 7 16:01:21 UTC 2019 on sn-devel-184
* ntlm_auth: Fix nonempty line endingsVolker Lendecke2019-11-061-64/+64
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* ntlm_auth: Simplify session generationVolker Lendecke2019-11-061-16/+3
| | | | | | | We don't need to parse a text sid, we have those as binary available Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* net: Avoid the use of g_lock_do()Volker Lendecke2019-11-061-25/+26
| | | | | | | g_lock_do() does too much in g_lock.c, and it's rarely used. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* net: Avoid the use of g_lock_do()Volker Lendecke2019-11-061-71/+65
| | | | | | | g_lock_do() does too much in g_lock.c, and it's rarely used. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* lib: Remove #define serverid_equal server_id_equalVolker Lendecke2019-11-062-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* source3/utils/net_rpc.c: typo fixesBjörn Jacke2019-10-311-1/+1
| | | | | Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Martin Schwenke <martin@meltin.net>
* 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: remove now unneeded call to cmdline_messaging_context()Ralph Boehme2019-10-248-16/+0
| | | | | | | | | | | | | | | This was only needed as dbwrap_open() had a bug where it asked for the ctdb connection before initializing messaging. The previous commit fixed that so we can now safely remove the calls to cmdline_messaging_context() from all tools that don't use messaging. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13925 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Oct 24 09:33:47 UTC 2019 on sn-devel-184
* net: 'net ads gpo getgpo' command not dumping gpoAmit Kumar2019-10-221-1/+13
| | | | | | | | | | We have passed dump_gpo(debuglevel=1), hence gpo is not dumped at debuglevel=0. But end user will expect gpo to be dumped without setting debug flag. Signed-off-by: Amit Kumar <amitkuma@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* smbstatus: fix column length for DenyModeChristian Schulz2019-10-211-1/+1
| | | | | | | | | Signed-off-by: Christian Schulz <chris@schocktools.de> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Oct 21 01:26:29 UTC 2019 on sn-devel-184
* smbstatus: use display print functionChristian Schulz2019-10-211-1/+1
| | | | | | Signed-off-by: Christian Schulz <chris@schocktools.de> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Build registry parsing code into subsystemMichael Hanselmann2019-10-181-1/+0
| | | | | | | | | | Fuzzing code will make use of the "reg_parse_fd" function. By building it into the "SMBREGISTRY" subsystem it can just be linked and "reg_parse.c" doesn't need to be explicitly included. Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* docs: modifies 'net ads dns gethostbyname -h' Changes server to nameserver ↵Amit Kumar2019-10-171-2/+2
| | | | | | | | | | and name to hostname. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14009 Signed-off-by: Amit Kumar amitkuma@redhat.com Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s3:utils: add mdfindRalph Boehme2019-10-092-0/+304
| | | | | | | | A small command line tool to run macOS Spotlight searches against an SMB server that runs the Spotlight mdssvc RPC service, including macOS and Samba. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Noel Power <noel.power@suse.com>
* s3:libnet: Require sealed LDAP SASL connections for joiningAndreas Schneider2019-10-091-4/+9
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s3:libads: let kerberos_kinit_password_ext() return the canonicalized ↵Stefan Metzmacher2019-09-241-0/+3
| | | | | | | | | principal/realm BUG: https://bugzilla.samba.org/show_bug.cgi?id=14124 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
* messaging: Do POOL_USAGE via a socketVolker Lendecke2019-09-181-28/+17
| | | | | | | | | | | | | This makes debugging run-away processes much more efficient and even possible at all: If the pool-usage output is more than 256MB, the previous code could not realloc it and threw it away. Also, it is not helpful for an already huge process to allocate even more. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Sep 18 21:27:30 UTC 2019 on sn-devel-184
* smbd: rename [un]become_user*() to [un]become_user_without_service*()Stefan Metzmacher2019-09-111-2/+4
| | | | | | | | | | | | We should make the behavior change (that gives up some protection) more obvious, by changing the function names. At least some OEMs have patches relying on the 4.9/4.10 behaviour and we want them to detect that they have to do more work when they need to change directories. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbstatus: Use file_id_str_buf() in print_brl()Volker Lendecke2019-09-101-1/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbcontrol: avoid printing NULL help stringsDavid Disseldorp2019-09-091-3/+7
| | | | | | | | | | | | | | | | | Some smbcontrol commands leave the .help pointer NULL, resulting in the following usage text: disconnect-dc (null) notify-cleanup (null) ... msg-cleanup (null) Improve this by printing an empty string instead. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Mon Sep 9 10:32:53 UTC 2019 on sn-devel-184
* Spelling fixes s/explicite /explicit /Mathieu Parent2019-09-011-1/+1
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* Spelling fixes s/emtpy/empty/Mathieu Parent2019-09-011-1/+1
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* Spelling fixes s/succedded/succeeded/Mathieu Parent2019-09-011-1/+1
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* Spelling fixes s/Mirgate/Migrate/Mathieu Parent2019-09-011-2/+2
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* Spelling fixes s/exising/existing/Mathieu Parent2019-09-011-1/+1
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* Spelling fixes s/containter/container/Mathieu Parent2019-09-011-3/+3
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s3:net: load registry shares too in 'net vfs stream2adouble'Ralph Wuerthner2019-08-221-2/+2
| | | | | | | | | Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Aug 22 17:41:20 UTC 2019 on sn-devel-184
* s3: free popt context in utilsSwen Schillig2019-08-2213-17/+58
| | | | | | | | 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: net: net_ads: fix a typo in commentMarco Wang2019-08-211-1/+1
| | | | | | | | | Signed-off-by: Marco Wang <m.aesophor@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Aug 21 08:39:43 UTC 2019 on sn-devel-184
* s3:utils: Use a stackframe for temporary memoryAndreas Schneider2019-07-261-8/+13
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:utils: Use GnuTLS RC4 in ntlm_authAndreas Schneider2019-07-261-3/+42
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:rpc_client: Return NTSTATUS for init_samr_CryptPassword()Andreas Schneider2019-07-261-3/+6
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14031 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:net: add 'net vfs getntacl' commandRalph Boehme2019-07-122-0/+112
| | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jul 12 22:59:58 UTC 2019 on sn-devel-184
* s3:net: add 'vfs' hierarchy with 'stream2adouble' commandRalph Boehme2019-07-125-0/+373
| | | | | | | | | | | 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>
* docs: Correct 'net ads dns unregister --help' descriptionAmit Kumar2019-07-031-1/+2
| | | | | | | | | | | | | | | | | | This change corrects the content of 'net ads dns unregister --help' command. Updated output would be: Usage: net ads dns unregister [hostname] Remove all IP Address entires for a given hostname from the Active Directory server. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14005 Signed-off-by: Amit Kumar <amitkuma@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Jul 3 15:12:50 UTC 2019 on sn-devel-184
* net idmap check: correct spelling of --forceDouglas Bagnall2019-07-021-1/+1
| | | | | Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* source3: Update all consumers of strtoul_err(), strtoull_err() to new APISwen Schillig2019-06-306-15/+23
| | | | | | Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* s3:utils: Use GnuTLS RC4 in npc_rpc_trustAndreas Schneider2019-06-271-7/+47
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbd: Remove unused brlock codeVolker Lendecke2019-06-202-42/+0
| | | | | | | No PENDING locks in brlock.tdb anymore. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3-smbcontrol: Replace && with || to declare variables in do_sleep()Anoop C S2019-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | --enable-developer internally use --enable-selftest alongside. But when configured only with --enable-selftest the following code block becomes invalid: #if defined(DEVELOPER) && defined(ENABLE_SELFTEST) unsigned int seconds; long input; const long MAX_SLEEP = 60 * 60; /* One hour maximum sleep */ #endif making those variables undeclared for further use. Therefore replace && with || to have those variables declared with --enable-selftest configure option. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri May 31 20:38:09 UTC 2019 on sn-devel-184
* s3:utils: Only declare variables if we're gonna use themAndreas Schneider2019-05-241-0/+2
| | | | | | | Found by covscan. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Gary Lockyer <gary@samba.org>
* net: Return share name in correct case from net rpc conf showshareChristof Schmitt2019-05-231-3/+36
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:utils: If share is NULL in smbcacls, don't print itAndreas Schneider2019-05-081-2/+2
| | | | | | | Found by GCC 9. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:utils: If share is NULL in smbcquotas, don't print itAndreas Schneider2019-05-081-2/+2
| | | | | | | Found by GCC 9. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:utils: use struct initializer in async-tracker long_optionsRalph Boehme2019-04-291-2/+14
| | | | | | | | | | s3:utils: use struct initializer in async-tracker long_options The previous initializer list was missing a NULL as last element. Using struct initializers instead for correct initialisation. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3/lib: tevent-glib-glue test utiltity with TrackerRalph Boehme2019-04-241-0/+288
| | | | | | | | | A small utilitly useful for tesing the tevent_glib_glue code. It runs a tracker-sparql search query against your local tracker store that must be setup and running. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Noel Power <npower@samba.org>
* utils: Use leases_db in smbstatusVolker Lendecke2019-04-141-9/+26
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* utils: Move conn_tdb.c to utils/Volker Lendecke2019-04-125-2/+227
| | | | | | | | | | That's a wrapper that only smbstatus and net status use by now. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Apr 12 00:37:05 UTC 2019 on sn-devel-144
* smbd: Remove some unused includesVolker Lendecke2019-04-111-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>