RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1791661 - booth: pcs should validate ticket names
Summary: booth: pcs should validate ticket names
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: pcs
Version: 8.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: 8.7
Assignee: Tomas Jelinek
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
: 2027771 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-01-16 10:40 UTC by Tomas Jelinek
Modified: 2023-07-25 18:22 UTC (History)
11 users (show)

Fixed In Version: pcs-0.10.13-1.el8
Doc Type: Bug Fix
Doc Text:
Cause: User creates a new booth ticket. Consequence: Because pcs doesn't check the ticket's name, it may be unprocessable by booth. Fix: Implement ticket name validation in pcs. Result: Ticket names which are not processable by booth are not allowed in the configuration. Pcs exits with an error describing the correct format of the name.
Clone Of:
: 2053177 (view as bug list)
Environment:
Last Closed: 2022-11-08 09:12:53 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ClusterLabs pcs issues 229 0 None open [booth] `pcs booth ticket add TICKET`does not verify syntactical validity of TICKET 2020-09-17 11:15:19 UTC
Red Hat Issue Tracker CLUSTERQE-5746 0 None None None 2022-05-23 16:03:21 UTC
Red Hat Issue Tracker KCSOPP-1861 0 None None None 2023-07-25 18:22:04 UTC
Red Hat Product Errata RHSA-2022:7447 0 None None None 2022-11-08 09:13:11 UTC

Description Tomas Jelinek 2020-01-16 10:40:52 UTC
Description of problem:
Pcs should check entered ticket names are valid.

Valid ticket names:
* only alphanumeric characters, "-" and "/" are allowed
* max name length is 63 characters
* names must be unique (this check may already be present in pcs)

pcs commands:
* pcs booth ticket add
* pcs constraint ticket add


Version-Release number of selected component (if applicable):
pcs-0.10.4-3.el8


How reproducible:
always, easily


Steps to Reproduce:
1. pcs booth ticket add ms_ip_ticket
2. booth list


Actual results:
# pcs booth ticket add ms_ip_ticket 
# echo $?
0

# booth list                                               
Dec 10 16:03:21 virt-154 booth: [22096]: error: ticket name "ms_ip_ticket" invalid; only alphanumeric names.
Dec 10 16:03:21 virt-154 booth: [22096]: error:  in config file line 5
Dec 10 16:03:21 virt-154 booth: [22096]: error: cannot read config


Expected results:
Pcs exits with an error explaining why the entered ticket name is not valid.


Additional info:
reported upstream: https://github.com/ClusterLabs/pcs/issues/229

Comment 3 RHEL Program Management 2021-07-16 07:30:41 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 7 Tomas Jelinek 2022-02-10 16:22:33 UTC
*** Bug 2027771 has been marked as a duplicate of this bug. ***

Comment 8 Tomas Jelinek 2022-02-16 15:54:34 UTC
Upstream patch + tests: https://github.com/ClusterLabs/pcs/commit/8f074a7619b33e69f3ff3dfc821cc0239cb85668

For a test / reproducer, see comment 0.
Implemented checks in this patch:
* only alphanumeric characters and "-" are allowed
* max name length is 63 characters

Comment 11 Miroslav Lisik 2022-05-26 08:30:21 UTC
DevTestResults:

[root@r8-node-01 ~]# rpm -q pcs
pcs-0.10.13-1.el8.x86_64

[root@r8-node-01 ~]# rpm -qa booth*
booth-core-1.0-199.1.ac1d34c.git.el8.x86_64
booth-site-1.0-199.1.ac1d34c.git.el8.noarch
booth-1.0-199.1.ac1d34c.git.el8.x86_64

[root@r8-node-01 ~]# pcs booth setup sites 127.0.0.{1..3}
[root@r8-node-01 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3


[root@r8-node-01 ~]# pcs booth ticket add ms_ip_ticket
Error: booth ticket name 'ms_ip_ticket' is not valid, use up to 63 alphanumeric characters or dash
Error: Errors have occurred, therefore pcs is unable to continue
[root@r8-node-01 ~]# echo $?
1
[root@r8-node-01 ~]# pcs booth ticket add "$(printf 'a%.0s' {1..64})"
Error: booth ticket name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is not valid, use up to 63 alphanumeric characters or dash
Error: Errors have occurred, therefore pcs is unable to continue
[root@r8-node-01 ~]# echo $?
1
[root@r8-node-01 ~]# pcs booth ticket add "a-b"
[root@r8-node-01 ~]# echo $?
0
[root@r8-node-01 ~]# pcs booth ticket add "$(printf 'b%.0s' {1..63})"
[root@r8-node-01 ~]# echo $?
0
[root@r8-node-01 ~]# pcs booth config
authfile = /etc/booth/booth.key
site = 127.0.0.1
site = 127.0.0.2
site = 127.0.0.3
ticket = "TicketA"
  mode = manual
ticket = "TicketB"
  mode = auto
ticket = "a-b"
ticket = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"

Comment 22 errata-xmlrpc 2022-11-08 09:12:53 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: pcs security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:7447


Note You need to log in before you can comment on or make changes to this bug.