summaryrefslogtreecommitdiff
path: root/source3/utils
AgeCommit message (Collapse)AuthorFilesLines
2015-09-30lib: Remove serverids_existVolker Lendecke1-0/+13
The only reason for this complex monster was an overload of ctdbd. When opening files, we unconditionally checked all share modes for validity. This meant thousands of serverid_exists calls per second for popular directories. This has long gone, now we only check for validity if a conflict happens. The only remaining caller is net serverid wipedbs, an administrative command. If that loads ctdbd, so be it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-09-30net: Add "serverid exists"Volker Lendecke1-0/+31
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
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: reformat usage text for 'net ads join'Michael Adam1-18/+21
Make the items nicely aligned again and do not exceed 80 columns. A few typos are fixed along the way. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2015-09-09net: add option --no-dns-updates for net ads joinMichael Adam3-3/+9
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-08-04s3-net: use talloc array in share allowedusersRalph Boehme1-4/+20
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11426 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Aug 4 16:48:36 CEST 2015 on sn-devel-104
2015-08-01net: Print time of last password change in 'net ads info'Christof Schmitt1-0/+6
This is useful for debugging overwritten machine accounts, e.g. a second machine is joined to a domain with the same name as the first one. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10smbcontrol: Set internal log level to 0Christof Schmitt1-0/+1
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-10smbstatus: Set internal log level to 0Christof Schmitt1-0/+1
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-09net: fix the order of DC lookup methods when joining a domainUri Simchoni1-0/+8
The dsgetdcname() function is able to try just DNS lookup, just NetBIOS, or start with DNS and fall back to NetBIOS. For "net ads join", we know most of the time whether the name of the domain we're joining is a DNS name or a NetBIOS name. In that case, it makes no sense to try both lookup methods, especially that DNS may fail and we want to fall back from site-aware DNS lookup to site-less DNS lookup, with no NetBIOS lookup in between. This change lets "net ads join" tell libnet what is the type of the domain name, if it is known. Signed-off-by: Uri Simchoni <urisimchoni@gmail.com> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-07-07utils: add net notifyVolker Lendecke3-0/+207
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-07-07notify: Re-add notify_walk()Volker Lendecke1-21/+23
This used to be a tdb traverse wrapper. Now we get the notify db from notifyd via messages. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-30net:conf:import: print error message when importing fails.Michael Adam1-0/+5
If there is a mis-spelled option in a share definition, 'net conf import' will currently silently drop it (but exit with code != 0). We want to be notified of what went wrong. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2015-06-23s3:ntlm_auth: don't start gensec backend twiceStefan Metzmacher1-11/+5
ntlm_auth_start_ntlmssp_server() was used in two cases and both call gensec_start_mech_by_oid() again. So we remove gensec_start_mech_by_oid() and rename the function to ntlm_auth_prepare_gensec_server. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-06-17sharesec: Use non-numerical output for sharesecChristof Schmitt1-2/+2
This is an easy change to get the sharesec output back to the format used before. It is also easier to understand than the output of the flags. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11324 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@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-21testparm: Add warning if the netbios name is too longAndreas Schneider1-0/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2015-05-16Convert the few instances of int32 there were to int32_t.Richard Sharpe1-1/+1
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): Sat May 16 03:09:12 CEST 2015 on sn-devel-104
2015-05-14Convert all uint32/16/8 to _t in a grab-bag of remaining files.Richard Sharpe2-5/+5
I still need to fix the rpc stuff, but we are almost there. 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 14 22:16:56 CEST 2015 on sn-devel-104
2015-05-13Convert a couple of uint32s to _t that I missed in source3/utils.Richard Sharpe1-1/+1
Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-07s3: utils: Convert all uses of uint32/16/8 to _t.Richard Sharpe26-210/+210
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-01Convert three include files from uint32/16/8 to _t types as well as the ↵Richard Sharpe1-2/+2
source that includes them. The files that include them already seem clean. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-01Convert uint32/16/8 to 32_t/16_t/8_t in printing.h and all files that ↵Richard Sharpe1-3/+3
include it. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-28lib: Remove server_id_str()Volker Lendecke4-25/+24
Call server_id_str_buf instead 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): Tue Apr 28 20:48:01 CEST 2015 on sn-devel-104
2015-04-28lib: Remove procid_str_staticVolker Lendecke2-8/+17
Replace all callers with direct calls to server_id_str_buf without talloc_tos() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25sharesec: Use common parse_ace functionChristof Schmitt1-174/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25sharesec: Print ACEs in similar format as expected in inputChristof Schmitt1-12/+6
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25smbcacls: Move sec_desc_print to common fileChristof Schmitt1-81/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25smbcacls: Move print_ace and parse_ace to common fileChristof Schmitt1-354/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25smbcacls: Move StringToSid to common fileChristof Schmitt1-62/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25smbcacls: Move SidToString to common fileChristof Schmitt1-85/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25smbcacls: Use defines for security flagsChristof Schmitt1-9/+10
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-25smbcacls: Make 'numeric' a local variableChristof Schmitt1-20/+25
This will allow moving code to a shared file without relying on a global variable. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-23Make sure we initialize conn to NULL, because a routine we call may give an ↵Richard Sharpe1-1/+1
error and not touch conn, and then we get an error when trying to TALLOC_FREE it. Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-04-22s3:param: remove arg save_defaults from lp_load_with_registry_shares()Michael Adam2-2/+2
This is only used in command line contexts, especially for testparm which relies on safe defaults. The only changed use is in sharesec, but it does not harm to also safe the defaults there. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2015-04-22s3:param: remove arg initialize_globals from lp_load_with_registry_shares()Michael Adam2-2/+2
This is only ever called in client context, and only called once. So there is no point at all in requesting reinit_globals. Set it to false. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2015-04-22s3:param: remove "add_ipc" parameter from lp_load_with_registry_shares().Michael Adam2-2/+2
This is not called from the server (which loads registry shares lazily), so add_ipc is always false... Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2015-04-22s3:param: remove "global_only" parameter from lp_load_with_registry_shares().Michael Adam2-3/+2
There is no point in choosing global_only when forcing to load all shares from registry at the same time... Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-24lib: load_case_tables() -> smb_init_locale()Volker Lendecke20-20/+20
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-17lib: Remove tdb_fetch_compatVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17Remove tdb_[first|next]key_compatVolker Lendecke1-8/+8
This is essentially a revert of 3a8faefd. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-12s3:rpc_client: remove unused auth_level paramter of cli_rpc_pipe_open_schannel()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
2015-03-10smbcontrol: Simplify do_winbind_offlineVolker Lendecke1-5/+1
This saves 128 bytes of .text on x86-64 with -O3. No idea why... Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2015-03-10Use global context for winbindd_request_responseMatthew Newton1-8/+8
Updating API call in libwbclient, wbinfo, ntlm_auth and winbind_nss_* as per previous commit to wb_common.c. Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-06s3:smbprofile: Replace sysv shmem with tdbVolker Lendecke1-11/+15
What? This patch gets rid of the central shared memory segment referenced by "profile_p". Instead, every smbd gets a static profile_area where it collects profiling data. Once a second, every smbd writes this profiling data into a record of its own in a "smbprofile.tdb". smbstatus -P does a tdb_traverse on this database and sums up what it finds. Why? At least in my perception sysv IPC has not the best reputation on earth. The code before this patch uses shmat(). Samba ages ago has developed a good abstraction of shared memory: It's called tdb. The main reason why I started this is that I have a request to become more flexible with profiling data. Samba should be able to collect data per share or per user, something which is almost impossible to do with a fixed structure. My idea is to for example install a profile area per share and every second marshall this into one tdb record indexed by share name. smbstatus -P would then also collect the data and either aggregate them or put them into individual per-share statistics. This flexibility in the data model is not really possible with one fixed structure. But isn't it slow? Well, I don't think so. I can't really prove it, but I do believe that on large boxes atomically incrementing a shared memory value for every SMB does show up due to NUMA effects. With this patch the hot code path is completely process-local. Once a second every smbd writes into a central tdb, this of course does atomic operations. But it's once a second, not on every SMB2 read. There's two places where I would like to improve things: With the current code all smbds wake up once a second. With 10,000 potentially idle smbds this will become noticable. That's why the current only starts the timer when something has changed. The second place is the tdb traverse: Right now traverse is blocking in the sense that when it has to switch hash chains it will block. With mutexes, this means a syscall. I have a traverse light in mind that works as follows: It assumes a locked hash chain and then walks the complete chain in one run without unlocking in between. This way the caller can do nonblocking locks in the first round and only do blocking locks in a second round. Also, a lot of syscall overhead will vanish. This way smbstatus -P will have almost zero impact on normal operations. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2015-03-06s3:smbprofile: specify SMBPROFILE_STATS_SECTION_START() with name vs. ↵Stefan Metzmacher1-2/+2
display[name] Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2015-03-03Fix the O3 developer buildVolker Lendecke1-2/+2
Different gcc versions complain at different places Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Mar 3 13:14:53 CET 2015 on sn-devel-104
2015-02-25Fix the developer O3 buildVolker Lendecke3-3/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Wed Feb 25 16:32:29 CET 2015 on sn-devel-104
2015-02-24nmblookup: Warn user if netbios name is too long.Andreas Schneider1-0/+9
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): Tue Feb 24 01:01:10 CET 2015 on sn-devel-104
2015-02-19regedit: Rename variable to fix compile warningChristof Schmitt1-4/+4
With --picky-developer this warning is turned into an error: cc1: warnings being treated as errors ../source3/utils/regedit_treeview.c: In function ‘tree_node_load_children’: ../source3/utils/regedit_treeview.c:256: error: declaration of ‘key_name’ shadows a global declaration /usr/include/ncurses.h:1419: error: shadowed declaration is here Fix this by renaming the local variable. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Feb 19 01:31:44 CET 2015 on sn-devel-104