- Panel: Clean code for creating new text file
And use global actions for creating new text file and directories in panel
context menu.
- Panel: Create new local text files directly with QFile
Umask is applied.
nmel |
Krusader |
And use global actions for creating new text file and directories in panel
context menu.
Umask is applied.
No Linters Available |
No Unit Test Coverage |
Buildable 8777 | |
Build 8795: arc lint + arc unit |
Refactoring code is fine, however setting 644 unconditionally introduces a security issue. The permissions for new files should follow umask setting. Otherwise users may unintentionally share their new files with other users.
Since KIO::CopyJob::setDefaultPermissions does not work and all this KIO mambo jumbo is actually needed only for non-local FS, should we split this code and handle file creation for local and non-local files differently? I haven't checked yet, but I guess QFile should be able to handle umask correctly. If not, there are bunch of other ways to create a local file.
You're right Nikita. I changed it now so that local files are created with QFile. Umask is applied here.
Actually the code belongs into the FileSystem package, but thats a bigger change I'll eventually do later.
Alex, it looks good now - thanks! Let me test it and I'll get back to you in a few days.
Tested with various umasks and local / remote fs - works nicely. Please don't forget to fix the build (and possibly, the commit messages) before merging. Thanks!
krusader/Panel/panelfunc.cpp | ||
---|---|---|
518 | code suggestion: return here and on line 524 could be combined into a single return inside the parent if | |
523 | Doesn't build: missing semicolon. |
Thanks! Landed (Hope this revision will close itself).
krusader/Panel/panelfunc.cpp | ||
---|---|---|
518 | I think its more clear with two returns. |