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

151 Commits

Author SHA1 Message Date
Volker Lendecke
5f3b7ee713 r19766: Fix a const-warning. Jerry, what did you want to fix with this line?
Volker
(This used to be commit 55dc4741cf)
2007-10-10 12:15:54 -05:00
Gerald Carter
c2aae726ea r19762: libaddns/*[ch] code fixes donated by Centeris Corporation
(http://www.centeris.com/) under my copyright.

* Rework error reporting to use DNS_ERROR instead
  of int32
* Convert memory allocation to use talloc()
* Generalize the DNS request/response packet marshalling
* Fix the secure update requests
(This used to be commit c787983336)
2007-10-10 12:15:53 -05:00
Gerald Carter
8fa0a80b49 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()
(This used to be commit 3eddae2f20)
2007-10-10 12:15:53 -05:00
Günther Deschner
61a38bd4b8 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
(This used to be commit ff004f7284)
2007-10-10 12:15:44 -05:00
Günther Deschner
31a63ab19f r19528: Fix container handling for "net ads user" and "net ads group" functions
along with some memleaks.

Guenther
(This used to be commit 4bad52c5b3)
2007-10-10 12:15:41 -05:00
Günther Deschner
4e0f560f60 r19527: Fix double free in "net ads group add".
Guenther
(This used to be commit 08db3d3b04)
2007-10-10 12:15:41 -05:00
Günther Deschner
25fb86570d r19525: Fix the same error in "net ads group delete".
Guenther
(This used to be commit 94ed3e9de8)
2007-10-10 12:15:40 -05:00
Günther Deschner
8a9c4331a3 r19524: Stop "net ads user delete" from doing funny things.
Guenther
(This used to be commit a20e7c0315)
2007-10-10 12:15:40 -05:00
Günther Deschner
78f977f746 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
(This used to be commit e691ae7da3)
2007-10-10 12:15:39 -05:00
Jeremy Allison
a0c84f1b12 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.
(This used to be commit 47352b5398)
2007-10-10 12:15:26 -05:00
Günther Deschner
ac080e3184 r19039: Do not segfault in "net ads printer info" when a requested printserver
does not exist.

Guenther
(This used to be commit 359315021d)
2007-10-10 12:15:04 -05:00
Günther Deschner
88a98e35c7 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
(This used to be commit d086babf9d)
2007-10-10 12:14:55 -05:00
Günther Deschner
0d12a35e6b r18817: Enable the build of the gpo tool but do not make it available yet.
Guenther
(This used to be commit 927cda5d31)
2007-10-10 12:01:03 -05:00
Jeremy Allison
dc14e67a6b r18467: Some sites allow an account to be deleted, but not
disabled. Cope with both - print appropriate messages.
Jeremy.
(This used to be commit 2c003a4463)
2007-10-10 11:51:43 -05:00
Jeremy Allison
8c2c5c5d1d r18446: Add the ldap 'leave domain' code - call this as
a non-fatal error path if the 'disable machine
account' code succeeded.
Jeremy.
(This used to be commit f47bffa21e)
2007-10-10 11:51:42 -05:00
Günther Deschner
a58dc69813 r18170: Make sure to actually get the printing data before trying to publish it
in AD.

Guenther
(This used to be commit 1bb29acb3b)
2007-10-10 11:43:30 -05:00
Volker Lendecke
ee0e397d6f 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
(This used to be commit b2ff9680eb)
2007-10-10 11:39:49 -05:00
Jeremy Allison
4dcda274ef r17941: Fix print out of client site name.
Jeremy.
(This used to be commit b8cedcac93)
2007-10-10 11:39:00 -05:00
Jeremy Allison
2abab7ee6d 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.
(This used to be commit ab3f0c5b1e)
2007-10-10 11:38:59 -05:00
Gerald Carter
5693e6c599 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.
(This used to be commit 36f04674ae)
2007-10-10 11:38:48 -05:00
Volker Lendecke
900fe6a625 r17603: Make net_ads_join_ok return NTSTATUS.
Thanks to Michael Adam <ma@sernet.de>

hop, hop, hop... ;-)

Volker
(This used to be commit 47facab798)
2007-10-10 11:38:42 -05:00
Volker Lendecke
01c77cefef r17602: Make check_ads_config return NTSTATUS, set some error codes in net_ads_join.
Thanks to Michael Adam <ma@sernet.de>

Volker
(This used to be commit 27cca86150)
2007-10-10 11:38:42 -05:00
Volker Lendecke
8b39f5ef37 r17591: machine_account is unused, and ctx must be freed. Thanks Michael
(This used to be commit a347f8a9c4)
2007-10-10 11:38:41 -05:00
Volker Lendecke
20ad622b98 r17585: Don't let ads_status throw away the error information.
Thanks to Michael Adam <ma@sernet.de>.

Volker
(This used to be commit ea3a4142a0)
2007-10-10 11:38:41 -05:00
Volker Lendecke
db21dceb43 r17557: Change net_join_domain to return NTSTATUS instead of int.
Thanks to Michael Adam <ma@sernet.de>.

Volker
(This used to be commit c4e10afadb)
2007-10-10 11:38:39 -05:00
Volker Lendecke
c804dd0117 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
(This used to be commit d44599de3a)
2007-10-10 11:38:38 -05:00
Gerald Carter
e5f6544df1 r17383: Patch from Michael Adams <ma@sernet.de> to catch
some memory leaks on error paths in net_ads_join()
(This used to be commit 24de2d83ff)
2007-10-10 11:38:29 -05:00
Gerald Carter
20c09b75fa r17258: Cleanup the 'net ads help join' output and document createupn
and createcomputer options
(This used to be commit 87be77bf35)
2007-10-10 11:38:22 -05:00
Gerald Carter
188e7ac756 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)
(This used to be commit 75054e984e)
2007-10-10 11:38:17 -05:00
Gerald Carter
02f272f3c6 r17149: Fail the join if we cannot set any SPNs for the machine account.
Disable the one we created and whine.
(This used to be commit 1a7e81a4a8)
2007-10-10 11:38:16 -05:00
Günther Deschner
9c160dd9a7 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
(This used to be commit d573e64781)
2007-10-10 11:38:10 -05:00
Gerald Carter
060b155cd2 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.
(This used to be commit 6261dd3c67)
2007-10-10 11:19:15 -05:00
Jeremy Allison
fbdcf2663b 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.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Günther Deschner
10252f270e r16453: Fix another memleak.
Guenther
(This used to be commit 49fb1a3ebc)
2007-10-10 11:18:55 -05:00
Jeremy Allison
300acb99ad r16284: Start fixing up gcc4 -O6 warnings on an x86_64 box. size_t != unsigned
int
in a format string.
Jeremy.
(This used to be commit face01ef01)
2007-10-10 11:17:31 -05:00
Günther Deschner
e942ca4e0a r16261: Smaller fixes for net ads password.
Guenther
(This used to be commit 689ae22c80)
2007-10-10 11:17:28 -05:00
Günther Deschner
bf7a5433b4 r16115: Make "net ads changetrustpw" work again.
(adapt to the new UPN/SPN scheme).

Guenther
(This used to be commit 8fc70d0df0)
2007-10-10 11:17:21 -05:00
Günther Deschner
ae4a2a2b9d r15703: Fix d_printf call.
Guenther
(This used to be commit 741602e03a)
2007-10-10 11:17:08 -05:00
Gerald Carter
463e7c1171 r15701: change 'net ads leave' to disable the machine account in the domain (since removal implies greater permissions that Windows clients require)
(This used to be commit ad1f947625)
2007-10-10 11:17:08 -05:00
Gerald Carter
13bc6d4666 r15680: use the user creds when calling net_set_machine_spn() rather than the machine creds (just like WinXP)
(This used to be commit ae2bf464c4)
2007-10-10 11:17:07 -05:00
Gerald Carter
b16bdf985d r15597: more ads join fixes -- we can only set the PWDNOEXP and DES_ONLY acb flags on the setuserinfo(), not the createuser info call
(This used to be commit d933ac273d)
2007-10-10 11:17:02 -05:00
Gerald Carter
bc89437cca r15561: Should re-fix older systems without RC4-HMAC support
(This used to be commit 00c795e366)
2007-10-10 11:17:01 -05:00
Gerald Carter
f1039b8fb4 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.
(This used to be commit b69ac0e304)
2007-10-10 11:17:01 -05:00
Günther Deschner
453e4b50aa 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
(This used to be commit 8dd925c5fb)
2007-10-10 11:17:01 -05:00
Gerald Carter
2c029a8b96 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
(This used to be commit 4c4ea7b20f)
2007-10-10 11:16:57 -05:00
Volker Lendecke
18250bc299 r15471: Clarify error message
(This used to be commit f21adc04f7)
2007-10-10 11:16:51 -05:00
Gerald Carter
af086da4ec 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.
(This used to be commit cf71f88a3c)
2007-10-10 11:16:49 -05:00
Günther Deschner
c6fa16f330 r15460: Prefer to use the indexed objectCategory attribute (instead of
objectClass which is not indexed on AD) in LDAP queries.

Guenther
(This used to be commit 847882a983)
2007-10-10 11:16:49 -05:00
Jeremy Allison
c176ec2629 r15336: Unknown escape sequence: '\305' - should have been '\n'.
(How did that get in there ?).
Jeremy
(This used to be commit 780b71d300)
2007-10-10 11:16:36 -05:00
Günther Deschner
34e810076d 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
(This used to be commit 5557ada694)
2007-10-10 11:16:33 -05:00