diff --git a/misc.c b/misc.c index e7b32c9..c9ec29f 100644 --- a/misc.c +++ b/misc.c @@ -29,7 +29,7 @@ #include #endif -__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.139 2010/07/04 17:33:55 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/misc.c,v 1.140 2010/07/13 13:07:56 tg Exp $"); unsigned char chtypes[UCHAR_MAX + 1]; /* type bits for unsigned char */ @@ -329,6 +329,12 @@ parse_args(const char **argv, break; } i = option(go.optarg); + if ((enum sh_flag)i == FARC4RANDOM) { + warningf(true, "Do not use set ±o arc4random," + " it will be removed in the next version" + " of mksh!"); + return (0); + } if ((i != (size_t)-1) && set == Flag(i)) /* Don't check the context if the flag * isn't changing - makes "set -o interactive" diff --git a/mksh.1 b/mksh.1 index 92c09c1..e3eb68a 100644 --- a/mksh.1 +++ b/mksh.1 @@ -1,4 +1,4 @@ -.\" $MirOS: src/bin/mksh/mksh.1,v 1.228 2010/07/11 11:17:31 tg Exp $ +.\" $MirOS: src/bin/mksh/mksh.1,v 1.229 2010/07/13 13:07:56 tg Exp $ .\" $OpenBSD: ksh.1,v 1.134 2010/05/10 21:04:54 jmc Exp $ .\"- .\" Copyright © 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 @@ -71,7 +71,7 @@ .\" with -mandoc, it might implement .Mx itself, but we want to .\" use our own definition. And .Dd must come *first*, always. .\" -.Dd $Mdocdate: July 11 2010 $ +.Dd $Mdocdate: July 13 2010 $ .\" .\" Check which macro package we use .\" @@ -3852,6 +3852,11 @@ during file name generation. Print commands and parameter assignments when they are executed, preceded by the value of .Ev PS4 . +.It Ic arc4random +Deprecated, will be removed in +.Nm +R40. +Do not use, emits a warning to stderr. .It Ic bgnice Background jobs are run with lower priority. .It Ic braceexpand diff --git a/sh_flags.h b/sh_flags.h index 5a9e02c..aa5481e 100644 --- a/sh_flags.h +++ b/sh_flags.h @@ -1,5 +1,5 @@ #if defined(SHFLAGS_DEFNS) -__RCSID("$MirOS: src/bin/mksh/sh_flags.h,v 1.6 2010/07/04 17:33:58 tg Exp $"); +__RCSID("$MirOS: src/bin/mksh/sh_flags.h,v 1.7 2010/07/13 13:07:58 tg Exp $"); #define FN(sname,cname,ochar,flags) /* nothing */ #elif defined(SHFLAGS_ENUMS) #define FN(sname,cname,ochar,flags) cname, @@ -21,6 +21,9 @@ __RCSID("$MirOS: src/bin/mksh/sh_flags.h,v 1.6 2010/07/04 17:33:58 tg Exp $"); /* -a all new parameters are created with the export attribute */ F0("allexport", FEXPORT, 'a', OF_ANY) +/* ./. backwards compat: dummy, emits a warning */ +FN("arc4random", FARC4RANDOM, 0, OF_ANY) + #if HAVE_NICE /* ./. bgnice */ FN("bgnice", FBGNICE, 0, OF_ANY)