[SCM] Samba Shared Repository - branch master updated

2011-09-19 Thread Michael Adam
The branch, master has been updated
   via  cc6ecd4 s3:registry: fix a debug message in the v2_to_v3 upgrade 
code
  from  d49f509 s3:smb2cli: remove unused struct ntlmssp_state from 
smb2cli_session_setup_state

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


- Log -
commit cc6ecd4ead4144a9f37c7de3407862955bb7
Author: Michael Adam ob...@samba.org
Date:   Tue Sep 13 17:11:04 2011 +0200

s3:registry: fix a debug message in the v2_to_v3 upgrade code

Autobuild-User: Michael Adam ob...@samba.org
Autobuild-Date: Mon Sep 19 10:31:45 CEST 2011 on sn-devel-104

---

Summary of changes:
 source3/registry/reg_backend_db.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/registry/reg_backend_db.c 
b/source3/registry/reg_backend_db.c
index bac075a..e22a73a 100644
--- a/source3/registry/reg_backend_db.c
+++ b/source3/registry/reg_backend_db.c
@@ -522,7 +522,7 @@ static int regdb_upgrade_v2_to_v3_fn(struct db_record *rec, 
void *private_data)
}
 
if (db == NULL) {
-   DEBUG(0, (regdb_normalize_keynames_fn: ERROR: 
+   DEBUG(0, (regdb_upgrade_v2_to_v3_fn: ERROR: 
  NULL db context handed in via private_data\n));
return 1;
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-09-19 Thread Andrew Tridgell
The branch, master has been updated
   via  be4f188 s4-client: added close command in smbclient
  from  fcfde9a s4:ntvfs/common/brlock.c - remove unnecessary include 
tdb_compat.h

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


- Log -
commit be4f188128d631abe014a8182c22a03f4c09264a
Author: Andrew Tridgell tri...@samba.org
Date:   Tue Sep 20 06:06:26 2011 +1000

s4-client: added close command in smbclient

this matches the existing open command, and also gives you error codes
on both open and close

useful for testing share mode locking

Autobuild-User: Andrew Tridgell tri...@samba.org
Autobuild-Date: Mon Sep 19 23:59:28 CEST 2011 on sn-devel-104

---

Summary of changes:
 source4/client/client.c |   66 ---
 1 files changed, 62 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/client/client.c b/source4/client/client.c
index 2f353ae..c30d17d 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -2131,18 +2131,75 @@ static int cmd_delprivileges(struct smbclient_context 
*ctx, const char **args)
 
 
 /
+open a file
 /
 static int cmd_open(struct smbclient_context *ctx, const char **args)
 {
-   char *mask;
-   
+   char *filename;
+   union smb_open io;
+   NTSTATUS status;
+   TALLOC_CTX *tmp_ctx;
+
if (!args[1]) {
d_printf(open filename\n);
return 1;
}
-   mask = talloc_asprintf(ctx, %s%s, ctx-remote_cur_dir, args[1]);
+   tmp_ctx = talloc_new(ctx);
+
+   filename = talloc_asprintf(tmp_ctx, %s%s, ctx-remote_cur_dir, 
args[1]);
+
+   io.generic.level = RAW_OPEN_NTCREATEX;
+   io.ntcreatex.in.root_fid.fnum = 0;
+   io.ntcreatex.in.flags = 0;
+   io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL;
+   io.ntcreatex.in.create_options = 0;
+   io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_NORMAL;
+   io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_READ;
+   io.ntcreatex.in.alloc_size = 0;
+   io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN_IF;
+   io.ntcreatex.in.impersonation = NTCREATEX_IMPERSONATION_ANONYMOUS;
+   io.ntcreatex.in.security_flags = 0;
+   io.ntcreatex.in.fname = filename;
+
+   status = smb_raw_open(ctx-cli-tree, tmp_ctx, io);
+   talloc_free(tmp_ctx);
+
+   if (NT_STATUS_IS_OK(status)) {
+   d_printf(Opened file with fnum %u\n, 
(unsigned)io.ntcreatex.out.file.fnum);
+   } else {
+   d_printf(Opened failed: %s\n, nt_errstr(status));
+   }
+
+   return 0;
+}
 
-   smbcli_open(ctx-cli-tree, mask, O_RDWR, DENY_ALL);
+/
+close a file
+/
+static int cmd_close(struct smbclient_context *ctx, const char **args)
+{
+   union smb_close io;
+   NTSTATUS status;
+   uint16_t fnum;
+
+   if (!args[1]) {
+   d_printf(close fnum\n);
+   return 1;
+   }
+
+   fnum = atoi(args[1]);
+
+   ZERO_STRUCT(io);
+   io.generic.level = RAW_CLOSE_CLOSE;
+   io.close.in.file.fnum = fnum;
+
+   status = smb_raw_close(ctx-cli-tree, io);
+
+   if (NT_STATUS_IS_OK(status)) {
+   d_printf(Closed file OK\n);
+   } else {
+   d_printf(Close failed: %s\n, nt_errstr(status));
+   }
 
return 0;
 }
@@ -2694,6 +2751,7 @@ static struct
   {mput,cmd_mput,mask put all matching files,{COMPL_REMOTE,COMPL_NONE}},
   {newer,cmd_newer,file only mget files newer than the specified local 
file,{COMPL_LOCAL,COMPL_NONE}},
   {open,cmd_open,mask open a file,{COMPL_REMOTE,COMPL_NONE}},
+  {close,cmd_close,fnum close a file,{COMPL_NONE,COMPL_NONE}},
   {privileges,cmd_privileges,user show privileges for a 
user,{COMPL_NONE,COMPL_NONE}},
   {print,cmd_print,file name print a file,{COMPL_NONE,COMPL_NONE}},
   {printmode,cmd_printmode,graphics or text set the print 
mode,{COMPL_NONE,COMPL_NONE}},


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-09-19 Thread Andrew Bartlett
The branch, master has been updated
   via  f9acf77 lib/util/charset: remove charset module loading
   via  8316577 lib/util/charcnv: Remove broken internal CP850 and CP464 
modules
  from  be4f188 s4-client: added close command in smbclient

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


- Log -
commit f9acf770e9c121aa495cb7e19175a4a6e45ff3d9
Author: Andrew Bartlett abart...@samba.org
Date:   Mon Sep 19 19:13:21 2011 -0700

lib/util/charset: remove charset module loading

Now that the 'table' modules are gone, there is no reason for there to
be charset modules at all.  This builds the macosxfs and weird modules
into the binary at the appropriate times, and changes the tests to
test instead the difference between the remaining internal handlers
and iconv().

Andrew Bartlett

Autobuild-User: Andrew Bartlett abart...@samba.org
Autobuild-Date: Tue Sep 20 06:27:06 CEST 2011 on sn-devel-104

commit 8316577b7538f7204c5fd6328756c4c3f171b36e
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Sep 16 14:52:28 2011 -0700

lib/util/charcnv: Remove broken internal CP850 and CP464 modules

These modules are now known to be faulty, and Samba 3.6.0 didn't
include support for them, so we now require a system iconv if you wish
to support these character sets for the non-ASCII range.

Andrew Bartlett

---

Summary of changes:
 lib/util/charset/CP437.c   |  135 
 lib/util/charset/CP850.c   |  121 --
 lib/util/charset/charset.h |  101 +--
 lib/util/charset/charset_macosxfs.c|   26 ++--
 .../srvstr.h = lib/util/charset/charset_proto.h   |   26 +++--
 lib/util/charset/codepoints.c  |   14 +-
 lib/util/charset/iconv.c   |  115 +++--
 lib/util/charset/tests/convert_string.c|   22 ++--
 lib/util/charset/tests/iconv.c |7 +-
 lib/util/charset/weird.c   |   25 ++--
 lib/util/charset/wscript_build |   39 +--
 source3/Makefile.in|   21 +---
 source3/configure.in   |   10 +-
 source3/wscript|3 -
 source4/param/util.c   |6 +-
 source4/selftest/knownfail |8 +-
 source4/selftest/tests.py  |6 +-
 source4/torture/smbiconv.c |2 +-
 18 files changed, 101 insertions(+), 586 deletions(-)
 delete mode 100644 lib/util/charset/CP437.c
 delete mode 100644 lib/util/charset/CP850.c
 copy source3/include/srvstr.h = lib/util/charset/charset_proto.h (51%)


Changeset truncated at 500 lines:

diff --git a/lib/util/charset/CP437.c b/lib/util/charset/CP437.c
deleted file mode 100644
index 1e478d6..000
--- a/lib/util/charset/CP437.c
+++ /dev/null
@@ -1,135 +0,0 @@
-/* 
- * Conversion table for CP437 charset also known as IBM437
- *
- * Copyright (C) Alexander Bokovoy 2003
- *
- * Conversion tables are generated using GNU libc 2.2.5's 
- * localedata/charmaps/IBM437 table and source/script/gen-8bit-gap.sh script
- *
- * 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/.
- */
-
-#include includes.h
-
-static const uint16_t to_ucs2[256] = {
- 0x, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007,
- 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F,
- 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017,
- 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F,
- 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027,
- 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F,
- 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037,
- 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F,
- 0x0040, 0x0041, 0x0042, 0x0043, 0x0044, 0x0045, 0x0046, 0x0047,
- 0x0048, 0x0049, 0x004A, 0x004B, 0x004C, 0x004D, 0x004E, 0x004F,
- 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0055, 0x0056, 0x0057,
- 0x0058, 0x0059, 0x005A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F,
- 0x0060, 0x0061, 

[SCM] Samba Shared Repository - branch master updated

2011-09-19 Thread Michael Adam
The branch, master has been updated
   via  da5224a s3:dbwrap_ctdb: skip the internal __db_sequence_number__ 
key from (persistent) traverse and traverse_read
   via  4d30fd8 s3:dbwrap_tool: add popt support and standard samba options
   via  aa0f102 s3:g_lock: add a missing 
 to a debug message in g_lock_init
  from  f9acf77 lib/util/charset: remove charset module loading

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


- Log -
commit da5224a9d2684c0a95f056700af4c4f7be2f93f9
Author: Michael Adam ob...@samba.org
Date:   Tue Sep 20 04:33:31 2011 +0200

s3:dbwrap_ctdb: skip the internal __db_sequence_number__ key from 
(persistent) traverse and traverse_read

This is is used internally in the persistent transactions and should not 
surface.

Autobuild-User: Michael Adam ob...@samba.org
Autobuild-Date: Tue Sep 20 07:59:20 CEST 2011 on sn-devel-104

commit 4d30fd8c5163c92e8fdbfd1cae7088e9e010b8cd
Author: Michael Adam ob...@samba.org
Date:   Tue Sep 20 04:32:25 2011 +0200

s3:dbwrap_tool: add popt support and standard samba options

commit aa0f102fd7defb5ff442ac4bfc782721fbbff434
Author: Michael Adam ob...@samba.org
Date:   Mon Sep 19 22:30:57 2011 +0200

s3:g_lock: add a missing \n to a debug message in g_lock_init

---

Summary of changes:
 source3/Makefile.in  |4 ++-
 source3/lib/dbwrap/dbwrap_ctdb.c |   26 +
 source3/lib/g_lock.c |2 +-
 source3/utils/dbwrap_tool.c  |   58 -
 source3/wscript_build|3 +-
 5 files changed, 76 insertions(+), 17 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index d64adb8..0796bc6 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1549,7 +1549,8 @@ RPC_OPEN_TCP_OBJ = torture/rpc_open_tcp.o \
 DBWRAP_TOOL_OBJ = utils/dbwrap_tool.o \
  $(PARAM_OBJ) \
  $(LIB_NONSMBD_OBJ) \
- $(LIBSMB_ERR_OBJ)
+ $(LIBSMB_ERR_OBJ) \
+ $(POPT_LIB_OBJ)
 
 DBWRAP_TORTURE_OBJ = utils/dbwrap_torture.o \
 $(PARAM_OBJ) \
@@ -3204,6 +3205,7 @@ bin/dbwrap_tool@EXEEXT@: $(DBWRAP_TOOL_OBJ) $(LIBTALLOC) 
$(LIBTDB)
@$(CC) -o $@ $(DBWRAP_TOOL_OBJ)\
$(LDFLAGS) $(DYNEXP) $(LIBS) \
$(LDAP_LIBS) \
+   $(POPT_LIBS) \
$(LIBTALLOC_LIBS) $(LIBTDB_LIBS)
 
 install-dbwrap_tool:: bin/dbwrap_tool@EXEEXT@
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index 429f542..d9fb489 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1261,11 +1261,25 @@ static int traverse_persistent_callback(TDB_CONTEXT 
*tdb, TDB_DATA kbuf, TDB_DAT
struct db_record *rec;
TALLOC_CTX *tmp_ctx = talloc_new(state-db);
int ret = 0;
+
+   /*
+* Skip the __db_sequence_number__ key:
+* This is used for persistent transactions internally.
+*/
+   if (kbuf.dsize == strlen(CTDB_DB_SEQNUM_KEY) + 1 
+   strncmp((const char*)kbuf.dptr, CTDB_DB_SEQNUM_KEY,
+   strlen(CTDB_DB_SEQNUM_KEY)) == 0)
+   {
+   goto done;
+   }
+
/* we have to give them a locked record to prevent races */
rec = db_ctdb_fetch_locked(state-db, tmp_ctx, kbuf);
if (rec  rec-value.dsize  0) {
ret = state-fn(rec, state-private_data);
}
+
+done:
talloc_free(tmp_ctx);
return ret;
 }
@@ -1321,6 +1335,18 @@ static int traverse_persistent_callback_read(TDB_CONTEXT 
*tdb, TDB_DATA kbuf, TD
 {
struct traverse_state *state = (struct traverse_state *)private_data;
struct db_record rec;
+
+   /*
+* Skip the __db_sequence_number__ key:
+* This is used for persistent transactions internally.
+*/
+   if (kbuf.dsize == strlen(CTDB_DB_SEQNUM_KEY) + 1 
+   strncmp((const char*)kbuf.dptr, CTDB_DB_SEQNUM_KEY,
+   strlen(CTDB_DB_SEQNUM_KEY)) == 0)
+   {
+   return 0;
+   }
+
rec.key = kbuf;
rec.value = dbuf;
rec.store = db_ctdb_store_deny;
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 308e5cf..38dec40 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -62,7 +62,7 @@ struct g_lock_ctx *g_lock_ctx_init(TALLOC_CTX *mem_ctx,
 TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
 O_RDWR|O_CREAT, 0600);
if (result-db == NULL) {
-   DEBUG(1, (g_lock_init: Could not open g_lock.tdb));
+   DEBUG(1, (g_lock_init: Could not open g_lock.tdb\n));
TALLOC_FREE(result);
return NULL;
}
diff --git