author | John Beck <John.Beck@Oracle.COM> |
Mon, 03 Apr 2017 16:07:26 -0700 | |
changeset 7826 | a45cf4c68b08 |
permissions | -rw-r--r-- |
7826
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
1 |
This patch was developed by a customer at New York University, as part of |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
2 |
the analysis of a bug that was only discovered because the customer was |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
3 |
building procmail as root, triggering TOGGLE_SGID_OK to be set, which in |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
4 |
turn triggered CAN_toggle_sgid to be set, which is checked via logical OR |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
5 |
with accspooldir when deciding about the privileges needed to set[rg]id. |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
6 |
The patch will be submitted upstream. |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
7 |
|
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
8 |
--- procmail-3.22/src/foldinfo.c.orig 2001-09-10 21:57:32.000000000 +0000 |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
9 |
+++ procmail-3.22/src/foldinfo.c 2017-04-03 09:35:21.186639287 +0000 |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
10 |
@@ -185,9 +185,9 @@ |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
11 |
*chp='\0'; /* strip off the filename */ |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
12 |
if(!stat(buf,&stbuf)) |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
13 |
{ unsigned wwsdir; |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
14 |
- accspooldir=(wwsdir= /* world writable spool dir? */ |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
15 |
- ((S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH)&stbuf.st_mode)== |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
16 |
- (S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH) |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
17 |
+ accspooldir=((wwsdir= /* world writable spool dir? */ |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
18 |
+ (((S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH)&stbuf.st_mode)== |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
19 |
+ (S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH))) |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
20 |
<<1| /* note it in bit 1 */ |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
21 |
uid==stbuf.st_uid); /* we own the spool dir, note it in bit 0 */ |
a45cf4c68b08
20823016 Solaris bundled procmail cannot read ~/.procmailrc under certain conditions
John Beck <John.Beck@Oracle.COM>
parents:
diff
changeset
|
22 |
if((CAN_toggle_sgid||accspooldir)&&privileged) |