Bug 1579764
| Summary: | Running 'sudo -s' gives 'error': mkdir: cannot create directory ‘/home/user/.local’: Permission denied | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | James Pearson <james-p> |
| Component: | kde-settings | Assignee: | Jan Grulich <jgrulich> |
| Status: | CLOSED ERRATA | QA Contact: | Desktop QE <desktop-qa-list> |
| Severity: | low | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 7.5 | CC: | amike, bgollahe, cww, huston, jgrulich, jkoten, jwright, steve.traylen, thomas.oulevey, tpelka |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | kde-settings-19-23.9.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2019-08-06 12:57:16 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: | |||
| Bug Blocks: | 1479323, 1656436 | ||
|
Description
James Pearson
2018-05-18 09:35:12 UTC
You can produce the same error whenever HOME is not set. e.g.
$ env -u HOME bash -l -c 'echo "home is ${HOME}"'
mkdir: cannot create directory ‘/.local’: Permission denied
home is
Indeed this is not the way to solve bug 1404382 , kde should create the directories itself. 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://access.redhat.com/errata/RHSA-2019:2141 This fix seems to have broken startup scripts for csh/tcsh users due to using [ ] instead of ( ) :
erigone:~/foo/etc/profile.d# diff -urN kde.csh /etc/profile.d/kde.csh
--- kde.csh 2019-08-27 14:37:03.222817544 -0400
+++ /etc/profile.d/kde.csh 2019-08-14 04:22:09.000000000 -0400
@@ -22,7 +22,7 @@
end
# Fix the user-places.xbel error pop at first user login
-if ( ! -d ${HOME}/.local/share ) then
+if [ ! -d ${HOME}/.local/share -a -w ${HOME} ] then
mkdir -p ${HOME}/.local/share
endif
erigone:~# su - tcshuser
Last login: Tue Aug 27 14:20:29 EDT 2019 on pts/29
if: Expression Syntax.
[tcshuser@erigone ~]$ foreach S ( /etc/profile.d/*.csh )
foreach? echo $S
foreach? source $S
foreach? end
/etc/profile.d/256term.csh
/etc/profile.d/astro.csh
/etc/profile.d/cobbler.csh
/etc/profile.d/colorgrep.csh
/etc/profile.d/colorls.csh
/etc/profile.d/cvs.csh
/etc/profile.d/gnome-ssh-askpass.csh
/etc/profile.d/kde.csh
if: Expression Syntax.
/etc/profile.d/lang.csh
/etc/profile.d/less.csh
/etc/profile.d/mc.csh
/etc/profile.d/modules.csh
/etc/profile.d/puppet-agent.csh
/etc/profile.d/qt-graphicssystem.csh
/etc/profile.d/qt.csh
/etc/profile.d/vim.csh
/etc/profile.d/which2.csh
[tcshuser@erigone ~]$ source .cshrc
erigone:~>
This seems to be the proper syntax (forgot about using && instead of -a as well):
--- kde.csh.1 2019-08-27 14:44:47.141991394 -0400
+++ kde.csh.2 2019-08-27 14:49:37.950857442 -0400
@@ -22,7 +22,7 @@
end
# Fix the user-places.xbel error pop at first user login
-if [ ! -d ${HOME}/.local/share -a -w ${HOME} ] then
+if ( ! -d ${HOME}/.local/share && -w ${HOME} ) then
mkdir -p ${HOME}/.local/share
endif
(In reply to Steve Huston from comment #12) > This fix seems to have broken startup scripts for csh/tcsh users due to > using [ ] instead of ( ) : That's a pretty fundamental error - how did that slip past QA ??? |