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 #!/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, # Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012 # 2011, 2012
@ -494,6 +494,8 @@ BeOS)
esac esac
# BeOS has no real tty either # BeOS has no real tty either
add_cppflags -DMKSH_UNEMPLOYED add_cppflags -DMKSH_UNEMPLOYED
# BeOS doesn't have different UIDs and GIDs
add_cppflags -DMKSH__NO_SETEUGID
;; ;;
BSD/OS) BSD/OS)
: ${HAVE_SETLOCALE_CTYPE=0} : ${HAVE_SETLOCALE_CTYPE=0}
@ -501,6 +503,7 @@ BSD/OS)
Coherent) Coherent)
oswarn="; it has major issues" oswarn="; it has major issues"
check_categories="$check_categories nosymlink" check_categories="$check_categories nosymlink"
add_cppflags -DMKSH__NO_SETEUGID
;; ;;
CYGWIN*) CYGWIN*)
: ${HAVE_SETLOCALE_CTYPE=0} : ${HAVE_SETLOCALE_CTYPE=0}
@ -1405,7 +1408,7 @@ else
#define EXTERN #define EXTERN
#define MKSH_INCLUDES_ONLY #define MKSH_INCLUDES_ONLY
#include "sh.h" #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); } int main(void) { printf("Hello, World!\n"); return (0); }
EOF EOF
case $cm in case $cm in

8
misc.c
View File

@ -30,7 +30,7 @@
#include <grp.h> #include <grp.h>
#endif #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 */ /* type bits for unsigned char */
unsigned char chtypes[UCHAR_MAX + 1]; unsigned char chtypes[UCHAR_MAX + 1];
@ -254,13 +254,11 @@ change_flag(enum sh_flag f, int what, unsigned int newval)
#else #else
/* seteuid, setegid, setgid don't EAGAIN on Linux */ /* seteuid, setegid, setgid don't EAGAIN on Linux */
ksheuid = kshuid = getuid(); ksheuid = kshuid = getuid();
#ifndef __BEOS__ #ifndef MKSH__NO_SETEUGID
/* BeOS doesn't have different UIDs */
seteuid(ksheuid); seteuid(ksheuid);
#endif #endif
DO_SETUID(setuid, (ksheuid)); DO_SETUID(setuid, (ksheuid));
#ifndef __BEOS__ #ifndef MKSH__NO_SETEUGID
/* BeOS doesn't have different GIDs */
setegid(kshegid); setegid(kshegid);
#endif #endif
setgid(kshegid); setgid(kshegid);