Bug 494907 - chcat has flaky parsing of category ranges
chcat has flaky parsing of category ranges
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: policycoreutils (Show other bugs)
All Linux
low Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
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)
Last Closed: 2009-11-24 06:49:53 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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):

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.