Bug 447779 - Creating a new file from templates requires root password
Summary: Creating a new file from templates requires root password
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: git master
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KIO Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-01 15:17 UTC by Fushan Wen
Modified: 2022-01-03 14:24 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fushan Wen 2022-01-01 15:17:07 UTC
SUMMARY
Creating a new file from templates requires password. If I click cancel, the owner of the file will not be changed to root.


STEPS TO REPRODUCE
1. Cd to a home folder
2. Create a file from templates, e.g. a LibreOffice Document template

OBSERVED RESULT
"Authentication Required" dialog pops up. If I click "Cancel", the ownership of the file will not be changed to root.

EXPECTED RESULT
No "Authentication Required" dialog

SOFTWARE/OS VERSIONS
Information for package kio:
----------------------------
Repository     : unstable-kde-frameworks
Name           : kio
Version        : 5.89.0git.20211229T171155~2f75d9039-ku.23.1
Arch           : x86_64
Vendor         : obs://build.opensuse.org/KDE:Unstable
Installed Size : 4.7 MiB
Installed      : Yes
Status         : up-to-date
Source package : kio-5.89.0git.20211229T171155~2f75d9039-ku.23.1.src
Summary        : Network transparent access to files and data
Comment 1 Bug Janitor Service 2022-01-02 14:24:39 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kio/-/merge_requests/691
Comment 2 Fushan Wen 2022-01-03 14:24:54 UTC
Git commit a9a84e8ad1bb4ad4b09395eb9da3e1a240b09b2b by Fushan Wen.
Committed on 03/01/2022 at 14:22.
Pushed by fusionfuture into branch 'master'.

file_unix: Do not try to preserve ownership when permission is -1

When the permission mode is set to -1, it means the copy job doesn't want to
touch the dest permissions, but the dest ownership is always touched, which
results in root password being required when creating a new file from
templates.

This commit makes the copy job ignore dest ownership when the permission
mode is -1, so no authentication dialog will pop up when creating a new
file from templates.

M  +4    -2    src/core/filecopyjob.h
M  +2    -1    src/core/slavebase.h
M  +9    -7    src/ioslaves/file/file_unix.cpp

https://invent.kde.org/frameworks/kio/commit/a9a84e8ad1bb4ad4b09395eb9da3e1a240b09b2b