[SCM] Samba Shared Repository - branch master updated

2011-04-04 Thread Matthias Dieter Wallnöfer
The branch, master has been updated
   via  513574a talloc - some documentation changes
  from  f00d258 s4-dsdb: implemented creation of conflict records

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 513574afd759bcb3832374d3ae170f1ed0b0062b
Author: Matthias Dieter Wallnöfer m...@samba.org
Date:   Thu Mar 31 21:32:51 2011 +0200

talloc - some documentation changes

- Fix some typos
- Document better the differences in the behaviour between talloc 1.X and 
2.X.
  Previously this seemed a bit spongy to me.

Reviewed-by: Jelmer + Tridge

Autobuild-User: Matthias Dieter Wallnöfer m...@samba.org
Autobuild-Date: Mon Apr  4 11:05:42 CEST 2011 on sn-devel-104

---

Summary of changes:
 lib/talloc/talloc.h |   49 +++
 lib/talloc/talloc_guide.txt |   52 +++---
 2 files changed, 48 insertions(+), 53 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/talloc.h b/lib/talloc/talloc.h
index 64879b7..96c7e24 100644
--- a/lib/talloc/talloc.h
+++ b/lib/talloc/talloc.h
@@ -173,18 +173,11 @@ void *talloc_init(const char *fmt, ...) 
PRINTF_ATTRIBUTE(1,2);
  * destructors. Likewise, if ptr is NULL, then the function will make
  * no modifications and return -1.
  *
- * If this pointer has an additional parent when talloc_free() is called
- * then the memory is not actually released, but instead the most
- * recently established parent is destroyed. See talloc_reference() for
- * details on establishing additional parents.
- *
- * For more control on which parent is removed, see talloc_unlink()
- *
- * talloc_free() operates recursively on its children.
- *
- * From the 2.0 version of talloc, as a special case, talloc_free() is
- * refused on pointers that have more than one parent, as talloc would
- * have no way of knowing which parent should be removed. To free a
+ * From version 2.0 and onwards, as a special case, talloc_free() is
+ * refused on pointers that have more than one parent associated, as talloc
+ * would have no way of knowing which parent should be removed. This is
+ * different from older versions in the sense that always the reference to
+ * the most recently established parent has been destroyed. Hence to free a
  * pointer that has more than one parent please use talloc_unlink().
  *
  * To help you find problems in your code caused by this behaviour, if
@@ -201,6 +194,8 @@ void *talloc_init(const char *fmt, ...) 
PRINTF_ATTRIBUTE(1,2);
  * talloc_set_log_stderr() for more information on talloc logging
  * functions.
  *
+ * talloc_free() operates recursively on its children.
+ *
  * @param[in]  ptr  The chunk to be freed.
  *
  * @return  Returns 0 on success and -1 on error. A possible
@@ -233,7 +228,10 @@ int _talloc_free(void *ptr, const char *location);
  * The function walks along the list of all children of a talloc context and
  * talloc_free()s only the children, not the context itself.
  *
- * @param[in]  ptr  The chunk that you want to free the children of.
+ * A NULL argument is handled as no-op.
+ *
+ * @param[in]  ptr  The chunk that you want to free the children of
+ *  (NULL is allowed too)
  */
 void talloc_free_children(void *ptr);
 
@@ -702,9 +700,9 @@ void *_talloc_memdup(const void *t, const void *p, size_t 
size, const char *name
 /**
  * @brief Assign a type to a talloc chunk.
  *
- * This macro allows you to force the name of a pointer to be a particular 
type.
- * This can be used in conjunction with talloc_get_type() to do type checking 
on
- * void* pointers.
+ * This macro allows you to force the name of a pointer to be of a particular
+ * type. This can be used in conjunction with talloc_get_type() to do type
+ * checking on void* pointers.
  *
  * It is equivalent to this:
  *
@@ -905,9 +903,9 @@ size_t talloc_reference_count(const void *ptr);
  *   will reduce the number of parents of this pointer by 1, and will
  *   cause this pointer to be freed if it runs out of parents.
  *
- * - you can talloc_free() the pointer itself. That will destroy the
- *   most recently established parent to the pointer and leave the
- *   pointer as a child of its current parent.
+ * - you can talloc_free() the pointer itself if it has at maximum one
+ *   parent. This behaviour has been changed since the release of version
+ *   2.0. Further informations in the description of talloc_free.
  *
  * For more control on which parent to remove, see talloc_unlink()
  * @param[in]  ctx  The additional parent.
@@ -942,9 +940,10 @@ void *_talloc_reference_loc(const void *context, const 
void *ptr, const char *lo
  * either be a context used in talloc_reference() with this pointer, or must be
  * a direct parent of ptr.
  *
- * Usually you can just 

[SCM] Samba Shared Repository - branch master updated

2011-04-04 Thread Andrew Bartlett
The branch, master has been updated
   via  a3ef974 s3-rpc_server Remove comment, yes the key is correct.
   via  77e6716 s3-auth consolidate create_local_token() into 
make_server_info_krb5()
   via  841d0bc s3-selftest Remove more instances of /tmp in 
test_smbclient_s3.sh
   via  6351dee s3-selftest Add testing of kerberos login
   via  55134c9 s4-credentials Add a command line hook to set the kerberos 
credentials cache
   via  ffb6003 s3-selftest Disable log rotation in 'make test'
  from  513574a talloc - some documentation changes

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit a3ef974d30fd1adcf1a25940c2a2fa7e03fad6a0
Author: Andrew Bartlett abart...@samba.org
Date:   Thu Feb 10 21:40:07 2011 +1100

s3-rpc_server Remove comment, yes the key is correct.

Autobuild-User: Andrew Bartlett abart...@samba.org
Autobuild-Date: Mon Apr  4 13:31:52 CEST 2011 on sn-devel-104

commit 77e67163daaa670ee43ddbc4fd3fd3e8c3c38d49
Author: Andrew Bartlett abart...@samba.org
Date:   Thu Feb 10 21:04:01 2011 +1100

s3-auth consolidate create_local_token() into make_server_info_krb5()

This ensures that all callers don't need to each add builtin groups
and privileges to the user's token

Andrew Bartlett

commit 841d0bc9e81dbe56352ac8b12e63e8257963936e
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Apr 4 19:18:47 2011 +1000

s3-selftest Remove more instances of /tmp in test_smbclient_s3.sh

commit 6351dee4d810bfa20c3a892d0eba3b2ac828e193
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Apr 4 19:13:17 2011 +1000

s3-selftest Add testing of kerberos login

This uses a pre-calculated credentials cache, that should be valid
until 2036.

Andrew Bartlett

commit 55134c9a9e4a47c6a8ed89ef10c95c0fa0d4daaf
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Apr 4 19:11:39 2011 +1000

s4-credentials Add a command line hook to set the kerberos credentials cache

This allows this to be specified independent of the KRB5CCNAME
environment variable (in this case, it's harder than it should be to
set up in the make test for s3 that way).

Andrew Bartlett

commit ffb600330289e59071ffbbb071a7d20afb7ab09f
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Apr 4 09:22:03 2011 +1000

s3-selftest Disable log rotation in 'make test'

---

Summary of changes:
 selftest/target/Samba3.pm |   66 +
 source3/auth/proto.h  |4 +-
 source3/auth/user_krb5.c  |   12 +-
 source3/rpc_server/dcesrv_gssapi.c|2 +-
 source3/rpc_server/srv_pipe.c |   12 -
 source3/script/tests/test_smbclient_s3.sh |8 ++--
 source3/selftest/ktest-krb5_ccache|  Bin 0 - 11966 bytes
 source3/selftest/ktest-secrets.tdb|  Bin 0 - 45056 bytes
 source3/selftest/tests.py |   19 +++--
 source3/smbd/sesssetup.c  |   20 +
 source3/smbd/smb2_sesssetup.c |   22 ++
 source4/lib/cmdline/popt_credentials.c|   14 ++-
 12 files changed, 117 insertions(+), 62 deletions(-)
 create mode 100644 source3/selftest/ktest-krb5_ccache
 create mode 100644 source3/selftest/ktest-secrets.tdb


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 38148eb..de3fffb 100644
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -102,6 +102,8 @@ sub setup_env($$$)
return $self-setup_dc($path/dc);
} elsif ($envname eq secshare) {
return $self-setup_secshare($path/secshare);
+   } elsif ($envname eq ktest) {
+   return $self-setup_ktest($path/ktest);
} elsif ($envname eq secserver) {
if (not defined($self-{vars}-{dc})) {
$self-setup_dc($path/dc);
@@ -255,6 +257,69 @@ sub setup_secserver($$$)
return $ret;
 }
 
+sub setup_ktest($$$)
+{
+   my ($self, $prefix, $dcvars) = @_;
+
+   print PROVISIONING server with security=ads...;
+
+   my $ktest_options = 
+workgroup = KTEST
+realm = ktest.samba.example.com
+   security = ads
+username map = $prefix/lib/username.map
+;
+
+   my $ret = $self-provision($prefix,
+  LOCALKTEST6,
+  5,
+  localktest6pass,
+  $ktest_options);
+
+   $ret or die(Unable to provision);
+
+   open(USERMAP, $prefix/lib/username.map) or die(Unable to open 
$prefix/lib/username.map);
+   print USERMAP 
+$ret-{USERNAME} = KTEST\\Administrator
+;
+   close(USERMAP);
+
+#This is the secrets.tdb created by 'net ads join' from Samba3 to a

[SCM] Samba Shared Repository - branch master updated

2011-04-04 Thread Michael Adam
The branch, master has been updated
   via  a217ec6 s3-net: add command net idmap check
   via  8fc8c88 s3: add function srprs_quoted to parse strings written with 
cbuf_print_quoted
   via  9272614 s3: add function cbuf_print_quoted
   via  340f20d s3: add function dbwrap_traverse
   via  84019ea s3: add function dbwrap_trans_traverse
   via  10cec2f s3: fix cbuf_swapptr
   via  b7e330a s3:idmap_tdb2: fix build of tdb2
  from  a3ef974 s3-rpc_server Remove comment, yes the key is correct.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit a217ec64ec5b189f697c58456dad6a6151f763ab
Author: Gregor Beck gb...@sernet.de
Date:   Fri Jan 28 10:55:58 2011 +0100

s3-net: add command net idmap check

This is a tool to check the consistency of an idmap tdb database.

The default mode is to scan the database and list invalid entries,
e.g. records with an invalid format, or records which are valid
but for which the reverse mapping entry is missing.

With the --repair switch, one can enter an interactive
repair mode which will prompt for each invalid entry found
with the option to delete, skip or edit the record.

There is also a non-interactive repair mode triggered by --auto
which will remove all records with invalid content and fill up
mappings which are missing the reverse entry.

The --test parameter lets net idmap check only list the
changes that would be written and not actually commit them to
the database.

The --lock option allows to lock the database already in the
first reading traverse, in order to remove the race when the
database has to be closed and reopened again before writing
the changes.

Signed-off-by: Michael Adam ob...@samba.org

Autobuild-User: Michael Adam ob...@samba.org
Autobuild-Date: Mon Apr  4 18:21:09 CEST 2011 on sn-devel-104

commit 8fc8c880074d01af5a2d92fbd9b2fb042bdd59f3
Author: Gregor Beck gb...@sernet.de
Date:   Thu Mar 17 10:22:25 2011 +0100

s3: add function srprs_quoted to parse strings written with 
cbuf_print_quoted

commit 9272614d9dad501ad95ac76b40f53e433a4878bc
Author: Gregor Beck gb...@sernet.de
Date:   Thu Mar 17 10:20:30 2011 +0100

s3: add function cbuf_print_quoted

commit 340f20ddb01da08b6a6ad11143768ffd69b7944e
Author: Gregor Beck gb...@sernet.de
Date:   Fri Mar 18 14:39:15 2011 +0100

s3: add function dbwrap_traverse

commit 84019ea5288ec3ec83739aa8142ec50cef0f1b82
Author: Gregor Beck gb...@sernet.de
Date:   Wed Mar 16 09:13:40 2011 +0100

s3: add function dbwrap_trans_traverse

commit 10cec2f0ec752cbec2055b0aa878b4814f3c1309
Author: Gregor Beck gb...@sernet.de
Date:   Wed Mar 16 09:12:28 2011 +0100

s3: fix cbuf_swapptr

commit b7e330a2b325463e49abceb8f3e8d792248179ed
Author: Michael Adam ob...@samba.org
Date:   Mon Apr 4 11:46:31 2011 +0200

s3:idmap_tdb2: fix build of tdb2

The include of system/filesys.h was removed from includes.h. ...

---

Summary of changes:
 source3/Makefile.in|2 +-
 source3/include/dbwrap.h   |7 +
 source3/lib/cbuf.c |   35 +
 source3/lib/cbuf.h |   17 +-
 source3/lib/dbwrap_util.c  |   38 +
 source3/lib/srprs.c|   40 +
 source3/lib/srprs.h|   13 +-
 source3/utils/net.c|3 +
 source3/utils/net.h|3 +
 source3/utils/net_idmap.c  |   47 +-
 source3/utils/net_idmap_check.c| 1006 
 .../srv_epmapper.h = utils/net_idmap_check.h} |   38 +-
 source3/winbindd/idmap_tdb2.c  |1 +
 source3/wscript_build  |3 +-
 14 files changed, 1236 insertions(+), 17 deletions(-)
 create mode 100644 source3/utils/net_idmap_check.c
 copy source3/{rpc_server/epmapper/srv_epmapper.h = utils/net_idmap_check.h} 
(56%)


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index a0f28f1..108bfef 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1147,7 +1147,7 @@ LIBNET_SAMSYNC_OBJ = libnet/libnet_samsync.o \
 NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_help.o \
   utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
   utils/net_rpc_join.o utils/net_time.o utils/net_lookup.o \
-  utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o \
+  utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o 
utils/net_idmap_check.o\
   utils/net_status.o utils/net_rpc_printer.o utils/net_rpc_rights.o \
   utils/net_rpc_service.o 

[SCM] Samba Shared Repository - branch master updated

2011-04-04 Thread Jeremy Allison
The branch, master has been updated
   via  2ec4826 Move SET_STAT_INVALID call added by Volker as fix for bug 
8042 - Newly create files are always failed with NT_STATUS_FILE_IS_A_DIRECTORY
   via  074239a Note that check_parent_exists() doesn't change the contents 
of smb_fname (add const).
  from  a217ec6 s3-net: add command net idmap check

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 2ec48260ee377e499fe7f0fc2ca18b8a078c6aaa
Author: Jeremy Allison j...@samba.org
Date:   Mon Apr 4 10:22:03 2011 -0700

Move SET_STAT_INVALID call added by Volker as fix for bug 8042 - Newly 
create files are always failed with NT_STATUS_FILE_IS_A_DIRECTORY

Ensure we do this for all cases where the stat fails.

Jeremy

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Mon Apr  4 20:08:45 CEST 2011 on sn-devel-104

commit 074239ac2eec666abb892b5eef46ca70691ed41f
Author: Jeremy Allison j...@samba.org
Date:   Mon Apr 4 10:15:16 2011 -0700

Note that check_parent_exists() doesn't change the contents of smb_fname 
(add const).

---

Summary of changes:
 source3/smbd/filename.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 912e3a4..08bc79d 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -114,7 +114,7 @@ static NTSTATUS check_for_dot_component(const struct 
smb_filename *smb_fname)
 static NTSTATUS check_parent_exists(TALLOC_CTX *ctx,
connection_struct *conn,
bool posix_pathnames,
-   struct smb_filename *smb_fname,
+   const struct smb_filename *smb_fname,
char **pp_dirpath,
char **pp_start)
 {
@@ -440,6 +440,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
goto done;
}
 
+   /* Stat failed - ensure we don't use it. */
+   SET_STAT_INVALID(smb_fname-st);
+
if (errno == ENOENT) {
/* Optimization when creating a new file - only
   the last component doesn't exist. */
@@ -506,9 +509,6 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
}
}
 
-   /* Stat failed - ensure we don't use it. */
-   SET_STAT_INVALID(smb_fname-st);
-
/*
 * Missing last component is ok - new file.
 * Also deal with permission denied elsewhere.


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-5-test updated

2011-04-04 Thread Karolin Seeger
The branch, v3-5-test has been updated
   via  3e0f539 alpha_strcpy() is a utility function which reportedly: 
Strips out all but 'a-Z0-9' and the character in other_safe_chars and replaces 
with '_'.
   via  bb3ed43 Fix bug 8040 - smbclient segfaults when a Cyrillic netbios 
name or workgroup is configured.
  from  90e7f31 Fix bug #7996 - sgid bit lost on folder rename.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -
commit 3e0f539596fbb867b672eeaff037e81c33428309
Author: David Disseldorp dd...@suse.de
Date:   Fri Apr 1 11:21:59 2011 -0700

alpha_strcpy() is a utility function which reportedly: Strips out all but 
'a-Z0-9' and the character in other_safe_chars and replaces with '_'.

This statement does not currently hold true in all cases (e.g. src =
ТАНЦЕВАТЬ).

Part of a fix for bug 8040 - smbclient segfaults when a Cyrillic netbios
name or workgroup is configured.

commit bb3ed43584e6d2c4d64b5f7b9e70a7db7f3e859d
Author: Jeremy Allison j...@samba.org
Date:   Fri Mar 25 15:12:12 2011 -0700

Fix bug 8040 - smbclient segfaults when a Cyrillic netbios name or 
workgroup is configured.

As discovered by David Disseldorp dd...@suse.de, convert_string_talloc()
doesn't always return consistent results for a zero length string. The
API states an incoming string must *always* contain the terminating null,
but unfotunately too much code expects passing in a zero source length
to return a null terminated string, so at least ensure we return a
correct null string in the required character set and return the
correct length.

Also ensure we cannot return a zero length for a converted string
(we ensure that the returned buffer is always allocated and zero
terminated anyway) as calling code depends on the fact that returning
true from this function will *always* return a non-zero length (as
it must include the terminating null).

Note this is a different fix from what went into master (this is
identical to the fix I'm planning for 3.5.x) as convert_string_talloc()
has diverged between the two.

Jeremy.

---

Summary of changes:
 source3/lib/charcnv.c  |   24 ++--
 source3/lib/util_str.c |   12 +---
 2 files changed, 31 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 718f810..743f748 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -573,14 +573,24 @@ bool convert_string_talloc(TALLOC_CTX *ctx, charset_t 
from, charset_t to,
errno = EINVAL;
return false;
}
+
if (srclen == 0) {
-   ob = talloc_strdup(ctx, );
+   /* We really should treat this as an error, but
+  there are too many callers that need this to
+  return a NULL terminated string in the correct
+  character set. */
+   if (to == CH_UTF16LE|| to == CH_UTF16BE || to == 
CH_UTF16MUNGED) {
+   destlen = 2;
+   } else {
+   destlen = 1;
+   }
+   ob = talloc_zero_array(ctx, char, destlen);
if (ob == NULL) {
errno = ENOMEM;
return false;
}
+   *converted_size = destlen;
*dest = ob;
-   *converted_size = 0;
return true;
}
 
@@ -677,6 +687,16 @@ bool convert_string_talloc(TALLOC_CTX *ctx, charset_t 
from, charset_t to,
ob[destlen] = '\0';
ob[destlen+1] = '\0';
 
+   /* Ensure we can never return a *converted_size of zero. */
+   if (destlen == 0) {
+   /* This can happen from a bad iconv use_as_is: call. */
+   if (to == CH_UTF16LE|| to == CH_UTF16BE || to == 
CH_UTF16MUNGED) {
+   destlen = 2;
+   } else {
+   destlen = 1;
+   }
+   }
+
*converted_size = destlen;
return true;
 
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 3da2b83..d869637 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -586,7 +586,9 @@ char *safe_strcat_fn(const char *fn,
  Paranoid strcpy into a buffer of given length (includes terminating
  zero. Strips out all but 'a-Z0-9' and the character in other_safe_chars
  and replaces with '_'. Deliberately does *NOT* check for multibyte
- characters. Don't change it !
+ characters. Treats src as an array of bytes, not as a multibyte
+ string. Any byte 0x7f is automatically converted to '_'.
+ other_safe_chars must also contain an ascii string (bytes0x7f).
 **/
 
 char *alpha_strcpy_fn(const char *fn,
@@ -622,8 +624,12 @@ char 

[SCM] Samba Shared Repository - branch v3-5-test updated

2011-04-04 Thread Karolin Seeger
The branch, v3-5-test has been updated
   via  baecb5a s3: Fix Bug 8047 -- Fix mdns registration if interfaces= 
is used
  from  3e0f539 alpha_strcpy() is a utility function which reportedly: 
Strips out all but 'a-Z0-9' and the character in other_safe_chars and replaces 
with '_'.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -
commit baecb5a35e9f50140cf78e2dbdfe9f2791653875
Author: Marc A. Dahlhaus m...@wol.de
Date:   Fri Apr 1 22:24:56 2011 +0200

s3: Fix Bug 8047 -- Fix mdns registration if interfaces= is used

---

Summary of changes:
 source3/smbd/server.c |7 +++
 1 files changed, 7 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 0c59135..8c0fa80 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -600,6 +600,13 @@ static bool open_sockets_smbd(struct smbd_parent_context 
*parent,
continue;
}
 
+   /* Keep the first port for mDNS service
+* registration.
+*/
+   if (dns_port == 0) {
+   dns_port = port;
+   }
+
if (!smbd_open_one_socket(parent, ifss, port)) {
return false;
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-5-test updated

2011-04-04 Thread Karolin Seeger
The branch, v3-5-test has been updated
   via  5fc7b78 s3: Fix Coverity ID 1137: CONSTANT_EXPRESSION_RESULT
   via  ec4d201 s3: Fix Coverity ID 1136: CONSTANT_EXPRESSION_RESULT
  from  baecb5a s3: Fix Bug 8047 -- Fix mdns registration if interfaces= 
is used

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -
commit 5fc7b78c64c43fd345b96dcbc1d30f2cabfaef81
Author: Volker Lendecke v...@samba.org
Date:   Fri Apr 1 08:40:38 2011 +0200

s3: Fix Coverity ID 1137: CONSTANT_EXPRESSION_RESULT

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Fri Apr  1 09:35:19 CEST 2011 on sn-devel-104

This patch and the last one address bug #8054 - winbindd cache 
stores/retrieves
wrong sizes for 16-bit ints.

commit ec4d201d5b9b86dfead5d999e4f186316797f77f
Author: Volker Lendecke v...@samba.org
Date:   Fri Apr 1 08:40:38 2011 +0200

s3: Fix Coverity ID 1136: CONSTANT_EXPRESSION_RESULT

---

Summary of changes:
 source3/utils/ntlm_auth.c |2 +-
 source3/winbindd/winbindd_cache.c |4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/ntlm_auth.c b/source3/utils/ntlm_auth.c
index a85f123..afd0a15 100644
--- a/source3/utils/ntlm_auth.c
+++ b/source3/utils/ntlm_auth.c
@@ -736,7 +736,7 @@ static NTSTATUS do_ccache_ntlm_auth(DATA_BLOB initial_msg, 
DATA_BLOB challenge_m
 */
ctrl = get_pam_winbind_config();
 
-   if (ctrl | WINBIND_KRB5_AUTH) {
+   if (ctrl  WINBIND_KRB5_AUTH) {
wb_request.flags |= WBFLAG_PAM_CONTACT_TRUSTDOM;
}
 
diff --git a/source3/winbindd/winbindd_cache.c 
b/source3/winbindd/winbindd_cache.c
index 81970d4..64a4a1c 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -246,7 +246,7 @@ static uint16 centry_uint16(struct cache_entry *centry)
if (!centry_check_bytes(centry, 2)) {
smb_panic_fn(centry_uint16);
}
-   ret = CVAL(centry-data, centry-ofs);
+   ret = SVAL(centry-data, centry-ofs);
centry-ofs += 2;
return ret;
 }
@@ -757,7 +757,7 @@ static void centry_put_uint32(struct cache_entry *centry, 
uint32 v)
 static void centry_put_uint16(struct cache_entry *centry, uint16 v)
 {
centry_expand(centry, 2);
-   SIVAL(centry-data, centry-ofs, v);
+   SSVAL(centry-data, centry-ofs, v);
centry-ofs += 2;
 }
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-5-test updated

2011-04-04 Thread Karolin Seeger
The branch, v3-5-test has been updated
   via  0d929df Fix for servers that don't put a path separator at the end 
of the service.
  from  5fc7b78 s3: Fix Coverity ID 1137: CONSTANT_EXPRESSION_RESULT

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -
commit 0d929df7d194574d283ea5b9f4f8a45d6d214a54
Author: Larry Reid lcr...@jadesystems.ca
Date:   Sat Mar 26 15:39:27 2011 -0700

Fix for servers that don't put a path separator at the end of the service.

Fix bug 8055 - Can't See Parts of DFS CIFS Share.

---

Summary of changes:
 source3/libsmb/clidfs.c |   17 +
 1 files changed, 13 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index c588c16..0a6b902 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -896,10 +896,19 @@ bool cli_resolve_path(TALLOC_CTX *ctx,
}
 
if (extrapath  strlen(extrapath)  0) {
-   *pp_targetpath = talloc_asprintf(ctx,
-   %s%s,
-   extrapath,
-   *pp_targetpath);
+   /* EMC Celerra NAS version 5.6.50 (at least) doesn't appear to 
*/
+   /* put the trailing \ on the path, so to be save we put one in 
if needed */
+   if (extrapath[strlen(extrapath)-1] != '\\'  **pp_targetpath 
!= '\\') {
+   *pp_targetpath = talloc_asprintf(ctx,
+ %s\\%s,
+ extrapath,
+ *pp_targetpath);
+   } else {
+   *pp_targetpath = talloc_asprintf(ctx,
+ %s%s,
+ extrapath,
+ *pp_targetpath);
+   }
if (!*pp_targetpath) {
return false;
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2011-04-04 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  25312f6 Move SET_STAT_INVALID call added by Volker as fix for bug 
8042 - Newly create files are always failed with NT_STATUS_FILE_IS_A_DIRECTORY
   via  f1bae42 Note that check_parent_exists() doesn't change the contents 
of smb_fname (add const). (cherry picked from commit 
074239ac2eec666abb892b5eef46ca70691ed41f)
  from  702c32d Fix bug #7987 - ACL can get lost when files are being 
renamed.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit 25312f62f373ce426318c72366638881fd99f158
Author: Jeremy Allison j...@samba.org
Date:   Mon Apr 4 10:22:03 2011 -0700

Move SET_STAT_INVALID call added by Volker as fix for bug 8042 - Newly 
create files are always failed with NT_STATUS_FILE_IS_A_DIRECTORY

Ensure we do this for all cases where the stat fails.

Jeremy

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Mon Apr  4 20:08:45 CEST 2011 on sn-devel-104
(cherry picked from commit 2ec48260ee377e499fe7f0fc2ca18b8a078c6aaa)

commit f1bae428abf552470a41650f628e43840dbd1ea1
Author: Jeremy Allison j...@samba.org
Date:   Mon Apr 4 10:15:16 2011 -0700

Note that check_parent_exists() doesn't change the contents of smb_fname 
(add const).
(cherry picked from commit 074239ac2eec666abb892b5eef46ca70691ed41f)

---

Summary of changes:
 source3/smbd/filename.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 8b0c42a..cce1c44 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -112,7 +112,7 @@ static NTSTATUS check_for_dot_component(const struct 
smb_filename *smb_fname)
 static NTSTATUS check_parent_exists(TALLOC_CTX *ctx,
connection_struct *conn,
bool posix_pathnames,
-   struct smb_filename *smb_fname,
+   const struct smb_filename *smb_fname,
char **pp_dirpath,
char **pp_start)
 {
@@ -438,6 +438,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
goto done;
}
 
+   /* Stat failed - ensure we don't use it. */
+   SET_STAT_INVALID(smb_fname-st);
+
if (errno == ENOENT) {
/* Optimization when creating a new file - only
   the last component doesn't exist. */
@@ -504,9 +507,6 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
}
}
 
-   /* Stat failed - ensure we don't use it. */
-   SET_STAT_INVALID(smb_fname-st);
-
/*
 * Missing last component is ok - new file.
 * Also deal with permission denied elsewhere.


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2011-04-04 Thread Michael Adam
The branch, v3-6-test has been updated
   via  0c3a359 s3-net: add command net idmap check
   via  0d537ea s3: add function srprs_quoted to parse strings written with 
cbuf_print_quoted
   via  c3cdbe5 s3: add function cbuf_print_quoted
   via  4b1c0bc s3: add function dbwrap_traverse
   via  d059345 s3: add function dbwrap_trans_traverse
   via  246dab7 s3: fix cbuf_swapptr
  from  25312f6 Move SET_STAT_INVALID call added by Volker as fix for bug 
8042 - Newly create files are always failed with NT_STATUS_FILE_IS_A_DIRECTORY

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit 0c3a359de1491828439ee5bbe4b05364b814d068
Author: Gregor Beck gb...@sernet.de
Date:   Fri Jan 28 10:55:58 2011 +0100

s3-net: add command net idmap check

This is a tool to check the consistency of an idmap tdb database.

The default mode is to scan the database and list invalid entries,
e.g. records with an invalid format, or records which are valid
but for which the reverse mapping entry is missing.

With the --repair switch, one can enter an interactive
repair mode which will prompt for each invalid entry found
with the option to delete, skip or edit the record.

There is also a non-interactive repair mode triggered by --auto
which will remove all records with invalid content and fill up
mappings which are missing the reverse entry.

The --test parameter lets net idmap check only list the
changes that would be written and not actually commit them to
the database.

The --lock option allows to lock the database already in the
first reading traverse, in order to remove the race when the
database has to be closed and reopened again before writing
the changes.

Signed-off-by: Michael Adam ob...@samba.org

Autobuild-User: Michael Adam ob...@samba.org
Autobuild-Date: Mon Apr  4 18:21:09 CEST 2011 on sn-devel-104

commit 0d537ea63885cfb2b9577785bae9305feb5d19c9
Author: Gregor Beck gb...@sernet.de
Date:   Thu Mar 17 10:22:25 2011 +0100

s3: add function srprs_quoted to parse strings written with 
cbuf_print_quoted

commit c3cdbe566e0611ec72515e0ca129575d14b4ce32
Author: Gregor Beck gb...@sernet.de
Date:   Thu Mar 17 10:20:30 2011 +0100

s3: add function cbuf_print_quoted

commit 4b1c0bc3f258438253d09e414972eb12856dda92
Author: Gregor Beck gb...@sernet.de
Date:   Fri Mar 18 14:39:15 2011 +0100

s3: add function dbwrap_traverse

commit d0593450374933c9ca8858370b2ed3e5d9ff0b7f
Author: Gregor Beck gb...@sernet.de
Date:   Wed Mar 16 09:13:40 2011 +0100

s3: add function dbwrap_trans_traverse

commit 246dab79a4eae3b69476fb11e48db609e2dc5aa8
Author: Gregor Beck gb...@sernet.de
Date:   Wed Mar 16 09:12:28 2011 +0100

s3: fix cbuf_swapptr

---

Summary of changes:
 source3/Makefile.in|2 +-
 source3/include/dbwrap.h   |7 +
 source3/lib/cbuf.c |   35 +
 source3/lib/cbuf.h |   17 +-
 source3/lib/dbwrap_util.c  |   38 +
 source3/lib/srprs.c|   40 +
 source3/lib/srprs.h|   13 +-
 source3/utils/net.c|3 +
 source3/utils/net.h|3 +
 source3/utils/net_idmap.c  |   47 +-
 source3/utils/net_idmap_check.c| 1005 
 .../srv_epmapper.h = utils/net_idmap_check.h} |   38 +-
 source3/wscript_build  |3 +-
 13 files changed, 1234 insertions(+), 17 deletions(-)
 create mode 100644 source3/utils/net_idmap_check.c
 copy source3/{rpc_server/epmapper/srv_epmapper.h = utils/net_idmap_check.h} 
(56%)


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index 34f5f82..2b89545 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1146,7 +1146,7 @@ LIBNET_SAMSYNC_OBJ = libnet/libnet_samsync.o \
 NET_OBJ1 = utils/net.o utils/net_ads.o utils/net_help.o \
   utils/net_rap.o utils/net_rpc.o utils/net_rpc_samsync.o \
   utils/net_rpc_join.o utils/net_time.o utils/net_lookup.o \
-  utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o \
+  utils/net_cache.o utils/net_groupmap.o utils/net_idmap.o 
utils/net_idmap_check.o\
   utils/net_status.o utils/net_rpc_printer.o utils/net_rpc_rights.o \
   utils/net_rpc_service.o utils/net_rpc_registry.o 
utils/net_usershare.o \
   utils/netlookup.o utils/net_sam.o utils/net_rpc_shell.o \
diff --git a/source3/include/dbwrap.h b/source3/include/dbwrap.h
index 8dba624..ef35b00 100644
--- a/source3/include/dbwrap.h
+++ b/source3/include/dbwrap.h
@@ 

[SCM] CTDB repository - branch 1.2 updated - ctdb-1.9.1-408-gafdde23

2011-04-04 Thread Ronnie Sahlberg
The branch, 1.2 has been updated
   via  afdde23217250775f078f5d95912e76a3b2962eb (commit)
   via  13ccb717548ac0d5279e1c35bcedac4667bce1e2 (commit)
  from  811f4fa44a790f741699126a6bd88fd3dc23393a (commit)

http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=1.2


- Log -
commit afdde23217250775f078f5d95912e76a3b2962eb
Author: Ronnie Sahlberg sahlberg@lenovo-laptop.(none)
Date:   Tue Apr 5 10:32:02 2011 +1000

Merge branches '1.2' and '1.2' of 10.1.1.27:/shared/ctdb/ctdb-master into 
1.2

commit 13ccb717548ac0d5279e1c35bcedac4667bce1e2
Author: root r...@int001st001.vsofs1.com
Date:   Tue Apr 5 09:20:10 2011 +1000

ctdbd_pid : dont assign the ctdbd_pid until we have finished startup and 
thus dont log warnings about 'Handling event ...' until startup has finished.

During startup there are some initial setup and commands done synchronous 
which means it is semi-normal to have the eventsystem blocked for some 
situations.

Once startup has finished, all handling should be asynchronous so activate 
the monitoring of the eventsystems at that stage.

CQ S1021936

---

Summary of changes:
 server/ctdb_daemon.c  |7 +++
 server/ctdb_monitor.c |1 +
 2 files changed, 4 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_daemon.c b/server/ctdb_daemon.c
index 75344ad..f0c7ec9 100644
--- a/server/ctdb_daemon.c
+++ b/server/ctdb_daemon.c
@@ -50,7 +50,7 @@ static void ctdb_time_tick(struct event_context *ev, struct 
timed_event *te,
 {
struct ctdb_context *ctdb = talloc_get_type(private_data, struct 
ctdb_context);
 
-   if (getpid() != ctdbd_pid) {
+   if (getpid() != ctdb-ctdbd_pid) {
return;
}
 
@@ -776,11 +776,10 @@ int ctdb_start_daemon(struct ctdb_context *ctdb, bool 
do_fork, bool use_syslog,
}
block_signal(SIGPIPE);
 
-   ctdbd_pid = getpid();
-   ctdb-ctdbd_pid = ctdbd_pid;
+   ctdb-ctdbd_pid = getpid();
 
 
-   DEBUG(DEBUG_ERR, (Starting CTDBD as pid : %u\n, ctdbd_pid));
+   DEBUG(DEBUG_ERR, (Starting CTDBD as pid : %u\n, ctdb-ctdbd_pid));
 
if (ctdb-do_setsched) {
/* try to set us up as realtime */
diff --git a/server/ctdb_monitor.c b/server/ctdb_monitor.c
index 820e082..89fa886 100644
--- a/server/ctdb_monitor.c
+++ b/server/ctdb_monitor.c
@@ -203,6 +203,7 @@ static void ctdb_startup_callback(struct ctdb_context 
*ctdb, int status, void *p
} else if (status == 0) {
DEBUG(DEBUG_NOTICE,(startup event OK - enabling 
monitoring\n));
ctdb-done_startup = true;
+   ctdbd_pid = ctdb-ctdbd_pid;
ctdb-monitor-next_interval = 2;
ctdb_run_notification_script(ctdb, startup);
}


-- 
CTDB repository


autobuild: intermittent test failure detected

2011-04-04 Thread Andrew Tridgell
The autobuild test system has detected an intermittent failing test in 
the current master tree.

The autobuild log of the failure is available here:

   http://git.samba.org/autobuild.flakey/2011-04-05-0624/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-05-0624/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-04-05-0624/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-04-05-0624/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-04-05-0624/samba4.stdout
  
The top commit at the time of the failure was:

commit 2d22bbf2c0af57c1bb7665590960a9b888ee8a4d
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Apr 4 21:01:40 2011 +1000

s3-selftest Look only under source3 for smb.conf files

This test looks for any .conf file with [global] in it, and assumes
it's a Samba3 format smb.conf file.  If 'make test' has been run in
the top level build, it was finding the smb.conf files it generated.

Andrew Bartlett

Autobuild-User: Andrew Bartlett abart...@samba.org
Autobuild-Date: Mon Apr  4 23:50:06 CEST 2011 on sn-devel-104


[SCM] Samba Shared Repository - branch master updated

2011-04-04 Thread Kai Blin
The branch, master has been updated
   via  4b78956 s4 samba-tool: Implement testparm command
  from  2d22bbf s3-selftest Look only under source3 for smb.conf files

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 4b7895698557149504773f4e74e8d4eb81c3b093
Author: Kai Blin k...@samba.org
Date:   Wed Mar 23 23:06:18 2011 +0100

s4 samba-tool: Implement testparm command

This is a port of the existing testparm python script to a samba-tool
command.

Autobuild-User: Kai Blin k...@samba.org
Autobuild-Date: Tue Apr  5 07:49:13 CEST 2011 on sn-devel-104

---

Summary of changes:
 source4/scripting/python/samba/netcmd/__init__.py |2 +
 source4/scripting/python/samba/netcmd/testparm.py |  206 +
 2 files changed, 208 insertions(+), 0 deletions(-)
 create mode 100755 source4/scripting/python/samba/netcmd/testparm.py


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/netcmd/__init__.py 
b/source4/scripting/python/samba/netcmd/__init__.py
index aa74f65..cf514d5 100644
--- a/source4/scripting/python/samba/netcmd/__init__.py
+++ b/source4/scripting/python/samba/netcmd/__init__.py
@@ -213,3 +213,5 @@ from samba.netcmd.gpo import cmd_gpo
 commands[gpo2] = cmd_gpo()
 from samba.netcmd.ldapcmp import cmd_ldapcmp
 commands[ldapcmp] = cmd_ldapcmp()
+from samba.netcmd.testparm import cmd_testparm
+commands[testparm] =  cmd_testparm()
diff --git a/source4/scripting/python/samba/netcmd/testparm.py 
b/source4/scripting/python/samba/netcmd/testparm.py
new file mode 100755
index 000..ec44858
--- /dev/null
+++ b/source4/scripting/python/samba/netcmd/testparm.py
@@ -0,0 +1,206 @@
+#!/usr/bin/env python
+# vim: expandtab ft=python
+#
+#   Unix SMB/CIFS implementation.
+#   Test validity of smb.conf
+#   Copyright (C) Karl Auer 1993, 1994-1998
+#
+#   Extensively modified by Andrew Tridgell, 1995
+#   Converted to popt by Jelmer Vernooij (jel...@nl.linux.org), 2002
+#   Updated for Samba4 by Andrew Bartlett abart...@samba.org 2006
+#   Converted to Python by Jelmer Vernooij jel...@samba.org 2010
+#
+#   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/.
+#
+# Testbed for loadparm.c/params.c
+#
+# This module simply loads a specified configuration file and
+# if successful, dumps it's contents to stdout. Note that the
+# operation is performed with DEBUGLEVEL at 3.
+#
+# Useful for a quick 'syntax check' of a configuration file.
+#
+
+import os
+import sys
+import logging
+
+import samba
+import samba.getopt as options
+from samba.netcmd import Command, CommandError, Option
+
+class cmd_testparm(Command):
+Syntax check the configuration file
+
+synopsis = 
+
+takes_optiongroups = {
+sambaopts: options.SambaOptions,
+versionopts: options.VersionOptions
+}
+
+takes_options = [
+Option(--section-name, type=str,
+   help=Limit testparm to a named section),
+Option(--parameter-name, type=str,
+   help=Limit testparm to a named parameter),
+Option(--client-name, type=str,
+   help=Client DNS name for 'hosts allow' checking 
+(should match reverse lookup)),
+Option(--client-ip, type=str,
+   help=Client IP address for 'hosts allow' checking),
+Option(--suppress-prompt, action=store_true, default=False,
+   help=Suppress prompt for enter),
+Option(-v, --verbose, action=store_true,
+   default=False, help=Show default options too),
+# We need support for smb.conf macros before this will work again
+Option(--server, type=str, help=Set %%L macro to servername),
+# These are harder to do with the new code structure
+Option(--show-all-parameters, action=store_true, default=False,
+   help=Show the parameters, type, possible values)
+]
+
+takes_args = [hostname?, hostip?]
+
+def run(self, *args, **kwargs):
+if kwargs.get('hostname', None) is not None and \
+   kwargs.get('hostip', None) is None:
+raise CommandError(Both a DNS name and an IP address are  \
+   required for the host access check)
+
+lp =