Bug 494907 - chcat has flaky parsing of category ranges
chcat has flaky parsing of category ranges
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: policycoreutils (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
BaseOS QE
:
Depends On:
Blocks: 494910
  Show dependency treegraph
 
Reported: 2009-04-08 12:49 EDT by Steve Bonneville
Modified: 2009-11-24 06:49 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 494910 (view as bug list)
Environment:
Last Closed: 2009-11-24 06:49:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Steve Bonneville 2009-04-08 12:49:05 EDT
Description of problem:

The chcat Python script has some serious parsing issues when attempting to update contexts, especially when category ranges are involved.

Case 1:
  # chcat c1 /tmp/file; chcat +c2 /tmp/file; chcat +c3 /tmp/file
  # chcat +c5 /tmp/file
  # ls -Z /tmp/file
  -rw-r--r--  root root user_u:object_r:tmp_t:s0:c1.c3,c5 /tmp/file
(fine so far...)
  # chcat +c4 /tmp/file
  /usr/bin/chcat: invalid literal for int(): 3,c5

Case 2:
  # chcon -l s0:c1,c3,c5,c7,c9 /tmp/file
  # ls -Z /tmp/file
  -rw-r--r--  root root user_u:object_r:tmp_t:s0:c1,c3,c5,c7,c9 /tmp/file
  # chcat +c4 /tmp/file
  # ls -Z /tmp/file
  -rw-r--r--  root root user_u:object_r:tmp_t:s0:c1,c3.c5,c7,c9 /tmp/file
(fine so far...)
  # chcat +c6 /tmp/file
  /usr/bin/chcat: invalid literal for int(): 1,c3

Version-Release number of selected component (if applicable):

  policycoreutils-1.33.12-14.2.el5
Comment 2 Miroslav Grepl 2009-11-24 06:49:53 EST
This is already fixed in policycoreutils-1.33.12-14.6.el5

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