svn commit: samba r17047 - in branches/SAMBA_3_0/source/registry: .
Author: vlendec Date: 2006-07-15 08:36:44 + (Sat, 15 Jul 2006) New Revision: 17047 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17047 Log: Fix a typo and a possible NULL dereference Modified: branches/SAMBA_3_0/source/registry/reg_db.c Changeset: Modified: branches/SAMBA_3_0/source/registry/reg_db.c === --- branches/SAMBA_3_0/source/registry/reg_db.c 2006-07-15 00:34:08 UTC (rev 17046) +++ branches/SAMBA_3_0/source/registry/reg_db.c 2006-07-15 08:36:44 UTC (rev 17047) @@ -229,7 +229,7 @@ /* always setup the necessary keys and values */ if ( !init_registry_data() ) { - DEBUG(0,(init_registry: Failed to initiailize data in registry!\n)); + DEBUG(0,(init_registry: Failed to initialize data in registry!\n)); return False; } @@ -313,7 +313,9 @@ /* allocate some initial memory */ - buffer = SMB_MALLOC(sizeof(pstring)); + if (!(buffer = SMB_MALLOC(sizeof(pstring { + return False; + } buflen = sizeof(pstring); len = 0;
svn commit: samba r17048 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 08:46:27 + (Sat, 15 Jul 2006) New Revision: 17048 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17048 Log: Remove unused async step from map_step. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 08:36:44 UTC (rev 17047) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 08:46:27 UTC (rev 17048) @@ -105,7 +105,6 @@ struct map_async_context { enum map_step { MAP_SEARCH_LOCAL, - MAP_SEARCH_REMOTE, MAP_DO_ADD_REMOTE, MAP_DO_ADD_LOCAL, MAP_SEARCH_SELF_MODIFY,
svn commit: samba r17049 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 08:56:19 + (Sat, 15 Jul 2006) New Revision: 17049 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17049 Log: Insert missing braces. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 08:46:27 UTC (rev 17048) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 08:56:19 UTC (rev 17049) @@ -1547,12 +1547,13 @@ break; case MAP_CONVERT: - if (map-u.convert.convert_local == NULL) + if (map-u.convert.convert_local == NULL) { ldb_debug(module-ldb, LDB_DEBUG_ERROR, ldb_map: Skipping attribute '%s': 'convert_local' not set\n, map-local_name); - goto failed; + goto failed; + } el = copy_conv_msg_el(module, remote, old, map-u.convert.remote_name,
svn commit: samba r17050 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:01:20 + (Sat, 15 Jul 2006) New Revision: 17050 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17050 Log: Copy (don't steal) the old msg element when adding to the local message. The old elements are accessed from an array and usually haven't been tallocced themselves. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 08:56:19 UTC (rev 17049) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:01:20 UTC (rev 17050) @@ -1586,9 +1586,17 @@ return ldb_msg_add(remote, el, old-flags); local: - /* TODO: do we need a copy or can we just steal it? */ - return ldb_msg_add(local, talloc_steal(local, old), old-flags); + /* copy the message element */ + el = talloc(local, struct ldb_message_element); + if (el == NULL) { + ldb_oom(module-ldb); + goto failed; + } + *el = *old; /* copy the old element */ + + return ldb_msg_add(local, el, old-flags); + failed: return -1; }
svn commit: samba r17051 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:04:28 + (Sat, 15 Jul 2006) New Revision: 17051 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17051 Log: Reset the async handle status before running additional down requests. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:01:20 UTC (rev 17050) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:04:28 UTC (rev 17051) @@ -2100,6 +2100,9 @@ ac-step = MAP_DO_ADD_LOCAL; + handle-state = LDB_ASYNC_INIT; + handle-status = LDB_SUCCESS; + return ldb_next_request(ac-module, ac-local_req); } @@ -2218,6 +2221,9 @@ ac-step = MAP_DO_MODIFY_LOCAL; + handle-state = LDB_ASYNC_INIT; + handle-status = LDB_SUCCESS; + return ldb_next_request(ac-module, ac-local_req); } @@ -2257,6 +2263,9 @@ ac-step = MAP_DO_MODIFY_REMOTE; + handle-state = LDB_ASYNC_INIT; + handle-status = LDB_SUCCESS; + return ldb_next_remote_request(ac-module, ac-remote_req); } @@ -2382,6 +2391,9 @@ ac-step = MAP_DO_DELETE_LOCAL; + handle-state = LDB_ASYNC_INIT; + handle-status = LDB_SUCCESS; + return ldb_next_request(ac-module, ac-local_req); } @@ -2417,6 +2429,9 @@ ac-step = MAP_DO_DELETE_REMOTE; + handle-state = LDB_ASYNC_INIT; + handle-status = LDB_SUCCESS; + return ldb_next_remote_request(ac-module, ac-remote_req); } @@ -2483,6 +2498,9 @@ ac-step = MAP_DO_RENAME_LOCAL; + handle-state = LDB_ASYNC_INIT; + handle-status = LDB_SUCCESS; + return ldb_next_request(ac-module, ac-local_req); } @@ -2531,6 +2549,9 @@ ac-step = MAP_DO_RENAME_FIXUP; + handle-state = LDB_ASYNC_INIT; + handle-status = LDB_SUCCESS; + return ldb_next_request(ac-module, ac-down_req); failed: @@ -2573,6 +2594,9 @@ ac-step = MAP_DO_RENAME_REMOTE; + handle-state = LDB_ASYNC_INIT; + handle-status = LDB_SUCCESS; + return ldb_next_remote_request(ac-module, ac-remote_req); }
svn commit: samba r17052 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:07:24 + (Sat, 15 Jul 2006) New Revision: 17052 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17052 Log: Don't declare variables in the middle of a function. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:04:28 UTC (rev 17051) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:07:24 UTC (rev 17052) @@ -2116,6 +2116,7 @@ struct ldb_async_handle *h; struct map_async_context *ac; struct ldb_message *local, *remote; + const char *dn; /* do not manipulate our control entries */ if (ldb_dn_is_special(msg-dn)) @@ -2188,7 +2189,7 @@ return map_add_do_local(h); /* store the remote DN in 'IS_MAPPED' */ - const char *dn = ldb_dn_linearize(local, remote-dn); + dn = ldb_dn_linearize(local, remote-dn); if (ldb_msg_add_string(local, IS_MAPPED, dn) != 0) goto failed;
svn commit: samba r17053 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:11:02 + (Sat, 15 Jul 2006) New Revision: 17053 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17053 Log: Handle missing async step. Don't include a default case when switching ac-step, that suppresses the wrong warnings. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:07:24 UTC (rev 17052) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:11:02 UTC (rev 17053) @@ -2662,15 +2662,15 @@ case MAP_DO_RENAME_FIXUP: return ac-down_req; + case MAP_SEARCH_LOCAL: case MAP_DO_ADD_LOCAL: case MAP_DO_MODIFY_LOCAL: case MAP_DO_DELETE_LOCAL: case MAP_DO_RENAME_LOCAL: return ac-local_req; + } -default: -return NULL; - } + return NULL;/* unreachable; silences a warning */ } typedef int (*map_next_function)(struct ldb_async_handle *handle); @@ -2681,6 +2681,9 @@ map_async_get_next(struct map_async_context *ac) { switch (ac-step) { + case MAP_SEARCH_LOCAL: + return NULL; + case MAP_DO_ADD_REMOTE: return map_add_do_local; @@ -2716,10 +2719,9 @@ case MAP_DO_RENAME_LOCAL: return NULL; - - default: - return NULL; } + + return NULL;/* unreachable; silences a warning */ } /* Async trampoline */
svn commit: samba r17054 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:13:29 + (Sat, 15 Jul 2006) New Revision: 17054 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17054 Log: When renaming, skip requests if neither DN is in the local partition. Fail if either is but the other isn't. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:11:02 UTC (rev 17053) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:13:29 UTC (rev 17054) @@ -2615,11 +2615,15 @@ return ldb_next_request(module, req); /* no mapping requested, skip to next module */ - /* TODO: both? either? neither? what to do in each case? */ - if (!check_dn_local(module, req-op.rename.olddn) || + if (!check_dn_local(module, req-op.rename.olddn) !check_dn_local(module, req-op.rename.newdn)) return ldb_next_request(module, req); + /* rename into/out of the mapped partition requested, bail out */ + if (!check_dn_local(module, req-op.rename.olddn) || + !check_dn_local(module, req-op.rename.newdn)) + return LDB_ERR_AFFECTS_MULTIPLE_DSAS; + /* prepare async context and handle */ h = map_init_handle(req, module); if (h == NULL)
svn commit: samba r17055 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:16:41 + (Sat, 15 Jul 2006) New Revision: 17055 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17055 Log: Don't talloc_zero structures whose contents will be completely overwritten anyway. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:13:29 UTC (rev 17054) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:16:41 UTC (rev 17055) @@ -2140,7 +2140,7 @@ req-async.handle = h; /* prepare the local operation */ - ac-local_req = talloc_zero(ac, struct ldb_request); + ac-local_req = talloc(ac, struct ldb_request); if (ac-local_req == NULL) { map_oom(module); return LDB_ERR_OPERATIONS_ERROR; @@ -2152,7 +2152,7 @@ ac-local_req-async.callback = NULL; /* prepare the remote operation */ - ac-remote_req = talloc_zero(ac, struct ldb_request); + ac-remote_req = talloc(ac, struct ldb_request); if (ac-remote_req == NULL) { talloc_free(ac-local_req); map_oom(module); @@ -2303,7 +2303,7 @@ req-async.handle = h; /* prepare the local operation */ - ac-local_req = talloc_zero(ac, struct ldb_request); + ac-local_req = talloc(ac, struct ldb_request); if (ac-local_req == NULL) { map_oom(module); return LDB_ERR_OPERATIONS_ERROR; @@ -2315,7 +2315,7 @@ ac-local_req-async.callback = NULL; /* prepare the remote operation */ - ac-remote_req = talloc_zero(ac, struct ldb_request); + ac-remote_req = talloc(ac, struct ldb_request); if (ac-remote_req == NULL) { talloc_free(ac-local_req); map_oom(module); @@ -2377,7 +2377,7 @@ ac = talloc_get_type(handle-private_data, struct map_async_context); /* prepare the local operation */ - ac-local_req = talloc_zero(ac, struct ldb_request); + ac-local_req = talloc(ac, struct ldb_request); if (ac-local_req == NULL) { ldb_oom(ac-module-ldb); return LDB_ERR_OPERATIONS_ERROR; @@ -2412,7 +2412,7 @@ return map_delete_do_local(handle); /* prepare the remote operation */ - ac-remote_req = talloc_zero(ac, struct ldb_request); + ac-remote_req = talloc(ac, struct ldb_request); if (ac-remote_req == NULL) { ldb_oom(ac-module-ldb); return LDB_ERR_OPERATIONS_ERROR; @@ -2484,7 +2484,7 @@ ac = talloc_get_type(handle-private_data, struct map_async_context); /* prepare the local operation */ - ac-local_req = talloc_zero(ac, struct ldb_request); + ac-local_req = talloc(ac, struct ldb_request); if (ac-local_req == NULL) { ldb_oom(ac-module-ldb); return LDB_ERR_OPERATIONS_ERROR; @@ -2574,7 +2574,7 @@ return map_rename_do_local(handle); /* prepare the remote operation */ - ac-remote_req = talloc_zero(ac, struct ldb_request); + ac-remote_req = talloc(ac, struct ldb_request); if (ac-remote_req == NULL) { ldb_oom(ac-module-ldb); return LDB_ERR_OPERATIONS_ERROR;
svn commit: samba r17056 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:22:24 + (Sat, 15 Jul 2006) New Revision: 17056 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17056 Log: Defer setting async handled until *after* the up request was copied. When an async handle is likely to still have been copied, reset to NULL. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:16:41 UTC (rev 17055) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:22:24 UTC (rev 17056) @@ -2136,9 +2136,6 @@ return LDB_ERR_OPERATIONS_ERROR; ac = talloc_get_type(h-private_data, struct map_async_context); - /* return or own handle to deal with this call */ - req-async.handle = h; - /* prepare the local operation */ ac-local_req = talloc(ac, struct ldb_request); if (ac-local_req == NULL) { @@ -2193,6 +2190,9 @@ if (ldb_msg_add_string(local, IS_MAPPED, dn) != 0) goto failed; + /* return or own handle to deal with this call */ + req-async.handle = h; + ldb_set_timeout_from_prev_req(module-ldb, req, ac-remote_req); /* continue with the remote request */ @@ -2299,9 +2299,6 @@ return LDB_ERR_OPERATIONS_ERROR; ac = talloc_get_type(h-private_data, struct map_async_context); - /* return or own handle to deal with this call */ - req-async.handle = h; - /* prepare the local operation */ ac-local_req = talloc(ac, struct ldb_request); if (ac-local_req == NULL) { @@ -2358,6 +2355,9 @@ ac-step = MAP_SEARCH_SELF_MODIFY; + /* return or own handle to deal with this call */ + req-async.handle = h; + return ldb_next_request(module, ac-search_req); failed: @@ -2385,8 +2385,10 @@ *(ac-local_req) = *(ac-orig_req); /* copy the request */ + ac-local_req-async.handle = NULL; ac-local_req-async.context = NULL; ac-local_req-async.callback = NULL; + ldb_set_timeout_from_prev_req(ac-module-ldb, ac-orig_req, ac-local_req); @@ -2420,8 +2422,10 @@ *(ac-remote_req) = *(ac-orig_req); /* copy the request */ + ac-remote_req-async.handle = NULL; ac-remote_req-async.context = NULL; ac-remote_req-async.callback = NULL; + ldb_set_timeout_from_prev_req(ac-module-ldb, ac-orig_req, ac-remote_req); @@ -2460,14 +2464,14 @@ return LDB_ERR_OPERATIONS_ERROR; ac = talloc_get_type(h-private_data, struct map_async_context); - /* return or own handle to deal with this call */ - req-async.handle = h; - /* prepare the search operation */ ac-search_req = search_self_req(ac, req-op.del.dn); if (ac-search_req == NULL) return LDB_ERR_OPERATIONS_ERROR; + /* return or own handle to deal with this call */ + req-async.handle = h; + ac-step = MAP_SEARCH_SELF_DELETE; return ldb_next_request(module, ac-search_req); @@ -2492,8 +2496,10 @@ *(ac-local_req) = *(ac-orig_req); /* copy the request */ + ac-local_req-async.handle = NULL; ac-local_req-async.context = NULL; ac-local_req-async.callback = NULL; + ldb_set_timeout_from_prev_req(ac-module-ldb, ac-orig_req, ac-local_req); @@ -2543,8 +2549,10 @@ ac-down_req-operation = LDB_MODIFY; ac-down_req-op.mod.message = msg; ac-down_req-controls = NULL; + ac-down_req-async.handle = NULL; ac-down_req-async.context = NULL; ac-down_req-async.callback = NULL; + ldb_set_timeout_from_prev_req(ac-module-ldb, ac-orig_req, ac-down_req); @@ -2582,8 +2590,10 @@ *(ac-remote_req) = *(ac-orig_req); /* copy the request */ + ac-remote_req-async.handle = NULL; ac-remote_req-async.context = NULL; ac-remote_req-async.callback = NULL; + ldb_set_timeout_from_prev_req(ac-module-ldb, ac-orig_req, ac-remote_req); @@ -2630,14 +2640,14 @@ return LDB_ERR_OPERATIONS_ERROR; ac = talloc_get_type(h-private_data, struct map_async_context); - /* return or own handle to deal with this call */ - req-async.handle = h; - /* prepare the search operation */ ac-search_req = search_self_req(ac, req-op.rename.olddn); if (ac-search_req == NULL) return LDB_ERR_OPERATIONS_ERROR; + /* return or own handle to deal with this call */ + req-async.handle = h; + ac-step = MAP_SEARCH_SELF_RENAME; return ldb_next_request(module, ac-search_req);
svn commit: samba r17057 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:27:07 + (Sat, 15 Jul 2006) New Revision: 17057 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17057 Log: When failing before the async handle was set in the up request, free the complete async handle. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:22:24 UTC (rev 17056) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:27:07 UTC (rev 17057) @@ -2140,7 +2140,7 @@ ac-local_req = talloc(ac, struct ldb_request); if (ac-local_req == NULL) { map_oom(module); - return LDB_ERR_OPERATIONS_ERROR; + goto failed; } *(ac-local_req) = *req; /* copy the request */ @@ -2151,9 +2151,8 @@ /* prepare the remote operation */ ac-remote_req = talloc(ac, struct ldb_request); if (ac-remote_req == NULL) { - talloc_free(ac-local_req); map_oom(module); - return LDB_ERR_OPERATIONS_ERROR; + goto failed; } *(ac-remote_req) = *req; /* copy the request */ @@ -2201,8 +2200,7 @@ return ldb_next_remote_request(module, ac-remote_req); failed: - talloc_free(ac-local_req); - talloc_free(ac-remote_req); + talloc_free(h); return LDB_ERR_OPERATIONS_ERROR; } @@ -2303,7 +2301,7 @@ ac-local_req = talloc(ac, struct ldb_request); if (ac-local_req == NULL) { map_oom(module); - return LDB_ERR_OPERATIONS_ERROR; + goto failed; } *(ac-local_req) = *req; /* copy the request */ @@ -2314,9 +2312,8 @@ /* prepare the remote operation */ ac-remote_req = talloc(ac, struct ldb_request); if (ac-remote_req == NULL) { - talloc_free(ac-local_req); map_oom(module); - return LDB_ERR_OPERATIONS_ERROR; + goto failed; } *(ac-remote_req) = *req; /* copy the request */ @@ -2361,8 +2358,7 @@ return ldb_next_request(module, ac-search_req); failed: - talloc_free(ac-local_req); - talloc_free(ac-remote_req); + talloc_free(h); return LDB_ERR_OPERATIONS_ERROR; }
svn commit: samba r17058 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:32:17 + (Sat, 15 Jul 2006) New Revision: 17058 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17058 Log: When fixing the 'isMapped' attribute after renaming the remote record, don't reuse the DN from the last down request but calculate it freshly. The old 'newdn' was modified to point into the remote partition, but the 'isMapped' attribute is expected to keep pointing into the local partition. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:27:07 UTC (rev 17057) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:32:17 UTC (rev 17058) @@ -2534,7 +2534,7 @@ /* update 'IS_MAPPED' with the new remote DN */ msg-dn = discard_const_p(struct ldb_dn, ac-orig_req-op.rename.olddn); - dn = ldb_dn_linearize(msg, ac-remote_req-op.rename.newdn); + dn = map_local_dn(ac-module, msg, ac-orig_req-op.rename.newdn); if (dn == NULL) goto failed; if (ldb_msg_add_empty(msg, IS_MAPPED, LDB_FLAG_MOD_REPLACE) != 0)
svn commit: samba r17059 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 09:35:21 + (Sat, 15 Jul 2006) New Revision: 17059 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17059 Log: If no remote addition/modification is neccessary, just free the async handle and run the original request. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:32:17 UTC (rev 17058) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 09:35:21 UTC (rev 17059) @@ -2181,8 +2181,10 @@ ac-local_req-op.add.message = local; ac-remote_req-op.add.message = remote; - if (remote-num_elements == 0) /* no remote data */ - return map_add_do_local(h); + if (remote-num_elements == 0) { /* no remote data */ + talloc_free(h); + return ldb_next_request(module, req); + } /* store the remote DN in 'IS_MAPPED' */ dn = ldb_dn_linearize(local, remote-dn); @@ -2342,8 +2344,10 @@ ac-local_req-op.mod.message = local; ac-remote_req-op.mod.message = remote; - if (remote-num_elements == 0) /* no remote data */ - return map_modify_do_local(h); + if (remote-num_elements == 0) { /* no remote data */ + talloc_free(h); + return ldb_next_request(module, req); + } /* prepare the search operation */ ac-search_req = search_self_req(ac, msg-dn);
svn commit: samba r17060 - in branches/SAMBA_3_0/source/libsmb: .
Author: vlendec Date: 2006-07-15 10:55:24 + (Sat, 15 Jul 2006) New Revision: 17060 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17060 Log: Some c++ warnings Modified: branches/SAMBA_3_0/source/libsmb/asn1.c Changeset: Modified: branches/SAMBA_3_0/source/libsmb/asn1.c === --- branches/SAMBA_3_0/source/libsmb/asn1.c 2006-07-15 09:35:21 UTC (rev 17059) +++ branches/SAMBA_3_0/source/libsmb/asn1.c 2006-07-15 10:55:24 UTC (rev 17060) @@ -31,7 +31,8 @@ { if (data-has_error) return False; if (data-length data-ofs+len) { - data-data = SMB_REALLOC(data-data, data-ofs+len); + data-data = SMB_REALLOC_ARRAY(data-data, unsigned char, + data-ofs+len); if (!data-data) { data-has_error = True; return False; @@ -213,7 +214,7 @@ BOOL asn1_load(ASN1_DATA *data, DATA_BLOB blob) { ZERO_STRUCTP(data); - data-data = memdup(blob.data, blob.length); + data-data = (unsigned char *)memdup(blob.data, blob.length); if (!data-data) { data-has_error = True; return False; @@ -405,7 +406,7 @@ data-has_error = True; return False; } - str = SMB_MALLOC(len+1); + str = SMB_MALLOC_ARRAY(char, len+1); if (!str) { data-has_error = True; return False;
svn commit: samba r17061 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2006-07-15 13:28:52 + (Sat, 15 Jul 2006) New Revision: 17061 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17061 Log: - remove the currect talloc chunk from it's parent before freeing the children this fixes an endless loop bug! - reenable the test for this should I merge this to samba3? metze Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c branches/SAMBA_4_0/source/lib/talloc/testsuite.c Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c === --- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2006-07-15 10:55:24 UTC (rev 17060) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2006-07-15 13:28:52 UTC (rev 17061) @@ -585,10 +585,6 @@ tc-destructor = NULL; } - tc-flags |= TALLOC_FLAG_LOOP; - - talloc_free_children(ptr); - if (tc-parent) { _TLIST_REMOVE(tc-parent-child, tc); if (tc-parent-child) { @@ -599,8 +595,10 @@ if (tc-next) tc-next-prev = tc-prev; } - tc-flags |= TALLOC_FLAG_FREE; + tc-flags |= TALLOC_FLAG_LOOP; + talloc_free_children(ptr); + tc-flags |= TALLOC_FLAG_FREE; old_errno = errno; free(tc); errno = old_errno; Modified: branches/SAMBA_4_0/source/lib/talloc/testsuite.c === --- branches/SAMBA_4_0/source/lib/talloc/testsuite.c2006-07-15 10:55:24 UTC (rev 17060) +++ branches/SAMBA_4_0/source/lib/talloc/testsuite.c2006-07-15 13:28:52 UTC (rev 17061) @@ -845,9 +845,8 @@ talloc_report_full(top, stdout); talloc_free(top); talloc_free(child_owner); -#if 0 talloc_free(child); -#endif + return True; }
svn commit: samba r17062 - in branches/SAMBA_4_0/source/lib/talloc: .
Author: metze Date: 2006-07-15 14:09:21 + (Sat, 15 Jul 2006) New Revision: 17062 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17062 Log: make correct use of talloc destructors, and make the code much simpler should I merge that aslo to samba3? metze Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c Changeset: Modified: branches/SAMBA_4_0/source/lib/talloc/talloc.c === --- branches/SAMBA_4_0/source/lib/talloc/talloc.c 2006-07-15 13:28:52 UTC (rev 17061) +++ branches/SAMBA_4_0/source/lib/talloc/talloc.c 2006-07-15 14:09:21 UTC (rev 17062) @@ -237,13 +237,8 @@ */ static int talloc_reference_destructor(struct talloc_reference_handle *handle) { - struct talloc_chunk *tc1 = talloc_chunk_from_ptr(handle); - struct talloc_chunk *tc2 = talloc_chunk_from_ptr(handle-ptr); - if (tc1-destructor != (talloc_destructor_t)-1) { - tc1-destructor = NULL; - } - _TLIST_REMOVE(tc2-refs, handle); - talloc_free(handle); + struct talloc_chunk *ptr_tc = talloc_chunk_from_ptr(handle-ptr); + _TLIST_REMOVE(ptr_tc-refs, handle); return 0; } @@ -302,10 +297,7 @@ return -1; } - talloc_set_destructor(h, NULL); - _TLIST_REMOVE(tc-refs, h); - talloc_free(h); - return 0; + return talloc_free(h); } /* @@ -558,9 +550,15 @@ if (tc-refs) { int is_child; - struct talloc_reference_handle *handle = tc-refs; - is_child = talloc_is_parent(handle, handle-ptr); - talloc_reference_destructor(tc-refs); + /* check this is a reference from a child or grantchild +* back to it's parent or grantparent +* +* in that case we need to remove the reference and +* call another instance of talloc_free() on the current +* pointer. +*/ + is_child = talloc_is_parent(tc-refs, ptr); + talloc_free(tc-refs); if (is_child) { return talloc_free(ptr); }
svn commit: samba r17063 - in branches/SAMBA_3_0/packaging/Debian/debian-sarge: . patches
Author: idra Date: 2006-07-15 16:51:23 + (Sat, 15 Jul 2006) New Revision: 17063 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17063 Log: Update debian-sarge for 3.0.23 Modified: branches/SAMBA_3_0/packaging/Debian/debian-sarge/changelog branches/SAMBA_3_0/packaging/Debian/debian-sarge/patches/fhs.patch branches/SAMBA_3_0/packaging/Debian/debian-sarge/patches/make-distclean.patch branches/SAMBA_3_0/packaging/Debian/debian-sarge/patches/samba.patch branches/SAMBA_3_0/packaging/Debian/debian-sarge/rules branches/SAMBA_3_0/packaging/Debian/debian-sarge/samba-common.files Changeset: Modified: branches/SAMBA_3_0/packaging/Debian/debian-sarge/changelog === --- branches/SAMBA_3_0/packaging/Debian/debian-sarge/changelog 2006-07-15 14:09:21 UTC (rev 17062) +++ branches/SAMBA_3_0/packaging/Debian/debian-sarge/changelog 2006-07-15 16:51:23 UTC (rev 17063) @@ -1,3 +1,15 @@ +samba (3.0.23-1) stable; urgency=low + + * samba 3.0.23 Samba Team Release + + -- Simo Sorce [EMAIL PROTECTED] Sat, 15 Jul 2006 10:01:30 -0400 + +samba (3.0.22-1) stable; urgency=high + + * samba 3.0.22 Samba Team Release + + -- Simo Sorce [EMAIL PROTECTED] Fri, 07 Apr 2006 15:45:30 -0400 + samba (3.0.21b-1) stable; urgency=high * samba 3.0.21b Samba Team Release Modified: branches/SAMBA_3_0/packaging/Debian/debian-sarge/patches/fhs.patch === --- branches/SAMBA_3_0/packaging/Debian/debian-sarge/patches/fhs.patch 2006-07-15 14:09:21 UTC (rev 17062) +++ branches/SAMBA_3_0/packaging/Debian/debian-sarge/patches/fhs.patch 2006-07-15 16:51:23 UTC (rev 17063) @@ -28,11 +28,11 @@ @$(SHELL) $(srcdir)/script/installscripts.sh $(INSTALLPERMS) $(DESTDIR)$(BINDIR) $(SCRIPTS) installdat: installdirs -- @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(LIBDIR) $(srcdir) -+ @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR)$(CODEPAGEDIR) $(srcdir) +- @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR) $(LIBDIR) $(srcdir) ++ @$(SHELL) $(srcdir)/script/installdat.sh $(DESTDIR) $(CODEPAGEDIR) $(srcdir) installmsg: installdirs - @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR)$(LIBDIR) $(srcdir) + @$(SHELL) $(srcdir)/script/installmsg.sh $(DESTDIR) $(LIBDIR) $(srcdir) diff -uNr samba-3.0.10.orig/source/configure.in samba-3.0.10/source/configure.in --- samba-3.0.10.orig/source/configure.in 2004-12-17 03:50:08.0 -0800 +++ samba-3.0.10/source/configure.in 2004-12-17 03:55:29.0 -0800 @@ -57,9 +57,9 @@ esac]) @@ -201,6 +205,9 @@ - AC_SUBST(swatdir) - AC_SUBST(bindir) AC_SUBST(sbindir) + AC_SUBST(rootsbindir) + AC_SUBST(pammodulesdir) +AC_SUBST(codepagedir) +AC_SUBST(statedir) +AC_SUBST(cachedir) @@ -85,8 +85,8 @@ * @sa lib_path() to get the path to a file inside the LIBDIR. @@ -70,3 +77,27 @@ - const pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE; - const pstring dyn_PRIVATE_DIR = PRIVATE_DIR; + pstring dyn_SMB_PASSWD_FILE = SMB_PASSWD_FILE; + pstring dyn_PRIVATE_DIR = PRIVATE_DIR; + + +/* In non-FHS mode, these should be configurable using 'lock dir ='; @@ -114,10 +114,11 @@ diff -uNr samba-3.0.10.orig/source/groupdb/mapping.c samba-3.0.10/source/groupdb/mapping.c --- samba-3.0.10.orig/source/groupdb/mapping.c 2004-12-17 03:50:08.0 -0800 +++ samba-3.0.10/source/groupdb/mapping.c 2004-12-17 03:55:29.0 -0800 -@@ -140,7 +140,7 @@ +@@ -140,8 +140,8 @@ if (tdb) return True; + - tdb = tdb_open_log(lock_path(group_mapping.tdb), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); + tdb = tdb_open_log(state_path(group_mapping.tdb), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); if (!tdb) { @@ -131,11 +132,11 @@ extern pstring dyn_LOGFILEBASE, dyn_LMHOSTSFILE; extern pstring dyn_LIBDIR; +extern pstring dyn_CODEPAGEDIR; - extern const fstring dyn_SHLIBEXT; - extern const pstring dyn_LOCKDIR; - extern const pstring dyn_PIDDIR; - extern const pstring dyn_SMB_PASSWD_FILE; - extern const pstring dyn_PRIVATE_DIR; + extern fstring dyn_SHLIBEXT; + extern pstring dyn_LOCKDIR; + extern pstring dyn_PIDDIR; + extern pstring dyn_SMB_PASSWD_FILE; + extern pstring dyn_PRIVATE_DIR; + +char *dyn_STATEDIR(void); +char *dyn_CACHEDIR(void); @@ -231,17 +232,20 @@ diff -uNr samba-3.0.10.orig/source/lib/util_unistr.c samba-3.0.10/source/lib/util_unistr.c --- samba-3.0.10.orig/source/lib/util_unistr.c 2004-12-17 03:50:08.0 -0800 +++ samba-3.0.10/source/lib/util_unistr.c 2004-12-17 03:55:29.0 -0800 -@@ -54,8 +54,8 @@ - if (initialised) return; +@@ -54,11 +54,11 @@ + } initialised = 1; - upcase_table = map_file(lib_path(upcase.dat), 0x2); -- lowcase_table = map_file(lib_path(lowcase.dat), 0x2); + upcase_table =
svn commit: samba r17064 - in branches: SAMBA_3_0/source/rpc_server SAMBA_4_0/source/torture/rpc
Author: vlendec Date: 2006-07-15 17:55:01 + (Sat, 15 Jul 2006) New Revision: 17064 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17064 Log: lsa_GetUserName needs to return the name for S-1-5-7 on an anonymous login. Found that because I want to play around with setsharesecurity, for this I need the whoami call figuring out the SID of the currently connected user. Not activating this test yet until the build farm has picked up the new samba4 revision. Volker Modified: branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c branches/SAMBA_4_0/source/torture/rpc/rpc.c branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c Changeset: Modified: branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c === --- branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c 2006-07-15 16:51:23 UTC (rev 17063) +++ branches/SAMBA_3_0/source/rpc_server/srv_lsa_nt.c 2006-07-15 17:55:01 UTC (rev 17064) @@ -1514,15 +1514,27 @@ NTSTATUS _lsa_unk_get_connuser(pipes_struct *p, LSA_Q_UNK_GET_CONNUSER *q_u, LSA_R_UNK_GET_CONNUSER *r_u) { - fstring username, domname; + const char *username, *domname; user_struct *vuser = get_valid_user_struct(p-vuid); if (vuser == NULL) return NT_STATUS_CANT_ACCESS_DOMAIN_INFO; + + if (vuser-guest) { + /* +* I'm 99% sure this is not the right place to do this, +* global_sid_Anonymous should probably be put into the token +* instead of the guest id -- vl +*/ + if (!lookup_sid(p-mem_ctx, global_sid_Anonymous, + domname, username, NULL)) { + return NT_STATUS_NO_MEMORY; + } + } else { + username = vuser-user.smb_name; + domname = vuser-user.domain; + } - fstrcpy(username, vuser-user.smb_name); - fstrcpy(domname, vuser-user.domain); - r_u-ptr_user_name = 1; init_unistr2(r_u-uni2_user_name, username, UNI_STR_TERMINATE); init_uni_hdr(r_u-hdr_user_name, r_u-uni2_user_name); Modified: branches/SAMBA_4_0/source/torture/rpc/rpc.c === --- branches/SAMBA_4_0/source/torture/rpc/rpc.c 2006-07-15 16:51:23 UTC (rev 17063) +++ branches/SAMBA_4_0/source/torture/rpc/rpc.c 2006-07-15 17:55:01 UTC (rev 17064) @@ -130,6 +130,8 @@ register_torture_op(RPC-NETLOGSAMBA3, torture_netlogon_samba3); register_torture_op(RPC-SAMBA3SESSIONKEY, torture_samba3_sessionkey); register_torture_op(RPC-SAMBA3-SRVSVC, torture_samba3_rpc_srvsvc); + register_torture_op(RPC-SAMBA3-GETUSERNAME, + torture_samba3_rpc_getusername); register_torture_op(RPC-DRSUAPI, torture_rpc_drsuapi); register_torture_op(RPC-CRACKNAMES, torture_rpc_drsuapi_cracknames); register_torture_op(RPC-ROT, torture_rpc_rot); Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c === --- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c 2006-07-15 16:51:23 UTC (rev 17063) +++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c 2006-07-15 17:55:01 UTC (rev 17064) @@ -21,7 +21,9 @@ */ #include includes.h +#include libcli/raw/libcliraw.h #include torture/torture.h +#include torture/util.h #include librpc/gen_ndr/ndr_lsa.h #include librpc/gen_ndr/ndr_lsa_c.h #include librpc/gen_ndr/ndr_samr.h @@ -39,7 +41,22 @@ #include libcli/auth/libcli_auth.h #include libcli/auth/credentials.h #include lib/crypto/crypto.h +#include libcli/security/proto.h +static struct cli_credentials *create_anon_creds(TALLOC_CTX *mem_ctx) +{ + struct cli_credentials *result; + + if (!(result = cli_credentials_init(mem_ctx))) { + return NULL; + } + + cli_credentials_set_conf(result); + cli_credentials_set_anonymous(result); + + return result; +} + /* * This tests a RPC call using an invalid vuid */ @@ -128,15 +145,11 @@ goto done; } - anon_creds = cli_credentials_init(mem_ctx); - if (anon_creds == NULL) { - d_printf(cli_credentials_init failed\n); + if (!(anon_creds = create_anon_creds(mem_ctx))) { + d_printf(create_anon_creds failed\n); goto done; } - cli_credentials_set_conf(anon_creds); - cli_credentials_set_anonymous(anon_creds); - setup.in.sesskey = cli-transport-negotiate.sesskey; setup.in.capabilities = cli-transport-negotiate.capabilities; setup.in.workgroup = ; @@ -986,15 +999,11 @@ return False; } - anon_creds = cli_credentials_init(mem_ctx); - if (anon_creds == NULL) { - d_printf(cli_credentials_init failed\n); + if (!(anon_creds =
svn commit: samba r17065 - in branches/SAMBA_4_0/source/torture/rpc: .
Author: vlendec Date: 2006-07-15 18:20:13 + (Sat, 15 Jul 2006) New Revision: 17065 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17065 Log: NT4 does not like 0 here, W2k3 does not care... Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c Changeset: Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c === --- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c 2006-07-15 17:55:01 UTC (rev 17064) +++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c 2006-07-15 18:20:13 UTC (rev 17065) @@ -1272,7 +1272,7 @@ struct lsa_LookupNames l; struct lsa_TransSidArray sids; struct lsa_String lsa_name; - uint32_t count = 1; + uint32_t count = 0; struct dom_sid *result; TALLOC_CTX *tmp_ctx;
svn commit: samba r17066 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 18:26:12 + (Sat, 15 Jul 2006) New Revision: 17066 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17066 Log: Add missing `break's to switches... Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:20:13 UTC (rev 17065) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:26:12 UTC (rev 17066) @@ -338,16 +338,19 @@ case MAP_KEEP: if (ldb_attr_cmp(data-attribute_maps[i] .local_name, name) == 0) return data-attribute_maps[i]; + break; case MAP_RENAME: case MAP_CONVERT: if (ldb_attr_cmp(data-attribute_maps[i] .u.rename.remote_name, name) == 0) return data-attribute_maps[i]; + break; case MAP_GENERATE: for (j = 0; data-attribute_maps[i].u.generate.remote_names[j]; j++) if (ldb_attr_cmp(data-attribute_maps[i].u.generate.remote_names[j], name) == 0) return data-attribute_maps[i]; + break; default: break; @@ -1204,12 +1207,15 @@ switch (tree-operation) { case LDB_OP_EQUALITY: val = tree-u.equality.value; + break; case LDB_OP_LESS: case LDB_OP_GREATER: case LDB_OP_APPROX: val = tree-u.comparison.value; + break; case LDB_OP_EXTENDED: val = tree-u.extended.value; + break; default: return val; }
svn commit: samba r17067 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 18:28:27 + (Sat, 15 Jul 2006) New Revision: 17067 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17067 Log: When merging search results and the remote result contains an unmapped attribute, assume it was auto-generated and skip it. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:26:12 UTC (rev 17066) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:28:27 UTC (rev 17067) @@ -1687,12 +1687,13 @@ { struct ldb_message_element *el; - /* no mapping: fail */ + /* unmapped attribute in remote message: + skip, attribute was probably auto-generated */ if (map == NULL) { ldb_debug(module-ldb, LDB_DEBUG_WARNING, ldb_map: Not mapping attribute '%s': no mapping found\n, old-name); - goto failed; + goto unmapped; } switch (map-type) {
svn commit: samba r17068 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 18:30:29 + (Sat, 15 Jul 2006) New Revision: 17068 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17068 Log: Fix a pointer to inaccessible memory. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:28:27 UTC (rev 17067) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:30:29 UTC (rev 17068) @@ -1217,7 +1217,7 @@ val = tree-u.extended.value; break; default: - return val; + return ldb_val_dup(new, val); } /* convert to the new value */
svn commit: samba r17069 - in branches/SAMBA_4_0/source/torture/rpc: .
Author: vlendec Date: 2006-07-15 18:31:51 + (Sat, 15 Jul 2006) New Revision: 17069 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17069 Log: Make us pass RPC-NETLOGSAMBA3 against w2k3 again Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c Changeset: Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c === --- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c 2006-07-15 18:30:29 UTC (rev 17068) +++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c 2006-07-15 18:31:51 UTC (rev 17069) @@ -594,7 +594,8 @@ status = dcerpc_samr_SetUserInfo2(samr_pipe, mem_ctx, sui2); if (!NT_STATUS_IS_OK(status)) { - d_printf(samr_SetUserInfo(24) failed\n); + d_printf(samr_SetUserInfo(24) failed: %s\n, +nt_errstr(status)); goto done; } @@ -1023,7 +1024,9 @@ cli_credentials_set_secure_channel_type(wks_creds, SEC_CHAN_WKSTA); cli_credentials_set_username(wks_creds, wks_name, CRED_SPECIFIED); cli_credentials_set_workstation(wks_creds, wks_name, CRED_SPECIFIED); - cli_credentials_set_password(wks_creds, , CRED_SPECIFIED); + cli_credentials_set_password(wks_creds, +generate_random_str(wks_creds, 8), +CRED_SPECIFIED); if (!join3(cli, False, cmdline_credentials, wks_creds)) { d_printf(join failed\n);
svn commit: samba r17070 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 18:32:37 + (Sat, 15 Jul 2006) New Revision: 17070 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17070 Log: Skip mapped search if search base *exists* and is outside the local partition. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:31:51 UTC (rev 17069) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:32:37 UTC (rev 17070) @@ -2019,7 +2019,8 @@ return ldb_next_request(module, req); /* no mapping requested, skip to next module */ - if (!check_dn_local(module, req-op.search.base)) + if (req-op.search.base + !check_dn_local(module, req-op.search.base)) return ldb_next_request(module, req); /* no mapping needed, skip to next module */
svn commit: samba r17071 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 18:33:32 + (Sat, 15 Jul 2006) New Revision: 17071 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17071 Log: Set the correct async handles for searches. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:32:37 UTC (rev 17070) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:33:32 UTC (rev 17071) @@ -1988,6 +1988,9 @@ if (req == NULL) goto error; + /* use search context to merge results */ + req-async.context = sc; + return ldb_next_remote_request(ac-module, req); callback: @@ -2038,9 +2041,6 @@ return LDB_ERR_OPERATIONS_ERROR; ac = talloc_get_type(h-private_data, struct map_async_context); - /* return or own handle to deal with this call */ - /* req-async.handle = h; */ - /* prepare the local operation */ ac-local_req = talloc_zero(ac, struct ldb_request); if (ac-local_req == NULL) {
svn commit: samba r17072 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 18:35:26 + (Sat, 15 Jul 2006) New Revision: 17072 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17072 Log: When a parse-tree contains only remote parts, use a new parse-tree that searches records pointing to remote parts for the local search. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:33:32 UTC (rev 17071) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:35:26 UTC (rev 17072) @@ -2073,6 +2073,19 @@ if (ret != LDB_SUCCESS) goto failed; + /* if there is no local tree, search for records with remote parts */ + if (remote_tree !local_tree) { + local_tree = talloc_zero(ac-local_req, struct ldb_parse_tree); + if (local_tree == NULL) { + map_oom(module); + goto failed; + } + + local_tree-operation = LDB_OP_PRESENT; + local_tree-u.present.attr + = talloc_strdup(local_tree, IS_MAPPED); + } + ac-local_req-op.search.tree = local_tree; ac-remote_tree = remote_tree;
svn commit: samba r17073 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-15 18:38:57 + (Sat, 15 Jul 2006) New Revision: 17073 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17073 Log: Convert remote new DN to string before stuffing it into the fixup message. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:35:26 UTC (rev 17072) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 18:38:57 UTC (rev 17073) @@ -2539,6 +2539,7 @@ { struct map_async_context *ac; struct ldb_message *msg; + const struct ldb_dn *newdn; const char *dn; ac = talloc_get_type(handle-private_data, struct map_async_context); @@ -2559,7 +2560,8 @@ /* update 'IS_MAPPED' with the new remote DN */ msg-dn = discard_const_p(struct ldb_dn, ac-orig_req-op.rename.olddn); - dn = map_local_dn(ac-module, msg, ac-orig_req-op.rename.newdn); + newdn = map_local_dn(ac-module, msg, ac-orig_req-op.rename.newdn); + dn = ldb_dn_linearize(msg, newdn); if (dn == NULL) goto failed; if (ldb_msg_add_empty(msg, IS_MAPPED, LDB_FLAG_MOD_REPLACE) != 0)
svn commit: samba r17074 - in branches/SAMBA_4_0/source/torture/rpc: .
Author: vlendec Date: 2006-07-15 20:08:40 + (Sat, 15 Jul 2006) New Revision: 17074 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17074 Log: Extend the rpc-samba3-getusername test: This creates a normal user and we check if we can actually see the user SID on a fresh sessionsetup. This also gives us the simple create_user, which can lead to more fun tests :-) Volker Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c Changeset: Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c === --- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c 2006-07-15 18:38:57 UTC (rev 17073) +++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c 2006-07-15 20:08:40 UTC (rev 17074) @@ -324,10 +324,11 @@ struct cli_credentials *admin_creds, uint8_t auth_type, uint8_t auth_level, - const char *wks_name, + const char *username, char **domain, struct dcerpc_pipe **result_pipe, - struct policy_handle **result_handle) + struct policy_handle **result_handle, + struct dom_sid **sid) { struct dcerpc_pipe *samr_pipe; NTSTATUS status; @@ -434,9 +435,9 @@ } c.in.domain_handle = domain_handle; - user_name.string = talloc_asprintf(mem_ctx, %s$, wks_name); + user_name.string = username; c.in.account_name = user_name; - c.in.acct_flags = ACB_WSTRUST; + c.in.acct_flags = ACB_NORMAL; c.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; user_handle = talloc(mem_ctx, struct policy_handle); c.out.user_handle = user_handle; @@ -462,7 +463,7 @@ ou.in.domain_handle = domain_handle; ou.in.access_mask = SEC_FLAG_MAXIMUM_ALLOWED; - ou.in.rid = ln.out.rids.ids[0]; + user_rid = ou.in.rid = ln.out.rids.ids[0]; ou.out.user_handle = user_handle; status = dcerpc_samr_OpenUser(samr_pipe, mem_ctx, ou); @@ -480,6 +481,9 @@ *result_pipe = samr_pipe; *result_handle = user_handle; + if (sid != NULL) { + *sid = dom_sid_add_rid(mem_ctx, l.out.sid, user_rid); + } return NT_STATUS_OK; fail: @@ -487,6 +491,163 @@ } /* + * Create a test user + */ + +static BOOL create_user(TALLOC_CTX *mem_ctx, struct smbcli_state *cli, + struct cli_credentials *admin_creds, + const char *username, const char *password, + char **domain_name, + struct dom_sid **user_sid) +{ + TALLOC_CTX *tmp_ctx; + NTSTATUS status; + struct dcerpc_pipe *samr_pipe; + struct policy_handle *wks_handle; + BOOL ret = False; + + if (!(tmp_ctx = talloc_new(mem_ctx))) { + d_printf(talloc_init failed\n); + return False; + } + + status = get_usr_handle(cli, tmp_ctx, admin_creds, + DCERPC_AUTH_TYPE_NTLMSSP, + DCERPC_AUTH_LEVEL_INTEGRITY, + username, domain_name, samr_pipe, wks_handle, + user_sid); + if (!NT_STATUS_IS_OK(status)) { + d_printf(get_wks_handle failed: %s\n, nt_errstr(status)); + goto done; + } + + { + struct samr_SetUserInfo2 sui2; + struct samr_SetUserInfo sui; + struct samr_QueryUserInfo qui; + union samr_UserInfo u_info; + DATA_BLOB session_key; + + encode_pw_buffer(u_info.info24.password.data, password, +STR_UNICODE); + u_info.info24.pw_len = strlen_m(password)*2; + + status = dcerpc_fetch_session_key(samr_pipe, session_key); + if (!NT_STATUS_IS_OK(status)) { + d_printf(dcerpc_fetch_session_key failed\n); + goto done; + } + arcfour_crypt_blob(u_info.info24.password.data, 516, + session_key); + sui2.in.user_handle = wks_handle; + sui2.in.info = u_info; + sui2.in.level = 24; + + status = dcerpc_samr_SetUserInfo2(samr_pipe, tmp_ctx, sui2); + if (!NT_STATUS_IS_OK(status)) { + d_printf(samr_SetUserInfo(24) failed: %s\n, +nt_errstr(status)); + goto done; + } + + u_info.info16.acct_flags = ACB_NORMAL; + sui.in.user_handle = wks_handle; + sui.in.info = u_info; +
svn commit: samba r17075 - in branches/SAMBA_3_0/source/passdb: .
Author: vlendec Date: 2006-07-15 20:39:00 + (Sat, 15 Jul 2006) New Revision: 17075 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17075 Log: Even without talloc_steal you can still create memory problems ;-) Modified: branches/SAMBA_3_0/source/passdb/lookup_sid.c Changeset: Modified: branches/SAMBA_3_0/source/passdb/lookup_sid.c === --- branches/SAMBA_3_0/source/passdb/lookup_sid.c 2006-07-15 20:08:40 UTC (rev 17074) +++ branches/SAMBA_3_0/source/passdb/lookup_sid.c 2006-07-15 20:39:00 UTC (rev 17075) @@ -357,7 +357,7 @@ if (ret_domain != NULL) { char *tmp_dom; - if (!(tmp_dom = talloc_strdup(tmp_ctx, domain))) { + if (!(tmp_dom = talloc_strdup(mem_ctx, domain))) { DEBUG(0, (talloc failed\n)); TALLOC_FREE(tmp_ctx); return False;
svn commit: linux-cifs-client r57 - in branches/linux-converged-for-old-kernels/fs/cifs: .
Author: jra Date: 2006-07-15 21:10:27 + (Sat, 15 Jul 2006) New Revision: 57 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=linux-cifs-clientrev=57 Log: Add in code to make timeouts absolute not relative. Jeremy. Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h branches/linux-converged-for-old-kernels/fs/cifs/connect.c branches/linux-converged-for-old-kernels/fs/cifs/transport.c Changeset: Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h === --- branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h 2006-07-14 23:14:06 UTC (rev 56) +++ branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h 2006-07-15 21:10:27 UTC (rev 57) @@ -160,6 +160,7 @@ char workstation_RFC1001_name[SERVER_NAME_LEN_WITH_NULL]; __u32 sequence_number; /* needed for CIFS PDU signature */ char mac_signing_key[CIFS_SESS_KEY_SIZE + 16]; + unsigned long last_receive_time; }; /* Modified: branches/linux-converged-for-old-kernels/fs/cifs/connect.c === --- branches/linux-converged-for-old-kernels/fs/cifs/connect.c 2006-07-14 23:14:06 UTC (rev 56) +++ branches/linux-converged-for-old-kernels/fs/cifs/connect.c 2006-07-15 21:10:27 UTC (rev 57) @@ -609,6 +609,10 @@ task_to_wake = NULL; spin_lock(GlobalMid_Lock); + + /* Note when we last received a reply - needed for timeout purposes. */ + server-last_receive_time = jiffies; + list_for_each(tmp, server-pending_mid_q) { mid_entry = list_entry(tmp, struct mid_q_entry, qhead); Modified: branches/linux-converged-for-old-kernels/fs/cifs/transport.c === --- branches/linux-converged-for-old-kernels/fs/cifs/transport.c 2006-07-14 23:14:06 UTC (rev 56) +++ branches/linux-converged-for-old-kernels/fs/cifs/transport.c 2006-07-15 21:10:27 UTC (rev 57) @@ -3,7 +3,8 @@ * * Copyright (C) International Business Machines Corp., 2002,2005 * Author(s): Steve French ([EMAIL PROTECTED]) - * + * Jeremy Allison ([EMAIL PROTECTED]) 2006. + * * 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.1 of the License, or @@ -476,12 +477,40 @@ /* No user interrupts in wait - wreaks havoc with performance */ if(timeout != MAX_SCHEDULE_TIMEOUT) { - timeout += jiffies; - wait_event(ses-server-response_q, - (!(midQ-midState MID_REQUEST_SUBMITTED)) || - time_after(jiffies, timeout) || - ((ses-server-tcpStatus != CifsGood) -(ses-server-tcpStatus != CifsNew))); + unsigned long curr_timeout; + + for (;;) { + curr_timeout = timeout + jiffies; + wait_event(ses-server-response_q, + (!(midQ-midState MID_REQUEST_SUBMITTED)) || + time_after(jiffies, curr_timeout) || + ((ses-server-tcpStatus != CifsGood) +(ses-server-tcpStatus != CifsNew))); + + if (time_after(jiffies, curr_timeout) + (midQ-midState MID_REQUEST_SUBMITTED) + ((ses-server-tcpStatus == CifsGood) || +(ses-server-tcpStatus == CifsNew))) { + + unsigned long lrt; + + /* We timed out. Is the server still + sending replies ? */ + spin_lock(GlobalMid_Lock); + lrt = ses-server-last_receive_time; + spin_unlock(GlobalMid_Lock); + + /* Calculate 15 seconds past last received time. */ + lrt += (15 * HZ); + if (time_after(jiffies, lrt)) { + /* Server sent no replies for 15 seconds. */ + cERROR(1,(Server idle for 15 seconds. Timing out)); + break; + } + } else { + break; + } + } } else { wait_event(ses-server-response_q, (!(midQ-midState MID_REQUEST_SUBMITTED)) || @@ -743,12 +772,40 @@ /* No user interrupts in wait - wreaks havoc with performance */ if(timeout !=
svn commit: linux-cifs-client r58 - in branches: .
Author: sfrench Date: 2006-07-15 22:05:22 + (Sat, 15 Jul 2006) New Revision: 58 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=linux-cifs-clientrev=58 Log: delete obsolete branches of cifs client code - they have been replaced by cifs-for-older-kernels branch This line, and those below, will be ignored-- Dlinux-2.6.9-RHEL4 Dlinux-2.6bk D2.6.8-Suse-Workstation-9.2 Removed: branches/2.6.8-Suse-Workstation-9.2/ branches/linux-2.6.9-RHEL4/ branches/linux-2.6bk/ Changeset:
Build status as of Sun Jul 16 00:00:02 2006
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2006-07-15 00:00:22.0 + +++ /home/build/master/cache/broken_results.txt 2006-07-16 00:00:04.0 + @@ -1,4 +1,4 @@ -Build status as of Sat Jul 15 00:00:02 2006 +Build status as of Sun Jul 16 00:00:02 2006 Build counts: Tree Total Broken Panic @@ -7,12 +7,12 @@ distcc 31 2 0 lorikeet-heimdal 0 0 0 ppp 18 0 0 -rsync31 1 0 +rsync30 0 0 samba30 5 0 samba-docs 0 0 0 -samba4 39 25 5 -samba_3_037 8 0 +samba4 39 24 5 +samba_3_038 8 0 smb-build25 25 0 -talloc 25 8 0 -tdb 29 9 0 +talloc 31 12 0 +tdb 26 9 0
svn commit: samba r17076 - in branches/SOC/mkhl/ldb-map/modules: .
Author: mkhl Date: 2006-07-16 00:29:35 + (Sun, 16 Jul 2006) New Revision: 17076 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=17076 Log: When searching for specific local attributes, always search for the IS_MAPPED attribute as well so we can include data from the remote partition. Martin Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c Changeset: Modified: branches/SOC/mkhl/ldb-map/modules/ldb_map.c === --- branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-15 20:39:00 UTC (rev 17075) +++ branches/SOC/mkhl/ldb-map/modules/ldb_map.c 2006-07-16 00:29:35 UTC (rev 17076) @@ -1510,9 +1510,27 @@ const char ***remote_attrs, const char * const *attrs) { - + int last; + *local_attrs = select_unmapped_attrs(module, local_ctx, attrs); *remote_attrs = select_mapped_attrs(module, remote_ctx, attrs); + + if (*local_attrs == NULL) + return LDB_SUCCESS; + + /* if specific local attrs were requested */ + /* find last local attribute */ + for (last = 0; (*local_attrs)[last]; last++); + + /* add IS_MAPPED behind it */ + *local_attrs = talloc_realloc(local_ctx, *local_attrs, + const char *, last+2); + if (*local_attrs == NULL) + return LDB_ERR_OPERATIONS_ERROR; + + (*local_attrs)[last] = talloc_strdup(*local_attrs, IS_MAPPED); + (*local_attrs)[last+1] = NULL; + return LDB_SUCCESS; }
svn commit: linux-cifs-client r59 - in branches/linux-converged-for-old-kernels/fs/cifs: .
Author: jra Date: 2006-07-16 01:49:10 + (Sun, 16 Jul 2006) New Revision: 59 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=linux-cifs-clientrev=59 Log: Don't use midQ-midState MID_REQUEST_SUBMITTED as this isn't a flag bit - use midQ-midState == MID_REQUEST_SUBMITTED instead. I know currently this doesn't make a difference but it makes the use of midState clearer. Jeremy. Modified: branches/linux-converged-for-old-kernels/fs/cifs/transport.c Changeset: Modified: branches/linux-converged-for-old-kernels/fs/cifs/transport.c === --- branches/linux-converged-for-old-kernels/fs/cifs/transport.c 2006-07-15 22:05:22 UTC (rev 58) +++ branches/linux-converged-for-old-kernels/fs/cifs/transport.c 2006-07-16 01:49:10 UTC (rev 59) @@ -482,13 +482,13 @@ for (;;) { curr_timeout = timeout + jiffies; wait_event(ses-server-response_q, - (!(midQ-midState MID_REQUEST_SUBMITTED)) || + (!(midQ-midState == MID_REQUEST_SUBMITTED)) || time_after(jiffies, curr_timeout) || ((ses-server-tcpStatus != CifsGood) (ses-server-tcpStatus != CifsNew))); if (time_after(jiffies, curr_timeout) - (midQ-midState MID_REQUEST_SUBMITTED) + (midQ-midState == MID_REQUEST_SUBMITTED) ((ses-server-tcpStatus == CifsGood) || (ses-server-tcpStatus == CifsNew))) { @@ -513,7 +513,7 @@ } } else { wait_event(ses-server-response_q, - (!(midQ-midState MID_REQUEST_SUBMITTED)) || + (!(midQ-midState == MID_REQUEST_SUBMITTED)) || ((ses-server-tcpStatus != CifsGood) (ses-server-tcpStatus != CifsNew))); } @@ -777,13 +777,13 @@ for (;;) { curr_timeout = timeout + jiffies; wait_event(ses-server-response_q, - (!(midQ-midState MID_REQUEST_SUBMITTED)) || + (!(midQ-midState == MID_REQUEST_SUBMITTED)) || time_after(jiffies, curr_timeout) || ((ses-server-tcpStatus != CifsGood) (ses-server-tcpStatus != CifsNew))); if (time_after(jiffies, curr_timeout) - (midQ-midState MID_REQUEST_SUBMITTED) + (midQ-midState == MID_REQUEST_SUBMITTED) ((ses-server-tcpStatus == CifsGood) || (ses-server-tcpStatus == CifsNew))) { @@ -808,7 +808,7 @@ } } else { wait_event(ses-server-response_q, - (!(midQ-midState MID_REQUEST_SUBMITTED)) || + (!(midQ-midState == MID_REQUEST_SUBMITTED)) || ((ses-server-tcpStatus != CifsGood) (ses-server-tcpStatus != CifsNew))); }
svn commit: linux-cifs-client r60 - in branches/linux-2.6-cifs-git-devel/fs/cifs: .
Author: sfrench Date: 2006-07-16 04:54:08 + (Sun, 16 Jul 2006) New Revision: 60 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=linux-cifs-clientrev=60 Log: Merge with mainline git modified jra patch Modified: branches/linux-2.6-cifs-git-devel/fs/cifs/CHANGES branches/linux-2.6-cifs-git-devel/fs/cifs/asn1.c branches/linux-2.6-cifs-git-devel/fs/cifs/cifsfs.c branches/linux-2.6-cifs-git-devel/fs/cifs/cifsfs.h branches/linux-2.6-cifs-git-devel/fs/cifs/cifsglob.h branches/linux-2.6-cifs-git-devel/fs/cifs/cifssmb.c branches/linux-2.6-cifs-git-devel/fs/cifs/connect.c branches/linux-2.6-cifs-git-devel/fs/cifs/file.c branches/linux-2.6-cifs-git-devel/fs/cifs/transport.c Changeset: Sorry, the patch is too large (339 lines) to include; please use WebSVN to see it! WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=linux-cifs-clientrev=60
svn commit: linux-cifs-client r61 - in branches/linux-converged-for-old-kernels/fs/cifs: .
Author: sfrench Date: 2006-07-16 05:07:17 + (Sun, 16 Jul 2006) New Revision: 61 WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=linux-cifs-clientrev=61 Log: Merge with main git tree Modified: branches/linux-converged-for-old-kernels/fs/cifs/CHANGES branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h branches/linux-converged-for-old-kernels/fs/cifs/cifssmb.c branches/linux-converged-for-old-kernels/fs/cifs/connect.c branches/linux-converged-for-old-kernels/fs/cifs/transport.c Changeset: Modified: branches/linux-converged-for-old-kernels/fs/cifs/CHANGES === --- branches/linux-converged-for-old-kernels/fs/cifs/CHANGES2006-07-16 04:54:08 UTC (rev 60) +++ branches/linux-converged-for-old-kernels/fs/cifs/CHANGES2006-07-16 05:07:17 UTC (rev 61) @@ -1,3 +1,9 @@ +Version 1.45 + +Do not time out lockw calls when using posix extensions. Do not +time out requests if server still responding reasonably fast +on requests on other threads + Version 1.44 Rewritten sessionsetup support, including support for legacy SMB Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h === --- branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h 2006-07-16 04:54:08 UTC (rev 60) +++ branches/linux-converged-for-old-kernels/fs/cifs/cifsfs.h 2006-07-16 05:07:17 UTC (rev 61) @@ -112,5 +112,5 @@ extern ssize_t cifs_listxattr(struct dentry *, char *, size_t); extern int cifs_ioctl (struct inode * inode, struct file * filep, unsigned int command, unsigned long arg); -#define CIFS_VERSION 1.44 +#define CIFS_VERSION 1.45 #endif /* _CIFSFS_H */ Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h === --- branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h 2006-07-16 04:54:08 UTC (rev 60) +++ branches/linux-converged-for-old-kernels/fs/cifs/cifsglob.h 2006-07-16 05:07:17 UTC (rev 61) @@ -159,8 +159,8 @@ /* 16th byte of RFC1001 workstation name is always null */ char workstation_RFC1001_name[SERVER_NAME_LEN_WITH_NULL]; __u32 sequence_number; /* needed for CIFS PDU signature */ - char mac_signing_key[CIFS_SESS_KEY_SIZE + 16]; - unsigned long last_receive_time; + char mac_signing_key[CIFS_SESS_KEY_SIZE + 16]; + unsigned long lstrp; /* when we got last response from this server */ }; /* Modified: branches/linux-converged-for-old-kernels/fs/cifs/cifssmb.c === --- branches/linux-converged-for-old-kernels/fs/cifs/cifssmb.c 2006-07-16 04:54:08 UTC (rev 60) +++ branches/linux-converged-for-old-kernels/fs/cifs/cifssmb.c 2006-07-16 05:07:17 UTC (rev 61) @@ -1494,8 +1494,8 @@ char *data_offset; struct cifs_posix_lock *parm_data; int rc = 0; + int timeout = 0; int bytes_returned = 0; - int timeout = 0; __u16 params, param_offset, offset, byte_count, count; cFYI(1, (Posix Lock)); @@ -1514,7 +1514,6 @@ pSMB-MaxSetupCount = 0; pSMB-Reserved = 0; pSMB-Flags = 0; - pSMB-Timeout = 0; pSMB-Reserved2 = 0; param_offset = offsetof(struct smb_com_transaction2_sfi_req, Fid) - 4; offset = param_offset + params; @@ -1542,9 +1541,11 @@ parm_data-lock_type = cpu_to_le16(lock_type); if(waitFlag) { timeout = 3; /* blocking operation, no timeout */ - pSMB-Timeout = cpu_to_le32(-1);/* blocking - do not time out */ parm_data-lock_flags = cpu_to_le16(1); - } + pSMB-Timeout = cpu_to_le32(-1); + } else + pSMB-Timeout = 0; + parm_data-pid = cpu_to_le32(current-tgid); parm_data-start = cpu_to_le64(pLockData-fl_start); parm_data-length = cpu_to_le64(len); /* normalize negative numbers */ Modified: branches/linux-converged-for-old-kernels/fs/cifs/connect.c === --- branches/linux-converged-for-old-kernels/fs/cifs/connect.c 2006-07-16 04:54:08 UTC (rev 60) +++ branches/linux-converged-for-old-kernels/fs/cifs/connect.c 2006-07-16 05:07:17 UTC (rev 61) @@ -609,10 +609,6 @@ task_to_wake = NULL; spin_lock(GlobalMid_Lock); - - /* Note when we last received a reply - needed for timeout purposes. */ - server-last_receive_time = jiffies; - list_for_each(tmp, server-pending_mid_q) { mid_entry = list_entry(tmp, struct mid_q_entry, qhead); @@ -659,6 +655,10 @@ #ifdef CONFIG_CIFS_STATS2