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

127 Commits

Author SHA1 Message Date
Jeremy Allison
afe845235a Fixed warnings in secret code.
Jeremy.
(This used to be commit 86ebf99043)
2003-08-28 23:38:13 +00:00
Gerald Carter
494bb81bb0 fixing typos pointed out by Vance in WHATSNEW
Include patch to manually set the machine trust account
password (on request from jht) to mimic 2.2. behavior.

last changes before RC2 (not counting syncing the docs).
(This used to be commit ce09037144)
2003-08-28 20:24:25 +00:00
Andrew Bartlett
f1be3a5c5d - Make 'net' use a single funciton for setting the 'use machine account' code.
- Make winbindd try to use kerberos for connections to DCs, so that it can
   access RA=2 servers, particularly for netlogon.
 - Make rpcclient follow the new flags for the NETLOGON pipe
 - Make all the code that uses schannel use the centralised functions for doing so.

Andrew Bartlett
(This used to be commit 96b4187963)
2003-08-19 22:47:10 +00:00
Jeremy Allison
29ca70cd34 Add a command line option (-S on|off|required) to enable signing on client
connections. Overrides smb.conf parameter if set.
Jeremy.
(This used to be commit 879309671d)
2003-07-30 23:49:29 +00:00
Tim Potter
274f1f8806 Replace the eight (!) copies of dummy become/unbecome root with a single one.
(This used to be commit 8b818ce381)
2003-07-22 00:20:53 +00:00
Rafal Szczesniak
fb56f58fbc According to the result of voting, net has default debug level with
ability to change it by command line instead of turn-off cmdline switch
for debug messages.
It's a bit more comfortable to use now.
(This used to be commit b65fe75bec)
2003-07-19 00:23:08 +00:00
Gerald Carter
816724fb39 more compile fixes for become/unbecome_root()
(This used to be commit f005f1cf12)
2003-07-09 03:32:07 +00:00
Gerald Carter
f51d769dd3 large change:
*)  consolidates the dc location routines again (dns
    and netbios)  get_dc_list() or get_sorted_dc_list()
    is the authoritative means of locating DC's again.

    (also inludes a flag to get_dc_list() to define
     if this should be a DNS only lookup or not)

    (however, if you set "name resolve order = hosts wins"
     you could still get DNS queries for domain name IFF
     ldap_domain2hostlist() fails.  The answer?  Fix your DNS
     setup)

*)  enabled DOMAIN<0x1c> lookups to be funneled through
    resolve_hosts resulting in a call to ldap_domain2hostlist()
    if lp_security() == SEC_ADS

*)  enables name cache for winbind ADS backend

*)  enable the negative connection cache for winbind
    ADS backend

*)  removes some old dead code

*)  consolidates some duplicate code

*)  moves the internal_name_resolve() to use an IP/port pair
    to deal with SRV RR dns replies.  The namecache code
    also supports the IP:port syntax now as well.

*)  removes 'ads server' and moves the functionality back
    into 'password server' (which can support "hostname:port"
    syntax now but works fine with defaults depending on
    the value of lp_security())
(This used to be commit d7f7fcda42)
2003-06-25 17:41:05 +00:00
Andrew Bartlett
668a9af94e This removes the StrCaseCmp() stuff from 'net idmap' and 'net
groupmap'.  The correct way to implement this stuff is via a function
table, as exampled in all the other parts of 'net'.

This also moves the idmap code into a new file.  Volker, is this your
code?  You might want to put your name on it.

Andrew Bartlett
(This used to be commit 477f2d9e39)
2003-06-21 08:35:30 +00:00
Simo Sorce
75a5c0b307 Ok, this patch removes the privilege stuff we had in, unused, for some time.
The code was nice, but put in the wrong place (group mapping) and not
supported by most of the code, thus useless.

We will put back most of the code when our infrastructure will be changed
so that privileges actually really make sense to be set.

This is a first patch of a set to enhance all our mapping code cleaness and
stability towards a sane next beta for 3.0 code base

Simo.
(This used to be commit e341e7c49f)
2003-06-18 15:24:10 +00:00
Volker Lendecke
bd1333ea74 Add 'net idmap restore'. This restores a broken idmap file
from the output of 'net idmap dump'.

'net idmap dump' now also prints the USER/GROUP HWM.

Volker
(This used to be commit c0575be936)
2003-06-14 17:51:09 +00:00
Andrew Bartlett
b85664047c This patch modifies 'net rpc vampire' to add new and existing users to both
the idmap and the SAM.

The basic idea is this:  Lookup the user with GetPwnam(), and if they
exist then use that uid.  This is what people expect.  If the user does
not exist, try and run the right script.

This is also what people expect from previous Samba 3.0 behaviour, where
the Get_Pwnam() was at runtime.

If the idmap entry for this SID isn't valid, or isn't the right value,
modify the idmap to account for this mapping.

Also, the same logic is applied to the primary gid - if it has changed,
update the user's primary unix group.

This patch allows users to be added without a mapping - this is fine for
machine accounts, for example.  I've given it a quick test against my
Win2k DC, and I *think* it's sane.

Andrew Bartlett
(This used to be commit d2a70bfff1)
2003-06-14 00:49:02 +00:00
Volker Lendecke
8ad364dd2e Trivial extension to 'net' to dump current local idmap.
(This used to be commit 18f3a5efea)
2003-06-13 16:19:02 +00:00
Jelmer Vernooij
0914e541f5 Reverse previous patch from Stefan and me after comments by Andrew Bartlett
(This used to be commit d817eaf0ec)
2003-05-10 11:49:51 +00:00
Jelmer Vernooij
c507ebe567 Patch from metze and me that adds dummy smb_register_*() functions so
that is now possible to, for example, load a module which contains
an auth method into a binary without the auth/ subsystem built in.
(This used to be commit 74d9ecfe2d)
2003-05-10 10:53:48 +00:00
Andrew Bartlett
4437f7f76d Make it easier to select which domain to show the sid for.
(This used to be commit 4c7efe25c3)
2003-04-21 17:25:54 +00:00
Andrew Bartlett
f071020f5e Merge from HEAD - save the type of channel used to contact the DC.
This allows us to join as a BDC, without appearing on the network as one
until we have the database replicated, and the admin changes the configuration.

This also change the SID retreval order from secrets.tdb, so we no longer
require a 'net rpc getsid' - the sid fetch during the domain join is sufficient.
Also minor fixes to 'net'.

Andrew Bartlett
(This used to be commit 876e00fd11)
2003-04-21 14:09:03 +00:00
Gerald Carter
a1fb9f2176 Merging smbgroupedit into 'net groupmap'. Not entirely done.
Need to check on where the privilege code is sitting
and update the docs.

Examples:

root# bin/net help groupmap
net groupmap add
  Create a new group mapping
net groupmap modify
  Update a group mapping
net groupmap delete
  Remove a group mapping
net groupmap list
  List current group map

# bin/net groupmap add
Usage: net groupmap add rid=<int> name=<string> type=<domain|local|builtin> [comment=<string>]

# bin/net groupmap delete
Usage: net groupmap delete name=<string|SID>

# bin/net groupmap modify
Usage: net groupmap modify name=<string|SID> [comment=<string>] [type=<domain|local>
(This used to be commit f2fd0ab41f)
2003-04-19 05:53:55 +00:00
Jelmer Vernooij
9397cdba52 - Change ADS CHOSTPASS -> ADS CHANGETRUSTPW
- Add general CHANGETRUSTPW function that calls ADS CHANGETRUSTPW or RPC CHANGETRUSTPW
(Merged from HEAD)
(This used to be commit f0982e1102)
2003-04-14 22:27:09 +00:00
Tim Potter
5f82e261c6 Merge:
- Jelmer's latest popt changes
(This used to be commit 6a54d9a0a7)
2003-04-14 03:59:04 +00:00
Andrew Bartlett
d5ee9b2f48 Jeremy merged across my string parinoia fixes, but forgot to enable them! :-)
This patch catches up on the rest of the work - as much string checking
as is possible is done at compile time, and the rest at runtime.

Lots of code converted to pstrcpy() etc, and other code reworked to correctly
call sizeof().

Andrew Bartlett
(This used to be commit c5b604e2ee)
2003-03-18 11:22:52 +00:00
Tim Potter
a03c5f2394 Merge: add popt_common_version to command line options table.
(This used to be commit 8de62f7896)
2003-02-25 23:54:23 +00:00
Jim McDonough
85ecf66547 Properly display popt errors. Also fix debug to be -d for consistency with other progs.
(This used to be commit c58c84e806)
2003-01-21 14:08:33 +00:00
Gerald Carter
4242eda183 merging some rpcclient and net functionality from HEAD
(This used to be commit 7a4c874842)
2003-01-15 17:22:48 +00:00
Gerald Carter
9eeab10e54 [merge]
* removed unused variable from rpcclient code
* added container option to net command (patch from SuSE)
* Makefile patch for examples/VFS from SuSE
(This used to be commit 25a9681ddd)
2003-01-15 16:10:57 +00:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Jeremy Allison
2f194322d4 Removed global_myworkgroup, global_myname, global_myscope. Added liberal
dashes of const. This is a rather large check-in, some things may break.
It does compile though :-).
Jeremy.
(This used to be commit f755711df8)
2002-11-12 23:20:50 +00:00
Andrew Bartlett
2458c8de64 Merge fix for uninitialised IP variable from HEAD
(This used to be commit e3310ac832)
2002-11-09 03:27:42 +00:00
Tim Potter
ab1cf8d1cf Merge of get_dc_list() api change from HEAD.
(This used to be commit 6ba7847ce2)
2002-11-06 05:14:15 +00:00
Jeremy Allison
c53eb2ed54 Added new error codes. Fix up connection code to retry in the same way
that app-head does.
Jeremy.
(This used to be commit ec7953f201)
2002-10-17 17:10:24 +00:00
Andrew Bartlett
ad8a22e570 Updates from Samba HEAD:
- Fix segfaults in the 'net ads' commands when no password is provided
 - Readd --with-ldapsam for 2.2 compatability.  This conditionally compiles the
   old options, but the actual code is available on all ldap systems.
 - Fix shadow passwords (as per work with vl)
 - Fix sending plaintext passwords to unicode servers (again vl)
 - Add a bit of const to secrets.c functions
 - Fix some spelling and grammer by vance.
 - Document the -r option in smbgroupedit.

There are more changes in HEAD, I'm only merging the changes I've been involved
with.

Andrew Bartlett
(This used to be commit 83973c3893)
2002-10-01 13:10:57 +00:00
Gerald Carter
a834a73e34 sync'ing up for 3.0alpha20 release
(This used to be commit 65e7b5273b)
2002-09-25 15:19:00 +00:00
Jelmer Vernooij
f0255b38bc sync 3.0 branch with HEAD
(This used to be commit 1b83b78e33)
2002-08-17 14:45:04 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Jim McDonough
1458b7c795 Lots more net consistency work:
- Added net_help.c for unified help when possible
- Added net rpc user listing, delete, info commands
- Unified net user command to autodetect ads/rpc/rap (try in that order)
- Added generic routine for detecting rpc (protocol > PROTOCOL_NT1)
- I'm sure I forgot something.
(This used to be commit 9daa5788c8)
2002-04-05 01:36:28 +00:00
Jim McDonough
f21cfd9413 Multiple changes:
- Get rid of improper "Invalid option: d (100)" message when setting
  debug from commandline.
- Eliminate got_pass global and only use opt_password.  This enables
  re-use of password that may have been enetered in failed ads connect.
- Auto-detect method for net user command
- use new net_ads_check rather than lp_security==ADS test on net join
- Get rid of annoying debug level 0's
(This used to be commit 1280968000)
2002-04-04 16:53:07 +00:00
Jim McDonough
a3f0bd0b68 Add ability to get specific net ads subcommand help. Not all have been
implemented yet...
(This used to be commit 24c6bf4e8b)
2002-04-04 02:54:47 +00:00
Andrew Bartlett
73c45a4a6f There is no reason we can't join a domain with secuirty=user. In fact we
need to when we are a BDC or a PDC doing a self-join.

Andrew Bartlett
(This used to be commit 996cd3a097)
2002-03-21 11:54:43 +00:00
Tim Potter
ab13654dc9 Renamed get_nt_error_msg() to nt_errstr().
(This used to be commit 1f007d3ed4)
2002-03-17 04:36:35 +00:00
Jim McDonough
e9394d5238 Add autodetect for net join, as well as some more help updates
(This used to be commit 951006374e)
2002-03-15 22:04:53 +00:00
Jim McDonough
bb38f48f6f Some help cleanups. Formatting and consistency issues. Line up text nicely, and make 'net help rap user' the same as 'net rap user help'...stuff like that
(This used to be commit 17775dae28)
2002-03-15 20:03:07 +00:00
Andrew Bartlett
75de5a5dfa The beginning of trusted and trusting domain support from
Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl>

This adds the 'net' tools to manipulate the trusted domains.

Andrew Bartlett
(This used to be commit 770c8a31d9)
2002-03-01 02:56:35 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Jim McDonough
de260eadf9 Enable net ads commands to use existing tickets if the user doesn't specify a username on the commandline. Also don't continue past the kinit if a password is entered and fails because existing tickets would be used, which may not be desired if the username was specified.
(This used to be commit 7e5d7dfa83)
2002-01-25 22:07:46 +00:00
Andrew Bartlett
a0681820e6 Add 'net rpc shutdown' and 'net rpc abortshutdown'.
These two little features are very useful, but the passing of options about
needs some serious work.  The popt stuff in the shutdown code is #ifdef'ed out
until the main popt loop can be convinced not to chew on the options :-(

Andrew Bartlett
(This used to be commit 51c985be7f)
2001-12-31 13:00:59 +00:00
Andrew Tridgell
6722cfc3e6 added net lookup command
(This used to be commit 51268c512d)
2001-12-20 07:42:00 +00:00
Andrew Tridgell
bed11a34ba net now sends its debug to stderr so its output can be relied upon in
scripts
(This used to be commit 6d2f7ed708)
2001-12-20 07:13:47 +00:00
Tim Potter
69e0fe9972 Display a nice error message for NT_STATUS_LOGON_FAILURE in connect_to_ipc()
(This used to be commit 60eb4dc7b1)
2001-12-14 03:55:09 +00:00
Tim Potter
9f6b241175 Set the debuglevel after the call to lp_load() so the change sticks.
(This used to be commit 3c927e39e7)
2001-12-14 02:14:59 +00:00
Andrew Tridgell
0ae4916299 improved error message from failed connect
(This used to be commit 4405a87fb7)
2001-12-13 08:54:51 +00:00
Andrew Tridgell
32ba2c889f added a net time command. Allow display or set of system time based on
a SMB server

particularly useful for ADS is:

	net time set -S DOMAIN#1B

this makes kerberos clock skew problems go away :)
(This used to be commit b3ba2293d0)
2001-12-11 05:21:50 +00:00
Tim Potter
4589265bb0 Removed unreferenced getopt() externals.
(This used to be commit c87d1ad321)
2001-12-11 04:25:21 +00:00
Andrew Tridgell
0c29881501 reinstated all the rap commands as top level commands until we get the
protocol switch mechanism in place
(This used to be commit d20c3717dd)
2001-12-10 22:25:21 +00:00
Andrew Bartlett
8ba00d147b OK. Smbpasswd -j is DEAD.
This moves the rest of the functionality into the 'net rpc join' code.

Futhermore, this moves that entire area over to the libsmb codebase, rather
than the crufty old rpc_client stuff.

I have also fixed up the smbpasswd -a -m bug in the process.

We also have a new 'net rpc changetrustpw' that can be called from a
cron-job to regularly change the trust account password, for sites
that run winbind but not smbd.

With a little more work, we can kill rpc_client from smbd entirly!
(It is mostly the domain auth stuff - which I can rework - and the
spoolss stuff that sombody else will need to look over).

Andrew Bartlett
(This used to be commit 575897e879)
2001-12-05 11:00:26 +00:00
Andrew Bartlett
f98d753b2f Make it easier to construct anonymous connections with a new flag and helper
function.
(This used to be commit 61b0f5f4f9)
2001-12-05 03:14:21 +00:00
Andrew Bartlett
2f87684a1e Split out the name resolution code into a seperate function
(This used to be commit b2443f6fca)
2001-12-05 02:58:40 +00:00
Andrew Bartlett
275a9f4ef7 Some changes to the name resolution code in 'net' to allow us to find a
PDC, as well as changes for correctness as per tridge.

Andrew Bartlett
(This used to be commit 16d302c5cc)
2001-12-04 04:48:01 +00:00
Andrew Bartlett
3ea7519b06 This change reworkes the connection code for both rpcclient and net new
'net' untility.

This should make it easier to port rpcclient code across to net.

It also allows SPNEGO (the NTLMSSP subsystem in particular) to work, becouse
it kills off the early destruction of the clear-text password.

Andrew Bartlett
(This used to be commit eee925861a)
2001-12-03 07:42:18 +00:00
Andrew Bartlett
feb4f52f13 This is another major rework of the 'net' command.
This time, all the existing functionality has been moved into
'net rap', ready for new commands in the 'net ads' and 'net rpc' categories.

In particular, we hope to have the abilty to autoselect the appropriate
backend to use based on smb.conf or other paramaters.

This will allow 'net user' to work no matter what the remote server.

The new 'net rpc' command will soon gain a 'net rpc join' and a
'net rpc user' based on the existing samba code.

Also in this commit, the connection establishment code has been almost entirly
reworked, and now has some minor sense of sainity to it.
In particular, we can now connect to hosts *other* than localhost!

We also have the ability to state on a per-command basis whether the 'localhost'
is a sane default value.  (A net join, for example, would not be sane against
localhost).

Unfortunetly we have had to make the basic paramaters global variables, but
the 'cli' is not opened and closed on a per-command basis.

Andrew Bartlett
(This used to be commit 8739d426ca)
2001-12-03 04:39:23 +00:00
Andrew Tridgell
eec9e8a052 fix a bunch of places where we can double-free a cli structure
(This used to be commit e2ba2383c9)
2001-11-28 03:56:30 +00:00
Andrew Bartlett
1a08524ddb prevent proto from picking up this as a defintion for 'main()' becoue it conflicts with nmbd's definition.
(This used to be commit 70e9c2efaa)
2001-11-26 05:59:43 +00:00
Tim Potter
222311817f More compiler warnings fixed. Some minor reformatting.
(This used to be commit 8227f6909c)
2001-11-26 04:53:08 +00:00
Tim Potter
585d0efbc6 Got medieval on another pointless extern. Removed extern struct ipzero
and replaced with two functions:

	void zero_ip(struct in_adder *ip);
	BOOL is_zero_ip(struct in_addr ip);
(This used to be commit 778f5f77a6)
2001-11-26 03:11:44 +00:00
Andrew Tridgell
660fa6632e portability fixes
(This used to be commit 09127d85dc)
2001-11-25 13:36:02 +00:00
Andrew Tridgell
2ff1b666c1 fixed typo
(This used to be commit b14ae49502)
2001-11-25 13:32:28 +00:00
Andrew Tridgell
9255dc9a14 made a "net ads" command, currently with "net ads join" and "net ads leave"
(This used to be commit 2f8fa175b1)
2001-11-25 00:18:11 +00:00
Andrew Tridgell
ad2974cd05 added "net join" command
this completes the first stage of the smbd ADS support
(This used to be commit 058a5aee90)
2001-11-24 14:16:41 +00:00
Andrew Tridgell
3c63b841cc rewrote net.c
The rewrite fixes a number of things:

- much better command line parsing
- fixed usage of static and const
- better finding of hosts
- clean internal separation of sub-functions
- expandable design
(This used to be commit 0f88d9c50e)
2001-11-24 13:26:01 +00:00
Martin Pool
f741f65673 Store some path names in global variables initialized to configure
default, rather than in preprocessor macros.
(This used to be commit 79ec88f0da)
2001-11-19 02:49:53 +00:00
Steve French
3ea2fd3a96 Minor fixes to help display, and domain enumeration , and also preparation for new command option
(This used to be commit 3623fbb4f0)
2001-11-12 22:50:48 +00:00
Jim McDonough
806c951344 Internationalization enbalement for net utility - replace printf with d_printf
(This used to be commit b83b21e9ca)
2001-11-06 16:28:50 +00:00
Jeremy Allison
30be58a857 Got serious about const again.
REMOVED BZERO CALLS YET AGAIN !!! Why do these keep creeping back in....
They are *NOT* POSIX. I'm also thinking of removing strncpy as I'm sure
it's not being used correctly....
Jeremy.
(This used to be commit b1930abb35)
2001-11-04 00:14:08 +00:00
Steve French
a8346f4e83 Adding support for net password, net service, net user info, fixing net helps
(This used to be commit a1f3930637)
2001-11-03 21:11:28 +00:00
Herb Lewis
b8fe0f6711 more compiler warnings
(This used to be commit 12c10e876e)
2001-10-23 20:39:38 +00:00
Jim McDonough
c290b209c5 Remove setbuffer which caused build errors
(This used to be commit 5a482350a7)
2001-10-23 17:49:28 +00:00
Jim McDonough
b955d94d5c Replace getopt_long with popt for parsing commandline options
(This used to be commit 0be7bf421b)
2001-10-23 14:16:59 +00:00
Jim McDonough
10d0331754 Add command-line remote management utility
(This used to be commit 50c243518a)
2001-10-19 16:51:26 +00:00