Bug 50698

Summary: two different ntp usage messages?
Product: [Retired] Red Hat Raw Hide Reporter: Jonathan Kamens <jik>
Component: ntpAssignee: Harald Hoyer <harald>
Status: CLOSED RAWHIDE QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: rh-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-08-31 00:30:58 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Jonathan Kamens 2001-08-02 10:54:13 UTC
# ntpd -h
ntpd: unknown option -h
usage: ntpd [ -abdgmnqx ] [ -c config_file ] [ -e e_delay ]
                [ -f freq_file ] [ -k key_file ] [ -l log_file ]
                [ -p pid_file ] [ -r broad_delay ] [ -s statdir ]
                [ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]
                [ -T chroot_dir ] [ -U server_user ]
                [ -P fixed_process_priority ]
# ntpd -n -U ntp
usage: ntpd [ -abdgmnx ] [ -c config_file ] [ -e e_delay ]
                [ -f freq_file ] [ -k key_file ] [ -l log_file ]
                [ -p pid_file ] [ -r broad_delay ] [ -s statdir ]
                [ -t trust_key ] [ -v sys_var ] [ -V default_sysvar ]
                [ -P fixed_process_priority ]
# 

Note how the two usage messages above are different -- one mentions -T and
-U and the other doesn't!

Comment 1 Harald Hoyer 2001-08-02 10:56:49 UTC
will be fixed in 4.0.99mrc2-5. But first I want to fix other bugs.. thx



Comment 2 Harald Hoyer 2001-08-29 08:58:43 UTC
*** Bug 52763 has been marked as a duplicate of this bug. ***

Comment 3 Harald Hoyer 2001-08-29 09:01:46 UTC
*** Bug 50526 has been marked as a duplicate of this bug. ***

Comment 4 Harald Hoyer 2001-08-29 09:08:04 UTC
ok, really fixed in 4.0.99mrc2-5


Comment 5 Enrico Scholz 2001-08-30 10:16:01 UTC
In -5 `-U ntp' works but ntpd becomes a random user:

| $ service ntpd restart
| $ ls -ld /proc/`/sbin/pidof ntpd`
| dr-xr-xr-x    3 1075437652 134767660        0 Aug 30 12:20 /proc/3633
| $ id ntp
| uid=38(ntp) gid=38(ntp) groups=38(ntp)


Comment 6 Enrico Scholz 2001-08-30 22:36:19 UTC
Bad user happens because of uninitialized variables `server_uid' + `server_gid'. 

ntpd/ntpd.c:

1. declares server_uid/server_gid and sets server_user to NULL
2. gets debug settings (line 441) via getstartup()
3. `if (server_user) { ... initialize server_uid/gid ... }' --> does not happen, 
   because server_user is still null
4. calculates `server_user' later
5. calls drop_root() with the uninitialized server_uid/gid values

Perhaps evaluation of the `-U' option should happen in the getstartup() routine
already and not in the getCmdOpts() one which is called later.

Comment 7 Harald Hoyer 2001-08-31 06:17:47 UTC
already fixed in ntp-4.1.0-1 ... :)


Comment 8 Harald Hoyer 2001-09-03 17:45:03 UTC
*** Bug 53099 has been marked as a duplicate of this bug. ***

Comment 9 Harald Hoyer 2001-09-05 10:37:13 UTC
*** Bug 53215 has been marked as a duplicate of this bug. ***

Comment 10 Harald Hoyer 2001-10-04 08:45:59 UTC
*** Bug 54313 has been marked as a duplicate of this bug. ***