Bug 10728 - 'net time system' segfaults
Summary: 'net time system' segfaults
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.1.9
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Karolin Seeger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-19 07:28 UTC by David Woodhouse
Modified: 2014-09-01 19:15 UTC (History)
1 user (show)

See Also:


Attachments
git-am fix for master. (4.67 KB, patch)
2014-07-29 21:29 UTC, Jeremy Allison
ddiss: review+
Details
tiny regression test (1.06 KB, patch)
2014-07-30 10:07 UTC, David Disseldorp
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Woodhouse 2014-07-19 07:28:42 UTC
Some users complain of issues with clock skew; I thought it would be a good idea to investigate having their machines automatically sync to the domain controller.

Maybe not...

Starting program: /usr/bin/net time system irsger202.ger.corp.intel.com
Program received signal SIGSEGV, Segmentation fault.
__strchr_sse2 () at ../sysdeps/x86_64/strchr.S:32
32		movdqa	(%rdi), %xmm0
Missing separate debuginfos, use: debuginfo-install audit-libs-2.3.7-1.fc20.x86_64 avahi-libs-0.6.31-21.fc20.x86_64 cups-libs-1.7.3-1.fc20.x86_64 dbus-libs-1.6.12-9.fc20.x86_64 libacl-2.2.52-4.fc20.x86_64 libattr-2.4.47-3.fc20.x86_64 libldb-1.1.16-4.fc20.x86_64 libtalloc-2.1.0-3.fc20.x86_64 libtdb-1.2.12-2.fc20.x86_64 libtevent-0.9.20-1.fc20.x86_64 ncurses-libs-5.9-12.20130511.fc20.x86_64 nss-3.16.2-1.fc20.x86_64 nss-softokn-freebl-3.16.2-1.fc20.x86_64 nss-util-3.16.2-1.fc20.x86_64 pcre-8.33-5.fc20.x86_64 popt-1.16-2.fc20.x86_64 readline-6.2-8.fc20.x86_64
(gdb) up
#1  0x00007fbba8245c88 in cli_connect_nb_send (
p    mem_ctx=mem_ctx@entry=0x7fbbab65e230, ev=ev@entry=0x7fbbab65e230, 
    host=host@entry=0x0, dest_ss=dest_ss@entry=0x0, port=port@entry=0, 
    name_type=name_type@entry=32, 
    myname=myname@entry=0x7fbbab65aea0 "DWOODHOU-LINUX", 
    signing_state=signing_state@entry=-1, flags=flags@entry=0)
    at ../source3/libsmb/cliconnect.c:3008
3008		p = strchr(host, '#');
(gdb) p host
$1 = 0x0
Comment 1 Jeremy Allison 2014-07-29 19:14:42 UTC
Actually the server must be specified with the -S SERVER option. This is both a man page bug (as that should be explicit) as well as a code bug (we should print a usage here, not core dump).
Comment 2 David Woodhouse 2014-07-29 21:23:34 UTC
I should be able to use '-W $DOMAIN' too, right? That didn't work either.
Comment 3 Jeremy Allison 2014-07-29 21:28:37 UTC
Not sure, it certainly looks like -S is the only allowed thing.

I'm uploading a patch that fixes this.
Comment 4 Jeremy Allison 2014-07-29 21:29:08 UTC
Created attachment 10159 [details]
git-am fix for master.
Comment 5 David Woodhouse 2014-07-30 08:04:53 UTC
Looks good; will test shortly although I'm a little busy this week. Trying to work out where I got the idea that I could use '-W $DOMAIN'. Probably from the documentation of the -S option:

       -S|--server server
           Name of target server. You should specify either this option or a
           target workgroup or a target IP address.

That might want to be changed to

       -S|--server server
           Name of target server. You should specify either this option or a
           target workgroup or a target IP address. Except for 'net time', where
           we make dwmw2 really unhappy by not supporting -W and forcing him to
           script something to find a specific server, instead of just doing it
           automatically for him with fallback when the first selected server
           can't be reached.

Or something like that.
Comment 6 David Disseldorp 2014-07-30 10:06:06 UTC
Comment on attachment 10159 [details]
git-am fix for master.

Pushed to autobuild.
Comment 7 David Disseldorp 2014-07-30 10:07:19 UTC
Created attachment 10161 [details]
tiny regression test
Comment 8 Jeremy Allison 2014-07-30 16:44:25 UTC
git-am fix applies cleanly to 4.1.next and 4.0.next. Re-assigning to Karolin for inclusion.

Jeremy.
Comment 9 Karolin Seeger 2014-08-03 18:42:19 UTC
Pushed to autobuild-v4-[0|1]-test.
Comment 10 Karolin Seeger 2014-09-01 19:15:41 UTC
(In reply to comment #9)
> Pushed to autobuild-v4-[0|1]-test.

Pushed to both branches.
Closing out bug report.

Thanks!