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 1417106 - Logrotate Errors on Username/Groups with Spaces
Summary: Logrotate Errors on Username/Groups with Spaces
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: logrotate
Version: 7.2
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: rc
: ---
Assignee: Kamil Dudka
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-27 09:13 UTC by MarkS
Modified: 2017-01-30 11:46 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-30 11:46:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description MarkS 2017-01-27 09:13:36 UTC
Description of problem:
If you use a space in a user/group name then logrotate will error out indicating that the usage was wrong.

Version-Release number of selected component (if applicable):
I do not believe this is version related but in my test it was: logrotate-3.8.6-7.el7_2.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. Create a logrotate configuration and use a group name with spaces in the "su" or "create" directives.
2. Run: logrotate -d config
3. Error outputted

Actual results:
# cat /etc/logrotate.d/test
/var/log/test/*.log {
    su Test "Test Group"
    weekly
    rotate 10
    copytruncate
    delaycompress
    compress
    notifempty
    missingok
}

# logrotate -d /etc/logrotate.d/test
reading config file /etc/logrotate.d/test
error: /etc/logrotate.d/test:2 extra arguments for su
error: found error in /var/log/test/*.log , skipping
removing last 1 log configs
Allocating hash table for state file, size 64 entries

Handling 0 logs

Expected results:
Whilst spaces are not traditionally used in groups and users and indeed I am certain a lot of tools wouldn't accept it in the username. We have integration with Active Directory where it is acceptable. As such I would expect logrotate to handle the group name with spaces at least but preferably user and group.

Additional info:
I did experiment with other possible styles of inputting the group.

su Test Test\ Group
error: /etc/logrotate.d/test:2 extra arguments for su

su Test "Test\ Group"
error: /etc/logrotate.d/test:2 extra arguments for su

su Test Test\040Group
error: /etc/logrotate.d/test:2 unknown group 'Test\040Group'

(1024 is the GID of "Test Group")
su Test 1024
error: /etc/logrotate.d/test:2 unknown group '1024'

Comment 2 Kamil Dudka 2017-01-30 11:46:31 UTC
This needs to be implemented upstream first.  Please submit a patch including a test-case at https://github.com/logrotate/logrotate/pulls and get it reviewed by the upstream community.  For RHEL-7, closing WONTFIX.  If you are a customer of Red Hat, please contact Product Support.


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