Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 71296 - rdate -u broken
Summary: rdate -u broken
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-15 10:07 UTC by Hiel Van Campen
Modified: 2005-02-14 00:40 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
strace rdate -u (trace.u,8.89 KB, text/plain)
2004-11-19 08:50 UTC, Hiel Van Campen
Details
strace -otrace.t rdate -p ntp.sdsu.edu (trace.t,9.48 KB, text/plain)
2004-11-19 08:53 UTC, Hiel Van Campen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Hiel Van Campen 2004-11-15 10:07:26 UTC
Running rdate -u gives "rdate -p -u pool.ntp.org
rdate: error in read: Invalid argument". I also tried it at 3 other sites, Califorian edu sites and recieved the same error. It work before versions /usr/portage/packages/All/rdate-990821-r1.tbz2
/usr/portage/packages/All/rdate-1.4.tbz2

 

Reproducible: Always
Steps to Reproduce:
1.rdate -p -u pool.ntp.org or tock.inLa.edu or ntp.sdsu.edu
2.
3.

Actual Results:  
rdate -p -u pool.ntp.org
rdate: error in read: Invalid argument

Expected Results:  
rdate -p pool.ntp.org
rdate: [pool.ntp.org]	Mon Nov 15 10:05:52 2004

emerge info
Portage 2.0.51-r3 (default-linux/x86/2004.2/gcc34/2.6, gcc-3.4.3,
glibc-2.3.4.20041102-r0, 2.6.9-gentoo-r3n i686)
=================================================================
System uname: 2.6.9-gentoo-r3n i686 AMD Athlon(tm) XP 2000+
Gentoo Base System version 1.6.5
distcc 2.18 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.15.92.0.2-r1
Headers:  sys-kernel/linux26-headers-2.6.8.1-r1
Libtools: sys-devel/libtool-1.5.2-r6
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-march=athlon-xp -O2 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown
/usr/kde/3/share/config /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=athlon-xp -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs buildpkg ccache distlocks sandbox sfperms userpriv"
GENTOO_MIRRORS="ftp://ftp.ucsb.edu/pub/mirrors/linux/gentoo/ 
http://128.213.5.34/gentoo/"
MAKEOPTS="-j3 "
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/home/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3Dnow 3Dnow2 X alsa apache2 async autofs avi berkdb bitmap-fonts cdr chroot
cpdflib crypt cups dba dillo directfb divx4linux doc encode esd f77 fam fbdev
fomaticdb foomaticdb fortran freetype gd gdbm gif gnome gpm gtk gtk2 hpijs
imagemagick imlib java jpeg kde libg++ libwww live mad mikmod mmx mmx2 motif
mozilla mp3 mpeg mpeg4 mplayer mysql nas ncurses network nptl oggvorbis oss pam
pdflib perl php png ppds python qt quicktime readline real rtc ruby samba sdl
slang snmp spell sse ssl svga tcltk tcpd tiff truetype type1 unicode vim x86 xml
xml2 xmms xv zlib"
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-11-16 02:07:00 UTC
could you please explain a little more clearly which versions work and which don't?
Comment 2 Hiel Van Campen 2004-11-18 19:06:00 UTC
rdate -u worked for me prior to versions 990821-r1 and 1.4. Now "rdate -s -u" doesnt, I get the error "rdate: error in read: Invalid argument". 
Comment 3 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-11-18 19:56:31 UTC
all of the versions work fine for me.
rdate -p -u HOST
rdate -p HOST

do TCP mode work for you?
could you include the results from 
'strace rdate -p HOST'
AND
'strace rdate -u -p HOST'
(attach them as seperate files).
Comment 4 Hiel Van Campen 2004-11-19 08:50:55 UTC
Created attachment 44293 [details]
strace rdate -u

strace -otrace.u rdate -p -u ntp.sdsu.edu
Comment 5 Hiel Van Campen 2004-11-19 08:53:01 UTC
Created attachment 44295 [details]
strace -otrace.t rdate -p ntp.sdsu.edu

strace -otrace.t rdate -p ntp.sdsu.edu which works.
Comment 6 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-11-21 18:40:59 UTC
does UDP work properly on your machine?
any firewalls?

If you downgrade back to rdate-0.990821 does it work again?

Try another kernel perhaps?
I tested on 2.6.7-mm4, 2.6.10-rc1-mm5, 2.6.9-gentoo-r4, 2.6.7-hardened-r12
and UDP and TCP modes for rdate work on all of those.

Comment 7 Hiel Van Campen 2004-11-23 08:41:20 UTC
I down graded to rdate-0.990821-r2 and the -u ,UDP now works again. Tonight I'll go back up to 1.4 and test it again.
Comment 8 Hiel Van Campen 2004-11-23 08:58:50 UTC
I have a second machine that Im setting up for someone and it has rdate-1.4 on it and the UDP option errors out as reported before "rdate: error in read: Invalid argument".
Comment 9 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-11-23 17:37:19 UTC
could you try some other kernels like I suggested?
are you certain UDP works properly on your machine, or any firewalls around?
Comment 10 Hiel Van Campen 2004-11-24 13:13:13 UTC
1. Working rdate-0.990821-r2. I was mistaken in my original post This version
   works both ways, UDP and TCP. Thats with my current kernel 2.6.9

2. Rdate-1.4 does not work useing UDP.

4. The P4 box also works with 990821 but not 1.4. Kernel is 2.6.9-r1

5. I got kernel 2.4.28 and rdate-1.4 UDP works.

Comment 11 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-11-24 15:01:29 UTC
do other UDP things work on your machine?
is there any firewall stuff?
Comment 12 Hiel Van Campen 2004-12-05 18:47:59 UTC
Sorry its been so long but heres my set up. I am behind a router but Im not useing the firewall. I have had a halflife server on this box until recently, its now now on an old pII, and its uses UDP on one or 2 ports. Besides that and "rdate -u" Im not a where of any thing else.
Comment 13 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-12-08 02:09:24 UTC
I'm very stumped now.
options:
a) your 2.6 kernel is broken - your 2.4 kernel works, my 2.[46] kernels work.
b) something else is weird.

Looking at your strace rdate -u ...
I do notice one strange thing (this is the call to the time server):
recvfrom(3, 0xbffff8a8, 4, 0, 0xbffff8b0, 0xbffff8a4) = -1 EINVAL (Invalid argument)

Compare this to an earlier invocation of recvfrom (this is a request to your DNS server):
recvfrom(3, "\377.\201\200\0\1\0\2\0\2\0\2\3ntp\4sdsu\3edu\0\0\1\0\1"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("192.168.2.1")}, [16]) = 135

Compare this to my two:
request to DNS server:
recvfrom(3, "N\230\201\200\0\1\0\2\0\2\0\1\3ntp\4sdsu\3edu\0\0\1\0\1"..., 1024, 0, {sa_family=AF_INET, sin_port=htons(53), sin_addr=inet_addr("206.12.16.1")}, [16]) = 119
request to time server:
recvfrom(3, "\305aP\252", 4, 0, {sa_family=AF_INET, sin_port=htons(37), sin_addr=inet_addr("130.191.1.1")}, [16]) = 4

In the case of your application, the pointers for the time server call are not being printed. I'm wondering if they are even valid - as that would explain the EINVAL error response. If they are invalid, why are they invalid? You'd need to debug the C code to trace this one down.
Comment 14 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2005-02-14 00:40:06 UTC
no response from user.