Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162184647
D48191.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
991 B
Referenced Files
None
Subscribers
None
D48191.id.diff
View Options
diff --git a/libexec/rc/rc.d/ntpd b/libexec/rc/rc.d/ntpd
--- a/libexec/rc/rc.d/ntpd
+++ b/libexec/rc/rc.d/ntpd
@@ -101,7 +101,6 @@
# by the admin, we don't add the option. If the file exists in the old
# default location we use that, else we use the new default location.
if can_run_nonroot; then
- _user="ntpd"
driftopt="-f ${_ntp_default_driftfile}"
elif grep -q "^[ \t]*driftfile" "${ntpd_config}" ||
[ -n "${rc_flags}" ] &&
@@ -115,7 +114,13 @@
fi
# Set command_args based on the various config vars.
- command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt}"
+ command_args="-p ${pidfile} -c ${ntpd_config} ${driftopt} -u ${ntpd_user:=ntpd:ntpd}"
+
+ # Unset ntpd_user because rc.subr uses $${name}_user to determine
+ # whether to invoke su(1) to setuid() to $ntpd_user for us. We want
+ # ntpd to do the setuid() itself through the -u argument, above.
+ unset ntpd_user
+
if checkyesno ntpd_sync_on_start; then
command_args="${command_args} -g"
fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 11, 4:36 PM (18 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34966353
Default Alt Text
D48191.id.diff (991 B)
Attached To
Mode
D48191: ntpd: Use the ntpd -u option in preference to the rc su plumbing
Attached
Detach File
Event Timeline
Log In to Comment