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

67 Commits

Author SHA1 Message Date
Noel Power
65ef044b8d s3:utils: add new 'net ads setspn list' subcommand
This patch adds basic functionality not unlike the setspn.exe
command that is provided by windows for adminsistering SPN on
the AD. (see https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/cc731241(v=ws.11)

Only the basic list operation (that corresponds to the -l
    switch for setspn.exe is implemented)

Usage:

     net ads setspn list <computer>

Note: <computer> is optional, if not specified the computer account
associated with value returned by lp_netbios_name() is used instead.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-02 14:07:14 +01:00
Volker Lendecke
df7e7c65ed net: Remove NT4-based rpc vampire ldif
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-09-20 22:48:15 +02:00
Volker Lendecke
4e9877d304 net: Remove rpc samdump
This uses the NT4 replication commands. Samba does not have a server
for this, no tests, and whoever needs to migrate a native domain can
use an old Samba version

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-09-20 22:48:15 +02:00
Christof Schmitt
25b5bb3056 net: Add net tdb command to print information from tdb records
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>
2017-05-08 21:08:23 +02:00
Volker Lendecke
b4d6aee15e utils: add net notify
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-07 23:51:24 +02: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
Stefan Metzmacher
05d9b4165a s3-net: avoid confusing output in net_rpc_oldjoin() if NET_FLAGS_EXPECT_FALLBACK is passed
"net rpc join" tries net_rpc_oldjoin() first and falls back to
net_rpc_join_newstyle(). We should not print the join failed
if just net_rpc_oldjoin() failed.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-08-05 10:30:01 +02:00
Günther Deschner
3e4ded48bb s3-net: use libnetjoin for "net rpc join" newstyle.
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:01 +02:00
Günther Deschner
9cfa625160 s3-net: use libnetjoin for "net rpc testjoin".
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:01 +02:00
Günther Deschner
93e92faca9 s3-net: pass down ndr_interface_table to connect_dst_pipe().
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:29:59 +02:00
Stefan Metzmacher
4a7a8ecb0b s3:utils/net: remove unused "net connections"
The connections.tdb will go away.

metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:15:01 +02:00
Gregor Beck
1c2bae062d s3:net add command "connections cleanup"
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2012-08-16 06:56:51 +10:00
Andrew Bartlett
1c7725ae8a s3-utils: Remove unused connect_to_ipc_krb5()
Found by callcatcher.

Andrew Bartlett
2012-02-23 16:14:19 +11:00
Andrew Bartlett
9729bdf89f s3-utils/net: pass struct ndr_interface_table down
This will allow the target service (as determined from the IDL) to be
passed to GSSAPI (rather than the current, incorrect, "cifs").

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-01-18 16:23:24 +01:00
Vicentiu Ciorbaru
283da12a73 s3-net: Added the command rpc conf to the net binary.
The net binary now has an extra item linked to it, the
net_rpc_conf.c module.

Signed-off-by: Michael Adam <obnox@samba.org>
2011-08-22 13:59:24 +02:00
Stefan Metzmacher
f0c1b5dad2 s3:net_rpc_join: pass const sockaddr_storage to net_rpc_join_ok()
metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
e91797689b s3:net_util: pass const sockaddr_storage to net_make_ipc_connection_ex()
metze
2011-07-22 17:06:08 +02:00
Stefan Metzmacher
f7cd20d43c s3:net_util: add some const to sockaddr_storage
metze
2011-07-22 17:06:08 +02:00
Günther Deschner
1e208a7057 s3-includes: no need to globally include libads/ads_status.h.
Guenther
2011-05-06 16:37:22 +02:00
Sumit Bose
11c342724f s3-net: Add net trust utility
Signed-off-by: Günther Deschner <gd@samba.org>
2011-04-06 12:25:42 +02:00
Gregor Beck
01d3da3c7c s3:net: remove unused net_idmap_help
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Feb  8 11:50:37 CET 2011 on sn-devel-104
2011-02-08 11:50:37 +01:00
Stefan Metzmacher
1c1aebae82 s3:net: make some net_rpc_samsync.c functions static
metze
2011-02-02 15:45:20 +01:00
Michael Adam
45cb9bba37 s3:net: make idmap_store_secret static.
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sun Jan  2 13:41:07 CET 2011 on sn-devel-104
2011-01-02 13:41:07 +01:00
Michael Adam
11016f2a6b s3:net: remove alloc parameter from idmap_store_secret() (net idmap store). 2011-01-02 12:51:55 +01:00
Volker Lendecke
5915d4a0b6 s3: Remove some duplicate prototypes 2010-11-05 15:54:05 +01:00
Andrew Bartlett
170b345e0c s3-auth Use security_token_debug() from common code
This prints the security token including the privileges as strings
instead of just a bitmap.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-10-14 02:35:04 +00:00
Andrew Bartlett
d1bb21b0d5 s3:auth Remove NT_USER_TOKEN
The all UPPER case typedef is no longer the preferred Samba style
and this makes it easier to see that this is the IDL-derivied structure

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:06 +10:00
Andrew Bartlett
4bfc8d3b1a s3-auth Change struct nt_user_token -> struct security_token
This common structure is defined in security.idl

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-09-11 18:46:05 +10:00
Günther Deschner
e7a6a3ec0d s3: avoid global include of ads.h.
Guenther
2010-08-05 00:32:02 +02:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Günther Deschner
9bbf761bfe s3-net: Added a rather trivial "net printing dump" command.
Guenther
2010-05-18 15:06:17 +02:00
Volker Lendecke
89c785c47a s3: Fix a long-standing problem with recycled PIDs
When a samba server process dies hard, it has no chance to clean up its entries
in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb.

For locking.tdb and brlock.tdb Samba is robust by checking every time we read
an entry from the database if the corresponding process still exists. If it
does not exist anymore, the entry is deleted. This is not 100% failsafe though:
On systems with a limited PID space there is a non-zero chance that between the
smbd's death and the fresh access, the PID is recycled by another long-running
process. This renders all files that had been locked by the killed smbd
potentially unusable until the new process also dies.

This patch is supposed to fix the problem the following way: Every process ID
in every database is augmented by a random 64-bit number that is stored in a
serverid.tdb. Whenever we need to check if a process still exists we know its
PID and the 64-bit number. We look up the PID in serverid.tdb and compare the
64-bit number. If it's the same, the process still is a valid smbd holding the
lock. If it is different, a new smbd has taken over.

I believe this is safe against an smbd that has died hard and the PID has been
taken over by a non-samba process. This process would not have registered
itself with a fresh 64-bit number in serverid.tdb, so the old one still exists
in serverid.tdb. We protect against this case by the parent smbd taking care of
deregistering PIDs from serverid.tdb and the fact that serverid.tdb is
CLEAR_IF_FIRST.

CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not
work when all smbds are restarted. For this, "net serverid wipe" has to be run
before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up
sessionid.tdb and connections.tdb.

While there, this also cleans up overloading connections.tdb with all the
process entries just for messaging_send_all().

Volker
2010-03-10 16:07:10 +01:00
Volker Lendecke
4c1c3f2549 s3: Implement global locks in a g_lock tdb
This is the basis to implement global locks in ctdb without depending on a
shared file system. The initial goal is to make ctdb persistent transactions
deterministic without too many timeouts.
2010-02-12 23:12:09 +01:00
Volker Lendecke
b02c46bef9 Revert "s3: Make run_rpc_command take strings instead of a ndr_interface_table"
This reverts commit 53f2a1595e.
2009-11-08 19:43:46 +01:00
Volker Lendecke
53f2a1595e s3: Make run_rpc_command take strings instead of a ndr_interface_table 2009-11-08 13:12:15 +01:00
Günther Deschner
ebe0e64ba9 s3: use enum netr_SchannelType all over the place.
Guenther
2009-10-13 10:21:46 +02:00
Volker Lendecke
0cf317f36f s3: Remove the lua interpreter again
This was meant to support async winbind. But as the hairy parts of async
winbind (getgrent) are done without it, it can go again.
2009-09-29 13:51:43 +02:00
Kai Blin
8f5ef10633 Revert "net: Use samba default command line arguments."
This reverts commit fb262f79fa
and related commits c36031778e
72fd5fa6bb and
38cd0e086f

This change caused more trouble than it solved. We need to do this differently.
Reverting so we don't accidently release this.
2009-07-22 13:39:34 +02:00
Kai Blin
fb262f79fa net: Use samba default command line arguments.
Attention:

The meaning of the -N flag changed.
To get the old meaning for net groupmap set, use the long option --ntname
The long option for using kerberos changed from --kerberos to --use-kerberos

net rpc commands will now prompt for a password if none is given.

As a benefit, net will now accept an authentication file like other samba
command line tools. So no need to specify the password on the command line in
scripts anymore.

This should fix bug #6357

Signed-off-by: Kai Blin <kai@samba.org>
2009-05-25 23:35:38 +02:00
Günther Deschner
21d23bf7e8 s3-net: add "net eventlog dump".
This allows to dump a native (non-wrapped) win32 *.evt eventlog file.

Guenther
2009-02-04 19:01:31 +01:00
Volker Lendecke
09e6dfb8e8 net lua
This adds a lua command line interpreter with some sample code how to build
your own data types based on our internal data types.

Not meant as the final word, but as a playground for experiments for people.
Might be removed later when we find this turns out to be too awkward.
2008-12-17 12:57:19 +01:00
Günther Deschner
9f86dd715a s3-net: add "net rpc vampire passdb" that allows to take arguments.
Guenther
2008-11-18 16:03:05 +01:00
Günther Deschner
b8fee9d863 s3-net: add net_scan_dc function.
Guenther
2008-11-18 16:00:52 +01:00
Kai Blin
694786b23c net: Make share type lookup a function. 2008-09-26 20:52:13 +02:00
Volker Lendecke
05cc3fda05 Refactoring: connect_dst_pipe uses ndr_syntax_id instead of pipe_idx
(This used to be commit 0f77746f36)
2008-07-21 14:36:28 +02:00
Volker Lendecke
f23567fcb9 Refactoring: run_rpc_command uses ndr_syntax_id instead of pipe_idx
(This used to be commit 850166ec0d)
2008-07-21 14:36:28 +02:00
Günther Deschner
adef1b004b net_vampire: add code to vampire a SAM database to a keytab file.
Guenther
(This used to be commit ee6e422c0e)
2008-06-24 23:40:14 +02:00
Günther Deschner
8049d3aa8e net_vampire: split out rpc_vampire_ldif().
Guenther
(This used to be commit bcc6d3a0eb)
2008-06-13 23:39:09 +02:00
Kai Blin
255bdb2602 net: Rename functable3 to functable, get rid of old functables
(This used to be commit bb7c5fc4ec)
2008-06-10 09:48:21 +02:00
Kai Blin
c51ca559c1 net: Make "net rpc" use functable3
(This used to be commit 428b56863c)
2008-06-10 09:47:28 +02:00