Bug 494907 - chcat has flaky parsing of category ranges
Summary: chcat has flaky parsing of category ranges
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: policycoreutils
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks: 494910
TreeView+ depends on / blocked
 
Reported: 2009-04-08 16:49 UTC by Steve Bonneville
Modified: 2009-11-24 11:49 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 494910 (view as bug list)
Environment:
Last Closed: 2009-11-24 11:49:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Steve Bonneville 2009-04-08 16:49:05 UTC
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 11:49:53 UTC
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.