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

759 Commits

Author SHA1 Message Date
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 :)
-
Andrew Bartlett
c5b5e3d653 Make it possible to query account policy values from pdbedit (set to come soon).
Update account_pol.c to use just uint32, rather then uint32 for paramaters,
int32 for storage.  (The int32 functions didn't have seperate return/status
values, uint32 functions use a pointer-paramater).

Move the #define -> string from a swtich to a table, so we can look it up
both ways.

Andrew Bartlett
-
Tim Potter
fe229cc126 Fix up dir drive call. -
Andrew Bartlett
21b0e8f560 More cleanups, and add a comment/hint not to clean somthing up in future :-)
Andrew Bartlett
-
Andrew Bartlett
897cc4a610 Another smattering of static and const -
Tim Potter
277f6bbb9a Renamed all the new_cli_netlogon_* functions to cli_netlogon_*
as they're no longer new!
-
Andrew Bartlett
5081062853 Oops, my bad. I forgot to assign this, so lookupnames wasn't doing much :-) -
Andrew Bartlett
30d0998c8c More fixes towards warnings on the IRIX compiler
(and yes, some of these are real bugs)

In particular, the samr code was doing an &foo of various types, to a function
that assumed uint32.  If time_t isn't 32 bits long, that broke.

They are assignment compatible however, so use that and an intermediate
variable.

Andrew Bartlett
-
Andrew Bartlett
860f5b1a0c correctly declare global_myworkgroup to be the right size.
Andrew Bartlett
-
Andrew Bartlett
8196ee908e Try to fix up warnings - particularly on the IRIX 64 bit compiler (which had a
distinction between uchar and char).

Lots of const etc.

Andrew Bartlett
-
Andrew Bartlett
bce3a2b1d8 Update the usage for smbgroupedit to document -d for 'description'.
I think this one is due to metze.

Andrew Bartlett
-
Andrew Bartlett
b5ec92d7a2 Show the account flags in the 'verbose' listing of pdbedit.
Andrew Bartlett
-
Andrew Tridgell
39e11ef5b1 move opt_machine_pass to keep some compilers happy -
Andrew Tridgell
a7663428e0 added useful 'net rpc info' command
this also gives a way to distinguish a 'native mode' server from a
non-native server. This call will fail for a native mode server.
-
Andrew Tridgell
73b246981f added --machine-pass option to net. This allows you to authenticate as
the current machine account and password. This is useful both for
diagnostics and domain leave.
-
Andrew Bartlett
4687fac69d This makes smbcacls a bit easier to use and debug.
Allow connection in the form of //server/share instead of just \\server\share
and show the reason for failure from cli_full_connection().

Andrew Bartlett
-
Andrew Tridgell
abc2aed26c make net join a bit less verbose
these errors happen all the time, so they shouldn't be level 0
-
Jeremy Allison
3603cd4947 Proper merge of all the working printing stuff from APPLIANCE_HEAD.
Now let's keep this in sync !
Jeremy.
-
Andrew Tridgell
e125f06058 This commit finally gives us multiple wins server groups. We now
accept an extended syntax for 'wins server' like this:

  wins server = group1:192.168.2.10 group2:192.168.3.99 group1:192.168.0.1

The tags before the IPs don't mean anything, they are just a way of
grouping IPs together. If you use the old syntax (ie. no ':') then
an implicit group name of '*' is used. In general I'd recommend people
use interface names for the group names, but it doesn't matter much.

When we register in nmbd we try to register all our IPs with each group
of WINS servers. We keep trying until all of them are registered with
every group, falling back to the failover WINS servers for each group
as we go.

When we do a WINS lookup we try each of the WINS servers for each group.
If a WINS server for a group gives a negative answer then we give up
on that group and move to the next group. If it times out then
we move to the next failover wins server in the group.

In either case, if a WINS server doesn't respond then we mark it dead
for 10 minutes, to prevent lengthy waits for dead servers.
-
Andrew Bartlett
23689b0746 Update cli_full_connection() to take a 'flags' paramater, and try to get a
few more places to use it.

Andrew Bartlett
-
Andrew Bartlett
7f81e423d2 Add a .cvsignore file -
Andrew Bartlett
edb41dad2d Break up samba's object dependencies, and its prototype includes.
Now smbclient, net, and swat use their own proto files - now the global
proto.h

The change to libads/kerberos.c was to break up the dependency on secrets.c -
we want to be able to write an ADS client that doesn't need local secrets.

I have other breakups in the works - I will remove the dependency of
rpc_parse on passdb (and therefore secrets.c) shortly.

(NOTE:  This patch does *not* break up includes.h, or other such forbidden
actions).

Andrew Bartlett
-
Jim McDonough
f924cb5358 Support utf8 on the wire for ads ldap. DN's are converted, as well as strings,
though it is up to the calling function to decide whether values are
strings or not.  Attributes are not converted at this point, though support
for it would be simple.

I have tested it with users and groups using non-ascii chars, and if the
check for alphanumeric user/domain names is removed form sesssetup.c, even
a user with accented chars can connect, or even login (via winbind).

I have also simplified the interfaces to ads_mod_*, though we will probably
want to expand this by a few functions in the near future.  We just had
too many ways to do the same thing...
-
Jeremy Allison
5841ca54b6 Don't use uint. It doesn't exist on some platforms and we don't define it.
Replaced with "unsigned int".
Jeremy.
-
Andrew Bartlett
11b6d283d3 Cope with the requirement for constant initialisers on some unix C compilers.
Andrew Bartlett
-
Andrew Bartlett
e2f9dd8b65 Kill useless cast -
Andrew Bartlett
c264bf2ec9 Patch from ctrlsoft to make the pluggable passdb subsystem use an lp_list
rather than a string when configuring mulitple backends.

Also adjust some of the users of get_global_sam_sid() to cope with the fact
that it just might not exist (uninitialised, can't access secrets.tdb).

More places need conversion.

Add some const and remove silly casts.

Andrew Bartlett
-