Bug 475116 - Opening new tab fails, if current tab is root shell
Summary: Opening new tab fails, if current tab is root shell
Status: RESOLVED DUPLICATE of bug 470262
Alias: None
Product: yakuake
Classification: Applications
Component: general (other bugs)
Version First Reported In: 23.08.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-01 23:16 UTC by FirstAirBender
Modified: 2024-03-15 21:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
This is what I see when I open a new tab from a tab which is root (48.58 KB, image/png)
2023-10-01 23:16 UTC, FirstAirBender
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FirstAirBender 2023-10-01 23:16:56 UTC
Created attachment 162014 [details]
This is what I see when I open a new tab from a tab which is root

SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Open a tab, and type `sudo -i`
2. From that tab, open a new tab
3. 

OBSERVED RESULT
New tab fails with permission errors. Furthermore, when I exit the root shell in that tab, any further attempts to open a new tab still fails with the same error.

EXPECTED RESULT
A new tab should open as usual to the user's home directory

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version:  5.27.8
KDE Frameworks Version:  5.110.0
Qt Version: 5.15.0

ADDITIONAL INFORMATION
Comment 1 Bug Janitor Service 2024-03-10 21:09:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/konsole/-/merge_requests/961
Comment 2 Christian Muehlhaeuser 2024-03-11 10:55:26 UTC

*** This bug has been marked as a duplicate of bug 470262 ***
Comment 3 Kurt Hindenburg 2024-03-15 21:10:15 UTC
Git commit e4840a2e7cbf006821fbbac5128eaaf585f8125a by Kurt Hindenburg, on behalf of Christian Muehlhaeuser.
Committed on 15/03/2024 at 21:06.
Pushed by hindenburg into branch 'master'.

Fallback to home dir if initial working dir is inaccessible

In cases where the initial working is inaccessible by the current
user, we should fallback to their home directory.

This can easily be triggered by changing the working dir to an
otherwise inaccessible dir for the current user (e.g. /etc/sudoers.d
inside a root shell), followed by opening a new session.
Related: bug 470262, bug 469249

M  +3    -1    src/session/Session.cpp

https://invent.kde.org/utilities/konsole/-/commit/e4840a2e7cbf006821fbbac5128eaaf585f8125a