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

217 Commits

Author SHA1 Message Date
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Günther Deschner
a2befee3f2 r23648: Allow to list a custom krb5 keytab file with:
net ads keytab list /path/to/krb5.keytab

Guenther
2007-10-10 12:23:41 -05:00
Volker Lendecke
9b8df24107 r22954: More messaging_register 2007-10-10 12:22:11 -05:00
Volker Lendecke
0ad4b1226c r22736: Start to merge the low-hanging fruit from the now 7000-line cluster patch.
This changes "struct process_id" to "struct server_id", keeping both is
just too much hassle. No functional change (I hope ;-))

Volker
2007-10-10 12:21:52 -05:00
Gerald Carter
3f588e0b65 r22729: add help text for osver and osname options to 'net ads join' (patch from Dnailo A.) 2007-10-10 12:21:51 -05:00
Gerald Carter
3004cc6e59 r22728: Patch from Danilo Almeida <dalmeida@centeris.com>:
When asked to create a machine account in an OU as part
of "net ads join" and the account already exists in another
OU, simply move the machine object to the requested OU.
2007-10-10 12:21:51 -05:00
Günther Deschner
9ec76c5427 r22479: Add "net ads keytab list".
Guenther
2007-10-10 12:19:37 -05:00
Gerald Carter
5035778ae4 r21888: Add the osname and osver options to 'net ads join' as discussed
on the samba-technical ml.

I'll add a 'net ads set attribute=value' utility later
rather than the original 'net ads setmachineupn' patch that
was also posted to the tech ml.
2007-10-10 12:18:45 -05:00
Jeremy Allison
df07a662e3 r21609: Fix memory leaks in error code paths (and one in winbindd_group.c).
Patch from Zack Kirsch <zack.kirsch@isilon.com>.
Jeremy.
2007-10-10 12:18:16 -05:00
Jeremy Allison
cbe725f1b0 r21608: Fix a couple of memleaks in error code paths before
Coverity finds them :-)
Jeremy.
2007-10-10 12:18:16 -05:00
Simo Sorce
5b4838f62a r21606: Implement escaping function for ldap RDN values
Fix escaping of DN components and filters around the code
Add some notes to commandline help messages about how to pass DNs

revert jra's "concistency" commit to nsswitch/winbindd_ads.c, as it was
incorrect.
The 2 functions use DNs in different ways.

- lookup_usergroups_member() uses the DN in a search filter,
and must use the filter escaping function to escape it
Escaping filters that include escaped DNs ("\," becomes "\5c,") is the
correct way to do it (tested against W2k3).

- lookup_usergroups_memberof() instead uses the DN ultimately as a base dn.
Both functions do NOT need any DN escaping function as DNs can't be reliably
escaped when in a string form, intead each single RDN value must be escaped
separately.

DNs coming from other ldap calls (like ads_get_dn()), do not need escaping as
they come already escaped on the wire and passed as is by the ldap libraries

DN filtering has been tested.
For example now it is possible to do something like:
'net ads add user joe#5' as now the '#' character is correctly escaped when
building the DN, previously such a call failed with Invalid DN Syntax.

Simo.
2007-10-10 12:18:16 -05:00
Volker Lendecke
c8ae60ed65 r21064: The core of this patch is
void message_register(int msg_type,
                      void (*fn)(int msg_type, struct process_id pid,
-                                void *buf, size_t len))
+                                void *buf, size_t len,
+                                void *private_data),
+                     void *private_data)
 {
        struct dispatch_fns *dfn;

So this adds a (so far unused) private pointer that is passed from
message_register to the message handler. A prerequisite to implement a tiny
samba4-API compatible wrapper around our messaging system. That itself is
necessary for the Samba4 notify system.

Yes, I know, I could import the whole Samba4 messaging system, but I want to
do it step by step and I think getting notify in is more important in this
step.

Volker
2007-10-10 12:17:32 -05:00
Gerald Carter
ff8f27108d r20903: Replace the hardcoded "smb.conf" string with the dyn_CONFIGFILE 2007-10-10 12:17:18 -05:00
Jeremy Allison
97e248f89a r20857: Silence gives assent :-). Checking in the fix for
site support in a network where many DC's are down.
I heard via Volker there is still a bug w.r.t the
wrong site being chosen with trusted domains but
we'll have to layer that fix on top of this.
Gd - complain if this doesn't work for you.
Jeremy.
2007-10-10 12:17:14 -05:00
Gerald Carter
3486acd3c3 r20173: DNS update fixes:
* Fix DNS updates for multi-homed hosts
* Child domains often don't have an NS record in
  DNS so we have to fall back to looking up the the NS
  records for the forest root.
* Fix compile warning caused by mismatched 'struct in_addr'
  and 'in_addr_t' parameters called to DoDNSUpdate()
2007-10-10 12:16:29 -05:00
Jim McDonough
cc26e2f9a1 r20119: Update help info indicating how to use separators (forward slash only)
and properly use backslashes in "net ads join computername="
2007-10-10 12:16:26 -05:00
Volker Lendecke
55dc4741cf r19766: Fix a const-warning. Jerry, what did you want to fix with this line?
Volker
2007-10-10 12:15:54 -05:00
Gerald Carter
c787983336 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
2007-10-10 12:15:53 -05:00
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