Skip to content

Commit

Permalink
fix: [admin] Unable to open directories containing blank spaces
Browse files Browse the repository at this point in the history
Directories with blank spaces are incorrectly split

Log: fix open as admin

Bug: https://pms.uniontech.com/bug-view-236923.html
  • Loading branch information
Johnson-zs committed Dec 27, 2023
1 parent 772f054 commit cb3a7e7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/apps/dde-file-manager/pkexec/dde-file-manager-pkexec
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ function run_pkexec() {

function run_app() {
echo "param in run_app: $@"
uid=$2
user_name=$(logname)
uid=$(id -u "$user_name")
echo "runner uid: $uid"
export XDG_RUNTIME_DIR=/run/user/$uid
export WAYLAND_DISPLAY=wayland-0
Expand All @@ -28,19 +29,19 @@ function run_app() {
export GDK_BACKEND=x11
export $(dbus-launch)

dde-file-manager $1 -w `pwd`
dde-file-manager "$1" -w "$(pwd)"
}

echo "run dde-file-manager in $XDG_SESSION_TYPE"
if [ "$XDG_SESSION_TYPE" == "x11" ];then
pkexec dde-file-manager "$@" -w `pwd`
else
echo "current file: $0"
if [ x`id -u` != "x0" ];then
run_pkexec $0 $@
if [ x$(id -u) != "x0" ];then
run_pkexec "$0" "$@"
exit 0
fi

echo "run app: $@"
run_app $@
run_app "$@"
fi

0 comments on commit cb3a7e7

Please sign in to comment.