generalise the skipping sete{u,g}id() case for Coherent, not just BeOS

This commit is contained in:
tg 2012-05-04 21:57:38 +00:00
parent 893ff18d59
commit 401116766b
2 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,5 @@
#!/bin/sh
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.559 2012/05/04 21:42:50 tg Exp $'
srcversion='$MirOS: src/bin/mksh/Build.sh,v 1.560 2012/05/04 21:57:36 tg Exp $'
#-
# Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012
@ -494,6 +494,8 @@ BeOS)
esac
# BeOS has no real tty either
add_cppflags -DMKSH_UNEMPLOYED
# BeOS doesn't have different UIDs and GIDs
add_cppflags -DMKSH__NO_SETEUGID
;;
BSD/OS)
: ${HAVE_SETLOCALE_CTYPE=0}
@ -501,6 +503,7 @@ BSD/OS)
Coherent)
oswarn="; it has major issues"
check_categories="$check_categories nosymlink"
add_cppflags -DMKSH__NO_SETEUGID
;;
CYGWIN*)
: ${HAVE_SETLOCALE_CTYPE=0}
@ -1405,7 +1408,7 @@ else
#define EXTERN
#define MKSH_INCLUDES_ONLY
#include "sh.h"
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.559 2012/05/04 21:42:50 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/Build.sh,v 1.560 2012/05/04 21:57:36 tg Exp $");
int main(void) { printf("Hello, World!\n"); return (0); }
EOF
case $cm in

8
misc.c
View File

@ -30,7 +30,7 @@
#include <grp.h>
#endif
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.189 2012/05/04 20:49:06 tg Exp $");
__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.190 2012/05/04 21:57:38 tg Exp $");
/* type bits for unsigned char */
unsigned char chtypes[UCHAR_MAX + 1];
@ -254,13 +254,11 @@ change_flag(enum sh_flag f, int what, unsigned int newval)
#else
/* seteuid, setegid, setgid don't EAGAIN on Linux */
ksheuid = kshuid = getuid();
#ifndef __BEOS__
/* BeOS doesn't have different UIDs */
#ifndef MKSH__NO_SETEUGID
seteuid(ksheuid);
#endif
DO_SETUID(setuid, (ksheuid));
#ifndef __BEOS__
/* BeOS doesn't have different GIDs */
#ifndef MKSH__NO_SETEUGID
setegid(kshegid);
#endif
setgid(kshegid);