1 This works around the limitation of requiring root as the user. This has
2 been reported to the community as NTP bug 2422 "Allow ntpd to be started as
3 non-root if appropriate POSIX capabilities are set" which although reported
4 as Linux specific, is being used to track the Solaris issue as well.
6 This particular solution is not being passed to the community as a solution
7 because it is specific to Solaris and to our specific use of SMF and is not
8 really suitable as a general solution.
14 /* MPE lacks the concept of root */
15 # if defined(HAVE_GETUID) && !defined(MPE)
17 - if (uid && !HAVE_OPT( SAVECONFIGQUIT )
18 + if (!getenv("SMF_FMRI")) {
20 + if (uid && !HAVE_OPT( SAVECONFIGQUIT )
21 # if defined(HAVE_TRUSTEDBSD_MAC)
22 - /* We can run as non-root if the mac_ntpd policy is enabled. */
23 - && mac_is_present("ntpd") != 1
24 + /* We can run as non-root if the mac_ntpd policy is enabled. */
25 + && mac_is_present("ntpd") != 1
28 - msyslog_term = TRUE;
30 - "must be run as root, not uid %ld", (long)uid);
33 + msyslog_term = TRUE;
35 + "must be run as root, not uid %ld", (long)uid);