Bug 1126827 - Change the contexts on the directory
Summary: Change the contexts on the directory
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libsemanage
Version: 7.0
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Daniel Walsh
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-05 11:38 UTC by Ardelean Calin
Modified: 2014-08-05 13:24 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-05 13:24:53 UTC


Attachments (Terms of Use)

Description Ardelean Calin 2014-08-05 11:38:52 UTC
Description of problem:

line 4 has invalid regex /ftp/*:  out of memory
Version-Release number of selected component (if applicable):


How reproducible:
semanage fcontext -a -s system_u -t public_content_t /ftp/*

Steps to Reproduce:
1.[root@server1 ~]#  ls -Zd /ftp
drwxr-xr-x. root root unconfined_u:object_r:default_t:s0 /ftp
2.[root@server1 ~]# chcon -R --reference /var/ftp /ftp
  [root@server1 ~]#  ls -Zd /ftp
drwxr-xr-x. root root system_u:object_r:public_content_t:s0 /ftp
  [root@server1 ~]# restorecon -R /ftp
  [root@server1 ~]#  ls -Zd /ftp
drwxr-xr-x. root root system_u:object_r:default_t:s0   /ftp
3.
[root@server1 ~]# semanage fcontext -a -s system_u -t public_content_t /ftp/*
/etc/selinux/targeted/contexts/files/file_contexts.local:  line 4 has invalid regex /ftp/*:  out of memory
PCRE study failed for ^/*$: (null)
libsemanage.sefcontext_compile: sefcontext_compile returned error code 255. Compiling /etc/selinux/targeted/contexts/files/file_contexts.local
/etc/selinux/targeted/contexts/files/file_contexts.local:  line 4 has invalid regex /ftp/*:  out of memory
PCRE study failed for ^/*$: (null)
libsemanage.sefcontext_compile: sefcontext_compile returned error code 255. Compiling /etc/selinux/targeted/contexts/files/file_contexts.local
ValueError: Could not commit semanage transaction
Actual results:

Expected results:


Additional info:
libsemanage-2.1.10-16.el7.x86_64
libsemanage-python-2.1.10-16.el7.x86_64
3.10.0-123.el7.x86_6

Comment 1 Milos Malik 2014-08-05 12:03:58 UTC
The path needs to be specified as regexp. Do following commands work for you?

# semanage fcontext -a -t public_content_t "/ftp(/.*)?"

# semanage fcontext -d -t public_content_t "/ftp(/.*)?"

#

Comment 3 Ardelean Calin 2014-08-05 12:20:13 UTC
(In reply to Milos Malik from comment #1)
> The path needs to be specified as regexp. Do following commands work for you?
> 
> # semanage fcontext -a -t public_content_t "/ftp(/.*)?"
> 
> # semanage fcontext -d -t public_content_t "/ftp(/.*)?"
> 
> #

Yes is working 
Thank You


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