mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-07-16 04:17:25 +00:00
samba, ctdb, libldb, libtdb, libtevent, talloc: move to meta-networking
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
@@ -1,108 +0,0 @@
|
||||
From 1573638212a9733a44939a4d38a226f38dca36f1 Mon Sep 17 00:00:00 2001
|
||||
From: Michele Baldessari <michele@acksyn.org>
|
||||
Date: Tue, 9 Jul 2013 23:23:33 +0200
|
||||
Subject: [PATCH] Fix typos in man-pages
|
||||
|
||||
Fix some typos in the man-pages.
|
||||
|
||||
Signed-off-by: Michele Baldessari <michele@acksyn.org>
|
||||
Reviewed-by: Simo Sorce <idra@samba.org>
|
||||
|
||||
Autobuild-User(master): Simo Sorce <idra@samba.org>
|
||||
Autobuild-Date(master): Wed Jul 10 16:45:07 CEST 2013 on sn-devel-104
|
||||
---
|
||||
docs-xml/manpages/dbwrap_tool.1.xml | 2 +-
|
||||
docs-xml/manpages/idmap_autorid.8.xml | 2 +-
|
||||
docs-xml/manpages/net.8.xml | 2 +-
|
||||
docs-xml/manpages/pdbedit.8.xml | 2 +-
|
||||
docs-xml/manpages/samba.7.xml | 2 +-
|
||||
docs-xml/manpages/smbclient.1.xml | 2 +-
|
||||
docs-xml/manpages/smbpasswd.5.xml | 2 +-
|
||||
docs-xml/manpages/vfs_smb_traffic_analyzer.8.xml | 2 +-
|
||||
8 files changed, 8 insertions(+), 8 deletions(-)
|
||||
|
||||
Index: samba-4.1.11/docs-xml/manpages/smbstatus.1.xml
|
||||
===================================================================
|
||||
--- samba-4.1.11.orig/docs-xml/manpages/smbstatus.1.xml
|
||||
+++ samba-4.1.11/docs-xml/manpages/smbstatus.1.xml
|
||||
@@ -137,6 +137,13 @@
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
+ <varlistentry>
|
||||
+ <term>-n|--numeric</term>
|
||||
+ <listitem><para>causes smbstatus to display numeric UIDs and GIDs instead of
|
||||
+ resolving them to names.</para>
|
||||
+ </listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
Index: samba-4.1.11/docs-xml/manpages/sharesec.1.xml
|
||||
===================================================================
|
||||
--- samba-4.1.11.orig/docs-xml/manpages/sharesec.1.xml
|
||||
+++ samba-4.1.11/docs-xml/manpages/sharesec.1.xml
|
||||
@@ -129,6 +129,13 @@
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
+ <varlistentry>
|
||||
+ <term>-S|--setsddl=STRING</term>
|
||||
+ <listitem><para>
|
||||
+ Set security descriptor by providing ACL in SDDL format.
|
||||
+ </para></listitem>
|
||||
+ </varlistentry>
|
||||
+
|
||||
&stdarg.help;
|
||||
&stdarg.server.debug;
|
||||
&popt.common.samba;
|
||||
Index: samba-4.1.11/docs-xml/build/DTD/samba.entities
|
||||
===================================================================
|
||||
--- samba-4.1.11.orig/docs-xml/build/DTD/samba.entities
|
||||
+++ samba-4.1.11/docs-xml/build/DTD/samba.entities
|
||||
@@ -270,6 +270,44 @@ file.
|
||||
&popt.common.samba;
|
||||
'>
|
||||
|
||||
+<!ENTITY stdarg.signing '
|
||||
+<varlistentry>
|
||||
+<term>-S|--signing on|off|required</term>
|
||||
+<listitem><para>Set the client signing state.
|
||||
+</para></listitem>
|
||||
+</varlistentry>
|
||||
+'>
|
||||
+
|
||||
+<!ENTITY stdarg.machinepass '
|
||||
+<varlistentry>
|
||||
+<term>-P|--machine-pass</term>
|
||||
+<listitem><para>Use stored machine account password.
|
||||
+</para></listitem>
|
||||
+</varlistentry>
|
||||
+'>
|
||||
+
|
||||
+<!ENTITY stdarg.encrypt '
|
||||
+<varlistentry>
|
||||
+<term>-e|--encrypt</term>
|
||||
+<listitem><para>
|
||||
+This command line parameter requires the remote
|
||||
+server support the UNIX extensions or that the SMB3 protocol has been selected.
|
||||
+Requests that the connection be encrypted. Negotiates SMB encryption using either
|
||||
+SMB3 or POSIX extensions via GSSAPI. Uses the given credentials for
|
||||
+the encryption negotiation (either kerberos or NTLMv1/v2 if given
|
||||
+domain/username/password triple. Fails the connection if encryption
|
||||
+cannot be negotiated.
|
||||
+</para></listitem>
|
||||
+</varlistentry>
|
||||
+'>
|
||||
+
|
||||
+<!ENTITY stdarg.pwnthash '
|
||||
+<varlistentry>
|
||||
+<term>--pw-nt-hash</term>
|
||||
+<listitem><para>The supplied password is the NT hash.
|
||||
+</para></listitem>
|
||||
+</varlistentry>
|
||||
+'>
|
||||
|
||||
<!ENTITY stdarg.resolve.order '
|
||||
<varlistentry>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,266 +0,0 @@
|
||||
From 168627e1877317db86471a4b0360dccd9f469aaa Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Mon, 13 Jan 2014 15:59:26 +0100
|
||||
Subject: [PATCH 1/2] s3-kerberos: remove print_kdc_line() completely.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Just calling print_canonical_sockaddr() is sufficient, as it already deals with
|
||||
ipv6 as well. The port handling, which was only done for IPv6 (not IPv4), is
|
||||
removed as well. It was pointless because it always derived the port number from
|
||||
the provided address which was either a SMB (usually port 445) or LDAP
|
||||
connection. No KDC will ever run on port 389 or 445 on a Windows/Samba DC.
|
||||
Finally, the kerberos libraries that we support and build with, can deal with
|
||||
ipv6 addresses in krb5.conf, so we no longer put the (unnecessary) burden of
|
||||
resolving the DC name on the kerberos library anymore.
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/libads/kerberos.c | 73 ++++-------------------------------------------
|
||||
1 file changed, 5 insertions(+), 68 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
|
||||
index b026e09..ea14350 100644
|
||||
--- a/source3/libads/kerberos.c
|
||||
+++ b/source3/libads/kerberos.c
|
||||
@@ -592,70 +592,6 @@ int kerberos_kinit_password(const char *principal,
|
||||
/************************************************************************
|
||||
************************************************************************/
|
||||
|
||||
-static char *print_kdc_line(char *mem_ctx,
|
||||
- const char *prev_line,
|
||||
- const struct sockaddr_storage *pss,
|
||||
- const char *kdc_name)
|
||||
-{
|
||||
- char addr[INET6_ADDRSTRLEN];
|
||||
- uint16_t port = get_sockaddr_port(pss);
|
||||
-
|
||||
- if (pss->ss_family == AF_INET) {
|
||||
- return talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
|
||||
- prev_line,
|
||||
- print_canonical_sockaddr(mem_ctx, pss));
|
||||
- }
|
||||
-
|
||||
- /*
|
||||
- * IPv6 starts here
|
||||
- */
|
||||
-
|
||||
- DEBUG(10, ("print_kdc_line: IPv6 case for kdc_name: %s, port: %d\n",
|
||||
- kdc_name, port));
|
||||
-
|
||||
- if (port != 0 && port != DEFAULT_KRB5_PORT) {
|
||||
- /* Currently for IPv6 we can't specify a non-default
|
||||
- krb5 port with an address, as this requires a ':'.
|
||||
- Resolve to a name. */
|
||||
- char hostname[MAX_DNS_NAME_LENGTH];
|
||||
- int ret = sys_getnameinfo((const struct sockaddr *)pss,
|
||||
- sizeof(*pss),
|
||||
- hostname, sizeof(hostname),
|
||||
- NULL, 0,
|
||||
- NI_NAMEREQD);
|
||||
- if (ret) {
|
||||
- DEBUG(0,("print_kdc_line: can't resolve name "
|
||||
- "for kdc with non-default port %s. "
|
||||
- "Error %s\n.",
|
||||
- print_canonical_sockaddr(mem_ctx, pss),
|
||||
- gai_strerror(ret)));
|
||||
- return NULL;
|
||||
- }
|
||||
- /* Success, use host:port */
|
||||
- return talloc_asprintf(mem_ctx,
|
||||
- "%s\tkdc = %s:%u\n",
|
||||
- prev_line,
|
||||
- hostname,
|
||||
- (unsigned int)port);
|
||||
- }
|
||||
-
|
||||
- /* no krb5 lib currently supports "kdc = ipv6 address"
|
||||
- * at all, so just fill in just the kdc_name if we have
|
||||
- * it and let the krb5 lib figure out the appropriate
|
||||
- * ipv6 address - gd */
|
||||
-
|
||||
- if (kdc_name) {
|
||||
- return talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
|
||||
- prev_line, kdc_name);
|
||||
- }
|
||||
-
|
||||
- return talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
|
||||
- prev_line,
|
||||
- print_sockaddr(addr,
|
||||
- sizeof(addr),
|
||||
- pss));
|
||||
-}
|
||||
-
|
||||
/************************************************************************
|
||||
Create a string list of available kdc's, possibly searching by sitename.
|
||||
Does DNS queries.
|
||||
@@ -698,7 +634,8 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
||||
char *result = NULL;
|
||||
struct netlogon_samlogon_response **responses = NULL;
|
||||
NTSTATUS status;
|
||||
- char *kdc_str = print_kdc_line(mem_ctx, "", pss, kdc_name);
|
||||
+ char *kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", "",
|
||||
+ print_canonical_sockaddr(mem_ctx, pss));
|
||||
|
||||
if (kdc_str == NULL) {
|
||||
TALLOC_FREE(frame);
|
||||
@@ -788,9 +725,9 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
||||
}
|
||||
|
||||
/* Append to the string - inefficient but not done often. */
|
||||
- new_kdc_str = print_kdc_line(mem_ctx, kdc_str,
|
||||
- &dc_addrs[i],
|
||||
- kdc_name);
|
||||
+ new_kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
|
||||
+ kdc_str,
|
||||
+ print_canonical_sockaddr(mem_ctx, &dc_addrs[i]));
|
||||
if (new_kdc_str == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
|
||||
From 3edb3d4084548960f03356cf4c44a6892e6efb84 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Fri, 7 Mar 2014 14:47:31 +0100
|
||||
Subject: [PATCH 2/2] s3-kerberos: remove unused kdc_name from
|
||||
create_local_private_krb5_conf_for_domain().
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/libads/kerberos.c | 10 ++++------
|
||||
source3/libads/kerberos_proto.h | 3 +--
|
||||
source3/libnet/libnet_join.c | 3 +--
|
||||
source3/libsmb/namequery_dc.c | 6 ++----
|
||||
source3/winbindd/winbindd_cm.c | 6 ++----
|
||||
5 files changed, 10 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
|
||||
index ea14350..649e568 100644
|
||||
--- a/source3/libads/kerberos.c
|
||||
+++ b/source3/libads/kerberos.c
|
||||
@@ -618,8 +618,7 @@ static void add_sockaddr_unique(struct sockaddr_storage *addrs, int *num_addrs,
|
||||
static char *get_kdc_ip_string(char *mem_ctx,
|
||||
const char *realm,
|
||||
const char *sitename,
|
||||
- const struct sockaddr_storage *pss,
|
||||
- const char *kdc_name)
|
||||
+ const struct sockaddr_storage *pss)
|
||||
{
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
int i;
|
||||
@@ -756,8 +755,7 @@ fail:
|
||||
bool create_local_private_krb5_conf_for_domain(const char *realm,
|
||||
const char *domain,
|
||||
const char *sitename,
|
||||
- const struct sockaddr_storage *pss,
|
||||
- const char *kdc_name)
|
||||
+ const struct sockaddr_storage *pss)
|
||||
{
|
||||
char *dname;
|
||||
char *tmpname = NULL;
|
||||
@@ -782,7 +780,7 @@ bool create_local_private_krb5_conf_for_domain(const char *realm,
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (domain == NULL || pss == NULL || kdc_name == NULL) {
|
||||
+ if (domain == NULL || pss == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -815,7 +813,7 @@ bool create_local_private_krb5_conf_for_domain(const char *realm,
|
||||
goto done;
|
||||
}
|
||||
|
||||
- kdc_ip_string = get_kdc_ip_string(dname, realm, sitename, pss, kdc_name);
|
||||
+ kdc_ip_string = get_kdc_ip_string(dname, realm, sitename, pss);
|
||||
if (!kdc_ip_string) {
|
||||
goto done;
|
||||
}
|
||||
diff --git a/source3/libads/kerberos_proto.h b/source3/libads/kerberos_proto.h
|
||||
index f7470d2..2559634 100644
|
||||
--- a/source3/libads/kerberos_proto.h
|
||||
+++ b/source3/libads/kerberos_proto.h
|
||||
@@ -62,8 +62,7 @@ int kerberos_kinit_password(const char *principal,
|
||||
bool create_local_private_krb5_conf_for_domain(const char *realm,
|
||||
const char *domain,
|
||||
const char *sitename,
|
||||
- const struct sockaddr_storage *pss,
|
||||
- const char *kdc_name);
|
||||
+ const struct sockaddr_storage *pss);
|
||||
|
||||
/* The following definitions come from libads/authdata.c */
|
||||
|
||||
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
|
||||
index a87eb38..68884cd 100644
|
||||
--- a/source3/libnet/libnet_join.c
|
||||
+++ b/source3/libnet/libnet_join.c
|
||||
@@ -2152,8 +2152,7 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
|
||||
|
||||
create_local_private_krb5_conf_for_domain(
|
||||
r->out.dns_domain_name, r->out.netbios_domain_name,
|
||||
- NULL, smbXcli_conn_remote_sockaddr(cli->conn),
|
||||
- smbXcli_conn_remote_name(cli->conn));
|
||||
+ NULL, smbXcli_conn_remote_sockaddr(cli->conn));
|
||||
|
||||
if (r->out.domain_is_ad && r->in.account_ou &&
|
||||
!(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE)) {
|
||||
diff --git a/source3/libsmb/namequery_dc.c b/source3/libsmb/namequery_dc.c
|
||||
index 3cfae79..eb34741 100644
|
||||
--- a/source3/libsmb/namequery_dc.c
|
||||
+++ b/source3/libsmb/namequery_dc.c
|
||||
@@ -112,14 +112,12 @@ static bool ads_dc_name(const char *domain,
|
||||
create_local_private_krb5_conf_for_domain(realm,
|
||||
domain,
|
||||
sitename,
|
||||
- &ads->ldap.ss,
|
||||
- ads->config.ldap_server_name);
|
||||
+ &ads->ldap.ss);
|
||||
} else {
|
||||
create_local_private_krb5_conf_for_domain(realm,
|
||||
domain,
|
||||
NULL,
|
||||
- &ads->ldap.ss,
|
||||
- ads->config.ldap_server_name);
|
||||
+ &ads->ldap.ss);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
|
||||
index 669a43e..be13a57 100644
|
||||
--- a/source3/winbindd/winbindd_cm.c
|
||||
+++ b/source3/winbindd/winbindd_cm.c
|
||||
@@ -1233,8 +1233,7 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
|
||||
create_local_private_krb5_conf_for_domain(domain->alt_name,
|
||||
domain->name,
|
||||
sitename,
|
||||
- pss,
|
||||
- *name);
|
||||
+ pss);
|
||||
|
||||
SAFE_FREE(sitename);
|
||||
} else {
|
||||
@@ -1242,8 +1241,7 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
|
||||
create_local_private_krb5_conf_for_domain(domain->alt_name,
|
||||
domain->name,
|
||||
NULL,
|
||||
- pss,
|
||||
- *name);
|
||||
+ pss);
|
||||
}
|
||||
winbindd_set_locator_kdc_envs(domain);
|
||||
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
@@ -1,962 +0,0 @@
|
||||
From 932490ae08578c37523e00e537017603ee00ce7c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Fri, 17 Jan 2014 14:29:03 +0100
|
||||
Subject: [PATCH 1/8] s3-libads: pass down local_service to
|
||||
kerberos_return_pac().
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/libads/authdata.c | 6 +-----
|
||||
source3/libads/kerberos_proto.h | 1 +
|
||||
source3/utils/net_ads.c | 8 ++++++++
|
||||
source3/winbindd/winbindd_pam.c | 9 +++++++++
|
||||
4 files changed, 19 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c
|
||||
index 801e551..dd80dc2 100644
|
||||
--- a/source3/libads/authdata.c
|
||||
+++ b/source3/libads/authdata.c
|
||||
@@ -101,13 +101,13 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
bool add_netbios_addr,
|
||||
time_t renewable_time,
|
||||
const char *impersonate_princ_s,
|
||||
+ const char *local_service,
|
||||
struct PAC_LOGON_INFO **_logon_info)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
NTSTATUS status = NT_STATUS_INVALID_PARAMETER;
|
||||
DATA_BLOB tkt, tkt_wrapped, ap_rep, sesskey1;
|
||||
const char *auth_princ = NULL;
|
||||
- const char *local_service = NULL;
|
||||
const char *cc = "MEMORY:kerberos_return_pac";
|
||||
struct auth_session_info *session_info;
|
||||
struct gensec_security *gensec_server_context;
|
||||
@@ -141,10 +141,6 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
NT_STATUS_HAVE_NO_MEMORY(auth_princ);
|
||||
|
||||
- local_service = talloc_asprintf(mem_ctx, "%s$@%s",
|
||||
- lp_netbios_name(), lp_realm());
|
||||
- NT_STATUS_HAVE_NO_MEMORY(local_service);
|
||||
-
|
||||
ret = kerberos_kinit_password_ext(auth_princ,
|
||||
pass,
|
||||
time_offset,
|
||||
diff --git a/source3/libads/kerberos_proto.h b/source3/libads/kerberos_proto.h
|
||||
index 2559634..1151d66 100644
|
||||
--- a/source3/libads/kerberos_proto.h
|
||||
+++ b/source3/libads/kerberos_proto.h
|
||||
@@ -77,6 +77,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
bool add_netbios_addr,
|
||||
time_t renewable_time,
|
||||
const char *impersonate_princ_s,
|
||||
+ const char *local_service,
|
||||
struct PAC_LOGON_INFO **logon_info);
|
||||
|
||||
/* The following definitions come from libads/krb5_setpw.c */
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index 89eebf3..5a073b1 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -2604,6 +2604,7 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
NTSTATUS status;
|
||||
int ret = -1;
|
||||
const char *impersonate_princ_s = NULL;
|
||||
+ const char *local_service = NULL;
|
||||
|
||||
if (c->display_usage) {
|
||||
d_printf( "%s\n"
|
||||
@@ -2623,6 +2624,12 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
impersonate_princ_s = argv[0];
|
||||
}
|
||||
|
||||
+ local_service = talloc_asprintf(mem_ctx, "%s$@%s",
|
||||
+ lp_netbios_name(), lp_realm());
|
||||
+ if (local_service == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
c->opt_password = net_prompt_pass(c, c->opt_user_name);
|
||||
|
||||
status = kerberos_return_pac(mem_ctx,
|
||||
@@ -2636,6 +2643,7 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
true,
|
||||
2592000, /* one month */
|
||||
impersonate_princ_s,
|
||||
+ local_service,
|
||||
&info);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf(_("failed to query kerberos PAC: %s\n"),
|
||||
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
|
||||
index 3f3ec70..61e2cef 100644
|
||||
--- a/source3/winbindd/winbindd_pam.c
|
||||
+++ b/source3/winbindd/winbindd_pam.c
|
||||
@@ -576,6 +576,7 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
time_t time_offset = 0;
|
||||
const char *user_ccache_file;
|
||||
struct PAC_LOGON_INFO *logon_info = NULL;
|
||||
+ const char *local_service;
|
||||
|
||||
*info3 = NULL;
|
||||
|
||||
@@ -632,6 +633,13 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
|
||||
+ local_service = talloc_asprintf(mem_ctx, "%s$@%s",
|
||||
+ lp_netbios_name(), lp_realm());
|
||||
+ if (local_service == NULL) {
|
||||
+ return NT_STATUS_NO_MEMORY;
|
||||
+ }
|
||||
+
|
||||
+
|
||||
/* if this is a user ccache, we need to act as the user to let the krb5
|
||||
* library handle the chown, etc. */
|
||||
|
||||
@@ -653,6 +661,7 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
true,
|
||||
WINBINDD_PAM_AUTH_KRB5_RENEW_TIME,
|
||||
NULL,
|
||||
+ local_service,
|
||||
&logon_info);
|
||||
if (user_ccache_file != NULL) {
|
||||
gain_root_privilege();
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
|
||||
From baed403983a5bb2e728249443fdfc9167a87f526 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Mon, 3 Mar 2014 12:14:51 +0100
|
||||
Subject: [PATCH 2/8] auth/kerberos: fix a typo.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
auth/kerberos/kerberos_pac.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/auth/kerberos/kerberos_pac.c b/auth/kerberos/kerberos_pac.c
|
||||
index 81f7f21..8f55c8f 100644
|
||||
--- a/auth/kerberos/kerberos_pac.c
|
||||
+++ b/auth/kerberos/kerberos_pac.c
|
||||
@@ -79,7 +79,7 @@ krb5_error_code check_pac_checksum(DATA_BLOB pac_data,
|
||||
}
|
||||
|
||||
/**
|
||||
-* @brief Decode a blob containing a NDR envoded PAC structure
|
||||
+* @brief Decode a blob containing a NDR encoded PAC structure
|
||||
*
|
||||
* @param mem_ctx - The memory context
|
||||
* @param pac_data_blob - The data blob containing the NDR encoded data
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
|
||||
From 9725a86e60bb6ef6e912621e81acc955ae2f70a8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Mon, 10 Mar 2014 15:11:18 +0100
|
||||
Subject: [PATCH 3/8] s3-net: change the way impersonation principals are used
|
||||
in "net ads kerberos pac".
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/utils/net_ads.c | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index 5a073b1..ac6346f 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -2605,6 +2605,7 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
int ret = -1;
|
||||
const char *impersonate_princ_s = NULL;
|
||||
const char *local_service = NULL;
|
||||
+ int i;
|
||||
|
||||
if (c->display_usage) {
|
||||
d_printf( "%s\n"
|
||||
@@ -2615,15 +2616,20 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
return 0;
|
||||
}
|
||||
|
||||
+ for (i=0; i<argc; i++) {
|
||||
+ if (strnequal(argv[i], "impersonate", strlen("impersonate"))) {
|
||||
+ impersonate_princ_s = get_string_param(argv[i]);
|
||||
+ if (impersonate_princ_s == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
mem_ctx = talloc_init("net_ads_kerberos_pac");
|
||||
if (!mem_ctx) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
- if (argc > 0) {
|
||||
- impersonate_princ_s = argv[0];
|
||||
- }
|
||||
-
|
||||
local_service = talloc_asprintf(mem_ctx, "%s$@%s",
|
||||
lp_netbios_name(), lp_realm());
|
||||
if (local_service == NULL) {
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
|
||||
From 35a1ed22f65473fabb2f4846f6d2b50da1847f6a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Tue, 11 Mar 2014 16:34:36 +0100
|
||||
Subject: [PATCH 4/8] s3-net: allow to provide custom local_service in "net ads
|
||||
kerberos pac".
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/utils/net_ads.c | 14 +++++++++++---
|
||||
1 file changed, 11 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index ac6346f..c53c8c6 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -2623,6 +2623,12 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
+ if (strnequal(argv[i], "local_service", strlen("local_service"))) {
|
||||
+ local_service = get_string_param(argv[i]);
|
||||
+ if (local_service == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
mem_ctx = talloc_init("net_ads_kerberos_pac");
|
||||
@@ -2630,10 +2636,12 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
goto out;
|
||||
}
|
||||
|
||||
- local_service = talloc_asprintf(mem_ctx, "%s$@%s",
|
||||
- lp_netbios_name(), lp_realm());
|
||||
if (local_service == NULL) {
|
||||
- goto out;
|
||||
+ local_service = talloc_asprintf(mem_ctx, "%s$@%s",
|
||||
+ lp_netbios_name(), lp_realm());
|
||||
+ if (local_service == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
|
||||
c->opt_password = net_prompt_pass(c, c->opt_user_name);
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
|
||||
From 1270e35ba70a4e4881512d375c767023512f67bd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Fri, 21 Feb 2014 18:56:04 +0100
|
||||
Subject: [PATCH 5/8] s3-kerberos: return a full PAC in kerberos_return_pac().
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/libads/authdata.c | 28 +++++++++++++++++-----------
|
||||
source3/libads/kerberos_proto.h | 4 ++--
|
||||
source3/utils/net_ads.c | 17 ++++++++++++++++-
|
||||
source3/winbindd/winbindd_pam.c | 22 +++++++++++++++++++++-
|
||||
4 files changed, 56 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c
|
||||
index dd80dc2..53e40ef 100644
|
||||
--- a/source3/libads/authdata.c
|
||||
+++ b/source3/libads/authdata.c
|
||||
@@ -52,7 +52,7 @@ static NTSTATUS kerberos_fetch_pac(struct auth4_context *auth_ctx,
|
||||
struct auth_session_info **session_info)
|
||||
{
|
||||
TALLOC_CTX *tmp_ctx;
|
||||
- struct PAC_LOGON_INFO *logon_info = NULL;
|
||||
+ struct PAC_DATA *pac_data = NULL;
|
||||
NTSTATUS status = NT_STATUS_INTERNAL_ERROR;
|
||||
|
||||
tmp_ctx = talloc_new(mem_ctx);
|
||||
@@ -61,16 +61,22 @@ static NTSTATUS kerberos_fetch_pac(struct auth4_context *auth_ctx,
|
||||
}
|
||||
|
||||
if (pac_blob) {
|
||||
- status = kerberos_pac_logon_info(tmp_ctx, *pac_blob, NULL, NULL,
|
||||
- NULL, NULL, 0, &logon_info);
|
||||
+ status = kerberos_decode_pac(tmp_ctx,
|
||||
+ *pac_blob,
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ NULL,
|
||||
+ 0,
|
||||
+ &pac_data);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
- talloc_set_name_const(logon_info, "struct PAC_LOGON_INFO");
|
||||
+ talloc_set_name_const(pac_data, "struct PAC_DATA");
|
||||
|
||||
- auth_ctx->private_data = talloc_steal(auth_ctx, logon_info);
|
||||
+ auth_ctx->private_data = talloc_steal(auth_ctx, pac_data);
|
||||
*session_info = talloc_zero(mem_ctx, struct auth_session_info);
|
||||
if (!*session_info) {
|
||||
status = NT_STATUS_NO_MEMORY;
|
||||
@@ -102,7 +108,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
time_t renewable_time,
|
||||
const char *impersonate_princ_s,
|
||||
const char *local_service,
|
||||
- struct PAC_LOGON_INFO **_logon_info)
|
||||
+ struct PAC_DATA **_pac_data)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
NTSTATUS status = NT_STATUS_INVALID_PARAMETER;
|
||||
@@ -116,7 +122,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
size_t idx = 0;
|
||||
struct auth4_context *auth_context;
|
||||
struct loadparm_context *lp_ctx;
|
||||
- struct PAC_LOGON_INFO *logon_info = NULL;
|
||||
+ struct PAC_DATA *pac_data = NULL;
|
||||
|
||||
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
|
||||
NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
|
||||
@@ -272,15 +278,15 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- logon_info = talloc_get_type_abort(gensec_server_context->auth_context->private_data,
|
||||
- struct PAC_LOGON_INFO);
|
||||
- if (logon_info == NULL) {
|
||||
+ pac_data = talloc_get_type_abort(gensec_server_context->auth_context->private_data,
|
||||
+ struct PAC_DATA);
|
||||
+ if (pac_data == NULL) {
|
||||
DEBUG(1,("no PAC\n"));
|
||||
status = NT_STATUS_INVALID_PARAMETER;
|
||||
goto out;
|
||||
}
|
||||
|
||||
- *_logon_info = talloc_move(mem_ctx, &logon_info);
|
||||
+ *_pac_data = talloc_move(mem_ctx, &pac_data);
|
||||
|
||||
out:
|
||||
talloc_free(tmp_ctx);
|
||||
diff --git a/source3/libads/kerberos_proto.h b/source3/libads/kerberos_proto.h
|
||||
index 1151d66..b2f7486 100644
|
||||
--- a/source3/libads/kerberos_proto.h
|
||||
+++ b/source3/libads/kerberos_proto.h
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "system/kerberos.h"
|
||||
|
||||
-struct PAC_LOGON_INFO;
|
||||
+struct PAC_DATA;
|
||||
|
||||
#include "libads/ads_status.h"
|
||||
|
||||
@@ -78,7 +78,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
time_t renewable_time,
|
||||
const char *impersonate_princ_s,
|
||||
const char *local_service,
|
||||
- struct PAC_LOGON_INFO **logon_info);
|
||||
+ struct PAC_DATA **pac_data);
|
||||
|
||||
/* The following definitions come from libads/krb5_setpw.c */
|
||||
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index c53c8c6..19da6da 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -2600,6 +2600,7 @@ static int net_ads_kerberos_renew(struct net_context *c, int argc, const char **
|
||||
static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **argv)
|
||||
{
|
||||
struct PAC_LOGON_INFO *info = NULL;
|
||||
+ struct PAC_DATA *pac_data = NULL;
|
||||
TALLOC_CTX *mem_ctx = NULL;
|
||||
NTSTATUS status;
|
||||
int ret = -1;
|
||||
@@ -2658,13 +2659,27 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
2592000, /* one month */
|
||||
impersonate_princ_s,
|
||||
local_service,
|
||||
- &info);
|
||||
+ &pac_data);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf(_("failed to query kerberos PAC: %s\n"),
|
||||
nt_errstr(status));
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ for (i=0; i < pac_data->num_buffers; i++) {
|
||||
+
|
||||
+ if (pac_data->buffers[i].type != PAC_TYPE_LOGON_INFO) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ info = pac_data->buffers[i].info->logon_info.info;
|
||||
+ if (!info) {
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
if (info) {
|
||||
const char *s;
|
||||
s = NDR_PRINT_STRUCT_STRING(mem_ctx, PAC_LOGON_INFO, info);
|
||||
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
|
||||
index 61e2cef..a8daae51 100644
|
||||
--- a/source3/winbindd/winbindd_pam.c
|
||||
+++ b/source3/winbindd/winbindd_pam.c
|
||||
@@ -576,7 +576,9 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
time_t time_offset = 0;
|
||||
const char *user_ccache_file;
|
||||
struct PAC_LOGON_INFO *logon_info = NULL;
|
||||
+ struct PAC_DATA *pac_data = NULL;
|
||||
const char *local_service;
|
||||
+ int i;
|
||||
|
||||
*info3 = NULL;
|
||||
|
||||
@@ -662,7 +664,7 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
WINBINDD_PAM_AUTH_KRB5_RENEW_TIME,
|
||||
NULL,
|
||||
local_service,
|
||||
- &logon_info);
|
||||
+ &pac_data);
|
||||
if (user_ccache_file != NULL) {
|
||||
gain_root_privilege();
|
||||
}
|
||||
@@ -673,6 +675,24 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
goto failed;
|
||||
}
|
||||
|
||||
+ if (pac_data == NULL) {
|
||||
+ goto failed;
|
||||
+ }
|
||||
+
|
||||
+ for (i=0; i < pac_data->num_buffers; i++) {
|
||||
+
|
||||
+ if (pac_data->buffers[i].type != PAC_TYPE_LOGON_INFO) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ logon_info = pac_data->buffers[i].info->logon_info.info;
|
||||
+ if (!logon_info) {
|
||||
+ return NT_STATUS_INVALID_PARAMETER;
|
||||
+ }
|
||||
+
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
*info3 = &logon_info->info3;
|
||||
|
||||
DEBUG(10,("winbindd_raw_kerberos_login: winbindd validated ticket of %s\n",
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
|
||||
From a8c2807a26d2f1ff094ed7ea5724c0394f79b888 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Tue, 11 Mar 2014 18:07:11 +0100
|
||||
Subject: [PATCH 6/8] s3-kerberos: let kerberos_return_pac() return a PAC
|
||||
container.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/libads/authdata.c | 29 +++++++++++++++++++++--------
|
||||
source3/libads/kerberos_proto.h | 7 ++++++-
|
||||
source3/utils/net_ads.c | 5 ++++-
|
||||
source3/winbindd/winbindd_pam.c | 8 +++++++-
|
||||
4 files changed, 38 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c
|
||||
index 53e40ef..276408d 100644
|
||||
--- a/source3/libads/authdata.c
|
||||
+++ b/source3/libads/authdata.c
|
||||
@@ -53,6 +53,7 @@ static NTSTATUS kerberos_fetch_pac(struct auth4_context *auth_ctx,
|
||||
{
|
||||
TALLOC_CTX *tmp_ctx;
|
||||
struct PAC_DATA *pac_data = NULL;
|
||||
+ struct PAC_DATA_CTR *pac_data_ctr = NULL;
|
||||
NTSTATUS status = NT_STATUS_INTERNAL_ERROR;
|
||||
|
||||
tmp_ctx = talloc_new(mem_ctx);
|
||||
@@ -74,9 +75,21 @@ static NTSTATUS kerberos_fetch_pac(struct auth4_context *auth_ctx,
|
||||
}
|
||||
}
|
||||
|
||||
- talloc_set_name_const(pac_data, "struct PAC_DATA");
|
||||
+ pac_data_ctr = talloc(mem_ctx, struct PAC_DATA_CTR);
|
||||
+ if (pac_data_ctr == NULL) {
|
||||
+ status = NT_STATUS_NO_MEMORY;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ talloc_set_name_const(pac_data_ctr, "struct PAC_DATA_CTR");
|
||||
+
|
||||
+ pac_data_ctr->pac_data = talloc_steal(pac_data_ctr, pac_data);
|
||||
+ pac_data_ctr->pac_blob = data_blob_talloc(pac_data_ctr,
|
||||
+ pac_blob->data,
|
||||
+ pac_blob->length);
|
||||
+
|
||||
+ auth_ctx->private_data = talloc_steal(auth_ctx, pac_data_ctr);
|
||||
|
||||
- auth_ctx->private_data = talloc_steal(auth_ctx, pac_data);
|
||||
*session_info = talloc_zero(mem_ctx, struct auth_session_info);
|
||||
if (!*session_info) {
|
||||
status = NT_STATUS_NO_MEMORY;
|
||||
@@ -108,7 +121,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
time_t renewable_time,
|
||||
const char *impersonate_princ_s,
|
||||
const char *local_service,
|
||||
- struct PAC_DATA **_pac_data)
|
||||
+ struct PAC_DATA_CTR **_pac_data_ctr)
|
||||
{
|
||||
krb5_error_code ret;
|
||||
NTSTATUS status = NT_STATUS_INVALID_PARAMETER;
|
||||
@@ -122,7 +135,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
size_t idx = 0;
|
||||
struct auth4_context *auth_context;
|
||||
struct loadparm_context *lp_ctx;
|
||||
- struct PAC_DATA *pac_data = NULL;
|
||||
+ struct PAC_DATA_CTR *pac_data_ctr = NULL;
|
||||
|
||||
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
|
||||
NT_STATUS_HAVE_NO_MEMORY(tmp_ctx);
|
||||
@@ -278,15 +291,15 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
goto out;
|
||||
}
|
||||
|
||||
- pac_data = talloc_get_type_abort(gensec_server_context->auth_context->private_data,
|
||||
- struct PAC_DATA);
|
||||
- if (pac_data == NULL) {
|
||||
+ pac_data_ctr = talloc_get_type_abort(gensec_server_context->auth_context->private_data,
|
||||
+ struct PAC_DATA_CTR);
|
||||
+ if (pac_data_ctr == NULL) {
|
||||
DEBUG(1,("no PAC\n"));
|
||||
status = NT_STATUS_INVALID_PARAMETER;
|
||||
goto out;
|
||||
}
|
||||
|
||||
- *_pac_data = talloc_move(mem_ctx, &pac_data);
|
||||
+ *_pac_data_ctr = talloc_move(mem_ctx, &pac_data_ctr);
|
||||
|
||||
out:
|
||||
talloc_free(tmp_ctx);
|
||||
diff --git a/source3/libads/kerberos_proto.h b/source3/libads/kerberos_proto.h
|
||||
index b2f7486..3d0ad4b 100644
|
||||
--- a/source3/libads/kerberos_proto.h
|
||||
+++ b/source3/libads/kerberos_proto.h
|
||||
@@ -34,6 +34,11 @@
|
||||
|
||||
struct PAC_DATA;
|
||||
|
||||
+struct PAC_DATA_CTR {
|
||||
+ DATA_BLOB pac_blob;
|
||||
+ struct PAC_DATA *pac_data;
|
||||
+};
|
||||
+
|
||||
#include "libads/ads_status.h"
|
||||
|
||||
/* The following definitions come from libads/kerberos.c */
|
||||
@@ -78,7 +83,7 @@ NTSTATUS kerberos_return_pac(TALLOC_CTX *mem_ctx,
|
||||
time_t renewable_time,
|
||||
const char *impersonate_princ_s,
|
||||
const char *local_service,
|
||||
- struct PAC_DATA **pac_data);
|
||||
+ struct PAC_DATA_CTR **pac_data_ctr);
|
||||
|
||||
/* The following definitions come from libads/krb5_setpw.c */
|
||||
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index 19da6da..19c28b1 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -2601,6 +2601,7 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
{
|
||||
struct PAC_LOGON_INFO *info = NULL;
|
||||
struct PAC_DATA *pac_data = NULL;
|
||||
+ struct PAC_DATA_CTR *pac_data_ctr = NULL;
|
||||
TALLOC_CTX *mem_ctx = NULL;
|
||||
NTSTATUS status;
|
||||
int ret = -1;
|
||||
@@ -2659,13 +2660,15 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
2592000, /* one month */
|
||||
impersonate_princ_s,
|
||||
local_service,
|
||||
- &pac_data);
|
||||
+ &pac_data_ctr);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf(_("failed to query kerberos PAC: %s\n"),
|
||||
nt_errstr(status));
|
||||
goto out;
|
||||
}
|
||||
|
||||
+ pac_data = pac_data_ctr->pac_data;
|
||||
+
|
||||
for (i=0; i < pac_data->num_buffers; i++) {
|
||||
|
||||
if (pac_data->buffers[i].type != PAC_TYPE_LOGON_INFO) {
|
||||
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
|
||||
index a8daae51..b41291e 100644
|
||||
--- a/source3/winbindd/winbindd_pam.c
|
||||
+++ b/source3/winbindd/winbindd_pam.c
|
||||
@@ -577,6 +577,7 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
const char *user_ccache_file;
|
||||
struct PAC_LOGON_INFO *logon_info = NULL;
|
||||
struct PAC_DATA *pac_data = NULL;
|
||||
+ struct PAC_DATA_CTR *pac_data_ctr = NULL;
|
||||
const char *local_service;
|
||||
int i;
|
||||
|
||||
@@ -664,7 +665,7 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
WINBINDD_PAM_AUTH_KRB5_RENEW_TIME,
|
||||
NULL,
|
||||
local_service,
|
||||
- &pac_data);
|
||||
+ &pac_data_ctr);
|
||||
if (user_ccache_file != NULL) {
|
||||
gain_root_privilege();
|
||||
}
|
||||
@@ -675,6 +676,11 @@ static NTSTATUS winbindd_raw_kerberos_login(TALLOC_CTX *mem_ctx,
|
||||
goto failed;
|
||||
}
|
||||
|
||||
+ if (pac_data_ctr == NULL) {
|
||||
+ goto failed;
|
||||
+ }
|
||||
+
|
||||
+ pac_data = pac_data_ctr->pac_data;
|
||||
if (pac_data == NULL) {
|
||||
goto failed;
|
||||
}
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
|
||||
From 9e01f3cbc4752539128e5452f567ff2e73c3ec9d Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Tue, 11 Mar 2014 18:14:39 +0100
|
||||
Subject: [PATCH 7/8] s3-net: modify the current "net ads kerberos pac"
|
||||
command.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Rename it to "net ads kerberos pac dump" and add a "type=num" option to allow
|
||||
dumping of individial pac buffer types. Ommitting type= or using type=0 will
|
||||
dump the whole PAC structure on stdout.
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/utils/net_ads.c | 115 ++++++++++++++++++++++++++++++++----------------
|
||||
1 file changed, 77 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index 19c28b1..f54cf23 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -2597,27 +2597,15 @@ static int net_ads_kerberos_renew(struct net_context *c, int argc, const char **
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **argv)
|
||||
+static int net_ads_kerberos_pac_common(struct net_context *c, int argc, const char **argv,
|
||||
+ struct PAC_DATA_CTR **pac_data_ctr)
|
||||
{
|
||||
- struct PAC_LOGON_INFO *info = NULL;
|
||||
- struct PAC_DATA *pac_data = NULL;
|
||||
- struct PAC_DATA_CTR *pac_data_ctr = NULL;
|
||||
- TALLOC_CTX *mem_ctx = NULL;
|
||||
NTSTATUS status;
|
||||
int ret = -1;
|
||||
const char *impersonate_princ_s = NULL;
|
||||
const char *local_service = NULL;
|
||||
int i;
|
||||
|
||||
- if (c->display_usage) {
|
||||
- d_printf( "%s\n"
|
||||
- "net ads kerberos pac [impersonation_principal]\n"
|
||||
- " %s\n",
|
||||
- _("Usage:"),
|
||||
- _("Dump the Kerberos PAC"));
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
for (i=0; i<argc; i++) {
|
||||
if (strnequal(argv[i], "impersonate", strlen("impersonate"))) {
|
||||
impersonate_princ_s = get_string_param(argv[i]);
|
||||
@@ -2633,13 +2621,8 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
}
|
||||
}
|
||||
|
||||
- mem_ctx = talloc_init("net_ads_kerberos_pac");
|
||||
- if (!mem_ctx) {
|
||||
- goto out;
|
||||
- }
|
||||
-
|
||||
if (local_service == NULL) {
|
||||
- local_service = talloc_asprintf(mem_ctx, "%s$@%s",
|
||||
+ local_service = talloc_asprintf(c, "%s$@%s",
|
||||
lp_netbios_name(), lp_realm());
|
||||
if (local_service == NULL) {
|
||||
goto out;
|
||||
@@ -2648,7 +2631,7 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
|
||||
c->opt_password = net_prompt_pass(c, c->opt_user_name);
|
||||
|
||||
- status = kerberos_return_pac(mem_ctx,
|
||||
+ status = kerberos_return_pac(c,
|
||||
c->opt_user_name,
|
||||
c->opt_password,
|
||||
0,
|
||||
@@ -2660,39 +2643,95 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
2592000, /* one month */
|
||||
impersonate_princ_s,
|
||||
local_service,
|
||||
- &pac_data_ctr);
|
||||
+ pac_data_ctr);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
d_printf(_("failed to query kerberos PAC: %s\n"),
|
||||
nt_errstr(status));
|
||||
goto out;
|
||||
}
|
||||
|
||||
- pac_data = pac_data_ctr->pac_data;
|
||||
+ ret = 0;
|
||||
+ out:
|
||||
+ return ret;
|
||||
+}
|
||||
|
||||
- for (i=0; i < pac_data->num_buffers; i++) {
|
||||
+static int net_ads_kerberos_pac_dump(struct net_context *c, int argc, const char **argv)
|
||||
+{
|
||||
+ struct PAC_DATA_CTR *pac_data_ctr = NULL;
|
||||
+ int i;
|
||||
+ int ret = -1;
|
||||
+ enum PAC_TYPE type = 0;
|
||||
|
||||
- if (pac_data->buffers[i].type != PAC_TYPE_LOGON_INFO) {
|
||||
- continue;
|
||||
+ if (c->display_usage) {
|
||||
+ d_printf( "%s\n"
|
||||
+ "net ads kerberos pac dump [impersonate=string] [local_service=string] [pac_buffer_type=int]\n"
|
||||
+ " %s\n",
|
||||
+ _("Usage:"),
|
||||
+ _("Dump the Kerberos PAC"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ for (i=0; i<argc; i++) {
|
||||
+ if (strnequal(argv[i], "pac_buffer_type", strlen("pac_buffer_type"))) {
|
||||
+ type = get_int_param(argv[i]);
|
||||
}
|
||||
+ }
|
||||
|
||||
- info = pac_data->buffers[i].info->logon_info.info;
|
||||
- if (!info) {
|
||||
- goto out;
|
||||
+ ret = net_ads_kerberos_pac_common(c, argc, argv, &pac_data_ctr);
|
||||
+ if (ret) {
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ if (type == 0) {
|
||||
+
|
||||
+ char *s = NULL;
|
||||
+
|
||||
+ s = NDR_PRINT_STRUCT_STRING(c, PAC_DATA,
|
||||
+ pac_data_ctr->pac_data);
|
||||
+ if (s != NULL) {
|
||||
+ d_printf(_("The Pac: %s\n"), s);
|
||||
+ talloc_free(s);
|
||||
}
|
||||
|
||||
- break;
|
||||
+ return 0;
|
||||
}
|
||||
|
||||
- if (info) {
|
||||
- const char *s;
|
||||
- s = NDR_PRINT_STRUCT_STRING(mem_ctx, PAC_LOGON_INFO, info);
|
||||
- d_printf(_("The Pac: %s\n"), s);
|
||||
+ for (i=0; i < pac_data_ctr->pac_data->num_buffers; i++) {
|
||||
+
|
||||
+ char *s = NULL;
|
||||
+
|
||||
+ if (pac_data_ctr->pac_data->buffers[i].type != type) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ s = NDR_PRINT_UNION_STRING(c, PAC_INFO, type,
|
||||
+ pac_data_ctr->pac_data->buffers[i].info);
|
||||
+ if (s != NULL) {
|
||||
+ d_printf(_("The Pac: %s\n"), s);
|
||||
+ talloc_free(s);
|
||||
+ }
|
||||
+ break;
|
||||
}
|
||||
|
||||
- ret = 0;
|
||||
- out:
|
||||
- TALLOC_FREE(mem_ctx);
|
||||
- return ret;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **argv)
|
||||
+{
|
||||
+ struct functable func[] = {
|
||||
+ {
|
||||
+ "dump",
|
||||
+ net_ads_kerberos_pac_dump,
|
||||
+ NET_TRANSPORT_ADS,
|
||||
+ N_("Dump Kerberos PAC"),
|
||||
+ N_("net ads kerberos pac dump\n"
|
||||
+ " Dump a Kerberos PAC to stdout")
|
||||
+ },
|
||||
+
|
||||
+ {NULL, NULL, 0, NULL, NULL}
|
||||
+ };
|
||||
+
|
||||
+ return net_run_function(c, argc, argv, "net ads kerberos pac", func);
|
||||
}
|
||||
|
||||
static int net_ads_kerberos_kinit(struct net_context *c, int argc, const char **argv)
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
|
||||
From 91ceace4ee8fd141cac5dbe5282bed141c38bee7 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Tue, 11 Mar 2014 18:16:40 +0100
|
||||
Subject: [PATCH 8/8] s3-net: add a new "net ads kerberos pac save" tool.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Use "filename=string" to define a file where to save the unencrypted PAC to.
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/utils/net_ads.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 52 insertions(+)
|
||||
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index f54cf23..8b8e719 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -2716,6 +2716,50 @@ static int net_ads_kerberos_pac_dump(struct net_context *c, int argc, const char
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int net_ads_kerberos_pac_save(struct net_context *c, int argc, const char **argv)
|
||||
+{
|
||||
+ struct PAC_DATA_CTR *pac_data_ctr = NULL;
|
||||
+ char *filename = NULL;
|
||||
+ int ret = -1;
|
||||
+ int i;
|
||||
+
|
||||
+ if (c->display_usage) {
|
||||
+ d_printf( "%s\n"
|
||||
+ "net ads kerberos pac save [impersonate=string] [local_service=string] [filename=string]\n"
|
||||
+ " %s\n",
|
||||
+ _("Usage:"),
|
||||
+ _("Save the Kerberos PAC"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ for (i=0; i<argc; i++) {
|
||||
+ if (strnequal(argv[i], "filename", strlen("filename"))) {
|
||||
+ filename = get_string_param(argv[i]);
|
||||
+ if (filename == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ret = net_ads_kerberos_pac_common(c, argc, argv, &pac_data_ctr);
|
||||
+ if (ret) {
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ if (filename == NULL) {
|
||||
+ d_printf(_("please define \"filename=<filename>\" to save the PAC\n"));
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ /* save the raw format */
|
||||
+ if (!file_save(filename, pac_data_ctr->pac_blob.data, pac_data_ctr->pac_blob.length)) {
|
||||
+ d_printf(_("failed to save PAC in %s\n"), filename);
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **argv)
|
||||
{
|
||||
struct functable func[] = {
|
||||
@@ -2727,6 +2771,14 @@ static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **ar
|
||||
N_("net ads kerberos pac dump\n"
|
||||
" Dump a Kerberos PAC to stdout")
|
||||
},
|
||||
+ {
|
||||
+ "save",
|
||||
+ net_ads_kerberos_pac_save,
|
||||
+ NET_TRANSPORT_ADS,
|
||||
+ N_("Save Kerberos PAC"),
|
||||
+ N_("net ads kerberos pac save\n"
|
||||
+ " Save a Kerberos PAC in a file")
|
||||
+ },
|
||||
|
||||
{NULL, NULL, 0, NULL, NULL}
|
||||
};
|
||||
--
|
||||
1.8.5.3
|
||||
|
||||
@@ -1,211 +0,0 @@
|
||||
From 942dedb71437cd89932a7f39ca73d65c09aa59be Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Wed, 2 Apr 2014 19:37:34 +0200
|
||||
Subject: [PATCH] s3-kerberos: make ipv6 support for generated krb5 config
|
||||
files more robust.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Older MIT Kerberos libraries will add any secondary ipv6 address as
|
||||
ipv4 address, defining the (default) krb5 port 88 circumvents that.
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
---
|
||||
source3/libads/kerberos.c | 29 +++++++++++++++++++++++++++--
|
||||
1 file changed, 27 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
|
||||
index 649e568..f3c23ea 100644
|
||||
--- a/source3/libads/kerberos.c
|
||||
+++ b/source3/libads/kerberos.c
|
||||
@@ -615,6 +615,31 @@ static void add_sockaddr_unique(struct sockaddr_storage *addrs, int *num_addrs,
|
||||
*num_addrs += 1;
|
||||
}
|
||||
|
||||
+/* print_canonical_sockaddr prints an ipv6 addr in the form of
|
||||
+* [ipv6.addr]. This string, when put in a generated krb5.conf file is not
|
||||
+* always properly dealt with by some older krb5 libraries. Adding the hard-coded
|
||||
+* portnumber workarounds the issue. - gd */
|
||||
+
|
||||
+static char *print_canonical_sockaddr_with_port(TALLOC_CTX *mem_ctx,
|
||||
+ const struct sockaddr_storage *pss)
|
||||
+{
|
||||
+ char *str = NULL;
|
||||
+
|
||||
+ str = print_canonical_sockaddr(mem_ctx, pss);
|
||||
+ if (str == NULL) {
|
||||
+ return NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (pss->ss_family != AF_INET6) {
|
||||
+ return str;
|
||||
+ }
|
||||
+
|
||||
+#if defined(HAVE_IPV6)
|
||||
+ str = talloc_asprintf_append(str, ":88");
|
||||
+#endif
|
||||
+ return str;
|
||||
+}
|
||||
+
|
||||
static char *get_kdc_ip_string(char *mem_ctx,
|
||||
const char *realm,
|
||||
const char *sitename,
|
||||
@@ -634,7 +659,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
||||
struct netlogon_samlogon_response **responses = NULL;
|
||||
NTSTATUS status;
|
||||
char *kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n", "",
|
||||
- print_canonical_sockaddr(mem_ctx, pss));
|
||||
+ print_canonical_sockaddr_with_port(mem_ctx, pss));
|
||||
|
||||
if (kdc_str == NULL) {
|
||||
TALLOC_FREE(frame);
|
||||
@@ -726,7 +751,7 @@ static char *get_kdc_ip_string(char *mem_ctx,
|
||||
/* Append to the string - inefficient but not done often. */
|
||||
new_kdc_str = talloc_asprintf(mem_ctx, "%s\tkdc = %s\n",
|
||||
kdc_str,
|
||||
- print_canonical_sockaddr(mem_ctx, &dc_addrs[i]));
|
||||
+ print_canonical_sockaddr_with_port(mem_ctx, &dc_addrs[i]));
|
||||
if (new_kdc_str == NULL) {
|
||||
goto fail;
|
||||
}
|
||||
--
|
||||
1.9.0
|
||||
|
||||
From 60db71015f84dd242be889576d85ccd5c6a1f73b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Wed, 16 Apr 2014 16:07:14 +0200
|
||||
Subject: [PATCH] s3-libads: allow ads_try_connect() to re-use a resolved ip
|
||||
address.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Pass down a struct sockaddr_storage to ads_try_connect.
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
|
||||
Autobuild-User(master): Günther Deschner <gd@samba.org>
|
||||
Autobuild-Date(master): Thu Apr 17 19:56:16 CEST 2014 on sn-devel-104
|
||||
---
|
||||
source3/libads/ldap.c | 44 ++++++++++++++++++++++++++------------------
|
||||
1 file changed, 26 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
|
||||
index d9bb8e2..8fed8fd 100644
|
||||
--- a/source3/libads/ldap.c
|
||||
+++ b/source3/libads/ldap.c
|
||||
@@ -228,33 +228,27 @@ bool ads_closest_dc(ADS_STRUCT *ads)
|
||||
try a connection to a given ldap server, returning True and setting the servers IP
|
||||
in the ads struct if successful
|
||||
*/
|
||||
-static bool ads_try_connect(ADS_STRUCT *ads, const char *server, bool gc)
|
||||
+static bool ads_try_connect(ADS_STRUCT *ads, bool gc,
|
||||
+ struct sockaddr_storage *ss)
|
||||
{
|
||||
struct NETLOGON_SAM_LOGON_RESPONSE_EX cldap_reply;
|
||||
TALLOC_CTX *frame = talloc_stackframe();
|
||||
bool ret = false;
|
||||
- struct sockaddr_storage ss;
|
||||
char addr[INET6_ADDRSTRLEN];
|
||||
|
||||
- if (!server || !*server) {
|
||||
+ if (ss == NULL) {
|
||||
TALLOC_FREE(frame);
|
||||
return False;
|
||||
}
|
||||
|
||||
- if (!resolve_name(server, &ss, 0x20, true)) {
|
||||
- DEBUG(5,("ads_try_connect: unable to resolve name %s\n",
|
||||
- server ));
|
||||
- TALLOC_FREE(frame);
|
||||
- return false;
|
||||
- }
|
||||
- print_sockaddr(addr, sizeof(addr), &ss);
|
||||
+ print_sockaddr(addr, sizeof(addr), ss);
|
||||
|
||||
DEBUG(5,("ads_try_connect: sending CLDAP request to %s (realm: %s)\n",
|
||||
addr, ads->server.realm));
|
||||
|
||||
ZERO_STRUCT( cldap_reply );
|
||||
|
||||
- if ( !ads_cldap_netlogon_5(frame, &ss, ads->server.realm, &cldap_reply ) ) {
|
||||
+ if ( !ads_cldap_netlogon_5(frame, ss, ads->server.realm, &cldap_reply ) ) {
|
||||
DEBUG(3,("ads_try_connect: CLDAP request %s failed.\n", addr));
|
||||
ret = false;
|
||||
goto out;
|
||||
@@ -298,7 +292,7 @@ static bool ads_try_connect(ADS_STRUCT *ads, const char *server, bool gc)
|
||||
ads->server.workgroup = SMB_STRDUP(cldap_reply.domain_name);
|
||||
|
||||
ads->ldap.port = gc ? LDAP_GC_PORT : LDAP_PORT;
|
||||
- ads->ldap.ss = ss;
|
||||
+ ads->ldap.ss = *ss;
|
||||
|
||||
/* Store our site name. */
|
||||
sitename_store( cldap_reply.domain_name, cldap_reply.client_site);
|
||||
@@ -330,6 +324,7 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads)
|
||||
bool use_own_domain = False;
|
||||
char *sitename;
|
||||
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
|
||||
+ bool ok = false;
|
||||
|
||||
/* if the realm and workgroup are both empty, assume they are ours */
|
||||
|
||||
@@ -384,12 +379,14 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads)
|
||||
DEBUG(6,("ads_find_dc: (ldap) looking for %s '%s'\n",
|
||||
(got_realm ? "realm" : "domain"), realm));
|
||||
|
||||
- if (get_dc_name(domain, realm, srv_name, &ip_out)) {
|
||||
+ ok = get_dc_name(domain, realm, srv_name, &ip_out);
|
||||
+ if (ok) {
|
||||
/*
|
||||
* we call ads_try_connect() to fill in the
|
||||
* ads->config details
|
||||
*/
|
||||
- if (ads_try_connect(ads, srv_name, false)) {
|
||||
+ ok = ads_try_connect(ads, false, &ip_out);
|
||||
+ if (ok) {
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
}
|
||||
@@ -445,7 +442,8 @@ static NTSTATUS ads_find_dc(ADS_STRUCT *ads)
|
||||
}
|
||||
}
|
||||
|
||||
- if ( ads_try_connect(ads, server, false) ) {
|
||||
+ ok = ads_try_connect(ads, false, &ip_list[i].ss);
|
||||
+ if (ok) {
|
||||
SAFE_FREE(ip_list);
|
||||
SAFE_FREE(sitename);
|
||||
return NT_STATUS_OK;
|
||||
@@ -630,9 +628,19 @@ ADS_STATUS ads_connect(ADS_STRUCT *ads)
|
||||
TALLOC_FREE(s);
|
||||
}
|
||||
|
||||
- if (ads->server.ldap_server)
|
||||
- {
|
||||
- if (ads_try_connect(ads, ads->server.ldap_server, ads->server.gc)) {
|
||||
+ if (ads->server.ldap_server) {
|
||||
+ bool ok = false;
|
||||
+ struct sockaddr_storage ss;
|
||||
+
|
||||
+ ok = resolve_name(ads->server.ldap_server, &ss, 0x20, true);
|
||||
+ if (!ok) {
|
||||
+ DEBUG(5,("ads_connect: unable to resolve name %s\n",
|
||||
+ ads->server.ldap_server));
|
||||
+ status = ADS_ERROR_NT(NT_STATUS_NOT_FOUND);
|
||||
+ goto out;
|
||||
+ }
|
||||
+ ok = ads_try_connect(ads, ads->server.gc, &ss);
|
||||
+ if (ok) {
|
||||
goto got_connection;
|
||||
}
|
||||
|
||||
--
|
||||
1.9.0
|
||||
|
||||
-29894
File diff suppressed because it is too large
Load Diff
-97
@@ -1,97 +0,0 @@
|
||||
From f73c906237aa0c9d45900d69d31c9b39261f062a Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Tue, 16 Sep 2014 18:02:30 +0200
|
||||
Subject: [PATCH 1/2] lib: Add daemon_status() to util library.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10816
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Alexander Bokovoy <ab@samba.org>
|
||||
(cherry picked from commit 9f5f5fa8ebf845c53b7a92557d7aec56ed820320)
|
||||
---
|
||||
lib/util/become_daemon.c | 11 +++++++++++
|
||||
lib/util/samba_util.h | 6 ++++++
|
||||
2 files changed, 17 insertions(+)
|
||||
|
||||
diff --git a/lib/util/become_daemon.c b/lib/util/become_daemon.c
|
||||
index 35c8b32..688bedd 100644
|
||||
--- a/lib/util/become_daemon.c
|
||||
+++ b/lib/util/become_daemon.c
|
||||
@@ -135,3 +135,14 @@ _PUBLIC_ void daemon_ready(const char *daemon)
|
||||
#endif
|
||||
DEBUG(0, ("STATUS=daemon '%s' finished starting up and ready to serve connections", daemon));
|
||||
}
|
||||
+
|
||||
+_PUBLIC_ void daemon_status(const char *name, const char *msg)
|
||||
+{
|
||||
+ if (name == NULL) {
|
||||
+ name = "Samba";
|
||||
+ }
|
||||
+#ifdef HAVE_SYSTEMD
|
||||
+ sd_notifyf(0, "\nSTATUS=%s: %s", name, msg);
|
||||
+#endif
|
||||
+ DEBUG(0, ("STATUS=daemon '%s' : %s", name, msg));
|
||||
+}
|
||||
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
|
||||
index e3fe6a6..f4216d8 100644
|
||||
--- a/lib/util/samba_util.h
|
||||
+++ b/lib/util/samba_util.h
|
||||
@@ -853,6 +853,12 @@ _PUBLIC_ void exit_daemon(const char *msg, int error);
|
||||
**/
|
||||
_PUBLIC_ void daemon_ready(const char *daemon);
|
||||
|
||||
+/*
|
||||
+ * Report the daemon status. For example if it is not ready to serve connections
|
||||
+ * and is waiting for some event to happen.
|
||||
+ */
|
||||
+_PUBLIC_ void daemon_status(const char *name, const char *msg);
|
||||
+
|
||||
/**
|
||||
* @brief Get a password from the console.
|
||||
*
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
||||
From 7fcd74039961fa0fb02934bc87ce41fd98234f1a Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Tue, 16 Sep 2014 18:03:51 +0200
|
||||
Subject: [PATCH 2/2] nmbd: Send waiting status to systemd.
|
||||
|
||||
This tells the Administrator what's going on and we should log that IPv6
|
||||
is not supported.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10816
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Alexander Bokovoy <ab@samba.org>
|
||||
|
||||
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
|
||||
Autobuild-Date(master): Wed Sep 17 13:16:43 CEST 2014 on sn-devel-104
|
||||
|
||||
(cherry picked from commit 2df601bff0d949e66c79366b8248b9d950c0b430)
|
||||
---
|
||||
source3/nmbd/nmbd_subnetdb.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c
|
||||
index 311a240..6c483af 100644
|
||||
--- a/source3/nmbd/nmbd_subnetdb.c
|
||||
+++ b/source3/nmbd/nmbd_subnetdb.c
|
||||
@@ -247,8 +247,11 @@ bool create_subnets(void)
|
||||
|
||||
/* Only count IPv4, non-loopback interfaces. */
|
||||
if (iface_count_v4_nl() == 0) {
|
||||
- DEBUG(0,("create_subnets: No local IPv4 non-loopback interfaces !\n"));
|
||||
- DEBUG(0,("create_subnets: Waiting for an interface to appear ...\n"));
|
||||
+ daemon_status("nmbd",
|
||||
+ "No local IPv4 non-loopback interfaces "
|
||||
+ "available, waiting for interface ...");
|
||||
+ DEBUG(0,("NOTE: NetBIOS name resolution is not supported for "
|
||||
+ "Internet Protocol Version 6 (IPv6).\n"));
|
||||
}
|
||||
|
||||
/* We only count IPv4, non-loopback interfaces here. */
|
||||
--
|
||||
2.1.0
|
||||
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
From 23dfa2e35bec9c0f6c3d579e7dc2e1d0ce636aa2 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Fri, 19 Sep 2014 13:33:10 +0200
|
||||
Subject: [PATCH] nsswitch: Skip groups we were not able to map.
|
||||
|
||||
If we have configured the idmap_ad backend it is possible that the user
|
||||
is in a group without a gid set. This will result in (uid_t)-1 as the
|
||||
gid. We return this invalid gid to NSS which is wrong.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10824
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: David Disseldorp <ddiss@samba.org>
|
||||
|
||||
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
|
||||
Autobuild-Date(master): Fri Sep 19 17:57:14 CEST 2014 on sn-devel-104
|
||||
|
||||
(cherry picked from commit 7f59711f076e98ece099f6b38ff6da8c80fa6d5e)
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
nsswitch/winbind_nss_linux.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c
|
||||
index 8d66a74..70ede3e 100644
|
||||
--- a/nsswitch/winbind_nss_linux.c
|
||||
+++ b/nsswitch/winbind_nss_linux.c
|
||||
@@ -1101,6 +1101,11 @@ _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
|
||||
continue;
|
||||
}
|
||||
|
||||
+ /* Skip groups without a mapping */
|
||||
+ if (gid_list[i] == (uid_t)-1) {
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
/* Filled buffer ? If so, resize. */
|
||||
|
||||
if (*start == *size) {
|
||||
--
|
||||
2.1.0
|
||||
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
From dc6b86b93c8f059b0cc96c364ffad05c88b7d92e Mon Sep 17 00:00:00 2001
|
||||
From: Christof Schmitt <cs@samba.org>
|
||||
Date: Fri, 22 Aug 2014 09:15:59 -0700
|
||||
Subject: [PATCH] s3-winbindd: Use correct realm for trusted domains in idmap child
|
||||
|
||||
When authenticating users in a trusted domain, the idmap_ad module
|
||||
always connects to a local DC instead of one in the trusted domain.
|
||||
|
||||
Fix this by passing the correct realm to connect to.
|
||||
|
||||
Also Comment parameters passed to ads_cached_connection_connect
|
||||
|
||||
Signed-off-by: Christof Schmitt <cs@samba.org>
|
||||
Reviewed-by: Jeremy Allison <jra@samba.org>
|
||||
(cherry picked from commit c203c722e7e22f9146f2ecf6f42452c0e82042e4)
|
||||
---
|
||||
source3/winbindd/winbindd_ads.c | 11 +++++++++--
|
||||
1 files changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/source3/winbindd/winbindd_ads.c b/source3/winbindd/winbindd_ads.c
|
||||
index 4c26389..e47613e 100644
|
||||
--- a/source3/winbindd/winbindd_ads.c
|
||||
+++ b/source3/winbindd/winbindd_ads.c
|
||||
@@ -187,8 +187,15 @@ ADS_STATUS ads_idmap_cached_connection(ADS_STRUCT **adsp, const char *dom_name)
|
||||
}
|
||||
}
|
||||
|
||||
- status = ads_cached_connection_connect(adsp, realm, dom_name, ldap_server,
|
||||
- password, realm, 0);
|
||||
+ status = ads_cached_connection_connect(
|
||||
+ adsp, /* Returns ads struct. */
|
||||
+ wb_dom->alt_name, /* realm to connect to. */
|
||||
+ dom_name, /* 'workgroup' name for ads_init */
|
||||
+ ldap_server, /* DNS name to connect to. */
|
||||
+ password, /* password for auth realm. */
|
||||
+ realm, /* realm used for krb5 ticket. */
|
||||
+ 0); /* renewable ticket time. */
|
||||
+
|
||||
SAFE_FREE(realm);
|
||||
|
||||
return status;
|
||||
--
|
||||
1.7.1
|
||||
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
From 0aab8ae3c137e5900d22160555bcef57cd62ca21 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Wed, 17 Sep 2014 15:17:50 +0200
|
||||
Subject: [PATCH 2/2] libcli: Fix a segfault calling smbXcli_req_set_pending()
|
||||
on NULL.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10817
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Jeremy Allison <jra@samba.org>
|
||||
|
||||
Autobuild-User(master): Jeremy Allison <jra@samba.org>
|
||||
Autobuild-Date(master): Tue Sep 23 04:23:05 CEST 2014 on sn-devel-104
|
||||
|
||||
(cherry picked from commit f92086f4a347dcc8fa948aa2614a2c12f1115e5a)
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
libcli/smb/smb1cli_echo.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/libcli/smb/smb1cli_echo.c b/libcli/smb/smb1cli_echo.c
|
||||
index 4fb7c60..10dff2d 100644
|
||||
--- a/libcli/smb/smb1cli_echo.c
|
||||
+++ b/libcli/smb/smb1cli_echo.c
|
||||
@@ -96,7 +96,6 @@ static void smb1cli_echo_done(struct tevent_req *subreq)
|
||||
NULL, /* pbytes_offset */
|
||||
NULL, /* pinbuf */
|
||||
expected, ARRAY_SIZE(expected));
|
||||
- TALLOC_FREE(subreq);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
return;
|
||||
--
|
||||
2.1.0
|
||||
|
||||
-180
@@ -1,180 +0,0 @@
|
||||
From 579901faf787d8d787c978324bdec87c349e3d9b Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Tue, 23 Sep 2014 14:09:41 +0200
|
||||
Subject: [PATCH] s3-libads: Improve service principle guessing.
|
||||
|
||||
If the name passed to the net command with the -S options is the long
|
||||
hostname of the domaincontroller and not the 15 char NetBIOS name we
|
||||
should construct a FQDN with the realm to get a Kerberos ticket.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10829
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Guenther Deschner <gd@samba.org>
|
||||
(cherry picked from commit 83c62bd3f5945bbe295cbfbd153736d4c709b3a6)
|
||||
---
|
||||
source3/libads/sasl.c | 124 +++++++++++++++++++++++++++-----------------------
|
||||
1 file changed, 66 insertions(+), 58 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/sasl.c b/source3/libads/sasl.c
|
||||
index 33f4e24..1450ff1 100644
|
||||
--- a/source3/libads/sasl.c
|
||||
+++ b/source3/libads/sasl.c
|
||||
@@ -714,88 +714,96 @@ static void ads_free_service_principal(struct ads_service_principal *p)
|
||||
static ADS_STATUS ads_guess_service_principal(ADS_STRUCT *ads,
|
||||
char **returned_principal)
|
||||
{
|
||||
+ ADS_STATUS status = ADS_ERROR(LDAP_NO_MEMORY);
|
||||
char *princ = NULL;
|
||||
+ TALLOC_CTX *frame;
|
||||
+ char *server = NULL;
|
||||
+ char *realm = NULL;
|
||||
+ int rc;
|
||||
|
||||
- if (ads->server.realm && ads->server.ldap_server) {
|
||||
- char *server, *server_realm;
|
||||
-
|
||||
- server = SMB_STRDUP(ads->server.ldap_server);
|
||||
- server_realm = SMB_STRDUP(ads->server.realm);
|
||||
-
|
||||
- if (!server || !server_realm) {
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
- }
|
||||
+ frame = talloc_stackframe();
|
||||
+ if (frame == NULL) {
|
||||
+ return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ }
|
||||
|
||||
- if (!strlower_m(server)) {
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ if (ads->server.realm && ads->server.ldap_server) {
|
||||
+ server = strlower_talloc(frame, ads->server.ldap_server);
|
||||
+ if (server == NULL) {
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
- if (!strupper_m(server_realm)) {
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ realm = strupper_talloc(frame, ads->server.realm);
|
||||
+ if (realm == NULL) {
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
- if (asprintf(&princ, "ldap/%s@%s", server, server_realm) == -1) {
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
- }
|
||||
+ /*
|
||||
+ * If we got a name which is bigger than a NetBIOS name,
|
||||
+ * but isn't a FQDN, create one.
|
||||
+ */
|
||||
+ if (strlen(server) > 15 && strstr(server, ".") == NULL) {
|
||||
+ char *dnsdomain;
|
||||
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
+ dnsdomain = strlower_talloc(frame, ads->server.realm);
|
||||
+ if (dnsdomain == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
- if (!princ) {
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ server = talloc_asprintf(frame,
|
||||
+ "%s.%s",
|
||||
+ server, dnsdomain);
|
||||
+ if (server == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
} else if (ads->config.realm && ads->config.ldap_server_name) {
|
||||
- char *server, *server_realm;
|
||||
-
|
||||
- server = SMB_STRDUP(ads->config.ldap_server_name);
|
||||
- server_realm = SMB_STRDUP(ads->config.realm);
|
||||
-
|
||||
- if (!server || !server_realm) {
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ server = strlower_talloc(frame, ads->config.ldap_server_name);
|
||||
+ if (server == NULL) {
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
- if (!strlower_m(server)) {
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ realm = strupper_talloc(frame, ads->config.realm);
|
||||
+ if (realm == NULL) {
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
- if (!strupper_m(server_realm)) {
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
- }
|
||||
- if (asprintf(&princ, "ldap/%s@%s", server, server_realm) == -1) {
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
- }
|
||||
+ /*
|
||||
+ * If we got a name which is bigger than a NetBIOS name,
|
||||
+ * but isn't a FQDN, create one.
|
||||
+ */
|
||||
+ if (strlen(server) > 15 && strstr(server, ".") == NULL) {
|
||||
+ char *dnsdomain;
|
||||
|
||||
- SAFE_FREE(server);
|
||||
- SAFE_FREE(server_realm);
|
||||
+ dnsdomain = strlower_talloc(frame, ads->server.realm);
|
||||
+ if (dnsdomain == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
- if (!princ) {
|
||||
- return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ server = talloc_asprintf(frame,
|
||||
+ "%s.%s",
|
||||
+ server, dnsdomain);
|
||||
+ if (server == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
- if (!princ) {
|
||||
- return ADS_ERROR(LDAP_PARAM_ERROR);
|
||||
+ if (server == NULL || realm == NULL) {
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ rc = asprintf(&princ, "ldap/%s@%s", server, realm);
|
||||
+ if (rc == -1 || princ == NULL) {
|
||||
+ status = ADS_ERROR(LDAP_PARAM_ERROR);
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
*returned_principal = princ;
|
||||
|
||||
- return ADS_SUCCESS;
|
||||
+ status = ADS_SUCCESS;
|
||||
+out:
|
||||
+ TALLOC_FREE(frame);
|
||||
+ return status;
|
||||
}
|
||||
|
||||
static ADS_STATUS ads_generate_service_principal(ADS_STRUCT *ads,
|
||||
--
|
||||
2.1.0
|
||||
|
||||
-329
@@ -1,329 +0,0 @@
|
||||
From 1925edc67e223d73d672af48c2ebd3e5865e01d9 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Wed, 24 Sep 2014 09:22:03 +0200
|
||||
Subject: [PATCH 1/4] s3-libads: Add a function to retrieve the SPNs of a
|
||||
computer account.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9984
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Guenther Deschner <gd@samba.org>
|
||||
(cherry picked from commit 4eaa4ccbdf279f1ff6d8218b36d92aeea0114cd8)
|
||||
---
|
||||
source3/libads/ads_proto.h | 6 +++++
|
||||
source3/libads/ldap.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 66 insertions(+)
|
||||
|
||||
diff --git a/source3/libads/ads_proto.h b/source3/libads/ads_proto.h
|
||||
index 17a84d1..6a22807 100644
|
||||
--- a/source3/libads/ads_proto.h
|
||||
+++ b/source3/libads/ads_proto.h
|
||||
@@ -87,6 +87,12 @@ ADS_STATUS ads_add_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods,
|
||||
const char *name, const char **vals);
|
||||
uint32 ads_get_kvno(ADS_STRUCT *ads, const char *account_name);
|
||||
uint32_t ads_get_machine_kvno(ADS_STRUCT *ads, const char *machine_name);
|
||||
+
|
||||
+ADS_STATUS ads_get_service_principal_names(TALLOC_CTX *mem_ctx,
|
||||
+ ADS_STRUCT *ads,
|
||||
+ const char *machine_name,
|
||||
+ char ***spn_array,
|
||||
+ size_t *num_spns);
|
||||
ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machine_name);
|
||||
ADS_STATUS ads_add_service_principal_name(ADS_STRUCT *ads, const char *machine_name,
|
||||
const char *my_fqdn, const char *spn);
|
||||
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
|
||||
index fb99132..51a0883 100644
|
||||
--- a/source3/libads/ldap.c
|
||||
+++ b/source3/libads/ldap.c
|
||||
@@ -1927,6 +1927,66 @@ ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machin
|
||||
}
|
||||
|
||||
/**
|
||||
+ * @brief This gets the service principal names of an existing computer account.
|
||||
+ *
|
||||
+ * @param[in] mem_ctx The memory context to use to allocate the spn array.
|
||||
+ *
|
||||
+ * @param[in] ads The ADS context to use.
|
||||
+ *
|
||||
+ * @param[in] machine_name The NetBIOS name of the computer, which is used to
|
||||
+ * identify the computer account.
|
||||
+ *
|
||||
+ * @param[in] spn_array A pointer to store the array for SPNs.
|
||||
+ *
|
||||
+ * @param[in] num_spns The number of principals stored in the array.
|
||||
+ *
|
||||
+ * @return 0 on success, or a ADS error if a failure occured.
|
||||
+ */
|
||||
+ADS_STATUS ads_get_service_principal_names(TALLOC_CTX *mem_ctx,
|
||||
+ ADS_STRUCT *ads,
|
||||
+ const char *machine_name,
|
||||
+ char ***spn_array,
|
||||
+ size_t *num_spns)
|
||||
+{
|
||||
+ ADS_STATUS status;
|
||||
+ LDAPMessage *res = NULL;
|
||||
+ char *dn;
|
||||
+ int count;
|
||||
+
|
||||
+ status = ads_find_machine_acct(ads,
|
||||
+ &res,
|
||||
+ machine_name);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ DEBUG(1,("Host Account for %s not found... skipping operation.\n",
|
||||
+ machine_name));
|
||||
+ return status;
|
||||
+ }
|
||||
+
|
||||
+ count = ads_count_replies(ads, res);
|
||||
+ if (count != 1) {
|
||||
+ status = ADS_ERROR(LDAP_NO_SUCH_OBJECT);
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ dn = ads_get_dn(ads, mem_ctx, res);
|
||||
+ if (dn == NULL) {
|
||||
+ status = ADS_ERROR_LDAP(LDAP_NO_MEMORY);
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ *spn_array = ads_pull_strings(ads,
|
||||
+ mem_ctx,
|
||||
+ res,
|
||||
+ "servicePrincipalName",
|
||||
+ num_spns);
|
||||
+
|
||||
+done:
|
||||
+ ads_msgfree(ads, res);
|
||||
+
|
||||
+ return status;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* This adds a service principal name to an existing computer account
|
||||
* (found by hostname) in AD.
|
||||
* @param ads An initialized ADS_STRUCT
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
||||
From ed3b6536e1027a26d7983942f62677aa2bc0e93c Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Wed, 24 Sep 2014 09:23:58 +0200
|
||||
Subject: [PATCH 2/4] s3-libads: Add function to search for an element in an
|
||||
array.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9984
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Guenther Deschner <gd@samba.org>
|
||||
(cherry picked from commit e1ee4c8bc7018db7787dd9a0be6d3aa40a477ee2)
|
||||
---
|
||||
source3/libads/ads_proto.h | 2 ++
|
||||
source3/libads/ldap.c | 31 +++++++++++++++++++++++++++++++
|
||||
2 files changed, 33 insertions(+)
|
||||
|
||||
diff --git a/source3/libads/ads_proto.h b/source3/libads/ads_proto.h
|
||||
index 6a22807..1e34247 100644
|
||||
--- a/source3/libads/ads_proto.h
|
||||
+++ b/source3/libads/ads_proto.h
|
||||
@@ -88,6 +88,8 @@ ADS_STATUS ads_add_strlist(TALLOC_CTX *ctx, ADS_MODLIST *mods,
|
||||
uint32 ads_get_kvno(ADS_STRUCT *ads, const char *account_name);
|
||||
uint32_t ads_get_machine_kvno(ADS_STRUCT *ads, const char *machine_name);
|
||||
|
||||
+bool ads_element_in_array(const char **el_array, size_t num_el, const char *el);
|
||||
+
|
||||
ADS_STATUS ads_get_service_principal_names(TALLOC_CTX *mem_ctx,
|
||||
ADS_STRUCT *ads,
|
||||
const char *machine_name,
|
||||
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
|
||||
index 51a0883..8d104c2 100644
|
||||
--- a/source3/libads/ldap.c
|
||||
+++ b/source3/libads/ldap.c
|
||||
@@ -1927,6 +1927,37 @@ ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machin
|
||||
}
|
||||
|
||||
/**
|
||||
+ * @brief Search for an element in a string array.
|
||||
+ *
|
||||
+ * @param[in] el_array The string array to search.
|
||||
+ *
|
||||
+ * @param[in] num_el The number of elements in the string array.
|
||||
+ *
|
||||
+ * @param[in] el The string to search.
|
||||
+ *
|
||||
+ * @return True if found, false if not.
|
||||
+ */
|
||||
+bool ads_element_in_array(const char **el_array, size_t num_el, const char *el)
|
||||
+{
|
||||
+ size_t i;
|
||||
+
|
||||
+ if (el_array == NULL || num_el == 0 || el == NULL) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ for (i = 0; i < num_el && el_array[i] != NULL; i++) {
|
||||
+ int cmp;
|
||||
+
|
||||
+ cmp = strcasecmp_m(el_array[i], el);
|
||||
+ if (cmp == 0) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
* @brief This gets the service principal names of an existing computer account.
|
||||
*
|
||||
* @param[in] mem_ctx The memory context to use to allocate the spn array.
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
||||
From 11700f1398d6197a99c686f1a43b45d6305ceae8 Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Fri, 26 Sep 2014 03:09:08 +0200
|
||||
Subject: [PATCH 3/4] s3-libnet: Add libnet_join_get_machine_spns().
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9984
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Guenther Deschner <gd@samba.org>
|
||||
(cherry picked from commit 7e0b8fcce5572c88d50993a1dbd90f65638ba90f)
|
||||
---
|
||||
source3/libnet/libnet_join.c | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
|
||||
index 1418385..3611cc7 100644
|
||||
--- a/source3/libnet/libnet_join.c
|
||||
+++ b/source3/libnet/libnet_join.c
|
||||
@@ -358,6 +358,26 @@ static ADS_STATUS libnet_join_find_machine_acct(TALLOC_CTX *mem_ctx,
|
||||
return status;
|
||||
}
|
||||
|
||||
+static ADS_STATUS libnet_join_get_machine_spns(TALLOC_CTX *mem_ctx,
|
||||
+ struct libnet_JoinCtx *r,
|
||||
+ char ***spn_array,
|
||||
+ size_t *num_spns)
|
||||
+{
|
||||
+ ADS_STATUS status;
|
||||
+
|
||||
+ if (r->in.machine_name == NULL) {
|
||||
+ return ADS_ERROR_SYSTEM(EINVAL);
|
||||
+ }
|
||||
+
|
||||
+ status = ads_get_service_principal_names(mem_ctx,
|
||||
+ r->in.ads,
|
||||
+ r->in.machine_name,
|
||||
+ spn_array,
|
||||
+ num_spns);
|
||||
+
|
||||
+ return status;
|
||||
+}
|
||||
+
|
||||
/****************************************************************
|
||||
Set a machines dNSHostName and servicePrincipalName attributes
|
||||
****************************************************************/
|
||||
--
|
||||
2.1.0
|
||||
|
||||
|
||||
From 472256e27ad5cb5e7657efaece71744269ca8d16 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Fri, 26 Sep 2014 03:35:43 +0200
|
||||
Subject: [PATCH 4/4] s3-libnet: Make sure we do not overwrite precreated SPNs.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9984
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
|
||||
Autobuild-User(master): Günther Deschner <gd@samba.org>
|
||||
Autobuild-Date(master): Fri Sep 26 08:22:45 CEST 2014 on sn-devel-104
|
||||
|
||||
(cherry picked from commit 0aacbe78bb40d76b65087c2a197c92b0101e625e)
|
||||
---
|
||||
source3/libnet/libnet_join.c | 39 ++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 36 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
|
||||
index 3611cc7..aa7b5cb 100644
|
||||
--- a/source3/libnet/libnet_join.c
|
||||
+++ b/source3/libnet/libnet_join.c
|
||||
@@ -388,8 +388,10 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
|
||||
ADS_STATUS status;
|
||||
ADS_MODLIST mods;
|
||||
fstring my_fqdn;
|
||||
- const char *spn_array[3] = {NULL, NULL, NULL};
|
||||
+ const char **spn_array = NULL;
|
||||
+ size_t num_spns = 0;
|
||||
char *spn = NULL;
|
||||
+ bool ok;
|
||||
|
||||
/* Find our DN */
|
||||
|
||||
@@ -398,6 +400,14 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
|
||||
return status;
|
||||
}
|
||||
|
||||
+ status = libnet_join_get_machine_spns(mem_ctx,
|
||||
+ r,
|
||||
+ discard_const_p(char **, &spn_array),
|
||||
+ &num_spns);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ DEBUG(5, ("Retrieving the servicePrincipalNames failed.\n"));
|
||||
+ }
|
||||
+
|
||||
/* Windows only creates HOST/shortname & HOST/fqdn. */
|
||||
|
||||
spn = talloc_asprintf(mem_ctx, "HOST/%s", r->in.machine_name);
|
||||
@@ -407,7 +417,15 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
|
||||
if (!strupper_m(spn)) {
|
||||
return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
|
||||
}
|
||||
- spn_array[0] = spn;
|
||||
+
|
||||
+ ok = ads_element_in_array(spn_array, num_spns, spn);
|
||||
+ if (!ok) {
|
||||
+ ok = add_string_to_array(spn_array, spn,
|
||||
+ &spn_array, (int *)&num_spns);
|
||||
+ if (!ok) {
|
||||
+ return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if (!name_to_fqdn(my_fqdn, r->in.machine_name)
|
||||
|| (strchr(my_fqdn, '.') == NULL)) {
|
||||
@@ -424,8 +442,23 @@ static ADS_STATUS libnet_join_set_machine_spn(TALLOC_CTX *mem_ctx,
|
||||
if (!spn) {
|
||||
return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
|
||||
}
|
||||
- spn_array[1] = spn;
|
||||
+
|
||||
+ ok = ads_element_in_array(spn_array, num_spns, spn);
|
||||
+ if (!ok) {
|
||||
+ ok = add_string_to_array(spn_array, spn,
|
||||
+ &spn_array, (int *)&num_spns);
|
||||
+ if (!ok) {
|
||||
+ return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* make sure to NULL terminate the array */
|
||||
+ spn_array = talloc_realloc(mem_ctx, spn_array, const char *, num_spns + 1);
|
||||
+ if (spn_array == NULL) {
|
||||
+ return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
|
||||
}
|
||||
+ spn_array[num_spns] = NULL;
|
||||
|
||||
mods = ads_init_mods(mem_ctx);
|
||||
if (!mods) {
|
||||
--
|
||||
2.1.0
|
||||
|
||||
-159
@@ -1,159 +0,0 @@
|
||||
From 3516236ec6eb42f29eda42542b109fa10217e68c Mon Sep 17 00:00:00 2001
|
||||
From: Andreas Schneider <asn@samba.org>
|
||||
Date: Wed, 24 Sep 2014 10:51:33 +0200
|
||||
Subject: [PATCH] s3-libads: Add all machine account principals to the keytab.
|
||||
|
||||
This adds all SPNs defined in the DC for the computer account to the
|
||||
keytab using 'net ads keytab create -P'.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=9985
|
||||
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Guenther Deschner <gd@samba.org>
|
||||
(cherry picked from commit 5d58b92f8fcbc509f4fe2bd3617bcaeada1806b6)
|
||||
---
|
||||
source3/libads/kerberos_keytab.c | 74 ++++++++++++++++++++++++++++------------
|
||||
1 file changed, 52 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/source3/libads/kerberos_keytab.c b/source3/libads/kerberos_keytab.c
|
||||
index 83df088..d13625b 100644
|
||||
--- a/source3/libads/kerberos_keytab.c
|
||||
+++ b/source3/libads/kerberos_keytab.c
|
||||
@@ -507,20 +507,57 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
|
||||
krb5_kt_cursor cursor;
|
||||
krb5_keytab_entry kt_entry;
|
||||
krb5_kvno kvno;
|
||||
- int i, found = 0;
|
||||
+ size_t found = 0;
|
||||
char *sam_account_name, *upn;
|
||||
char **oldEntries = NULL, *princ_s[26];
|
||||
- TALLOC_CTX *tmpctx = NULL;
|
||||
+ TALLOC_CTX *frame;
|
||||
char *machine_name;
|
||||
+ char **spn_array;
|
||||
+ size_t num_spns;
|
||||
+ size_t i;
|
||||
+ ADS_STATUS status;
|
||||
|
||||
- /* these are the main ones we need */
|
||||
- ret = ads_keytab_add_entry(ads, "host");
|
||||
- if (ret != 0) {
|
||||
- DEBUG(1, (__location__ ": ads_keytab_add_entry failed while "
|
||||
- "adding 'host' principal.\n"));
|
||||
- return ret;
|
||||
+ frame = talloc_stackframe();
|
||||
+ if (frame == NULL) {
|
||||
+ ret = -1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_get_service_principal_names(frame,
|
||||
+ ads,
|
||||
+ lp_netbios_name(),
|
||||
+ &spn_array,
|
||||
+ &num_spns);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ ret = -1;
|
||||
+ goto done;
|
||||
}
|
||||
|
||||
+ for (i = 0; i < num_spns; i++) {
|
||||
+ char *srv_princ;
|
||||
+ char *p;
|
||||
+
|
||||
+ srv_princ = strlower_talloc(frame, spn_array[i]);
|
||||
+ if (srv_princ == NULL) {
|
||||
+ ret = -1;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ p = strchr_m(srv_princ, '/');
|
||||
+ if (p == NULL) {
|
||||
+ continue;
|
||||
+ }
|
||||
+ p[0] = '\0';
|
||||
+
|
||||
+ /* Add the SPNs found on the DC */
|
||||
+ ret = ads_keytab_add_entry(ads, srv_princ);
|
||||
+ if (ret != 0) {
|
||||
+ DEBUG(1, ("ads_keytab_add_entry failed while "
|
||||
+ "adding '%s' principal.\n",
|
||||
+ spn_array[i]));
|
||||
+ goto done;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
#if 0 /* don't create the CIFS/... keytab entries since no one except smbd
|
||||
really needs them and we will fall back to verifying against
|
||||
@@ -543,24 +580,17 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
|
||||
if (ret) {
|
||||
DEBUG(1, (__location__ ": could not krb5_init_context: %s\n",
|
||||
error_message(ret)));
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- tmpctx = talloc_init(__location__);
|
||||
- if (!tmpctx) {
|
||||
- DEBUG(0, (__location__ ": talloc_init() failed!\n"));
|
||||
- ret = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
- machine_name = talloc_strdup(tmpctx, lp_netbios_name());
|
||||
+ machine_name = talloc_strdup(frame, lp_netbios_name());
|
||||
if (!machine_name) {
|
||||
ret = -1;
|
||||
goto done;
|
||||
}
|
||||
|
||||
/* now add the userPrincipalName and sAMAccountName entries */
|
||||
- sam_account_name = ads_get_samaccountname(ads, tmpctx, machine_name);
|
||||
+ sam_account_name = ads_get_samaccountname(ads, frame, machine_name);
|
||||
if (!sam_account_name) {
|
||||
DEBUG(0, (__location__ ": unable to determine machine "
|
||||
"account's name in AD!\n"));
|
||||
@@ -584,7 +614,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
|
||||
}
|
||||
|
||||
/* remember that not every machine account will have a upn */
|
||||
- upn = ads_get_upn(ads, tmpctx, machine_name);
|
||||
+ upn = ads_get_upn(ads, frame, machine_name);
|
||||
if (upn) {
|
||||
ret = ads_keytab_add_entry(ads, upn);
|
||||
if (ret != 0) {
|
||||
@@ -596,7 +626,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
|
||||
|
||||
/* Now loop through the keytab and update any other existing entries */
|
||||
kvno = (krb5_kvno)ads_get_machine_kvno(ads, machine_name);
|
||||
- if (kvno == -1) {
|
||||
+ if (kvno == (krb5_kvno)-1) {
|
||||
DEBUG(1, (__location__ ": ads_get_machine_kvno() failed to "
|
||||
"determine the system's kvno.\n"));
|
||||
goto done;
|
||||
@@ -629,12 +659,12 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
|
||||
* have a race condition where someone else could add entries after
|
||||
* we've counted them. Re-open asap to minimise the race. JRA.
|
||||
*/
|
||||
- DEBUG(3, (__location__ ": Found %d entries in the keytab.\n", found));
|
||||
+ DEBUG(3, (__location__ ": Found %zd entries in the keytab.\n", found));
|
||||
if (!found) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
- oldEntries = talloc_array(tmpctx, char *, found);
|
||||
+ oldEntries = talloc_array(frame, char *, found);
|
||||
if (!oldEntries) {
|
||||
DEBUG(1, (__location__ ": Failed to allocate space to store "
|
||||
"the old keytab entries (talloc failed?).\n"));
|
||||
@@ -708,7 +738,7 @@ int ads_keytab_create_default(ADS_STRUCT *ads)
|
||||
|
||||
done:
|
||||
TALLOC_FREE(oldEntries);
|
||||
- TALLOC_FREE(tmpctx);
|
||||
+ TALLOC_FREE(frame);
|
||||
|
||||
{
|
||||
krb5_keytab_entry zero_kt_entry;
|
||||
--
|
||||
2.1.0
|
||||
|
||||
@@ -1,988 +0,0 @@
|
||||
From cbef7b5e10f4477d9f2e648ac6c654eef1165b82 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Wed, 24 Sep 2014 22:16:20 +0200
|
||||
Subject: [PATCH 1/4] s3-net: add "net ads enctypes {list,set,delete}".
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Stefan Metzmacher <metze@samba.org>
|
||||
---
|
||||
source3/utils/net_ads.c | 308 ++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 308 insertions(+)
|
||||
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index 8b8e719..5f18bf4 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -2860,6 +2860,306 @@ int net_ads_kerberos(struct net_context *c, int argc, const char **argv)
|
||||
return net_run_function(c, argc, argv, "net ads kerberos", func);
|
||||
}
|
||||
|
||||
+static int net_ads_enctype_lookup_account(struct net_context *c,
|
||||
+ ADS_STRUCT *ads,
|
||||
+ const char *account,
|
||||
+ LDAPMessage **res,
|
||||
+ const char **enctype_str)
|
||||
+{
|
||||
+ const char *filter;
|
||||
+ const char *attrs[] = {
|
||||
+ "msDS-SupportedEncryptionTypes",
|
||||
+ NULL
|
||||
+ };
|
||||
+ int count;
|
||||
+ int ret = -1;
|
||||
+ ADS_STATUS status;
|
||||
+
|
||||
+ filter = talloc_asprintf(c, "(&(objectclass=user)(sAMAccountName=%s))",
|
||||
+ account);
|
||||
+ if (filter == NULL) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_search(ads, res, filter, attrs);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ d_printf(_("no account found with filter: %s\n"), filter);
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ count = ads_count_replies(ads, *res);
|
||||
+ switch (count) {
|
||||
+ case 1:
|
||||
+ break;
|
||||
+ case 0:
|
||||
+ d_printf(_("no account found with filter: %s\n"), filter);
|
||||
+ goto done;
|
||||
+ default:
|
||||
+ d_printf(_("multiple accounts found with filter: %s\n"), filter);
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ if (enctype_str) {
|
||||
+ *enctype_str = ads_pull_string(ads, c, *res,
|
||||
+ "msDS-SupportedEncryptionTypes");
|
||||
+ if (*enctype_str == NULL) {
|
||||
+ d_printf(_("no msDS-SupportedEncryptionTypes attribute found\n"));
|
||||
+ goto done;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+ done:
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static void net_ads_enctype_dump_enctypes(const char *username,
|
||||
+ const char *enctype_str)
|
||||
+{
|
||||
+ int enctypes;
|
||||
+
|
||||
+ d_printf(_("'%s' uses \"msDS-SupportedEncryptionTypes\":\n"), username);
|
||||
+
|
||||
+ enctypes = atoi(enctype_str);
|
||||
+
|
||||
+ printf("[%s] 0x%08x DES-CBC-CRC\n",
|
||||
+ enctypes & ENC_CRC32 ? "X" : " ",
|
||||
+ ENC_CRC32);
|
||||
+ printf("[%s] 0x%08x DES-CBC-MD5\n",
|
||||
+ enctypes & ENC_RSA_MD5 ? "X" : " ",
|
||||
+ ENC_RSA_MD5);
|
||||
+ printf("[%s] 0x%08x RC4-HMAC\n",
|
||||
+ enctypes & ENC_RC4_HMAC_MD5 ? "X" : " ",
|
||||
+ ENC_RC4_HMAC_MD5);
|
||||
+ printf("[%s] 0x%08x AES128-CTS-HMAC-SHA1-96\n",
|
||||
+ enctypes & ENC_HMAC_SHA1_96_AES128 ? "X" : " ",
|
||||
+ ENC_HMAC_SHA1_96_AES128);
|
||||
+ printf("[%s] 0x%08x AES256-CTS-HMAC-SHA1-96\n",
|
||||
+ enctypes & ENC_HMAC_SHA1_96_AES256 ? "X" : " ",
|
||||
+ ENC_HMAC_SHA1_96_AES256);
|
||||
+}
|
||||
+
|
||||
+static int net_ads_enctypes_list(struct net_context *c, int argc, const char **argv)
|
||||
+{
|
||||
+ int ret = -1;
|
||||
+ ADS_STATUS status;
|
||||
+ ADS_STRUCT *ads = NULL;
|
||||
+ LDAPMessage *res = NULL;
|
||||
+ const char *str = NULL;
|
||||
+
|
||||
+ if (c->display_usage || (argc < 1)) {
|
||||
+ d_printf( "%s\n"
|
||||
+ "net ads enctypes list\n"
|
||||
+ " %s\n",
|
||||
+ _("Usage:"),
|
||||
+ _("List supported enctypes"));
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_startup(c, false, &ads);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ printf("startup failed\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = net_ads_enctype_lookup_account(c, ads, argv[0], &res, &str);
|
||||
+ if (ret) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ net_ads_enctype_dump_enctypes(argv[0], str);
|
||||
+
|
||||
+ ret = 0;
|
||||
+ done:
|
||||
+ ads_msgfree(ads, res);
|
||||
+ ads_destroy(&ads);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int net_ads_enctypes_set(struct net_context *c, int argc, const char **argv)
|
||||
+{
|
||||
+ int ret = -1;
|
||||
+ ADS_STATUS status;
|
||||
+ ADS_STRUCT *ads;
|
||||
+ LDAPMessage *res = NULL;
|
||||
+ const char *etype_list_str;
|
||||
+ const char *dn;
|
||||
+ ADS_MODLIST mods;
|
||||
+ uint32_t etype_list;
|
||||
+ const char *str;
|
||||
+
|
||||
+ if (c->display_usage || argc < 1) {
|
||||
+ d_printf( "%s\n"
|
||||
+ "net ads enctypes set <sAMAccountName> [enctypes]\n"
|
||||
+ " %s\n",
|
||||
+ _("Usage:"),
|
||||
+ _("Set supported enctypes"));
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_startup(c, false, &ads);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ printf("startup failed\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = net_ads_enctype_lookup_account(c, ads, argv[0], &res, NULL);
|
||||
+ if (ret) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ dn = ads_get_dn(ads, c, res);
|
||||
+ if (dn == NULL) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ etype_list = ENC_CRC32 | ENC_RSA_MD5 | ENC_RC4_HMAC_MD5;
|
||||
+#ifdef HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96
|
||||
+ etype_list |= ENC_HMAC_SHA1_96_AES128;
|
||||
+#endif
|
||||
+#ifdef HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96
|
||||
+ etype_list |= ENC_HMAC_SHA1_96_AES256;
|
||||
+#endif
|
||||
+
|
||||
+ if (argv[1] != NULL) {
|
||||
+ sscanf(argv[1], "%i", &etype_list);
|
||||
+ }
|
||||
+
|
||||
+ etype_list_str = talloc_asprintf(c, "%d", etype_list);
|
||||
+ if (!etype_list_str) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ mods = ads_init_mods(c);
|
||||
+ if (!mods) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_mod_str(c, &mods, "msDS-SupportedEncryptionTypes",
|
||||
+ etype_list_str);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_gen_mod(ads, dn, mods);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ d_printf(_("failed to add msDS-SupportedEncryptionTypes: %s\n"),
|
||||
+ ads_errstr(status));
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ads_msgfree(ads, res);
|
||||
+
|
||||
+ ret = net_ads_enctype_lookup_account(c, ads, argv[0], &res, &str);
|
||||
+ if (ret) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ net_ads_enctype_dump_enctypes(argv[0], str);
|
||||
+
|
||||
+ ret = 0;
|
||||
+ done:
|
||||
+ ads_msgfree(ads, res);
|
||||
+ ads_destroy(&ads);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int net_ads_enctypes_delete(struct net_context *c, int argc, const char **argv)
|
||||
+{
|
||||
+ int ret = -1;
|
||||
+ ADS_STATUS status;
|
||||
+ ADS_STRUCT *ads;
|
||||
+ LDAPMessage *res = NULL;
|
||||
+ const char *dn;
|
||||
+ ADS_MODLIST mods;
|
||||
+
|
||||
+ if (c->display_usage || argc < 1) {
|
||||
+ d_printf( "%s\n"
|
||||
+ "net ads enctypes delete <sAMAccountName>\n"
|
||||
+ " %s\n",
|
||||
+ _("Usage:"),
|
||||
+ _("Delete supported enctypes"));
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_startup(c, false, &ads);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ printf("startup failed\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ ret = net_ads_enctype_lookup_account(c, ads, argv[0], &res, NULL);
|
||||
+ if (ret) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ dn = ads_get_dn(ads, c, res);
|
||||
+ if (dn == NULL) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ mods = ads_init_mods(c);
|
||||
+ if (!mods) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_mod_str(c, &mods, "msDS-SupportedEncryptionTypes", NULL);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ status = ads_gen_mod(ads, dn, mods);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ d_printf(_("failed to remove msDS-SupportedEncryptionTypes: %s\n"),
|
||||
+ ads_errstr(status));
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = 0;
|
||||
+
|
||||
+ done:
|
||||
+ ads_msgfree(ads, res);
|
||||
+ ads_destroy(&ads);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static int net_ads_enctypes(struct net_context *c, int argc, const char **argv)
|
||||
+{
|
||||
+ struct functable func[] = {
|
||||
+ {
|
||||
+ "list",
|
||||
+ net_ads_enctypes_list,
|
||||
+ NET_TRANSPORT_ADS,
|
||||
+ N_("List the supported encryption types"),
|
||||
+ N_("net ads enctypes list\n"
|
||||
+ " List the supported encryption types")
|
||||
+ },
|
||||
+ {
|
||||
+ "set",
|
||||
+ net_ads_enctypes_set,
|
||||
+ NET_TRANSPORT_ADS,
|
||||
+ N_("Set the supported encryption types"),
|
||||
+ N_("net ads enctypes set\n"
|
||||
+ " Set the supported encryption types")
|
||||
+ },
|
||||
+ {
|
||||
+ "delete",
|
||||
+ net_ads_enctypes_delete,
|
||||
+ NET_TRANSPORT_ADS,
|
||||
+ N_("Delete the supported encryption types"),
|
||||
+ N_("net ads enctypes delete\n"
|
||||
+ " Delete the supported encryption types")
|
||||
+ },
|
||||
+
|
||||
+ {NULL, NULL, 0, NULL, NULL}
|
||||
+ };
|
||||
+
|
||||
+ return net_run_function(c, argc, argv, "net ads enctypes", func);
|
||||
+}
|
||||
+
|
||||
+
|
||||
int net_ads(struct net_context *c, int argc, const char **argv)
|
||||
{
|
||||
struct functable func[] = {
|
||||
@@ -3015,6 +3315,14 @@ int net_ads(struct net_context *c, int argc, const char **argv)
|
||||
N_("net ads kerberos\n"
|
||||
" Manage kerberos keytab")
|
||||
},
|
||||
+ {
|
||||
+ "enctypes",
|
||||
+ net_ads_enctypes,
|
||||
+ NET_TRANSPORT_ADS,
|
||||
+ N_("List/modify supported encryption types"),
|
||||
+ N_("net ads enctypes\n"
|
||||
+ " List/modify enctypes")
|
||||
+ },
|
||||
{NULL, NULL, 0, NULL, NULL}
|
||||
};
|
||||
|
||||
--
|
||||
1.9.3
|
||||
|
||||
|
||||
From a19f1e51bd7d48b238ad22ec9e27af53dfa5bf44 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Wed, 24 Sep 2014 23:36:19 +0200
|
||||
Subject: [PATCH 2/4] s3-net: add manpage documentation for "net ads enctypes".
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Stefan Metzmacher <metze@samba.org>
|
||||
---
|
||||
docs-xml/manpages/net.8.xml | 53 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 53 insertions(+)
|
||||
|
||||
diff --git a/docs-xml/manpages/net.8.xml b/docs-xml/manpages/net.8.xml
|
||||
index f39b420..9e982e3 100644
|
||||
--- a/docs-xml/manpages/net.8.xml
|
||||
+++ b/docs-xml/manpages/net.8.xml
|
||||
@@ -1339,6 +1339,59 @@ to show in the result.
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
+ <title>ADS ENCTYPES</title>
|
||||
+
|
||||
+<para>
|
||||
+ List, modify or delete the value of the "msDS-SupportedEncryptionTypes" attribute of an account in AD.
|
||||
+</para>
|
||||
+
|
||||
+<para>
|
||||
+ This attribute allows to control which Kerberos encryption types are used for the generation of initial and service tickets. The value consists of an integer bitmask with the following values:
|
||||
+</para>
|
||||
+
|
||||
+<para>0x00000001 DES-CBC-CRC</para>
|
||||
+<para>0x00000002 DES-CBC-MD5</para>
|
||||
+<para>0x00000004 RC4-HMAC</para>
|
||||
+<para>0x00000008 AES128-CTS-HMAC-SHA1-96</para>
|
||||
+<para>0x00000010 AES256-CTS-HMAC-SHA1-96</para>
|
||||
+
|
||||
+</refsect2>
|
||||
+
|
||||
+<refsect2>
|
||||
+ <title>ADS ENCTYPES LIST <replaceable><ACCOUNTNAME></replaceable></title>
|
||||
+
|
||||
+<para>
|
||||
+ List the value of the "msDS-SupportedEncryptionTypes" attribute of a given account.
|
||||
+</para>
|
||||
+
|
||||
+<para>Example: <userinput>net ads enctypes list Computername</userinput></para>
|
||||
+
|
||||
+</refsect2>
|
||||
+
|
||||
+<refsect2>
|
||||
+ <title>ADS ENCTYPES SET <replaceable><ACCOUNTNAME></replaceable> <replaceable>[enctypes]</replaceable></title>
|
||||
+
|
||||
+<para>
|
||||
+ Set the value of the "msDS-SupportedEncryptionTypes" attribute of the LDAP object of ACCOUNTNAME to a given value. If the value is ommitted, the value is set to 31 which enables all the currently supported encryption types.
|
||||
+</para>
|
||||
+
|
||||
+<para>Example: <userinput>net ads enctypes set Computername 24</userinput></para>
|
||||
+
|
||||
+</refsect2>
|
||||
+
|
||||
+<refsect2>
|
||||
+ <title>ADS ENCTYPES DELETE <replaceable><ACCOUNTNAME></replaceable></title>
|
||||
+
|
||||
+<para>
|
||||
+ Deletes the "msDS-SupportedEncryptionTypes" attribute of the LDAP object of ACCOUNTNAME.
|
||||
+</para>
|
||||
+
|
||||
+<para>Example: <userinput>net ads enctypes set Computername 24</userinput></para>
|
||||
+
|
||||
+</refsect2>
|
||||
+
|
||||
+
|
||||
+<refsect2>
|
||||
<title>SAM CREATEBUILTINGROUP <NAME></title>
|
||||
|
||||
<para>
|
||||
--
|
||||
1.9.3
|
||||
|
||||
|
||||
From 0f42d123afde57ee74d89bdc742185cef718cf0f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Fri, 23 Nov 2012 12:34:27 +0100
|
||||
Subject: [PATCH 3/4] s3-libnet: set list of allowed krb5 encryption types in
|
||||
AD >= 2008.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
Reviewed-by: Stefan Metzmacher <metze@samba.org>
|
||||
---
|
||||
source3/libnet/libnet_join.c | 65 ++++++++++++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 65 insertions(+)
|
||||
|
||||
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
|
||||
index 381a59c..e70e11a 100644
|
||||
--- a/source3/libnet/libnet_join.c
|
||||
+++ b/source3/libnet/libnet_join.c
|
||||
@@ -605,6 +605,52 @@ static ADS_STATUS libnet_join_set_os_attributes(TALLOC_CTX *mem_ctx,
|
||||
/****************************************************************
|
||||
****************************************************************/
|
||||
|
||||
+static ADS_STATUS libnet_join_set_etypes(TALLOC_CTX *mem_ctx,
|
||||
+ struct libnet_JoinCtx *r)
|
||||
+{
|
||||
+ ADS_STATUS status;
|
||||
+ ADS_MODLIST mods;
|
||||
+ uint32_t etype_list = ENC_CRC32 | ENC_RSA_MD5 | ENC_RC4_HMAC_MD5;
|
||||
+ const char *etype_list_str;
|
||||
+
|
||||
+#ifdef HAVE_ENCTYPE_AES128_CTS_HMAC_SHA1_96
|
||||
+ etype_list |= ENC_HMAC_SHA1_96_AES128;
|
||||
+#endif
|
||||
+#ifdef HAVE_ENCTYPE_AES256_CTS_HMAC_SHA1_96
|
||||
+ etype_list |= ENC_HMAC_SHA1_96_AES256;
|
||||
+#endif
|
||||
+
|
||||
+ etype_list_str = talloc_asprintf(mem_ctx, "%d", etype_list);
|
||||
+ if (!etype_list_str) {
|
||||
+ return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ }
|
||||
+
|
||||
+ /* Find our DN */
|
||||
+
|
||||
+ status = libnet_join_find_machine_acct(mem_ctx, r);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ return status;
|
||||
+ }
|
||||
+
|
||||
+ /* now do the mods */
|
||||
+
|
||||
+ mods = ads_init_mods(mem_ctx);
|
||||
+ if (!mods) {
|
||||
+ return ADS_ERROR(LDAP_NO_MEMORY);
|
||||
+ }
|
||||
+
|
||||
+ status = ads_mod_str(mem_ctx, &mods, "msDS-SupportedEncryptionTypes",
|
||||
+ etype_list_str);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ return status;
|
||||
+ }
|
||||
+
|
||||
+ return ads_gen_mod(r->in.ads, r->out.dn, mods);
|
||||
+}
|
||||
+
|
||||
+/****************************************************************
|
||||
+****************************************************************/
|
||||
+
|
||||
static bool libnet_join_create_keytab(TALLOC_CTX *mem_ctx,
|
||||
struct libnet_JoinCtx *r)
|
||||
{
|
||||
@@ -679,6 +725,7 @@ static ADS_STATUS libnet_join_post_processing_ads(TALLOC_CTX *mem_ctx,
|
||||
struct libnet_JoinCtx *r)
|
||||
{
|
||||
ADS_STATUS status;
|
||||
+ uint32_t func_level = 0;
|
||||
|
||||
if (!r->in.ads) {
|
||||
status = libnet_join_connect_ads(mem_ctx, r);
|
||||
@@ -713,6 +760,24 @@ static ADS_STATUS libnet_join_post_processing_ads(TALLOC_CTX *mem_ctx,
|
||||
return status;
|
||||
}
|
||||
|
||||
+ status = ads_domain_func_level(r->in.ads, &func_level);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ libnet_join_set_error_string(mem_ctx, r,
|
||||
+ "failed to query domain controller functional level: %s",
|
||||
+ ads_errstr(status));
|
||||
+ return status;
|
||||
+ }
|
||||
+
|
||||
+ if (func_level >= DS_DOMAIN_FUNCTION_2008) {
|
||||
+ status = libnet_join_set_etypes(mem_ctx, r);
|
||||
+ if (!ADS_ERR_OK(status)) {
|
||||
+ libnet_join_set_error_string(mem_ctx, r,
|
||||
+ "failed to set machine kerberos encryption types: %s",
|
||||
+ ads_errstr(status));
|
||||
+ return status;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (!libnet_join_derive_salting_principal(mem_ctx, r)) {
|
||||
return ADS_ERROR_NT(NT_STATUS_UNSUCCESSFUL);
|
||||
}
|
||||
--
|
||||
1.9.3
|
||||
|
||||
|
||||
From adb206481ac56c8f438e70f7b9e986aeba9586b1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Fri, 26 Sep 2014 21:06:38 +0200
|
||||
Subject: [PATCH 4/4] s4-auth/kerberos: fix salting principal, make sure
|
||||
hostname is lowercase.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Found at MS interop event while working on AES kerberos key support.
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
|
||||
---
|
||||
source4/auth/kerberos/srv_keytab.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/source4/auth/kerberos/srv_keytab.c b/source4/auth/kerberos/srv_keytab.c
|
||||
index d81e27d..3baba14 100644
|
||||
--- a/source4/auth/kerberos/srv_keytab.c
|
||||
+++ b/source4/auth/kerberos/srv_keytab.c
|
||||
@@ -143,7 +143,7 @@ static krb5_error_code salt_principal(TALLOC_CTX *parent_ctx,
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
- machine_username = talloc_strdup(tmp_ctx, samAccountName);
|
||||
+ machine_username = strlower_talloc(tmp_ctx, samAccountName);
|
||||
if (!machine_username) {
|
||||
*error_string = "Cannot duplicate samAccountName";
|
||||
talloc_free(tmp_ctx);
|
||||
--
|
||||
1.9.3
|
||||
|
||||
From d423e8b759af2e0a7cdce39d3f7a6c8d9c1764b4 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Allison <jra@samba.org>
|
||||
Date: Mon, 16 Jun 2014 22:49:29 -0700
|
||||
Subject: [PATCH 1/5] s3: auth: Add some const to the struct netr_SamInfo3 *
|
||||
arguments of copy_netr_SamInfo3() and make_server_info_info3()
|
||||
|
||||
Both functions only read from the struct netr_SamInfo3 * argument.
|
||||
|
||||
Signed-off-by: Jeremy Allison <jra@samba.org>
|
||||
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
|
||||
Reviewed-by: Simo Sorce <idra@samba.org>
|
||||
|
||||
Conflicts:
|
||||
source3/auth/proto.h
|
||||
source3/auth/server_info.c
|
||||
---
|
||||
source3/auth/auth_util.c | 2 +-
|
||||
source3/auth/proto.h | 4 ++--
|
||||
source3/auth/server_info.c | 2 +-
|
||||
3 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c
|
||||
index ceaa706..afa78ec 100644
|
||||
--- a/source3/auth/auth_util.c
|
||||
+++ b/source3/auth/auth_util.c
|
||||
@@ -1369,7 +1369,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
|
||||
const char *sent_nt_username,
|
||||
const char *domain,
|
||||
struct auth_serversupplied_info **server_info,
|
||||
- struct netr_SamInfo3 *info3)
|
||||
+ const struct netr_SamInfo3 *info3)
|
||||
{
|
||||
static const char zeros[16] = {0, };
|
||||
|
||||
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
|
||||
index 76661fc..6ec206e 100644
|
||||
--- a/source3/auth/proto.h
|
||||
+++ b/source3/auth/proto.h
|
||||
@@ -232,7 +232,7 @@ NTSTATUS make_server_info_info3(TALLOC_CTX *mem_ctx,
|
||||
const char *sent_nt_username,
|
||||
const char *domain,
|
||||
struct auth_serversupplied_info **server_info,
|
||||
- struct netr_SamInfo3 *info3);
|
||||
+ const struct netr_SamInfo3 *info3);
|
||||
struct wbcAuthUserInfo;
|
||||
NTSTATUS make_server_info_wbcAuthUserInfo(TALLOC_CTX *mem_ctx,
|
||||
const char *sent_nt_username,
|
||||
@@ -287,7 +287,7 @@ NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx,
|
||||
const struct passwd *pwd,
|
||||
struct netr_SamInfo3 **pinfo3);
|
||||
struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx,
|
||||
- struct netr_SamInfo3 *orig);
|
||||
+ const struct netr_SamInfo3 *orig);
|
||||
struct netr_SamInfo3 *wbcAuthUserInfo_to_netr_SamInfo3(TALLOC_CTX *mem_ctx,
|
||||
const struct wbcAuthUserInfo *info);
|
||||
|
||||
diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
|
||||
index d2b7d6e..066b9a8 100644
|
||||
--- a/source3/auth/server_info.c
|
||||
+++ b/source3/auth/server_info.c
|
||||
@@ -445,7 +445,7 @@ NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx,
|
||||
} } while(0)
|
||||
|
||||
struct netr_SamInfo3 *copy_netr_SamInfo3(TALLOC_CTX *mem_ctx,
|
||||
- struct netr_SamInfo3 *orig)
|
||||
+ const struct netr_SamInfo3 *orig)
|
||||
{
|
||||
struct netr_SamInfo3 *info3;
|
||||
unsigned int i;
|
||||
--
|
||||
1.9.3
|
||||
|
||||
|
||||
From cab0cda9df0bb0eda2d7957c0bb8dbcb51ba7ef7 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Allison <jra@samba.org>
|
||||
Date: Mon, 16 Jun 2014 22:54:45 -0700
|
||||
Subject: [PATCH 2/5] s3: auth: Change make_server_info_info3() to take a const
|
||||
struct netr_SamInfo3 pointer instead of a struct PAC_LOGON_INFO.
|
||||
|
||||
make_server_info_info3() only reads from the info3 pointer.
|
||||
|
||||
Signed-off-by: Jeremy Allison <jra@samba.org>
|
||||
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
|
||||
Reviewed-by: Simo Sorce <idra@samba.org>
|
||||
---
|
||||
source3/auth/auth_generic.c | 2 +-
|
||||
source3/auth/proto.h | 2 +-
|
||||
source3/auth/user_krb5.c | 8 ++++----
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c
|
||||
index a2ba4e3..2880bc9 100644
|
||||
--- a/source3/auth/auth_generic.c
|
||||
+++ b/source3/auth/auth_generic.c
|
||||
@@ -112,7 +112,7 @@ static NTSTATUS auth3_generate_session_info_pac(struct auth4_context *auth_ctx,
|
||||
|
||||
status = make_session_info_krb5(mem_ctx,
|
||||
ntuser, ntdomain, username, pw,
|
||||
- logon_info, is_guest, is_mapped, NULL /* No session key for now, caller will sort it out */,
|
||||
+ &logon_info->info3, is_guest, is_mapped, NULL /* No session key for now, caller will sort it out */,
|
||||
session_info);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(1, ("Failed to map kerberos pac to server info (%s)\n",
|
||||
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
|
||||
index 6ec206e..75d1097 100644
|
||||
--- a/source3/auth/proto.h
|
||||
+++ b/source3/auth/proto.h
|
||||
@@ -357,7 +357,7 @@ NTSTATUS make_session_info_krb5(TALLOC_CTX *mem_ctx,
|
||||
char *ntdomain,
|
||||
char *username,
|
||||
struct passwd *pw,
|
||||
- struct PAC_LOGON_INFO *logon_info,
|
||||
+ const struct netr_SamInfo3 *info3,
|
||||
bool mapped_to_guest, bool username_was_mapped,
|
||||
DATA_BLOB *session_key,
|
||||
struct auth_session_info **session_info);
|
||||
diff --git a/source3/auth/user_krb5.c b/source3/auth/user_krb5.c
|
||||
index 974a8aa..0a538b4 100644
|
||||
--- a/source3/auth/user_krb5.c
|
||||
+++ b/source3/auth/user_krb5.c
|
||||
@@ -186,7 +186,7 @@ NTSTATUS make_session_info_krb5(TALLOC_CTX *mem_ctx,
|
||||
char *ntdomain,
|
||||
char *username,
|
||||
struct passwd *pw,
|
||||
- struct PAC_LOGON_INFO *logon_info,
|
||||
+ const struct netr_SamInfo3 *info3,
|
||||
bool mapped_to_guest, bool username_was_mapped,
|
||||
DATA_BLOB *session_key,
|
||||
struct auth_session_info **session_info)
|
||||
@@ -202,14 +202,14 @@ NTSTATUS make_session_info_krb5(TALLOC_CTX *mem_ctx,
|
||||
return status;
|
||||
}
|
||||
|
||||
- } else if (logon_info) {
|
||||
+ } else if (info3) {
|
||||
/* pass the unmapped username here since map_username()
|
||||
will be called again in make_server_info_info3() */
|
||||
|
||||
status = make_server_info_info3(mem_ctx,
|
||||
ntuser, ntdomain,
|
||||
&server_info,
|
||||
- &logon_info->info3);
|
||||
+ info3);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(1, ("make_server_info_info3 failed: %s!\n",
|
||||
nt_errstr(status)));
|
||||
@@ -299,7 +299,7 @@ NTSTATUS make_session_info_krb5(TALLOC_CTX *mem_ctx,
|
||||
char *ntdomain,
|
||||
char *username,
|
||||
struct passwd *pw,
|
||||
- struct PAC_LOGON_INFO *logon_info,
|
||||
+ const struct netr_SamInfo3 *info3,
|
||||
bool mapped_to_guest, bool username_was_mapped,
|
||||
DATA_BLOB *session_key,
|
||||
struct auth_session_info **session_info)
|
||||
--
|
||||
1.9.3
|
||||
|
||||
|
||||
From 102335441aaa7967367abcc5690fe7229807546a Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Allison <jra@samba.org>
|
||||
Date: Mon, 16 Jun 2014 23:11:58 -0700
|
||||
Subject: [PATCH 3/5] s3: auth: Add create_info3_from_pac_logon_info() to
|
||||
create a new info3 and merge resource group SIDs into it.
|
||||
|
||||
Originally written by Richard Sharpe Richard Sharpe <realrichardsharpe@gmail.com>.
|
||||
|
||||
Signed-off-by: Jeremy Allison <jra@samba.org>
|
||||
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
|
||||
Reviewed-by: Simo Sorce <idra@samba.org>
|
||||
---
|
||||
source3/auth/proto.h | 3 ++
|
||||
source3/auth/server_info.c | 77 ++++++++++++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 80 insertions(+)
|
||||
|
||||
diff --git a/source3/auth/proto.h b/source3/auth/proto.h
|
||||
index 75d1097..cc51698 100644
|
||||
--- a/source3/auth/proto.h
|
||||
+++ b/source3/auth/proto.h
|
||||
@@ -281,6 +281,9 @@ NTSTATUS serverinfo_to_SamInfo3(const struct auth_serversupplied_info *server_in
|
||||
struct netr_SamInfo3 *sam3);
|
||||
NTSTATUS serverinfo_to_SamInfo6(struct auth_serversupplied_info *server_info,
|
||||
struct netr_SamInfo6 *sam6);
|
||||
+NTSTATUS create_info3_from_pac_logon_info(TALLOC_CTX *mem_ctx,
|
||||
+ const struct PAC_LOGON_INFO *logon_info,
|
||||
+ struct netr_SamInfo3 **pp_info3);
|
||||
NTSTATUS samu_to_SamInfo3(TALLOC_CTX *mem_ctx,
|
||||
struct samu *samu,
|
||||
const char *login_server,
|
||||
diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
|
||||
index 066b9a8..dc84794 100644
|
||||
--- a/source3/auth/server_info.c
|
||||
+++ b/source3/auth/server_info.c
|
||||
@@ -252,6 +252,83 @@ static NTSTATUS group_sids_to_info3(struct netr_SamInfo3 *info3,
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
+/*
|
||||
+ * Merge resource SIDs, if any, into the passed in info3 structure.
|
||||
+ */
|
||||
+
|
||||
+static NTSTATUS merge_resource_sids(const struct PAC_LOGON_INFO *logon_info,
|
||||
+ struct netr_SamInfo3 *info3)
|
||||
+{
|
||||
+ uint32_t i = 0;
|
||||
+
|
||||
+ if (!(logon_info->info3.base.user_flags & NETLOGON_RESOURCE_GROUPS)) {
|
||||
+ return NT_STATUS_OK;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * If there are any resource groups (SID Compression) add
|
||||
+ * them to the extra sids portion of the info3 in the PAC.
|
||||
+ *
|
||||
+ * This makes the info3 look like it would if we got the info
|
||||
+ * from the DC rather than the PAC.
|
||||
+ */
|
||||
+
|
||||
+ /*
|
||||
+ * Construct a SID for each RID in the list and then append it
|
||||
+ * to the info3.
|
||||
+ */
|
||||
+ for (i = 0; i < logon_info->res_groups.count; i++) {
|
||||
+ NTSTATUS status;
|
||||
+ struct dom_sid new_sid;
|
||||
+ uint32_t attributes = logon_info->res_groups.rids[i].attributes;
|
||||
+
|
||||
+ sid_compose(&new_sid,
|
||||
+ logon_info->res_group_dom_sid,
|
||||
+ logon_info->res_groups.rids[i].rid);
|
||||
+
|
||||
+ DEBUG(10, ("Adding SID %s to extra SIDS\n",
|
||||
+ sid_string_dbg(&new_sid)));
|
||||
+
|
||||
+ status = append_netr_SidAttr(info3, &info3->sids,
|
||||
+ &info3->sidcount,
|
||||
+ &new_sid,
|
||||
+ attributes);
|
||||
+ if (!NT_STATUS_IS_OK(status)) {
|
||||
+ DEBUG(1, ("failed to append SID %s to extra SIDS: %s\n",
|
||||
+ sid_string_dbg(&new_sid),
|
||||
+ nt_errstr(status)));
|
||||
+ return status;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return NT_STATUS_OK;
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
+ * Create a copy of an info3 struct from the struct PAC_LOGON_INFO,
|
||||
+ * then merge resource SIDs, if any, into it. If successful return
|
||||
+ * the created info3 struct.
|
||||
+ */
|
||||
+
|
||||
+NTSTATUS create_info3_from_pac_logon_info(TALLOC_CTX *mem_ctx,
|
||||
+ const struct PAC_LOGON_INFO *logon_info,
|
||||
+ struct netr_SamInfo3 **pp_info3)
|
||||
+{
|
||||
+ NTSTATUS status;
|
||||
+ struct netr_SamInfo3 *info3 = copy_netr_SamInfo3(mem_ctx,
|
||||
+ &logon_info->info3);
|
||||
+ if (info3 == NULL) {
|
||||
+ return NT_STATUS_NO_MEMORY;
|
||||
+ }
|
||||
+ status = merge_resource_sids(logon_info, info3);
|
||||
+ if (!NT_STATUS_IS_OK(status)) {
|
||||
+ TALLOC_FREE(info3);
|
||||
+ return status;
|
||||
+ }
|
||||
+ *pp_info3 = info3;
|
||||
+ return NT_STATUS_OK;
|
||||
+}
|
||||
+
|
||||
#define RET_NOMEM(ptr) do { \
|
||||
if (!ptr) { \
|
||||
TALLOC_FREE(info3); \
|
||||
--
|
||||
1.9.3
|
||||
|
||||
|
||||
From fda9cefd3d4a0808af67595631dd755d5b73aacf Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Allison <jra@samba.org>
|
||||
Date: Mon, 16 Jun 2014 23:15:21 -0700
|
||||
Subject: [PATCH 4/5] s3: auth: Change auth3_generate_session_info_pac() to use
|
||||
a copy of the info3 struct from the struct PAC_LOGON_INFO.
|
||||
|
||||
Call create_info3_from_pac_logon_info() to add in any resource SIDs
|
||||
from the struct PAC_LOGON_INFO to the info3.
|
||||
|
||||
Signed-off-by: Jeremy Allison <jra@samba.org>
|
||||
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
|
||||
Reviewed-by: Simo Sorce <idra@samba.org>
|
||||
---
|
||||
source3/auth/auth_generic.c | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/source3/auth/auth_generic.c b/source3/auth/auth_generic.c
|
||||
index 2880bc9..f841f0c 100644
|
||||
--- a/source3/auth/auth_generic.c
|
||||
+++ b/source3/auth/auth_generic.c
|
||||
@@ -44,6 +44,7 @@ static NTSTATUS auth3_generate_session_info_pac(struct auth4_context *auth_ctx,
|
||||
{
|
||||
TALLOC_CTX *tmp_ctx;
|
||||
struct PAC_LOGON_INFO *logon_info = NULL;
|
||||
+ struct netr_SamInfo3 *info3_copy = NULL;
|
||||
bool is_mapped;
|
||||
bool is_guest;
|
||||
char *ntuser;
|
||||
@@ -101,7 +102,13 @@ static NTSTATUS auth3_generate_session_info_pac(struct auth4_context *auth_ctx,
|
||||
|
||||
/* save the PAC data if we have it */
|
||||
if (logon_info) {
|
||||
- netsamlogon_cache_store(ntuser, &logon_info->info3);
|
||||
+ status = create_info3_from_pac_logon_info(tmp_ctx,
|
||||
+ logon_info,
|
||||
+ &info3_copy);
|
||||
+ if (!NT_STATUS_IS_OK(status)) {
|
||||
+ goto done;
|
||||
+ }
|
||||
+ netsamlogon_cache_store(ntuser, info3_copy);
|
||||
}
|
||||
|
||||
/* setup the string used by %U */
|
||||
@@ -112,7 +119,7 @@ static NTSTATUS auth3_generate_session_info_pac(struct auth4_context *auth_ctx,
|
||||
|
||||
status = make_session_info_krb5(mem_ctx,
|
||||
ntuser, ntdomain, username, pw,
|
||||
- &logon_info->info3, is_guest, is_mapped, NULL /* No session key for now, caller will sort it out */,
|
||||
+ info3_copy, is_guest, is_mapped, NULL /* No session key for now, caller will sort it out */,
|
||||
session_info);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(1, ("Failed to map kerberos pac to server info (%s)\n",
|
||||
--
|
||||
1.9.3
|
||||
|
||||
|
||||
From 9ed711f88685fc2d4860c9d6b7fa651bd2a52558 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Allison <jra@samba.org>
|
||||
Date: Mon, 16 Jun 2014 23:27:35 -0700
|
||||
Subject: [PATCH 5/5] s3: auth: Fix winbindd_pam_auth_pac_send() to create a
|
||||
new info3 and merge in resource groups from a trusted PAC.
|
||||
|
||||
Based on a patch from Richard Sharpe <realrichardsharpe@gmail.com>.
|
||||
|
||||
Signed-off-by: Jeremy Allison <jra@samba.org>
|
||||
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
|
||||
Reviewed-by: Simo Sorce <idra@samba.org>
|
||||
|
||||
Autobuild-User(master): Jeremy Allison <jra@samba.org>
|
||||
Autobuild-Date(master): Wed Jun 18 03:30:36 CEST 2014 on sn-devel-104
|
||||
---
|
||||
source3/winbindd/winbindd_pam.c | 24 ++++++++++++++++++++++--
|
||||
1 file changed, 22 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
|
||||
index c356686..0f1ca28 100644
|
||||
--- a/source3/winbindd/winbindd_pam.c
|
||||
+++ b/source3/winbindd/winbindd_pam.c
|
||||
@@ -2421,6 +2421,7 @@ NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
|
||||
struct winbindd_request *req = state->request;
|
||||
DATA_BLOB pac_blob;
|
||||
struct PAC_LOGON_INFO *logon_info = NULL;
|
||||
+ struct netr_SamInfo3 *info3_copy = NULL;
|
||||
NTSTATUS result;
|
||||
|
||||
pac_blob = data_blob_const(req->extra_data.data, req->extra_len);
|
||||
@@ -2434,7 +2435,13 @@ NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
|
||||
|
||||
if (logon_info) {
|
||||
/* Signature verification succeeded, trust the PAC */
|
||||
- netsamlogon_cache_store(NULL, &logon_info->info3);
|
||||
+ result = create_info3_from_pac_logon_info(state->mem_ctx,
|
||||
+ logon_info,
|
||||
+ &info3_copy);
|
||||
+ if (!NT_STATUS_IS_OK(result)) {
|
||||
+ return result;
|
||||
+ }
|
||||
+ netsamlogon_cache_store(NULL, info3_copy);
|
||||
|
||||
} else {
|
||||
/* Try without signature verification */
|
||||
@@ -2446,9 +2453,22 @@ NTSTATUS winbindd_pam_auth_pac_send(struct winbindd_cli_state *state,
|
||||
nt_errstr(result)));
|
||||
return result;
|
||||
}
|
||||
+ if (logon_info) {
|
||||
+ /*
|
||||
+ * Don't strictly need to copy here,
|
||||
+ * but it makes it explicit we're
|
||||
+ * returning a copy talloc'ed off
|
||||
+ * the state->mem_ctx.
|
||||
+ */
|
||||
+ info3_copy = copy_netr_SamInfo3(state->mem_ctx,
|
||||
+ &logon_info->info3);
|
||||
+ if (info3_copy == NULL) {
|
||||
+ return NT_STATUS_NO_MEMORY;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
- *info3 = &logon_info->info3;
|
||||
+ *info3 = info3_copy;
|
||||
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
From 3bf805a38a1b901a55b08118ec04097d9787497c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
|
||||
Date: Mon, 29 Sep 2014 17:16:15 +0200
|
||||
Subject: [PATCH] s3-net: Force libkrb5 locator to use the same KDC for join
|
||||
and DNS update.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Guenther
|
||||
|
||||
Signed-off-by: Günther Deschner <gd@samba.org>
|
||||
---
|
||||
source3/utils/net_ads.c | 21 +++++++++++++++++++++
|
||||
1 file changed, 21 insertions(+)
|
||||
|
||||
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
|
||||
index e96377f..efbc3d2 100644
|
||||
--- a/source3/utils/net_ads.c
|
||||
+++ b/source3/utils/net_ads.c
|
||||
@@ -1566,6 +1566,27 @@ int net_ads_join(struct net_context *c, int argc, const char **argv)
|
||||
* If the dns update fails, we still consider the join
|
||||
* operation as succeeded if we came this far.
|
||||
*/
|
||||
+
|
||||
+ if (r->out.dns_domain_name != NULL) {
|
||||
+
|
||||
+ /* Avoid potential libkrb5 issues finding a good KDC when we
|
||||
+ * already found one during the join. When the locator plugin is
|
||||
+ * installed (but winbind is not yet running) make sure we can
|
||||
+ * force libkrb5 to reuse that KDC. - gd */
|
||||
+
|
||||
+ char *env;
|
||||
+
|
||||
+ env = talloc_asprintf_strupper_m(r,
|
||||
+ "WINBINDD_LOCATOR_KDC_ADDRESS_%s",
|
||||
+ r->out.dns_domain_name);
|
||||
+ if (env == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+ setenv(env, r->in.ads->auth.kdc_server, 0);
|
||||
+ setenv("_NO_WINBINDD", "1", 0);
|
||||
+ }
|
||||
+
|
||||
_net_ads_join_dns_updates(c, ctx, r);
|
||||
|
||||
TALLOC_FREE(r);
|
||||
--
|
||||
1.9.3
|
||||
|
||||
@@ -1,154 +0,0 @@
|
||||
From 170166b8a0076089c6a8505f53a22f5b72c15786 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Allison <jra@samba.org>
|
||||
Date: Tue, 28 Oct 2014 11:55:30 -0700
|
||||
Subject: [PATCH] s3-nmbd: Fix netbios name truncation.
|
||||
|
||||
Try and cope with truncation more intelligently.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10896
|
||||
|
||||
Signed-off-by: Jeremy Allison <jra@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
(cherry picked from commit 6adcc7bffd5e1474ecba04d2328955c0b208cabc)
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/nmbd/nmbd_nameregister.c | 76 +++++++++++++++++++++++++++++++++++-----
|
||||
1 file changed, 68 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/source3/nmbd/nmbd_nameregister.c b/source3/nmbd/nmbd_nameregister.c
|
||||
index 71c4751..8b078e6 100644
|
||||
--- a/source3/nmbd/nmbd_nameregister.c
|
||||
+++ b/source3/nmbd/nmbd_nameregister.c
|
||||
@@ -482,17 +482,77 @@ void register_name(struct subnet_record *subrec,
|
||||
{
|
||||
struct nmb_name nmbname;
|
||||
nstring nname;
|
||||
+ size_t converted_size;
|
||||
|
||||
errno = 0;
|
||||
- push_ascii_nstring(nname, name);
|
||||
- if (errno == E2BIG) {
|
||||
- unstring tname;
|
||||
- pull_ascii_nstring(tname, sizeof(tname), nname);
|
||||
- DEBUG(0,("register_name: NetBIOS name %s is too long. Truncating to %s\n",
|
||||
- name, tname));
|
||||
- make_nmb_name(&nmbname, tname, type);
|
||||
- } else {
|
||||
+ converted_size = push_ascii_nstring(nname, name);
|
||||
+ if (converted_size != (size_t)-1) {
|
||||
+ /* Success. */
|
||||
make_nmb_name(&nmbname, name, type);
|
||||
+ } else if (errno == E2BIG) {
|
||||
+ /*
|
||||
+ * Name converted to CH_DOS is too large.
|
||||
+ * try to truncate.
|
||||
+ */
|
||||
+ char *converted_str_dos = NULL;
|
||||
+ char *converted_str_unix = NULL;
|
||||
+ bool ok;
|
||||
+
|
||||
+ converted_size = 0;
|
||||
+
|
||||
+ ok = convert_string_talloc(talloc_tos(),
|
||||
+ CH_UNIX,
|
||||
+ CH_DOS,
|
||||
+ name,
|
||||
+ strlen(name)+1,
|
||||
+ &converted_str_dos,
|
||||
+ &converted_size);
|
||||
+ if (!ok) {
|
||||
+ DEBUG(0,("register_name: NetBIOS name %s cannot be "
|
||||
+ "converted. Failing to register name.\n",
|
||||
+ name));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * As it's now CH_DOS codepage
|
||||
+ * we truncate by writing '\0' at
|
||||
+ * MAX_NETBIOSNAME_LEN-1 and then
|
||||
+ * convert back to CH_UNIX which we
|
||||
+ * need for the make_nmb_name() call.
|
||||
+ */
|
||||
+ if (converted_size >= MAX_NETBIOSNAME_LEN) {
|
||||
+ converted_str_dos[MAX_NETBIOSNAME_LEN-1] = '\0';
|
||||
+ }
|
||||
+
|
||||
+ ok = convert_string_talloc(talloc_tos(),
|
||||
+ CH_DOS,
|
||||
+ CH_UNIX,
|
||||
+ converted_str_dos,
|
||||
+ strlen(converted_str_dos)+1,
|
||||
+ &converted_str_unix,
|
||||
+ &converted_size);
|
||||
+ if (!ok) {
|
||||
+ DEBUG(0,("register_name: NetBIOS name %s cannot be "
|
||||
+ "converted back to CH_UNIX. "
|
||||
+ "Failing to register name.\n",
|
||||
+ converted_str_dos));
|
||||
+ TALLOC_FREE(converted_str_dos);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ make_nmb_name(&nmbname, converted_str_unix, type);
|
||||
+
|
||||
+ TALLOC_FREE(converted_str_dos);
|
||||
+ TALLOC_FREE(converted_str_unix);
|
||||
+ } else {
|
||||
+ /*
|
||||
+ * Generic conversion error. Fail to register.
|
||||
+ */
|
||||
+ DEBUG(0,("register_name: NetBIOS name %s cannot be "
|
||||
+ "converted (%s). Failing to register name.\n",
|
||||
+ name, strerror(errno)));
|
||||
+ return;
|
||||
}
|
||||
|
||||
/* Always set the NB_ACTIVE flag on the name we are
|
||||
--
|
||||
2.1.2
|
||||
|
||||
From 653a1c312e6b85f1d8113beec52a27e0ba71ef79 Mon Sep 17 00:00:00 2001
|
||||
From: Jeremy Allison <jra@samba.org>
|
||||
Date: Fri, 31 Oct 2014 11:01:26 -0700
|
||||
Subject: [PATCH] s3: nmbd: Ensure NetBIOS names are only 15 characters stored.
|
||||
|
||||
This screws up if the name is greater than MAX_NETBIOSNAME_LEN-1 in the
|
||||
unix charset, but less than or equal to MAX_NETBIOSNAME_LEN-1 in the DOS
|
||||
charset, but this is so old we have to live with that.
|
||||
|
||||
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10920
|
||||
|
||||
Signed-off-by: Jeremy Allison <jra@samba.org>
|
||||
Reviewed-by: Andreas Schneider <asn@samba.org>
|
||||
|
||||
(cherry picked from commit 7467f6e72cba214eeca75c34e9d9fba354c7ef31)
|
||||
Signed-off-by: Andreas Schneider <asn@samba.org>
|
||||
---
|
||||
source3/lib/util_names.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/source3/lib/util_names.c b/source3/lib/util_names.c
|
||||
index cf54a0e..1392b48 100644
|
||||
--- a/source3/lib/util_names.c
|
||||
+++ b/source3/lib/util_names.c
|
||||
@@ -60,7 +60,15 @@ static bool set_my_netbios_names(const char *name, int i)
|
||||
{
|
||||
SAFE_FREE(smb_my_netbios_names[i]);
|
||||
|
||||
- smb_my_netbios_names[i] = SMB_STRDUP(name);
|
||||
+ /*
|
||||
+ * Don't include space for terminating '\0' in strndup,
|
||||
+ * it is automatically added. This screws up if the name
|
||||
+ * is greater than MAX_NETBIOSNAME_LEN-1 in the unix
|
||||
+ * charset, but less than or equal to MAX_NETBIOSNAME_LEN-1
|
||||
+ * in the DOS charset, but this is so old we have to live
|
||||
+ * with that.
|
||||
+ */
|
||||
+ smb_my_netbios_names[i] = SMB_STRNDUP(name, MAX_NETBIOSNAME_LEN-1);
|
||||
if (!smb_my_netbios_names[i])
|
||||
return False;
|
||||
return strupper_m(smb_my_netbios_names[i]);
|
||||
--
|
||||
2.1.2
|
||||
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
Don't check xsltproc manpages
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
diff -Nurp samba-4.1.12.orig/lib/ldb/wscript samba-4.1.12/lib/ldb/wscript
|
||||
--- samba-4.1.12.orig/lib/ldb/wscript 2014-07-28 16:13:45.000000000 +0900
|
||||
+++ samba-4.1.12/lib/ldb/wscript 2015-04-23 17:08:45.277000225 +0900
|
||||
@@ -56,7 +56,7 @@ def configure(conf):
|
||||
conf.define('USING_SYSTEM_PYLDB_UTIL', 1)
|
||||
|
||||
if conf.env.standalone_ldb:
|
||||
- conf.CHECK_XSLTPROC_MANPAGES()
|
||||
+ #conf.CHECK_XSLTPROC_MANPAGES()
|
||||
|
||||
# we need this for the ldap backend
|
||||
if conf.CHECK_FUNCS_IN('ber_flush ldap_open ldap_initialize', 'lber ldap', headers='lber.h ldap.h'):
|
||||
diff -Nurp samba-4.1.12.orig/lib/ntdb/wscript samba-4.1.12/lib/ntdb/wscript
|
||||
--- samba-4.1.12.orig/lib/ntdb/wscript 2013-12-05 18:16:48.000000000 +0900
|
||||
+++ samba-4.1.12/lib/ntdb/wscript 2015-04-23 17:09:17.680000274 +0900
|
||||
@@ -121,7 +121,7 @@ def configure(conf):
|
||||
Logs.warn('Disabling pyntdb as python devel libs not found')
|
||||
conf.env.disable_python = True
|
||||
|
||||
- conf.CHECK_XSLTPROC_MANPAGES()
|
||||
+ #conf.CHECK_XSLTPROC_MANPAGES()
|
||||
|
||||
# This make #include <ccan/...> work.
|
||||
conf.ADD_EXTRA_INCLUDES('''#lib''')
|
||||
diff -Nurp samba-4.1.12.orig/lib/talloc/wscript samba-4.1.12/lib/talloc/wscript
|
||||
--- samba-4.1.12.orig/lib/talloc/wscript 2013-12-05 18:16:48.000000000 +0900
|
||||
+++ samba-4.1.12/lib/talloc/wscript 2015-04-23 17:08:21.781000339 +0900
|
||||
@@ -55,7 +55,7 @@ def configure(conf):
|
||||
if conf.env.standalone_talloc:
|
||||
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
|
||||
|
||||
- conf.CHECK_XSLTPROC_MANPAGES()
|
||||
+ #conf.CHECK_XSLTPROC_MANPAGES()
|
||||
|
||||
if not conf.env.disable_python:
|
||||
# also disable if we don't have the python libs installed
|
||||
diff -Nurp samba-4.1.12.orig/lib/tdb/wscript samba-4.1.12/lib/tdb/wscript
|
||||
--- samba-4.1.12.orig/lib/tdb/wscript 2013-12-05 18:16:48.000000000 +0900
|
||||
+++ samba-4.1.12/lib/tdb/wscript 2015-04-23 17:09:02.538000343 +0900
|
||||
@@ -43,7 +43,7 @@ def configure(conf):
|
||||
|
||||
conf.env.disable_python = getattr(Options.options, 'disable_python', False)
|
||||
|
||||
- conf.CHECK_XSLTPROC_MANPAGES()
|
||||
+ #conf.CHECK_XSLTPROC_MANPAGES()
|
||||
|
||||
if not conf.env.disable_python:
|
||||
# also disable if we don't have the python libs installed
|
||||
@@ -1,22 +0,0 @@
|
||||
samba: execute prog on target directly is impossible.
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
diff -Nurp samba-4.1.12.orig/lib/ccan/wscript samba-4.1.12/lib/ccan/wscript
|
||||
--- samba-4.1.12.orig/lib/ccan/wscript 2013-06-13 18:21:02.000000000 +0900
|
||||
+++ samba-4.1.12/lib/ccan/wscript 2015-04-27 14:26:25.123000238 +0900
|
||||
@@ -127,10 +127,10 @@ def configure(conf):
|
||||
# Only check for FILE_OFFSET_BITS=64 if off_t is normally small:
|
||||
# use raw routines because wrappers include previous _GNU_SOURCE
|
||||
# or _FILE_OFFSET_BITS defines.
|
||||
- conf.check(fragment="""#include <sys/types.h>
|
||||
- int main(void) { return !(sizeof(off_t) < 8); }""",
|
||||
- execute=True, msg='Checking for small off_t',
|
||||
- define_name='SMALL_OFF_T')
|
||||
+ conf.CHECK_CODE("""#include <sys/types.h>
|
||||
+ int main(void) { return !(sizeof(off_t) < 8); }""",
|
||||
+ link=True, execute=True, addmain=False, msg='Checking for small off_t',
|
||||
+ define='HAVE_SMALL_OFF_T')
|
||||
# Unreliable return value above, hence use define.
|
||||
if conf.CONFIG_SET('SMALL_OFF_T'):
|
||||
conf.check(fragment="""#include <sys/types.h>
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
waf trys to get package's configuration by native ncurses6-config.
|
||||
it will make native header files and library be used.
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
--- samba-4.1.12.orig/source3/wscript_configure_system_ncurses 2013-12-05 18:16:48.000000000 +0900
|
||||
+++ samba-4.1.12/source3/wscript_configure_system_ncurses 2015-04-29 16:12:22.619000250 +0900
|
||||
@@ -2,14 +2,6 @@ import Logs, Options, sys
|
||||
|
||||
Logs.info("Looking for ncurses features")
|
||||
|
||||
-conf.find_program('ncurses5-config', var='NCURSES_CONFIG')
|
||||
-if not conf.env.NCURSES_CONFIG:
|
||||
- conf.find_program('ncurses6-config', var='NCURSES_CONFIG')
|
||||
-
|
||||
-if conf.env.NCURSES_CONFIG:
|
||||
- conf.check_cfg(path=conf.env.NCURSES_CONFIG, args="--cflags --libs",
|
||||
- package="", uselib_store="NCURSES")
|
||||
-
|
||||
conf.CHECK_HEADERS('ncurses.h menu.h panel.h form.h', lib='ncurses')
|
||||
|
||||
conf.CHECK_FUNCS_IN('initscr', 'ncurses')
|
||||
-42
@@ -1,42 +0,0 @@
|
||||
systemd-daemon is contained by libsystemd, so we just need link libsystemd to
|
||||
obtain the implementation of systemd-daemon's function.
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
diff -Nurp samba-4.1.12.orig/lib/util/wscript_build samba-4.1.12/lib/util/wscript_build
|
||||
--- samba-4.1.12.orig/lib/util/wscript_build 2014-09-08 18:26:14.000000000 +0900
|
||||
+++ samba-4.1.12/lib/util/wscript_build 2015-04-29 16:16:58.303000207 +0900
|
||||
@@ -10,7 +10,7 @@ bld.SAMBA_LIBRARY('samba-util',
|
||||
server_id.c dprintf.c parmlist.c bitmap.c pidfile.c
|
||||
tevent_debug.c util_process.c memcache.c''',
|
||||
deps='DYNCONFIG',
|
||||
- public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd-daemon',
|
||||
+ public_deps='talloc tevent execinfo uid_wrapper pthread LIBCRYPTO charset util_setid systemd',
|
||||
public_headers='debug.h attr.h byteorder.h data_blob.h memory.h safe_string.h time.h talloc_stack.h xfile.h dlinklist.h samba_util.h string_wrappers.h',
|
||||
header_path= [ ('dlinklist.h samba_util.h', '.'), ('*', 'util') ],
|
||||
local_include=False,
|
||||
diff -Nurp samba-4.1.12.orig/wscript samba-4.1.12/wscript
|
||||
--- samba-4.1.12.orig/wscript 2014-07-28 16:13:45.000000000 +0900
|
||||
+++ samba-4.1.12/wscript 2015-04-29 16:17:52.338000264 +0900
|
||||
@@ -183,16 +183,16 @@ def configure(conf):
|
||||
conf.env['ENABLE_PIE'] = True
|
||||
|
||||
if Options.options.enable_systemd != False:
|
||||
- conf.check_cfg(package='libsystemd-daemon', args='--cflags --libs',
|
||||
- msg='Checking for libsystemd-daemon', uselib_store="SYSTEMD-DAEMON")
|
||||
- conf.CHECK_HEADERS('systemd/sd-daemon.h', lib='systemd-daemon')
|
||||
- conf.CHECK_LIB('systemd-daemon', shlib=True)
|
||||
+ conf.check_cfg(package='libsystemd', args='--cflags --libs',
|
||||
+ msg='Checking for libsystemd', uselib_store="SYSTEMD-DAEMON")
|
||||
+ conf.CHECK_HEADERS('systemd/sd-daemon.h', lib='systemd')
|
||||
+ conf.CHECK_LIB('systemd', shlib=True)
|
||||
|
||||
if conf.CONFIG_SET('HAVE_SYSTEMD_SD_DAEMON_H'):
|
||||
conf.DEFINE('HAVE_SYSTEMD', '1')
|
||||
conf.env['ENABLE_SYSTEMD'] = True
|
||||
else:
|
||||
- conf.SET_TARGET_TYPE('systemd-daemon', 'EMPTY')
|
||||
+ conf.SET_TARGET_TYPE('systemd', 'EMPTY')
|
||||
conf.undefine('HAVE_SYSTEMD')
|
||||
|
||||
conf.SAMBA_CONFIG_H('include/config.h')
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
Some modules such as dynamic library maybe cann't be imported while cross compile,
|
||||
we just check whether does the module exist.
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
--- samba-4.1.12.orig/buildtools/wafsamba/samba_bundled.py 2013-06-13 17:21:02.000000000 +0800
|
||||
+++ samba-4.1.12/buildtools/wafsamba/samba_bundled.py 2015-07-16 16:57:06.649092158 +0800
|
||||
@@ -1,7 +1,7 @@
|
||||
# functions to support bundled libraries
|
||||
|
||||
from Configure import conf
|
||||
-import sys, Logs
|
||||
+import sys, Logs, imp
|
||||
from samba_utils import *
|
||||
|
||||
def PRIVATE_NAME(bld, name, private_extension, private_library):
|
||||
@@ -228,17 +228,32 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, li
|
||||
# versions
|
||||
minversion = minimum_library_version(conf, libname, minversion)
|
||||
|
||||
- try:
|
||||
- m = __import__(modulename)
|
||||
- except ImportError:
|
||||
- found = False
|
||||
- else:
|
||||
+ # Find module in PYTHONPATH
|
||||
+ stuff = imp.find_module(modulename, [os.environ["PYTHONPATH"]])
|
||||
+ if stuff:
|
||||
try:
|
||||
- version = m.__version__
|
||||
- except AttributeError:
|
||||
+ m = imp.load_module(modulename, stuff[0], stuff[1], stuff[2])
|
||||
+ except ImportError:
|
||||
found = False
|
||||
+
|
||||
+ if conf.env.CROSS_COMPILE:
|
||||
+ # Some modules such as dynamic library maybe cann't be imported
|
||||
+ # while cross compile, we just check whether the module exist
|
||||
+ Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (stuff[1]))
|
||||
+ found = True
|
||||
else:
|
||||
- found = tuplize_version(version) >= tuplize_version(minversion)
|
||||
+ try:
|
||||
+ version = m.__version__
|
||||
+ except AttributeError:
|
||||
+ found = False
|
||||
+ else:
|
||||
+ found = tuplize_version(version) >= tuplize_version(minversion)
|
||||
+ finally:
|
||||
+ if stuff[0]:
|
||||
+ stuff[0].close()
|
||||
+ else:
|
||||
+ found = False
|
||||
+
|
||||
if not found and not conf.LIB_MAY_BE_BUNDLED(libname):
|
||||
Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
|
||||
sys.exit(1)
|
||||
@@ -1,182 +0,0 @@
|
||||
SECTION = "console/network"
|
||||
|
||||
LICENSE = "GPL-3.0+ & LGPL-3.0+ & GPL-2.0+"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
|
||||
file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
|
||||
file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 "
|
||||
|
||||
SAMBA_MIRROR = "http://samba.org/samba/ftp"
|
||||
MIRRORS += "\
|
||||
${SAMBA_MIRROR} http://mirror.internode.on.net/pub/samba \n \
|
||||
${SAMBA_MIRROR} http://www.mirrorservice.org/sites/ftp.samba.org \n \
|
||||
"
|
||||
|
||||
SRC_URI = "${SAMBA_MIRROR}/stable/samba-${PV}.tar.gz \
|
||||
file://00-fix-typos-in-man-pages.patch \
|
||||
file://01-fix-force-user-sec-ads.patch \
|
||||
file://02-fix-ipv6-join.patch \
|
||||
file://03-net-ads-kerberos-pac.patch \
|
||||
file://04-ipv6-workaround.patch \
|
||||
file://05-fix-gecos-field-with-samlogon.patch \
|
||||
file://06-fix-nmbd-systemd-status-update.patch \
|
||||
file://07-fix-idmap-ad-getgroups-without-gid.patch \
|
||||
file://08-fix-idmap-ad-sfu-with-trusted-domains.patch \
|
||||
file://09-fix-smbclient-echo-cmd-segfault.patch \
|
||||
file://10-improve-service-principal-guessing-in-net.patch \
|
||||
file://11-fix-overwriting-of-spns-during-net-ads-join.patch \
|
||||
file://12-add-precreated-spns-from-AD-during-keytab-generation.patch \
|
||||
file://13-fix-aes-enctype.patch \
|
||||
file://14-fix-dnsupdate.patch \
|
||||
file://15-fix-netbios-name-truncation.patch \
|
||||
file://16-do-not-check-xsltproc-manpages.patch \
|
||||
file://17-execute-prog-by-qemu.patch \
|
||||
file://18-avoid-get-config-by-native-ncurses.patch \
|
||||
file://19-systemd-daemon-is-contained-by-libsystemd.patch \
|
||||
file://20-do-not-import-target-module-while-cross-compile.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "232016d7581a1ba11e991ec2674553c4"
|
||||
SRC_URI[sha256sum] = "033604674936bf5c77d7df299b0626052b84a41505a6a6afe902f6274fc29898"
|
||||
|
||||
inherit systemd waf-samba cpan-base perlnative
|
||||
|
||||
DEPENDS += "readline virtual/libiconv zlib popt talloc libtdb libtevent libldb krb5 ctdb"
|
||||
|
||||
SYSVINITTYPE_linuxstdbase = "lsb"
|
||||
SYSVINITTYPE = "sysv"
|
||||
|
||||
PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \
|
||||
${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '${SYSVINITTYPE}', '', d)} \
|
||||
${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
|
||||
${@base_contains('DISTRO_FEATURES', 'zeroconf', 'zeroconf', '', d)} \
|
||||
acl aio cups ldap \
|
||||
"
|
||||
|
||||
RDEPENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'lsb', 'lsb', '', d)}"
|
||||
|
||||
PACKAGECONFIG[acl] = "--with-acl-support,---without-acl-support,acl"
|
||||
PACKAGECONFIG[aio] = "--with-aio-support,---without-aio-support,libaio"
|
||||
PACKAGECONFIG[fam] = "--with-fam,--without-fam,gamin"
|
||||
PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
|
||||
PACKAGECONFIG[lsb] = ",,lsb"
|
||||
PACKAGECONFIG[cups] = "--enable-cups,--disable-cups,cups"
|
||||
PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
|
||||
PACKAGECONFIG[systemd] = "--with-systemd,--without-systemd,systemd"
|
||||
PACKAGECONFIG[zeroconf] = "--enable-avahi,--disable-avahi,avahi"
|
||||
|
||||
SAMBA4_IDMAP_MODULES="idmap_ad,idmap_rid,idmap_adex,idmap_hash,idmap_tdb2"
|
||||
SAMBA4_PDB_MODULES="pdb_tdbsam,${@bb.utils.contains('PACKAGECONFIG', 'ldap', 'pdb_ldap,', '', d)}pdb_ads,pdb_smbpasswd,pdb_wbc_sam,pdb_samba4"
|
||||
SAMBA4_AUTH_MODULES="auth_unix,auth_wbc,auth_server,auth_netlogond,auth_script,auth_samba4"
|
||||
SAMBA4_MODULES="${SAMBA4_IDMAP_MODULES},${SAMBA4_PDB_MODULES},${SAMBA4_AUTH_MODULES}"
|
||||
|
||||
SAMBA4_LIBS="heimdal,!zlib,!popt,!talloc,!pytalloc,!pytalloc-util,!tevent,!pytevent,!tdb,!pytdb,!ldb,!pyldb"
|
||||
|
||||
PERL_VERNDORLIB="${libdir}/perl5/vendor_perl/${PERLVERSION}"
|
||||
|
||||
EXTRA_OECONF += "--enable-fhs \
|
||||
--with-piddir=${localstatedir}/run \
|
||||
--with-sockets-dir=${localstatedir}/run/samba \
|
||||
--with-modulesdir=${libdir}/samba \
|
||||
--with-pammodulesdir=${base_libdir}/security \
|
||||
--with-lockdir=${localstatedir}/lib/samba \
|
||||
--with-cachedir=${localstatedir}/lib/samba \
|
||||
--with-perl-lib-install-dir=${PERL_VERNDORLIB} \
|
||||
--disable-gnutls \
|
||||
--disable-rpath-install \
|
||||
--with-shared-modules=${SAMBA4_MODULES} \
|
||||
--bundled-libraries=${SAMBA4_LIBS} \
|
||||
--with-system-mitkrb5 \
|
||||
--without-ad-dc \
|
||||
${@base_conditional('TARGET_ARCH', 'x86_64', '', '--disable-glusterfs', d)} \
|
||||
--with-cluster-support \
|
||||
--enable-old-ctdb \
|
||||
--with-profiling-data \
|
||||
--with-libiconv=${STAGING_DIR_HOST}${prefix} \
|
||||
"
|
||||
|
||||
LDFLAGS += "-Wl,-z,relro,-z,now"
|
||||
|
||||
do_install_append() {
|
||||
rmdir --ignore-fail-on-non-empty "${D}/${localstatedir}/run"
|
||||
|
||||
if ${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'true', 'false', d)}; then
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
for i in nmb smb winbind; do
|
||||
install -m 0644 packaging/systemd/$i.service ${D}${systemd_unitdir}/system
|
||||
done
|
||||
sed -e 's,@BASE_BINDIR@,${base_bindir},g' \
|
||||
-e 's,@SBINDIR@,${sbindir},g' \
|
||||
-i ${D}${systemd_unitdir}/system/*.service
|
||||
|
||||
install -d ${D}${sysconfdir}/tmpfiles.d
|
||||
echo "d ${localstatedir}/log/samba 0755 root root -" \
|
||||
> ${D}${sysconfdir}/tmpfiles.d/99-${BPN}.conf
|
||||
elif ${@bb.utils.contains('PACKAGECONFIG', 'lsb', 'true', 'false', d)}; then
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -m 0755 packaging/LSB/samba.sh ${D}${sysconfdir}/init.d
|
||||
update-rc.d -r ${D} samba.sh start 20 3 5 .
|
||||
update-rc.d -r ${D} samba.sh start 20 0 1 6 .
|
||||
elif ${@bb.utils.contains('PACKAGECONFIG', 'lsb', 'true', 'false', d)}; then
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -m 0755 packaging/sysv/samba.init ${D}${sysconfdir}/init.d/samba.sh
|
||||
update-rc.d -r ${D} samba.sh start 20 3 5 .
|
||||
update-rc.d -r ${D} samba.sh start 20 0 1 6 .
|
||||
fi
|
||||
|
||||
install -d ${D}${sysconfdir}/samba
|
||||
echo "127.0.0.1 localhost" > ${D}${sysconfdir}/samba/lmhosts
|
||||
install -m644 packaging/LSB/smb.conf ${D}${sysconfdir}/samba/smb.conf
|
||||
|
||||
install -d ${D}${libdir}/tmpfiles.d
|
||||
install -m644 packaging/systemd/samba.conf.tmp ${D}${libdir}/tmpfiles.d/samba.conf
|
||||
|
||||
install -d ${D}${sysconfdir}/sysconfig/
|
||||
install -m644 packaging/systemd/samba.sysconfig ${D}${sysconfdir}/sysconfig/samba
|
||||
}
|
||||
|
||||
PACKAGES += "${PN}-python ${PN}-python-dbg ${PN}-pidl libwinbind libwinbind-dbg libwinbind-krb5-locator"
|
||||
|
||||
FILES_${PN} += "/run \
|
||||
${base_libdir}/security/pam_smbpass.so \
|
||||
${libdir}/tmpfiles.d/* \
|
||||
"
|
||||
|
||||
SMB_SERVICE="${systemd_unitdir}/system/nmb.service ${systemd_unitdir}/system/smb.service"
|
||||
SMB_SYSV="${sysconfdir}/init.d ${sysconfdir}/rc?.d"
|
||||
FILES_${PN} +="${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${SMB_SERVICE}', '', d)}"
|
||||
FILES_${PN} +="${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '${SMB_SYSV}', '', d)}"
|
||||
|
||||
FILES_${PN}-dbg += "${libdir}/samba/idmap/.debug/* \
|
||||
${libdir}/samba/pdb/.debug/* \
|
||||
${libdir}/samba/auth/.debug/* \
|
||||
${libdir}/samba/nss_info/.debug/* \
|
||||
${libdir}/samba/ldb/.debug/* \
|
||||
${libdir}/samba/vfs/.debug/* \
|
||||
${base_libdir}/security/.debug/pam_smbpass.so \
|
||||
"
|
||||
|
||||
FILES_libwinbind = "${base_libdir}/security/pam_winbind.so"
|
||||
FILES_libwinbind += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_unitdir}/system/winbind.service', '', d)}"
|
||||
FILES_libwinbind-dbg = "${base_libdir}/security/.debug/pam_winbind.so"
|
||||
FILES_libwinbind-krb5-locator = "${libdir}/winbind_krb5_locator.so"
|
||||
|
||||
FILES_${PN}-python = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*.so \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/*.py \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/*.so \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/dcerpc/*.so \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/dcerpc/*.py \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/external/* \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/netcmd/*.py \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/provision/*.py \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/samba3/*.py \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/samba3/*.so \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/tests/* \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/web_server/* \
|
||||
"
|
||||
FILES_${PN}-python-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/* \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/.debug/* \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/samba3/.debug/* \
|
||||
${libdir}/python${PYTHON_BASEVERSION}/site-packages/samba/dcerpc/.debug/* \
|
||||
"
|
||||
|
||||
FILES_${PN}-pidl = "${bindir}/pidl ${PERL_VERNDORLIB}/*"
|
||||
@@ -1,24 +0,0 @@
|
||||
support cross-compile for linux-os.
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
diff -Nurp ctdb-2.5.1.orig/configure ctdb-2.5.1/configure
|
||||
--- ctdb-2.5.1.orig/configure 2015-05-07 16:24:28.545000238 +0900
|
||||
+++ ctdb-2.5.1/configure 2015-05-07 16:28:20.894000244 +0900
|
||||
@@ -10692,10 +10692,16 @@ if test x"$libreplace_cv_HAVE_GETADDRINF
|
||||
# see bug 5910, use our replacements if we detect
|
||||
# a broken system.
|
||||
if test "$cross_compiling" = yes; then :
|
||||
+ case "$target_os" in
|
||||
+ *linux*)
|
||||
+ ;;
|
||||
+ *)
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error $? "cannot run test program while cross compiling
|
||||
See \`config.log' for more details" "$LINENO" 5; }
|
||||
+ ;;
|
||||
+ esac
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
@@ -1,16 +0,0 @@
|
||||
link rep_snprintf from lib/replace/snprintf.o for ltdbtool
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
diff -Nurp ctdb-2.5.1.orig/Makefile.in ctdb-2.5.1/Makefile.in
|
||||
--- ctdb-2.5.1.orig/Makefile.in 2015-05-07 16:43:39.276000236 +0900
|
||||
+++ ctdb-2.5.1/Makefile.in 2015-05-07 16:44:09.627000237 +0900
|
||||
@@ -170,7 +170,7 @@ bin/ctdb: $(CTDB_CLIENT_OBJ) tools/ctdb.
|
||||
@echo Linking $@
|
||||
$(WRAPPER) $(CC) $(CFLAGS) -o $@ tools/ctdb.o tools/ctdb_vacuum.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
|
||||
|
||||
-bin/ltdbtool: tools/ltdbtool.o $(TDB_OBJ)
|
||||
+bin/ltdbtool: tools/ltdbtool.o $(TDB_OBJ) lib/replace/snprintf.o
|
||||
@echo Linking $@
|
||||
$(WRAPPER) $(CC) $(CFLAGS) -o $@ $+ $(TDB_LIBS) $(LIB_FLAGS)
|
||||
|
||||
@@ -1,43 +0,0 @@
|
||||
DESCRIPTION = "CTDB is a cluster implementation of the TDB database \
|
||||
used by Samba and other projects to store temporary data. If an \
|
||||
application is already using TDB for temporary data it is very easy \
|
||||
to convert that application to be cluster aware and use CTDB instead."
|
||||
DESCRIPTION = "CTDB is a cluster implementation of the TDB database \
|
||||
used by Samba and other projects to store temporary data. If an \
|
||||
application is already using TDB for temporary data it is very easy \
|
||||
to convert that application to be cluster aware and use CTDB instead."
|
||||
HOMEPAGE = "https://ctdb.samba.org/"
|
||||
LICENSE = "GPL-2.0+ & LGPL-3.0+ & GPL-3.0+"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504 \
|
||||
file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
|
||||
file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6 \
|
||||
"
|
||||
|
||||
SRC_URI = "https://ftp.samba.org/pub/${PN}/${BP}.tar.gz \
|
||||
file://01-support-cross-compile-for-linux-os.patch \
|
||||
file://02-link-rep_snprintf-for-ltdbtool.patch \
|
||||
"
|
||||
|
||||
SRC_URI[md5sum] = "d0cd91726ff4ca2229e1b21859c94717"
|
||||
SRC_URI[sha256sum] = "d5bf3f674cae986bb6178b1db215a703ac94adc5f75fadfdcff63dcbb5e98ab5"
|
||||
|
||||
inherit autotools-brokensep pkgconfig systemd
|
||||
|
||||
PARALLEL_MAKE = ""
|
||||
|
||||
DEPENDS += "popt libtevent talloc"
|
||||
|
||||
do_configure() {
|
||||
oe_runconf
|
||||
}
|
||||
|
||||
do_install_append() {
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${S}/config/ctdb.service ${D}${systemd_unitdir}/system
|
||||
sed -i -e 's,/usr/sbin/,${sbindir}/,' ${D}${systemd_unitdir}/system/ctdb.service
|
||||
}
|
||||
|
||||
SYSTEMD_SERVICE_${PN} = "ctdb.service"
|
||||
|
||||
FILES_${PN} += "/run"
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
Some modules such as dynamic library maybe cann't be imported while cross compile,
|
||||
we just check whether does the module exist.
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
--- ldb-1.1.17.orig/buildtools/wafsamba/samba_bundled.py 2015-07-16 16:42:12.265127110 +0800
|
||||
+++ ldb-1.1.17/buildtools/wafsamba/samba_bundled.py 2015-07-16 16:45:25.717119550 +0800
|
||||
@@ -1,7 +1,7 @@
|
||||
# functions to support bundled libraries
|
||||
|
||||
from Configure import conf
|
||||
-import sys, Logs
|
||||
+import sys, Logs, imp
|
||||
from samba_utils import *
|
||||
|
||||
def PRIVATE_NAME(bld, name, private_extension, private_library):
|
||||
@@ -218,17 +218,32 @@ def CHECK_BUNDLED_SYSTEM_PYTHON(conf, li
|
||||
# versions
|
||||
minversion = minimum_library_version(conf, libname, minversion)
|
||||
|
||||
- try:
|
||||
- m = __import__(modulename)
|
||||
- except ImportError:
|
||||
- found = False
|
||||
- else:
|
||||
+ # Find module in PYTHONPATH
|
||||
+ stuff = imp.find_module(modulename, [os.environ["PYTHONPATH"]])
|
||||
+ if stuff:
|
||||
try:
|
||||
- version = m.__version__
|
||||
- except AttributeError:
|
||||
+ m = imp.load_module(modulename, stuff[0], stuff[1], stuff[2])
|
||||
+ except ImportError:
|
||||
found = False
|
||||
+
|
||||
+ if conf.env.CROSS_COMPILE:
|
||||
+ # Some modules such as dynamic library maybe cann't be imported
|
||||
+ # while cross compile, we just check whether the module exist
|
||||
+ Logs.warn('Cross module[%s] has been found, but can not be loaded.' % (stuff[1]))
|
||||
+ found = True
|
||||
else:
|
||||
- found = tuplize_version(version) >= tuplize_version(minversion)
|
||||
+ try:
|
||||
+ version = m.__version__
|
||||
+ except AttributeError:
|
||||
+ found = False
|
||||
+ else:
|
||||
+ found = tuplize_version(version) >= tuplize_version(minversion)
|
||||
+ finally:
|
||||
+ if stuff[0]:
|
||||
+ stuff[0].close()
|
||||
+ else:
|
||||
+ found = False
|
||||
+
|
||||
if not found and not conf.LIB_MAY_BE_BUNDLED(libname):
|
||||
Logs.error('ERROR: Python module %s of version %s not found, and bundling disabled' % (libname, minversion))
|
||||
sys.exit(1)
|
||||
@@ -1,46 +0,0 @@
|
||||
SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
|
||||
HOMEPAGE = "http://ldb.samba.org"
|
||||
SECTION = "libs"
|
||||
LICENSE = "LGPL-3.0+ & LGPL-2.1+ & GPL-3.0+"
|
||||
|
||||
DEPENDS += "libtdb talloc libtevent popt"
|
||||
RDEPENDS_${PN} += "libtevent popt libtalloc openldap"
|
||||
RDEPENDS_pyldb += "python libtdb libtalloc"
|
||||
|
||||
SRC_URI = "http://samba.org/ftp/ldb/ldb-${PV}.tar.gz \
|
||||
file://do-not-import-target-module-while-cross-compile.patch \
|
||||
"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
|
||||
file://${COREBASE}/meta/files/common-licenses/LGPL-2.1;md5=1a6d268fd218675ffea8be556788b780 \
|
||||
file://${COREBASE}/meta/files/common-licenses/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891"
|
||||
|
||||
SRC_URI[md5sum] = "7c2ab4e3f2a4186493aa06eabbc61cc0"
|
||||
SRC_URI[sha256sum] = "b9a312aad19e9463716d257d8f2529fd7fc1a5ef24f6dcdc0c4a1930d7bdb6e6"
|
||||
|
||||
inherit waf-samba
|
||||
|
||||
S = "${WORKDIR}/ldb-${PV}"
|
||||
|
||||
EXTRA_OECONF += "--disable-rpath \
|
||||
--disable-rpath-install \
|
||||
--bundled-libraries=NONE \
|
||||
--builtin-libraries=replace \
|
||||
--with-modulesdir=${libdir}/ldb/modules \
|
||||
--with-privatelibdir=${libdir}/ldb \
|
||||
--with-libiconv=${STAGING_DIR_HOST}${prefix}\
|
||||
"
|
||||
|
||||
PACKAGES += "pyldb pyldb-dbg pyldb-dev"
|
||||
|
||||
FILES_${PN} += "${libdir}/ldb/*"
|
||||
FILES_${PN}-dbg += "${libdir}/ldb/.debug/* \
|
||||
${libdir}/ldb/modules/ldb/.debug/*"
|
||||
|
||||
FILES_pyldb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
|
||||
${libdir}/libpyldb-util.so.1 \
|
||||
${libdir}/libpyldb-util.so.1.1.17 \
|
||||
"
|
||||
FILES_pyldb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
|
||||
${libdir}/.debug/libpyldb-util.so.1.1.17"
|
||||
FILES_pyldb-dev = "${libdir}/libpyldb-util.so"
|
||||
@@ -1,15 +0,0 @@
|
||||
Don't check manpages for xsltproc.
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
--- tdb-1.3.0.orig/wscript 2015-04-22 09:52:32.366000222 +0900
|
||||
+++ tdb-1.3.0/wscript 2015-04-22 09:51:57.720000205 +0900
|
||||
@@ -90,7 +90,7 @@ def configure(conf):
|
||||
not conf.env.disable_tdb_mutex_locking):
|
||||
conf.define('USE_TDB_MUTEX_LOCKING', 1)
|
||||
|
||||
- conf.CHECK_XSLTPROC_MANPAGES()
|
||||
+ conf.find_program('xsltproc', var='XSLTPROC')
|
||||
|
||||
if not conf.env.disable_python:
|
||||
# also disable if we don't have the python libs installed
|
||||
@@ -1,30 +0,0 @@
|
||||
SUMMARY = "The tdb library"
|
||||
SECTION = "libs"
|
||||
LICENSE = "LGPL-3.0+ & GPL-3.0+"
|
||||
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
|
||||
file://${COREBASE}/meta/files/common-licenses/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891"
|
||||
|
||||
SRC_URI = "http://samba.org/ftp/tdb/tdb-${PV}.tar.gz \
|
||||
file://do-not-check-xsltproc-manpages.patch"
|
||||
|
||||
SRC_URI[md5sum] = "f18cd6afc4f5670edfe58f72d2665f94"
|
||||
SRC_URI[sha256sum] = "04bee48d405ab7815810575a6e0cb364cc0eea6187b54b18c84e9c18a768ba20"
|
||||
|
||||
S = "${WORKDIR}/tdb-${PV}"
|
||||
|
||||
inherit waf-samba
|
||||
|
||||
EXTRA_OECONF += "--disable-rpath \
|
||||
--bundled-libraries=NONE \
|
||||
--builtin-libraries=replace \
|
||||
--with-libiconv=${STAGING_DIR_HOST}${prefix}\
|
||||
"
|
||||
|
||||
PACKAGES += "tdb-tools python-tdb python-tdb-dbg"
|
||||
|
||||
FILES_${PN} = "${libdir}/*.so.*"
|
||||
FILES_tdb-tools = "${bindir}/*"
|
||||
FILES_python-tdb = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
|
||||
FILES_python-tdb-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug/*"
|
||||
RDEPENDS_python-tdb = "python"
|
||||
@@ -1,16 +0,0 @@
|
||||
Don't check manpages for xsltproc.
|
||||
|
||||
Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
|
||||
|
||||
diff -Nurp tevent-0.9.21.orig/lib/talloc/wscript tevent-0.9.21/lib/talloc/wscript
|
||||
--- tevent-0.9.21.orig/lib/talloc/wscript 2013-09-08 21:24:14.000000000 +0900
|
||||
+++ tevent-0.9.21/lib/talloc/wscript 2015-04-24 16:28:04.085000230 +0900
|
||||
@@ -55,7 +55,7 @@ def configure(conf):
|
||||
if conf.env.standalone_talloc:
|
||||
conf.env.TALLOC_COMPAT1 = Options.options.TALLOC_COMPAT1
|
||||
|
||||
- conf.CHECK_XSLTPROC_MANPAGES()
|
||||
+ conf.find_program('xsltproc', var='XSLTPROC')
|
||||
|
||||
if not conf.env.disable_python:
|
||||
# also disable if we don't have the python libs installed
|
||||
@@ -1,30 +0,0 @@
|
||||
SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
|
||||
HOMEPAGE = "http://tevent.samba.org"
|
||||
SECTION = "libs"
|
||||
LICENSE = "LGPLv3+"
|
||||
|
||||
DEPENDS += "talloc libcap"
|
||||
RDEPENDS_${PN} += "libtalloc"
|
||||
RDEPENDS_python-tevent = "python"
|
||||
|
||||
SRC_URI = "http://samba.org/ftp/tevent/tevent-${PV}.tar.gz"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b"
|
||||
|
||||
SRC_URI[md5sum] = "3d5a76c0a1b5f724842d785fd055633f"
|
||||
SRC_URI[sha256sum] = "f2be7463573dab2d8210cb57fe7e7e2aeb323274cbdc865a6e29ddcfb977f0f4"
|
||||
|
||||
inherit waf-samba
|
||||
|
||||
S = "${WORKDIR}/tevent-${PV}"
|
||||
|
||||
EXTRA_OECONF += "--disable-rpath \
|
||||
--bundled-libraries=NONE \
|
||||
--builtin-libraries=replace \
|
||||
--with-libiconv=${STAGING_DIR_HOST}${prefix}\
|
||||
--without-gettext \
|
||||
"
|
||||
|
||||
PACKAGES += "python-tevent python-tevent-dbg"
|
||||
|
||||
FILES_python-tevent = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/*"
|
||||
FILES_python-tevent-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug"
|
||||
@@ -1,45 +0,0 @@
|
||||
SUMMARY = "Hierarchical, reference counted memory pool system with destructors"
|
||||
HOMEPAGE = "http://talloc.samba.org"
|
||||
SECTION = "libs"
|
||||
LICENSE = "LGPL-3.0+ & GPL-3.0+"
|
||||
|
||||
SRC_URI = "http://samba.org/ftp/${BPN}/${BPN}-${PV}.tar.gz"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/LGPL-3.0;md5=bfccfe952269fff2b407dd11f2f3083b \
|
||||
file://${COREBASE}/meta/files/common-licenses/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891"
|
||||
|
||||
SRC_URI[md5sum] = "5dffb86414218a91864ed4453ba9be07"
|
||||
SRC_URI[sha256sum] = "3e29ce6c3ba3c4f7c2d57ce8cf0fbc24c86618c519f2b2fb6a459025488b6174"
|
||||
|
||||
inherit waf-samba
|
||||
|
||||
EXTRA_OECONF += "--disable-rpath \
|
||||
--disable-rpath-install \
|
||||
--bundled-libraries=NONE \
|
||||
--builtin-libraries=replace \
|
||||
--disable-silent-rules \
|
||||
--with-libiconv=${STAGING_DIR_HOST}${prefix}\
|
||||
"
|
||||
|
||||
PACKAGES += "libtalloc libtalloc-dbg libtalloc-dev pytalloc pytalloc-dbg pytalloc-dev"
|
||||
|
||||
#ALLOW_EMPTY_${PN} = "1"
|
||||
FILES_${PN} = ""
|
||||
FILES_${PN}-dev = ""
|
||||
FILES_${PN}-dbg = ""
|
||||
|
||||
FILES_libtalloc = "${libdir}/libtalloc.so.2 \
|
||||
${libdir}/libtalloc.so.2.1.1"
|
||||
FILES_libtalloc-dbg = "/usr/src/debug/ \
|
||||
${libdir}/.debug/libtalloc.so.2.1.1"
|
||||
FILES_libtalloc-dev = "${includedir}/ \
|
||||
${libdir}/libtalloc.so \
|
||||
${libdir}/pkgconfig/"
|
||||
|
||||
FILES_pytalloc = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/* \
|
||||
${libdir}/libpytalloc-util.so.2 \
|
||||
${libdir}/libpytalloc-util.so.2.1.1 \
|
||||
"
|
||||
FILES_pytalloc-dbg = "${libdir}/python${PYTHON_BASEVERSION}/site-packages/.debug \
|
||||
${libdir}/.debug/libpytalloc-util.so.2.1.1"
|
||||
FILES_pytalloc-dev = "${libdir}/libpytalloc-util.so"
|
||||
RDEPENDS_pytalloc = "python"
|
||||
Reference in New Issue
Block a user