Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153272570
D48191.id148367.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D48191.id148367.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
@@ -23,6 +23,7 @@
_ntp_default_dir="/var/db/ntp"
_ntp_default_driftfile="${_ntp_default_dir}/ntpd.drift"
_ntp_old_driftfile="/var/db/ntpd.drift"
+_ntpd_user_arg="-u ntpd:ntpd"
pidfile="${_ntp_default_dir}/${name}.pid"
@@ -101,9 +102,12 @@
# 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}" ||
+ elif [ -n "${ntpd_user}" ]; then
+ _ntpd_user_arg="-u ${ntpd_user}"
+ unset ntpd_user
+ fi
+ if grep -q "^[ \t]*driftfile" "${ntpd_config}" ||
[ -n "${rc_flags}" ] &&
( [ -z "${rc_flags##*-f*}" ] ||
[ -z "${rc_flags##*--driftfile*}" ] ); then
@@ -115,7 +119,7 @@
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} ${_ntpd_user_arg}"
if checkyesno ntpd_sync_on_start; then
command_args="${command_args} -g"
fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 21, 4:32 AM (19 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31888657
Default Alt Text
D48191.id148367.diff (1 KB)
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