backout 17533968/17817727/17699248/17777549/18119738/18229654/16169978/18302723/16507675/18920300/18355790/19907453/18426052/20808157/20948390/20948350 - causes 21091065
--- a/src/cmd/ksh93/sh/args.c Thu Sep 2 22:38:27 2010
+++ b/src/cmd/ksh93/sh/args.c Tue Sep 27 10:48:45 2011
@@ -26,6 +26,9 @@
* AT&T Labs
*
*/
+/*
+ * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
+ */
#include "defs.h"
#include "path.h"
@@ -302,6 +305,11 @@
}
else
{
+ if ((o == SH_RESTRICTED) &&
+ sh_isoption(SH_RESTRICTED)) {
+ errormsg(SH_DICT, ERROR_exit(1),
+ e_restricted, "r");
+ }
if(o==SH_XTRACE)
trace = 0;
off_option(&newflags,o);