svn commit: samba r17580 - in branches/SAMBA_4_0/source/lib/ldb: . common include man tools

2006-08-17 Thread abartlet
Author: abartlet
Date: 2006-08-17 08:31:19 + (Thu, 17 Aug 2006)
New Revision: 17580

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17580

Log:
Add a new tools to convert back from AD-like schema to OpenLDAP.

Add attribute syntax mapping to the existing OpenLDAP - AD tool.

Andrew Bartlett

Added:
   branches/SAMBA_4_0/source/lib/ldb/man/ad2oLschema.1.xml
   branches/SAMBA_4_0/source/lib/ldb/tools/convert.c
   branches/SAMBA_4_0/source/lib/ldb/tools/convert.h
Modified:
   branches/SAMBA_4_0/source/lib/ldb/Makefile.in
   branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c
   branches/SAMBA_4_0/source/lib/ldb/config.mk
   branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
   branches/SAMBA_4_0/source/lib/ldb/tools/oLschema2ldif.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/ldb/Makefile.in   2006-08-17 01:52:24 UTC 
(rev 17579)
+++ branches/SAMBA_4_0/source/lib/ldb/Makefile.in   2006-08-17 08:31:19 UTC 
(rev 17580)
@@ -114,7 +114,7 @@
$(CC) -o bin/ldbtest tools/ldbtest.o tools/cmdline.o $(LIB_FLAGS)
 
 bin/oLschema2ldif: tools/oLschema2ldif.o tools/cmdline.o $(LIBS)
-   $(CC) -o bin/oLschema2ldif tools/oLschema2ldif.o tools/cmdline.o 
$(LIB_FLAGS)
+   $(CC) -o bin/oLschema2ldif tools/oLschema2ldif.o tools/cmdline.o 
tools/convert.o $(LIB_FLAGS)
 
 examples/ldbreader: examples/ldbreader.o $(LIBS)
$(CC) -o examples/ldbreader examples/ldbreader.o $(LIB_FLAGS)

Modified: branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c
===
--- branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c  2006-08-17 01:52:24 UTC 
(rev 17579)
+++ branches/SAMBA_4_0/source/lib/ldb/common/ldb_msg.c  2006-08-17 08:31:19 UTC 
(rev 17580)
@@ -366,6 +366,23 @@
return strtod((const char *)v-data, NULL);
 }
 
+int ldb_msg_find_attr_as_bool(const struct ldb_message *msg, 
+ const char *attr_name,
+ int default_value)
+{
+   const struct ldb_val *v = ldb_msg_find_ldb_val(msg, attr_name);
+   if (!v || !v-data) {
+   return default_value;
+   }
+   if (strcasecmp(v-data, FALSE) == 0) {
+   return 0;
+   }
+   if (strcasecmp(v-data, TRUE) == 0) {
+   return 1;
+   }
+   return default_value;
+}
+
 const char *ldb_msg_find_attr_as_string(const struct ldb_message *msg, 
const char *attr_name,
const char *default_value)

Modified: branches/SAMBA_4_0/source/lib/ldb/config.mk
===
--- branches/SAMBA_4_0/source/lib/ldb/config.mk 2006-08-17 01:52:24 UTC (rev 
17579)
+++ branches/SAMBA_4_0/source/lib/ldb/config.mk 2006-08-17 08:31:19 UTC (rev 
17580)
@@ -271,12 +271,26 @@
 INSTALLDIR = BINDIR
 MANPAGE = man/oLschema2ldif.1
 OBJ_FILES= \
+   tools/convert.o \
tools/oLschema2ldif.o
 PRIVATE_DEPENDENCIES = \
LIBLDB_CMDLINE
 # End BINARY oLschema2ldif
 
 
+
+# Start BINARY  ad2oLschema
+[BINARY::ad2oLschema]
+INSTALLDIR = BINDIR
+MANPAGE = man/ad2oLschema.1
+OBJ_FILES= \
+   tools/convert.o \
+   tools/ad2oLschema.o
+PRIVATE_DEPENDENCIES = \
+   LIBLDB_CMDLINE
+# End BINARY ad2oLschema
+
+
 ###
 # Start LIBRARY swig_ldb
 [LIBRARY::swig_ldb]

Modified: branches/SAMBA_4_0/source/lib/ldb/include/ldb.h
===
--- branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-08-17 01:52:24 UTC 
(rev 17579)
+++ branches/SAMBA_4_0/source/lib/ldb/include/ldb.h 2006-08-17 08:31:19 UTC 
(rev 17580)
@@ -1265,6 +1265,9 @@
 double ldb_msg_find_attr_as_double(const struct ldb_message *msg, 
   const char *attr_name,
   double default_value);
+int ldb_msg_find_attr_as_bool(const struct ldb_message *msg, 
+ const char *attr_name,
+ int default_value);
 const char *ldb_msg_find_attr_as_string(const struct ldb_message *msg, 
const char *attr_name,
const char *default_value);

Added: branches/SAMBA_4_0/source/lib/ldb/man/ad2oLschema.1.xml
===
--- branches/SAMBA_4_0/source/lib/ldb/man/ad2oLschema.1.xml 2006-08-17 
01:52:24 UTC (rev 17579)
+++ branches/SAMBA_4_0/source/lib/ldb/man/ad2oLschema.1.xml 2006-08-17 
08:31:19 UTC (rev 17580)
@@ -0,0 +1,87 @@
+?xml version=1.0 encoding=iso-8859-1?
+!DOCTYPE 

svn commit: samba r17581 - in branches/SAMBA_4_0/source/lib/ldb/tools: .

2006-08-17 Thread abartlet
Author: abartlet
Date: 2006-08-17 08:49:57 + (Thu, 17 Aug 2006)
New Revision: 17581

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17581

Log:
Add tool to convert AD schema back to OpenLDAP's schema formatting.

Andrew Bartlett

Added:
   branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c


Changeset:
Added: branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c
===
--- branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c   2006-08-17 
08:31:19 UTC (rev 17580)
+++ branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c   2006-08-17 
08:49:57 UTC (rev 17581)
@@ -0,0 +1,324 @@
+/* 
+   ldb database library
+
+   Copyright (C) Andrew Bartlett 2006
+
+ ** NOTE! The following LGPL license applies to the ldb
+ ** library. This does NOT imply that all of Samba is released
+ ** under the LGPL
+   
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   This library 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
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with this library; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+/*
+ *  Name: ldb
+ *
+ *  Component: ad2oLschema
+ *
+ *  Description: utility to convert an AD schema into the format required by 
OpenLDAP
+ *
+ *  Author: Andrew Tridgell
+ */
+
+#include includes.h
+#include ldb/include/includes.h
+#include ldb/tools/cmdline.h
+#include ldb/tools/convert.h
+
+struct schema_conv {
+   int count;
+   int skipped;
+   int failures;
+};
+
+static void usage(void)
+{
+   printf(Usage: ad2oLschema options\n);
+   printf(\nConvert AD-like LDIF to OpenLDAP schema format\n\n);
+   printf(Options:\n);
+   printf(  -I inputfile inputfile of mapped OIDs and skipped 
attributes/ObjectClasses);
+   printf(  -H url   LDB or LDAP server to read schmea from\n);
+   printf(  -O outputfileoutputfile otherwise STDOUT\n);
+   printf(  -o options   pass options like modules to activate\n);
+   printf(  e.g: -o modules:timestamps\n);
+   printf(\n);
+   printf(Converts records from an AD-like LDIF schema into an openLdap 
formatted schema\n\n);
+   exit(1);
+};
+
+static int fetch_schema(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct 
ldb_result **attrs_res, struct ldb_result **objectclasses_res) 
+{
+   TALLOC_CTX *local_ctx = talloc_new(mem_ctx);
+   struct ldb_dn *basedn, *schemadn;
+   struct ldb_result *res;
+   int ret;
+   const char *rootdse_attrs[] = {schemaNamingContext, NULL};
+   const char *attrs[] = {
+   lDAPDisplayName,
+   mayContain,
+   mustContain,
+   systemMayContain,
+   systemMustContain,
+   objectClassCategory,
+   isSingleValued,
+   attributeID,
+   attributeSyntax,
+   description,  
+   subClassOf,
+   NULL
+   };
+
+   if (!local_ctx) {
+   return LDB_ERR_OPERATIONS_ERROR;
+   }
+   
+   basedn = ldb_dn_explode(mem_ctx, );
+   if (!basedn) {
+   return LDB_ERR_OPERATIONS_ERROR;
+   }
+   
+   /* Search for rootdse */
+   ret = ldb_search(ldb, basedn, LDB_SCOPE_BASE, NULL, rootdse_attrs, 
res);
+   if (ret != LDB_SUCCESS) {
+   printf(Search failed: %s\n, ldb_errstring(ldb));
+   return LDB_ERR_OPERATIONS_ERROR;
+   }
+   
+   if (res-count != 1) {
+   return LDB_ERR_OPERATIONS_ERROR;
+   }
+   
+   /* Locate schema */
+   schemadn = ldb_msg_find_attr_as_dn(mem_ctx, res-msgs[0], 
schemaNamingContext);
+   if (!schemadn) {
+   return LDB_ERR_OPERATIONS_ERROR;
+   }
+
+   /* Downlaod schema */
+   ret = ldb_search(ldb, schemadn, LDB_SCOPE_SUBTREE, 
+objectClass=attributeSchema, 
+attrs, attrs_res);
+   if (ret != LDB_SUCCESS) {
+   printf(Search failed: %s\n, ldb_errstring(ldb));
+   return LDB_ERR_OPERATIONS_ERROR;
+   }
+
+   ret = ldb_search(ldb, schemadn, LDB_SCOPE_SUBTREE, 
+objectClass=classSchema, 
+attrs, objectclasses_res);
+   if (ret != LDB_SUCCESS) {
+   printf(Search failed: %s\n, ldb_errstring(ldb));
+   return ret;
+   }
+
+ 

svn commit: samba r17582 - in branches/SAMBA_4_0/source/lib/ldb: .

2006-08-17 Thread abartlet
Author: abartlet
Date: 2006-08-17 08:55:09 + (Thu, 17 Aug 2006)
New Revision: 17582

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17582

Log:
Fix dependenies for oLschema2ldif.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/ldb/Makefile.in


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/Makefile.in
===
--- branches/SAMBA_4_0/source/lib/ldb/Makefile.in   2006-08-17 08:49:57 UTC 
(rev 17581)
+++ branches/SAMBA_4_0/source/lib/ldb/Makefile.in   2006-08-17 08:55:09 UTC 
(rev 17582)
@@ -113,7 +113,7 @@
 bin/ldbtest: tools/ldbtest.o tools/cmdline.o $(LIBS)
$(CC) -o bin/ldbtest tools/ldbtest.o tools/cmdline.o $(LIB_FLAGS)
 
-bin/oLschema2ldif: tools/oLschema2ldif.o tools/cmdline.o $(LIBS)
+bin/oLschema2ldif: tools/oLschema2ldif.o tools/cmdline.o tools/convert.o 
$(LIBS)
$(CC) -o bin/oLschema2ldif tools/oLschema2ldif.o tools/cmdline.o 
tools/convert.o $(LIB_FLAGS)
 
 examples/ldbreader: examples/ldbreader.o $(LIBS)



svn commit: samba r17583 - in branches/SAMBA_3_0/source/libsmb: .

2006-08-17 Thread vlendec
Author: vlendec
Date: 2006-08-17 10:01:48 + (Thu, 17 Aug 2006)
New Revision: 17583

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17583

Log:
Change internal cli_session_setup functions to NTSTATUS.

Volker
Modified:
   branches/SAMBA_3_0/source/libsmb/cliconnect.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/cliconnect.c
===
--- branches/SAMBA_3_0/source/libsmb/cliconnect.c   2006-08-17 08:55:09 UTC 
(rev 17582)
+++ branches/SAMBA_3_0/source/libsmb/cliconnect.c   2006-08-17 10:01:48 UTC 
(rev 17583)
@@ -55,16 +55,19 @@
  Do an old lanman2 style session setup.
 /
 
-static BOOL cli_session_setup_lanman2(struct cli_state *cli, const char *user, 
- const char *pass, size_t passlen, const 
char *workgroup)
+static NTSTATUS cli_session_setup_lanman2(struct cli_state *cli,
+ const char *user, 
+ const char *pass, size_t passlen,
+ const char *workgroup)
 {
DATA_BLOB session_key = data_blob(NULL, 0);
DATA_BLOB lm_response = data_blob(NULL, 0);
fstring pword;
char *p;
 
-   if (passlen  sizeof(pword)-1)
-   return False;
+   if (passlen  sizeof(pword)-1) {
+   return NT_STATUS_INVALID_PARAMETER;
+   }
 
/* LANMAN servers predate NT status codes and Unicode and ignore those 
   smb flags so we must disable the corresponding default capabilities  
@@ -82,7 +85,7 @@
lm_response = data_blob(NULL, 24);
if (!SMBencrypt(pass, cli-secblob.data,(uchar 
*)lm_response.data)) {
DEBUG(1, (Password is  14 chars in length, and is 
therefore incompatible with Lanman authentication\n));
-   return False;
+   return NT_STATUS_ACCESS_DENIED;
}
} else if ((cli-sec_mode  NEGOTIATE_SECURITY_CHALLENGE_RESPONSE)  
passlen == 24) {
/* Encrypted mode needed, and encrypted password supplied. */
@@ -115,14 +118,15 @@
p += clistr_push(cli, p, Samba, -1, STR_TERMINATE);
cli_setup_bcc(cli, p);
 
-   cli_send_smb(cli);
-   if (!cli_receive_smb(cli))
-   return False;
+   if (!cli_send_smb(cli) || !cli_receive_smb(cli)) {
+   return cli_nt_error(cli);
+   }
 
show_msg(cli-inbuf);
 
-   if (cli_is_error(cli))
-   return False;
+   if (cli_is_error(cli)) {
+   return cli_nt_error(cli);
+   }

/* use the returned vuid from now on */
cli-vuid = SVAL(cli-inbuf,smb_uid);   
@@ -133,7 +137,7 @@
cli_set_session_key(cli, session_key);
}
 
-   return True;
+   return NT_STATUS_OK;
 }
 
 /
@@ -158,7 +162,7 @@
  Do a NT1 guest session setup.
 /
 
-static BOOL cli_session_setup_guest(struct cli_state *cli)
+static NTSTATUS cli_session_setup_guest(struct cli_state *cli)
 {
char *p;
uint32 capabilities = cli_session_setup_capabilities(cli);
@@ -183,14 +187,15 @@
p += clistr_push(cli, p, Samba, -1, STR_TERMINATE);
cli_setup_bcc(cli, p);
 
-   cli_send_smb(cli);
-   if (!cli_receive_smb(cli))
- return False;
+   if (!cli_send_smb(cli) || !cli_receive_smb(cli)) {
+   return cli_nt_error(cli);
+   }

show_msg(cli-inbuf);

-   if (cli_is_error(cli))
-   return False;
+   if (cli_is_error(cli)) {
+   return cli_nt_error(cli);
+   }
 
cli-vuid = SVAL(cli-inbuf,smb_uid);
 
@@ -205,15 +210,16 @@
 
fstrcpy(cli-user_name, );
 
-   return True;
+   return NT_STATUS_OK;
 }
 
 /
  Do a NT1 plaintext session setup.
 /
 
-static BOOL cli_session_setup_plaintext(struct cli_state *cli, const char 
*user, 
-   const char *pass, const char *workgroup)
+static NTSTATUS cli_session_setup_plaintext(struct cli_state *cli,
+   const char *user, const char *pass,
+   const char *workgroup)
 {
uint32 capabilities = cli_session_setup_capabilities(cli);
char *p;
@@ -252,14 +258,15 @@
p += clistr_push(cli, p, lanman, -1, STR_TERMINATE);
cli_setup_bcc(cli, p);
 
-   cli_send_smb(cli);
-   if (!cli_receive_smb(cli))
- return False;
+   if (!cli_send_smb(cli) || 

svn commit: samba r17584 - in branches/SAMBA_3_0/source: auth lib nsswitch sam utils

2006-08-17 Thread vlendec
Author: vlendec
Date: 2006-08-17 11:54:23 + (Thu, 17 Aug 2006)
New Revision: 17584

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17584

Log:
Some C++ Warnings
Modified:
   branches/SAMBA_3_0/source/auth/auth_script.c
   branches/SAMBA_3_0/source/lib/talloctort.c
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
   branches/SAMBA_3_0/source/sam/idmap_rid.c
   branches/SAMBA_3_0/source/utils/log2pcaphex.c


Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_script.c
===
--- branches/SAMBA_3_0/source/auth/auth_script.c2006-08-17 10:01:48 UTC 
(rev 17583)
+++ branches/SAMBA_3_0/source/auth/auth_script.c2006-08-17 11:54:23 UTC 
(rev 17584)
@@ -69,7 +69,7 @@
48 + 1 + /* 24 bytes of challenge going to 48 */
48 + 1;
 
-   secret_str = malloc(secret_str_len);
+   secret_str = (char *)malloc(secret_str_len);
if (!secret_str) {
return NT_STATUS_NO_MEMORY;
}

Modified: branches/SAMBA_3_0/source/lib/talloctort.c
===
--- branches/SAMBA_3_0/source/lib/talloctort.c  2006-08-17 10:01:48 UTC (rev 
17583)
+++ branches/SAMBA_3_0/source/lib/talloctort.c  2006-08-17 11:54:23 UTC (rev 
17584)
@@ -403,7 +403,7 @@
talloc_report(root, stdout);
 
 
-   p2 = talloc_zero_size(p1, 20);
+   p2 = (char *)talloc_zero_size(p1, 20);
if (p2[19] != 0) {
printf(Failed to give zero memory\n);
return False;
@@ -465,7 +465,7 @@
talloc_unlink(NULL, p1);
 
p1 = talloc_named_const(root, 10, p1);
-   p2 = talloc_named_const(root, 20, p2);
+   p2 = (char *)talloc_named_const(root, 20, p2);
talloc_reference(p1, p2);
talloc_report_full(root, stdout);
talloc_unlink(root, p2);
@@ -477,7 +477,7 @@
talloc_unlink(root, p1);
 
p1 = talloc_named_const(root, 10, p1);
-   p2 = talloc_named_const(root, 20, p2);
+   p2 = (char *)talloc_named_const(root, 20, p2);
talloc_reference(NULL, p2);
talloc_report_full(root, stdout);
talloc_unlink(root, p2);

Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2006-08-17 10:01:48 UTC 
(rev 17583)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c2006-08-17 11:54:23 UTC 
(rev 17584)
@@ -1036,7 +1036,7 @@
case 0:
pam_get_data( pamh, PAM_WINBIND_NEW_AUTHTOK_REQD, (const void 
**)tmp);
if (tmp != NULL) {
-   retval = atoi(tmp);
+   retval = atoi((const char *)tmp);
switch (retval) {
case PAM_AUTHTOK_EXPIRED:
/* fall through, since new token is required in 
this case */

Modified: branches/SAMBA_3_0/source/sam/idmap_rid.c
===
--- branches/SAMBA_3_0/source/sam/idmap_rid.c   2006-08-17 10:01:48 UTC (rev 
17583)
+++ branches/SAMBA_3_0/source/sam/idmap_rid.c   2006-08-17 11:54:23 UTC (rev 
17584)
@@ -196,9 +196,9 @@
}
 
/* open a connection to the dc */
-   username = secrets_fetch(SECRETS_AUTH_USER, NULL);
-   password = secrets_fetch(SECRETS_AUTH_PASSWORD, NULL);
-   domain =   secrets_fetch(SECRETS_AUTH_DOMAIN, NULL);
+   username = (char *)secrets_fetch(SECRETS_AUTH_USER, NULL);
+   password = (char *)secrets_fetch(SECRETS_AUTH_PASSWORD, NULL);
+   domain =   (char *)secrets_fetch(SECRETS_AUTH_DOMAIN, NULL);
 
if (username) {
 

Modified: branches/SAMBA_3_0/source/utils/log2pcaphex.c
===
--- branches/SAMBA_3_0/source/utils/log2pcaphex.c   2006-08-17 10:01:48 UTC 
(rev 17583)
+++ branches/SAMBA_3_0/source/utils/log2pcaphex.c   2006-08-17 11:54:23 UTC 
(rev 17584)
@@ -142,7 +142,7 @@
long newlen;

newlen = length+sizeof(HDR_IP)+sizeof(HDR_TCP);
-   newdata = malloc(newlen);
+   newdata = (unsigned char *)malloc(newlen);
 
HDR_IP.packet_length = htons(newlen);
HDR_TCP.window = htons(0x2000);
@@ -165,7 +165,7 @@
int tmp; long i;
assert(fscanf(in,  size=%ld\n, buffersize));
*buffersize+=4; /* for netbios */
-   buffer = malloc(*buffersize);
+   buffer = (unsigned char *)malloc(*buffersize);
memset(buffer, 0, *buffersize);
/* NetBIOS */
buffer[0] = 0x00;



svn commit: samba r17585 - in branches/SAMBA_3_0/source/utils: .

2006-08-17 Thread vlendec
Author: vlendec
Date: 2006-08-17 12:44:59 + (Thu, 17 Aug 2006)
New Revision: 17585

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17585

Log:
Don't let ads_status throw away the error information.

Thanks to Michael Adam [EMAIL PROTECTED].

Volker
Modified:
   branches/SAMBA_3_0/source/utils/net_ads.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_ads.c
===
--- branches/SAMBA_3_0/source/utils/net_ads.c   2006-08-17 11:54:23 UTC (rev 
17584)
+++ branches/SAMBA_3_0/source/utils/net_ads.c   2006-08-17 12:44:59 UTC (rev 
17585)
@@ -216,9 +216,8 @@
setenv(KRB5_ENV_CCNAME, MEMORY:net_ads, 1);
 }
 
-static ADS_STRUCT *ads_startup(BOOL only_own_domain)
+static ADS_STATUS ads_startup(BOOL only_own_domain, ADS_STRUCT **ads)
 {
-   ADS_STRUCT *ads;
ADS_STATUS status;
BOOL need_password = False;
BOOL second_time = False;
@@ -234,7 +233,7 @@
realm = lp_realm();
}

-   ads = ads_init(realm, opt_target_workgroup, opt_host);
+   *ads = ads_init(realm, opt_target_workgroup, opt_host);
 
if (!opt_user_name) {
opt_user_name = administrator;
@@ -254,23 +253,23 @@
 
if (opt_password) {
use_in_memory_ccache();
-   ads-auth.password = smb_xstrdup(opt_password);
+   (*ads)-auth.password = smb_xstrdup(opt_password);
}
 
-   ads-auth.user_name = smb_xstrdup(opt_user_name);
+   (*ads)-auth.user_name = smb_xstrdup(opt_user_name);
 
/*
 * If the username is of the form [EMAIL PROTECTED], 
 * extract the realm and convert to upper case.
 * This is only used to establish the connection.
 */
-   if ((cp = strchr_m(ads-auth.user_name, '@'))!=0) {
+   if ((cp = strchr_m((*ads)-auth.user_name, '@'))!=0) {
*cp++ = '\0';
-   ads-auth.realm = smb_xstrdup(cp);
-   strupper_m(ads-auth.realm);
+   (*ads)-auth.realm = smb_xstrdup(cp);
+   strupper_m((*ads)-auth.realm);
}
 
-   status = ads_connect(ads);
+   status = ads_connect(*ads);
 
if (!ADS_ERR_OK(status)) {
if (!need_password  !second_time) {
@@ -278,12 +277,10 @@
second_time = True;
goto retry;
} else {
-   d_printf(%s.\n, ads_errstr(status));
-   ads_destroy(ads);
-   return NULL;
+   ads_destroy(ads);
}
}
-   return ads;
+   return status;
 }
 
 
@@ -404,7 +401,7 @@
 
if (argc  1) return net_ads_user_usage(argc, argv);

-   if (!(ads = ads_startup(False))) {
+   if (!ADS_ERR_OK(ads_startup(False, ads))) {
return -1;
}
 
@@ -489,7 +486,7 @@
return -1;
}
 
-   if (!(ads = ads_startup(False))) {
+   if (!ADS_ERR_OK(ads_startup(False, ads))) {
SAFE_FREE(escaped_user);
return -1;
}
@@ -536,7 +533,7 @@
return net_ads_user_usage(argc, argv);
}

-   if (!(ads = ads_startup(False))) {
+   if (!ADS_ERR_OK(ads_startup(False, ads))) {
return -1;
}
 
@@ -576,7 +573,7 @@
char *disp_fields[2] = {NULL, NULL};

if (argc == 0) {
-   if (!(ads = ads_startup(False))) {
+   if (!ADS_ERR_OK(ads_startup(False, ads))) {
return -1;
}
 
@@ -613,7 +610,7 @@
return net_ads_group_usage(argc, argv);
}

-   if (!(ads = ads_startup(False))) {
+   if (!ADS_ERR_OK(ads_startup(False, ads))) {
return -1;
}
 
@@ -662,7 +659,7 @@
return net_ads_group_usage(argc, argv);
}

-   if (!(ads = ads_startup(False))) {
+   if (!ADS_ERR_OK(ads_startup(False, ads))) {
return -1;
}
 
@@ -701,7 +698,7 @@
char *disp_fields[2] = {NULL, NULL};
 
if (argc == 0) {
-   if (!(ads = ads_startup(False))) {
+   if (!ADS_ERR_OK(ads_startup(False, ads))) {
return -1;
}
 
@@ -727,7 +724,7 @@
ADS_STATUS rc;
void *res;
 
-   if (!(ads = ads_startup(True))) {
+   if (!ADS_ERR_OK(ads_startup(True, ads))) {
return -1;
}
 
@@ -776,7 +773,7 @@
/* The finds a DC and takes care of getting the 
   user creds if necessary */
 
-   if (!(ads = ads_startup(True))) {
+   if (!ADS_ERR_OK(ads_startup(True, ads))) {
return -1;
}
 
@@ -826,7 +823,7 @@
 
net_use_machine_password();
 
-   if (!(ads = ads_startup(True))) {
+   if (!ADS_ERR_OK(ads_startup(True, ads))) {
return -1;
}

svn commit: samba r17586 - in branches/SAMBA_4_0/source: cldap_server heimdal_build kdc ldap_server lib lib/socket libcli/resolve libcli/wrepl nbt_server nbt_server/wins rpc_server scripting/ejs smb_s

2006-08-17 Thread metze
Author: metze
Date: 2006-08-17 13:37:04 + (Thu, 17 Aug 2006)
New Revision: 17586

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17586

Log:
merge lib/netif into lib/socket and use -lnsl -lsocket on the 
configure check for the interfaces.

should fix the build on some old sun boxes

metze
Added:
   branches/SAMBA_4_0/source/lib/socket/interface.c
   branches/SAMBA_4_0/source/lib/socket/netif.c
   branches/SAMBA_4_0/source/lib/socket/netif.h
Removed:
   branches/SAMBA_4_0/source/lib/netif/
Modified:
   branches/SAMBA_4_0/source/cldap_server/cldap_server.c
   branches/SAMBA_4_0/source/cldap_server/netlogon.c
   branches/SAMBA_4_0/source/heimdal_build/glue.c
   branches/SAMBA_4_0/source/kdc/kdc.c
   branches/SAMBA_4_0/source/ldap_server/ldap_server.c
   branches/SAMBA_4_0/source/lib/basic.mk
   branches/SAMBA_4_0/source/lib/socket/config.m4
   branches/SAMBA_4_0/source/lib/socket/config.mk
   branches/SAMBA_4_0/source/libcli/resolve/bcast.c
   branches/SAMBA_4_0/source/libcli/resolve/nbtlist.c
   branches/SAMBA_4_0/source/libcli/wrepl/winsrepl.c
   branches/SAMBA_4_0/source/nbt_server/interfaces.c
   branches/SAMBA_4_0/source/nbt_server/nbt_server.c
   branches/SAMBA_4_0/source/nbt_server/wins/wins_ldb.c
   branches/SAMBA_4_0/source/nbt_server/wins/winsdb.c
   branches/SAMBA_4_0/source/rpc_server/dcerpc_sock.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_config.c
   branches/SAMBA_4_0/source/scripting/ejs/smbcalls_sys.c
   branches/SAMBA_4_0/source/smb_server/smb_server.c
   branches/SAMBA_4_0/source/torture/local/socket.c
   branches/SAMBA_4_0/source/torture/nbt/dgram.c
   branches/SAMBA_4_0/source/torture/nbt/register.c
   branches/SAMBA_4_0/source/torture/nbt/wins.c
   branches/SAMBA_4_0/source/torture/nbt/winsbench.c
   branches/SAMBA_4_0/source/torture/nbt/winsreplication.c
   branches/SAMBA_4_0/source/utils/nmblookup.c
   branches/SAMBA_4_0/source/web_server/web_server.c
   branches/SAMBA_4_0/source/wrepl_server/wrepl_in_connection.c


Changeset:
Sorry, the patch is too large (1259 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17586


svn commit: samba r17587 - in branches/SAMBA_4_0/source/lib/socket: .

2006-08-17 Thread metze
Author: metze
Date: 2006-08-17 13:38:59 + (Thu, 17 Aug 2006)
New Revision: 17587

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17587

Log:
ignore generated files

metze
Modified:
   branches/SAMBA_4_0/source/lib/socket/


Changeset:

Property changes on: branches/SAMBA_4_0/source/lib/socket
___
Name: svn:ignore
   - .sconsign
*.d

   + *.d
netif_proto.h



svn commit: samba r17588 - in branches/SAMBA_4_0/source: .

2006-08-17 Thread metze
Author: metze
Date: 2006-08-17 13:41:23 + (Thu, 17 Aug 2006)
New Revision: 17588

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17588

Log:
this file doesn't exist anymore

metze
Modified:
   branches/SAMBA_4_0/source/configure.ac


Changeset:
Modified: branches/SAMBA_4_0/source/configure.ac
===
--- branches/SAMBA_4_0/source/configure.ac  2006-08-17 13:38:59 UTC (rev 
17587)
+++ branches/SAMBA_4_0/source/configure.ac  2006-08-17 13:41:23 UTC (rev 
17588)
@@ -28,7 +28,6 @@
 sinclude(lib/popt/config.m4)
 sinclude(lib/charset/config.m4)
 sinclude(lib/socket/config.m4)
-sinclude(lib/netif/config.m4)
 sinclude(lib/talloc/config.m4)
 sinclude(lib/tdb/config.m4)
 sinclude(lib/ldb/sqlite3.m4)



svn commit: samba r17589 - in branches/SAMBA_3_0/source/libads: .

2006-08-17 Thread vlendec
Author: vlendec
Date: 2006-08-17 13:46:02 + (Thu, 17 Aug 2006)
New Revision: 17589

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17589

Log:
Check in the really uncontroversial patch from Michael
Modified:
   branches/SAMBA_3_0/source/libads/ads_status.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ads_status.c
===
--- branches/SAMBA_3_0/source/libads/ads_status.c   2006-08-17 13:41:23 UTC 
(rev 17588)
+++ branches/SAMBA_3_0/source/libads/ads_status.c   2006-08-17 13:46:02 UTC 
(rev 17589)
@@ -72,6 +72,9 @@
if (status.error_type == ENUM_ADS_ERROR_NT){
return status.err.nt_status;
}
+   if (status.error_type == ENUM_ADS_ERROR_SYSTEM) {
+   return map_nt_error_from_unix(status.err.rc);
+   }
 #ifdef HAVE_LDAP
if ((status.error_type == ENUM_ADS_ERROR_LDAP) 
 (status.err.rc == LDAP_NO_MEMORY)) {
@@ -84,6 +87,8 @@
return NT_STATUS_LOGON_FAILURE;
} else if (status.err.rc == KRB5_KDC_UNREACH) {
return NT_STATUS_NO_LOGON_SERVERS;
+   } else if (status.err.rc == KRB5KRB_AP_ERR_SKEW) {
+   return NT_STATUS_TIME_DIFFERENCE_AT_DC;
}
}
 #endif



svn commit: samba r17590 - in branches/SAMBA_3_0/source/printing: .

2006-08-17 Thread vlendec
Author: vlendec
Date: 2006-08-17 14:28:03 + (Thu, 17 Aug 2006)
New Revision: 17590

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17590

Log:
Some C++ Warnings
Modified:
   branches/SAMBA_3_0/source/printing/notify.c
   branches/SAMBA_3_0/source/printing/nt_printing.c
   branches/SAMBA_3_0/source/printing/printing.c


Changeset:
Modified: branches/SAMBA_3_0/source/printing/notify.c
===
--- branches/SAMBA_3_0/source/printing/notify.c 2006-08-17 13:46:02 UTC (rev 
17589)
+++ branches/SAMBA_3_0/source/printing/notify.c 2006-08-17 14:28:03 UTC (rev 
17590)
@@ -99,7 +99,7 @@
msg-len, msg-notify.data);
 
if (buflen != len) {
-   buf = TALLOC_REALLOC(send_ctx, buf, len);
+   buf = (char *)TALLOC_REALLOC(send_ctx, buf, len);
if (!buf)
return False;
buflen = len;
@@ -140,7 +140,7 @@
}
offset += 4; /* For count. */
 
-   buf = TALLOC(send_ctx, offset);
+   buf = (char *)TALLOC(send_ctx, offset);
if (!buf) {
DEBUG(0,(print_notify_send_messages: Out of memory\n));
talloc_free_children(send_ctx);
@@ -220,7 +220,7 @@
memcpy( to, from, sizeof(SPOOLSS_NOTIFY_MSG) );

if ( from-len ) {
-   to-notify.data = TALLOC_MEMDUP(send_ctx, from-notify.data, 
from-len );
+   to-notify.data = (char *)TALLOC_MEMDUP(send_ctx, 
from-notify.data, from-len );
if ( !to-notify.data ) {
DEBUG(0,(copy_notify2_msg: talloc_memdup() of size 
[%d] failed!\n, from-len ));
return False;

Modified: branches/SAMBA_3_0/source/printing/nt_printing.c
===
--- branches/SAMBA_3_0/source/printing/nt_printing.c2006-08-17 13:46:02 UTC 
(rev 17589)
+++ branches/SAMBA_3_0/source/printing/nt_printing.c2006-08-17 14:28:03 UTC 
(rev 17590)
@@ -1035,7 +1035,7 @@
char*buf = NULL;
ssize_t byte_count;
 
-   if ((buf=SMB_MALLOC(PE_HEADER_SIZE)) == NULL) {
+   if ((buf=(char *)SMB_MALLOC(PE_HEADER_SIZE)) == NULL) {
DEBUG(0,(get_file_version: PE file [%s] PE Header malloc 
failed bytes = %d\n,
fname, PE_HEADER_SIZE));
goto error_exit;
@@ -1091,7 +1091,7 @@
goto error_exit;
 
SAFE_FREE(buf);
-   if ((buf=SMB_MALLOC(section_table_bytes)) == NULL) {
+   if ((buf=(char *)SMB_MALLOC(section_table_bytes)) == NULL) {
DEBUG(0,(get_file_version: PE file [%s] section table 
malloc failed bytes = %d\n,
fname, section_table_bytes));
goto error_exit;
@@ -1115,7 +1115,7 @@
goto error_exit;
 
SAFE_FREE(buf);
-   if ((buf=SMB_MALLOC(section_bytes)) == NULL) {
+   if ((buf=(char *)SMB_MALLOC(section_bytes)) == 
NULL) {
DEBUG(0,(get_file_version: PE file 
[%s] version malloc failed bytes = %d\n,
fname, section_bytes));
goto error_exit;
@@ -1175,7 +1175,7 @@
 
/* Allocate a bit more space to speed up things */
SAFE_FREE(buf);
-   if ((buf=SMB_MALLOC(VS_NE_BUF_SIZE)) == NULL) {
+   if ((buf=(char *)SMB_MALLOC(VS_NE_BUF_SIZE)) == NULL) {
DEBUG(0,(get_file_version: NE file [%s] malloc failed 
bytes  = %d\n,
fname, PE_HEADER_SIZE));
goto error_exit;
@@ -2083,7 +2083,7 @@
memset(info.dependentfiles, '\0', 2*sizeof(fstring));
fstrcpy(info.dependentfiles[0], );
 
-   *info_ptr = memdup(info, sizeof(info));
+   *info_ptr = (NT_PRINTER_DRIVER_INFO_LEVEL_3 *)memdup(info, 
sizeof(info));
if (!*info_ptr) {
SAFE_FREE(info.dependentfiles);
return WERR_NOMEM;
@@ -2555,7 +2555,7 @@
 
new_nt_devicemode-nt_dev_private = NULL;
if (nt_devicemode-nt_dev_private != NULL) {
-   if ((new_nt_devicemode-nt_dev_private = 
memdup(nt_devicemode-nt_dev_private, nt_devicemode-driverextra)) == NULL) {
+   if ((new_nt_devicemode-nt_dev_private = (uint8 
*)memdup(nt_devicemode-nt_dev_private, nt_devicemode-driverextra)) == NULL) {
SAFE_FREE(new_nt_devicemode);
DEBUG(0,(dup_nt_devicemode: malloc fail.\n));
return NULL;
@@ -3039,7 +3039,7 @@
/* We use ldap_get_dn here as we need the answer
 * in utf8 to call ldap_explode_dn(). JRA. */
 
-

svn commit: samba r17591 - in branches/SAMBA_3_0/source/utils: .

2006-08-17 Thread vlendec
Author: vlendec
Date: 2006-08-17 14:38:59 + (Thu, 17 Aug 2006)
New Revision: 17591

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17591

Log:
machine_account is unused, and ctx must be freed. Thanks Michael
Modified:
   branches/SAMBA_3_0/source/utils/net_ads.c


Changeset:
Modified: branches/SAMBA_3_0/source/utils/net_ads.c
===
--- branches/SAMBA_3_0/source/utils/net_ads.c   2006-08-17 14:28:03 UTC (rev 
17590)
+++ branches/SAMBA_3_0/source/utils/net_ads.c   2006-08-17 14:38:59 UTC (rev 
17591)
@@ -1168,11 +1168,10 @@
ADS_STRUCT *ads = NULL;
ADS_STATUS status;
NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
-   char *machine_account = NULL;
const char *short_domain_name = NULL;
char *tmp_password, *password;
struct cldap_netlogon_reply cldap_reply;
-   TALLOC_CTX *ctx;
+   TALLOC_CTX *ctx = NULL;
DOM_SID *domain_sid = NULL;
BOOL createupn = False;
const char *machineupn = NULL;
@@ -1342,7 +1341,6 @@
 
d_printf(Joined '%s' to realm '%s'\n, global_myname(), 
ads-config.realm);
 
-   SAFE_FREE(machine_account);
TALLOC_FREE( ctx );
ads_destroy(ads);

@@ -1353,6 +1351,7 @@
d_printf(Failed to join domain: %s\n, 
 get_friendly_nt_error_msg(nt_status));
ads_destroy(ads);
+   TALLOC_FREE( ctx );
return -1;
 }
 



svn commit: samba r17592 - in branches/SAMBA_3_0/source: lib passdb

2006-08-17 Thread vlendec
Author: vlendec
Date: 2006-08-17 15:04:53 + (Thu, 17 Aug 2006)
New Revision: 17592

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17592

Log:
Remove some unused functions pointed out by John E. Malmberg, make
do_file_lock static to pdb_smbpasswd.c, the only user of it.

Volker
Modified:
   branches/SAMBA_3_0/source/lib/util_file.c
   branches/SAMBA_3_0/source/passdb/pdb_smbpasswd.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/util_file.c
===
--- branches/SAMBA_3_0/source/lib/util_file.c   2006-08-17 14:38:59 UTC (rev 
17591)
+++ branches/SAMBA_3_0/source/lib/util_file.c   2006-08-17 15:04:53 UTC (rev 
17592)
@@ -24,241 +24,6 @@
 #define MAP_FAILED ((void *)-1)
 #endif
 
-static int gotalarm;
-
-/***
- Signal function to tell us we timed out.
-/
-
-static void gotalarm_sig(void)
-{
-   gotalarm = 1;
-}
-
-/***
- Lock or unlock a fd for a known lock type. Abandon after waitsecs 
- seconds.
-/
-
-BOOL do_file_lock(int fd, int waitsecs, int type)
-{
-   SMB_STRUCT_FLOCK lock;
-   int ret;
-   void (*oldsig_handler)(int);
-
-   gotalarm = 0;
-   oldsig_handler = CatchSignal(SIGALRM, SIGNAL_CAST gotalarm_sig);
-
-   lock.l_type = type;
-   lock.l_whence = SEEK_SET;
-   lock.l_start = 0;
-   lock.l_len = 1;
-   lock.l_pid = 0;
-
-   alarm(waitsecs);
-   /* Note we must *NOT* use sys_fcntl here ! JRA */
-   ret = fcntl(fd, SMB_F_SETLKW, lock);
-   alarm(0);
-   CatchSignal(SIGALRM, SIGNAL_CAST oldsig_handler);
-
-   if (gotalarm) {
-   DEBUG(0, (do_file_lock: failed to %s file.\n,
-   type == F_UNLCK ? unlock : lock));
-   return False;
-   }
-
-   return (ret == 0);
-}
-
-/***
- Lock an fd. Abandon after waitsecs seconds.
-/
-
-BOOL file_lock(int fd, int type, int secs, int *plock_depth)
-{
-   if (fd  0)
-   return False;
-
-   (*plock_depth)++;
-
-   if ((*plock_depth) == 0) {
-   if (!do_file_lock(fd, secs, type)) {
-   DEBUG(10,(file_lock: locking file failed, error = 
%s.\n, strerror(errno)));
-   return False;
-   }
-   }
-
-   return True;
-}
-
-/***
- Unlock an fd. Abandon after waitsecs seconds.
-/
-
-BOOL file_unlock(int fd, int *plock_depth)
-{
-   BOOL ret=True;
-
-   if(*plock_depth == 1) {
-   ret = do_file_lock(fd, 5, F_UNLCK);
-   }
-
-   (*plock_depth)--;
-
-   if(!ret) {
-   DEBUG(10,(file_unlock: unlocking file failed, error = %s.\n, 
strerror(errno)));
-   }
-   return ret;
-}
-
-/***
- Locks a file for enumeration / modification.
- update to be set = True if modification is required.
-/
-
-void *startfilepwent(char *pfile, char *s_readbuf, int bufsize,
-   int *file_lock_depth, BOOL update)
-{
-   FILE *fp = NULL;
-
-   if (!*pfile) {
-   DEBUG(0, (startfilepwent: No file set\n));
-   return (NULL);
-   }
-   DEBUG(10, (startfilepwent: opening file %s\n, pfile));
-
-   fp = sys_fopen(pfile, update ? r+b : rb);
-
-   if (fp == NULL) {
-   DEBUG(0, (startfilepwent: unable to open file %s\n, pfile));
-   return NULL;
-   }
-
-   /* Set a buffer to do more efficient reads */
-   setvbuf(fp, s_readbuf, _IOFBF, bufsize);
-
-   if (!file_lock(fileno(fp), (update ? F_WRLCK : F_RDLCK), 5, 
file_lock_depth)) {
-   DEBUG(0, (startfilepwent: unable to lock file %s\n, pfile));
-   fclose(fp);
-   return NULL;
-   }
-
-   /* Make sure it is only rw by the owner */
-   chmod(pfile, 0600);
-
-   /* We have a lock on the file. */
-   return (void *)fp;
-}
-
-/***
- End enumeration of the file.
-/
-
-void endfilepwent(void *vp, int *file_lock_depth)
-{
-   FILE *fp = (FILE *)vp;
-
-   file_unlock(fileno(fp), file_lock_depth);
-   fclose(fp);
-   DEBUG(7, (endfilepwent: closed file.\n));
-}
-
-/*
- Return the current position in the file list as an 

svn commit: samba r17593 - in branches/SOC/sree/ui: .

2006-08-17 Thread sree
Author: sree
Date: 2006-08-17 16:55:48 + (Thu, 17 Aug 2006)
New Revision: 17593

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17593

Log:
Remove the prototype HTML files, which are now converted to mostly-final JS 
files.

Also, add the code for the user browser.

Added:
   branches/SOC/sree/ui/newuser.js
   branches/SOC/sree/ui/test.html
   branches/SOC/sree/ui/userbrowser.js
   branches/SOC/sree/ui/userprop.js
Removed:
   branches/SOC/sree/ui/newuser.html
   branches/SOC/sree/ui/propuser.html
Modified:
   branches/SOC/sree/ui/README


Changeset:
Sorry, the patch is too large (1264 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17593


svn commit: samba r17594 - in branches/SAMBA_3_0_23/source: lib smbd

2006-08-17 Thread idra
Author: idra
Date: 2006-08-17 16:57:42 + (Thu, 17 Aug 2006)
New Revision: 17594

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17594

Log:

Let innetgr(0 work without binding its use to a NIS domain
(to support negroups to be stored on files/ldap/other on
platforms that support that)

Simo.


Modified:
   branches/SAMBA_3_0_23/source/lib/access.c
   branches/SAMBA_3_0_23/source/smbd/password.c


Changeset:
Modified: branches/SAMBA_3_0_23/source/lib/access.c
===
--- branches/SAMBA_3_0_23/source/lib/access.c   2006-08-17 16:55:48 UTC (rev 
17593)
+++ branches/SAMBA_3_0_23/source/lib/access.c   2006-08-17 16:57:42 UTC (rev 
17594)
@@ -83,8 +83,7 @@
yp_get_default_domain(mydomain);
 
if (!mydomain) {
-   DEBUG(0,(Unable to get default yp domain.\n));
-   return False;
+   DEBUG(0,(Unable to get default yp domain. Try without 
it.\n));
}
if (!(hostname = SMB_STRDUP(s))) {
DEBUG(1,(out of memory for strdup!\n));
@@ -95,7 +94,7 @@

DEBUG(5,(looking for %s of domain %s in netgroup %s gave 
%s\n, 
 hostname,
-mydomain, 
+mydomain?mydomain:(ANY), 
 tok+1,
 BOOLSTR(netgroup_ok)));
 

Modified: branches/SAMBA_3_0_23/source/smbd/password.c
===
--- branches/SAMBA_3_0_23/source/smbd/password.c2006-08-17 16:55:48 UTC 
(rev 17593)
+++ branches/SAMBA_3_0_23/source/smbd/password.c2006-08-17 16:57:42 UTC 
(rev 17594)
@@ -420,12 +420,11 @@
yp_get_default_domain(mydomain);
 
if(mydomain == NULL) {
-   DEBUG(5,(Unable to get default yp domain\n));
-   return False;
+   DEBUG(5,(Unable to get default yp domain, let's try without 
specifying it\n));
}
 
DEBUG(5,(looking for user %s of domain %s in netgroup %s\n,
-   user, mydomain, ngname));
+   user, mydomain?mydomain:(ANY), ngname));
 
if (innetgr(ngname, NULL, user, mydomain)) {
DEBUG(5,(user_in_netgroup: Found\n));
@@ -441,7 +440,7 @@
strlower_m(lowercase_user);

DEBUG(5,(looking for user %s of domain %s in netgroup %s\n,
-   lowercase_user, mydomain, ngname));
+   lowercase_user, mydomain?mydomain:(ANY), ngname));
 
if (innetgr(ngname, NULL, lowercase_user, mydomain)) {
DEBUG(5,(user_in_netgroup: Found\n));



svn commit: samba r17595 - in branches: SAMBA_3_0/source/libsmb SAMBA_3_0_23/source/libsmb

2006-08-17 Thread jra
Author: jra
Date: 2006-08-17 19:49:54 + (Thu, 17 Aug 2006)
New Revision: 17595

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17595

Log:
Fix from Ben Winslow [EMAIL PROTECTED] to allow
client smb signing to be correctly turned off.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/libsmb/smb_signing.c
   branches/SAMBA_3_0_23/source/libsmb/smb_signing.c


Changeset:
Modified: branches/SAMBA_3_0/source/libsmb/smb_signing.c
===
--- branches/SAMBA_3_0/source/libsmb/smb_signing.c  2006-08-17 16:57:42 UTC 
(rev 17594)
+++ branches/SAMBA_3_0/source/libsmb/smb_signing.c  2006-08-17 19:49:54 UTC 
(rev 17595)
@@ -108,6 +108,10 @@
 
 static BOOL cli_set_smb_signing_common(struct cli_state *cli) 
 {
+   if (!cli-sign_info.allow_smb_signing) {
+   return False;
+   }
+
if (!cli-sign_info.negotiated_smb_signing 
 !cli-sign_info.mandatory_signing) {
return False;

Modified: branches/SAMBA_3_0_23/source/libsmb/smb_signing.c
===
--- branches/SAMBA_3_0_23/source/libsmb/smb_signing.c   2006-08-17 16:57:42 UTC 
(rev 17594)
+++ branches/SAMBA_3_0_23/source/libsmb/smb_signing.c   2006-08-17 19:49:54 UTC 
(rev 17595)
@@ -108,6 +108,10 @@
 
 static BOOL cli_set_smb_signing_common(struct cli_state *cli) 
 {
+   if (!cli-sign_info.allow_smb_signing) {
+   return False;
+   }
+
if (!cli-sign_info.negotiated_smb_signing 
 !cli-sign_info.mandatory_signing) {
return False;



svn commit: samba r17596 - in branches/SAMBA_4_0/source/lib/ldb/modules: .

2006-08-17 Thread idra
Author: idra
Date: 2006-08-17 20:06:43 + (Thu, 17 Aug 2006)
New Revision: 17596

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17596

Log:

apply patch from Martin


Modified:
   branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c
===
--- branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c 2006-08-17 19:49:54 UTC 
(rev 17595)
+++ branches/SAMBA_4_0/source/lib/ldb/modules/ldb_map.c 2006-08-17 20:06:43 UTC 
(rev 17596)
@@ -806,11 +806,11 @@
 {

static const struct ldb_map_attribute objectclass_map = {
-   .local_name = objectclass,
+   .local_name = objectClass,
.type = MAP_CONVERT,
.u = {
.convert = {
-.remote_name = objectclass,
+.remote_name = objectClass,
 .convert_local = map_objectclass_convert_local,
 .convert_remote = 
map_objectclass_convert_remote,
 },
@@ -1160,12 +1160,12 @@
},
},
{
-   .local_name = objectclass,
+   .local_name = objectClass,
.type = MAP_GENERATE,
.convert_operator = map_objectclass_convert_operator,
.u = {
.generate = {
-.remote_names = { objectclass, NULL },
+.remote_names = { objectClass, NULL },
 .generate_local = 
map_objectclass_generate_local,
 .generate_remote = 
map_objectclass_generate_remote,
 },



svn commit: samba r17597 - in branches/SAMBA_4_0/testprogs/ejs: .

2006-08-17 Thread idra
Author: idra
Date: 2006-08-17 20:21:14 + (Thu, 17 Aug 2006)
New Revision: 17597

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17597

Log:

fix prefix path handling


Modified:
   branches/SAMBA_4_0/testprogs/ejs/ldb.js
   branches/SAMBA_4_0/testprogs/ejs/samba3sam.js


Changeset:
Modified: branches/SAMBA_4_0/testprogs/ejs/ldb.js
===
--- branches/SAMBA_4_0/testprogs/ejs/ldb.js 2006-08-17 20:06:43 UTC (rev 
17596)
+++ branches/SAMBA_4_0/testprogs/ejs/ldb.js 2006-08-17 20:21:14 UTC (rev 
17597)
@@ -18,7 +18,7 @@
 libinclude(base.js);
 
 if (options.ARGV.length != 1) {
-   println(Usage: ldap.js HOST);
+   println(Usage: ldb.js prefix);
return -1;
 }
 
@@ -88,10 +88,10 @@
 defaultNamingContext: cn=Test
 
 dn: @PARTITION
-partition: cn=SideTest: + prefix +  testside.ldb
-partition: cn=Sub,cn=PartTest: + prefix +  testsub.ldb
-partition: cn=PartTest: + prefix +  testpartition.ldb
-partition: cn=Sub,cn=Sub,cn=PartTest: + prefix +  testsubsub.ldb
+partition: cn=SideTest: + prefix + / + testside.ldb
+partition: cn=Sub,cn=PartTest: + prefix + / + testsub.ldb
+partition: cn=PartTest: + prefix + / + testpartition.ldb
+partition: cn=Sub,cn=Sub,cn=PartTest: + prefix + / + testsubsub.ldb
 replicateEntries: @SUBCLASSES
 replicateEntries: @ATTRIBUTES
 replicateEntries: @INDEXLIST
@@ -349,31 +349,31 @@
 sys = sys_init();
 var dbfile = test.ldb;
 
-sys.unlink(prefix + dbfile);
-sys.unlink(prefix + testpartition.ldb);
-sys.unlink(prefix + testsub.ldb);
-sys.unlink(prefix + testsubsub.ldb);
-sys.unlink(prefix + testside.ldb);
+sys.unlink(prefix + / + dbfile);
+sys.unlink(prefix + / + testpartition.ldb);
+sys.unlink(prefix + / + testsub.ldb);
+sys.unlink(prefix + / + testsubsub.ldb);
+sys.unlink(prefix + / + testside.ldb);
 
-var ok = ldb.connect(tdb:// + prefix + dbfile);
+var ok = ldb.connect(tdb:// + prefix + / + dbfile);
 assert(ok);
 
 basic_tests(ldb);
 
 setup_modules(ldb);
 ldb = ldb_init();
-var ok = ldb.connect(tdb:// + prefix + dbfile);
+var ok = ldb.connect(tdb:// + prefix + / + dbfile);
 assert(ok);
 
 parttestldb = ldb_init();
-var ok = parttestldb.connect(tdb:// + prefix + testpartition.ldb);
+var ok = parttestldb.connect(tdb:// + prefix + / + testpartition.ldb);
 assert(ok);
 
 modules_test(ldb, parttestldb);
 
-sys.unlink(prefix + dbfile);
-sys.unlink(prefix + testpartition.ldb);
-sys.unlink(prefix + testsub.ldb);
-sys.unlink(prefix + testsubsub.ldb);
-sys.unlink(prefix + testside.ldb);
+sys.unlink(prefix + / + dbfile);
+sys.unlink(prefix + / + testpartition.ldb);
+sys.unlink(prefix + / + testsub.ldb);
+sys.unlink(prefix + / + testsubsub.ldb);
+sys.unlink(prefix + / + testside.ldb);
 return 0;

Modified: branches/SAMBA_4_0/testprogs/ejs/samba3sam.js
===
--- branches/SAMBA_4_0/testprogs/ejs/samba3sam.js   2006-08-17 20:06:43 UTC 
(rev 17596)
+++ branches/SAMBA_4_0/testprogs/ejs/samba3sam.js   2006-08-17 20:21:14 UTC 
(rev 17597)
@@ -27,7 +27,7 @@
 datadir = options.ARGV[1];
 
 function setup_modules(sys, ldb, from, to) {
-   var ldif = sys.file_load(datadir + provision_samba3sam.ldif);
+   var ldif = sys.file_load(datadir + / + provision_samba3sam.ldif);
ldif = substitute_var(ldif, from);
assert(ldif != undefined);
var ok = ldb.add(ldif);
@@ -52,7 +52,7 @@
 }
 
 function setup_data(sys, ldb, remote) {
-   var ldif = sys.file_load(datadir + samba3.ldif);
+   var ldif = sys.file_load(datadir + / + samba3.ldif);
ldif = substitute_var(ldif, remote);
assert(ldif != undefined);
var ok = ldb.add(ldif);
@@ -216,16 +216,16 @@
 }
 
 sys = sys_init();
-var ldbfile = prefix + test.ldb;
+var ldbfile = prefix + / + test.ldb;
 var ldburl = tdb:// + ldbfile;
 
 var samba4 = new Object(samba4 partition info);
-var samba4.FILE = prefix + samba4.ldb;
+var samba4.FILE = prefix + / + samba4.ldb;
 var samba4.URL = tdb:// + samba4.FILE;
 var samba4.BASEDN = dc=vernstok,dc=nl;
 
 var samba3 = new Object(samba3 partition info);
-var samba3.FILE = prefix + samba3.ldb;
+var samba3.FILE = prefix + / + samba3.ldb;
 var samba3.URL = tdb:// + samba3.FILE;
 var samba3.BASEDN = cn=Samba3Sam, + samba4.BASEDN;
 



svn commit: linux-cifs-client r73 - in branches/linux-converged-for-old-kernels/fs/cifs: .

2006-08-17 Thread sfrench
Author: sfrench
Date: 2006-08-17 21:47:38 + (Thu, 17 Aug 2006)
New Revision: 73

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=linux-cifs-clientrev=73

Log:
Merge cifs with git tree

Modified:
   branches/linux-converged-for-old-kernels/fs/cifs/CHANGES
   branches/linux-converged-for-old-kernels/fs/cifs/README
   branches/linux-converged-for-old-kernels/fs/cifs/xattr.c


Changeset:
Modified: branches/linux-converged-for-old-kernels/fs/cifs/CHANGES
===
--- branches/linux-converged-for-old-kernels/fs/cifs/CHANGES2006-08-16 
19:51:48 UTC (rev 72)
+++ branches/linux-converged-for-old-kernels/fs/cifs/CHANGES2006-08-17 
21:47:38 UTC (rev 73)
@@ -5,7 +5,8 @@
 on requests on other threads.  Improve POSIX locking emulation,
 (lock cancel now works, and unlock of merged range works even
 to Windows servers now).  Fix oops on mount to lanman servers
-(win9x, os/2 etc.) when null password.
+(win9x, os/2 etc.) when null password.  Do not send listxattr
+(SMB to query all EAs) if nouser_xattr specified.
 
 Version 1.44
 

Modified: branches/linux-converged-for-old-kernels/fs/cifs/README
===
--- branches/linux-converged-for-old-kernels/fs/cifs/README 2006-08-16 
19:51:48 UTC (rev 72)
+++ branches/linux-converged-for-old-kernels/fs/cifs/README 2006-08-17 
21:47:38 UTC (rev 73)
@@ -408,7 +408,7 @@
   user_xattrAllow getting and setting user xattrs as OS/2 EAs (extended
attributes) to the server (default) e.g. via setfattr 
and getfattr utilities. 
-  nouser_xattr  Do not allow getfattr/setfattr to get/set xattrs 
+  nouser_xattr  Do not allow getfattr/setfattr to get/set/list xattrs 
   mapchars  Translate six of the seven reserved characters (not backslash)
*?|:
to the remap range (above 0xF000), which also

Modified: branches/linux-converged-for-old-kernels/fs/cifs/xattr.c
===
--- branches/linux-converged-for-old-kernels/fs/cifs/xattr.c2006-08-16 
19:51:48 UTC (rev 72)
+++ branches/linux-converged-for-old-kernels/fs/cifs/xattr.c2006-08-17 
21:47:38 UTC (rev 73)
@@ -330,11 +330,15 @@
sb = direntry-d_inode-i_sb;
if(sb == NULL)
return -EIO;
-   xid = GetXid();
 
cifs_sb = CIFS_SB(sb);
pTcon = cifs_sb-tcon;
 
+   if(cifs_sb-mnt_cifs_flags  CIFS_MOUNT_NO_XATTR)
+   return -EOPNOTSUPP;
+
+   xid = GetXid();
+
full_path = build_path_from_dentry(direntry);
if(full_path == NULL) {
FreeXid(xid);



svn commit: samba r17598 - in branches/SAMBA_4_0/testprogs/ejs: .

2006-08-17 Thread abartlet
Author: abartlet
Date: 2006-08-17 22:18:20 + (Thu, 17 Aug 2006)
New Revision: 17598

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17598

Log:
Patch from Martin K?\195?\188hl [EMAIL PROTECTED] to update the samba3sam test
suite, which contains tests for the samba3sam and ldb_map modules,
with a lot of tests for search requests.

The tests add a small set of known records to the database, half of
them with only remote data, half of them split across the local and
remote backends, and test searching these records by DN, by attribute
and with a range of parse trees.

This suite should be extensive enough to ensure that behaviour of
search requests doesn't break.


Modified:
   branches/SAMBA_4_0/testprogs/ejs/samba3sam.js


Changeset:
Sorry, the patch is too large (707 lines) to include; please use WebSVN to see 
it!
WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17598


Build status as of Fri Aug 18 00:00:01 2006

2006-08-17 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2006-08-17 
00:00:09.0 +
+++ /home/build/master/cache/broken_results.txt 2006-08-18 00:00:10.0 
+
@@ -1,18 +1,18 @@
-Build status as of Thu Aug 17 00:00:02 2006
+Build status as of Fri Aug 18 00:00:01 2006
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
-ccache   22 4  0 
-distcc   23 2  0 
+ccache   23 6  0 
+distcc   24 2  0 
 lorikeet-heimdal 0  0  0 
-ppp  12 0  0 
-rsync24 1  0 
+ppp  13 0  0 
+rsync25 2  0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba4   35 18 4 
-samba_3_031 6  0 
-smb-build19 19 0 
-talloc   14 4  0 
-tdb  23 8  0 
+samba4   36 17 2 
+samba_3_033 7  0 
+smb-build20 20 0 
+talloc   26 9  0 
+tdb  24 8  0 
 


svn commit: samba r17599 - in branches/SAMBA_4_0/source/lib/ldb/tools: .

2006-08-17 Thread abartlet
Author: abartlet
Date: 2006-08-18 03:52:50 + (Fri, 18 Aug 2006)
New Revision: 17599

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17599

Log:
Improvements to the AD-like to OpenLDAP format schema conversion utility.

We now read the objectClasses, and sort them into order, so that
OpenLDAP will load them.  We do this by walking down the 'subClassOf'
chain.  This should also be used in the objectClass module to sort the
objectClass list, and to populate the @SUBCLASS records.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c
===
--- branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c   2006-08-17 
22:18:20 UTC (rev 17598)
+++ branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c   2006-08-18 
03:52:50 UTC (rev 17599)
@@ -43,6 +43,12 @@
int failures;
 };
 
+enum convert_target {
+   TARGET_OPENLDAP,
+   TARGET_FEDORA_DS
+};
+   
+
 static void usage(void)
 {
printf(Usage: ad2oLschema options\n);
@@ -58,25 +64,18 @@
exit(1);
 };
 
-static int fetch_schema(struct ldb_context *ldb, TALLOC_CTX *mem_ctx, struct 
ldb_result **attrs_res, struct ldb_result **objectclasses_res) 
+static int fetch_attrs_schema(struct ldb_context *ldb, struct ldb_dn *schemadn,
+ TALLOC_CTX *mem_ctx, 
+ struct ldb_result **attrs_res)
 {
TALLOC_CTX *local_ctx = talloc_new(mem_ctx);
-   struct ldb_dn *basedn, *schemadn;
-   struct ldb_result *res;
int ret;
-   const char *rootdse_attrs[] = {schemaNamingContext, NULL};
const char *attrs[] = {
lDAPDisplayName,
-   mayContain,
-   mustContain,
-   systemMayContain,
-   systemMustContain,
-   objectClassCategory,
isSingleValued,
attributeID,
attributeSyntax,
description,  
-   subClassOf,
NULL
};
 
@@ -84,53 +83,153 @@
return LDB_ERR_OPERATIONS_ERROR;
}

-   basedn = ldb_dn_explode(mem_ctx, );
-   if (!basedn) {
+   /* Downlaod schema */
+   ret = ldb_search(ldb, schemadn, LDB_SCOPE_SUBTREE, 
+objectClass=attributeSchema, 
+attrs, attrs_res);
+   if (ret != LDB_SUCCESS) {
+   printf(Search failed: %s\n, ldb_errstring(ldb));
return LDB_ERR_OPERATIONS_ERROR;
}

-   /* Search for rootdse */
-   ret = ldb_search(ldb, basedn, LDB_SCOPE_BASE, NULL, rootdse_attrs, 
res);
+   return ret;
+}
+
+static const char *oc_attrs[] = {
+   lDAPDisplayName,
+   mayContain,
+   mustContain,
+   systemMayContain,
+   systemMustContain,
+   objectClassCategory,
+   governsID,
+   description,  
+   subClassOf,
+   NULL
+};
+
+static int fetch_oc_recursive(struct ldb_context *ldb, struct ldb_dn 
*schemadn, 
+ TALLOC_CTX *mem_ctx, 
+ struct ldb_result *search_from,
+ struct ldb_result *res_list)
+{
+   int i;
+   int ret = 0;
+   for (i=0; i  search_from-count; i++) {
+   struct ldb_result *res;
+   const char *name = 
ldb_msg_find_attr_as_string(search_from-msgs[i], 
+  
lDAPDisplayname, NULL);
+   char *filter = talloc_asprintf(mem_ctx, 
(((objectClass=classSchema)(subClassOf=%s))(!(lDAPDisplayName=%s))), 
+  name, name);
+
+   ret = ldb_search(ldb, schemadn, LDB_SCOPE_SUBTREE, 
+filter,
+oc_attrs, res);
+   talloc_free(filter);
+   if (ret != LDB_SUCCESS) {
+   printf(Search failed: %s\n, ldb_errstring(ldb));
+   return ret;
+   }
+   
+   talloc_steal(mem_ctx, res);
+
+   res_list-msgs = talloc_realloc(res_list, res_list-msgs, 
+   struct ldb_message *, 
res_list-count + 2);
+   if (!res_list-msgs) {
+   return LDB_ERR_OPERATIONS_ERROR;
+   }
+   res_list-msgs[res_list-count] = talloc_steal(res_list, 
search_from-msgs[i]);
+   res_list-count++;
+   res_list-msgs[res_list-count] = NULL;
+
+   if (res-count  0) {
+   ret = fetch_oc_recursive(ldb, schemadn, mem_ctx, res, 
res_list); 
+   }
+   if (ret != LDB_SUCCESS) {
+   return ret;
+   }
+   }
+   return