[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via c019302 ccan/tally: don't use SIZE_MAX. from 44a016c build: we no longer put #if _SAMBA_BUILD_ == 4 in public headers http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit c019302e65051f214c5ea2ef908aa0ef79c8b12e Author: Rusty Russell ru...@rustcorp.com.au Date: Wed Jul 6 14:47:44 2011 +0930 ccan/tally: don't use SIZE_MAX. Michael Adam points out this broke the build farm (ie. OSF1 axp V5.1 2650 alpha) so fixed in CCAN and imported from af7a902d74a7926693f55da9e21a67dde46931d4: Turns out it's not standard (thanks Samba build farm!) And the previous test had a hole in it anyway. This one is more conservative. Signed-off-by: Rusty Russell ru...@rustcorp.com.au Autobuild-User: Rusty Russell ru...@rustcorp.com.au Autobuild-Date: Wed Jul 6 08:34:05 CEST 2011 on sn-devel-104 --- Summary of changes: lib/ccan/tally/tally.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/lib/ccan/tally/tally.c b/lib/ccan/tally/tally.c index b1839be..396474b 100644 --- a/lib/ccan/tally/tally.c +++ b/lib/ccan/tally/tally.c @@ -27,8 +27,8 @@ struct tally *tally_new(unsigned buckets) if (buckets == 0) buckets = 1; - /* Check for overflow. */ - if (buckets SIZE_MAX / buckets sizeof(tally-counts[0])) + /* Overly cautious check for overflow. */ + if (sizeof(*tally) * buckets / sizeof(*tally) != buckets) return NULL; tally = malloc(sizeof(*tally) + sizeof(tally-counts[0])*(buckets-1)); if (tally) { -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 7d96a45 s3: Remove cli_errstr from cmd_posix_open via c33a5a6 s3: Fix error logic in posix_open via c1fdec7 s3: Remove a few uses of cli_errstr via 26782fb s3: make cli_resolve_path return NTSTATUS from c019302 ccan/tally: don't use SIZE_MAX. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 7d96a4594bcbaa75d82779d70e2dec658b9508d6 Author: Volker Lendecke v...@samba.org Date: Tue Jul 5 19:55:25 2011 +0200 s3: Remove cli_errstr from cmd_posix_open Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Wed Jul 6 09:45:11 CEST 2011 on sn-devel-104 commit c33a5a659c82eda365e4dacfe665ce401e92f476 Author: Volker Lendecke v...@samba.org Date: Tue Jul 5 19:51:09 2011 +0200 s3: Fix error logic in posix_open commit c1fdec7efce159bcc9aa146d2ce3485dccc6476a Author: Volker Lendecke v...@samba.org Date: Tue Jul 5 19:42:46 2011 +0200 s3: Remove a few uses of cli_errstr commit 26782fbbf3a7885746aa17be259607dd2d418347 Author: Volker Lendecke v...@samba.org Date: Sun Jul 3 20:53:55 2011 +0200 s3: make cli_resolve_path return NTSTATUS This looks larger than it is. No parameters needed changing. --- Summary of changes: source3/client/client.c | 212 - source3/libsmb/clidfs.c | 78 --- source3/libsmb/libsmb_dir.c | 51 +- source3/libsmb/libsmb_file.c | 54 +++ source3/libsmb/libsmb_stat.c |8 +- source3/libsmb/libsmb_xattr.c | 13 ++- source3/libsmb/proto.h| 14 ++-- source3/utils/net_rpc.c |6 +- 8 files changed, 269 insertions(+), 167 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/client/client.c b/source3/client/client.c index bc653d5..e2efad8 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -311,8 +311,11 @@ static int do_dskattr(void) TALLOC_CTX *ctx = talloc_tos(); NTSTATUS status; - if ( !cli_resolve_path(ctx, , auth_info, cli, client_get_cur_dir(), targetcli, targetpath)) { - d_printf(Error in dskattr: %s\n, cli_errstr(cli)); + status = cli_resolve_path(ctx, , auth_info, cli, + client_get_cur_dir(), targetcli, + targetpath); + if (!NT_STATUS_IS_OK(status)) { + d_printf(Error in dskattr: %s\n, nt_errstr(status)); return 1; } @@ -365,6 +368,7 @@ static int do_cd(const char *new_dir) uint32 attributes; int ret = 1; TALLOC_CTX *ctx = talloc_stackframe(); + NTSTATUS status; newdir = talloc_strdup(ctx, new_dir); if (!newdir) { @@ -406,8 +410,10 @@ static int do_cd(const char *new_dir) new_cd = clean_name(ctx, new_cd); client_set_cur_dir(new_cd); - if ( !cli_resolve_path(ctx, , auth_info, cli, new_cd, targetcli, targetpath)) { - d_printf(cd %s: %s\n, new_cd, cli_errstr(cli)); + status = cli_resolve_path(ctx, , auth_info, cli, new_cd, + targetcli, targetpath); + if (!NT_STATUS_IS_OK(status)) { + d_printf(cd %s: %s\n, new_cd, nt_errstr(status)); client_set_cur_dir(saved_dir); goto out; } @@ -421,7 +427,6 @@ static int do_cd(const char *new_dir) Except Win9x doesn't support the qpathinfo_basic() call. */ if (targetcli-protocol PROTOCOL_LANMAN2 !targetcli-win95) { - NTSTATUS status; status = cli_qpathinfo_basic(targetcli, targetpath, sbuf, attributes); @@ -437,7 +442,6 @@ static int do_cd(const char *new_dir) goto out; } } else { - NTSTATUS status; targetpath = talloc_asprintf(ctx, %s%s, @@ -858,8 +862,12 @@ NTSTATUS do_list(const char *mask, /* check for dfs */ - if ( !cli_resolve_path(ctx, , auth_info, cli, head, targetcli, targetpath ) ) { - d_printf(do_list: [%s] %s\n, head, cli_errstr(cli)); + status = cli_resolve_path(ctx, , auth_info, cli, + head, targetcli, + targetpath); + if (!NT_STATUS_IS_OK(status)) { + d_printf(do_list: [%s] %s\n, head, +nt_errstr(status)); remove_do_list_queue_head(); continue; } @@ -897,8 +905,9 @@ NTSTATUS do_list(const
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 2dfc898 s3: Follow the TALLOC_FREE convention in source3 via 6fcb3bb s3: Fix Coverity ID 2586 -- NO_EFFECT from 7d96a45 s3: Remove cli_errstr from cmd_posix_open http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 2dfc898d1a3927fa01de0f2afe72864f30a1ca58 Author: Volker Lendecke v...@samba.org Date: Wed Jul 6 09:39:08 2011 +0200 s3: Follow the TALLOC_FREE convention in source3 Autobuild-User: Volker Lendecke vlen...@samba.org Autobuild-Date: Wed Jul 6 11:01:05 CEST 2011 on sn-devel-104 commit 6fcb3bbdae835f513e5c539eddb437f2ae4c1c88 Author: Volker Lendecke v...@samba.org Date: Wed Jul 6 09:37:04 2011 +0200 s3: Fix Coverity ID 2586 -- NO_EFFECT tsocket_address_bsd_sockaddr returns ssize_t, and on some systems socklen_t is unsigned. So (len 0) could never have turned true. Volker --- Summary of changes: source3/lib/util_sock.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c index a35bd58..867646b 100644 --- a/source3/lib/util_sock.c +++ b/source3/lib/util_sock.c @@ -1135,7 +1135,7 @@ int get_remote_hostname(const struct tsocket_address *remote_address, char tmp_name[MAX_DNS_NAME_LENGTH]; struct name_addr_pair nc; struct sockaddr_storage ss; - socklen_t len; + ssize_t len; int rc; if (!lp_hostname_lookups()) { @@ -1205,7 +1205,7 @@ int get_remote_hostname(const struct tsocket_address *remote_address, gai_strerror(rc))); strlcpy(name_buf, p, sizeof(name_buf)); - talloc_free(p); + TALLOC_FREE(p); } else { if (!matchname(name_buf, (struct sockaddr *)ss, len)) { DEBUG(0,(matchname failed on %s\n, name_buf)); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 310fff0 s3:sharesec: also initialize pgranted if get_share_security() returns NULL from 2dfc898 s3: Follow the TALLOC_FREE convention in source3 http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 310fff02a68d87a8af3e2cff0560669eb8bb091a Author: Stefan Metzmacher me...@samba.org Date: Tue Jul 5 16:59:41 2011 +0200 s3:sharesec: also initialize pgranted if get_share_security() returns NULL metze Autobuild-User: Stefan Metzmacher me...@samba.org Autobuild-Date: Wed Jul 6 12:54:30 CEST 2011 on sn-devel-104 --- Summary of changes: source3/lib/sharesec.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index 0c06d7b..66e3401 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -423,6 +423,9 @@ bool share_access_check(const struct security_token *token, psd = get_share_security(talloc_tos(), sharename, sd_size); if (!psd) { + if (pgranted != NULL) { + *pgranted = desired_access; + } return True; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 93ad34c s3:test: catch more errors in test_access_check() in the smbclient_s3 test via 4af8615 s3:registry: update copyright for the registry db implementation via f5bc4de examples/VFS: try to fix the build on openbsd, adding alternative spellings of autoconf/header from 310fff0 s3:sharesec: also initialize pgranted if get_share_security() returns NULL http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 93ad34c4ad1a8c0e68eed0ddf69a332a71ba860c Author: Michael Adam ob...@samba.org Date: Wed Jul 6 12:24:13 2011 +0200 s3:test: catch more errors in test_access_check() in the smbclient_s3 test Autobuild-User: Michael Adam ob...@samba.org Autobuild-Date: Wed Jul 6 14:07:13 CEST 2011 on sn-devel-104 commit 4af8615da8494b65eae189c697bcfecb4ce7c889 Author: Michael Adam ob...@samba.org Date: Wed Jul 6 12:09:52 2011 +0200 s3:registry: update copyright for the registry db implementation commit f5bc4de1cd1f2453eb18e8056d1c09d41570caba Author: Michael Adam ob...@samba.org Date: Wed Jul 6 10:37:40 2011 +0200 examples/VFS: try to fix the build on openbsd, adding alternative spellings of autoconf/header The host samba-amd64 on the build farm running openbsd 4.8 broke. Taking over the additional spellings of autoconf and autoheader from the source3/autogen.sh script should fix it. --- Summary of changes: examples/VFS/autogen.sh |5 +++-- source3/registry/reg_backend_db.c |3 ++- source3/script/tests/test_smbclient_s3.sh | 16 3 files changed, 21 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/examples/VFS/autogen.sh b/examples/VFS/autogen.sh index 2239198..8c6c909 100755 --- a/examples/VFS/autogen.sh +++ b/examples/VFS/autogen.sh @@ -4,8 +4,9 @@ ## insert all possible names (only works with ## autoconf 2.x -TESTAUTOHEADER=autoheader autoheader-2.53 autoheader2.50 -TESTAUTOCONF=autoconf autoconf-2.53 autoconf2.50 +TESTAUTOHEADER=autoheader autoheader-2.53 autoheader2.50 autoheader259 autoheader253 +TESTAUTOCONF=autoconf autoconf-2.53 autoconf2.50 autoconf259 autoconf253 + AUTOHEADERFOUND=0 AUTOCONFFOUND=0 diff --git a/source3/registry/reg_backend_db.c b/source3/registry/reg_backend_db.c index 88ac393..65ff0ae 100644 --- a/source3/registry/reg_backend_db.c +++ b/source3/registry/reg_backend_db.c @@ -2,7 +2,8 @@ * Unix SMB/CIFS implementation. * Virtual Windows Registry Layer * Copyright (C) Gerald Carter 2002-2005 - * Copyright (C) Michael Adam 2007-2009 + * Copyright (C) Michael Adam 2007-2011 + * Copyright (C) Gregor Beck 2011 * * 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 diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index 167b5ae..fa721cb 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -410,6 +410,14 @@ EOF test_ccache_access() { $WBINFO --ccache-save=${USERNAME}%${PASSWORD} +ret=$? + +if [ $ret != 0 ] ; then + echo wbinfo failed to store creds in cache (user='${USERNAME}', pass='${PASSWORD}') + false + return +fi + $SMBCLIENT //$SERVER_IP/tmp -C -U ${USERNAME}% \ -c quit 21 ret=$? @@ -421,6 +429,14 @@ test_ccache_access() fi $WBINFO --ccache-save=${USERNAME}%GarBage +ret=$? + +if [ $ret != 0 ] ; then + echo wbinfo failed to store creds in cache (user='${USERNAME}', pass='GarBage') + false + return +fi + $SMBCLIENT //$SERVER_IP/tmp -C -U ${USERNAME}% \ -c quit 21 ret=$? -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via f9601a9 s3:sharesec: return an error if get_share_security() returns NULL from 93ad34c s3:test: catch more errors in test_access_check() in the smbclient_s3 test http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f9601a91805651963834e37e27800a74931468b7 Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 12:31:41 2011 +0200 s3:sharesec: return an error if get_share_security() returns NULL This indicates an error, as it uses get_share_security_default() if no security descriptor is configured. Jeremy, please check. metze Autobuild-User: Stefan Metzmacher me...@samba.org Autobuild-Date: Wed Jul 6 15:40:23 CEST 2011 on sn-devel-104 --- Summary of changes: source3/lib/sharesec.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index 66e3401..2f62535 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -426,7 +426,7 @@ bool share_access_check(const struct security_token *token, if (pgranted != NULL) { *pgranted = desired_access; } - return True; + return false; } status = se_access_check(psd, token, desired_access, granted); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-5-test updated
The branch, v3-5-test has been updated via 70e9d82 WHATSNEW: Add changes since 3.5.9. from 12a4b56 s3:librpc/gen_ndr: regen after wbint.idl changes http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test - Log - commit 70e9d82abeca30fb0503e0e69503258e52f86d4d Author: Karolin Seeger ksee...@samba.org Date: Wed Jul 6 16:12:27 2011 +0200 WHATSNEW: Add changes since 3.5.9. Karolin --- Summary of changes: WHATSNEW.txt | 35 --- 1 files changed, 32 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/WHATSNEW.txt b/WHATSNEW.txt index 29a3c27..8963b2c 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -1,6 +1,6 @@ == Release Notes for Samba 3.5.10 - , 2011 + July 12, 2011 == @@ -8,12 +8,41 @@ This is the latest stable release of Samba 3.5. Major enhancements in Samba 3.5.10 include: -o +o Fix access to Samba shares when Windows security patch KB2536276 is installed + (bug #7460). +o Fix DoS in Winbind and smbd with many file descriptors open (bug #7949). +o Fix Winbind panics if verify_idpool() fails (bug #8253). + Changes since 3.5.9: -o +o Jeremy Allison j...@samba.org +* BUG 8254: Make acl check permissions = no working in all cases. + + +o Gregor Beck gb...@sernet.de +* BUG 8253: Fix Winbind panics if verify_idpool() fails. + + +o David Disseldorp dd...@suse.de +* BUG 8269: Stop spamming log with Could not find child X -- ignoring + messages in smbd. + + +o Björn Jacke b...@sernet.de +* BUG 7460: Include sys/file.h only when available. + + +o Volker Lendecke v...@samba.org +* BUG 7841: Explicitly pass domain_sid to wbint_LookupRids(). +* BUG 8238: Fix access to Samba shares when Windows security patch + KB2536276 is installed. + + +o Stefan Metzmacher me...@samba.org +* BUG 7949: Fix DoS in Winbind and smbd with many file descriptors open. +* BUG 8276: Close all sockets attached to a subnet in close_subnet(). ## -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 0b8184d s4:torture/smb2: s/smb2cli_unlock/test_smb2_unlock via 43c865a s4:torture/smb2: s/smb2cli_lock/test_smb2_lock via 8a22906 s3:libsmb: use clistr_pull_talloc() in cli_qfilename() via a1df729 s3:libsmb: let cli_qfileinfo[_recv]() return recv_flags2 via 2b0cc3c s3:libsmb: use clistr_pull_talloc() in cli_get_fs_volume_info() via 27736be s3:libsmb: the SMB_QUERY_FS_VOLUME_INFO response needs at least 18 data bytes via bc98d00 s3:libsmb: don't use cli-inbuf in cli_dfs_get_referral() via af61f6f s3:libsmb: fix error handling in cli_dfs_get_referral() from f9601a9 s3:sharesec: return an error if get_share_security() returns NULL http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 0b8184d9d40c6ccb10209973e6bbeccee4dc000a Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 17:52:33 2011 +0200 s4:torture/smb2: s/smb2cli_unlock/test_smb2_unlock metze Autobuild-User: Stefan Metzmacher me...@samba.org Autobuild-Date: Wed Jul 6 19:07:42 CEST 2011 on sn-devel-104 commit 43c865a38e534ec6f01643f9609cbccd9de976f8 Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 17:52:33 2011 +0200 s4:torture/smb2: s/smb2cli_lock/test_smb2_lock metze commit 8a2290667ca4c530321d366d3dd09f4757e9ac1d Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 14:35:13 2011 +0200 s3:libsmb: use clistr_pull_talloc() in cli_qfilename() metze commit a1df729f7b498c770a013ddabb38d0b2e8608b67 Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 14:04:15 2011 +0200 s3:libsmb: let cli_qfileinfo[_recv]() return recv_flags2 metze commit 2b0cc3c412d2cad5e35728f86cc66109f5dc4676 Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 13:57:20 2011 +0200 s3:libsmb: use clistr_pull_talloc() in cli_get_fs_volume_info() metze commit 27736bed83191ccad69e5ad7732cc8ed60c5864f Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 13:21:41 2011 +0200 s3:libsmb: the SMB_QUERY_FS_VOLUME_INFO response needs at least 18 data bytes metze commit bc98d004c9dc22ff1438bfd1d9ddeaca5a3f6179 Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 13:04:26 2011 +0200 s3:libsmb: don't use cli-inbuf in cli_dfs_get_referral() The rdata buffer returned by cli_trans() doesn't belong to cli-inbuf, so don't use it. metze commit af61f6fce6a219a78238d7187476addaa1e00525 Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 15:57:22 2011 +0200 s3:libsmb: fix error handling in cli_dfs_get_referral() We should not return NT_STATUS_OK on error. metze --- Summary of changes: source3/client/client.c |7 +++-- source3/libsmb/clidfs.c | 26 +--- source3/libsmb/clifile.c| 14 ++-- source3/libsmb/clifsinfo.c | 34 ++-- source3/libsmb/clirap.c | 32 ++ source3/libsmb/clirap.h |7 +++-- source3/libsmb/proto.h |3 +- source3/torture/torture.c |6 ++-- source4/torture/smb2/lock.c | 44 +- 9 files changed, 118 insertions(+), 55 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/client/client.c b/source3/client/client.c index e2efad8..aa26d99 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -3767,12 +3767,13 @@ static int cmd_rename(void) static int cmd_volume(void) { - fstring volname; - uint32 serial_num; + char *volname; + uint32_t serial_num; time_t create_date; NTSTATUS status; - status = cli_get_fs_volume_info(cli, volname, serial_num, + status = cli_get_fs_volume_info(cli, talloc_tos(), + volname, serial_num, create_date); if (!NT_STATUS_IS_OK(status)) { d_printf(Error %s getting volume info\n, nt_errstr(status)); diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index 9c0f1f4..2287812 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -608,7 +608,8 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx, { unsigned int data_len = 0; unsigned int param_len = 0; - uint16 setup[1]; + uint16_t setup[1]; + uint16_t recv_flags2; uint8_t *param = NULL; uint8_t *rdata = NULL; char *p; @@ -643,16 +644,13 @@ NTSTATUS cli_dfs_get_referral(TALLOC_CTX *ctx, setup, 1, 0, param, param_len, 2, NULL, 0, cli-max_xmit, - NULL, + recv_flags2,
Re: [SCM] Samba Shared Repository - branch master updated
On Wed, Jul 06, 2011 at 03:41:02PM +0200, Stefan Metzmacher wrote: The branch, master has been updated via f9601a9 s3:sharesec: return an error if get_share_security() returns NULL from 93ad34c s3:test: catch more errors in test_access_check() in the smbclient_s3 test http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit f9601a91805651963834e37e27800a74931468b7 Author: Stefan Metzmacher me...@samba.org Date: Wed Jul 6 12:31:41 2011 +0200 s3:sharesec: return an error if get_share_security() returns NULL This indicates an error, as it uses get_share_security_default() if no security descriptor is configured. Jeremy, please check. +1 from me - this fixes an error condition. Thanks !
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 749d022 s4 provision: Add some of the AD-specific DNS records to the directory via a8d3bdb s4 provision: split up DNS provisioning into generic and samba-specific ldifs from 0b8184d s4:torture/smb2: s/smb2cli_unlock/test_smb2_unlock http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 749d022a0c68dd7d9f62b034e37fbe509dba2c46 Author: Kai Blin k...@samba.org Date: Mon Jun 27 11:25:39 2011 +0200 s4 provision: Add some of the AD-specific DNS records to the directory Signed-off-by: Kai Blin k...@samba.org Autobuild-User: Kai Blin k...@samba.org Autobuild-Date: Thu Jul 7 02:29:53 CEST 2011 on sn-devel-104 commit a8d3bdb48da71dd65385e4355e46a595ef32dbe0 Author: Kai Blin k...@samba.org Date: Sun Jun 26 00:36:25 2011 +0200 s4 provision: split up DNS provisioning into generic and samba-specific ldifs Signed-off-by: Kai Blin k...@samba.org --- Summary of changes: .../scripting/python/samba/provision/__init__.py |8 +- .../scripting/python/samba/provision/sambadns.py | 231 source4/setup/provision_dns_add.ldif | 23 +-- source4/setup/provision_dns_add_samba.ldif | 17 ++ 4 files changed, 258 insertions(+), 21 deletions(-) create mode 100644 source4/scripting/python/samba/provision/sambadns.py create mode 100644 source4/setup/provision_dns_add_samba.ldif Changeset truncated at 500 lines: diff --git a/source4/scripting/python/samba/provision/__init__.py b/source4/scripting/python/samba/provision/__init__.py index 5aabd36..f2b8c04 100644 --- a/source4/scripting/python/samba/provision/__init__.py +++ b/source4/scripting/python/samba/provision/__init__.py @@ -74,6 +74,8 @@ from samba.provision.backend import ( LDBBackend, OpenLDAPBackend, ) +from samba.provision.sambadns import setup_ad_dns + import samba.param import samba.registry from samba.schema import Schema @@ -1101,9 +1103,9 @@ def setup_self_join(samdb, names, machinepass, dnspass, RIDALLOCATIONEND: str(next_rid + 100 + 499), }) -# This is partially Samba4 specific and should be replaced by the correct +# This is Samba4 specific and should be replaced by the correct # DNS AD-style setup -setup_add_ldif(samdb, setup_path(provision_dns_add.ldif), { +setup_add_ldif(samdb, setup_path(provision_dns_add_samba.ldif), { DNSDOMAIN: names.dnsdomain, DOMAINDN: names.domaindn, DNSPASS_B64: b64encode(dnspass.encode('utf-16-le')), @@ -1761,6 +1763,8 @@ def provision(logger, session_info, credentials, smbconf=None, dnsdomain=names.dnsdomain, dns_keytab_path=paths.dns_keytab, dnspass=dnspass) +setup_ad_dns(samdb, names=names, hostip=hostip, hostip6=hostip6) + domainguid = samdb.searchone(basedn=domaindn, attribute=objectGUID) assert isinstance(domainguid, str) diff --git a/source4/scripting/python/samba/provision/sambadns.py b/source4/scripting/python/samba/provision/sambadns.py new file mode 100644 index 000..6b8561e --- /dev/null +++ b/source4/scripting/python/samba/provision/sambadns.py @@ -0,0 +1,231 @@ +# Unix SMB/CIFS implementation. +# backend code for provisioning DNS for a Samba4 server +# +# Copyright (C) Kai Blin k...@samba.org 2011 +# +# 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 http://www.gnu.org/licenses/. +# + +DNS-related provisioning + +import os +import ldb +import samba +from samba.ndr import ndr_pack +from samba import read_and_sub_file +from samba.dcerpc import dnsp + +class ARecord(dnsp.DnssrvRpcRecord): +def __init__(self, ip_addr, serial=1, ttl=3600): +super(ARecord, self).__init__() +self.wType = dnsp.DNS_TYPE_A +self.dwSerial = serial +self.dwTtlSeconds = ttl +self.data = ip_addr + +class Record(dnsp.DnssrvRpcRecord): +def __init__(self, ip6_addr, serial=1, ttl=3600): +super(Record, self).__init__() +self.wType = dnsp.DNS_TYPE_ +self.dwSerial = serial +self.dwTtlSeconds = ttl +self.data = ip6_addr + +class NSRecord(dnsp.DnssrvRpcRecord):