mailutils/silent-rpmlint-with_initgroups.patch

41 lines
1001 B
Diff

---
comsat/comsat.c | 1 +
comsat/comsat.h | 1 +
pop3d/user.c | 4 +++-
3 files changed, 5 insertions(+), 1 deletion(-)
--- comsat/comsat.c
+++ comsat/comsat.c 2018-06-07 08:51:30.882263156 +0000
@@ -516,6 +516,7 @@ change_user (const char *user)
return 1;
}
+ initgroups (user, pw->pw_gid);
setgid (pw->pw_gid);
setuid (pw->pw_uid);
chdir (pw->pw_dir);
--- comsat/comsat.h
+++ comsat/comsat.h 2018-06-07 09:57:24.467620564 +0000
@@ -36,6 +36,7 @@
#include <syslog.h>
#include <string.h>
#include <pwd.h>
+#include <grp.h>
#include <confpaths.h>
--- pop3d/user.c
+++ pop3d/user.c 2018-06-07 08:56:38.448784813 +0000
@@ -38,8 +38,10 @@ pop3d_begin_session ()
return ERR_LOGIN_DELAY;
}
- if (auth_data->change_uid)
+ if (auth_data->change_uid) {
+ initgroups (auth_data->name, auth_data->gid);
setuid (auth_data->uid);
+ }
if (manlock_open_mailbox (&mbox, auth_data->mailbox, 0,
MU_STREAM_CREAT | MU_STREAM_RDWR))