equal
deleted
inserted
replaced
|
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. |
|
5 |
|
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. |
|
9 |
|
10 --- ntpd/ntpd.c |
|
11 +++ ntpd/ntpd.c |
|
12 @@ -620,12 +620,14 @@ ntpdmain( |
|
13 |
|
14 /* MPE lacks the concept of root */ |
|
15 # if defined(HAVE_GETUID) && !defined(MPE) |
|
16 - uid = getuid(); |
|
17 - if (uid && !HAVE_OPT( SAVECONFIGQUIT )) { |
|
18 - msyslog_term = TRUE; |
|
19 - msyslog(LOG_ERR, |
|
20 - "must be run as root, not uid %ld", (long)uid); |
|
21 - exit(1); |
|
22 + if (!getenv("SMF_FMRI")) { |
|
23 + uid = getuid(); |
|
24 + if (uid && !HAVE_OPT( SAVECONFIGQUIT )) { |
|
25 + msyslog_term = TRUE; |
|
26 + msyslog(LOG_ERR, |
|
27 + "must be run as root, not uid %ld", (long)uid); |
|
28 + exit(1); |
|
29 + } |
|
30 } |
|
31 # endif |
|
32 |