diff options
author | Jeremy Allison <jra@samba.org> | 2007-10-24 14:16:54 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-10-24 14:16:54 -0700 |
commit | f88b7a076be74a29a3bf876b4e2705f4a1ecf42b (patch) | |
tree | 2d5167540fcbe1ad245fce697924b18216b2d142 /source3/utils/net_time.c | |
parent | e01cbcb28e63abb0f681a5a168fc2445744eec93 (diff) | |
download | samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.tar.gz samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.tar.bz2 samba-f88b7a076be74a29a3bf876b4e2705f4a1ecf42b.zip |
This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
(This used to be commit 98e154c3125d5732c37a72d74b0eb5cd7b6155fd)
Diffstat (limited to 'source3/utils/net_time.c')
-rw-r--r-- | source3/utils/net_time.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/utils/net_time.c b/source3/utils/net_time.c index 510807730e..7375206af6 100644 --- a/source3/utils/net_time.c +++ b/source3/utils/net_time.c @@ -23,7 +23,7 @@ /* return the time on a server. This does not require any authentication */ -static time_t cli_servertime(const char *host, struct in_addr *ip, int *zone) +static time_t cli_servertime(const char *host, struct sockaddr_storage *pss, int *zone) { struct nmb_name calling, called; time_t ret = 0; @@ -35,7 +35,7 @@ static time_t cli_servertime(const char *host, struct in_addr *ip, int *zone) goto done; } - status = cli_connect(cli, host, ip); + status = cli_connect(cli, host, pss); if (!NT_STATUS_IS_OK(status)) { fprintf(stderr,"Can't contact server %s. Error %s\n", host, nt_errstr(status)); goto done; @@ -83,9 +83,9 @@ static const char *systime(time_t t) if (!tm) { return "unknown"; } - - fstr_sprintf(s, "%02d%02d%02d%02d%04d.%02d", - tm->tm_mon+1, tm->tm_mday, tm->tm_hour, + + fstr_sprintf(s, "%02d%02d%02d%02d%04d.%02d", + tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_year + 1900, tm->tm_sec); return s; } @@ -110,8 +110,8 @@ static int net_time_set(int argc, const char **argv) int result; if (t == 0) return -1; - - /* yes, I know this is cheesy. Use "net time system" if you want to + + /* yes, I know this is cheesy. Use "net time system" if you want to roll your own. I'm putting this in as it works on a large number of systems and the user has a choice in whether its used or not */ asprintf(&cmd, "/bin/date %s", systime(t)); |