Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 21444
Alias:
Product:
Component:
Status: CLOSED
Resolution: FIXED
Assigned To: SpanKY <vapier@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Rajiv Aaron Manglani <rajiv@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:

Filename Description Type Creator Created Size Actions
ntp-4.0.99m-rc2-droproot.patch ntp droproot patch. patch Rajiv Aaron Manglani 2003-05-22 02:13 0000 12.23 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 21444 depends on: Show dependency tree
Bug 21444 blocks:
Votes: 0    Show votes for this bug    Vote for this bug

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.




View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2003-05-21 16:48 0000
currently net-misc/ntp-4.1.1b-r5 runs as root after it is installed.

the ebuild should create a user and group called ntp (maybe uid/gid 123 since
ntp runs on port 123?). in /etc/conf.d/ntpd NTPD_OPTS="-U ntp" should be set.

gentoo currently does this for bind and sshd, and possibly others.

also, /etc/ntp/ should be created and owned by ntp/ntp. then
/usr/share/ntp/ntp.conf should be copied to /etc/ntp.conf but modified so the
drift file is stored in /etc/ntp/drift.

------- Comment #1 From Luke-Jr 2003-05-21 23:19:17 0000 -------
Due to NTP's functionality (setting the system clock), it cannot be run as a
normal 
user. Nor does the -U option you suggested exist for ntpd. 

------- Comment #2 From Rajiv Aaron Manglani 2003-05-22 02:12:04 0000 -------
turns out that this feature is provided by a patch included with redhat rpms.
check out <https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=35653> for more
info. note: "This requires kernel >=2.2.18 and libcap package..."

i downloaded the src rpm from
ftp://ftp.redhat.com/pub/redhat/linux/7.2/en/os/i386/SRPMS/ntp-4.1.0-4.src.rpm
and extracted the patch.

------- Comment #3 From Rajiv Aaron Manglani 2003-05-22 02:13:47 0000 -------
Created an attachment (id=12278) [details]
ntp droproot patch.

originally from
<ftp://ftp.redhat.com/pub/redhat/linux/7.2/en/os/i386/SRPMS/ntp-4.1.0-4.src.rpm>
... i modified the patch file by adding this source url to the top of it. i
made no modifications to the code.

------- Comment #4 From Luke-Jr 2003-05-22 02:18:28 0000 -------
doesn't change the fact that normal users can't change the system time, does  
it? o.O  

------- Comment #5 From Rajiv Aaron Manglani 2003-05-22 13:32:36 0000 -------
fyi i submitted this patch to the ntp maintainers. even though it looks like it
was written in august 2001, they had not seen it. i will try and find out
if/when they are going to include it with the source. lets hold off on adding
it.

------- Comment #6 From Luke-Jr 2003-05-24 19:32:56 0000 -------
Why not apply the patch for now, though? Most of the patches in gentoo-sources 
are in future kernels, yet we apply them instead of waiting for a new version with 
them... 

------- Comment #7 From Rajiv Aaron Manglani 2003-05-27 05:25:55 0000 -------
re comment #6: makes sense. the maintainers are looking to include the patch
but it could be a while because they are waiting for something similar on bsd.
so let's go ahead and include this one with the ebuild.

also fyi, once the patch is in gentoo-src/eid_database/ needs to be updated.

all yours luke-jr.

------- Comment #8 From SpanKY 2003-08-06 00:47:17 0000 -------
i updated the patch to work with 4.1.2 and added it to portage

i also added enewgroup/enewuser to the ebuild to add ntp

finally, i updated the ntp server to (by default) pass '-U ntp' in the OPTS

------- Comment #9 From Rajiv Aaron Manglani 2003-12-07 17:04:07 0000 -------
test, works great. thanks.

------- Comment #10 From Kalin KOZHUHAROV 2004-02-01 00:04:25 0000 -------
4.2.0 is out and here is the patch:
http://bugzilla.ntp.org/attachment.cgi?id=103&action=view

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug