Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107138911
D32460.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
692 B
Referenced Files
None
Subscribers
None
D32460.diff
View Options
diff --git a/crypto/openssh/auth.c b/crypto/openssh/auth.c
--- a/crypto/openssh/auth.c
+++ b/crypto/openssh/auth.c
@@ -39,6 +39,7 @@
# include <paths.h>
#endif
#include <pwd.h>
+#include <grp.h>
#ifdef HAVE_LOGIN_H
#include <login.h>
#endif
@@ -983,6 +984,13 @@
}
closefrom(STDERR_FILENO + 1);
+ if (geteuid() == 0 &&
+ initgroups(pw->pw_name, pw->pw_gid) == -1) {
+ error("%s: initgroups(%s, %u): %s", tag,
+ pw->pw_name, (u_int)pw->pw_gid, strerror(errno));
+ _exit(1);
+ }
+
/* Don't use permanently_set_uid() here to avoid fatal() */
if (setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) != 0) {
error("%s: setresgid %u: %s", tag, (u_int)pw->pw_gid,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jan 11, 5:36 PM (20 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15756172
Default Alt Text
D32460.diff (692 B)
Attached To
Mode
D32460: OpenSSH: cherry-pick "need initgroups() before setresgid()"
Attached
Detach File
Event Timeline
Log In to Comment