svn commit: samba r17600 - in branches/SAMBA_4_0/source: lib/ldb/tools setup

2006-08-18 Thread abartlet
Author: abartlet
Date: 2006-08-18 06:14:21 + (Fri, 18 Aug 2006)
New Revision: 17600

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

Log:
Finish the schema conversion tool, and add a mapping file, used to map
OIDs and skip built-in attributes.

Andrew Bartlett

Added:
   branches/SAMBA_4_0/source/setup/schema-map-openldap-2.3
Modified:
   branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c
   branches/SAMBA_4_0/source/lib/ldb/tools/convert.c
   branches/SAMBA_4_0/source/setup/provision_init.ldif
   branches/SAMBA_4_0/source/setup/schema.ldif
   branches/SAMBA_4_0/source/setup/schema_samba4.ldif


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c
===
--- branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c   2006-08-18 
03:52:50 UTC (rev 17599)
+++ branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c   2006-08-18 
06:14:21 UTC (rev 17600)
@@ -105,6 +105,11 @@
governsID,
description,  
subClassOf,
+   objectClassCategory,
+   mustContain,
+   systemMustContain,
+   mayContain,
+   systemMayContain,
NULL
 };
 
@@ -229,6 +234,14 @@
return schemadn;
 }
 
+#define IF_NULL_FAIL_RET(x) do { \
+   if (!x) {   \
+   ret.failures++; \
+   return ret; \
+   }   \
+   } while (0) 
+
+
 static struct schema_conv process_convert(struct ldb_context *ldb, enum 
convert_target target, FILE *in, FILE *out) 
 {
/* Read list of attributes to skip, OIDs to map */
@@ -242,6 +255,7 @@
} *oid_map = NULL;
int num_maps = 0;
struct ldb_result *attrs_res, *objectclasses_res;
+   struct ldb_message *msg;
struct ldb_dn *schemadn;
struct schema_conv ret;
 
@@ -252,24 +266,36 @@
ret.failures = 0;
 
while ((line = afdgets(fileno(in), mem_ctx, 0))) {
-   if (!*line) {
-   break;
+   /* Blank Line */
+   if (line[0] == '\0') {
+   continue;
}
-   if (isdigit(*line)) {
+   /* Comment */
+   if (line[0] == '#') {
+   continue;
+   }
+   if (isdigit(line[0])) {
char *p = strchr(line, ':');
+   IF_NULL_FAIL_RET(p);
if (!p) {
ret.failures = 1;
return ret;
}
+   p[0] = '\0';
p++;
oid_map = talloc_realloc(mem_ctx, oid_map, struct 
oid_map, num_maps + 2);
+   trim_string(line,  ,  );
oid_map[num_maps].old_oid = talloc_steal(oid_map, line);
+   trim_string(p,  ,  );
oid_map[num_maps].new_oid = p;
num_maps++;
oid_map[num_maps].old_oid = NULL;
} else {
attrs_skip = talloc_realloc(mem_ctx, attrs_skip, const 
char *, num_skip + 2);
+   trim_string(line,  ,  );
attrs_skip[num_skip] = talloc_steal(attrs_skip, line);
+   num_skip++;
+   attrs_skip[num_skip] = NULL;
}
}
 
@@ -288,17 +314,19 @@
}

for (i=0; i  attrs_res-count; i++) {
-   const char *name = 
ldb_msg_find_attr_as_string(attrs_res-msgs[i], lDAPDisplayName, NULL);
-   const char *description = 
ldb_msg_find_attr_as_string(attrs_res-msgs[i], description, NULL);
-   const char *oid = 
ldb_msg_find_attr_as_string(attrs_res-msgs[i], attributeID, NULL);
-   const char *syntax = 
ldb_msg_find_attr_as_string(attrs_res-msgs[i], attributeSyntax, NULL);
-   BOOL single_value = 
ldb_msg_find_attr_as_bool(attrs_res-msgs[i], isSingleValued, False);
+   msg = attrs_res-msgs[i];
+
+   const char *name = ldb_msg_find_attr_as_string(msg, 
lDAPDisplayName, NULL);
+   const char *description = ldb_msg_find_attr_as_string(msg, 
description, NULL);
+   const char *oid = ldb_msg_find_attr_as_string(msg, 
attributeID, NULL);
+   const char *syntax = ldb_msg_find_attr_as_string(msg, 
attributeSyntax, NULL);
+   BOOL single_value = ldb_msg_find_attr_as_bool(msg, 
isSingleValued, False);
const struct syntax_map *map = 
find_syntax_map_by_ad_oid(syntax);
char *schema_entry = NULL;
int j;
 
/* We have been asked to skip some attributes/objectClasses */
-   if (in_list(attrs_skip, name, False)) {
+   if (str_list_check_ci(attrs_skip, name)) {

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

2006-08-18 Thread abartlet
Author: abartlet
Date: 2006-08-18 12:27:14 + (Fri, 18 Aug 2006)
New Revision: 17601

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

Log:
Fix declaration after statement.

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-18 
06:14:21 UTC (rev 17600)
+++ branches/SAMBA_4_0/source/lib/ldb/tools/ad2oLschema.c   2006-08-18 
12:27:14 UTC (rev 17601)
@@ -255,7 +255,6 @@
} *oid_map = NULL;
int num_maps = 0;
struct ldb_result *attrs_res, *objectclasses_res;
-   struct ldb_message *msg;
struct ldb_dn *schemadn;
struct schema_conv ret;
 
@@ -314,7 +313,7 @@
}

for (i=0; i  attrs_res-count; i++) {
-   msg = attrs_res-msgs[i];
+   struct ldb_message *msg = attrs_res-msgs[i];
 
const char *name = ldb_msg_find_attr_as_string(msg, 
lDAPDisplayName, NULL);
const char *description = ldb_msg_find_attr_as_string(msg, 
description, NULL);
@@ -410,7 +409,7 @@
}

for (i=0; i  objectclasses_res-count; i++) {
-   msg = objectclasses_res-msgs[i];
+   struct ldb_message *msg = objectclasses_res-msgs[i];
const char *name = ldb_msg_find_attr_as_string(msg, 
lDAPDisplayName, NULL);
const char *description = ldb_msg_find_attr_as_string(msg, 
description, NULL);
const char *oid = ldb_msg_find_attr_as_string(msg, governsID, 
NULL);



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

2006-08-18 Thread vlendec
Author: vlendec
Date: 2006-08-18 12:39:21 + (Fri, 18 Aug 2006)
New Revision: 17602

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

Log:
Make check_ads_config return NTSTATUS, set some error codes in net_ads_join.

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-18 12:27:14 UTC (rev 
17601)
+++ branches/SAMBA_3_0/source/utils/net_ads.c   2006-08-18 12:39:21 UTC (rev 
17602)
@@ -852,32 +852,33 @@
   Simple configu checks before beginning the join
  /
 
-static int check_ads_config( void )
+static NTSTATUS check_ads_config( void )
 {
if (lp_server_role() != ROLE_DOMAIN_MEMBER ) {
d_printf(Host is not configured as a member server.\n);
-   return -1;
+   return NT_STATUS_INVALID_DOMAIN_ROLE;
}
 
if (strlen(global_myname())  15) {
d_printf(Our netbios name can be at most 15 chars long, 
-\%s\ is %u chars long\n,
-global_myname(), (unsigned 
int)strlen(global_myname()));
-   return -1;
+\%s\ is %u chars long\n, global_myname(),
+(unsigned int)strlen(global_myname()));
+   return NT_STATUS_NAME_TOO_LONG;
}
 
if ( lp_security() == SEC_ADS  !*lp_realm()) {
d_fprintf(stderr, realm must be set in in smb.conf for ADS 
join to succeed.\n);
-   return -1;
+   return NT_STATUS_INVALID_PARAMETER;
}
 
if (!secrets_init()) {
DEBUG(1,(Failed to initialise secrets database\n));
-   return -1;
+   /* This is a good bet for failure of secrets_init ... */
+   return NT_STATUS_ACCESS_DENIED;
}

-   return 0;
+   return NT_STATUS_OK;
 }
 
 /***
@@ -1167,7 +1168,7 @@
 {
ADS_STRUCT *ads = NULL;
ADS_STATUS status;
-   NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL;
+   NTSTATUS nt_status;
const char *short_domain_name = NULL;
char *tmp_password, *password;
struct cldap_netlogon_reply cldap_reply;
@@ -1178,7 +1179,8 @@
const char *create_in_ou = NULL;
int i;

-   if ( check_ads_config() != 0 ) {
+   nt_status = check_ads_config();
+   if (!NT_STATUS_IS_OK(nt_status)) {
d_fprintf(stderr, Invalid configuration.  Exiting\n);
goto fail;
}
@@ -1194,11 +1196,13 @@
d_fprintf(stderr, realm of remote server (%s) and realm in 
smb.conf 
(%s) DO NOT match.  Aborting join\n, 
ads-config.realm, 
lp_realm());
+   nt_status = NT_STATUS_INVALID_PARAMETER;
goto fail;
}
 
if (!(ctx = talloc_init(net_ads_join))) {
d_fprintf(stderr, Could not initialise talloc context.\n);
+   nt_status = NT_STATUS_NO_MEMORY;
goto fail;
}
 
@@ -1212,6 +1216,7 @@
else if ( !StrnCaseCmp(argv[i], createcomputer, 
strlen(createcomputer)) ) {
if ( (create_in_ou = get_string_param(argv[i])) == NULL 
) {
d_fprintf(stderr, Please supply a valid OU 
path\n);
+   nt_status = NT_STATUS_INVALID_PARAMETER;
goto fail;
}   
}
@@ -1278,6 +1283,9 @@
if ( (netdom_store_machine_account( lp_workgroup(), domain_sid, 
password ) == -1)
|| (netdom_store_machine_account( short_domain_name, 
domain_sid, password ) == -1) )
{
+   /* issue an internal error here for now.
+* everything else would mean changing tdb routines. */
+   nt_status = NT_STATUS_INTERNAL_ERROR;
goto fail;
}
 



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

2006-08-18 Thread vlendec
Author: vlendec
Date: 2006-08-18 12:45:51 + (Fri, 18 Aug 2006)
New Revision: 17603

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

Log:
Make net_ads_join_ok return NTSTATUS.

Thanks to Michael Adam [EMAIL PROTECTED]

hop, hop, hop... ;-)

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-18 12:39:21 UTC (rev 
17602)
+++ branches/SAMBA_3_0/source/utils/net_ads.c   2006-08-18 12:45:51 UTC (rev 
17603)
@@ -812,23 +812,25 @@
return ret;
 }
 
-static int net_ads_join_ok(void)
+static NTSTATUS net_ads_join_ok(void)
 {
ADS_STRUCT *ads = NULL;
+   ADS_STATUS status;
 
if (!secrets_init()) {
DEBUG(1,(Failed to initialise secrets database\n));
-   return -1;
+   return NT_STATUS_ACCESS_DENIED;
}
 
net_use_machine_password();
 
-   if (!ADS_ERR_OK(ads_startup(True, ads))) {
-   return -1;
+   status = ads_startup(True, ads);
+   if (!ADS_ERR_OK(status)) {
+   return ads_ntstatus(status);
}
 
ads_destroy(ads);
-   return 0;
+   return NT_STATUS_OK;
 }
 
 /*
@@ -836,11 +838,14 @@
  */
 int net_ads_testjoin(int argc, const char **argv)
 {
+   NTSTATUS status;
use_in_memory_ccache();
 
/* Display success or failure */
-   if (net_ads_join_ok() != 0) {
-   fprintf(stderr,Join to domain is not valid\n);
+   status = net_ads_join_ok();
+   if (!NT_STATUS_IS_OK(status)) {
+   fprintf(stderr,Join to domain is not valid: %s\n, 
+   get_friendly_nt_error_msg(status));
return -1;
}
 



svn commit: samba r17604 - in branches/SAMBA_3_0/source/smbd: .

2006-08-18 Thread vlendec
Author: vlendec
Date: 2006-08-18 13:37:36 + (Fri, 18 Aug 2006)
New Revision: 17604

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

Log:
Fix a bug caught by g++.

Jeremy, please check this!

Volker
Modified:
   branches/SAMBA_3_0/source/smbd/trans2.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/trans2.c
===
--- branches/SAMBA_3_0/source/smbd/trans2.c 2006-08-18 12:45:51 UTC (rev 
17603)
+++ branches/SAMBA_3_0/source/smbd/trans2.c 2006-08-18 13:37:36 UTC (rev 
17604)
@@ -4584,8 +4584,8 @@
count,
offset,

lock_type,
+   
POSIX_LOCK,

blocking_lock,
-   
POSIX_LOCK,

status);
 
if (br_lck  blocking_lock  
ERROR_WAS_LOCK_DENIED(status)) {



svn commit: samba r17605 - in branches/SAMBA_3_0/source: client nsswitch

2006-08-18 Thread vlendec
Author: vlendec
Date: 2006-08-18 14:05:25 + (Fri, 18 Aug 2006)
New Revision: 17605

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

Log:
Some C++ warnings
Modified:
   branches/SAMBA_3_0/source/client/mount.cifs.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_async.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_cred_cache.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_group.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_misc.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_sid.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_user.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_util.c


Changeset:
Modified: branches/SAMBA_3_0/source/client/mount.cifs.c
===
--- branches/SAMBA_3_0/source/client/mount.cifs.c   2006-08-18 13:37:36 UTC 
(rev 17604)
+++ branches/SAMBA_3_0/source/client/mount.cifs.c   2006-08-18 14:05:25 UTC 
(rev 17605)
@@ -143,7 +143,7 @@
fs = fopen(file_name,r);
if(fs == NULL)
return errno;
-   line_buf = malloc(4096);
+   line_buf = (char *)malloc(4096);
if(line_buf == NULL) {
fclose(fs);
return -ENOMEM;
@@ -176,7 +176,7 @@
exit(1);
} else {
got_user = 1;
-   user_name = calloc(1 + length,1);
+   user_name = (char *)calloc(1 + 
length,1);
/* BB adding free of user_name string 
before exit,
not really necessary but would 
be cleaner */
strncpy(user_name,temp_val, length);
@@ -200,7 +200,7 @@
exit(1);
} else {
if(mountpassword == NULL) {
-   mountpassword = calloc(65,1);
+   mountpassword = (char 
*)calloc(65,1);
} else
memset(mountpassword,0,64);
if(mountpassword) {
@@ -228,7 +228,7 @@
 exit(1);
 } else {
 if(domain_name == NULL) {
-domain_name = calloc(65,1);
+domain_name = (char 
*)calloc(65,1);
 } else
 memset(domain_name,0,64);
 if(domain_name) {
@@ -255,7 +255,7 @@
char c;
 
if(mountpassword == NULL)
-   mountpassword = calloc(65,1);
+   mountpassword = (char *)calloc(65,1);
else 
memset(mountpassword, 0, 64);
 
@@ -374,7 +374,7 @@
if(percent_char) {
*percent_char = ',';
if(mountpassword == NULL)
-   mountpassword = 
calloc(65,1);
+   mountpassword = (char 
*)calloc(65,1);
if(mountpassword) {
if(got_password)

printf(\nmount.cifs warning - password specified twice\n);
@@ -596,7 +596,7 @@
if (value)
word_len += 1 + strlen(value);
 
-   out = realloc(out, out_len + word_len + 2);
+   out = (char *)realloc(out, out_len + word_len + 2);
if (out == NULL) {
perror(malloc);
exit(1);
@@ -646,7 +646,7 @@
return;
}
 
-   new_pass_buf = malloc(len+number_of_commas+1);
+   new_pass_buf = (char *)malloc(len+number_of_commas+1);
if(new_pass_buf == NULL)
return;
 
@@ -710,7 +710,7 @@
len = strlen(domainnm);
/* reset domainm to new buffer, and copy
domain name into it */
-   domainnm = malloc(len+1);
+   domainnm = (char *)malloc(len+1);
if(domainnm == NULL)
return NULL;
 
@@ -769,7 +769,7 @@
share = strchr(unc_name,':');
if(share) {
free_share_name = 1;
-   *punc_name = malloc(length+3);
+   *punc_name = (char 

svn commit: samba r17606 - in branches/SAMBA_3_0/source: libads libsmb

2006-08-18 Thread vlendec
Author: vlendec
Date: 2006-08-18 15:10:46 + (Fri, 18 Aug 2006)
New Revision: 17606

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

Log:
Introduce krb5_to_ntstatus.

Thanks to Michael Adam [EMAIL PROTECTED]

Volker
Modified:
   branches/SAMBA_3_0/source/libads/ads_status.c
   branches/SAMBA_3_0/source/libsmb/errormap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ads_status.c
===
--- branches/SAMBA_3_0/source/libads/ads_status.c   2006-08-18 14:05:25 UTC 
(rev 17605)
+++ branches/SAMBA_3_0/source/libads/ads_status.c   2006-08-18 15:10:46 UTC 
(rev 17606)
@@ -69,30 +69,29 @@
 */
 NTSTATUS ads_ntstatus(ADS_STATUS status)
 {
-   if (status.error_type == ENUM_ADS_ERROR_NT){
+   switch (status.error_type) {
+   case ENUM_ADS_ERROR_NT:
return status.err.nt_status;
-   }
-   if (status.error_type == ENUM_ADS_ERROR_SYSTEM) {
+   case 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)) {
-   return NT_STATUS_NO_MEMORY;
-   }
+   case ENUM_ADS_ERROR_LDAP:
+   if (status.err.rc == LDAP_NO_MEMORY) {
+   return NT_STATUS_NO_MEMORY;
+   }
+   break;
 #endif
 #ifdef HAVE_KRB5
-   if (status.error_type == ENUM_ADS_ERROR_KRB5) { 
-   if (status.err.rc == KRB5KDC_ERR_PREAUTH_FAILED) {
-   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;
-   }
-   }
+   case ENUM_ADS_ERROR_KRB5:
+   return krb5_to_ntstatus(status.err.rc);
 #endif
-   if (ADS_ERR_OK(status)) return NT_STATUS_OK;
+   default:
+   break;
+   }
+
+   if (ADS_ERR_OK(status)) {
+   return NT_STATUS_OK;
+   }
return NT_STATUS_UNSUCCESSFUL;
 }
 

Modified: branches/SAMBA_3_0/source/libsmb/errormap.c
===
--- branches/SAMBA_3_0/source/libsmb/errormap.c 2006-08-18 14:05:25 UTC (rev 
17605)
+++ branches/SAMBA_3_0/source/libsmb/errormap.c 2006-08-18 15:10:46 UTC (rev 
17606)
@@ -1566,3 +1566,40 @@
/* Default return */
return NT_STATUS_ACCESS_DENIED;
 }
+
+#ifdef HAVE_KRB5
+/*
+ Map a krb5 error code to an NT error code
+*/
+
+struct krb5_error_map {
+   int krb5_error;
+   NTSTATUS nt_error;
+};
+
+const struct krb5_error_map krb5_nt_errmap[] = {
+   { KRB5KDC_ERR_PREAUTH_FAILED, NT_STATUS_LOGON_FAILURE },
+   { KRB5_KDC_UNREACH, NT_STATUS_NO_LOGON_SERVERS },
+   { KRB5KRB_AP_ERR_SKEW, NT_STATUS_TIME_DIFFERENCE_AT_DC },
+   /* not sure if this mapping is appropriate */
+   { KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN, NT_STATUS_NO_TRUST_SAM_ACCOUNT },
+   { KRB5KDC_ERR_NONE, NT_STATUS_OK },
+   /* end of array flag - not used as error code... */
+   { 0, NT_STATUS_OK }
+};
+
+NTSTATUS krb5_to_ntstatus(int error) 
+{
+   int i = 0;
+
+   while (krb5_nt_errmap[i].krb5_error != 0) {
+   if (krb5_nt_errmap[i].krb5_error == error) {
+   return krb5_nt_errmap[i].nt_error;
+   }
+   i++;
+   }
+
+   return NT_STATUS_ACCESS_DENIED;
+}
+#endif
+



svn commit: samba r17607 - in branches/SAMBA_3_0/source: . include tdb tdb/common tdb/docs tdb/include tdb/swig tdb/tools

2006-08-18 Thread vlendec
Author: vlendec
Date: 2006-08-18 16:25:09 + (Fri, 18 Aug 2006)
New Revision: 17607

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

Log:
Adapt the Samba4 directory structure for tdb. Makes it easier to diff.

Let's see what it breaks. For me it works :-)

Volker
Added:
   branches/SAMBA_3_0/source/tdb/Makefile.in
   branches/SAMBA_3_0/source/tdb/aclocal.m4
   branches/SAMBA_3_0/source/tdb/autogen.sh
   branches/SAMBA_3_0/source/tdb/bin/
   branches/SAMBA_3_0/source/tdb/common/
   branches/SAMBA_3_0/source/tdb/common/dump.c
   branches/SAMBA_3_0/source/tdb/common/error.c
   branches/SAMBA_3_0/source/tdb/common/freelist.c
   branches/SAMBA_3_0/source/tdb/common/io.c
   branches/SAMBA_3_0/source/tdb/common/lock.c
   branches/SAMBA_3_0/source/tdb/common/open.c
   branches/SAMBA_3_0/source/tdb/common/tdb.c
   branches/SAMBA_3_0/source/tdb/common/tdb_private.h
   branches/SAMBA_3_0/source/tdb/common/tdbback.c
   branches/SAMBA_3_0/source/tdb/common/tdbutil.c
   branches/SAMBA_3_0/source/tdb/common/transaction.c
   branches/SAMBA_3_0/source/tdb/common/traverse.c
   branches/SAMBA_3_0/source/tdb/config.m4
   branches/SAMBA_3_0/source/tdb/config.mk
   branches/SAMBA_3_0/source/tdb/configure.in
   branches/SAMBA_3_0/source/tdb/docs/
   branches/SAMBA_3_0/source/tdb/docs/README
   branches/SAMBA_3_0/source/tdb/docs/tdb.magic
   branches/SAMBA_3_0/source/tdb/include/
   branches/SAMBA_3_0/source/tdb/include/tdb.h
   branches/SAMBA_3_0/source/tdb/include/tdbback.h
   branches/SAMBA_3_0/source/tdb/include/tdbconfig.h.in
   branches/SAMBA_3_0/source/tdb/include/tdbutil.h
   branches/SAMBA_3_0/source/tdb/swig/
   branches/SAMBA_3_0/source/tdb/swig/Tdb.py
   branches/SAMBA_3_0/source/tdb/swig/tdb.i
   branches/SAMBA_3_0/source/tdb/tdb.pc.in
   branches/SAMBA_3_0/source/tdb/tools/
   branches/SAMBA_3_0/source/tdb/tools/tdbbackup.c
   branches/SAMBA_3_0/source/tdb/tools/tdbdump.c
   branches/SAMBA_3_0/source/tdb/tools/tdbtest.c
   branches/SAMBA_3_0/source/tdb/tools/tdbtool.c
   branches/SAMBA_3_0/source/tdb/tools/tdbtorture.c
Removed:
   branches/SAMBA_3_0/source/tdb/Makefile
   branches/SAMBA_3_0/source/tdb/README
   branches/SAMBA_3_0/source/tdb/dump.c
   branches/SAMBA_3_0/source/tdb/error.c
   branches/SAMBA_3_0/source/tdb/freelist.c
   branches/SAMBA_3_0/source/tdb/io.c
   branches/SAMBA_3_0/source/tdb/lock.c
   branches/SAMBA_3_0/source/tdb/open.c
   branches/SAMBA_3_0/source/tdb/tdb.c
   branches/SAMBA_3_0/source/tdb/tdb.h
   branches/SAMBA_3_0/source/tdb/tdb.magic
   branches/SAMBA_3_0/source/tdb/tdb_private.h
   branches/SAMBA_3_0/source/tdb/tdbback.c
   branches/SAMBA_3_0/source/tdb/tdbback.h
   branches/SAMBA_3_0/source/tdb/tdbbackup.c
   branches/SAMBA_3_0/source/tdb/tdbdump.c
   branches/SAMBA_3_0/source/tdb/tdbtest.c
   branches/SAMBA_3_0/source/tdb/tdbtool.c
   branches/SAMBA_3_0/source/tdb/tdbtorture.c
   branches/SAMBA_3_0/source/tdb/tdbutil.c
   branches/SAMBA_3_0/source/tdb/tdbutil.h
   branches/SAMBA_3_0/source/tdb/transaction.c
   branches/SAMBA_3_0/source/tdb/traverse.c
Modified:
   branches/SAMBA_3_0/source/Makefile.in
   branches/SAMBA_3_0/source/include/includes.h


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


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

2006-08-18 Thread sree
Author: sree
Date: 2006-08-18 22:10:08 + (Fri, 18 Aug 2006)
New Revision: 17608

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

Log:
Add usermgmt.esp, the server for calls to usermgmt.js

Add New user to the menu in userbrowser.js

Make userbrowser load users from Samba (yay!)

Clean up code in newuser.js


Added:
   branches/SOC/sree/ui/usermgmt.esp
Modified:
   branches/SOC/sree/ui/README
   branches/SOC/sree/ui/newuser.js
   branches/SOC/sree/ui/test.html
   branches/SOC/sree/ui/userbrowser.js


Changeset:
Modified: branches/SOC/sree/ui/README
===
--- branches/SOC/sree/ui/README 2006-08-18 16:25:09 UTC (rev 17607)
+++ branches/SOC/sree/ui/README 2006-08-18 22:10:08 UTC (rev 17608)
@@ -1,9 +1,9 @@
-This is the UI code for the User Management Interface for SWAT. It is
-however not yet linked to SWAT, and will run independently of samba.
+This is the UI code for the User Management Interface for SWAT. It 
+however not yet linked completely yet to SWAT.
 
-The contents of this directory will finally end up in
-/usr/local/samba/share/swat/user_manager/ and will be accessible
-through SWAT.
+The contents of this directory must be installed in
+/usr/local/samba/share/swat/user_manager/ and must be accessed through
+SWAT.
 
 Qooxdoo 0.5.3 is used instead of the Qooxdoo supplied with Samba.
 

Modified: branches/SOC/sree/ui/newuser.js
===
--- branches/SOC/sree/ui/newuser.js 2006-08-18 16:25:09 UTC (rev 17607)
+++ branches/SOC/sree/ui/newuser.js 2006-08-18 22:10:08 UTC (rev 17608)
@@ -3,7 +3,26 @@
Client-side routines for the New User Dialog.
 */
 
+function __create_user()
+{
+//TODO: call server to create user
+return false;
+}
 
+function __validate_form(txtBoxes, txtPassword1, txtPassword2)
+{  
+for(var i = 0; i  txtBoxes.length; i++)
+   {
+   var x = txtBoxes[i].getValue();
+   if(!x) return false;
+   }
+
+if(txtPassword1.getValue() != txtPassword2.getValue()) 
+   return false;
+
+return true;
+}
+
 // creates the dialog
 function NewUserDialog()
 {
@@ -101,6 +120,14 @@
 chkNoChangePassword.setEnabled(false);
 chkNoPasswordExpire.setEnabled(false);
 
+var bl2 = new QxBoxLayout;
+with (bl2) 
+   {
+   setHeight(auto);
+   setHorizontalChildrenAlign(right);
+   setSpacing(10);
+   }
+
 var btnCancel = new QxButton(Cancel);
 var btnCreate = new QxButton(Create);
 with (btnCreate)
@@ -108,7 +135,39 @@
setSpacing(15);
setEnabled(false);
}
+
+bl2.add(btnCreate);
+bl2.add(btnCancel);
+
+var txtBoxes = [txtUsername, txtUnixname, txtFullname, txtDescription, 
txtPassword, txtConfirmPassword];
+
+btnCancel.addEventListener(click, function() { w1.close(); });
+btnCreate.addEventListener(click, function() {
+   if(__validate_form(txtBoxes, txtPassword, txtConfirmPassword))
+   {
+   if(__create_user(txtUsername, txtUnixname, txtFullname, 
txtDescription, txtPassword))
+   {
+   //TODO: do UI client callback
+   
+   // and then close
+   w1.close();
+   }
+   else
+   window.alert(Unable to create user!); 
+   }
+});
+
+function __toggle_create(e) {
+   btnCreate.setEnabled(__validate_form(txtBoxes, txtPassword, 
txtConfirmPassword));
+}
 
+// this doesn't work well, as no changeText function exists
+for(var i = 0; i  txtBoxes.length; i++)
+   {
+   txtBoxes[i].addEventListener(input, __toggle_create); 
+   //  txtBoxes[i].addEventListener(blur, __toggle_create);  
+   }
+
 bl.setOrientation(QxConst.ORIENTATION_VERTICAL);
 bl.add(g1);
 bl.add(new QxVerticalSpacer);
@@ -119,49 +178,8 @@
 bl.add(chkNoPasswordExpire);
 bl.add(chkAccountDisabled);
 bl.add(new QxVerticalSpacer);
+bl.add(bl2);
 
-var bl2 = new QxBoxLayout;
-with (bl2) 
-   {
-   setHeight(auto);
-   setHorizontalChildrenAlign(right);
-   setSpacing(10);
-   }
-
-var txtBoxes = [txtUsername, txtUnixname, txtFullname, txtDescription, 
txtPassword, txtConfirmPassword];
-
-function validateFormContents()
-   {
-   for(var i = 0; i  txtBoxes.length; i++)
-   {
-   var x = txtBoxes[i].getValue();
-   if(!x) return false;
-   }
-
-   if(txtPassword.getValue() != txtConfirmPassword.getValue()) return 
false;
-
-   return true;
-   }
-
-function toggleCreateButton(e)
-   {
-   btnCreate.setEnabled(validateFormContents());   
-   }
-
-// this doesn't work well, as no changeText 

svn commit: samba r17609 - in branches/SAMBA_4_0/source/cldap_server: .

2006-08-18 Thread abartlet
Author: abartlet
Date: 2006-08-18 22:20:13 + (Fri, 18 Aug 2006)
New Revision: 17609

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

Log:
Kill one more use of the fake dnsDomain attribute.

Add a talloc_steal to avoid a memory leak of the ldb_search result.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/cldap_server/netlogon.c


Changeset:
Modified: branches/SAMBA_4_0/source/cldap_server/netlogon.c
===
--- branches/SAMBA_4_0/source/cldap_server/netlogon.c   2006-08-18 22:10:08 UTC 
(rev 17608)
+++ branches/SAMBA_4_0/source/cldap_server/netlogon.c   2006-08-18 22:20:13 UTC 
(rev 17609)
@@ -47,8 +47,8 @@
 uint32_t version,
 union nbt_cldap_netlogon *netlogon)
 {
-   const char *ref_attrs[] = {nETBIOSName, ncName, NULL};
-   const char *dom_attrs[] = {dnsDomain, objectGUID, NULL};
+   const char *ref_attrs[] = {nETBIOSName, dnsRoot, ncName, NULL};
+   const char *dom_attrs[] = {objectGUID, NULL};
struct ldb_message **ref_res, **dom_res;
int ret, count = 0;
const char **services = lp_server_services();
@@ -96,6 +96,7 @@
DEBUG(2,(Error finding domain '%s'/'%s' in 
sam: %s\n, domain, ldb_dn_linearize(mem_ctx, dom_dn), 
ldb_errstring(cldapd-samctx)));
return NT_STATUS_NO_SUCH_DOMAIN;
}
+   talloc_steal(mem_ctx, dom_ldb_result);
if (dom_ldb_result-count != 1) {
DEBUG(2,(Error finding domain '%s'/'%s' in 
sam\n, domain, ldb_dn_linearize(mem_ctx, dom_dn)));
return NT_STATUS_NO_SUCH_DOMAIN;
@@ -143,8 +144,8 @@
 
pdc_name = talloc_asprintf(mem_ctx, %s, 
lp_netbios_name());
domain_uuid  = samdb_result_guid(dom_res[0], objectGUID);
-   realm= samdb_result_string(dom_res[0], dnsDomain, 
lp_realm());
-   dns_domain   = samdb_result_string(dom_res[0], dnsDomain, 
lp_realm());
+   realm= samdb_result_string(ref_res[0], dnsRoot, 
lp_realm());
+   dns_domain   = samdb_result_string(ref_res[0], dnsRoot, 
lp_realm());
pdc_dns_name = talloc_asprintf(mem_ctx, %s.%s, 
   strlower_talloc(mem_ctx, 
lp_netbios_name()), 
   dns_domain);



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

2006-08-18 Thread sfrench
Author: sfrench
Date: 2006-08-18 23:36:23 + (Fri, 18 Aug 2006)
New Revision: 74

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

Log:
2.4 build fixes for cifs

Modified:
   branches/linux-converged-for-old-kernels/fs/cifs/Makefile-24
   branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h
   branches/linux-converged-for-old-kernels/fs/cifs/netmisc.c
   branches/linux-converged-for-old-kernels/fs/cifs/xattr.c


Changeset:
Modified: branches/linux-converged-for-old-kernels/fs/cifs/Makefile-24
===
--- branches/linux-converged-for-old-kernels/fs/cifs/Makefile-24
2006-08-17 21:47:38 UTC (rev 73)
+++ branches/linux-converged-for-old-kernels/fs/cifs/Makefile-24
2006-08-18 23:36:23 UTC (rev 74)
@@ -3,7 +3,7 @@
 #
 O_TARGET := cifs.o
 
-obj-y := nterr.o md4.o md5.o netmisc.o smbdes.o smbencrypt.o asn1.o 
cifs_unicode.o cifsencrypt.o cifs_debug.o cifssmb.o connect.o misc.o dir.o 
inode.o link.o transport.o cifsfs.o file.o
+obj-y := nterr.o md4.o md5.o netmisc.o smbdes.o smbencrypt.o asn1.o 
cifs_unicode.o cifsencrypt.o cifs_debug.o sess.o cifssmb.o connect.o misc.o 
dir.o inode.o link.o transport.o cifsfs.o file.o
 
 obj-m := $(O_TARGET)
 

Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h
===
--- branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h   2006-08-17 
21:47:38 UTC (rev 73)
+++ branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h   2006-08-18 
23:36:23 UTC (rev 74)
@@ -31,6 +31,11 @@
 #ifndef TRUE
 #define TRUE 1
 #endif
+
+#ifndef __user
+#define __user
+#endif
+
 #include linux/version.h
 #if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,11)
 #define current_fs_time(arg) CURRENT_TIME
@@ -49,20 +54,22 @@
 #if LINUX_VERSION_CODE  KERNEL_VERSION(2, 5, 0)
 extern int cifs_create(struct inode *, struct dentry *, int, 
   struct nameidata *);
+extern struct dentry * cifs_lookup(struct inode *, struct dentry *,
+  struct nameidata *);
+extern int cifs_mknod(struct inode *, struct dentry *, int, dev_t);
+extern int cifs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
 #else
 extern int cifs_create(struct inode *, struct dentry *, int);
+extern struct dentry * cifs_lookup(struct inode *, struct dentry *);
+extern int cifs_mknod(struct inode *, struct dentry *, int, int);
 #endif
-extern struct dentry * cifs_lookup(struct inode *, struct dentry *,
- struct nameidata *);
 extern int cifs_unlink(struct inode *, struct dentry *);
 extern int cifs_hardlink(struct dentry *, struct inode *, struct dentry *);
-extern int cifs_mknod(struct inode *, struct dentry *, int, dev_t);
 extern int cifs_mkdir(struct inode *, struct dentry *, int);
 extern int cifs_rmdir(struct inode *, struct dentry *);
 extern int cifs_rename(struct inode *, struct dentry *, struct inode *,
   struct dentry *);
 extern int cifs_revalidate(struct dentry *);
-extern int cifs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
 extern int cifs_setattr(struct dentry *, struct iattr *);
 
 extern struct inode_operations cifs_file_inode_ops;

Modified: branches/linux-converged-for-old-kernels/fs/cifs/netmisc.c
===
--- branches/linux-converged-for-old-kernels/fs/cifs/netmisc.c  2006-08-17 
21:47:38 UTC (rev 73)
+++ branches/linux-converged-for-old-kernels/fs/cifs/netmisc.c  2006-08-18 
23:36:23 UTC (rev 74)
@@ -911,4 +911,28 @@
/* Convert to 100ns intervals and then add the NTFS time offset. */
return (u64) t.tv_sec * 1000 + t.tv_nsec/100 + NTFS_TIME_OFFSET;
 }
+#else
+time_t
+cifs_NTtimeToUnix(__u64 ntutc)
+{
+   /* BB what about the timezone? BB */
+
+   /* Subtract the NTFS time offset, then convert to 1s intervals.  */
+   u64 t;
+
+   t = ntutc - NTFS_TIME_OFFSET;
+   do_div(t, 1000);
+   return (time_t)t;
+}
+
+/* Convert the Unix UTC into NT UTC. */
+__u64
+cifs_UnixTimeToNT(time_t t)
+{
+   __u64 dce_time;
+   /* Convert to 100ns intervals and then add the NTFS time offset. */
+   dce_time = (__u64) t * 1000;
+   dce_time += NTFS_TIME_OFFSET;
+   return dce_time;
+}
 #endif

Modified: branches/linux-converged-for-old-kernels/fs/cifs/xattr.c
===
--- branches/linux-converged-for-old-kernels/fs/cifs/xattr.c2006-08-17 
21:47:38 UTC (rev 73)
+++ branches/linux-converged-for-old-kernels/fs/cifs/xattr.c2006-08-18 
23:36:23 UTC (rev 74)
@@ -20,7 +20,10 @@
  */
 
 #include linux/fs.h
+#include linux/version.h
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 5, 0)
 #include linux/posix_acl_xattr.h
+#endif
 #include cifsfs.h
 #include cifspdu.h
 #include cifsglob.h



Build status as of Sat Aug 19 00:00:01 2006

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

--- /home/build/master/cache/broken_results.txt.old 2006-08-18 
00:00:10.0 +
+++ /home/build/master/cache/broken_results.txt 2006-08-19 00:00:12.0 
+
@@ -1,18 +1,18 @@
-Build status as of Fri Aug 18 00:00:01 2006
+Build status as of Sat Aug 19 00:00:01 2006
 
 Build counts:
 Tree Total  Broken Panic 
 SOC  0  0  0 
-ccache   23 6  0 
-distcc   24 2  0 
-lorikeet-heimdal 0  0  0 
-ppp  13 0  0 
-rsync25 2  0 
+ccache   25 4  0 
+distcc   26 2  0 
+lorikeet-heimdal 1  0  0 
+ppp  15 0  0 
+rsync26 0  0 
 samba0  0  0 
 samba-docs   0  0  0 
-samba4   36 17 2 
-samba_3_033 7  0 
-smb-build20 20 0 
-talloc   26 9  0 
-tdb  24 8  0 
+samba4   37 19 3 
+samba_3_034 7  0 
+smb-build21 21 0 
+talloc   28 9  0 
+tdb  20 8  0 
 


svn commit: samba r17610 - in branches/SAMBA_3_0/source: . lib nsswitch utils

2006-08-18 Thread jra
Author: jra
Date: 2006-08-19 01:04:54 + (Sat, 19 Aug 2006)
New Revision: 17610

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

Log:
Added the ability for firefox to drive the winbindd
ntlm_auth module to allow it to use winbindd cached
credentials.The credentials are currently only stored
in a krb5 MIT environment - we need to add an option to
winbindd to allow passwords to be stored even in an NTLM-only
environment.
Patch from Robert O'Callahan, modified with some fixes
by me.
Jeremy.

Added:
   branches/SAMBA_3_0/source/nsswitch/winbindd_ccache_access.c
Modified:
   branches/SAMBA_3_0/source/Makefile.in
   branches/SAMBA_3_0/source/configure.in
   branches/SAMBA_3_0/source/lib/system.c
   branches/SAMBA_3_0/source/nsswitch/winbindd.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_dual.c
   branches/SAMBA_3_0/source/nsswitch/winbindd_nss.h
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
   branches/SAMBA_3_0/source/utils/ntlm_auth.c


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