projects
/
unix-history
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
67c9e20
)
Forgot to set SUGID in set-id exec.
author
Garrett Wollman
<wollman@FreeBSD.org>
Tue, 15 Mar 1994 03:55:35 +0000
(
03:55
+0000)
committer
Garrett Wollman
<wollman@FreeBSD.org>
Tue, 15 Mar 1994 03:55:35 +0000
(
03:55
+0000)
sys/kern/kern_execve.c
patch
|
blob
|
blame
|
history
diff --git
a/sys/kern/kern_execve.c
b/sys/kern/kern_execve.c
index
6f68fe9
..
1f7540d
100644
(file)
--- a/
sys/kern/kern_execve.c
+++ b/
sys/kern/kern_execve.c
@@
-28,7
+28,7
@@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: kern_execve.c,v 1.1
6 1994/03/15 01:58:29
wollman Exp $
+ * $Id: kern_execve.c,v 1.1
7 1994/03/15 02:48:35
wollman Exp $
*/
#include "param.h"
*/
#include "param.h"
@@
-258,6
+258,8
@@
interpret:
}
/* implement set userid/groupid */
}
/* implement set userid/groupid */
+ p->p_flag &= ~SUGID;
+
/*
* Turn off kernel tracing for set-id programs, except for
* root.
/*
* Turn off kernel tracing for set-id programs, except for
* root.
@@
-271,10
+273,12
@@
interpret:
if ((attr.va_mode&VSUID) && (p->p_flag & STRC) == 0) {
p->p_ucred = crcopy(p->p_ucred);
p->p_ucred->cr_uid = attr.va_uid;
if ((attr.va_mode&VSUID) && (p->p_flag & STRC) == 0) {
p->p_ucred = crcopy(p->p_ucred);
p->p_ucred->cr_uid = attr.va_uid;
+ p->p_flag |= SUGID;
}
if ((attr.va_mode&VSGID) && (p->p_flag & STRC) == 0) {
p->p_ucred = crcopy(p->p_ucred);
p->p_ucred->cr_groups[0] = attr.va_gid;
}
if ((attr.va_mode&VSGID) && (p->p_flag & STRC) == 0) {
p->p_ucred = crcopy(p->p_ucred);
p->p_ucred->cr_groups[0] = attr.va_gid;
+ p->p_flag |= SUGID;
}
/*
}
/*
@@
-296,9
+300,6
@@
interpret:
/* clear "fork but no exec" flag, as we _are_ execing */
p->p_acflag &= ~AFORK;
/* clear "fork but no exec" flag, as we _are_ execing */
p->p_acflag &= ~AFORK;
- /* clear `set id since last exec' flag */
- p->p_flag &= ~SUGID;
-
/* Set entry address */
setregs(p, iparams->entry_addr, stack_base);
/* Set entry address */
setregs(p, iparams->entry_addr, stack_base);