Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Kate
Commits
7f087a8a
Commit
7f087a8a
authored
Dec 31, 2021
by
Nate Graham
Committed by
Christoph Cullmann
Dec 31, 2021
Browse files
Show a less patronizing message when trying to run with sudo or kdesu
parent
db468760
Pipeline
#116475
passed with stage
in 4 minutes and 12 seconds
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
kate/main.cpp
View file @
7f087a8a
...
...
@@ -49,15 +49,15 @@ int main(int argc, char **argv)
// Prohibit using sudo or kdesu (but allow using the root user directly)
if
(
getuid
()
==
0
)
{
if
(
!
qEnvironmentVariableIsEmpty
(
"SUDO_USER"
))
{
std
::
cout
<<
"
Execut
ing Kate with sudo
is not possible due to unfixable
security vulnerabilities. "
"I
t is also not necessary; simply
use Kate normally
,
and you will be prompted for "
"
elevated privileges when
saving documents if needed."
std
::
cout
<<
"
Runn
ing Kate with sudo
can cause bugs and expose you to
security vulnerabilities. "
"I
nstead
use Kate normally and you will be prompted for
elevated privileges when
"
"saving documents if needed."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
else
if
(
!
qEnvironmentVariableIsEmpty
(
"KDESU_USER"
))
{
std
::
cout
<<
"
Execut
ing Kate with kdesu
is not possible due to unfixable
security vulnerabilities. "
"I
t is also not necessary; simply
use Kate normally
,
and you will be prompted for "
"
elevated privileges when
saving documents if needed."
std
::
cout
<<
"
Runn
ing Kate with kdesu
can cause bugs and expose you to
security vulnerabilities. "
"I
nstead
use Kate normally and you will be prompted for
elevated privileges when
"
"saving documents if needed."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
...
...
kwrite/main.cpp
View file @
7f087a8a
...
...
@@ -41,15 +41,15 @@ extern "C" Q_DECL_EXPORT int main(int argc, char **argv)
// Prohibit using sudo or kdesu (but allow using the root user directly)
if
(
getuid
()
==
0
)
{
if
(
!
qEnvironmentVariableIsEmpty
(
"SUDO_USER"
))
{
std
::
cout
<<
"
Execut
ing KWrite with sudo
is not possible due to unfixable
security vulnerabilities. "
"I
t is also not necessary; simply
use KWrite normally
,
and you will be prompted for "
"
elevated privileges when
saving documents if needed."
std
::
cout
<<
"
Runn
ing KWrite with sudo
can cause bugs and expose you to
security vulnerabilities. "
"I
nstead
use KWrite normally and you will be prompted for
elevated privileges when
"
"saving documents if needed."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
else
if
(
!
qEnvironmentVariableIsEmpty
(
"KDESU_USER"
))
{
std
::
cout
<<
"
Execut
ing KWrite with kdesu
is not possible due to unfixable
security vulnerabilities. "
"I
t is also not necessary; simply
use KWrite normally
,
and you will be prompted for "
"
elevated privileges when
saving documents if needed."
std
::
cout
<<
"
Runn
ing KWrite with kdesu
can cause bugs and expose you to
security vulnerabilities. "
"I
nstead
use KWrite normally and you will be prompted for
elevated privileges when
"
"saving documents if needed."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment