Page MenuHomeFreeBSD

D47828.diff
No OneTemporary

D47828.diff

diff --git a/libexec/comsat/comsat.c b/libexec/comsat/comsat.c
--- a/libexec/comsat/comsat.c
+++ b/libexec/comsat/comsat.c
@@ -212,10 +212,11 @@
struct passwd *p;
unsigned char line[BUFSIZ];
- /* Set effective uid to user in case mail drop is on nfs */
- if ((p = getpwnam(user)) == NULL)
- return;
- if (setuid(p->pw_uid) != 0)
+ /* Set uid/gid/groups to user's in case mail drop is on nfs */
+ if ((p = getpwnam(user)) == NULL ||
+ initgroups(p->pw_name, p->pw_gid) == -1 ||
+ setgid(p->pw_gid) == -1 ||
+ setuid(p->pw_uid) == -1)
return;
if ((fi = fopen(file, "r")) == NULL)

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 20, 4:16 PM (17 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31812486
Default Alt Text
D47828.diff (605 B)

Event Timeline