From 60002600b86808551df0fb9b907869590b670450 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Mon, 30 Aug 2010 18:54:42 +0200 Subject: [PATCH 01/16] s4/ldb: use monotonic clock for time deltas in ldbtest --- source4/lib/ldb/tools/ldbtest.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source4/lib/ldb/tools/ldbtest.c b/source4/lib/ldb/tools/ldbtest.c index b76889c61fb..a885b80c726 100644 --- a/source4/lib/ldb/tools/ldbtest.c +++ b/source4/lib/ldb/tools/ldbtest.c @@ -40,19 +40,19 @@ #include "ldb.h" #include "tools/cmdline.h" -static struct timeval tp1,tp2; +static struct timespec tp1,tp2; static struct ldb_cmdline *options; static void _start_timer(void) { - gettimeofday(&tp1,NULL); + clock_gettime_mono(&tp1); } static double _end_timer(void) { - gettimeofday(&tp2,NULL); + clock_gettime_mono(&tp2); return((tp2.tv_sec - tp1.tv_sec) + - (tp2.tv_usec - tp1.tv_usec)*1.0e-6); + (tp2.tv_nsec - tp1.tv_nsec)*1.0e-9); } static void add_records(struct ldb_context *ldb, -- 2.11.4.GIT From 4c8531b642c579e69c27a8920c1aacbee04260c9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Mon, 30 Aug 2010 18:58:20 +0200 Subject: [PATCH 02/16] s4/torture: use monotonic clock for time deltas in denytest --- source4/torture/basic/denytest.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/source4/torture/basic/denytest.c b/source4/torture/basic/denytest.c index 174a1b2d6cb..7480c388ae2 100644 --- a/source4/torture/basic/denytest.c +++ b/source4/torture/basic/denytest.c @@ -1416,7 +1416,7 @@ bool torture_denytest1(struct torture_context *tctx, int fnum1, fnum2; int i; bool correct = true; - struct timeval tv, tv_start; + struct timespec tv, tv_start; const char *fnames[2] = {"\\denytest1.dat", "\\denytest1.exe"}; int failures=0; @@ -1431,7 +1431,7 @@ bool torture_denytest1(struct torture_context *tctx, torture_comment(tctx, "Testing %d entries\n", (int)ARRAY_SIZE(denytable1)); - GetTimeOfDay(&tv_start); + clock_gettime_mono(&tv_start); for (i=0; itree, fnum1); } - GetTimeOfDay(&tv_start); + clock_gettime_mono(&tv_start); for (i=0; itree, fnum1, 0, buf, 0, sizeof(buf)); smbcli_close(cli1->tree, fnum1); - GetTimeOfDay(&tv_start); + clock_gettime_mono(&tv_start); io1.ntcreatex.level = RAW_OPEN_NTCREATEX; io1.ntcreatex.in.root_fid.fnum = 0; @@ -1871,9 +1871,9 @@ static bool torture_ntdenytest(struct torture_context *tctx, read_for_execute, &res2); - GetTimeOfDay(&tv); - tdif = usec_time_diff(&tv, &tv_start); - tdif /= 1000; + clock_gettime_mono(&tv); + tdif = nsec_time_diff(&tv, &tv_start); + tdif /= 1000000; if (torture_setting_bool(tctx, "showall", false) || !NT_STATUS_EQUAL(status2, status2_p) || res != res2) { -- 2.11.4.GIT From 7eff519703f15d123c9b256a674b1c6ad8c84446 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 31 Aug 2010 03:29:55 -0600 Subject: [PATCH 03/16] packaging: build fixes --- packaging/RHEL-CTDB/samba.spec.tmpl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packaging/RHEL-CTDB/samba.spec.tmpl b/packaging/RHEL-CTDB/samba.spec.tmpl index 6199dff974b..00f85af1803 100644 --- a/packaging/RHEL-CTDB/samba.spec.tmpl +++ b/packaging/RHEL-CTDB/samba.spec.tmpl @@ -15,7 +15,7 @@ URL: http://www.samba.org/ Source: samba-%{version}.tar.bz2 # Don't depend on Net::LDAP -Source997: docs.tar.bz2 +Source997: docs-3.6.tar.bz2 Source998: filter-requires-samba.sh Source999: setup.tar.bz2 @@ -471,6 +471,8 @@ exit 0 %{_libarchdir}/samba/vfs/aio_fork.so %{_libarchdir}/samba/vfs/audit.so %{_libarchdir}/samba/vfs/cap.so +%{_libarchdir}/samba/vfs/catia.so +%{_libarchdir}/samba/vfs/crossrename.so %{_libarchdir}/samba/vfs/default_quota.so %{_libarchdir}/samba/vfs/dirsort.so %{_libarchdir}/samba/vfs/expand_msdfs.so @@ -479,11 +481,13 @@ exit 0 %{_libarchdir}/samba/vfs/fileid.so %{_libarchdir}/samba/vfs/full_audit.so %{_libarchdir}/samba/vfs/gpfs.so +%{_libarchdir}/samba/vfs/linux_xfs_sgid.so %{_libarchdir}/samba/vfs/netatalk.so %{_libarchdir}/samba/vfs/preopen.so %{_libarchdir}/samba/vfs/readahead.so %{_libarchdir}/samba/vfs/readonly.so %{_libarchdir}/samba/vfs/recycle.so +%{_libarchdir}/samba/vfs/scannedonly.so %{_libarchdir}/samba/vfs/shadow_copy.so %{_libarchdir}/samba/vfs/shadow_copy2.so %{_libarchdir}/samba/vfs/smb_traffic_analyzer.so @@ -546,6 +550,7 @@ exit 0 %{_bindir}/smbtar %{_bindir}/smbtree %{_bindir}/sharesec +%{_bindir}/smbta-util %{_mandir}/man8/smbspool.8* %{_mandir}/man1/smbget.1* @@ -575,6 +580,7 @@ exit 0 %attr(755,root,root) /%{_libarch}/security/pam_winbind.so %attr(755,root,root) /%{_libarch}/security/pam_smbpass.so /usr/share/locale/*/LC_MESSAGES/pam_winbind.mo +/usr/share/locale/*/LC_MESSAGES/net.mo %{_libarchdir}/samba/charset/CP437.so %{_libarchdir}/samba/charset/CP850.so @@ -601,7 +607,7 @@ exit 0 %{_libarchdir}/libnetapi.so %{_libarchdir}/libnetapi.so.0 %{_libarchdir}/libtalloc.so -%{_libarchdir}/libtalloc.so.1 +%{_libarchdir}/libtalloc.so.2 %{_libarchdir}/libtdb.so %{_libarchdir}/libtdb.so.1 %{_libarchdir}/libwbclient.so @@ -616,12 +622,6 @@ exit 0 %{_bindir}/smbpasswd %{_bindir}/profiles %{_bindir}/net -%{_bindir}/ldbadd -%{_bindir}/ldbdel -%{_bindir}/ldbedit -%{_bindir}/ldbmodify -%{_bindir}/ldbsearch -%{_bindir}/ldbrename %{_bindir}/wbinfo %{_bindir}/ntlm_auth %{_bindir}/pdbedit @@ -655,7 +655,7 @@ exit 0 %attr(755,root,root) /lib/libnss_winbind.so %attr(755,root,root) /lib/libnss_winbind.so.2 %attr(755,root,root) /usr/lib/libtalloc.so -%attr(755,root,root) /usr/lib/libtalloc.so.1 +%attr(755,root,root) /usr/lib/libtalloc.so.2 %attr(755,root,root) /usr/lib/libtdb.so %attr(755,root,root) /usr/lib/libtdb.so.1 %attr(755,root,root) /usr/lib/libwbclient.so -- 2.11.4.GIT From f222387533645689b8529235d5e6c77418064f9e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 31 Aug 2010 11:30:17 +0200 Subject: [PATCH 04/16] s4: use GetTimeOfDay macro instead of gettimeofday --- source4/torture/libnet/userman.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source4/torture/libnet/userman.c b/source4/torture/libnet/userman.c index 13fc98dd48c..ad4fa92f8cd 100644 --- a/source4/torture/libnet/userman.c +++ b/source4/torture/libnet/userman.c @@ -115,7 +115,7 @@ static bool test_usermod(struct torture_context *tctx, struct dcerpc_pipe *p, testfld = (random() % USER_FIELD_LAST) + 1; - gettimeofday(&now, NULL); + GetTimeOfDay(&now); switch (testfld) { case acct_name: -- 2.11.4.GIT From 7c88ccde30b824e14183f7fd07f0c307c7ff693d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 31 Aug 2010 11:31:19 +0200 Subject: [PATCH 05/16] replace/waf: add rt to deps at this place --- lib/replace/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/replace/wscript b/lib/replace/wscript index 8c1c57f12cb..35e376a05d6 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -364,7 +364,7 @@ def build(bld): # libraries are loaded, but this doesn't appear to work # at the moment: # hide_symbols=bld.BUILTIN_LIBRARY('replace'), - deps='crypt dl nsl socket') + deps='crypt dl nsl socket rt') TEST_SOURCES = '''test/testsuite.c test/main.c test/strptime.c test/os2_delete.c test/getifaddrs.c''' -- 2.11.4.GIT From 20254221d2c935ebcf2c4ea4372b1634bd09b1f0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 31 Aug 2010 13:06:39 +0200 Subject: [PATCH 06/16] tdb/waf: the deps for rt are provided by libreplace --- lib/tdb/wscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tdb/wscript b/lib/tdb/wscript index 2fdd67f2516..3dfb5abba43 100644 --- a/lib/tdb/wscript +++ b/lib/tdb/wscript @@ -63,7 +63,7 @@ def build(bld): if not bld.CONFIG_SET('USING_SYSTEM_TDB'): bld.SAMBA_LIBRARY('tdb', COMMON_SRC, - deps='replace rt', + deps='replace', includes='include', abi_file='ABI/tdb-%s.sigs' % VERSION, abi_match='tdb_*', -- 2.11.4.GIT From b4ae2efa963649c46fa4a3e3ad054c691f38af5b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 31 Aug 2010 13:10:45 +0200 Subject: [PATCH 07/16] s3: use monotonic clock for time deltas in smbget --- source3/utils/smbget.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c index 62ecb34c9e1..85bbd245a6d 100644 --- a/source3/utils/smbget.c +++ b/source3/utils/smbget.c @@ -276,7 +276,7 @@ static int smb_download_file(const char *base, const char *name, int recursive, int resume, int toplevel, char *outfile) { int remotehandle, localhandle; - time_t start_time = time(NULL); + struct timespec start_time, now; const char *newpath; char path[SMB_MAXPATHLEN]; char checkbuf[2][RESUME_CHECK_SIZE]; @@ -284,6 +284,7 @@ static int smb_download_file(const char *base, const char *name, int recursive, off_t offset_download = 0, offset_check = 0, curpos = 0, start_offset = 0; struct stat localstat, remotestat; + clock_gettime_mono(&start_time); snprintf(path, SMB_MAXPATHLEN-1, "%s%s%s", base, (*base && *name && name[0] != '/' && base[strlen(base)-1] != '/')?"/":"", name); remotehandle = smbc_open(path, O_RDONLY, 0755); @@ -466,7 +467,9 @@ static int smb_download_file(const char *base, const char *name, int recursive, if(dots)fputc('.', stderr); else if(!quiet) { - print_progress(newpath, start_time, time(NULL), start_offset, curpos, remotestat.st_size); + clock_gettime_mono(&now); + print_progress(newpath, start_time.tv_sec, now.tv_sec, + start_offset, curpos, remotestat.st_size); } } -- 2.11.4.GIT From 659829851703797b47d398d3c71ad971b2c5dab7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Tue, 31 Aug 2010 13:11:13 +0200 Subject: [PATCH 08/16] s4/heimdal_build: use GetTimeOfDay macro instead of gettimeofday --- source4/heimdal_build/roken.h | 1 + 1 file changed, 1 insertion(+) diff --git a/source4/heimdal_build/roken.h b/source4/heimdal_build/roken.h index 50da1daa547..e44810dd2dc 100644 --- a/source4/heimdal_build/roken.h +++ b/source4/heimdal_build/roken.h @@ -118,6 +118,7 @@ #ifndef HAVE_GETTIMEOFDAY #define HAVE_GETTIMEOFDAY #endif +#define gettimeofday(a,b) GetTimeOfDay(a) #ifndef HAVE_SETEGID #define HAVE_SETEGID -- 2.11.4.GIT From 079baa76884a90740051f8dd0408eea4404adce8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Jacke?= Date: Wed, 12 May 2010 10:50:17 +0200 Subject: [PATCH 09/16] s3: use fine grained time in netprot response --- source3/smbd/negprot.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c index 2908c2613e2..463e1c80836 100644 --- a/source3/smbd/negprot.c +++ b/source3/smbd/negprot.c @@ -267,7 +267,7 @@ static void reply_nt1(struct smb_request *req, uint16 choice) int secword=0; char *p, *q; bool negotiate_spnego = False; - time_t t = time(NULL); + struct timespec ts; ssize_t ret; struct smbd_server_connection *sconn = req->sconn; @@ -359,8 +359,9 @@ static void reply_nt1(struct smb_request *req, uint16 choice) SIVAL(req->outbuf,smb_vwv5+1,0x10000); /* raw size. full 64k */ SIVAL(req->outbuf,smb_vwv7+1,sys_getpid()); /* session key */ SIVAL(req->outbuf,smb_vwv9+1,capabilities); /* capabilities */ - put_long_date((char *)req->outbuf+smb_vwv11+1,t); - SSVALS(req->outbuf,smb_vwv15+1,set_server_zone_offset(t)/60); + clock_gettime(CLOCK_REALTIME,&ts); + put_long_date_timespec(TIMESTAMP_SET_NT_OR_BETTER,(char *)req->outbuf+smb_vwv11+1,ts); + SSVALS(req->outbuf,smb_vwv15+1,set_server_zone_offset(ts.tv_sec)/60); p = q = smb_buf(req->outbuf); if (!negotiate_spnego) { -- 2.11.4.GIT From 301bf22eab92999bc4b0f2d733830618b8b9d428 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 31 Aug 2010 16:11:10 +0200 Subject: [PATCH 10/16] s3: Make ctdbd_init_connection static --- source3/include/ctdbd_conn.h | 2 -- source3/lib/ctdbd_conn.c | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/source3/include/ctdbd_conn.h b/source3/include/ctdbd_conn.h index c5ba5724cd4..80cf717499b 100644 --- a/source3/include/ctdbd_conn.h +++ b/source3/include/ctdbd_conn.h @@ -22,8 +22,6 @@ struct ctdbd_connection; -NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, - struct ctdbd_connection **pconn); NTSTATUS ctdbd_messaging_connection(TALLOC_CTX *mem_ctx, struct ctdbd_connection **pconn); diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 8dba3b2d770..afc13f20c5c 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -433,8 +433,8 @@ static NTSTATUS ctdb_read_req(struct ctdbd_connection *conn, uint32 reqid, * Get us a ctdbd connection */ -NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, - struct ctdbd_connection **pconn) +static NTSTATUS ctdbd_init_connection(TALLOC_CTX *mem_ctx, + struct ctdbd_connection **pconn) { struct ctdbd_connection *conn; NTSTATUS status; -- 2.11.4.GIT From 808ceac9f54bb3988fc2bb6b0d86eaded07283e1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 31 Aug 2010 16:51:28 +0200 Subject: [PATCH 11/16] s3: messaging_ctdbd_init potentially modifies my_vnn If we call messaging_ctdbd_connection() we end up with the wrong vnn in our messaging context. This is a bit of a hack, get_my_vnn() needs to go eventually along with procid_self() --- source3/lib/messages.c | 1 + 1 file changed, 1 insertion(+) diff --git a/source3/lib/messages.c b/source3/lib/messages.c index af83cee6d82..11dc931f0f3 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -211,6 +211,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, return NULL; } } + ctx->id.vnn = get_my_vnn(); #endif messaging_register(ctx, NULL, MSG_PING, ping_message); -- 2.11.4.GIT From 5648c3f67eeebee0a17cf9e7b64fb2cbfe2e2e68 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 31 Aug 2010 16:52:56 +0200 Subject: [PATCH 12/16] s3: messaging_ctdbd_connection() was only called with procid_self() Eventually we'll get this right... --- source3/include/messages.h | 2 +- source3/lib/dbwrap_ctdb.c | 13 ++++++------- source3/lib/g_lock.c | 11 +++-------- source3/lib/messages_ctdbd.c | 4 ++-- source3/lib/util.c | 2 +- source3/smbd/process.c | 2 +- source3/smbd/server.c | 3 +-- 7 files changed, 15 insertions(+), 22 deletions(-) diff --git a/source3/include/messages.h b/source3/include/messages.h index a64469e0690..bf5e5de26c3 100644 --- a/source3/include/messages.h +++ b/source3/include/messages.h @@ -116,7 +116,7 @@ bool messaging_tdb_parent_init(void); NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx, TALLOC_CTX *mem_ctx, struct messaging_backend **presult); -struct ctdbd_connection *messaging_ctdbd_connection(struct server_id id); +struct ctdbd_connection *messaging_ctdbd_connection(void); bool message_send_all(struct messaging_context *msg_ctx, int msg_type, diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c index ceaadd22569..67425dcb790 100644 --- a/source3/lib/dbwrap_ctdb.c +++ b/source3/lib/dbwrap_ctdb.c @@ -794,7 +794,7 @@ static int db_ctdb_transaction_commit(struct db_context *db) again: /* tell ctdbd to commit to the other nodes */ - rets = ctdbd_control_local(messaging_ctdbd_connection(procid_self()), + rets = ctdbd_control_local(messaging_ctdbd_connection(), CTDB_CONTROL_TRANS3_COMMIT, h->ctx->db_id, 0, db_ctdb_marshall_finish(h->m_write), @@ -1005,9 +1005,8 @@ again: ((struct ctdb_ltdb_header *)ctdb_data.dptr)->dmaster : -1, get_my_vnn())); - status = ctdbd_migrate( - messaging_ctdbd_connection(procid_self()), ctx->db_id, - key); + status = ctdbd_migrate(messaging_ctdbd_connection(), ctx->db_id, + key); if (!NT_STATUS_IS_OK(status)) { DEBUG(5, ("ctdb_migrate failed: %s\n", nt_errstr(status))); @@ -1112,8 +1111,8 @@ static int db_ctdb_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, SAFE_FREE(ctdb_data.dptr); /* we weren't able to get it locally - ask ctdb to fetch it for us */ - status = ctdbd_fetch(messaging_ctdbd_connection(procid_self()), - ctx->db_id, key, mem_ctx, data); + status = ctdbd_fetch(messaging_ctdbd_connection(), ctx->db_id, key, + mem_ctx, data); if (!NT_STATUS_IS_OK(status)) { DEBUG(5, ("ctdbd_fetch failed: %s\n", nt_errstr(status))); return -1; @@ -1291,7 +1290,7 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx, db_ctdb->transaction = NULL; db_ctdb->db = result; - conn = messaging_ctdbd_connection(procid_self()); + conn = messaging_ctdbd_connection(); if (conn == NULL) { DEBUG(1, ("Could not connect to ctdb\n")); TALLOC_FREE(result); diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c index 42bf3b09162..6e4c6d796c7 100644 --- a/source3/lib/g_lock.c +++ b/source3/lib/g_lock.c @@ -312,8 +312,7 @@ NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name, #ifdef CLUSTER_SUPPORT if (lp_clustering()) { - struct server_id my_id = messaging_server_id(ctx->msg); - status = ctdb_watch_us(messaging_ctdbd_connection(my_id)); + status = ctdb_watch_us(messaging_ctdbd_connection()); if (!NT_STATUS_IS_OK(status)) { DEBUG(10, ("could not register retry with ctdb: %s\n", nt_errstr(status))); @@ -388,11 +387,8 @@ NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name, #ifdef CLUSTER_SUPPORT if (lp_clustering()) { - struct server_id my_id; struct ctdbd_connection *conn; - - my_id = messaging_server_id(ctx->msg); - conn = messaging_ctdbd_connection(my_id); + conn = messaging_ctdbd_connection(); r_fds = &_r_fds; FD_ZERO(r_fds); @@ -597,8 +593,7 @@ NTSTATUS g_lock_unlock(struct g_lock_ctx *ctx, const char *name) #ifdef CLUSTER_SUPPORT if (lp_clustering()) { - struct server_id my_id = messaging_server_id(ctx->msg); - ctdb_unwatch(messaging_ctdbd_connection(my_id)); + ctdb_unwatch(messaging_ctdbd_connection()); } #endif return status; diff --git a/source3/lib/messages_ctdbd.c b/source3/lib/messages_ctdbd.c index 9b8fafe8d45..871334649db 100644 --- a/source3/lib/messages_ctdbd.c +++ b/source3/lib/messages_ctdbd.c @@ -38,7 +38,7 @@ struct messaging_ctdbd_context { static struct ctdbd_connection *global_ctdbd_connection; static int global_ctdb_connection_pid; -struct ctdbd_connection *messaging_ctdbd_connection(struct server_id id) +struct ctdbd_connection *messaging_ctdbd_connection(void) { if (global_ctdb_connection_pid == 0 && global_ctdbd_connection == NULL) { @@ -50,7 +50,7 @@ struct ctdbd_connection *messaging_ctdbd_connection(struct server_id id) DEBUG(0,("event_context_init failed\n")); } - msg = messaging_init(NULL, id, ev); + msg = messaging_init(NULL, procid_self(), ev); if (!msg) { DEBUG(0,("messaging_init failed\n")); return NULL; diff --git a/source3/lib/util.c b/source3/lib/util.c index 644f1830c6f..315f3897d6f 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1296,7 +1296,7 @@ bool process_exists(const struct server_id pid) } #ifdef CLUSTER_SUPPORT - return ctdbd_process_exists(messaging_ctdbd_connection(procid_self()), + return ctdbd_process_exists(messaging_ctdbd_connection(), pid.vnn, pid.pid); #else return False; diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 6beed4fb3fc..4d34bcf8581 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -2899,7 +2899,7 @@ static NTSTATUS smbd_register_ips(struct smbd_server_connection *sconn, char tmp_addr[INET6_ADDRSTRLEN]; char *addr; - cconn = messaging_ctdbd_connection(procid_self()); + cconn = messaging_ctdbd_connection(); if (cconn == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/smbd/server.c b/source3/smbd/server.c index aa0f7e85abe..c9ae742b990 100644 --- a/source3/smbd/server.c +++ b/source3/smbd/server.c @@ -729,8 +729,7 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent, #ifdef CLUSTER_SUPPORT if (lp_clustering()) { - ctdbd_register_reconfigure( - messaging_ctdbd_connection(procid_self())); + ctdbd_register_reconfigure(messaging_ctdbd_connection()); } #endif -- 2.11.4.GIT From 3ed1677f5ca6e3f0ff5ff338141ff1ddd2ffae0e Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Tue, 31 Aug 2010 18:23:16 +0200 Subject: [PATCH 13/16] This line should have been removed --- buildtools/wafsamba/wscript | 1 - 1 file changed, 1 deletion(-) diff --git a/buildtools/wafsamba/wscript b/buildtools/wafsamba/wscript index e2b1a278dde..311903e4998 100644 --- a/buildtools/wafsamba/wscript +++ b/buildtools/wafsamba/wscript @@ -319,5 +319,4 @@ def build(bld): bld.CHECK_MAKEFLAGS() bld.SETUP_BUILD_GROUPS() - bld.ENFORCE_GROUP_ORDERING() bld.CHECK_PROJECT_RULES() -- 2.11.4.GIT From 1e1a2a5dc5c945a72a1d9e4c8db6011cadbcd500 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Tue, 31 Aug 2010 19:05:26 +0200 Subject: [PATCH 14/16] fix to get it compiling --- source4/heimdal/lib/krb5/time.c | 2 ++ source4/heimdal/lib/krb5/v4_glue.c | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/source4/heimdal/lib/krb5/time.c b/source4/heimdal/lib/krb5/time.c index 247549ba237..7ea711856b0 100644 --- a/source4/heimdal/lib/krb5/time.c +++ b/source4/heimdal/lib/krb5/time.c @@ -33,6 +33,8 @@ #include "krb5_locl.h" +#include "../lib/util/time.h" + /** * Set the absolute time that the caller knows the kdc has so the * kerberos library can calculate the relative diffrence beteen the diff --git a/source4/heimdal/lib/krb5/v4_glue.c b/source4/heimdal/lib/krb5/v4_glue.c index 01cf323d37b..d3a21eace68 100644 --- a/source4/heimdal/lib/krb5/v4_glue.c +++ b/source4/heimdal/lib/krb5/v4_glue.c @@ -31,7 +31,12 @@ * SUCH DAMAGE. */ +#ifndef V4_GLUE_H +#define V4_GLUE_H + +#include #include "krb5_locl.h" +#include "../lib/util/time.h" #include "krb5-v4compat.h" @@ -958,3 +963,6 @@ _krb5_krb_free_auth_data(krb5_context context, struct _krb5_krb_auth_data *ad) } #endif /* HEIMDAL_SMALLER */ + +#endif /* V4_GLUE_H */ + -- 2.11.4.GIT From 074a0d6e4a3fe92d6094043b94d0b5c5ed92dae4 Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Tue, 31 Aug 2010 19:11:13 +0200 Subject: [PATCH 15/16] let krb5/time.c compile git add will not take the changes made afterwards --- source4/heimdal/lib/krb5/time.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source4/heimdal/lib/krb5/time.c b/source4/heimdal/lib/krb5/time.c index 7ea711856b0..3a35e74e26e 100644 --- a/source4/heimdal/lib/krb5/time.c +++ b/source4/heimdal/lib/krb5/time.c @@ -31,8 +31,11 @@ * SUCH DAMAGE. */ -#include "krb5_locl.h" +#ifndef KRB5_TIME_H +#define KRB5_TIME_H +#include +#include "krb5_locl.h" #include "../lib/util/time.h" /** @@ -129,3 +132,6 @@ krb5_string_to_deltat(const char *string, krb5_deltat *deltat) return KRB5_DELTAT_BADFORMAT; return 0; } + +#endif /* KRB5_TIME_H */ + -- 2.11.4.GIT From 436d0b5b24413684964b1a005a21b8de0889facd Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Tue, 31 Aug 2010 19:40:25 +0200 Subject: [PATCH 16/16] Build error exception lost (without wafcache) When no WAFCACHE is defined, a return in the finally block eats the exception, making the error potentially invisible. --- buildtools/wafsamba/samba_throttle.py | 82 +++++++++++++++++------------------ 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/buildtools/wafsamba/samba_throttle.py b/buildtools/wafsamba/samba_throttle.py index 3f44200e498..b7b45660302 100644 --- a/buildtools/wafsamba/samba_throttle.py +++ b/buildtools/wafsamba/samba_throttle.py @@ -33,48 +33,46 @@ def compile(self): old(self) finally: - if not Options.cache_global or Options.options.nocache: - return - - CACHESIZE = 2000 # 2GB +-300Mb should be enough - val = re_num.sub('\\1', os.path.basename(Options.cache_global)) - try: - CACHESIZE = int(val) - except: - pass - - for x in range(5): - - # loop in case another process is still filling up the cache - s = dsize(Options.cache_global) - if s < CACHESIZE: - break - - lst = [Options.cache_global + os.sep + x for x in Utils.listdir(Options.cache_global)] - - acc = [] - for x in lst: - try: - acc.append((x, os.path.getctime(x), dsize(x))) - except: - pass - - # sort the files by the oldest first - acc.sort(cmp=cmp2) - - tot = sum([x[2] for x in acc]) - cur = 0 - - # remove at least 10% more, just to make sure - while tot - cur > 0.9 * CACHESIZE: - x = acc.pop(0) - cur += x[2] - - # ignore if the folders cannot be removed - try: - shutil.rmtree(x[0]) - except: - pass + if Options.cache_global and not Options.options.nocache: + CACHESIZE = 2000 # 2GB +-300Mb should be enough + val = re_num.sub('\\1', os.path.basename(Options.cache_global)) + try: + CACHESIZE = int(val) + except: + pass + + for x in range(5): + + # loop in case another process is still filling up the cache + s = dsize(Options.cache_global) + if s < CACHESIZE: + break + + lst = [Options.cache_global + os.sep + x for x in Utils.listdir(Options.cache_global)] + + acc = [] + for x in lst: + try: + acc.append((x, os.path.getctime(x), dsize(x))) + except: + pass + + # sort the files by the oldest first + acc.sort(cmp=cmp2) + + tot = sum([x[2] for x in acc]) + cur = 0 + + # remove at least 10% more, just to make sure + while tot - cur > 0.9 * CACHESIZE: + x = acc.pop(0) + cur += x[2] + + # ignore if the folders cannot be removed + try: + shutil.rmtree(x[0]) + except: + pass Build.BuildContext.compile = compile -- 2.11.4.GIT