1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

785 Commits

Author SHA1 Message Date
Richard Sharpe
b53547bf66 Update some help. People keep forgetting that! -
Richard Sharpe
08c3e2b824 Add net getlocalsid [name] -
Volker Lendecke
b959419ed3 Ok, getting a bit more ambitious. Stop me, if this is wrong. ;-)
When creating a group you have to take care of the fact that the
underlying unix might not like the group name. This change gets around
that problem by giving the add group script the chance to invent a
group name. It then must only return the newly created numerical gid.

Volker
-
Volker Lendecke
42774a7753 Cosmetic fix for debug message. -
Volker Lendecke
f6ed429838 Add the ability to view/set the current local domain SIDs.
Volker
-
Volker Lendecke
8c41b5cd1b Change parsing of policy and privs delta to what Ethereal says.
Volker
-
Volker Lendecke
0c1fadd9e0 First code for 'net rpc vampire'. We should probably find a more
positive name for this. It creates users and global groups. More to come.

Volker
-
Richard Sharpe
a8dc1464ea Add a synonym for samdump ... -
Andrew Tridgell
0d28d76947 Add clock skew handling to our kerberos code. This allows us to cope with
the DC being out of sync with the local machine.
-
Andrew Tridgell
05a202c287 added gencache implementation from mimir - thanks! -
Gerald Carter
6f0561acad removing compiler warnings about shadowed globals -
Andrew Bartlett
d1e1fc3e4b This is the 'easy' parts of the trusted domains patch n+3 patch from
Rafal Szczesniak <mimir@diament.ists.pwr.wroc.pl>

It includes a conversion of make_user_info*() to NTSTATUS and some minor
changes to other files.

It also picks up on a nasty segfault that can occour in some security=domain
cases.

Andrew Bartlett
-
Andrew Bartlett
5b9a7ab901 Patch from "Stefan (metze) Metzmacher" <metze@metzemix.de>
to extend the ADS_STATUS system to include NTSTATUS, and to provide a better
general infrustructure for his sam_ads work.

I've also added some extra failure mode DEBUG()s to parts of the code.

NOTE:  The ADS_ERR_OK() macro is rather sensitive to braketing issues - without
the final set of brakets, the test is essentially inverted - causing some
intersting 'error = success' messages...

Andrew Bartlett
-
Volker Lendecke
26bee60a41 Fix segfault in net command -
Jean-François Micouleau
4d38caca40 added cli_net_auth_3 client code.
changed cli_nt_setup_creds() to call cli_net_auth_2 or cli_net_auth_3 based on a switch.
pass also the negociation flags all the way.
all the places calling cli_nt_setup_creds() are still using cli_net_aut2(), it's just for future use and for rpcclient.

in the future we will be able to call auth_2 or auth_3 as we want.

	J.F.
-
Andrew Tridgell
b04e91f660 convert the LDAP/SASL code to use GSS-SPNEGO if possible
we now do this:

- look for suported SASL mechanisms on the LDAP server
- choose GSS-SPNEGO if possible
- within GSS-SPNEGO choose KRB5 if we can do a kinit
- otherwise use NTLMSSP

This change also means that we no longer rely on having a gssapi
library to do ADS.

todo:
- add TLS/SSL support over LDAP
- change to using LDAP/SSL for password change in ADS
-
Volker Lendecke
23a4f6991e There's more work to be done on samsync. Intermediate commit, now
I get all the groups at least.

Volker
-
Andrew Tridgell
c1e00f5f16 show builtin groups in samdump -
Volker Lendecke
f76a5431f0 'No news is good news' might sometimes be confusing, at least to me :-)
Volker
-
Jelmer Vernooij
4b7de5ee23 Put in intermediate version of new SAM system. It's not stable yet, code
might be ugly, etc - please don't blame me for anything but instead try to fix
the code :-). Compiling of the new sam system can be enabled with the
configure option --with-sam

Removing passdb/passgrp.c as it's unused
fix typo in utils/testparm.c
-
Gerald Carter
e913d508d4 add hook for MSG_PRINTER_DRVUPGRADE that numps the change_id on all printers bound to a given driver -
Andrew Tridgell
228fc518da a few minor cleanups in the cldap request -
Andrew Tridgell
e4cb106d2e added a 'net rpc samdump' command for dumping the whole sam via
samsync operations (as a BDC)
-
Andrew Bartlett
4cd822d9e4 This is like jht's (abortive) patch for showing only non-default testparm
options.

Andrew Bartlett
-
Jelmer Vernooij
addf29e676 Patch from Paul Green <Paul.Green@stratus.com> to be more POSIX-compatible -
Volker Lendecke
287b7bda11 pdbedit needs global_myname to be set in order to display the
user SIDs correctly.

Volker
-
Volker Lendecke
2df34c9bfc global_myname is a pstring, not an fstring -
Volker Lendecke
12fd889a3f Add 'net rpc getsid' to fetch the PDC's SID into the local secrets.tdb
Print domain SID on 'net rpc info'

Volker
-
Volker Lendecke
169e784f48 just comment typos -
Volker Lendecke
5af5326f13 Fix debug level initialization for net.c
Volker
-
Andrew Tridgell
8aae10bcdc print out the GUID in the CLDAP reply -
Andrew Tridgell
67b4dbd5c9 we now parse the cldap reply and print its contents. There are a
couple of unknown fields we still need to work out.
-
Andrew Tridgell
6780ae25bf we now receive and parse the main cldap netlogon reply.
we still need to parse the core of the structure
-
Andrew Tridgell
6352508c54 added a 'net ads lookup' command that does a CLDAP NetLogon query to a
win2000 server. It does seem to work, and win200 sends us a valid
reply, but we don't parse it yet. Maybe tomorrow :)
-
Simo Sorce
cb72eead70 *** empty log message *** -
Tim Potter
aa93db5abe Merge some usage info from APPLIANCE_HEAD. -
Andrew Bartlett
e57a896f06 Fix the %m security bug again - and try to make it harder to reintroduce in
future.

This moves us from fstrcpy() and global variables to 'get' and 'set' functions.

In particular, the 'set' function sainity-checks the input, in the same way as
we always have.

Andrew Bartlett
-
Andrew Tridgell
3b0e60e522 fixed 'net ads chostpass' for new ads structures -
Andrew Tridgell
87c34a974a added 'net rpc testjoin' and 'net ads testjoin' commands
unfortuately we don't seem to be able to auto-test the ADS join due to
a rather nasty property of the GSSAPI library.
-
Andrew Tridgell
e358d7b24c This fixes a number of ADS problems, particularly with netbiosless
setups.

- split up the ads structure into logical pieces. This makes it much
  easier to keep things like the authentication realm and the server
  realm separate (they can be different).

- allow ads callers to specify that no sasl bind should be performed
(used by "net ads info" for example)

- fix an error with handing ADS_ERROR_SYSTEM() when errno is 0

- completely rewrote the code for finding the LDAP server. Now try DNS
  methods first, and try all DNS servers returned from the SRV DNS
  query, sorted by closeness to our interfaces (using the same sort code
  as we use in replies from WINS servers). This allows us to cope with
  ADS DCs that are down, and ensures we don't pick one that is on the
  other side of the country unless absolutely necessary.

- recognise dnsRecords as binary when displaying them

- cope with the realm not being configured in smb.conf (work it out
  from the LDAP server)

- look at the trustDirection when looking up trusted domains and don't
  include trusts that trust our domains but we don't trust
  theirs.

- use LDAP to query the alternate (netbios) name for a realm, and make
  sure that both and long and short forms of the name are accepted by
  winbindd. Use the short form by default for listing users/groups.

- rescan the list of trusted domains every 5 minutes in case new trust
  relationships are added while winbindd is running

- include transient trust relationships (ie. C trusts B, B trusts A,
  so C trusts A) in winbindd.

- don't do a gratuituous node status lookup when finding an ADS DC (we
  don't need it and it could fail)

- remove unused sid_to_distinguished_name function

- make sure we find the allternate name of our primary domain when
  operating with a netbiosless ADS DC (using LDAP to do the lookup)

- fixed the rpc trusted domain enumeration to support up to approx
  2000 trusted domains (the old limit was 3)

- use the IP for the remote_machine (%m) macro when the client doesn't
  supply us with a name via a netbios session request (eg. port 445)

- if the client uses SPNEGO then use the machine name from the SPNEGO
  auth packet for remote_machine (%m) macro

- add new 'net ads workgroup' command to find the netbios workgroup
  name for a realm
-
Simo Sorce
5a257096e9 passwords where not checked (you cannot check if the same buffer differs from itself).
they where alo not clean after use!

Simo.
-
Tim Potter
7bf9ca6ca3 Merge of print notify fixes from APPLIANCE_HEAD. -
Andrew Tridgell
ced5dc4e05 fixed a net crash bug if we can't find a DC in a 'net rpc' command -
Andrew Tridgell
cffa881092 make sure that 'net ads info' gives info on the server we specify, not
our smb.conf setup.
-
Andrew Tridgell
fc0d5479b5 net ads info now reports the IP of the LDAP server as well as its name - very useful in scripts -
Tim Potter
8c17904848 Use common popt definition for -d option. -
Andrew Bartlett
2bf6edf78b Add the ability to set account policies too.
Andrew Bartlett
-
Andrew Bartlett
71452365c8 Clean this code up a little. If it's alrady asprintf()ed, I see no
need for a manual strdup() too...
-
Andrew Bartlett
f089002682 Rafal 'Mimir' Szczesniak <mimir@diament.ists.pwr.wroc.pl> has been busy
again, and has added 'net rpc trustdom list' support.

This lists the trusted and trusting domains of a remote PDC.

I've applied these almost directly, just fixing some special
case code for when there are *no* trusting domains.  We still
have some parse errors in this case however.

Andrew Bartlett.


From mimir's e-mail:

Here are another patches adding trust relationship features.
More details:

    Better error reporting in cli_lsa_enum_trust_dom().
    Implementation of cli_samr_enum_dom_users() which cli_samr.c
    lacked.

    More "consts" -- one of arguments in net_find_dc().
    Modified implementation of run_rpc_command() -- now it
    allows to reuse already opened connection (if it is passed)
    to remote server's IPC$ (e.g. as part of longer exchange
    of rpc calls). I'm sure Andrew will argue ;-)
    More neat version of rpc_trustdom_list() function.
-
Andrew Bartlett
888d595fab Mimir has been busy with patches again, and sent in the following
patches:

Andrew Bartlett

From his e-mail:

Below I attach the following patches as a result of my work
on trusted domains support:
 1) srv_samr_nt.c.diff
    This fixes a bug which caused to return null string as
    the first entry of enumerated accounts list (no matter what
    entry, it was always null string and rid) and possibly
    spoiled further names, depeding on their length.
    I found that while testing my 'net rpc trustdom list'
    against nt servers and samba server.
 2) libsmb.diff
    Now, fallback to anonymous connection works correctly.
 3) smbpasswd.c.diff
    Just a little fix which actually allows one to create
    a trusting domain account using smbpasswd
 4) typos.diff
    As the name suggests, it's just a few typos fix :)
-