Bug 1139001

Summary: "mkdir: cannot create directory '$HOME/.cache': Permission denied" warning when opening shell without write on $HOME
Product: Red Hat Enterprise Linux 7 Reporter: Pavel Moravec <pmoravec>
Component: abrtAssignee: Jakub Filak <jfilak>
Status: CLOSED ERRATA QA Contact: Iveta Wiedermann <isenfeld>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: dcleal, hkim, isenfeld, jberan, jfilak, mmalik, pmoravec, rvokal
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: abrt-2.1.11-13.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 13:26:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1141485    
Bug Blocks: 1115190    

Description Pavel Moravec 2014-09-07 11:21:44 UTC
Description of problem:
Any run of foreman-rake on RHEL7 raises error:
mkdir: cannot create directory '/usr/share/foreman/.cache': Permission denied

It seems the error has no impact to any foreman command I used.

Trying on RHEL6 on the same RPM version (foreman-1.6.0.44-1.el6sat.noarch), the mkdir error is not raised.

Version-Release number of selected component (if applicable):
foreman-1.6.0.44-1.el7sat.noarch


How reproducible:
100%


Steps to Reproduce:
1. Execute on Sat6 on RHEL7:
foreman-rake --help
(or any other foreman-rake command like "permissions:reset")


Actual results:
mkdir: cannot create directory '/usr/share/foreman/.cache': Permission denied
(command seems to be executed properly, just the error is printed out)


Expected results:
No such error.


Additional info:
I dont know what is the purpose of .cache directory. If it is important in some cases, please modify BZ severity appropriately.

Comment 2 Dominic Cleal 2014-09-11 15:57:52 UTC
I'm unable to reproduce this at all, and I can't think what ~/.cache would be used for (the only thing that comes to mind is apipie-bindings, which is only in the CLI, not core).

Would you be able to give me temporary access to your host, if still available?

Comment 4 Dominic Cleal 2014-09-12 11:36:07 UTC
This appears to be an ABRT profile.d script that I think should be quieter and more forgiving if the user's home directory is not writeable when creating a login shell.

# getent passwd foreman
foreman:x:994:993:Foreman:/usr/share/foreman:/bin/false
# ll -d /usr/share/foreman
drwxr-xr-x. 13 root root 4096 Sep  7 10:52 /usr/share/foreman
# su - foreman -s /bin/bash -c true
mkdir: cannot create directory '/usr/share/foreman/.cache': Permission denied

# grep -B 4 -r mkdir /etc/profile.d/
/etc/profile.d/abrt-console-notification.sh-LPATHDIR="$HOME/.cache/abrt"
/etc/profile.d/abrt-console-notification.sh-SINCEFILE="$LPATHDIR/lastnotification"
/etc/profile.d/abrt-console-notification.sh-
/etc/profile.d/abrt-console-notification.sh-if [ ! -f "$LPATHDIR" ]; then
/etc/profile.d/abrt-console-notification.sh:    mkdir -p "$LPATHDIR"

# rpm -qf /etc/profile.d/abrt-console-notification.sh
abrt-console-notification-2.1.11-12.el7.x86_64


Steps to reproduce (on clean RHEL 7):
1. su - postfix -s /bin/bash -c true

Expected result:
no output

Actual result:
mkdir: cannot create directory '/var/spool/postfix/.cache': Permission denied

Comment 7 Jakub Filak 2014-09-15 11:32:25 UTC
Upstream commit https://github.com/abrt/abrt/commit/592b7e19a20b38547c5b3c5d81add27ed79e05a9 fixes this bug.

Comment 9 Jakub Filak 2014-09-25 10:10:30 UTC
*** Bug 1114864 has been marked as a duplicate of this bug. ***

Comment 14 errata-xmlrpc 2015-03-05 13:26:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-0556.html