Build status as of Mon May 17 06:00:04 2010
URL: http://build.samba.org/ --- /home/build/master/cache/broken_results.txt.old 2010-05-16 00:00:19.0 -0600 +++ /home/build/master/cache/broken_results.txt 2010-05-17 00:00:05.0 -0600 @@ -1,4 +1,4 @@ -Build status as of Sun May 16 06:00:07 2010 +Build status as of Mon May 17 06:00:04 2010 Build counts: Tree Total Broken Panic
[SCM] Samba Shared Repository - branch v3-5-test updated
The branch, v3-5-test has been updated via 78a6eb5... mount.cifs: check for NULL addr pointer before handling scopeid from f4d8716... s3-docs: Unify capitalization. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test - Log - commit 78a6eb582d28d92db5ffab6ded40785be54cf540 Author: Jeff Layton jlay...@redhat.com Date: Wed May 12 07:05:10 2010 -0400 mount.cifs: check for NULL addr pointer before handling scopeid Signed-off-by: Jeff Layton jlay...@redhat.com Fix bug #7315 (mount.cifs segfaults after upgrade to 2.6.33). --- Summary of changes: client/mount.cifs.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/client/mount.cifs.c b/client/mount.cifs.c index 0b8d5b4..1b472c2 100644 --- a/client/mount.cifs.c +++ b/client/mount.cifs.c @@ -1648,7 +1648,7 @@ mount_retry: } } - if (addr-ai_addr-sa_family == AF_INET6 addr6-sin6_scope_id) { + if (addr addr-ai_addr-sa_family == AF_INET6 addr6-sin6_scope_id) { strlcat(options, %, options_size); current_len = strnlen(options, options_size); optionstail = options + current_len; -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-5-test updated
The branch, v3-5-test has been updated via ffd5a0f... WHATSNEW: Update changes since 3.5.2. from 78a6eb5... mount.cifs: check for NULL addr pointer before handling scopeid http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test - Log - commit ffd5a0f90fd43d1e3a995e60acade1a07d8ef1c8 Author: Karolin Seeger ksee...@samba.org Date: Mon May 17 10:21:08 2010 +0200 WHATSNEW: Update changes since 3.5.2. Karolin --- Summary of changes: WHATSNEW.txt | 52 1 files changed, 52 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/WHATSNEW.txt b/WHATSNEW.txt index 8d79905..231c35d 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -15,6 +15,58 @@ Changes since 3.5.2 --- +o Jeremy Allison j...@samba.org +* BUG 7288: Fix SMB job IDs in CUPS job names. +* BUG 7339: Fix MS-DFS functionality. + + +o Andrew Bartlett abart...@samba.org +* BUG 7354: Fix CLDAP tsocket problem on Solaris. + + +o Ira Cooper sa...@ira.wakeful.net +* BUG 7384: Fix bitmap leak in dptr_Close. + + +o Günther Deschner g...@samba.org +* BUG 7277: Fix exporting printers via 'cupsaddsmb' command. +* BUG 7417: Fix setting of passwords via 'net rpc user password' command. +* BUG 7418: Fix 'net rpc printer list' command. + + +o Olaf Flebbe o.fle...@science-computing.de +* BUG 7421: Rename mod_name to module_name. + + +o Björn Jacke b...@sernet.de +* BUG 7352: Make TIME_T_MAX defines consistent. +* BUG 7385: Fix building with Solaris' gcc. + + +o Jeff Layton jlay...@redhat.com +* BUG 7315: Fix segfault in mount.cifs. + + +o Volker Lendecke v...@samba.org +* BUG 7357: Re-fix a bug with smbd serving a windows terminal server. +* BUG 7389: Fix a Winbind crash when scanning trusts. +* BUG 7398: Fix rename problems with full_audit VFS module. + + +o Jim McDonough j...@samba.org +* BUG 7378: Display an error on 'net conf import' failures. + + +o Stefan Metzmacher me...@samba.org +* BUG 7196: Add replacement for IPV6_V6ONLY on linux systems with broken + headers. +* BUG 7317: Fix problems with SIGCHLD handling in Winbind. +* BUG 7354: Fix CLDAP tsocket problem on Solaris. + + +o Luca Olivetti l...@wetron.es +* BUG 7263: Fix cups encryption setting. + ## Reporting bugs Development Discussion -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b05faff... added documentation for the -I flag via 843c6a0... added support for a -I flag via 4fee40e... Consolidate all set SEC_DESC into single procedure set_secdesc from 2cc612c... s3-selftest: Allow overriding the subunit formatter. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b05faffd00a54520b49722db89ae820284e257db Author: Matthew McGillis matt...@mcgillis.org Date: Wed May 5 22:43:28 2010 -0700 added documentation for the -I flag commit 843c6a03c7094a58484fab10e246a8153d976de5 Author: Matthew McGillis matt...@mcgillis.org Date: Wed May 5 22:35:02 2010 -0700 added support for a -I flag commit 4fee40e2c0700d563386cfab686c0e6e3cb3e8f2 Author: Matthew McGillis matt...@mcgillis.org Date: Wed May 5 22:26:15 2010 -0700 Consolidate all set SEC_DESC into single procedure set_secdesc --- Summary of changes: docs-xml/manpages-3/smbcacls.1.xml | 14 +++ source3/utils/smbcacls.c | 201 +++- 2 files changed, 191 insertions(+), 24 deletions(-) Changeset truncated at 500 lines: diff --git a/docs-xml/manpages-3/smbcacls.1.xml b/docs-xml/manpages-3/smbcacls.1.xml index 3e63b9b..571cb69 100644 --- a/docs-xml/manpages-3/smbcacls.1.xml +++ b/docs-xml/manpages-3/smbcacls.1.xml @@ -27,6 +27,7 @@ arg choice=opt-S acls/arg arg choice=opt-C name/arg arg choice=opt-G name/arg + arg choice=opt-I allow|romove|copy/arg arg choice=opt--numeric/arg arg choice=opt-t/arg arg choice=opt-U username/arg @@ -118,6 +119,19 @@ varlistentry + term-I|--inherit allow|remove|copy/term + listitemparaSet or unset the windows Allow inheritable + permissions check box using the parameter-I/parameter + option. To set the check box pass allow. To unset the check + box pass either remove or copy. Remove will remove all + inherited acls. Copy will copy all the inherited acls. + /para/listitem + + /varlistentry + + + + varlistentry term--numeric/term listitemparaThis option displays all ACL information in numeric format. The default is to convert SIDs to names and ACE types diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c index 7db1f17..817b079 100644 --- a/source3/utils/smbcacls.c +++ b/source3/utils/smbcacls.c @@ -37,7 +37,7 @@ static int numeric; static int sddl; enum acl_mode {SMB_ACL_SET, SMB_ACL_DELETE, SMB_ACL_MODIFY, SMB_ACL_ADD }; -enum chown_mode {REQUEST_NONE, REQUEST_CHOWN, REQUEST_CHGRP}; +enum chown_mode {REQUEST_NONE, REQUEST_CHOWN, REQUEST_CHGRP, REQUEST_INHERIT}; enum exit_values {EXIT_OK, EXIT_FAILED, EXIT_PARSE_ERROR}; struct perm_value { @@ -660,6 +660,34 @@ static void sec_desc_print(struct cli_state *cli, FILE *f, SEC_DESC *sd) } /* +get fileinfo for filename +***/ +static uint16 get_fileinfo(struct cli_state *cli, const char *filename) +{ + uint16_t fnum = (uint16_t)-1; + uint16 mode; + + /* The desired access below is the only one I could find that works + with NT4, W2KP and Samba */ + + if (!NT_STATUS_IS_OK(cli_ntcreate(cli, filename, 0, CREATE_ACCESS_READ, + 0, FILE_SHARE_READ|FILE_SHARE_WRITE, + FILE_OPEN, 0x0, 0x0, fnum))) { + printf(Failed to open %s: %s\n, filename, cli_errstr(cli)); + } + + if (!cli_qfileinfo(cli, fnum, mode, NULL, NULL, NULL, + NULL, NULL, NULL)) { + printf(Failed to file info %s: %s\n, filename, + cli_errstr(cli)); +} + + cli_close(cli, fnum); + +return mode; +} + +/* get sec desc for filename ***/ static SEC_DESC *get_secdesc(struct cli_state *cli, const char *filename) @@ -689,6 +717,36 @@ static SEC_DESC *get_secdesc(struct cli_state *cli, const char *filename) } /* +set sec desc for filename +***/ +static bool set_secdesc(struct cli_state *cli, const char *filename, +SEC_DESC *sd) +{ + uint16_t fnum = (uint16_t)-1; +bool result=true; + + /* The desired access below is the only one I could find that works +
[SCM] CTDB repository - branch libctdb updated - ctdb-1.0.114-110-gb28816f
The branch, libctdb has been updated via b28816fecc7c56a15f6027676c9557283ebc4338 (commit) via 9b78ee69040c1b28d4b9190d572795a43d5a9c57 (commit) via 0262c1a9a819f50517724ff6e1170be0fffcb7e8 (commit) from 3e9720d1dea95daf0c442eb2fbcbc1c90a0ccc47 (commit) http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=libctdb - Log - commit b28816fecc7c56a15f6027676c9557283ebc4338 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Mon May 17 18:40:24 2010 +1000 add a function ctdb_writerecord() to write a record to the database. This function can only be called while hoilding a ctdb_readreacordlock*() handle. Either from the callback provided or after ctdb_readrecordlock_recv() has been called but before ctdb_free() is used to release the handle. commit 9b78ee69040c1b28d4b9190d572795a43d5a9c57 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Mon May 17 15:55:40 2010 +1000 move ctdb_call_recv to libctdb commit 0262c1a9a819f50517724ff6e1170be0fffcb7e8 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Mon May 17 15:43:37 2010 +1000 createdb and getdbpath does not need to be in the public api --- Summary of changes: client/ctdb_client.c| 175 --- include/ctdb.h | 85 --- include/ctdb_private.h |7 ++ include/ctdb_protocol.h | 42 +++ libctdb/ctdb_client.c | 163 +++ libctdb/libctdb.c | 101 ++- libctdb/tst.c | 55 +-- 7 files changed, 387 insertions(+), 241 deletions(-) Changeset truncated at 500 lines: diff --git a/client/ctdb_client.c b/client/ctdb_client.c index 56d8b5a..4d49293 100644 --- a/client/ctdb_client.c +++ b/client/ctdb_client.c @@ -33,181 +33,6 @@ -struct ctdb_record_handle { - struct ctdb_db_context *ctdb_db; - TDB_DATA key; - TDB_DATA *data; - struct ctdb_ltdb_header header; -}; - - -/* - make a recv call to the local ctdb daemon - called from client context - - This is called when the program wants to wait for a ctdb_call to complete and get the - results. This call will block unless the call has already completed. -*/ -int ctdb_call_recv(struct ctdb_client_call_state *state, struct ctdb_call *call) -{ - if (state == NULL) { - return -1; - } - - while (state-state CTDB_CALL_DONE) { - event_loop_once(state-ctdb_db-ctdb-ev); - } - if (state-state != CTDB_CALL_DONE) { - DEBUG(DEBUG_ERR,(__location__ ctdb_call_recv failed\n)); - talloc_free(state); - return -1; - } - - if (state-call-reply_data.dsize) { - call-reply_data.dptr = talloc_memdup(state-ctdb_db, - state-call-reply_data.dptr, - state-call-reply_data.dsize); - call-reply_data.dsize = state-call-reply_data.dsize; - } else { - call-reply_data.dptr = NULL; - call-reply_data.dsize = 0; - } - call-status = state-call-status; - talloc_free(state); - - return 0; -} - - - - - - - -/* - full ctdb_call. Equivalent to a ctdb_call_send() followed by a ctdb_call_recv() -*/ -int ctdb_call(struct ctdb_db_context *ctdb_db, struct ctdb_call *call) -{ - struct ctdb_client_call_state *state; - - state = ctdb_call_send(ctdb_db, call); - return ctdb_call_recv(state, call); -} - - - - - -/* - cancel a ctdb_fetch_lock operation, releasing the lock - */ -static int fetch_lock_destructor(struct ctdb_record_handle *h) -{ - ctdb_ltdb_unlock(h-ctdb_db, h-key); - return 0; -} - -/* - force the migration of a record to this node - */ -static int ctdb_client_force_migration(struct ctdb_db_context *ctdb_db, TDB_DATA key) -{ - struct ctdb_call call; - ZERO_STRUCT(call); - call.call_id = CTDB_NULL_FUNC; - call.key = key; - call.flags = CTDB_IMMEDIATE_MIGRATION; - return ctdb_call(ctdb_db, call); -} - -/* - get a lock on a record, and return the records data. Blocks until it gets the lock - */ -struct ctdb_record_handle *ctdb_fetch_lock(struct ctdb_db_context *ctdb_db, TALLOC_CTX *mem_ctx, - TDB_DATA key, TDB_DATA *data) -{ - int ret; - struct ctdb_record_handle *h; - - /* - procedure is as follows: - - 1) get the chain lock. - 2) check if we are dmaster - 3) if we are the dmaster then return handle - 4) if not dmaster then ask ctdb daemon to make us dmaster, and wait for -reply from ctdbd - 5) when we get the reply, goto (1) -*/ - -
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 765e9c7... wbinfo: Add better libwbclient error reporting from b05faff... added documentation for the -I flag http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 765e9c7c67058271365521ce415b2ec1483e3c3d Author: Kai Blin k...@samba.org Date: Mon May 17 10:50:39 2010 +0200 wbinfo: Add better libwbclient error reporting --- Summary of changes: nsswitch/wbinfo.c | 104 +++-- 1 files changed, 101 insertions(+), 3 deletions(-) Changeset truncated at 500 lines: diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c index e576309..3c1db8b 100644 --- a/nsswitch/wbinfo.c +++ b/nsswitch/wbinfo.c @@ -47,7 +47,7 @@ static struct wbcInterfaceDetails *init_interface_details(void) wbc_status = wbcInterfaceDetails(details); if (!WBC_ERROR_IS_OK(wbc_status)) { d_fprintf(stderr, could not obtain winbind interface - details!\n); + details: %s\n, wbcErrorString(wbc_status)); } return details; @@ -172,6 +172,8 @@ static bool wbinfo_get_userinfo(char *user) wbc_status = wbcGetpwnam(user, pwd); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcGetpwnam: %s, + wbcErrorString(wbc_status)); return false; } @@ -195,6 +197,8 @@ static bool wbinfo_get_uidinfo(int uid) wbc_status = wbcGetpwuid(uid, pwd); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcGetpwuid: %s, + wbcErrorString(wbc_status)); return false; } @@ -219,6 +223,8 @@ static bool wbinfo_get_user_sidinfo(const char *sid_str) wbc_status = wbcStringToSid(sid_str, sid); wbc_status = wbcGetpwsid(sid, pwd); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcGetpwsid: %s, + wbcErrorString(wbc_status)); return false; } @@ -244,6 +250,8 @@ static bool wbinfo_get_groupinfo(const char *group) wbc_status = wbcGetgrnam(group, grp); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcGetgrnam: %s, + wbcErrorString(wbc_status)); return false; } @@ -273,6 +281,8 @@ static bool wbinfo_get_gidinfo(int gid) wbc_status = wbcGetgrgid(gid, grp); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcGetgrgid: %s, + wbcErrorString(wbc_status)); return false; } @@ -306,6 +316,8 @@ static bool wbinfo_get_usergroups(const char *user) wbc_status = wbcGetGroups(user, num_groups, groups); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcGetGroups: %s, + wbcErrorString(wbc_status)); return false; } @@ -331,11 +343,15 @@ static bool wbinfo_get_usersids(const char *user_sid_str) wbc_status = wbcStringToSid(user_sid_str, user_sid); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcStringToSid: %s, + wbcErrorString(wbc_status)); return false; } wbc_status = wbcLookupUserSids(user_sid, false, num_sids, sids); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcLookupUserSids: %s, + wbcErrorString(wbc_status)); return false; } @@ -343,6 +359,8 @@ static bool wbinfo_get_usersids(const char *user_sid_str) char *str = NULL; wbc_status = wbcSidToString(sids[i], str); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcSidToString: %s, + wbcErrorString(wbc_status)); wbcFreeMemory(sids); return false; } @@ -366,11 +384,15 @@ static bool wbinfo_get_userdomgroups(const char *user_sid_str) wbc_status = wbcStringToSid(user_sid_str, user_sid); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcSidToString: %s, + wbcErrorString(wbc_status)); return false; } wbc_status = wbcLookupUserSids(user_sid, true, num_sids, sids); if (!WBC_ERROR_IS_OK(wbc_status)) { + d_fprintf(stderr, failed to call wbcLookupUserSids: %s, + wbcErrorString(wbc_status)); return false;
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via a15b666... s3:winbind:idmap_tdb: don't check ranges when an invalid entry was found. from 765e9c7... wbinfo: Add better libwbclient error reporting http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit a15b6664389b05ea0cded46de3abe53034a7edef Author: Michael Adam ob...@samba.org Date: Mon May 17 10:39:00 2010 +0200 s3:winbind:idmap_tdb: don't check ranges when an invalid entry was found. There is no point in checking the ranges this if the record found had an invalid/unknown type: the mapping is not filled in. If it were initialized to some defaults before, the check just might replace the status NT_STATUS_INTERNAL_DB_ERROR with a NT_STATUS_NONE_MAPPED, which is not as precise. --- Summary of changes: source3/winbindd/idmap_tdb.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/idmap_tdb.c b/source3/winbindd/idmap_tdb.c index 8bfe751..45266ab 100644 --- a/source3/winbindd/idmap_tdb.c +++ b/source3/winbindd/idmap_tdb.c @@ -792,6 +792,7 @@ static NTSTATUS idmap_tdb_sid_to_id(struct idmap_tdb_context *ctx, struct id_map } else { /* Unknown record type ! */ DEBUG(2, (Found INVALID record %s - %s\n, keystr, (const char *)data.dptr)); ret = NT_STATUS_INTERNAL_DB_ERROR; + goto done; } /* apply filters before returning result */ -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d040658... s4-rodc: Set am_rodc flag during provision via 26d41c2... s4-rodc: Cache am_rodc flag from a15b666... s3:winbind:idmap_tdb: don't check ranges when an invalid entry was found. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d040658e1a5a48c6cc33640de37771d601c69a76 Author: Anatoliy Atanasov anatoliy.atana...@postpath.com Date: Mon May 17 12:49:37 2010 +0300 s4-rodc: Set am_rodc flag during provision commit 26d41c23f69b9e3ee327f159c9164917422d45c5 Author: Anatoliy Atanasov anatoliy.atana...@postpath.com Date: Thu May 13 15:07:50 2010 +0300 s4-rodc: Cache am_rodc flag --- Summary of changes: source4/dsdb/common/util.c | 29 +++ source4/dsdb/pydsdb.c | 22 source4/scripting/python/samba/provision.py | 18 +--- source4/scripting/python/samba/samdb.py |5 +++- source4/scripting/python/samba/schema.py|4 +- 5 files changed, 67 insertions(+), 11 deletions(-) Changeset truncated at 500 lines: diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c index 6387027..df4e734 100644 --- a/source4/dsdb/common/util.c +++ b/source4/dsdb/common/util.c @@ -2747,6 +2747,35 @@ int samdb_rodc(struct ldb_context *sam_ctx, bool *am_rodc) return LDB_SUCCESS; } +bool samdb_set_am_rodc(struct ldb_context *ldb, bool am_rodc) +{ + TALLOC_CTX *tmp_ctx; + bool *cached; + + tmp_ctx = talloc_new(ldb); + if (tmp_ctx == NULL) { + goto failed; + } + + cached = talloc(tmp_ctx, bool); + if (!cached) { + goto failed; + } + + *cached = am_rodc; + if (ldb_set_opaque(ldb, cache.am_rodc, cached) != LDB_SUCCESS) { + goto failed; + } + + talloc_steal(ldb, cached); + talloc_free(tmp_ctx); + return true; + +failed: + DEBUG(1,(Failed to set our own cached am_rodc in the ldb!\n)); + talloc_free(tmp_ctx); + return false; +} /* diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c index 45f8b6e..fd6925d 100644 --- a/source4/dsdb/pydsdb.c +++ b/source4/dsdb/pydsdb.c @@ -371,6 +371,25 @@ static PyObject *py_dsdb_load_partition_usn(PyObject *self, PyObject *args) return result; } +static PyObject *py_dsdb_set_am_rodc(PyObject *self, PyObject *args) +{ + PyObject *py_ldb; + bool ret; + struct ldb_context *ldb; + int py_val; + + if (!PyArg_ParseTuple(args, Oi, py_ldb, py_val)) + return NULL; + + PyErr_LDB_OR_RAISE(py_ldb, ldb); + ret = samdb_set_am_rodc(ldb, (bool)py_val); + if (!ret) { + PyErr_SetString(PyExc_RuntimeError, set_am_rodc failed); + return NULL; + } + Py_RETURN_NONE; +} + static PyMethodDef py_dsdb_methods[] = { { samdb_server_site_name, (PyCFunction)py_samdb_server_site_name, METH_VARARGS, Get the server site name as a string}, @@ -404,6 +423,9 @@ static PyMethodDef py_dsdb_methods[] = { { dsdb_load_partition_usn, (PyCFunction)py_dsdb_load_partition_usn, METH_VARARGS, get uSNHighest and uSNUrgent from the partition @REPLCHANGED}, + { dsdb_set_am_rodc, + (PyCFunction)py_dsdb_set_am_rodc, METH_VARARGS, + NULL }, { NULL } }; diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index f7db2e7..b4e48fb 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -841,7 +841,7 @@ def setup_samdb(path, setup_path, session_info, provision_backend, lp, domainsid, domainguid, policyguid, policyguid_dc, fill, adminpass, krbtgtpass, machinepass, invocationid, dnspass, ntdsguid, -serverrole, dom_for_fun_level=None, +serverrole, am_rodc, dom_for_fun_level=None, schema=None): Setup a complete SAM Database. @@ -870,11 +870,13 @@ def setup_samdb(path, setup_path, session_info, provision_backend, lp, names=names, serverrole=serverrole, schema=schema) if schema is None: -schema = Schema(setup_path, domainsid, schemadn=names.schemadn, serverdn=names.serverdn) +schema = Schema(setup_path, domainsid, schemadn=names.schemadn, serverdn=names.serverdn, +am_rodc=am_rodc) # Load the database, but don's load the global schema and don't connect quite yet samdb = SamDB(session_info=session_info, url=None, auto_connect=False, - credentials=provision_backend.credentials, lp=lp, global_schema=False) +
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 14ac2bb... s3-winbind: make the getpeername() checks in cm_prepare_connection IPv6 aware. from d040658... s4-rodc: Set am_rodc flag during provision http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 14ac2bb36ee22be6133ca1d069dc5de6c1891f47 Author: Günther Deschner g...@samba.org Date: Fri May 14 23:21:47 2010 +0200 s3-winbind: make the getpeername() checks in cm_prepare_connection IPv6 aware. Note that this failure was hard to track, as winbind did only log a super helpful cm_prepare_connection: Success debug message. IPv6 gurus, please check Successfully tested in two independent IPv6 networks now. Guenther --- Summary of changes: source3/winbindd/winbindd_cm.c | 30 +- 1 files changed, 25 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index 9715363..45747d4 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -808,11 +808,31 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain, peeraddr_len = sizeof(peeraddr); - if ((getpeername((*cli)-fd, peeraddr, peeraddr_len) != 0) || - (peeraddr_len != sizeof(struct sockaddr_in)) || - (peeraddr_in-sin_family != PF_INET)) - { - DEBUG(0,(cm_prepare_connection: %s\n, strerror(errno))); + if ((getpeername((*cli)-fd, peeraddr, peeraddr_len) != 0)) { + DEBUG(0,(cm_prepare_connection: getpeername failed with: %s\n, + strerror(errno))); + result = NT_STATUS_UNSUCCESSFUL; + goto done; + } + + if ((peeraddr_len != sizeof(struct sockaddr_in)) +#ifdef HAVE_IPV6 +(peeraddr_len != sizeof(struct sockaddr_in6)) +#endif + ) { + DEBUG(0,(cm_prepare_connection: got unexpected peeraddr len %d\n, + peeraddr_len)); + result = NT_STATUS_UNSUCCESSFUL; + goto done; + } + + if ((peeraddr_in-sin_family != PF_INET) +#ifdef HAVE_IPV6 +(peeraddr_in-sin_family != PF_INET6) +#endif + ) { + DEBUG(0,(cm_prepare_connection: got unexpected family %d\n, + peeraddr_in-sin_family)); result = NT_STATUS_UNSUCCESSFUL; goto done; } -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via dd5a4e2... s3-kerberos: temporary fix for ipv6 in print_kdc_line(). via e3bdff3... s3-kerberos: pass down kdc_name to create_local_private_krb5_conf_for_domain(). from 14ac2bb... s3-winbind: make the getpeername() checks in cm_prepare_connection IPv6 aware. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit dd5a4e23f8c24564d3fd21bb8d01172321087362 Author: Günther Deschner g...@samba.org Date: Sat May 15 00:34:35 2010 +0200 s3-kerberos: temporary fix for ipv6 in print_kdc_line(). Currently no krb5 lib supports kdc = ipv6 address at all, so for now just fill in just the kdc_name if we have it and let the krb5 lib figure out the appropriate ipv6 address ipv6 gurus, please check. Guenther commit e3bdff3d67b46277ee59685218bd90f3788b487d Author: Günther Deschner g...@samba.org Date: Fri May 14 23:23:34 2010 +0200 s3-kerberos: pass down kdc_name to create_local_private_krb5_conf_for_domain(). Guenther --- Summary of changes: source3/include/proto.h|3 +- source3/libads/kerberos.c | 44 +-- source3/libsmb/namequery_dc.c |6 +++- source3/winbindd/winbindd_cm.c |6 +++- 4 files changed, 42 insertions(+), 17 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index 91b6bd9..b633d9e 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1821,7 +1821,8 @@ int kerberos_kinit_password(const char *principal, bool create_local_private_krb5_conf_for_domain(const char *realm, const char *domain, const char *sitename, - struct sockaddr_storage *pss); + struct sockaddr_storage *pss, + const char *kdc_name); /* The following definitions come from libads/kerberos_keytab.c */ diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c index 7fb4ec3..df0ec8e 100644 --- a/source3/libads/kerberos.c +++ b/source3/libads/kerberos.c @@ -715,7 +715,8 @@ int kerberos_kinit_password(const char *principal, static char *print_kdc_line(char *mem_ctx, const char *prev_line, - const struct sockaddr_storage *pss) + const struct sockaddr_storage *pss, + const char *kdc_name) { char *kdc_str = NULL; @@ -727,6 +728,9 @@ static char *print_kdc_line(char *mem_ctx, char addr[INET6_ADDRSTRLEN]; uint16_t port = get_sockaddr_port(pss); + DEBUG(10,(print_kdc_line: IPv6 case for kdc_name: %s, port: %d\n, + kdc_name, port)); + if (port != 0 port != DEFAULT_KRB5_PORT) { /* Currently for IPv6 we can't specify a non-default krb5 port with an address, as this requires a ':'. @@ -743,6 +747,7 @@ static char *print_kdc_line(char *mem_ctx, Error %s\n., print_canonical_sockaddr(mem_ctx, pss), gai_strerror(ret))); + return NULL; } /* Success, use host:port */ kdc_str = talloc_asprintf(mem_ctx, @@ -751,11 +756,22 @@ static char *print_kdc_line(char *mem_ctx, hostname, (unsigned int)port); } else { - kdc_str = talloc_asprintf(mem_ctx, %s\tkdc = %s\n, - prev_line, - print_sockaddr(addr, - sizeof(addr), - pss)); + + /* no krb5 lib currently supports kdc = ipv6 address +* at all, so just fill in just the kdc_name if we have +* it and let the krb5 lib figure out the appropriate +* ipv6 address - gd */ + + if (kdc_name) { + kdc_str = talloc_asprintf(mem_ctx, %s\tkdc = %s\n, + prev_line, kdc_name); + } else { + kdc_str = talloc_asprintf(mem_ctx, %s\tkdc = %s\n, + prev_line, + print_sockaddr(addr, +
[SCM] Samba Shared Repository - branch v3-5-test updated
The branch, v3-5-test has been updated via 813cfd7... WHATSNEW: Add major enhancements in 3.5.3. from ffd5a0f... WHATSNEW: Update changes since 3.5.2. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test - Log - commit 813cfd7cb1f069ea622724e01d4b75b18bfcf482 Author: Karolin Seeger ksee...@samba.org Date: Mon May 17 13:49:42 2010 +0200 WHATSNEW: Add major enhancements in 3.5.3. Karolin --- Summary of changes: WHATSNEW.txt |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) Changeset truncated at 500 lines: diff --git a/WHATSNEW.txt b/WHATSNEW.txt index 231c35d..caec0a0 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -8,7 +8,9 @@ This is the latest stable release of Samba 3.5. Major enhancements in Samba 3.5.3 include: - o + o Fix MS-DFS functionality (bug #7339). + o Fix a Winbind crash when scanning trusts (bug #7389). + o Fix problems with SIGCHLD handling in Winbind (bug #7317). Changes since 3.5.2 -- Samba Shared Repository
[SCM] Samba Shared Repository - branch v3-5-stable updated
The branch, v3-5-stable has been updated via 4ae81a9... WHATSNEW: Add major enhancements in 3.5.3. via b0ed654... WHATSNEW: Update changes since 3.5.2. via 8bbeccb... mount.cifs: check for NULL addr pointer before handling scopeid via 5de0ffa... s3-docs: Unify capitalization. via c7b8f3e... s3-docs: Add documentation of the net g_lock subcommand. via feae5d0... s3-docs: Move -D option to the right paragraph in man winbindd. via a8871c6... work around AIX6.1 name space pollution rename mod_name to module_name via 75c12a4... lib/replace: make sure IPV6_V6ONLY is available for IPv6 support via 1f0f830... lib/replace: add replacement for IPV6_V6ONLY on linux systems with broken headers via fa773cd... tsocket_bsd: Always use a real length for the sa_socklen, and keep it around via 82ee4a2... tsocket: only copy the specific part of sockaddr* via 18717ca... tsocket: allow AF_UNIX sockaddrs smaller than sizeof(sockaddr_un) via 2975e65... s3:configure: use correct SONAMEFLAG on Solaris depending on which linker is being used (cherry picked from commit 358a3855c20153d7fe742ca2e6b9bd8a9c92e525) via 03f4400... s3:configure: not simply check for ld but for the linker used by $CC via b2fe935... s3-net: Fix Bug #7417. 'net rpc user password' can set the wrong password. via a9c442e... s3-spoolss: Fix _spoolss_EnumPrinters servername handling. via 1eb5581... s3-spoolss: in spoolss_EnumPrinters r-in.server is a *unique* pointer! via 6b5ab87... Fix bug #7263 - Unable to print using Samba 3.5.1 and cups-1.1.23-40.46 on SLES10. via 23a8770... s3-rpcclient: Fix Bug #7277. rpcclient was sending invalid data, causing cupsaddsmb to fail. via 753be37... tsocket: Improve the tsocket_address_bsd_sockaddr documentation. via 535b96d... Spelling fixes for tsocket API documentation. via c5f192e... tsocket: Fix the description of tstream_writev_queue_send/recv (cherry picked from commit 88099bcc93fabebe3d4548f8a5aa26b585886a1c) via 309fcce... tsocket: Fix description for tstream_readv_pdu_queue_send/recv (cherry picked from commit 9184f524f0e5fe828b723200182969e0e3e8685d) via ec5d9fa... tsocket: Added complete doxygen documentation. via 2ca53f0... tsocket: Added doxygen config file. via 7f40864... s3: Fix bug 7398 -- rename problems with full_audit (cherry picked from commit a9be37010b465346d5008edc5f8311180ff9e4f4) via 66d9db0... s3/packaging: make rpm build work by overriding strict linker flags (cherry picked from commit 8f74d38c3a4a853f608fed0bed1b55915d01555a) (cherry picked from commit 1c39ce13c551b0fb5ca1569d7be82a34284f7f06) via 8e9e6ed... s3: Fix a winbind crash when scanning trusts via f3868de... Fix bug #7384 - dptr_Close has a bitmap leak. via aa14278... s3-net_conf: Display an error on net conf import failures. via 6c52bb5... s3 torture: Prevent smbcli segfault when running smbtorture3 against an smbd with security=share via 758730f... s3-docs: Improve winbind nss info section in man smb.conf. via e245f46... Fix bug #7288 - SMB job IDs in CUPS job names wrong. via e0fccc3... s3-libsmbclient: Fix incomplete description of function return values in libsmbclient.h. via 4d9210e... libwbclient: Re-Fix a bug that was fixed with e5741e27c4c via c6c4606... s3:winbindd: make smbcontrol winbindd validate-cache reliable again via c0ba225... s3:winbindd: remove unused variables via 853e2a8... s3:winbindd: fix problems with SIGCHLD handling (bug #7317) via 2862e0e... s3-docs: Fix typo in man idmap_ad. via 1915731... s3:lib/time: remove TIME_T_MIN/MAX defines via c107d64... lib/util: move TIME_T_MIN/MAX defines into header file (cherry picked from commit 571ee54b791b93ad46e09ed563ef4a5582dcf0c8) (cherry picked from commit 42d89dbd9407fcdef989387208dd8cae8472a6e8) via ba710ca... Fix bug #7339 - MSDFS is non-functional in 3.5.x from 4edb5b0... WHATSNEW: Start release notes for Samba 3.5.3. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-stable - Log - commit 4ae81a924339aa4fb743b163b3edb4ec8f8c5485 Author: Karolin Seeger ksee...@samba.org Date: Mon May 17 13:49:42 2010 +0200 WHATSNEW: Add major enhancements in 3.5.3. Karolin (cherry picked from commit 813cfd7cb1f069ea622724e01d4b75b18bfcf482) commit b0ed6540463582ac458e0c56c8a377d72142a48c Author: Karolin Seeger ksee...@samba.org Date: Mon May 17 10:21:08 2010 +0200 WHATSNEW: Update changes since 3.5.2. Karolin (cherry picked from commit ffd5a0f90fd43d1e3a995e60acade1a07d8ef1c8) commit 8bbeccb9c35661c5a4d219398889b9f66aed7de7 Author: Jeff Layton jlay...@redhat.com Date: Wed May 12 07:05:10 2010 -0400
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via ed8a98f... s3-includes: remove some unused defines. from dd5a4e2... s3-kerberos: temporary fix for ipv6 in print_kdc_line(). http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit ed8a98f6f4547fed6045a4b6793e9a91edd6597c Author: Günther Deschner g...@samba.org Date: Mon May 17 20:49:31 2010 +0200 s3-includes: remove some unused defines. Guenther --- Summary of changes: source3/include/includes.h |7 --- 1 files changed, 0 insertions(+), 7 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/includes.h b/source3/include/includes.h index ec1ac20..456b64b 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -696,13 +696,6 @@ struct ntlmssp_state; #include lib/smbconf/smbconf_reg.h #include lib/smbconf/smbconf_txt.h -/* Defines for wisXXX functions. */ -#define UNI_UPPER0x1 -#define UNI_LOWER0x2 -#define UNI_DIGIT0x4 -#define UNI_XDIGIT 0x8 -#define UNI_SPACE0x10 - #include nsswitch/winbind_nss.h /* forward declaration from printing.h to get around -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 3d5972c... s3-libgpo: move group policy protos to where they belong. from ed8a98f... s3-includes: remove some unused defines. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 3d5972c43f536b94122100e1e30f92a4f8441768 Author: Günther Deschner g...@samba.org Date: Mon May 10 00:07:10 2010 +0200 s3-libgpo: move group policy protos to where they belong. Guenther --- Summary of changes: libgpo/gpext/gpext.c |4 ++ libgpo/gpo_fetch.c|2 + libgpo/gpo_ldap.c |2 +- libgpo/gpo_sec.c |2 +- libgpo/gpo_util.c |2 +- source3/include/ads_protos.h |1 + source3/include/includes.h|1 - source3/include/proto.h | 78 - source3/libgpo/gpext/registry.c |2 + source3/libgpo/gpext/scripts.c|4 +- source3/libgpo/gpext/security.c |4 +- source3/libgpo/gpo_filesync.c |2 + source3/libgpo/gpo_proto.h| 77 source3/libgpo/gpo_reg.c |2 + source3/registry/reg_backend_db.c |2 +- source3/utils/net_ads_gpo.c |2 + 16 files changed, 102 insertions(+), 85 deletions(-) create mode 100644 source3/libgpo/gpo_proto.h Changeset truncated at 500 lines: diff --git a/libgpo/gpext/gpext.c b/libgpo/gpext/gpext.c index b6cc410..5465774 100644 --- a/libgpo/gpext/gpext.c +++ b/libgpo/gpext/gpext.c @@ -18,9 +18,13 @@ */ #include includes.h +#include ../libgpo/gpo.h #include ../libgpo/gpext/gpext.h #include librpc/gen_ndr/ndr_misc.h #include lib/util/dlinklist.h +#if _SAMBA_BUILD_ == 3 +#include libgpo/gpo_proto.h +#endif static struct gp_extension *extensions = NULL; diff --git a/libgpo/gpo_fetch.c b/libgpo/gpo_fetch.c index 06c730c..2a7cb9d 100644 --- a/libgpo/gpo_fetch.c +++ b/libgpo/gpo_fetch.c @@ -32,6 +32,8 @@ #include libgpo/ads_convenience.h #include libgpo/gpo_s4.h #include lib/util/util.h +#else +#include libgpo/gpo_proto.h #endif / diff --git a/libgpo/gpo_ldap.c b/libgpo/gpo_ldap.c index a884198..2976826 100644 --- a/libgpo/gpo_ldap.c +++ b/libgpo/gpo_ldap.c @@ -18,8 +18,8 @@ */ #include includes.h -#if _SAMBA_BUILD_ == 4 #include libgpo/gpo.h +#if _SAMBA_BUILD_ == 4 #include libgpo/gpo_s4.h #include source4/libgpo/ads_convenience.h #endif diff --git a/libgpo/gpo_sec.c b/libgpo/gpo_sec.c index f207464..6b5e77f 100644 --- a/libgpo/gpo_sec.c +++ b/libgpo/gpo_sec.c @@ -19,12 +19,12 @@ #include includes.h #include libcli/security/dom_sid.h +#include ../libgpo/gpo.h #if _SAMBA_BUILD_ == 4 #include libgpo/ads_convenience.h #include librpc/gen_ndr/security.h #include librpc/gen_ndr/ndr_misc.h #include ../libcli/security/secace.h -#include ../libgpo/gpo.h #endif / diff --git a/libgpo/gpo_util.c b/libgpo/gpo_util.c index fdf4c6d..ef16329 100644 --- a/libgpo/gpo_util.c +++ b/libgpo/gpo_util.c @@ -19,10 +19,10 @@ #define TALLOC_DEPRECATED 1 #include includes.h #include librpc/gen_ndr/ndr_misc.h +#include ../libgpo/gpo.h #if _SAMBA_BUILD_ == 4 #include system/filesys.h #include auth/auth.h -#include ../libgpo/gpo.h #include ../lib/talloc/talloc.h #include source4/libgpo/ads_convenience.h #endif diff --git a/source3/include/ads_protos.h b/source3/include/ads_protos.h index 502eaa8..97b5728 100644 --- a/source3/include/ads_protos.h +++ b/source3/include/ads_protos.h @@ -96,6 +96,7 @@ void ads_process_results(ADS_STRUCT *ads, LDAPMessage *res, void *data_area); void ads_dump(ADS_STRUCT *ads, LDAPMessage *res); +struct GROUP_POLICY_OBJECT; ADS_STATUS ads_parse_gpo(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, LDAPMessage *res, diff --git a/source3/include/includes.h b/source3/include/includes.h index 456b64b..6cbef2e 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -651,7 +651,6 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx); #include mapping.h #include passdb.h #include rpc_secdes.h -#include ../libgpo/gpo.h #include msdfs.h #include ../lib/crypto/md5.h #include ../lib/crypto/md4.h diff --git a/source3/include/proto.h b/source3/include/proto.h index b633d9e..27fa1b5 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -2017,84 +2017,6 @@ ADS_STATUS ads_change_trust_account_password(ADS_STRUCT *ads, char *host_princip ADS_STATUS ads_guess_service_principal(ADS_STRUCT *ads, char **returned_principal); -/* The following definitions come from libgpo/gpo_filesync.c */ - -NTSTATUS gpo_copy_file(TALLOC_CTX
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 2deff34... Refactor the sessionsetup SMB2 code to make it easy to add krb5. Fix a memory leak in returning security blobs. from 3d5972c... s3-libgpo: move group policy protos to where they belong. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 2deff342b949ef7f91134115aa77c4051e2a4c33 Author: Jeremy Allison j...@samba.org Date: Mon May 17 13:05:22 2010 -0700 Refactor the sessionsetup SMB2 code to make it easy to add krb5. Fix a memory leak in returning security blobs. Jeremy --- Summary of changes: source3/smbd/smb2_sesssetup.c | 433 - 1 files changed, 293 insertions(+), 140 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 54f9b0e..4e31952 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -3,6 +3,7 @@ Core SMB2 server Copyright (C) Stefan Metzmacher 2009 + Copyright (C) Jeremy Allison 2010 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,7 +25,7 @@ #include ../libcli/auth/spnego.h #include ntlmssp.h -static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *req, +static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *smb2req, uint64_t in_session_id, uint8_t in_security_mode, DATA_BLOB in_security_buffer, @@ -32,11 +33,11 @@ static NTSTATUS smbd_smb2_session_setup(struct smbd_smb2_request *req, DATA_BLOB *out_security_buffer, uint64_t *out_session_id); -NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *req) +NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *smb2req) { const uint8_t *inhdr; const uint8_t *inbody; - int i = req-current_idx; + int i = smb2req-current_idx; uint8_t *outhdr; DATA_BLOB outbody; DATA_BLOB outdyn; @@ -53,36 +54,36 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *req) DATA_BLOB out_security_buffer; NTSTATUS status; - inhdr = (const uint8_t *)req-in.vector[i+0].iov_base; + inhdr = (const uint8_t *)smb2req-in.vector[i+0].iov_base; - if (req-in.vector[i+1].iov_len != (expected_body_size 0xFFFE)) { - return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); + if (smb2req-in.vector[i+1].iov_len != (expected_body_size 0xFFFE)) { + return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER); } - inbody = (const uint8_t *)req-in.vector[i+1].iov_base; + inbody = (const uint8_t *)smb2req-in.vector[i+1].iov_base; body_size = SVAL(inbody, 0x00); if (body_size != expected_body_size) { - return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); + return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER); } in_security_offset = SVAL(inbody, 0x0C); in_security_length = SVAL(inbody, 0x0E); if (in_security_offset != (SMB2_HDR_BODY + (body_size 0xFFFE))) { - return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); + return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER); } - if (in_security_length req-in.vector[i+2].iov_len) { - return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER); + if (in_security_length smb2req-in.vector[i+2].iov_len) { + return smbd_smb2_request_error(smb2req, NT_STATUS_INVALID_PARAMETER); } in_session_id = BVAL(inhdr, SMB2_HDR_SESSION_ID); in_security_mode = CVAL(inbody, 0x03); - in_security_buffer.data = (uint8_t *)req-in.vector[i+2].iov_base; + in_security_buffer.data = (uint8_t *)smb2req-in.vector[i+2].iov_base; in_security_buffer.length = in_security_length; - status = smbd_smb2_session_setup(req, + status = smbd_smb2_session_setup(smb2req, in_session_id, in_security_mode, in_security_buffer, @@ -92,16 +93,16 @@ NTSTATUS smbd_smb2_request_process_sesssetup(struct smbd_smb2_request *req) if (!NT_STATUS_IS_OK(status) !NT_STATUS_EQUAL(status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { status = nt_status_squash(status); - return smbd_smb2_request_error(req, status);
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via d7d3138... s3-tldap: only include tldap when actually needed. via e16ed33... s3-includes: remove completely unused util_getent.h header. via 1d2dd47... s3-crypto: only include crypto headers when crypto is done. via 26c8449... s3-samr: move samr helper prototypes outside of proto.h via 657fd0b... s3-services: move services.h to where it is actually used. via ca73e03... security: merge builtin rid tables. via 3b529d5... s3-rpc_misc: clean out include/rpc_misc.h. from 2deff34... Refactor the sessionsetup SMB2 code to make it easy to add krb5. Fix a memory leak in returning security blobs. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit d7d313851aed176d1caf7374a87c5ad327cb00a8 Author: Günther Deschner g...@samba.org Date: Tue May 18 00:39:43 2010 +0200 s3-tldap: only include tldap when actually needed. Guenther commit e16ed3399adf1e0fb9f6979677711bb0ab7d0409 Author: Günther Deschner g...@samba.org Date: Tue May 18 00:18:55 2010 +0200 s3-includes: remove completely unused util_getent.h header. Guenther commit 1d2dd47d31e776e5a976069147b33d7c34e5b071 Author: Günther Deschner g...@samba.org Date: Tue May 18 00:16:40 2010 +0200 s3-crypto: only include crypto headers when crypto is done. Guenther commit 26c844902c70ea73f43f8e900344c25fb21e607c Author: Günther Deschner g...@samba.org Date: Mon May 17 23:27:30 2010 +0200 s3-samr: move samr helper prototypes outside of proto.h Guenther commit 657fd0be1d9e878e98ff9eb79d845a5b6f974cd4 Author: Günther Deschner g...@samba.org Date: Mon May 17 23:04:46 2010 +0200 s3-services: move services.h to where it is actually used. Guenther commit ca73e03eb7e8690aef68cfafab36b0b9cc205ab7 Author: Günther Deschner g...@samba.org Date: Mon May 17 23:04:08 2010 +0200 security: merge builtin rid tables. Guenther commit 3b529d50be5613f37cf853714ecf78887df1d01b Author: Günther Deschner g...@samba.org Date: Mon May 17 22:04:24 2010 +0200 s3-rpc_misc: clean out include/rpc_misc.h. Well known rids don't really belong into an rpc header, just use the ones defined in security.idl. Guenther --- Summary of changes: librpc/idl/security.idl | 19 ++ source3/auth/auth_util.c |3 +- source3/auth/server_info.c|1 + source3/auth/token_util.c | 12 +++--- source3/groupdb/mapping.c |2 +- source3/include/includes.h|9 - source3/include/proto.h | 40 - source3/include/rpc_misc.h| 49 - source3/include/util_getent.h | 60 --- source3/lib/tldap.c |1 + source3/lib/tldap_util.c |2 + source3/libsmb/clirap.c |1 + source3/libsmb/ntlmssp.c |3 ++ source3/libsmb/ntlmssp_sign.c |4 ++ source3/libsmb/smb_signing.c |1 + source3/modules/vfs_streams_xattr.c |1 + source3/passdb/passdb.c | 10 +++--- source3/passdb/pdb_ads.c |2 + source3/passdb/pdb_get_set.c |4 +- source3/passdb/pdb_interface.c|6 ++-- source3/passdb/pdb_ldap.c |2 +- source3/passdb/pdb_smbpasswd.c|4 +- source3/passdb/util_builtin.c | 36 +- source3/printing/nt_printing.c| 10 +++--- source3/rpc_client/cli_samr.c |1 + source3/rpc_client/init_netlogon.c|1 + source3/rpc_client/init_samr.c|2 + source3/rpc_server/srv_lsa_nt.c |2 +- source3/rpc_server/srv_netlog_nt.c|1 + source3/rpc_server/srv_samr_nt.c | 12 --- source3/rpc_server/srv_samr_util.c|1 + source3/rpc_server/srv_samr_util.h| 63 + source3/rpc_server/srv_spoolss_util.c |2 +- source3/rpc_server/srv_srvsvc_nt.c|2 +- source3/rpc_server/srv_svcctl_nt.c|1 + source3/rpc_server/srv_wkssvc_nt.c|4 +- source3/services/services_db.c|1 + source3/services/svc_netlogon.c |1 + source3/services/svc_rcinit.c |1 + source3/services/svc_spoolss.c|1 + source3/services/svc_winreg.c |1 + source3/services/svc_wins.c |1 + source3/smbd/chgpasswd.c |1 + source3/utils/net_groupmap.c |4 +- source3/utils/net_sam.c | 10 +++--- source3/utils/ntlm_auth.c |1 + source3/winbindd/winbindd_ads.c |2 +- source3/winbindd/winbindd_pam.c |3 +- source3/winbindd/winbindd_passdb.c|2 +-
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via fe31b67... s3-registry: only include registry headers when really needed. from d7d3138... s3-tldap: only include tldap when actually needed. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit fe31b67d5e9bf5b6c195eddb5f7b42e680a0f36a Author: Günther Deschner g...@samba.org Date: Fri Oct 2 00:17:06 2009 +0200 s3-registry: only include registry headers when really needed. Guenther --- Summary of changes: libgpo/gpext/gpext.c |1 + source3/include/includes.h |2 - source3/include/proto.h| 221 source3/include/reg_objects.h | 36 source3/include/regfio.h |2 + source3/include/registry.h | 188 source3/lib/smbconf/smbconf_reg.c |1 + source3/lib/util_reg_api.c |1 + source3/libads/ldap_printer.c |1 + source3/libgpo/gpext/registry.c|1 + source3/libgpo/gpext/scripts.c |1 + source3/libgpo/gpo_reg.c |1 + source3/printing/nt_printing.c |1 + source3/registry/reg_api.c |1 + source3/registry/reg_backend_current_version.c |1 + source3/registry/reg_backend_db.c |2 + source3/registry/reg_backend_hkpt_params.c |1 + source3/registry/reg_backend_netlogon_params.c |1 + source3/registry/reg_backend_perflib.c |1 + source3/registry/reg_backend_printing.c|1 + source3/registry/reg_backend_prod_options.c|1 + source3/registry/reg_backend_shares.c |1 + source3/registry/reg_backend_smbconf.c |1 + source3/registry/reg_backend_tcpip_params.c|1 + source3/registry/reg_cachehook.c |1 + source3/registry/reg_dispatcher.c |1 + source3/registry/reg_eventlog.c|1 + source3/registry/reg_init_basic.c |1 + source3/registry/reg_init_full.c |1 + source3/registry/reg_init_smbconf.c|1 + source3/registry/reg_objects.c |1 + source3/registry/reg_perfcount.c |1 + source3/registry/reg_util.c|1 + source3/registry/reg_util_legacy.c |1 + source3/registry/regfio.c |1 + source3/rpc_server/srv_eventlog_nt.c |1 + source3/rpc_server/srv_ntsvcs_nt.c |1 + source3/rpc_server/srv_spoolss_nt.c|1 + source3/rpc_server/srv_svcctl_nt.c |1 + source3/rpc_server/srv_winreg_nt.c |1 + source3/rpcclient/cmd_spoolss.c|1 + source3/services/services_db.c |1 + source3/smbd/server.c |1 + source3/utils/eventlogadm.c|1 + source3/utils/net_registry.c |2 +- source3/utils/net_registry_util.c |1 + source3/utils/net_rpc_printer.c|1 + source3/utils/net_rpc_registry.c |2 +- source3/utils/profiles.c |1 + 49 files changed, 271 insertions(+), 225 deletions(-) create mode 100644 source3/include/registry.h Changeset truncated at 500 lines: diff --git a/libgpo/gpext/gpext.c b/libgpo/gpext/gpext.c index 5465774..865a725 100644 --- a/libgpo/gpext/gpext.c +++ b/libgpo/gpext/gpext.c @@ -24,6 +24,7 @@ #include lib/util/dlinklist.h #if _SAMBA_BUILD_ == 3 #include libgpo/gpo_proto.h +#include registry.h #endif static struct gp_extension *extensions = NULL; diff --git a/source3/include/includes.h b/source3/include/includes.h index 07b31c2..20a52e6 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -656,8 +656,6 @@ struct ntlmssp_state; #include auth.h #include ntdomain.h -#include reg_objects.h -#include reg_db.h #include librpc/gen_ndr/ndr_nbt.h #include librpc/rpc/dcerpc.h #include nt_printing.h diff --git a/source3/include/proto.h b/source3/include/proto.h index 8735b9a..53f7654 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -1303,16 +1303,6 @@ bool pull_reg_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, bool pull_reg_multi_sz(TALLOC_CTX *mem_ctx, struct smb_iconv_convenience *ic, const DATA_BLOB *blob, const char ***a); -/* The following definitions come from lib/util_reg_api.c */ - -WERROR registry_pull_value(TALLOC_CTX *mem_ctx, - struct registry_value **pvalue, - enum winreg_Type type, uint8 *data, - uint32 size, uint32
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via e22722a... selftest: Cope with empty testsuite results in more places. via 11ec291... selftest: Cope with testsuites without any output whatsoever (probably an error though). via f7f1a3a... pynet: Remove unused credentials argument. from fe31b67... s3-registry: only include registry headers when really needed. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit e22722ae641a43710380faa3e2ca8395e554deb8 Author: Jelmer Vernooij jel...@samba.org Date: Tue May 18 01:39:17 2010 +0200 selftest: Cope with empty testsuite results in more places. commit 11ec2916a7ba937aa09057a3a6b990bd29476cc4 Author: Jelmer Vernooij jel...@samba.org Date: Tue May 18 00:01:48 2010 +0200 selftest: Cope with testsuites without any output whatsoever (probably an error though). commit f7f1a3a4516528be8722bb416428c8abb4bab652 Author: Jelmer Vernooij jel...@samba.org Date: Sun May 2 20:02:26 2010 +0200 pynet: Remove unused credentials argument. --- Summary of changes: selftest/format-subunit |8 +--- source4/libnet/py_net.c |7 +++ 2 files changed, 8 insertions(+), 7 deletions(-) Changeset truncated at 500 lines: diff --git a/selftest/format-subunit b/selftest/format-subunit index 032b990..b4509ab 100755 --- a/selftest/format-subunit +++ b/selftest/format-subunit @@ -109,7 +109,7 @@ class PlainFormatter(object): if reason is not None: self.output_msg(REASON: %s\n % (reason,)) self.suitesfailed.append(name) -if self.immediate and not self.verbose: +if self.immediate and not self.verbose and name in self.test_output: out += self.test_output[name] unexpected = True @@ -157,7 +157,8 @@ class PlainFormatter(object): for suite in self.suitesfailed: f.write(== %s ==\n % suite) -f.write(self.test_output[suite]+\n\n) +if suite in self.test_output: +f.write(self.test_output[suite]+\n\n) f.write(\n) @@ -165,7 +166,8 @@ class PlainFormatter(object): for suite in self.suitesfailed: print = * 78 print FAIL: %s % suite -print self.test_output[suite] +if suite in self.test_output: +print self.test_output[suite] print f.write(= Skipped tests =\n) diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c index 0592b3f..9b5fa5d 100644 --- a/source4/libnet/py_net.c +++ b/source4/libnet/py_net.c @@ -40,12 +40,11 @@ static PyObject *py_net_join(py_net_Object *self, PyObject *args, PyObject *kwar NTSTATUS status; PyObject *result; TALLOC_CTX *mem_ctx; - PyObject *py_creds; - const char *kwnames[] = { domain_name, netbios_name, join_type, level, credentials, NULL }; + const char *kwnames[] = { domain_name, netbios_name, join_type, level, NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, ssiiO:Join, discard_const_p(char *, kwnames), + if (!PyArg_ParseTupleAndKeywords(args, kwargs, ssii:Join, discard_const_p(char *, kwnames), r.in.domain_name, r.in.netbios_name, -r.in.join_type, r.in.level, py_creds)) +r.in.join_type, r.in.level)) return NULL; mem_ctx = talloc_new(self-mem_ctx); -- Samba Shared Repository
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via b481b8e... Fix the build of bin/smbtorture in source3. Guenther please check ! from e22722a... selftest: Cope with empty testsuite results in more places. http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit b481b8e1f52562d21e060ad321f05c9d3c7ede0d Author: Jeremy Allison j...@samba.org Date: Mon May 17 17:17:44 2010 -0700 Fix the build of bin/smbtorture in source3. Guenther please check ! Jeremy. --- Summary of changes: source3/torture/torture.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/torture/torture.c b/source3/torture/torture.c index b454a7d..72b2296 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -22,6 +22,8 @@ #include nsswitch/libwbclient/wbc_async.h #include torture/proto.h #include libcli/security/dom_sid.h +#include tldap.h +#include tldap_util.h extern char *optarg; extern int optind; -- Samba Shared Repository
[SCM] CTDB repository - branch libctdb updated - ctdb-1.0.114-111-gd61fbb5
The branch, libctdb has been updated via d61fbb5c91b1780208fc24318a2fc7cbeaefebf4 (commit) from b28816fecc7c56a15f6027676c9557283ebc4338 (commit) http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=libctdb - Log - commit d61fbb5c91b1780208fc24318a2fc7cbeaefebf4 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue May 18 11:11:12 2010 +1000 update getpnn to use a generic set_callback call to register the callback on the handle this allows us to have a generic signature for all callbacks instead of different types for each operation. --- Summary of changes: client/ctdb_client.c |2 +- include/ctdb.h | 50 --- libctdb/libctdb.c| 109 - libctdb/tst.c| 51 +-- 4 files changed, 153 insertions(+), 59 deletions(-) Changeset truncated at 500 lines: diff --git a/client/ctdb_client.c b/client/ctdb_client.c index 4d49293..6a19510 100644 --- a/client/ctdb_client.c +++ b/client/ctdb_client.c @@ -1112,7 +1112,7 @@ int ctdb_ctrl_getpnn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t uint32_t pnn; ctdb_handle *handle; - handle = ctdb_getpnn_send(ctdb, destnode, NULL, NULL); + handle = ctdb_getpnn_send(ctdb, destnode); if (handle == NULL) { DEBUG(DEBUG_ERR, (__location__ Failed to send getpnn control\n)); return -1; diff --git a/include/ctdb.h b/include/ctdb.h index d0b9507..980e855 100644 --- a/include/ctdb.h +++ b/include/ctdb.h @@ -23,10 +23,23 @@ /* Functions are not thread safe so all function calls must be wrapped * inside a pthread_mutex for threaded applications. * - * All _send() functions are guaranteed to be non-blocking and fully + * All *_send() functions are guaranteed to be non-blocking and fully * asynchronous. * - * Avoid using the synchronous calls + * The return data from a _send() call can be accessed through two different + * mechanisms. + * + * 1, by calling *_recv() directly on the handle. + *This function will block until the response is received so it + *should be avoided. + *The exception is when called from in the registered callback, + *in this case the fucntion is guaranteed not to block. + * + * 2, Registering an async callback to be invoked when the call completes. + *From inside the callback you use the *_recv() function to extract the + *response data. + * + * After the *_recv() function returns, the handle will have been destroyed. */ /* @@ -65,6 +78,33 @@ typedef void ctdb_handle; /* + * After issuing a *_send() command, you can use this function to register a + * a callback function to be automatically called once the call + * finishes. + * + * Once the callback function returns, the handle will be automatically + * destroyed. + * + * If using ctdb_free() to abort a call in flight, you have to take care + * to avoid the race condition that would exist between the callback and + * ctdb_free(). + * + * Possible method could be : + * * take pthreads mutex + * * ctdb_set_callback(handle, NULL, NULL) + * * verify that the callback has not yet been called + * (if it has handle is no longer valid) + * * ctdb_free(handle) + * * release pthreads mutex + */ +typedef void (*ctdb_callback)(int32_t status, struct ctdb_context *ctdb, ctdb_handle *, void *private_data); + +int ctdb_set_callback(ctdb_handle *handle, ctdb_callback callback, void *private_data); + + + + +/* * functions to attach to a database * if the database does not exist it will be created. * @@ -182,13 +222,9 @@ int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn, uint64_t srvid, T /* * functions to read the pnn number of the local node */ -typedef void (*ctdb_getpnn_cb)(int32_t status, int32_t pnn, void *private_data); - ctdb_handle * ctdb_getpnn_send(struct ctdb_context *ctdb, -uint32_t destnode, -ctdb_getpnn_cb callback, -void *private_data); +uint32_t destnode); int ctdb_getpnn_recv(struct ctdb_context *ctdb, ctdb_handle *handle, uint32_t *pnn); diff --git a/libctdb/libctdb.c b/libctdb/libctdb.c index 02b40ab..a17ad14 100644 --- a/libctdb/libctdb.c +++ b/libctdb/libctdb.c @@ -34,6 +34,73 @@ #include system/filesys.h +struct ctdb_control_cb_data { + void *callback; + void *private_data; + uint32_t db_id; +}; + + +static void +ctdb_control_cb(struct ctdb_client_control_state *state) +{ + struct ctdb_control_cb_data *cb_data = state-async.private_data; + ctdb_callback callback = (ctdb_callback)cb_data-callback; + + /* dont recurse */ + state-async.fn = NULL; + + if (state-state != CTDB_CONTROL_DONE) { +
[SCM] Samba Shared Repository - branch master updated
The branch, master has been updated via 285b628... Plumb in krb5 to the SMB2 sessionsetup code. First cut of this code. from b481b8e... Fix the build of bin/smbtorture in source3. Guenther please check ! http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log - commit 285b62832779f53b135adae4f2c76c424d193cab Author: Jeremy Allison j...@samba.org Date: Mon May 17 18:22:19 2010 -0700 Plumb in krb5 to the SMB2 sessionsetup code. First cut of this code. Jeremy. --- Summary of changes: source3/include/proto.h |1 + source3/smbd/password.c |2 +- source3/smbd/smb2_sesssetup.c | 413 - 3 files changed, 405 insertions(+), 11 deletions(-) Changeset truncated at 500 lines: diff --git a/source3/include/proto.h b/source3/include/proto.h index 53f7654..6099ecf 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6268,6 +6268,7 @@ user_struct *get_partial_auth_user_struct(struct smbd_server_connection *sconn, void invalidate_vuid(struct smbd_server_connection *sconn, uint16 vuid); void invalidate_all_vuids(struct smbd_server_connection *sconn); int register_initial_vuid(struct smbd_server_connection *sconn); +int register_homes_share(const char *username); int register_existing_vuid(struct smbd_server_connection *sconn, uint16 vuid, struct auth_serversupplied_info *server_info, diff --git a/source3/smbd/password.c b/source3/smbd/password.c index 2e63f7a..5cf290c 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -197,7 +197,7 @@ int register_initial_vuid(struct smbd_server_connection *sconn) return vuser-vuid; } -static int register_homes_share(const char *username) +int register_homes_share(const char *username) { int result; struct passwd *pwd; diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c index 4e31952..9662894 100644 --- a/source3/smbd/smb2_sesssetup.c +++ b/source3/smbd/smb2_sesssetup.c @@ -145,17 +145,376 @@ static int smbd_smb2_session_destructor(struct smbd_smb2_session *session) static NTSTATUS smbd_smb2_session_setup_krb5(struct smbd_smb2_session *session, struct smbd_smb2_request *smb2req, - const DATA_BLOB *psecblob_in, - const char *kerb_mech, + uint8_t in_security_mode, + const DATA_BLOB *secblob, + const char *mechOID, uint16_t *out_session_flags, DATA_BLOB *out_security_buffer, uint64_t *out_session_id) { - return NT_STATUS_NOT_IMPLEMENTED; + DATA_BLOB ap_rep = data_blob_null; + DATA_BLOB ap_rep_wrapped = data_blob_null; + DATA_BLOB ticket = data_blob_null; + DATA_BLOB session_key = data_blob_null; + DATA_BLOB secblob_out = data_blob_null; + uint8 tok_id[2]; + struct PAC_LOGON_INFO *logon_info = NULL; + char *client = NULL; + char *p = NULL; + char *domain = NULL; + struct passwd *pw = NULL; + NTSTATUS status; + fstring user; + fstring real_username; + fstring tmp; + bool username_was_mapped = false; + bool map_domainuser_to_guest = false; + struct smbd_server_connection *sconn = smbd_server_conn; + + if (!spnego_parse_krb5_wrap(*secblob, ticket, tok_id)) { + status = NT_STATUS_LOGON_FAILURE; + goto fail; + } + + status = ads_verify_ticket(smb2req, lp_realm(), 0, ticket, + client, logon_info, ap_rep, + session_key, true); + + if (!NT_STATUS_IS_OK(status)) { + DEBUG(1,(smb2: Failed to verify incoming ticket with error %s!\n, + nt_errstr(status))); + if (!NT_STATUS_EQUAL(status, NT_STATUS_TIME_DIFFERENCE_AT_DC)) { + status = NT_STATUS_LOGON_FAILURE; + } + goto fail; + } + + DEBUG(3,(smb2: Ticket name is [%s]\n, client)); + + p = strchr_m(client, '@'); + if (!p) { + DEBUG(3,(smb2: %s Doesn't look like a valid principal\n, + client)); + status = NT_STATUS_LOGON_FAILURE; + goto fail; + } + + *p = 0; + + /* save the PAC data if we have it */ + + if (logon_info) { + netsamlogon_cache_store(client, logon_info-info3); + } + + if (!strequal(p+1, lp_realm())) { + DEBUG(3,(smb2: Ticket for foreign realm %...@%s\n,
[SCM] CTDB repository - branch libctdb updated - ctdb-1.0.114-112-ge9418d9
The branch, libctdb has been updated via e9418d95052490b0d8de98cb4c37b74f25ea8842 (commit) from d61fbb5c91b1780208fc24318a2fc7cbeaefebf4 (commit) http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=libctdb - Log - commit e9418d95052490b0d8de98cb4c37b74f25ea8842 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue May 18 11:24:39 2010 +1000 make the getrecovery master control use the new generic set_callback api and remove the callback argument from the _send() signature Update the example tst.c function to show the three different modes to talk to ctdb --- Summary of changes: include/ctdb.h|4 +-- libctdb/libctdb.c | 36 +++ libctdb/tst.c | 71 ++--- 3 files changed, 72 insertions(+), 39 deletions(-) Changeset truncated at 500 lines: diff --git a/include/ctdb.h b/include/ctdb.h index 980e855..86886e5 100644 --- a/include/ctdb.h +++ b/include/ctdb.h @@ -242,9 +242,7 @@ typedef void (*ctdb_getrecmaster_cb)(int32_t status, int32_t recmaster, void *pr ctdb_handle * ctdb_getrecmaster_send(struct ctdb_context *ctdb, - uint32_t destnode, - ctdb_getrecmaster_cb callback, - void *private_data); + uint32_t destnode); int ctdb_getrecmaster_recv(struct ctdb_context *ctdb, ctdb_handle *handle, uint32_t *recmaster); diff --git a/libctdb/libctdb.c b/libctdb/libctdb.c index a17ad14..e4a5ea6 100644 --- a/libctdb/libctdb.c +++ b/libctdb/libctdb.c @@ -292,29 +292,11 @@ int ctdb_getpnn(struct ctdb_context *ctdb, uint32_t destnode, uint32_t *pnn) /*** * GET RECOVERY MASTER * ***/ -static void -ctdb_getrecmaster_recv_cb(struct ctdb_client_control_state *state) -{ - struct ctdb_control_cb_data *cb_data = state-async.private_data; - ctdb_getrecmaster_cb callback = (ctdb_getrecmaster_cb)cb_data-callback; - - if (state-state != CTDB_CONTROL_DONE) { - DEBUG(DEBUG_ERR, (__location__ ctdb_getrecmaster_recv_cb failed with state:%d\n, state-state)); - callback(-1, 0, cb_data-private_data); - return; - } - - callback(0, state-status, cb_data-private_data); -} - ctdb_handle * ctdb_getrecmaster_send(struct ctdb_context *ctdb, - uint32_t destnode, - ctdb_getrecmaster_cb callback, - void *private_data) + uint32_t destnode) { struct ctdb_client_control_state *state; - struct ctdb_control_cb_data *cb_data; state = ctdb_control_send(ctdb, destnode, 0, CTDB_CONTROL_GET_RECMASTER, 0, tdb_null, @@ -325,15 +307,6 @@ ctdb_getrecmaster_send(struct ctdb_context *ctdb, return NULL; } - if (callback != NULL) { - cb_data = talloc(state, struct ctdb_control_cb_data); - cb_data-callback = callback; - cb_data-private_data = private_data; - - state-async.fn = ctdb_getrecmaster_recv_cb; - state-async.private_data = cb_data; - } - return (ctdb_handle *)state; } @@ -341,16 +314,15 @@ int ctdb_getrecmaster_recv(struct ctdb_context *ctdb, ctdb_handle *handle, uint3 { struct ctdb_client_control_state *state = talloc_get_type(handle, struct ctdb_client_control_state); int ret; - int32_t res; - ret = ctdb_control_recv(ctdb, state, state, NULL, res, NULL); + ret = ctdb_control_recv(ctdb, state, state, NULL, NULL, NULL); if (ret != 0) { DEBUG(DEBUG_ERR,(__location__ ctdb_getrecmaster_recv failed\n)); return -1; } if (recmaster != NULL) { - *recmaster = (uint32_t)res; + *recmaster = (uint32_t)state-status; } return 0; @@ -360,7 +332,7 @@ int ctdb_getrecmaster(struct ctdb_context *ctdb, uint32_t destnode, uint32_t *re { struct ctdb_client_control_state *state; - state = ctdb_getrecmaster_send(ctdb, destnode, NULL, NULL); + state = ctdb_getrecmaster_send(ctdb, destnode); if (state == NULL) { DEBUG(DEBUG_ERR,(__location__ ctdb_getrecmaster_send() failed.\n)); return -1; diff --git a/libctdb/tst.c b/libctdb/tst.c index f8e8f7f..d3db133 100644 --- a/libctdb/tst.c +++ b/libctdb/tst.c @@ -34,11 +34,26 @@ void pnn_cb(int32_t status, struct ctdb_context *ctdb, ctdb_handle *handle, void printf(status:%d pnn:%d\n, status, pnn); } -void rm_cb(int32_t status, int32_t recmaster, void *private_data) +void rm_cb(int32_t status, struct ctdb_context *ctdb,
[SCM] CTDB repository - branch libctdb updated - ctdb-1.0.114-113-g029675b
The branch, libctdb has been updated via 029675b432cb455e466bca723db0dc90fdbf54b5 (commit) from e9418d95052490b0d8de98cb4c37b74f25ea8842 (commit) http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=libctdb - Log - commit 029675b432cb455e466bca723db0dc90fdbf54b5 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue May 18 12:19:12 2010 +1000 Remove ctdb_set_callback() from the public API and provide the callback as part of the *_send() signature. --- Summary of changes: client/ctdb_client.c |2 +- include/ctdb.h | 40 +--- libctdb/libctdb.c| 25 +++-- libctdb/tst.c| 19 --- 4 files changed, 33 insertions(+), 53 deletions(-) Changeset truncated at 500 lines: diff --git a/client/ctdb_client.c b/client/ctdb_client.c index 6a19510..4d49293 100644 --- a/client/ctdb_client.c +++ b/client/ctdb_client.c @@ -1112,7 +1112,7 @@ int ctdb_ctrl_getpnn(struct ctdb_context *ctdb, struct timeval timeout, uint32_t uint32_t pnn; ctdb_handle *handle; - handle = ctdb_getpnn_send(ctdb, destnode); + handle = ctdb_getpnn_send(ctdb, destnode, NULL, NULL); if (handle == NULL) { DEBUG(DEBUG_ERR, (__location__ Failed to send getpnn control\n)); return -1; diff --git a/include/ctdb.h b/include/ctdb.h index 86886e5..6e07a10 100644 --- a/include/ctdb.h +++ b/include/ctdb.h @@ -35,7 +35,7 @@ *The exception is when called from in the registered callback, *in this case the fucntion is guaranteed not to block. * - * 2, Registering an async callback to be invoked when the call completes. + * 2, providing an async callback to be invoked when the call completes. *From inside the callback you use the *_recv() function to extract the *response data. * @@ -77,31 +77,7 @@ int ctdb_service(struct ctdb_context *ctdb); typedef void ctdb_handle; -/* - * After issuing a *_send() command, you can use this function to register a - * a callback function to be automatically called once the call - * finishes. - * - * Once the callback function returns, the handle will be automatically - * destroyed. - * - * If using ctdb_free() to abort a call in flight, you have to take care - * to avoid the race condition that would exist between the callback and - * ctdb_free(). - * - * Possible method could be : - * * take pthreads mutex - * * ctdb_set_callback(handle, NULL, NULL) - * * verify that the callback has not yet been called - * (if it has handle is no longer valid) - * * ctdb_free(handle) - * * release pthreads mutex - */ -typedef void (*ctdb_callback)(int32_t status, struct ctdb_context *ctdb, ctdb_handle *, void *private_data); - -int ctdb_set_callback(ctdb_handle *handle, ctdb_callback callback, void *private_data); - - +typedef void (*ctdb_generic_callback)(int32_t status, struct ctdb_context *ctdb, ctdb_handle *, void *private_data); /* @@ -224,7 +200,9 @@ int ctdb_send_message(struct ctdb_context *ctdb, uint32_t pnn, uint64_t srvid, T */ ctdb_handle * ctdb_getpnn_send(struct ctdb_context *ctdb, -uint32_t destnode); +uint32_t destnode, +ctdb_generic_callback callback, +void *private_data); int ctdb_getpnn_recv(struct ctdb_context *ctdb, ctdb_handle *handle, uint32_t *pnn); @@ -238,11 +216,11 @@ int ctdb_getpnn(struct ctdb_context *ctdb, /* * functions to read the recovery master of a node */ -typedef void (*ctdb_getrecmaster_cb)(int32_t status, int32_t recmaster, void *private_data); - ctdb_handle * ctdb_getrecmaster_send(struct ctdb_context *ctdb, - uint32_t destnode); + uint32_t destnode, + ctdb_generic_callback callback, + void *private_data); int ctdb_getrecmaster_recv(struct ctdb_context *ctdb, ctdb_handle *handle, uint32_t *recmaster); @@ -254,7 +232,7 @@ int ctdb_getrecmaster(struct ctdb_context *ctdb, /* - * cancel a request/call + * cancel a request/call or release a resource */ int ctdb_free(ctdb_handle *); diff --git a/libctdb/libctdb.c b/libctdb/libctdb.c index e4a5ea6..9fe55a9 100644 --- a/libctdb/libctdb.c +++ b/libctdb/libctdb.c @@ -45,7 +45,7 @@ static void ctdb_control_cb(struct ctdb_client_control_state *state) { struct ctdb_control_cb_data *cb_data = state-async.private_data; - ctdb_callback callback = (ctdb_callback)cb_data-callback; + ctdb_generic_callback callback = (ctdb_generic_callback)cb_data-callback; /* dont recurse */ state-async.fn = NULL; @@ -63,7 +63,8 @@ ctdb_control_cb(struct ctdb_client_control_state *state) /* * This function
[SCM] CTDB repository - branch libctdb updated - ctdb-1.0.114-115-gd3a2827
The branch, libctdb has been updated via d3a2827be3277cd1cd3c4d10c2d3035decc2bcfd (commit) via 43dfb4db16f695cdddf55a4b1895597e3395f780 (commit) from 029675b432cb455e466bca723db0dc90fdbf54b5 (commit) http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=libctdb - Log - commit d3a2827be3277cd1cd3c4d10c2d3035decc2bcfd Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue May 18 12:46:00 2010 +1000 move the definition of server/message id port values to the public ctdb.h header change tst.c example to use message id ports from the range reserved for test purposes commit 43dfb4db16f695cdddf55a4b1895597e3395f780 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue May 18 12:41:13 2010 +1000 create macros that define that all server ids for messaging where the top 32 bits are all zero are reserved for samba allocate the prefix 0x0001 for test purposes --- Summary of changes: include/ctdb.h | 93 +++ include/ctdb_protocol.h | 70 --- libctdb/tst.c |6 ++-- 3 files changed, 96 insertions(+), 73 deletions(-) Changeset truncated at 500 lines: diff --git a/include/ctdb.h b/include/ctdb.h index 6e07a10..c9ca36a 100644 --- a/include/ctdb.h +++ b/include/ctdb.h @@ -145,6 +145,99 @@ int ctdb_writerecord(ctdb_handle *handle, /* + Messaging serverid ports +*/ +/* + a message handler ID meaning give me all messages + */ +#define CTDB_SRVID_ALL (~(uint64_t)0) + +/* + The top 32 bits of the server id represents the owner of + this part of the srvid space +*/ +#define CTDB_SRVID_MASK0xLL + + +/* + Samba owns all message handler IDs where the top 32 bits are all zero +*/ +#define CTDB_SRVID_SAMBA 0x +#define CTDB_IS_SAMBA_SRVID((srvid CTDB_SRVID_MASK) == CTDB_SRVID_SAMBA) + +/* + Server ids reserved for testing +*/ +#define CTDB_SRVID_TEST0x0001 +#define CTDB_IS_TEST_SRVID ((srvid CTDB_SRVID_MASK) == CTDB_SRVID_TEST) + +/* + srvid type : RECOVERY +*/ +#define CTDB_SRVID_RECOVERY0xF100LL + +/* + a message handler ID meaning that the cluster has been reconfigured + */ +#define CTDB_SRVID_RECONFIGURE 0xF200LL + +/* + a message handler ID meaning that an IP address has been released + */ +#define CTDB_SRVID_RELEASE_IP 0xF300LL + +/* + a message ID to set the node flags in the recovery daemon + */ +#define CTDB_SRVID_SET_NODE_FLAGS 0xF400LL + +/* + a message ID to ask the recovery daemon to update the expected node + assignment for a public ip + */ +#define CTDB_SRVID_RECD_UPDATE_IP 0xF500LL + +/* + a message to tell the recovery daemon to fetch a set of records + */ +#define CTDB_SRVID_VACUUM_FETCH 0xF700LL + +/* + a message to tell the recovery daemon to write a talloc memdump + to the log + */ +#define CTDB_SRVID_MEM_DUMP 0xF800LL + +/* + a message ID to get the recovery daemon to push the node flags out + */ +#define CTDB_SRVID_PUSH_NODE_FLAGS 0xF900LL + +/* + a message ID to get the recovery daemon to reload the nodes file + */ +#define CTDB_SRVID_RELOAD_NODES 0xFA00LL + +/* + a message ID to get the recovery daemon to perform a takeover run + */ +#define CTDB_SRVID_TAKEOVER_RUN 0xFB00LL + +/* A message id to ask the recovery daemon to temporarily disable the + public ip checks +*/ +#define CTDB_SRVID_DISABLE_IP_CHECK 0xFC00LL + +/* A dummy port used for sending back ipreallocate resposnes to the main + daemon +*/ +#define CTDB_SRVID_TAKEOVER_RUN_RESPONSE 0xFD00LL + +/* A port reserved for samba (top 32 bits) + */ +#define CTDB_SRVID_SAMBA_NOTIFY 0xFE00LL + +/* * messaging functions * these functions provide a messaging layer for applications to communicate * with eachother across diff --git a/include/ctdb_protocol.h b/include/ctdb_protocol.h index 8eda5d4..bb72577 100644 --- a/include/ctdb_protocol.h +++ b/include/ctdb_protocol.h @@ -50,76 +50,6 @@ struct ctdb_call_info { */ #define CTDB_FLAG_TORTURE (11) -/* - a message handler ID meaning give me all messages - */ -#define CTDB_SRVID_ALL (~(uint64_t)0) - -/* - srvid type : RECOVERY -*/ -#define CTDB_SRVID_RECOVERY0xF100LL - -/* - a message handler ID meaning that the cluster has been reconfigured - */ -#define CTDB_SRVID_RECONFIGURE 0xF200LL - -/* - a message handler ID meaning that an IP address has been released - */ -#define CTDB_SRVID_RELEASE_IP 0xF300LL - -/* - a message ID to set the node flags in the recovery daemon - */ -#define CTDB_SRVID_SET_NODE_FLAGS 0xF400LL - -/* - a
[SCM] CTDB repository - branch libctdb updated - ctdb-1.0.114-116-g90fb6ca
The branch, libctdb has been updated via 90fb6caf1706454d8ec94f8022e61beb93a93f51 (commit) from d3a2827be3277cd1cd3c4d10c2d3035decc2bcfd (commit) http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=libctdb - Log - commit 90fb6caf1706454d8ec94f8022e61beb93a93f51 Author: Ronnie Sahlberg ronniesahlb...@gmail.com Date: Tue May 18 12:48:12 2010 +1000 add a missing argument to the macros to test for samba/test owner for a particular server id --- Summary of changes: include/ctdb.h |8 1 files changed, 4 insertions(+), 4 deletions(-) Changeset truncated at 500 lines: diff --git a/include/ctdb.h b/include/ctdb.h index c9ca36a..dc24499 100644 --- a/include/ctdb.h +++ b/include/ctdb.h @@ -162,14 +162,14 @@ int ctdb_writerecord(ctdb_handle *handle, /* Samba owns all message handler IDs where the top 32 bits are all zero */ -#define CTDB_SRVID_SAMBA 0x -#define CTDB_IS_SAMBA_SRVID((srvid CTDB_SRVID_MASK) == CTDB_SRVID_SAMBA) +#define CTDB_SRVID_SAMBA 0x +#define CTDB_IS_SAMBA_SRVID(srvid) ((srvid CTDB_SRVID_MASK) == CTDB_SRVID_SAMBA) /* Server ids reserved for testing */ -#define CTDB_SRVID_TEST0x0001 -#define CTDB_IS_TEST_SRVID ((srvid CTDB_SRVID_MASK) == CTDB_SRVID_TEST) +#define CTDB_SRVID_TEST0x0001 +#define CTDB_IS_TEST_SRVID(srvid) ((srvid CTDB_SRVID_MASK) == CTDB_SRVID_TEST) /* srvid type : RECOVERY -- CTDB repository