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

357 Commits

Author SHA1 Message Date
Michael Adam
4831b6e6bb s3:net ads join: check for malloc success and react accordingly in dns update block 2012-01-31 17:00:30 +01:00
Michael Adam
ca913c98a6 s3:net ads join: check for success of fetching machine password in dns update block
log and cleanup accordingly if failed
2012-01-31 17:00:30 +01:00
Michael Adam
04fa9a389c s3:net ads join: untangle assignment from check, fix return code and improve error logging
only the dns update failed, not the join.
Also do proper memory cleanup
2012-01-31 17:00:30 +01:00
Michael Adam
63d9b5d75a s3:net ads join: reduce indentation and improve logging in the dns update code block
by doing an early goto done upon error condition
2012-01-31 17:00:30 +01:00
Michael Adam
1d83f2118e s3:net ads join: untangle assignment from check. 2012-01-31 17:00:30 +01:00
Stefan Metzmacher
92a6f577ce s3:utils: s/Undefined/SMB_SIGNING_DEFAULT/
metze
2011-11-03 16:55:12 +01:00
David Disseldorp
8b375eef24 s3: fix typo in net ads join output
Space missing from "DNS update in aclustered setup".

Autobuild-User: David Disseldorp <ddiss@samba.org>
Autobuild-Date: Mon Oct 31 16:01:35 CET 2011 on sn-devel-104
2011-10-31 16:01:35 +01:00
Günther Deschner
151bb290d1 s3-net: Make sure to always re-use the "good" dc for the DNS updates as well.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Fri Oct 28 19:13:49 CEST 2011 on sn-devel-104
2011-10-28 19:13:49 +02:00
Günther Deschner
7119c8ba14 s3-net: when all DNS servers fail to operate, the overal DNS registration result
must be a failure.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon Oct 10 15:59:20 CEST 2011 on sn-devel-104
2011-10-10 15:59:20 +02:00
Andrew Bartlett
74eed8f3ed s3-param Remove special case for global_myname(), rename to lp_netbios_name()
There is no reason this can't be a normal constant string in the
loadparm system, now that we have lp_set_cmdline() to handle overrides
correctly.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Jeremy Allison
24ce9d52a6 Fix const warning. 2011-06-01 23:53:07 +02:00
Andrew Bartlett
da662b82b8 s3-lib Replace StrnCaseCmp() with strncasecmp_m()
strncasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Andrew Bartlett
c615ebed6e s3-lib Replace StrCaseCmp() with strcasecmp_m()
strcasecmp_m() never needs to call to talloc, and via next_codepoint()
still has an ASCII fast-path bypassing iconv() calls.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Günther Deschner
27022587e3 s3-libsmb: move protos to libsmb/proto.h
Guenther
2011-05-06 16:37:18 +02:00
Jeremy Allison
9eee6e2fd2 More const fixes... getting near the end now.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri May  6 00:57:00 CEST 2011 on sn-devel-104
2011-05-06 00:57:00 +02:00
Jeremy Allison
f85e095dd2 More simple const fixups. 2011-05-05 23:56:08 +02:00
Andrew Bartlett
818ec32d0c s3-libads Pass a struct sockaddr_storage to cldap routines
This avoids these routines doing a DNS lookup that has already been
done, and ensures that the emulated DNS lookup isn't thrown away.

Andrew Bartlett
2011-04-28 05:30:20 +02:00
Günther Deschner
6768b65123 s3-waf: try to fix the non-ldap-but-krb5 build.
Guenther
2011-04-15 12:37:55 +02:00
Volker Lendecke
feb3cdee36 s3: Retry the join with the short name
Signed-off-by: Günther Deschner <gd@samba.org>
2011-04-12 13:24:24 +02:00
Günther Deschner
af2538d16f s3-build: remove -I../lib/addns.
Guenther
2011-03-10 23:25:04 +01:00
Jelmer Vernooij
59a077d8f5 Fix some types
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Mon Feb 28 23:30:06 CET 2011 on sn-devel-104
2011-02-28 23:30:06 +01:00
Andreas Schneider
bf18403c81 s3-rpc_client: Move client pipe functions to own header. 2011-02-28 18:15:04 +01:00
Günther Deschner
66bc2f9127 s3-net: use correct spoolss header in net_ads.c.
Guenther
2011-01-18 23:54:30 +01:00
Günther Deschner
fa1fd85eea s3-net: Fix bug #7690: retry DNS updates when connection to one nameserver has failed.
Initial patch from Patrik Martinsson <patrik.martinsson@smhi.se>.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Jan  6 17:29:11 CET 2011 on sn-devel-104
2011-01-06 17:29:11 +01:00
Jeremy Allison
88c3e505e9 Fix a warning message.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Dec 22 03:59:18 CET 2010 on sn-devel-104
2010-12-22 03:59:18 +01:00
Volker Lendecke
d096de56b1 s3: Remove unused "retry" from cli_full_connection 2010-12-20 17:10:58 +01:00
Stefan Metzmacher
1dc2fa7616 s3:net ads dns register: use "cluster addresses" option if configured (bug #7871)
metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec 17 16:49:14 CET 2010 on sn-devel-104
2010-12-17 16:49:14 +01:00
Michael Adam
5e83a05009 s3:net ads dns register: add support for specifying addresse on the commandline (bug #7871)
In the clustering case, this is also made the only possiblity to do dns updates,
since the list addresses on the local interfaces is not suitable in that case.

This fixes the "net ads dns register" part of bug #7871.
It might be extended by a parsing of the "cluster addresses" setting.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-12-17 15:59:47 +01:00
Michael Adam
4d91f98b43 s3:net: add net_update_dns_ext() that accepts a list of addresses as parameter (bug# 7871)
This generalized form of net_update_dns() will be used to
add support for specifying a list of addresses on the commandline
of "net ads dns register".

This prepares the "net ads dns register" part of the fix for bug #7871.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-12-17 15:59:44 +01:00
Michael Adam
b8f19df53e s3:net: disable dynamic dns updates at the end of "net ads join" in a cluster (bug #7871)
In a clustered environment, registering the set of ip addresses that are
assigned to the interfaces of the node that performs the join does usually
not have the desired effect, since the local interfaces do not carry
complete set of the cluster's public IP addresses.  And it can also contain
internal addresses that should not be visible to the outside at all.
In order to do dns updates in a clustererd setup, use net ads dns register.

This fixes the net ads join part of bug #7871.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-12-17 15:59:44 +01:00
Jeremy Allison
b3630b4739 Fix bug 7866 - "net" in v3-6-test broken.
Someone wasn't careful about testing when not running as root :-).

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Dec 15 20:45:25 CET 2010 on sn-devel-104
2010-12-15 20:45:25 +01:00
Andrew Bartlett
c2a1ad9047 s3-net Allow 'net ads dns register' to take an optional hostname argument
This allows the administrator to more carefully chose what name to register.

Andrew Bartlett
2010-12-10 17:58:13 +11:00
Günther Deschner
f01360efad s3-net: use dns_errstr() when dns commands fail.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon Nov 22 12:31:33 CET 2010 on sn-devel-104
2010-11-22 12:31:33 +01:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Günther Deschner
ffdfcfb514 s3-dsgetdcname: always pass in messaging context.
Volker, please check.

Guenther
2010-09-23 10:26:25 -07:00
Günther Deschner
ca765d2f50 s3-build: only include krb5 environment variables where required.
Guenther
2010-08-26 00:20:29 +02:00
Günther Deschner
c136b84f0d s3-secrets: only include secrets.h when needed.
Guenther
2010-08-05 10:12:25 +02:00
Günther Deschner
e7a6a3ec0d s3: avoid global include of ads.h.
Guenther
2010-08-05 00:32:02 +02:00
Günther Deschner
80b47fcb0a s3-libnet: better separate headers.
Guenther
2010-07-13 22:40:46 +02:00
Günther Deschner
dff7be8ccb s3-libads: only include libds flags where needed.
Guenther
2010-07-01 23:20:40 +02:00
Günther Deschner
56538be6af s3-libads: move ads_dns out of main includes.
Guenther
2010-07-01 23:20:40 +02:00
Günther Deschner
2f9076ac29 s3-libads: use shared well known guids.
Guenther
2010-07-01 21:17:17 +02:00
Günther Deschner
fbb7814f91 s3: only use netlogon/nbt header when needed.
Guenther
2010-05-31 11:32:37 +02:00
Günther Deschner
f12028a3fd s3-net: fix a "dereferencing type-punned pointer will break strict-aliasing rules" warning.
Guenther
2010-05-25 12:43:00 +02:00
Günther Deschner
7c979adfbf s3-net: fix net_ads_gpo() for non-ads case.
Guenther
2010-05-21 18:09:14 +02:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Günther Deschner
96962277da s3-net: let net_ads_gpo() call no_ads when built w/o ads support.
Guenther
2010-05-20 18:45:40 +02:00
Andrew Bartlett
454b0b3f20 s3:kerberos Return PAC_LOGON_INFO rather than the full PAC_DATA
All the callers just want the PAC_LOGON_INFO, so search for that in
ads_verify_ticket(), and don't bother the callers with the rest of the
PAC.

This change makes sense on it's own (removing boilerplate wrappers
that just confuse the code), but it also makes it much easier to
implement a matching ads_verify_ticket() function in Samba4 for the
s3compat proposal.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-11 22:52:37 +02:00
Jeremy Allison
ce8595f68e Fix more S3 build breakage. Matthias, please ensure S3 builds when
changing common code.

Jeremy.
2010-04-27 12:10:20 -07:00
Günther Deschner
89c089d993 s3-net: fix net ads dns usage calls.
Bjoern, please check.

Guenther
2010-02-08 11:55:52 +01:00
Kai Blin
66de52c4f4 s3 net: Fix compile warnings 2010-01-19 14:48:34 +01:00
Kai Blin
28b512f904 s3 net: Fix compile error with WITH_DNS_UPDATES
bd3c922e2b introduced a compile-time error
when building with WITH_DNS_UPDATES.
2010-01-19 10:07:35 +01:00
Björn Jacke
bd3c922e2b s3/net: split up some printable stings to ease i18n
If we put strings like "Usage:" into separate _() macros and not the whole
"Usage:..." string we can cover much more messages by only one single
translation. The drawback is that the message in the sources looks less pretty.
2010-01-18 23:45:05 +01:00
Günther Deschner
475d296065 s3-net: use generated krb5.conf in 'net ads testjoin'
Guenther
2009-12-23 10:57:22 +01:00
Günther Deschner
3d679a3b5f s3-rpc: Avoid including every pipe's client and server stubs everywhere in samba.
Guenther
2009-11-26 20:03:17 +01:00
Jeremy Allison
5363d6e62c Ensure all callers to the rpc_client/cli_pipe functions correctly
initialize return variables.
Jeremy.
2009-11-12 13:56:33 -08:00
Günther Deschner
6ca8a40976 s3-net: better use memory credential cache in net_ads_kerberos_pac().
Guenther
2009-11-06 12:51:29 +01:00
Günther Deschner
58184b5fd4 s3-net: allow to call "net ads kerberos pac <impersonation principal> -P".
Guenther
2009-11-06 12:44:45 +01:00
Kai Blin
ceab454bcf s3 net: i18n support for net ads 2009-07-29 23:46:09 +02:00
Jeremy Allison
5d05d22999 Added prefer_ipv4 bool parameter to resolve_name().
W2K3 DC's can have IPv6 addresses but won't serve
krb5/ldap or cldap on those addresses. Make sure when
we're asking for DC's we prefer IPv4.
If you have an IPv6-only network this prioritizing code
will be a no-op. And if you have a mixed network then you
need to prioritize IPv4 due to W2K3 DC's.
Jeremy.
2009-07-28 11:51:58 -07:00
Kai Blin
67d9130c13 s3: net ads user info should print primary group as well (bug #2658)
Thanks to Pavel V. Rochnyack <rpv@muma.tusur.ru> for reporting this and
offering an initial patch.
2009-07-27 20:03:46 +02:00
Kai Blin
8f5ef10633 Revert "net: Use samba default command line arguments."
This reverts commit fb262f79fa
and related commits c36031778e
72fd5fa6bb and
38cd0e086f

This change caused more trouble than it solved. We need to do this differently.
Reverting so we don't accidently release this.
2009-07-22 13:39:34 +02:00
Volker Lendecke
c624a704be Make escape_ldap_string take a talloc context 2009-07-09 22:25:29 +02:00
Jim McDonough
7930f15f5d Don't require "Modify property" perms to unjoin bug #6481)
"net ads leave" stopped working when "modify properties"
permissions were not granted (meaning you had to be allowed
to disable the account that you were about to delete).

Libnetapi should not delete machine accounts, as this does not
happen on win32.  The WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE flag
really means "disable" (both in practice and docs).

However, to keep the functionality in "net ads leave", we
will still try to do the delete.  If this fails, we try
to do the disable.

Additionally, it is possible in windows to not disable or
delete the account, but just tell the local machine that it
is no longer in the account.  libnet can now do this as well.
2009-06-19 13:46:07 -04:00
Kai Blin
38cd0e086f net: Only use the in memory ccache when not already using a kerberos ticket in net ads 2009-06-09 18:09:18 +02:00
Günther Deschner
72fd5fa6bb s3-net: fix "net ads testjoin".
This always needs to use machine account credentials.

Kai, please check.

Guenther
2009-06-09 15:41:44 +02:00
Kai Blin
fb262f79fa net: Use samba default command line arguments.
Attention:

The meaning of the -N flag changed.
To get the old meaning for net groupmap set, use the long option --ntname
The long option for using kerberos changed from --kerberos to --use-kerberos

net rpc commands will now prompt for a password if none is given.

As a benefit, net will now accept an authentication file like other samba
command line tools. So no need to specify the password on the command line in
scripts anymore.

This should fix bug #6357

Signed-off-by: Kai Blin <kai@samba.org>
2009-05-25 23:35:38 +02:00
Günther Deschner
d71dec9259 s3-libads: avoid NULL talloc context with ads_get_dn().
Guenther
2009-04-07 01:17:30 +02:00
Andrew Bartlett
2050187673 s3:libads Make ads_get_dn() take a talloc context
Also remove ads_memfree(), which was only ever a wrapper around
SAFE_FREE, used only to free the DN from ads_get_ds().

This actually makes libgpo more consistant, as it mixed a talloc and a
malloc based string on the same element.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2009-04-06 15:54:41 +02:00
Günther Deschner
9fdeb7f7b3 s3-spoolss: remove custom syntax_spoolss and use the syntax defined in IDL.
Guenther
2009-03-18 14:18:42 +01:00
todd stecher
9d4d2f70cb S3: Fixes for coverity issues. 2009-02-10 14:43:14 -08:00
Günther Deschner
329b8775f5 s3-net: fix warning message for keytab usage.
Guenther
2009-02-03 15:32:48 +01:00
Dan Sledz
d96248a9b4 Add two new parameters to control how we verify kerberos tickets. Removes lp_use_kerberos_keytab parameter.
The first is "kerberos method" and replaces the "use kerberos keytab"
with an enum.  Valid options are:
secrets only - use only the secrets for ticket verification (default)
system keytab - use only the system keytab for ticket verification
dedicated keytab - use a dedicated keytab for ticket verification.
secrets and keytab - use the secrets.tdb first, then the system keytab

For existing installs:
"use kerberos keytab = yes" corresponds to secrets and keytab
"use kerberos keytab = no" corresponds to secrets only

The major difference between "system keytab" and "dedicated keytab" is
that the latter method relies on kerberos to find the correct keytab
entry instead of filtering based on expected principals.

The second parameter is "dedicated keytab file", which is the keytab
to use when in "dedicated keytab" mode.  This keytab is only used in
ads_verify_ticket.
2009-02-01 20:23:31 -08:00
Jeremy Allison
07e0094365 Fix all warnings in source3 with gcc4.3.
Jeremy.
2008-12-31 18:06:57 -08:00
Stefan Metzmacher
588f5aae66 s3: correctly detect if the current dc is the closest one
ads->config.tried_closest_dc was never set.

metze

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Günther Deschner <gd@samba.org>
(cherry picked from commit dfe5b00db3)
2008-12-13 11:42:22 +01:00
Jelmer Vernooij
44b728958a Use common error definitions. 2008-10-23 15:35:21 +02:00
Günther Deschner
4b59ecb903 s3-build: no need to duplicate generated ndr_ prototypes.
Guenther
2008-10-20 19:47:00 +02:00
Jelmer Vernooij
f0c4829e82 Remove silly safe_free() function which is a wrapper around SAFE_FREE().
Since it's a function it just sets the local pointer to NULL and basically
is an equivalent to free().

It also claims it's being used for callbacks but isn't used that way
anywhere.
2008-10-19 13:06:14 +02:00
Jelmer Vernooij
1f3e4f39c5 Use GUID_string rather than smb_uuid_string(). 2008-10-14 02:26:18 +02:00
Jelmer Vernooij
cb78d4593b Cope with changed signature of http_timestring(). 2008-10-11 23:57:44 +02:00
Günther Deschner
81fde58551 s3-nbt: remove double nbt netlogon opcodes.
Guenther
2008-09-25 20:11:55 +02:00
Günther Deschner
f07431f5ba s3-nbt: use the new generated nbt.
Guenther
2008-09-24 03:34:23 +02:00
Günther Deschner
5bea31aa3c libnetjoin: support kerberized joining/unjoing (fix #5416).
Guenther
(This used to be commit da6e0f4f37)
2008-08-11 19:52:23 +02:00
Volker Lendecke
1335da2a7c Refactoring: Change calling conventions for cli_rpc_pipe_open_noauth
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS
(This used to be commit 9abc9dc4dc)
2008-07-20 17:37:11 +02:00
Karolin Seeger
7c451b9b89 net ads: Fix typos.
Karolin
(This used to be commit 63c1a5146e)
2008-06-24 16:30:33 +02:00
Günther Deschner
6ce0c85172 net: Fix bug #5542 (samsync contains empty passwords).
Guenther
(cherry picked from commit 1a22e975dd)
(This used to be commit ad8392cf7c)
2008-06-13 12:23:57 +02:00
Kai Blin
8f1f62af28 net: Fix net_ads.c build for the HAVE_ADS == 0 case.
Thanks to Karolin for catching this one.
(This used to be commit 7f52998f54)
2008-06-12 15:46:12 +02:00
Kai Blin
255bdb2602 net: Rename functable3 to functable, get rid of old functables
(This used to be commit bb7c5fc4ec)
2008-06-10 09:48:21 +02:00
Kai Blin
54bc155736 net: Make "net ads" use functable3
(This used to be commit 64e3dc6396)
2008-06-10 09:47:15 +02:00
Günther Deschner
d7772433bf net: print NBT_SERVER_X_SECRET_DOMAIN_6 flags in "net ads lookup".
Guenther
(This used to be commit 420390ba0e)
2008-06-04 01:35:43 +02:00
Kai Blin
0210f7af91 net: The top level help function for net cmd is always net_cmd_usage
(This used to be commit f7d0903a58)
2008-05-20 14:28:12 +02:00
Kai Blin
007f0e19dc net: Split out "net group"
(This used to be commit 3ddd9c09e3)
2008-05-20 14:27:40 +02:00
Kai Blin
572de942c7 net: Split out "net user"
(This used to be commit 4ca08a5acc)
2008-05-20 14:27:27 +02:00
Kai Blin
16938883e6 net: Use true/false instead of True/False.
(This used to be commit a8b567aac3)
2008-05-20 14:27:08 +02:00
coffeedude
ed08bd3e83 net ads: Upper case he realm name when calling kinit() using machine creds.
Needed fix for the DNS Update option as part of "net ads join"
(This used to be commit aebae0b71b)
2008-05-12 17:35:55 -05:00
Volker Lendecke
232853d700 Fix the build with DNS_UPDATES
(This used to be commit 6c9500c290)
2008-05-10 10:58:56 +02:00
Kai Blin
f576910944 net: Remove globals
(This used to be commit 1e9319cf88)
2008-05-10 09:22:27 +02:00
Günther Deschner
cdd9913c4a cldap: let ads_cldap_netlogon() return all possible cldap replies.
Guenther
(This used to be commit 6f9d5e1cc9)
2008-05-09 14:59:18 +02:00
Günther Deschner
bcbac69d1a cldap: avoid duplicate definitions so remove ads_cldap.h.
Guenther
(This used to be commit 538eefe22a)
2008-04-21 20:21:40 +02:00
Günther Deschner
1dd7ab38e7 cldap: add talloc context to ads_cldap_netlogon().
Guenther
(This used to be commit 4cee7b1bd5)
2008-04-21 20:21:40 +02:00