From 4b2ce771f8c326dcffdb0c79befb54982001e7db Mon Sep 17 00:00:00 2001 From: Ricky Nance Date: Tue, 16 Oct 2012 00:52:51 -0500 Subject: [PATCH 1/2] Removed phpldapadmin inclusion for Samba 4. Signed-off-by: Andrew Bartlett Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Wed Oct 17 12:55:44 CEST 2012 on sn-devel-104 (cherry picked from commit d09ac9636af6a31098156ca65ab62e11ce3a5d15) --- .../scripting/python/samba/provision/__init__.py | 20 -------------------- source4/scripting/python/samba/tests/provision.py | 10 ---------- source4/setup/phpldapadmin-config.php | 20 -------------------- 3 files changed, 0 insertions(+), 50 deletions(-) delete mode 100644 source4/setup/phpldapadmin-config.php diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py index 03d9bca..f6c11b5 100644 --- a/source4/scripting/python/samba/provision/__init__.py +++ b/source4/scripting/python/samba/provision/__init__.py @@ -122,7 +122,6 @@ class ProvisionPaths(object): self.winsdb = None self.private_dir = None self.state_dir = None - self.phpldapadminconfig = None class ProvisionNames(object): @@ -405,12 +404,6 @@ class ProvisionResult(object): logger.info("DNS Domain: %s", self.names.dnsdomain) logger.info("DOMAIN SID: %s", self.domainsid) - if self.paths.phpldapadminconfig is not None: - logger.info( - "A phpLDAPadmin configuration file suitable for administering " - "the Samba 4 LDAP server has been created in %s.", - self.paths.phpldapadminconfig) - if self.backend_result: self.backend_result.report_logger(logger) @@ -478,8 +471,6 @@ def provision_paths_from_lp(lp, dnsdomain): paths.krb5conf = os.path.join(paths.private_dir, "krb5.conf") paths.winsdb = os.path.join(paths.private_dir, "wins.ldb") paths.s4_ldapi_path = os.path.join(paths.private_dir, "ldapi") - paths.phpldapadminconfig = os.path.join(paths.private_dir, - "phpldapadmin-config.php") paths.hklm = "hklm.ldb" paths.hkcr = "hkcr.ldb" paths.hkcu = "hkcu.ldb" @@ -2053,8 +2044,6 @@ def provision(logger, session_info, credentials, smbconf=None, backend_result = provision_backend.post_setup() provision_backend.shutdown() - create_phpldapadmin_config(paths.phpldapadminconfig, - ldapi_url) except: secrets_ldb.transaction_cancel() raise @@ -2125,15 +2114,6 @@ def provision_become_dc(smbconf=None, targetdir=None, return res -def create_phpldapadmin_config(path, ldapi_uri): - """Create a PHP LDAP admin configuration file. - - :param path: Path to write the configuration to. - """ - setup_file(setup_path("phpldapadmin-config.php"), path, - {"S4_LDAPI_URI": ldapi_uri}) - - def create_krb5_conf(path, dnsdomain, hostname, realm): """Write out a file containing zone statements suitable for inclusion in a named.conf file (including GSS-TSIG configuration). diff --git a/source4/scripting/python/samba/tests/provision.py b/source4/scripting/python/samba/tests/provision.py index f7fb407..9921791 100644 --- a/source4/scripting/python/samba/tests/provision.py +++ b/source4/scripting/python/samba/tests/provision.py @@ -104,9 +104,6 @@ class Disabled(object): def test_setup_samdb_partitions(self): raise NotImplementedError(self.test_setup_samdb_partitions) - def test_create_phpldapadmin_config(self): - raise NotImplementedError(self.test_create_phpldapadmin_config) - def test_provision_dns(self): raise NotImplementedError(self.test_provision_dns) @@ -185,13 +182,6 @@ class ProvisionResultTests(TestCase): ('INFO', 'DNS Domain: dnsdomein'), ('INFO', 'DOMAIN SID: S1-1-1')]) - def test_report_logger_phpldapadmin(self): - result = self.base_result() - result.paths.phpldapadminconfig = "/some/ldapconfig" - entries = self.report_logger(result) - self.assertEquals(entries[-1], - ("INFO", "A phpLDAPadmin configuration file suitable for administering the Samba 4 LDAP server has been created in /some/ldapconfig.")) - def test_report_logger_adminpass(self): result = self.base_result() result.adminpass_generated = True diff --git a/source4/setup/phpldapadmin-config.php b/source4/setup/phpldapadmin-config.php deleted file mode 100644 index 8a2f215..0000000 --- a/source4/setup/phpldapadmin-config.php +++ /dev/null @@ -1,20 +0,0 @@ -newServer('ldap_pla'); - -/* A convenient name that will appear in the tree viewer and throughout - phpLDAPadmin to identify this LDAP server to users. */ -$servers->setValue('server','name','Samba4 LDAP Server'); -$servers->setValue('server','host','${S4_LDAPI_URI}'); -$servers->setValue('login','auth_type','session'); -$servers->setValue('login','attr','dn'); - -?> -- 1.7.7 From 79d616af5645dc725641da32d23d5e0a738541f1 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Fri, 16 Nov 2012 09:59:53 +0100 Subject: [PATCH 2/2] utils: Remove unused samba-dig tool Signed-off-by: Kai Blin Reviewed-by: Michael Adam (cherry picked from commit d5de797af2aeb3697022e33ea51c516621b25e2f) --- utils/samba-dig.c | 160 --------------------------------------------------- utils/wscript_build | 7 -- wscript_build | 1 - 3 files changed, 0 insertions(+), 168 deletions(-) delete mode 100644 utils/samba-dig.c delete mode 100644 utils/wscript_build diff --git a/utils/samba-dig.c b/utils/samba-dig.c deleted file mode 100644 index ec0677a..0000000 --- a/utils/samba-dig.c +++ /dev/null @@ -1,160 +0,0 @@ -/* - Unix SMB/CIFS implementation. - - DNS query too for Samba with socketwrapper support - - Copyright (C) 2012 Kai Blin - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . -*/ - -#include "includes.h" -#include -#include -#include "lib/util/samba_util.h" -#include "librpc/ndr/libndr.h" -#include "librpc/gen_ndr/ndr_dns.h" -#include "libcli/dns/libdns.h" - -static void usage(void) -{ - printf("Usage: samba-dig \n\n"); -} - -static struct dns_name_packet *make_name_packet(TALLOC_CTX *mem_ctx, - uint16_t operation) -{ - struct dns_name_packet *packet = talloc_zero(mem_ctx, - struct dns_name_packet); - if (packet == NULL) { - return NULL; - } - - packet->id = random(); - packet->operation |= operation | DNS_FLAG_RECURSION_DESIRED; - - return packet; -} - -#define QTYPE_MAP(type) if (strncmp(type_string, #type , strlen( #type )) == 0) \ - return DNS_QTYPE_ ## type ; - -static enum dns_qtype parse_qtype(const char *type_string) -{ - QTYPE_MAP(AAAA); - QTYPE_MAP(A); - QTYPE_MAP(SOA); - QTYPE_MAP(PTR); - return -1; -} -#undef QTYPE_MAP - -static struct dns_name_question *make_question(TALLOC_CTX *mem_ctx, - const char *name, - enum dns_qtype type) -{ - struct dns_name_question *question = talloc(mem_ctx, - struct dns_name_question); - if (question == NULL) { - return NULL; - } - - question->name = talloc_strdup(question, name); - question->question_type = type; - question->question_class = DNS_QCLASS_IN; - - return question; -} - -int main(int argc, char **argv) -{ - TALLOC_CTX *mem_ctx = talloc_init("samba-dig"); - struct tevent_context *ev; - struct dns_name_packet *dns_packet, *in_packet; - struct dns_name_question *question; - enum dns_qtype type; - enum ndr_err_code ndr_err; - struct tevent_req *req; - WERROR w_err; - DATA_BLOB out, in; - int ret = 0; - - if (argc < 4) { - usage(); - exit(1); - } - - ev = tevent_context_init(mem_ctx); - setup_logging("samba-dig", DEBUG_STDERR); - debug_parse_levels("1"); - - DEBUG(1,("Querying %s for %s %s\n", argv[1], argv[2], argv[3])); - - dns_packet = make_name_packet(mem_ctx, DNS_OPCODE_QUERY); - - type = parse_qtype(argv[3]); - if (type == -1) { - DEBUG(0, ("Invalid DNS_QTYPE %s\n", argv[3])); - ret = 1; - goto error; - } - - question = make_question(dns_packet, argv[2], type); - - dns_packet->qdcount = 1; - dns_packet->questions = question; - NDR_PRINT_DEBUG(dns_name_packet, dns_packet); - - ndr_err = ndr_push_struct_blob(&out, mem_ctx, dns_packet, - (ndr_push_flags_fn_t)ndr_push_dns_name_packet); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - DEBUG(0, ("Failed to marshall dns_name_packet: %d\n", ndr_err)); - ret = 1; - goto error; - } - - req = dns_udp_request_send(mem_ctx, ev, argv[1], out.data, out.length); - if (req == NULL) { - DEBUG(0, ("Failed to allocate memory for tevent_req\n")); - ret = 1; - goto error; - } - if (!tevent_req_poll(req, ev)) { - DEBUG(0, ("Error sending dns request\n")); - ret = 1; - goto error; - } - w_err = dns_udp_request_recv(req, mem_ctx, &in.data, &in.length); - if (!W_ERROR_IS_OK(w_err)) { - DEBUG(0, ("Error receiving dns request: %s\n", win_errstr(w_err))); - ret = 1; - goto error; - } - - in_packet = talloc(mem_ctx, struct dns_name_packet); - - ndr_err = ndr_pull_struct_blob(&in, in_packet, in_packet, - (ndr_pull_flags_fn_t)ndr_pull_dns_name_packet); - if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { - DEBUG(0, ("Failed to unmarshall dns_name_packet: %d\n", ndr_err)); - ret = 1; - goto error; - } - - NDR_PRINT_DEBUG(dns_name_packet, in_packet); - -error: - talloc_free(mem_ctx); - return ret; -} diff --git a/utils/wscript_build b/utils/wscript_build deleted file mode 100644 index bb13bc7..0000000 --- a/utils/wscript_build +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python - -bld.SAMBA_BINARY('samba-dig', - source='samba-dig.c', - deps='samba-util NDR_DNS tevent clidns' - ) - diff --git a/wscript_build b/wscript_build index 0098036..ec673ce 100644 --- a/wscript_build +++ b/wscript_build @@ -136,7 +136,6 @@ bld.RECURSE('libds/common') bld.RECURSE('source3') bld.RECURSE('dfs_server') bld.RECURSE('file_server') -bld.RECURSE('utils') bld.RECURSE('lib/krb5_wrap') bld.RECURSE('testsuite/headers') -- 1.7.7