View Issue Details

IDProjectCategoryView StatusLast Update
0016786CentOS-8selinux-policypublic2019-11-30 22:09
Status newResolutionopen 
Product Version8.0.1905 
Target VersionFixed in Version 
Summary0016786: libsemanage error while setup custom user home dir.
DescriptionI want to set /var/www/html/user as home dir for new user. As I do it in CentOS 7 I need:
1) Install semanage (previosly it was called policycoreutils-python):
yum -y install policycoreutils-python-utils
2) Configure context:
usepasswd=true in /var/selinux/semanage.conf
semanage fcontext -a -t home_root_t /var/www/html
semanage fcontext -a -t user_home_dir_t /var/www/html/user
3) Apply:
restorecon -R -v /var/www/html
But I get an error at step 2:
libsemanage.get_home_dirs: Error while fetching users. Returning list so far.
As result when when login as user - can't change dir to home. If I disable SELinux - all works fine, enable and can'r reach home again.
Same code works fine at last build of Centos 7.7.




2019-11-30 22:09

reporter   ~0035786

Steps to Reproduce:
1. Install CentOS 8.0.1905 "Minimum Install" and login as root.
2. Enable usepasswd:
sed -i "s#usepasswd=.*#usepasswd=true#" /etc/selinux/semanage.conf
3. (Optional) Add new user with custom home:
mkdir -m 0751 -p /var/www/html
useradd -d /var/www/html/user user
passwd user
4. Run
5. Get message:
"libsemanage.get_home_dirs: Error while fetching users. Returning list so far."

Same error I got with semanage. In Centos 7 set "usepasswd=true" and restorecon was enough.

Issue History

Date Modified Username Field Change
2019-11-30 13:17 WSairus New Issue
2019-11-30 13:17 WSairus Tag Attached: selinux
2019-11-30 22:09 WSairus Note Added: 0035786