[SCM] Samba Shared Repository - branch master updated
Jelmer Vernooij
jelmer at samba.org
Wed Nov 9 11:44:03 MST 2011
The branch, master has been updated
via 7feb83a s4: Install samba-tool and samba_kcc to bin/ rather than sbin/.
via b8efff5 samba_kcc: Remove unnecessary return statements.
via 56081da util/time: Make some functions explicitly public.
via 56852bf util/time: Remove unnecessary _PUBLIC_ - that's implicit for things in header files.
from 6727429 s3:registry: prevent unnecessary transactions in regdb_init
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 7feb83a1c42a762d149ac376df63e6dd14fdf55d
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon Nov 7 14:58:10 2011 +0100
s4: Install samba-tool and samba_kcc to bin/ rather than sbin/.
Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
Autobuild-Date: Wed Nov 9 19:43:07 CET 2011 on sn-devel-104
commit b8efff57dce41fbcc16a63265e321ce83fe25e89
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Mon Nov 7 02:04:52 2011 +0100
samba_kcc: Remove unnecessary return statements.
commit 56081da3680b7032df08fdfa55e8a034a1f1d1a4
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Nov 3 17:22:40 2011 +0100
util/time: Make some functions explicitly public.
commit 56852bf1fc72d821d7241ac49589072944425ea7
Author: Jelmer Vernooij <jelmer at samba.org>
Date: Thu Nov 3 14:34:08 2011 +0100
util/time: Remove unnecessary _PUBLIC_ - that's implicit for things in header files.
-----------------------------------------------------------------------
Summary of changes:
lib/util/time.c | 6 +-
lib/util/time.h | 84 ++++++++++++++++++--------------------
source4/scripting/bin/samba_kcc | 17 --------
source4/scripting/wscript_build | 3 +-
4 files changed, 45 insertions(+), 65 deletions(-)
Changeset truncated at 500 lines:
diff --git a/lib/util/time.c b/lib/util/time.c
index 7216ea6..dc3ca68 100644
--- a/lib/util/time.c
+++ b/lib/util/time.c
@@ -845,7 +845,7 @@ struct timeval convert_timespec_to_timeval(const struct timespec ts)
Return a timespec for the current time
****************************************************************************/
-struct timespec timespec_current(void)
+_PUBLIC_ struct timespec timespec_current(void)
{
struct timespec ts;
clock_gettime(CLOCK_REALTIME, &ts);
@@ -872,7 +872,7 @@ struct timespec timespec_min(const struct timespec *ts1,
Return 1 if ts1 > ts2
****************************************************************************/
-int timespec_compare(const struct timespec *ts1, const struct timespec *ts2)
+_PUBLIC_ int timespec_compare(const struct timespec *ts1, const struct timespec *ts2)
{
if (ts1->tv_sec > ts2->tv_sec) return 1;
if (ts1->tv_sec < ts2->tv_sec) return -1;
@@ -910,7 +910,7 @@ void round_timespec_to_usec(struct timespec *ts)
Put a 8 byte filetime from a struct timespec. Uses GMT.
****************************************************************************/
-void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts)
+_PUBLIC_ void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts)
{
uint64_t d;
diff --git a/lib/util/time.h b/lib/util/time.h
index 047daec..69ba783 100644
--- a/lib/util/time.h
+++ b/lib/util/time.h
@@ -24,10 +24,6 @@
#ifndef _SAMBA_TIME_H_
#define _SAMBA_TIME_H_
-#ifndef _PUBLIC_
-#define _PUBLIC_
-#endif
-
#ifndef TIME_T_MIN
/* we use 0 here, because (time_t)-1 means error */
#define TIME_T_MIN 0
@@ -48,80 +44,80 @@ typedef uint64_t NTTIME;
/**
External access to time_t_min and time_t_max.
**/
-_PUBLIC_ time_t get_time_t_max(void);
+time_t get_time_t_max(void);
/**
a gettimeofday wrapper
**/
-_PUBLIC_ void GetTimeOfDay(struct timeval *tval);
+void GetTimeOfDay(struct timeval *tval);
/**
a wrapper to preferably get the monotonic time
**/
-_PUBLIC_ void clock_gettime_mono(struct timespec *tp);
+void clock_gettime_mono(struct timespec *tp);
/**
a wrapper to preferably get the monotonic time in s
**/
-_PUBLIC_ time_t time_mono(time_t *t);
+time_t time_mono(time_t *t);
/**
interpret an 8 byte "filetime" structure to a time_t
It's originally in "100ns units since jan 1st 1601"
**/
-_PUBLIC_ time_t nt_time_to_unix(NTTIME nt);
+time_t nt_time_to_unix(NTTIME nt);
/**
put a 8 byte filetime from a time_t
This takes GMT as input
**/
-_PUBLIC_ void unix_to_nt_time(NTTIME *nt, time_t t);
+void unix_to_nt_time(NTTIME *nt, time_t t);
/**
check if it's a null unix time
**/
-_PUBLIC_ bool null_time(time_t t);
+bool null_time(time_t t);
/**
check if it's a null NTTIME
**/
-_PUBLIC_ bool null_nttime(NTTIME t);
+bool null_nttime(NTTIME t);
/**
put a dos date into a buffer (time/date format)
This takes GMT time and puts local time in the buffer
**/
-_PUBLIC_ void push_dos_date(uint8_t *buf, int offset, time_t unixdate, int zone_offset);
+void push_dos_date(uint8_t *buf, int offset, time_t unixdate, int zone_offset);
/**
put a dos date into a buffer (date/time format)
This takes GMT time and puts local time in the buffer
**/
-_PUBLIC_ void push_dos_date2(uint8_t *buf,int offset,time_t unixdate, int zone_offset);
+void push_dos_date2(uint8_t *buf,int offset,time_t unixdate, int zone_offset);
/**
put a dos 32 bit "unix like" date into a buffer. This routine takes
GMT and converts it to LOCAL time before putting it (most SMBs assume
localtime for this sort of date)
**/
-_PUBLIC_ void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_offset);
+void push_dos_date3(uint8_t *buf,int offset,time_t unixdate, int zone_offset);
/**
create a unix date (int GMT) from a dos date (which is actually in
localtime)
**/
-_PUBLIC_ time_t pull_dos_date(const uint8_t *date_ptr, int zone_offset);
+time_t pull_dos_date(const uint8_t *date_ptr, int zone_offset);
/**
like make_unix_date() but the words are reversed
**/
-_PUBLIC_ time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset);
+time_t pull_dos_date2(const uint8_t *date_ptr, int zone_offset);
/**
create a unix GMT date from a dos date in 32 bit "unix like" format
these generally arrive as localtimes, with corresponding DST
**/
-_PUBLIC_ time_t pull_dos_date3(const uint8_t *date_ptr, int zone_offset);
+time_t pull_dos_date3(const uint8_t *date_ptr, int zone_offset);
/**
Return a date and time as a string (optionally with microseconds)
@@ -141,69 +137,69 @@ char *current_timestring(TALLOC_CTX *ctx, bool hires);
/**
return a HTTP/1.0 time string
**/
-_PUBLIC_ char *http_timestring(TALLOC_CTX *mem_ctx, time_t t);
+char *http_timestring(TALLOC_CTX *mem_ctx, time_t t);
/**
Return the date and time as a string
format is %a %b %e %X %Y %Z
**/
-_PUBLIC_ char *timestring(TALLOC_CTX *mem_ctx, time_t t);
+char *timestring(TALLOC_CTX *mem_ctx, time_t t);
/**
return a talloced string representing a NTTIME for human consumption
*/
-_PUBLIC_ const char *nt_time_string(TALLOC_CTX *mem_ctx, NTTIME nt);
+const char *nt_time_string(TALLOC_CTX *mem_ctx, NTTIME nt);
/**
put a NTTIME into a packet
*/
-_PUBLIC_ void push_nttime(uint8_t *base, uint16_t offset, NTTIME t);
+void push_nttime(uint8_t *base, uint16_t offset, NTTIME t);
/**
pull a NTTIME from a packet
*/
-_PUBLIC_ NTTIME pull_nttime(uint8_t *base, uint16_t offset);
+NTTIME pull_nttime(uint8_t *base, uint16_t offset);
/**
parse a nttime as a large integer in a string and return a NTTIME
*/
-_PUBLIC_ NTTIME nttime_from_string(const char *s);
+NTTIME nttime_from_string(const char *s);
/**
return (tv1 - tv2) in microseconds
*/
-_PUBLIC_ int64_t usec_time_diff(const struct timeval *tv1, const struct timeval *tv2);
+int64_t usec_time_diff(const struct timeval *tv1, const struct timeval *tv2);
/**
return (tp1 - tp2) in nanoseconds
*/
-_PUBLIC_ int64_t nsec_time_diff(const struct timespec *tp1, const struct timespec *tp2);
+int64_t nsec_time_diff(const struct timespec *tp1, const struct timespec *tp2);
/**
return a zero timeval
*/
-_PUBLIC_ struct timeval timeval_zero(void);
+struct timeval timeval_zero(void);
/**
return true if a timeval is zero
*/
-_PUBLIC_ bool timeval_is_zero(const struct timeval *tv);
+bool timeval_is_zero(const struct timeval *tv);
/**
return a timeval for the current time
*/
-_PUBLIC_ struct timeval timeval_current(void);
+struct timeval timeval_current(void);
/**
return a timeval struct with the given elements
*/
-_PUBLIC_ struct timeval timeval_set(uint32_t secs, uint32_t usecs);
+struct timeval timeval_set(uint32_t secs, uint32_t usecs);
/**
return a timeval ofs microseconds after tv
*/
-_PUBLIC_ struct timeval timeval_add(const struct timeval *tv,
+struct timeval timeval_add(const struct timeval *tv,
uint32_t secs, uint32_t usecs);
/**
@@ -215,17 +211,17 @@ struct timeval timeval_sum(const struct timeval *tv1,
/**
return a timeval secs/usecs into the future
*/
-_PUBLIC_ struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs);
+struct timeval timeval_current_ofs(uint32_t secs, uint32_t usecs);
/**
return a timeval milliseconds into the future
*/
-_PUBLIC_ struct timeval timeval_current_ofs_msec(uint32_t msecs);
+struct timeval timeval_current_ofs_msec(uint32_t msecs);
/**
return a timeval microseconds into the future
*/
-_PUBLIC_ struct timeval timeval_current_ofs_usec(uint32_t usecs);
+struct timeval timeval_current_ofs_usec(uint32_t usecs);
/**
compare two timeval structures.
@@ -233,33 +229,33 @@ _PUBLIC_ struct timeval timeval_current_ofs_usec(uint32_t usecs);
Return 0 if tv1 == tv2
Return 1 if tv1 > tv2
*/
-_PUBLIC_ int timeval_compare(const struct timeval *tv1, const struct timeval *tv2);
+int timeval_compare(const struct timeval *tv1, const struct timeval *tv2);
/**
return true if a timer is in the past
*/
-_PUBLIC_ bool timeval_expired(const struct timeval *tv);
+bool timeval_expired(const struct timeval *tv);
/**
return the number of seconds elapsed between two times
*/
-_PUBLIC_ double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2);
+double timeval_elapsed2(const struct timeval *tv1, const struct timeval *tv2);
/**
return the number of seconds elapsed since a given time
*/
-_PUBLIC_ double timeval_elapsed(const struct timeval *tv);
+double timeval_elapsed(const struct timeval *tv);
/**
return the lesser of two timevals
*/
-_PUBLIC_ struct timeval timeval_min(const struct timeval *tv1,
+struct timeval timeval_min(const struct timeval *tv1,
const struct timeval *tv2);
/**
return the greater of two timevals
*/
-_PUBLIC_ struct timeval timeval_max(const struct timeval *tv1,
+struct timeval timeval_max(const struct timeval *tv1,
const struct timeval *tv2);
/**
@@ -267,23 +263,23 @@ _PUBLIC_ struct timeval timeval_max(const struct timeval *tv1,
if tv1 comes after tv2, then return a zero timeval
(this is *tv2 - *tv1)
*/
-_PUBLIC_ struct timeval timeval_until(const struct timeval *tv1,
+struct timeval timeval_until(const struct timeval *tv1,
const struct timeval *tv2);
/**
convert a timeval to a NTTIME
*/
-_PUBLIC_ NTTIME timeval_to_nttime(const struct timeval *tv);
+NTTIME timeval_to_nttime(const struct timeval *tv);
/**
convert a NTTIME to a timeval
*/
-_PUBLIC_ void nttime_to_timeval(struct timeval *tv, NTTIME t);
+void nttime_to_timeval(struct timeval *tv, NTTIME t);
/**
return the UTC offset in seconds west of UTC, or 0 if it cannot be determined
*/
-_PUBLIC_ int get_time_zone(time_t t);
+int get_time_zone(time_t t);
/**
check if 2 NTTIMEs are equal.
diff --git a/source4/scripting/bin/samba_kcc b/source4/scripting/bin/samba_kcc
index 30e6687..c024cd4 100755
--- a/source4/scripting/bin/samba_kcc
+++ b/source4/scripting/bin/samba_kcc
@@ -61,7 +61,6 @@ class KCC:
self.my_dsa_dnstr = None # My dsa DN
self.my_site_dnstr = None
self.samdb = samdb
- return
def load_my_site(self):
"""Loads the Site class for the local DSA
@@ -73,7 +72,6 @@ class KCC:
site.load_site(samdb)
self.site_table[self.my_site_dnstr] = site
- return
def load_my_dsa(self):
"""Discover my nTDSDSA thru the rootDSE entry and
@@ -87,7 +85,6 @@ class KCC:
attrs=["dsServiceName"])
except ldb.LdbError, (enum, estr):
raise Exception("Unable to find my nTDSDSA - (%s)" % estr)
- return
dnstr = res[0]["dsServiceName"][0]
@@ -104,8 +101,6 @@ class KCC:
# and index by dsa dn
self.dsa_table[dnstr] = dsa
- return
-
def load_all_dsa(self):
"""Discover all nTDSDSA thru the sites entry and
instantiate and load the DSAs. Each dsa is inserted
@@ -119,7 +114,6 @@ class KCC:
expression="(objectClass=nTDSDSA)")
except ldb.LdbError, (enum, estr):
raise Exception("Unable to find nTDSDSAs - (%s)" % estr)
- return
for msg in res:
dnstr = str(msg.dn)
@@ -136,8 +130,6 @@ class KCC:
# and index by dsa dn
self.dsa_table[dnstr] = dsa
- return
-
def load_all_partitions(self):
"""Discover all NCs thru the Partitions dn and
instantiate and load the NCs. Each NC is inserted
@@ -165,8 +157,6 @@ class KCC:
part.load_partition(self.samdb)
self.part_table[partstr] = part
- return
-
def should_be_present_test(self):
"""Enumerate all loaded partitions and DSAs and test
if NC should be present as replica
@@ -178,7 +168,6 @@ class KCC:
logger.info("dsadn:%s\nncdn:%s\nneeded=%s:ro=%s:partial=%s\n" % \
(dsa.dsa_dnstr, part.nc_dnstr, needed, ro, partial))
- return
def refresh_failed_links_connections(self):
# XXX - not implemented yet
@@ -211,7 +200,6 @@ class KCC:
in the samdb
"""
# XXX - not implemented yet
- return
def update_rodc_connection(self):
"""Runs when the local DC is an RODC and updates the RODC NTFRS
@@ -229,7 +217,6 @@ class KCC:
# If no such cn1 can be found, nothing is modified by this task.
# XXX - not implemented yet
- return
def intrasite_max_node_edges(self, node_count):
"""Returns the maximum number of edges directed to a node in
@@ -540,8 +527,6 @@ class KCC:
i = i + 1
- return
-
def intrasite(self):
"""The head method for generating the intra-site KCC replica
connection graph and attendant nTDSConnection objects
@@ -602,7 +587,6 @@ class KCC:
mydsa.commit_connection_table(self.samdb)
logger.debug("intrasite exit:\nmydsa: %s" % mydsa)
- return
def run(self):
"""Method to perform a complete run of the KCC and
@@ -646,7 +630,6 @@ class KCC:
# Step 7
self.update_rodc_connection()
- return
##################################################
# Global Functions
diff --git a/source4/scripting/wscript_build b/source4/scripting/wscript_build
index 8029187..9e2cb1e 100644
--- a/source4/scripting/wscript_build
+++ b/source4/scripting/wscript_build
@@ -2,7 +2,8 @@
from samba_utils import MODE_755
-bld.INSTALL_FILES('${SBINDIR}','bin/upgradeprovision bin/samba_dnsupdate bin/samba_spnupdate bin/samba-tool bin/samba_kcc',
+bld.INSTALL_FILES('${SBINDIR}', 'bin/upgradeprovision bin/samba_dnsupdate bin/samba_spnupdate',
chmod=MODE_755, python_fixup=True, flat=True)
+bld.INSTALL_FILES('${BINDIR}', 'bin/samba-tool bin/samba_kcc', chmod=MODE_755, python_fixup=True, flat=True)
bld.RECURSE('bin')
--
Samba Shared Repository
More information about the samba-cvs
mailing list