svn commit: samba r25204 - in branches/SAMBA_4_0: source/lib/ldb/ldb_tdb testprogs/ejs

2007-09-17 Thread abartlet
Author: abartlet
Date: 2007-09-18 06:36:07 + (Tue, 18 Sep 2007)
New Revision: 25204

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25204

Log:
Patch by Andrew Kroeger <[EMAIL PROTECTED]> fixing bug #4958 -
rename of ldb entries for a case change (only).

I've modified the testsuite to verify this.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
   branches/SAMBA_4_0/testprogs/ejs/ldb.js


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c
===
--- branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2007-09-18 02:43:56 UTC 
(rev 25203)
+++ branches/SAMBA_4_0/source/lib/ldb/ldb_tdb/ldb_tdb.c 2007-09-18 06:36:07 UTC 
(rev 25204)
@@ -856,16 +856,38 @@
goto done;
}
 
-   ret = ltdb_add_internal(module, msg);
-   if (ret != LDB_SUCCESS) {
-   goto done;
-   }
+   if (ldb_dn_compare(req->op.rename.olddn, req->op.rename.newdn) == 0) {
+   /* The rename operation is apparently only changing case -
+  the DNs are the same.  Delete the old DN before adding
+  the new one to avoid a TDB_ERR_EXISTS error.
 
-   tret = ltdb_delete_internal(module, req->op.rename.olddn);
-   if (tret != LDB_SUCCESS) {
-   ltdb_delete_internal(module, req->op.rename.newdn);
-   ret = LDB_ERR_OPERATIONS_ERROR;
-   goto done;
+  The only drawback to this is that if the delete
+  succeeds but the add fails, we rely on the
+  transaction to roll this all back. */
+   ret = ltdb_delete_internal(module, req->op.rename.olddn);
+   if (ret != LDB_SUCCESS) {
+   goto done;
+   }
+
+   ret = ltdb_add_internal(module, msg);
+   if (ret != LDB_SUCCESS) {
+   goto done;
+   }
+   } else {
+   /* The rename operation is changing DNs.  Try to add the new
+  DN first to avoid clobbering another DN not related to
+  this rename operation. */
+   ret = ltdb_add_internal(module, msg);
+   if (ret != LDB_SUCCESS) {
+   goto done;
+   }
+
+   tret = ltdb_delete_internal(module, req->op.rename.olddn);
+   if (tret != LDB_SUCCESS) {
+   ltdb_delete_internal(module, req->op.rename.newdn);
+   ret = LDB_ERR_OPERATIONS_ERROR;
+   goto done;
+   }
}
 
if (ltdb_ac->callback) {

Modified: branches/SAMBA_4_0/testprogs/ejs/ldb.js
===
--- branches/SAMBA_4_0/testprogs/ejs/ldb.js 2007-09-18 02:43:56 UTC (rev 
25203)
+++ branches/SAMBA_4_0/testprogs/ejs/ldb.js 2007-09-18 06:36:07 UTC (rev 
25204)
@@ -60,6 +60,11 @@
res = ldb.search("x=4", NULL, ldb.SCOPE_DEFAULT, attrs);
assert(res.msgs[0].dn == "cn=x3,cn=test");
 
+   ok = ldb.rename("cn=x3,cn=test", "cn=X3,cn=test");
+   assert(ok.error == 0);
+   res = ldb.search("x=4", NULL, ldb.SCOPE_DEFAULT, attrs);
+   assert(res.msgs[0].dn == "cn=X3,cn=test");
+
ok = ldb.modify("
 dn: cn=x3,cn=test
 changetype: modify



svn commit: samba r25203 - in branches/SAMBA_4_0/source/setup: .

2007-09-17 Thread abartlet
Author: abartlet
Date: 2007-09-18 02:43:56 + (Tue, 18 Sep 2007)
New Revision: 25203

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25203

Log:
Don't use subclasses in Samba4, as we always fill out the full
objectClass list.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/setup/provision_init.ldif
   branches/SAMBA_4_0/source/setup/provision_partitions.ldif


Changeset:
Modified: branches/SAMBA_4_0/source/setup/provision_init.ldif
===
--- branches/SAMBA_4_0/source/setup/provision_init.ldif 2007-09-18 00:03:12 UTC 
(rev 25202)
+++ branches/SAMBA_4_0/source/setup/provision_init.ldif 2007-09-18 02:43:56 UTC 
(rev 25203)
@@ -23,17 +23,6 @@
 systemFlags: INTEGER
 userAccountControl: INTEGER
 
-dn: @SUBCLASSES
-top: domain
-top: person
-top: group
-domain: domainDNS
-person: organizationalPerson
-organizationalPerson: user
-user: computer
-template: userTemplate
-template: groupTemplate
-
 dn: @KLUDGEACL
 passwordAttribute: sambaPassword
 passwordAttribute: ntPwdHash

Modified: branches/SAMBA_4_0/source/setup/provision_partitions.ldif
===
--- branches/SAMBA_4_0/source/setup/provision_partitions.ldif   2007-09-18 
00:03:12 UTC (rev 25202)
+++ branches/SAMBA_4_0/source/setup/provision_partitions.ldif   2007-09-18 
02:43:56 UTC (rev 25203)
@@ -2,7 +2,6 @@
 partition: ${SCHEMADN}:${SCHEMADN_LDB}
 partition: ${CONFIGDN}:${CONFIGDN_LDB}
 partition: ${DOMAINDN}:${DOMAINDN_LDB}
-replicateEntries: @SUBCLASSES
 replicateEntries: @ATTRIBUTES
 replicateEntries: @INDEXLIST
 modules:${SCHEMADN}:${SCHEMADN_MOD}${SCHEMADN_MOD2}



svn commit: samba r25202 - in branches/SAMBA_3_2_0/source/script: .

2007-09-17 Thread jerry
Author: jerry
Date: 2007-09-18 00:03:12 + (Tue, 18 Sep 2007)
New Revision: 25202

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25202

Log:
Copy some code formatting scripts from SAMBA_3_2
Added:
   branches/SAMBA_3_2_0/source/script/count_80_col.pl
   branches/SAMBA_3_2_0/source/script/format_indent.sh
   branches/SAMBA_3_2_0/source/script/strip_trail_ws.pl


Changeset:
Copied: branches/SAMBA_3_2_0/source/script/count_80_col.pl (from rev 25201, 
branches/SAMBA_3_2/source/script/count_80_col.pl)

Copied: branches/SAMBA_3_2_0/source/script/format_indent.sh (from rev 25201, 
branches/SAMBA_3_2/source/script/format_indent.sh)

Copied: branches/SAMBA_3_2_0/source/script/strip_trail_ws.pl (from rev 25201, 
branches/SAMBA_3_2/source/script/strip_trail_ws.pl)



Build status as of Tue Sep 18 00:00:03 2007

2007-09-17 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2007-09-17 
00:01:54.0 +
+++ /home/build/master/cache/broken_results.txt 2007-09-18 00:01:20.0 
+
@@ -1,4 +1,4 @@
-Build status as of Mon Sep 17 00:00:02 2007
+Build status as of Tue Sep 18 00:00:03 2007
 
 Build counts:
 Tree Total  Broken Panic 
@@ -9,16 +9,16 @@
 distcc   2  0  0 
 ldb  31 5  0 
 libreplace   30 8  0 
-lorikeet-heimdal 26 15 0 
+lorikeet-heimdal 25 15 0 
 pidl 18 4  0 
 ppp  11 8  0 
 python   0  0  0 
 rsync31 12 0 
 samba-docs   0  0  0 
 samba-gtk3  3  0 
-samba4   28 18 3 
-samba_3_232 20 0 
-smb-build29 28 0 
-talloc   30 1  0 
+samba4   28 17 2 
+samba_3_232 30 0 
+smb-build29 29 0 
+talloc   31 1  0 
 tdb  31 3  0 
 


svn commit: samba r25201 - in branches: SAMBA_3_2/source/utils SAMBA_3_2_0/source/utils

2007-09-17 Thread obnox
Author: obnox
Date: 2007-09-17 21:04:10 + (Mon, 17 Sep 2007)
New Revision: 25201

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25201

Log:
Fight those red bars...


Modified:
   branches/SAMBA_3_2/source/utils/net_ads.c
   branches/SAMBA_3_2_0/source/utils/net_ads.c


Changeset:
Sorry, the patch is too large (2371 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25201


svn commit: samba r25199 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-09-17 Thread jra
Author: jra
Date: 2007-09-17 19:43:06 + (Mon, 17 Sep 2007)
New Revision: 25199

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25199

Log:
Remove pstring from strdup_upper - make it the
same as talloc_strdup_upper.
Jeremy.

Modified:
   branches/SAMBA_3_2/source/lib/charcnv.c
   branches/SAMBA_3_2_0/source/lib/charcnv.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/charcnv.c
===
--- branches/SAMBA_3_2/source/lib/charcnv.c 2007-09-17 15:34:22 UTC (rev 
25198)
+++ branches/SAMBA_3_2/source/lib/charcnv.c 2007-09-17 19:43:06 UTC (rev 
25199)
@@ -759,49 +759,68 @@
 
 /**
  strdup() a unix string to upper case.
- Max size is pstring.
 **/
 
 char *strdup_upper(const char *s)
 {
-   pstring out_buffer;
+   char *out_buffer = SMB_STRDUP(s);
const unsigned char *p = (const unsigned char *)s;
unsigned char *q = (unsigned char *)out_buffer;
 
+   if (!q) {
+   return NULL;
+   }
+
/* this is quite a common operation, so we want it to be
   fast. We optimise for the ascii case, knowing that all our
   supported multi-byte character sets are ascii-compatible
   (ie. they match for the first 128 chars) */
 
-   while (1) {
+   while (*p) {
if (*p & 0x80)
break;
*q++ = toupper_ascii(*p);
-   if (!*p)
-   break;
p++;
-   if (p - ( const unsigned char *)s >= sizeof(pstring))
-   break;
}
 
if (*p) {
/* MB case. */
size_t size;
-   wpstring buffer;
-   size = convert_string(CH_UNIX, CH_UTF16LE, s, -1, buffer, 
sizeof(buffer), True);
+   smb_ucs2_t *buffer = NULL;
+
+   SAFE_FREE(out_buffer);
+   size = convert_string_allocate(NULL,
+   CH_UNIX,
+   CH_UTF16LE,
+   s,
+   strlen(s) + 1,
+   (void **)(void *)&buffer,
+   True);
if (size == (size_t)-1) {
return NULL;
}
 
strupper_w(buffer);
 
-   size = convert_string(CH_UTF16LE, CH_UNIX, buffer, -1, 
out_buffer, sizeof(out_buffer), True);
+   size = convert_string_allocate(NULL,
+   CH_UTF16LE,
+   CH_UNIX,
+   buffer,
+   size,
+   (void **)(void *)&out_buffer,
+   True);
+
+   /* Don't need the intermediate buffer
+* anymore.
+*/
+
+   TALLOC_FREE(buffer);
if (size == (size_t)-1) {
return NULL;
}
}
 
-   return SMB_STRDUP(out_buffer);
+   return out_buffer;
 }
 
 /**
@@ -823,12 +842,10 @@
   supported multi-byte character sets are ascii-compatible
   (ie. they match for the first 128 chars) */
 
-   while (1) {
+   while (*p) {
if (*p & 0x80)
break;
*q++ = toupper_ascii(*p);
-   if (!*p)
-   break;
p++;
}
 

Modified: branches/SAMBA_3_2_0/source/lib/charcnv.c
===
--- branches/SAMBA_3_2_0/source/lib/charcnv.c   2007-09-17 15:34:22 UTC (rev 
25198)
+++ branches/SAMBA_3_2_0/source/lib/charcnv.c   2007-09-17 19:43:06 UTC (rev 
25199)
@@ -759,49 +759,68 @@
 
 /**
  strdup() a unix string to upper case.
- Max size is pstring.
 **/
 
 char *strdup_upper(const char *s)
 {
-   pstring out_buffer;
+   char *out_buffer = SMB_STRDUP(s);
const unsigned char *p = (const unsigned char *)s;
unsigned char *q = (unsigned char *)out_buffer;
 
+   if (!q) {
+   return NULL;
+   }
+
/* this is quite a common operation, so we want it to be
   fast. We optimise for the ascii case, knowing that all our
   supported multi-byte character sets are ascii-compatible
   (ie. they match for the first 128 chars) */
 
-   while (1) {
+   while (*p) {
if (*p & 0x80)
break;
*q++ = toupper_ascii(*p);
-   if (!*p)
-   break;
p++;
-   if (p - ( const unsigned char *)s >= sizeof(pstring))
-   break;
}
 
if (*p) {
/* MB case. */
size_t size;
-   wpstring buffer;
-   

svn commit: samba r25200 - in branches: SAMBA_3_2/source/utils SAMBA_3_2_0/source/utils

2007-09-17 Thread obnox
Author: obnox
Date: 2007-09-17 20:01:47 + (Mon, 17 Sep 2007)
New Revision: 25200

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25200

Log:
Fix a debug message.


Modified:
   branches/SAMBA_3_2/source/utils/net_ads.c
   branches/SAMBA_3_2_0/source/utils/net_ads.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/net_ads.c
===
--- branches/SAMBA_3_2/source/utils/net_ads.c   2007-09-17 19:43:06 UTC (rev 
25199)
+++ branches/SAMBA_3_2/source/utils/net_ads.c   2007-09-17 20:01:47 UTC (rev 
25200)
@@ -1406,7 +1406,7 @@
 
num_addrs = get_my_ip_address( &iplist );
if ( num_addrs <= 0 ) {
-   DEBUG(4,("net_ads_join: Failed to find my non-loopback IP "
+   DEBUG(4,("net_update_dns: Failed to find my non-loopback IP "
 "addresses!\n"));
return NT_STATUS_INVALID_PARAMETER;
}

Modified: branches/SAMBA_3_2_0/source/utils/net_ads.c
===
--- branches/SAMBA_3_2_0/source/utils/net_ads.c 2007-09-17 19:43:06 UTC (rev 
25199)
+++ branches/SAMBA_3_2_0/source/utils/net_ads.c 2007-09-17 20:01:47 UTC (rev 
25200)
@@ -1406,7 +1406,7 @@
 
num_addrs = get_my_ip_address( &iplist );
if ( num_addrs <= 0 ) {
-   DEBUG(4,("net_ads_join: Failed to find my non-loopback IP "
+   DEBUG(4,("net_update_dns: Failed to find my non-loopback IP "
 "addresses!\n"));
return NT_STATUS_INVALID_PARAMETER;
}



svn commit: samba r25198 - in branches: SAMBA_3_2/source/utils SAMBA_3_2_0/source/utils

2007-09-17 Thread obnox
Author: obnox
Date: 2007-09-17 15:34:22 + (Mon, 17 Sep 2007)
New Revision: 25198

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25198

Log:
Change net_rpc_join_ok() to return NTSTATUS for better
error propagation.

Michael


Modified:
   branches/SAMBA_3_2/source/utils/net_ads.c
   branches/SAMBA_3_2/source/utils/net_rpc_join.c
   branches/SAMBA_3_2_0/source/utils/net_ads.c
   branches/SAMBA_3_2_0/source/utils/net_rpc_join.c


Changeset:
Modified: branches/SAMBA_3_2/source/utils/net_ads.c
===
--- branches/SAMBA_3_2/source/utils/net_ads.c   2007-09-17 15:11:20 UTC (rev 
25197)
+++ branches/SAMBA_3_2/source/utils/net_ads.c   2007-09-17 15:34:22 UTC (rev 
25198)
@@ -1600,8 +1600,12 @@
 
/* Verify that everything is ok */
 
-   if ( net_rpc_join_ok(short_domain_name, ads->config.ldap_server_name, 
&ads->ldap.ip) != 0 ) {
-   d_fprintf(stderr, "Failed to verify membership in domain!\n");
+   nt_status = net_rpc_join_ok(short_domain_name,
+   ads->config.ldap_server_name, 
&ads->ldap.ip);
+   if (!NT_STATUS_IS_OK(nt_status)) {
+   d_fprintf(stderr,
+ "Failed to verify membership in domain: %s!\n",
+ nt_errstr(nt_status));
goto fail;
}   
 

Modified: branches/SAMBA_3_2/source/utils/net_rpc_join.c
===
--- branches/SAMBA_3_2/source/utils/net_rpc_join.c  2007-09-17 15:11:20 UTC 
(rev 25197)
+++ branches/SAMBA_3_2/source/utils/net_rpc_join.c  2007-09-17 15:34:22 UTC 
(rev 25198)
@@ -40,7 +40,8 @@
  * @return A shell status integer (0 for success)
  *
  **/
-int net_rpc_join_ok(const char *domain, const char *server, struct in_addr *ip 
)
+NTSTATUS net_rpc_join_ok(const char *domain, const char *server,
+struct in_addr *ip)
 {
enum security_types sec;
unsigned int conn_flags = NET_FLAGS_PDC;
@@ -66,7 +67,7 @@
/* Connect to remote machine */
ntret = net_make_ipc_connection_ex(domain, server, ip, conn_flags, 
&cli);
if (!NT_STATUS_IS_OK(ntret)) {
-   return -1;
+   return ntret;
}
 
/* Setup the creds as though we're going to do schannel... */
@@ -78,13 +79,13 @@
 if (!netlogon_pipe) {
if (NT_STATUS_EQUAL(ntret, NT_STATUS_INVALID_NETWORK_RESPONSE)) 
{
cli_shutdown(cli);
-   return 0;
+   return NT_STATUS_OK;
} else {
DEBUG(0,("net_rpc_join_ok: failed to get schannel 
session "
"key from server %s for domain %s. 
Error was %s\n",
cli->desthost, domain, nt_errstr(ntret) ));
cli_shutdown(cli);
-   return -1;
+   return ntret;
}
}
 
@@ -92,7 +93,7 @@
if (!lp_client_schannel()) {
cli_shutdown(cli);
/* We're good... */
-   return 0;
+   return ntret;
}
 
pipe_hnd = cli_rpc_pipe_open_schannel_with_key(cli, PI_NETLOGON,
@@ -103,12 +104,14 @@
DEBUG(0,("net_rpc_join_ok: failed to open schannel session "
"on netlogon pipe to server %s for domain %s. 
Error was %s\n",
cli->desthost, domain, nt_errstr(ntret) ));
-   cli_shutdown(cli);
-   return -1;
+   /*
+* Note: here, we have:
+* (pipe_hnd != NULL) if and only if NT_STATUS_IS_OK(ntret)
+*/
}
 
cli_shutdown(cli);
-   return 0;
+   return ntret;
 }
 
 /**
@@ -422,8 +425,9 @@
}
 
/* double-check, connection from scratch */
-   retval = net_rpc_join_ok(domain, cli->desthost, &cli->dest_ip);
-   
+   result = net_rpc_join_ok(domain, cli->desthost, &cli->dest_ip);
+   retval = NT_STATUS_IS_OK(result) ? 0 : -1;
+
 done:
 
/* Display success or failure */
@@ -452,10 +456,13 @@
 int net_rpc_testjoin(int argc, const char **argv) 
 {
char *domain = smb_xstrdup(opt_target_workgroup);
+   NTSTATUS nt_status;
 
/* Display success or failure */
-   if (net_rpc_join_ok(domain, NULL, NULL) != 0) {
-   fprintf(stderr,"Join to domain '%s' is not valid\n",domain);
+   nt_status = net_rpc_join_ok(domain, NULL, NULL);
+   if (!NT_STATUS_IS_OK(nt_status)) {
+   fprintf(stderr,"Join to domain '%s' is not valid: %s\n",
+   nt_errstr(nt_status), domain);
free(domain);
return -1;
}

Modified: branches/SAMBA_3_2_0/source/utils/net_ads.c
=

svn commit: samba r25197 - in branches: SAMBA_3_2/source/utils SAMBA_3_2_0/source/utils

2007-09-17 Thread obnox
Author: obnox
Date: 2007-09-17 15:11:20 + (Mon, 17 Sep 2007)
New Revision: 25197

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25197

Log:
Change net_make_ipc_connection() and net_make_ipc_connection_ex() to
return NTSTATUS to allow for better error propagation.

Michael


Modified:
   branches/SAMBA_3_2/source/utils/net.c
   branches/SAMBA_3_2/source/utils/net_rap.c
   branches/SAMBA_3_2/source/utils/net_rpc.c
   branches/SAMBA_3_2/source/utils/net_rpc_join.c
   branches/SAMBA_3_2/source/utils/net_rpc_shell.c
   branches/SAMBA_3_2_0/source/utils/net.c
   branches/SAMBA_3_2_0/source/utils/net_rap.c
   branches/SAMBA_3_2_0/source/utils/net_rpc.c
   branches/SAMBA_3_2_0/source/utils/net_rpc_join.c
   branches/SAMBA_3_2_0/source/utils/net_rpc_shell.c


Changeset:
Sorry, the patch is too large (837 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25197


svn commit: samba r25196 - in branches/SAMBA_4_0/source/rpc_server/lsa: .

2007-09-17 Thread abartlet
Author: abartlet
Date: 2007-09-17 12:44:26 + (Mon, 17 Sep 2007)
New Revision: 25196

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25196

Log:
Thanks to id10ts on IRC for finding some typos in my well-known names
patch.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/rpc_server/lsa/lsa_lookup.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/lsa/lsa_lookup.c
===
--- branches/SAMBA_4_0/source/rpc_server/lsa/lsa_lookup.c   2007-09-17 
10:50:59 UTC (rev 25195)
+++ branches/SAMBA_4_0/source/rpc_server/lsa/lsa_lookup.c   2007-09-17 
12:44:26 UTC (rev 25196)
@@ -40,7 +40,7 @@
},
{
.name = "CREATOR GROUP",
-   .sid = SID_CREATOR_OWNER,
+   .sid = SID_CREATOR_GROUP,
.rtype = SID_NAME_WKN_GRP,
},
{
@@ -52,7 +52,7 @@
{
.domain = "NT AUTHORITY",
.name = "Network",
-   .sid = SID_NT_DIALUP,
+   .sid = SID_NT_NETWORK,
.rtype = SID_NAME_WKN_GRP,
},
{



svn commit: samba r25195 - in branches: SAMBA_3_2/source/lib SAMBA_3_2_0/source/lib

2007-09-17 Thread jra
Author: jra
Date: 2007-09-17 10:50:59 + (Mon, 17 Sep 2007)
New Revision: 25195

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25195

Log:
Fix issue with calling pull_uc2_*alloc with
str_len == 0. We should just return 0 in this
case.
Jeremy.

Modified:
   branches/SAMBA_3_2/source/lib/charcnv.c
   branches/SAMBA_3_2_0/source/lib/charcnv.c


Changeset:
Modified: branches/SAMBA_3_2/source/lib/charcnv.c
===
--- branches/SAMBA_3_2/source/lib/charcnv.c 2007-09-17 05:31:49 UTC (rev 
25194)
+++ branches/SAMBA_3_2/source/lib/charcnv.c 2007-09-17 10:50:59 UTC (rev 
25195)
@@ -1369,6 +1369,10 @@
 {
size_t ret;
 
+   if (!src_len) {
+   return 0;
+   }
+
if (dest_len == (size_t)-1)
dest_len = sizeof(pstring);
 
@@ -1446,6 +1450,10 @@
}
 #endif
 
+   if (!src_len) {
+   return 0;
+   }
+
if (ucs2_align(base_ptr, src, flags)) {
src = (const void *)((const char *)src + 1);
if (src_len != (size_t)-1)

Modified: branches/SAMBA_3_2_0/source/lib/charcnv.c
===
--- branches/SAMBA_3_2_0/source/lib/charcnv.c   2007-09-17 05:31:49 UTC (rev 
25194)
+++ branches/SAMBA_3_2_0/source/lib/charcnv.c   2007-09-17 10:50:59 UTC (rev 
25195)
@@ -1369,6 +1369,10 @@
 {
size_t ret;
 
+   if (!src_len) {
+   return 0;
+   }
+
if (dest_len == (size_t)-1)
dest_len = sizeof(pstring);
 
@@ -1446,6 +1450,10 @@
}
 #endif
 
+   if (!src_len) {
+   return 0;
+   }
+
if (ucs2_align(base_ptr, src, flags)) {
src = (const void *)((const char *)src + 1);
if (src_len != (size_t)-1)