Don't assume setuid() cannot fail for suid root applications.
This commit is contained in:
parent
ce1c89634d
commit
869f68a326
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=164914
@ -8,6 +8,7 @@
|
||||
|
||||
PORTNAME= arts
|
||||
PORTVERSION= 1.5.3
|
||||
PORTREVISION= 1
|
||||
PORTEPOCH= 1
|
||||
CATEGORIES= audio kde
|
||||
MASTER_SITES= ${MASTER_SITE_KDE}
|
||||
|
33
audio/arts/files/patch-arts-1.2.x
Normal file
33
audio/arts/files/patch-arts-1.2.x
Normal file
@ -0,0 +1,33 @@
|
||||
Index: soundserver/artswrapper.c
|
||||
===================================================================
|
||||
--- soundserver/artswrapper.c (revision 546970)
|
||||
+++ soundserver/artswrapper.c (working copy)
|
||||
@@ -95,6 +95,10 @@ int main(int argc, char **argv)
|
||||
#else
|
||||
setreuid(-1, getuid());
|
||||
#endif
|
||||
+ if (geteuid() != getuid()) {
|
||||
+ perror("setuid()");
|
||||
+ return 2;
|
||||
+ }
|
||||
}
|
||||
|
||||
if(argc == 0)
|
||||
Index: soundserver/crashhandler.cc
|
||||
===================================================================
|
||||
--- soundserver/crashhandler.cc (revision 546970)
|
||||
+++ soundserver/crashhandler.cc (working copy)
|
||||
@@ -196,7 +196,12 @@ CrashHandler::defaultCrashHandler (int s
|
||||
argv[i++] = NULL;
|
||||
|
||||
setgid(getgid());
|
||||
- setuid(getuid());
|
||||
+ if (getuid() != geteuid())
|
||||
+ setuid(getuid());
|
||||
+ if (getuid() != geteuid()) {
|
||||
+ perror("setuid()");
|
||||
+ exit(255);
|
||||
+ }
|
||||
|
||||
execvp(crashApp, argv);
|
||||
|
@ -93,6 +93,10 @@ int main(int argc, char **argv)
|
||||
#else
|
||||
setreuid(-1, getuid());
|
||||
#endif
|
||||
if (geteuid() != getuid()) {
|
||||
perror("setuid()");
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
|
||||
if(argc == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user