1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-22 07:17:05 +03:00

199 Commits

Author SHA1 Message Date
Gerald Carter
3eddae2f20 r19754: * When using a krb5 session setup, we don't fill in the server_name
string the clis_state struct.  So call saf_store() after we
  have the short domain name in the lsa_query_inof_policy code.

* Remove unused server string in saf_delete()
2007-10-10 12:15:53 -05:00
Günther Deschner
ff004f7284 r19651: Fix interesting bug with the automatic site coverage in Active Directory:
When having DC-less sites, AD assigns DCs from other sites to that site
that does not have it's own DC. The most reliable way for us to identify
the nearest DC - in that and all other cases - is the closest_dc flag in
the CLDAP reply.

Guenther
2007-10-10 12:15:44 -05:00
Günther Deschner
4bad52c5b3 r19528: Fix container handling for "net ads user" and "net ads group" functions
along with some memleaks.

Guenther
2007-10-10 12:15:41 -05:00
Günther Deschner
08db3d3b04 r19527: Fix double free in "net ads group add".
Guenther
2007-10-10 12:15:41 -05:00
Günther Deschner
94ed3e9de8 r19525: Fix the same error in "net ads group delete".
Guenther
2007-10-10 12:15:40 -05:00
Günther Deschner
a20e7c0315 r19524: Stop "net ads user delete" from doing funny things.
Guenther
2007-10-10 12:15:40 -05:00
Günther Deschner
e691ae7da3 r19493: There is no point in prompting for a user's password in "net ads" when
we can't find a domain controller at all.

Guenther
2007-10-10 12:15:39 -05:00
Jeremy Allison
47352b5398 r19257: Janitor for Guenther - as well as a little massaging to make
his patch fit SAMBA_3_0. (This is guenthers code). Make
site support work correctly in net ads join.
Jeremy.
2007-10-10 12:15:26 -05:00
Günther Deschner
359315021d r19039: Do not segfault in "net ads printer info" when a requested printserver
does not exist.

Guenther
2007-10-10 12:15:04 -05:00
Günther Deschner
d086babf9d r19003: Finally activate "net ads gpo".
For those who are interested, try

        net ads gpo refresh mybox$

to get your machine related GPOs downloaded to /var/lib/samba/gpo_cache.
Detailed information about GPOs is currently only printed when setting a
higher debuglevel then 0.

Guenther
2007-10-10 12:14:55 -05:00
Günther Deschner
927cda5d31 r18817: Enable the build of the gpo tool but do not make it available yet.
Guenther
2007-10-10 12:01:03 -05:00
Jeremy Allison
2c003a4463 r18467: Some sites allow an account to be deleted, but not
disabled. Cope with both - print appropriate messages.
Jeremy.
2007-10-10 11:51:43 -05:00
Jeremy Allison
f47bffa21e r18446: Add the ldap 'leave domain' code - call this as
a non-fatal error path if the 'disable machine
account' code succeeded.
Jeremy.
2007-10-10 11:51:42 -05:00
Günther Deschner
1bb29acb3b r18170: Make sure to actually get the printing data before trying to publish it
in AD.

Guenther
2007-10-10 11:43:30 -05:00
Volker Lendecke
b2ff9680eb r18019: Fix a C++ warnings: Don't use void * in libads/ for LDAPMessage anymore.
Compiled it on systems with and without LDAP, I hope it does not break the
build farm too badly. If it does, I'll fix it tomorrow.

Volker
2007-10-10 11:39:49 -05:00
Jeremy Allison
b8cedcac93 r17941: Fix print out of client site name.
Jeremy.
2007-10-10 11:39:00 -05:00
Jeremy Allison
ab3f0c5b1e r17928: Implement the basic store for CLDAP sitename
support when looking up DC's. On every CLDAP
call store the returned client sitename (if
present, delete store if not) in gencache with
infinate timeout. On AD DNS DC lookup, try looking
for sitename DC's first, only try generic if
sitename DNS lookup failed.
I still haven't figured out yet how to ensure
we fetch the sitename with a CLDAP query before
doing the generic DC list lookup. This code is
difficult to understand. I'll do some experiments
and backtraces tomorrow to try and work out where
to force a CLDAP site query first.
Jeremy.
2007-10-10 11:38:59 -05:00
Gerald Carter
36f04674ae r17798: Beginnings of a standalone libaddns library released under
the LGPL.   Original code by Krishna Ganugapati <krishnag@centeris.com>.
Additional work by me.

It's still got some warts, but non-secure updates do
currently work.  There are at least four things left to
really clean up.

1. Change the memory management to use talloc() rather than
   malloc() and cleanup the leaks.
2. Fix the error code reporting (see initial changes to
   dnserr.h)
3. Fix the secure updates
4. Define a public interface in addns.h
5. Move the code in libads/dns.c into the libaddns/ directory
   (and under the LGPL).

A few notes:

* Enable the new code by compiling with --with-dnsupdate
* Also adds the command 'net ads dns register'
* Requires -luuid (included in the e2fsprogs-devel package).
* Has only been tested on Linux platforms so there may be portability
  issues.
2007-10-10 11:38:48 -05:00
Volker Lendecke
47facab798 r17603: Make net_ads_join_ok return NTSTATUS.
Thanks to Michael Adam <ma@sernet.de>

hop, hop, hop... ;-)

Volker
2007-10-10 11:38:42 -05:00
Volker Lendecke
27cca86150 r17602: Make check_ads_config return NTSTATUS, set some error codes in net_ads_join.
Thanks to Michael Adam <ma@sernet.de>

Volker
2007-10-10 11:38:42 -05:00
Volker Lendecke
a347f8a9c4 r17591: machine_account is unused, and ctx must be freed. Thanks Michael 2007-10-10 11:38:41 -05:00
Volker Lendecke
ea3a4142a0 r17585: Don't let ads_status throw away the error information.
Thanks to Michael Adam <ma@sernet.de>.

Volker
2007-10-10 11:38:41 -05:00
Volker Lendecke
c4e10afadb r17557: Change net_join_domain to return NTSTATUS instead of int.
Thanks to Michael Adam <ma@sernet.de>.

Volker
2007-10-10 11:38:39 -05:00
Volker Lendecke
d44599de3a r17551: Move some DEBUG to d_printf in interactive functions and return
NO_LOGON_SERVERS if no domain controller was found.

Thanks to Michael Adam <ma@sernet.de>.

Volker
2007-10-10 11:38:38 -05:00
Gerald Carter
24de2d83ff r17383: Patch from Michael Adams <ma@sernet.de> to catch
some memory leaks on error paths in net_ads_join()
2007-10-10 11:38:29 -05:00
Gerald Carter
87be77bf35 r17258: Cleanup the 'net ads help join' output and document createupn
and createcomputer options
2007-10-10 11:38:22 -05:00
Gerald Carter
75054e984e r17158: Add two new options to 'net ads join'
* createupn=[host_upn@realm]
  * createcomputer=<ou path top to bottom> (this was previously
    the only arg)
2007-10-10 11:38:17 -05:00
Gerald Carter
1a7e81a4a8 r17149: Fail the join if we cannot set any SPNs for the machine account.
Disable the one we created and whine.
2007-10-10 11:38:16 -05:00
Günther Deschner
d573e64781 r17086: Re-add ability to contact remote domain controllers with the "net ads"
toolset.

In 3.0.23 all those commands have been limited to the DC of our primary
domain. Also distinguish calls that may go to remote DCs (search, info,
lookup, etc.) from those that should only go to our primary domain
(join, leave, etc.).

Guenther
2007-10-10 11:38:10 -05:00
Gerald Carter
6261dd3c67 r16952: New derive DES salt code and Krb5 keytab generation
Major points of interest:

* Figure the DES salt based on the domain functional level
  and UPN (if present and applicable)
* Only deal with the DES-CBC-MD5, DES-CBC-CRC, and RC4-HMAC
  keys
* Remove all the case permutations in the keytab entry
  generation (to be partially re-added only if necessary).
* Generate keytab entries based on the existing SPN values
  in AD

The resulting keytab looks like:

ktutil:  list -e
slot KVNO Principal
---- ---- ---------------------------------------------------------------------
   1    6 host/suse10.plainjoe.org@COLOR.PLAINJOE.ORG (DES cbc mode with CRC-32)
   2    6 host/suse10.plainjoe.org@COLOR.PLAINJOE.ORG (DES cbc mode with RSA-MD5)
   3    6 host/suse10.plainjoe.org@COLOR.PLAINJOE.ORG (ArcFour with HMAC/md5)
   4    6           host/suse10@COLOR.PLAINJOE.ORG (DES cbc mode with CRC-32)
   5    6           host/suse10@COLOR.PLAINJOE.ORG (DES cbc mode with RSA-MD5)
   6    6           host/suse10@COLOR.PLAINJOE.ORG (ArcFour with HMAC/md5)
   7    6               suse10$@COLOR.PLAINJOE.ORG (DES cbc mode with CRC-32)
   8    6               suse10$@COLOR.PLAINJOE.ORG (DES cbc mode with RSA-MD5)
   9    6               suse10$@COLOR.PLAINJOE.ORG (ArcFour with HMAC/md5)

The list entries are the two basic SPN values (host/NetBIOSName & host/dNSHostName)
and the sAMAccountName value.  The UPN will be added as well if the machine has
one. This fixes 'kinit -k'.

Tested keytab using mod_auth_krb and MIT's telnet.  ads_verify_ticket()
continues to work with RC4-HMAC and DES keys.
2007-10-10 11:19:15 -05:00
Jeremy Allison
9dafb7f48c r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
2007-10-10 11:19:14 -05:00
Günther Deschner
49fb1a3ebc r16453: Fix another memleak.
Guenther
2007-10-10 11:18:55 -05:00
Jeremy Allison
face01ef01 r16284: Start fixing up gcc4 -O6 warnings on an x86_64 box. size_t != unsigned
int
in a format string.
Jeremy.
2007-10-10 11:17:31 -05:00
Günther Deschner
689ae22c80 r16261: Smaller fixes for net ads password.
Guenther
2007-10-10 11:17:28 -05:00
Günther Deschner
8fc70d0df0 r16115: Make "net ads changetrustpw" work again.
(adapt to the new UPN/SPN scheme).

Guenther
2007-10-10 11:17:21 -05:00
Günther Deschner
741602e03a r15703: Fix d_printf call.
Guenther
2007-10-10 11:17:08 -05:00
Gerald Carter
ad1f947625 r15701: change 'net ads leave' to disable the machine account in the domain (since removal implies greater permissions that Windows clients require) 2007-10-10 11:17:08 -05:00
Gerald Carter
ae2bf464c4 r15680: use the user creds when calling net_set_machine_spn() rather than the machine creds (just like WinXP) 2007-10-10 11:17:07 -05:00
Gerald Carter
d933ac273d r15597: more ads join fixes -- we can only set the PWDNOEXP and DES_ONLY acb flags on the setuserinfo(), not the createuser info call 2007-10-10 11:17:02 -05:00
Gerald Carter
00c795e366 r15561: Should re-fix older systems without RC4-HMAC support 2007-10-10 11:17:01 -05:00
Gerald Carter
b69ac0e304 r15560: Since the hotel doesn't have Sci-Fi and no "Doctor Who"....
Re-add the capability to specify an OU in which to create
the machine account.  Done via LDAP prior to the RPC join.
2007-10-10 11:17:01 -05:00
Günther Deschner
8dd925c5fb r15559: Smaller fixes for the new cldap code:
* replace printf to stderr with DEBUG statements as they get printed in
  daemons
* "net ads lookup" return code

Guenther
2007-10-10 11:17:01 -05:00
Gerald Carter
4c4ea7b20f r15543: New implementation of 'net ads join' to be more like Windows XP.
The motivating factor is to not require more privileges for
the user account than Windows does when joining a domain.

The points of interest are

* net_ads_join() uses same rpc mechanisms as net_rpc_join()
* Enable CLDAP queries for filling in the majority of the
  ADS_STRUCT->config information
* Remove ldap_initialized() from sam/idmap_ad.c and
  libads/ldap.c
* Remove some unnecessary fields from ADS_STRUCT
* Manually set the dNSHostName and servicePrincipalName attribute
  using the machine account after the join

Thanks to Guenther and Simo for the review.

Still to do:

* Fix the userAccountControl for DES only systems
* Set the userPrincipalName in order to support things like
  'kinit -k' (although we might be able to just use the sAMAccountName
  instead)
* Re-add support for pre-creating the machine account in
  a specific OU
2007-10-10 11:16:57 -05:00
Volker Lendecke
f21adc04f7 r15471: Clarify error message 2007-10-10 11:16:51 -05:00
Gerald Carter
cf71f88a3c r15462: replace the use of OpenLDAP's ldap_domain2hostlist() for
locating AD DC's with out own DNS SRV queries.
Testing on Linux and Solaris.
2007-10-10 11:16:49 -05:00
Günther Deschner
847882a983 r15460: Prefer to use the indexed objectCategory attribute (instead of
objectClass which is not indexed on AD) in LDAP queries.

Guenther
2007-10-10 11:16:49 -05:00
Jeremy Allison
780b71d300 r15336: Unknown escape sequence: '\305' - should have been '\n'.
(How did that get in there ?).
Jeremy
2007-10-10 11:16:36 -05:00
Günther Deschner
5557ada694 r15305: Let winbind search by sid directly (or in windows terms: "bind to a
sid"); works in all AD versions I tested. Also add "net ads sid" search
tool.

Guenther
2007-10-10 11:16:33 -05:00
Günther Deschner
ba81b508ca r15194: We need to be able to join as PDC as well. Thanks to Andrew Bartlett.
Guenther
2007-10-10 11:16:28 -05:00
Volker Lendecke
0ef5e4372c r15137: Refuse to join if our netbios name is longer than 15 chars. I think this is
sufficient to fix bug #3659.

Volker
2007-10-10 11:16:26 -05:00