Blame SOURCES/redhat-bugzilla-2093751-sudoers-docs.patch

5823b6
commit 55e8c83ee5920ab30644f54f7a525255b1de4b84
5823b6
Author: Nathan Scott <nathans@redhat.com>
5823b6
Date:   Mon Aug 29 14:25:03 2022 +1000
5823b6
5823b6
    docs: describe working sudoers configuration with requiretty
5823b6
    
5823b6
    When /etc/sudoers is configured with 'Defaults requiretty',
5823b6
    pmlogctl cannot invoke pmlogger_check in the normal fashion.
5823b6
    Symptoms of the problem are the following system log message:
5823b6
    
5823b6
    pmlogctl[PID]: sudo: sorry, you must have a tty to run sudo
5823b6
    
5823b6
    pmiectl and pmie_check are similarly affected.  The simplest
5823b6
    solution is to add an additional configuration line excluding
5823b6
    these commands from requiring a tty; this is the approach now
5823b6
    documented.
5823b6
    
5823b6
    Note these PCP commands are not interactive (require no tty)
5823b6
    and the unprivileged 'pcp' account uses nologin(8) as a shell
5823b6
    anyway, so requiretty offers no advantages here.  Note also
5823b6
    there's debate about whether requiretty is a useful security
5823b6
    measure in general as it can be trivially bypassed; further
5823b6
    details: https://bugzilla.redhat.com/show_bug.cgi?id=1020147
5823b6
    
5823b6
    Resolves Red Hat BZ #2093751
5823b6
5823b6
diff -Naurp pcp-5.3.7.orig/man/man1/pmie_check.1 pcp-5.3.7/man/man1/pmie_check.1
5823b6
--- pcp-5.3.7.orig/man/man1/pmie_check.1	2021-11-04 08:26:15.000000000 +1100
5823b6
+++ pcp-5.3.7/man/man1/pmie_check.1	2022-08-31 11:17:52.362276530 +1000
5823b6
@@ -406,6 +406,42 @@ no
5823b6
 entries are needed as the timer mechanism provided by
5823b6
 .B systemd
5823b6
 is used instead.
5823b6
+.PP
5823b6
+The
5823b6
+.BR pmiectl (1)
5823b6
+utility may invoke
5823b6
+.B pmie_check
5823b6
+using the
5823b6
+.BR sudo (1)
5823b6
+command to run it under the $PCP_USER ``pcp'' account.
5823b6
+If
5823b6
+.B sudo
5823b6
+is configured with the non-default
5823b6
+.I requiretty
5823b6
+option (see below),
5823b6
+.B pmie_check
5823b6
+may fail to run due to not having a tty configured.
5823b6
+This issue can be resolved by adding a second line
5823b6
+(expand $PCP_BINADM_DIR according to your platform)
5823b6
+to the
5823b6
+.I /etc/sudoers
5823b6
+configuration file as follows:
5823b6
+.P
5823b6
+.ft CW
5823b6
+.nf
5823b6
+.in +0.5i
5823b6
+Defaults requiretty
5823b6
+Defaults!$PCP_BINADM_DIR/pmie_check !requiretty
5823b6
+.in
5823b6
+.fi
5823b6
+.ft 1
5823b6
+.P
5823b6
+Note that the unprivileged PCP account under which these
5823b6
+commands run uses
5823b6
+.I /sbin/nologin
5823b6
+as the shell, so the
5823b6
+.I requiretty
5823b6
+option is ineffective here and safe to disable in this way.
5823b6
 .SH FILES
5823b6
 .TP 5
5823b6
 .I $PCP_PMIECONTROL_PATH
5823b6
diff -Naurp pcp-5.3.7.orig/man/man1/pmlogger_check.1 pcp-5.3.7/man/man1/pmlogger_check.1
5823b6
--- pcp-5.3.7.orig/man/man1/pmlogger_check.1	2022-04-05 09:05:43.000000000 +1000
5823b6
+++ pcp-5.3.7/man/man1/pmlogger_check.1	2022-08-31 11:20:52.470086724 +1000
5823b6
@@ -830,6 +830,42 @@ no
5823b6
 entries are needed as the timer mechanism provided by
5823b6
 .B systemd
5823b6
 is used instead.
5823b6
+.PP
5823b6
+The
5823b6
+.BR pmlogctl (1)
5823b6
+utility may invoke
5823b6
+.B pmlogger_check
5823b6
+using the
5823b6
+.BR sudo (1)
5823b6
+command to run it under the $PCP_USER ``pcp'' account.
5823b6
+If
5823b6
+.B sudo
5823b6
+is configured with the non-default
5823b6
+.I requiretty
5823b6
+option (see below),
5823b6
+.B pmlogger_check
5823b6
+may fail to run due to not having a tty configured.
5823b6
+This issue can be resolved by adding a second line
5823b6
+(expand $PCP_BINADM_DIR according to your platform)
5823b6
+to the
5823b6
+.I /etc/sudoers
5823b6
+configuration file as follows:
5823b6
+.P
5823b6
+.ft CW
5823b6
+.nf
5823b6
+.in +0.5i
5823b6
+Defaults requiretty
5823b6
+Defaults!$PCP_BINADM_DIR/pmlogger_check !requiretty
5823b6
+.in
5823b6
+.fi
5823b6
+.ft 1
5823b6
+.P
5823b6
+Note that the unprivileged PCP account under which these
5823b6
+commands run uses
5823b6
+.I /sbin/nologin
5823b6
+as the shell, so the
5823b6
+.I requiretty 
5823b6
+option is ineffective here and safe to disable in this way.
5823b6
 .SH FILES
5823b6
 .TP 5
5823b6
 .I $PCP_PMLOGGERCONTROL_PATH
5823b6
@@ -926,7 +962,7 @@ instances for
5823b6
 .I hostname
5823b6
 have been launched in the interim.
5823b6
 Because the cron-driven PCP archive management scripts run under
5823b6
-the uid of the user ``pcp'',
5823b6
+the $PCP_USER account ``pcp'',
5823b6
 .BI $PCP_ARCHIVE_DIR/ hostname /SaveLogs
5823b6
 typically needs to be owned by the user ``pcp''.
5823b6
 .TP
5823b6
@@ -994,6 +1030,7 @@ platforms.
5823b6
 .BR pmlogmv (1),
5823b6
 .BR pmlogrewrite (1),
5823b6
 .BR pmsocks (1),
5823b6
+.BR sudo (1),
5823b6
 .BR systemd (1),
5823b6
 .BR xz (1)
5823b6
 and