summaryrefslogtreecommitdiff
path: root/usr/src/lib/libshell/common/include
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2009-10-28 10:36:39 -0700
committerRoland Mainz <roland.mainz@nrubsig.org>2009-10-28 10:36:39 -0700
commit34f9b3eef6fdadbda0a846aa4d68691ac40eace5 (patch)
tree0b0fdfb35f8eb9324728de5a99e50e939aca650f /usr/src/lib/libshell/common/include
parent14969419acb89bb74e6c95fa472119b710224440 (diff)
downloadillumos-gate-34f9b3eef6fdadbda0a846aa4d68691ac40eace5.tar.gz
Portions contributed by Olga Kryzhanovska <olga.kryzhanovska@gmail.com>
PSARC/2009/063 ksh93 update 2 PSARC/2009/248 ksh93 update to 2009-03-10 PSARC/2009/249 more ksh93 command conversions 6888396 libast sources should not include localedef.h 6605478 ksh93 profile shell option does not work 6631006 ksh93 hangs in situations that ksh handles okay 6661487 logname reports nothing after running the script command 6705126 first call to read doesn't honor new setting of HISTFILE 6764665 *libpp* Array overrun in libpp 6765756 *libast* Array overruns in libast 6769332 Recursive function+command substitutions terminate shell after 257 iterations 6777491 *ksh93* lacks arithmetric function iszero() 6778077 *ksh93* does not understand "THAW" as a signal for use with trap 6789247 [ku1] libast/ksh93 1-digit hexfloat base conversion rounds incorrectly 6791838 *ksh93* unset of a variable which is not set should return 0 6793714 RFE: Update /usr/bin/comm to AT&T AST "comm" 6793719 RFE: Update /usr/bin/cut to AT&T AST "cut" 6793721 RFE: Update /usr/bin/paste to AT&T AST "paste" 6793722 RFE: Update /usr/bin/cmp to AT&T AST "cmp" 6793726 RFE: Update /usr/bin/uniq to AT&T AST "uniq" 6793735 RFE: Update /usr/bin/wc to AT&T AST "wc" 6793744 RFE: Add /usr/share/doc/ksh/ for ksh93 documentation 6793747 RFE: Provide "print" builtin as /usr/bin/print for external applications 6793763 RFE: Update /usr/bin/ksh93 to ast-ksh.2009-05-05 6794952 RFE: Enable "globstar" mode in /etc/ksh.kshrc (= interactive ksh93 shells) 6805792 [ku1] Moving local compound var into array does not work 6805794 [ku1] printf returns "invalid character constant" for $ printf "%d\n" "'<euro>" 6805795 [ku1] ksh93 does not differ between -0 and +0 6805797 [ku1]Can't append to nodes of an array of compound vars if addressing them via nameref 6805799 Indexed compound variable arrays do not work... 6805800 [ku1] Declaring associative compound array does not work 6805813 RFE: Update /usr/bin/join to AT&T AST "join". 6805819 RFE: Update /usr/bin/tee to AT&T AST "tee". 6809663 shlint missing ending newline on errors 6811916 ksh93 repeatedly segfaults when "tee" builtin is interrupted via <ctrl-c> in interactive mode 6821113 SUNWosdem package issues 6828644 RFE: Update /usr/bin/logname to AT&T AST "logname". 6828692 RFE: Update /usr/bin/cksum to AT&T AST "cksum". 6834184 ksh93 gets SIGSEGV if HISTFILE is changed in place. 6834207 ksh93 gets SIGSEGV on interactive function definition with HISTSIZE unset 6835835 ksh93 "cat" builtin does not handle "-n" correctly 6841442 Need exception list for OS/Net trees managed via Subversion 6848486 "echo ${test}" with test undefined crashes the shell 6850672 ksh93 (VISUAL=vi) crashes with memory fault while scrolling through history 6855875 typeset -X x ; print $x # does not print sufficient digits to restore value 6857344 /usr/bin/hash core dump with invalid arguments 6866676 Need test suite module to test the kernel support for compiled shell scripts 6881017 Subshell doesn't exit, holds pipe open preventing callers from exiting 6884409 fts functions in libast library can result in segv with deep dir trees (similar to CERT VU#590371)
Diffstat (limited to 'usr/src/lib/libshell/common/include')
-rw-r--r--usr/src/lib/libshell/common/include/argnod.h4
-rw-r--r--usr/src/lib/libshell/common/include/builtins.h3
-rw-r--r--usr/src/lib/libshell/common/include/defs.h15
-rw-r--r--usr/src/lib/libshell/common/include/edit.h2
-rw-r--r--usr/src/lib/libshell/common/include/env.h2
-rw-r--r--usr/src/lib/libshell/common/include/fault.h2
-rw-r--r--usr/src/lib/libshell/common/include/fcin.h2
-rw-r--r--usr/src/lib/libshell/common/include/history.h2
-rw-r--r--usr/src/lib/libshell/common/include/io.h3
-rw-r--r--usr/src/lib/libshell/common/include/jobs.h20
-rw-r--r--usr/src/lib/libshell/common/include/lexstates.h3
-rw-r--r--usr/src/lib/libshell/common/include/name.h11
-rw-r--r--usr/src/lib/libshell/common/include/national.h2
-rw-r--r--usr/src/lib/libshell/common/include/nval.h3
-rw-r--r--usr/src/lib/libshell/common/include/path.h4
-rw-r--r--usr/src/lib/libshell/common/include/regress.h66
-rw-r--r--usr/src/lib/libshell/common/include/shell.h4
-rw-r--r--usr/src/lib/libshell/common/include/shlex.h4
-rw-r--r--usr/src/lib/libshell/common/include/shnodes.h3
-rw-r--r--usr/src/lib/libshell/common/include/shtable.h2
-rw-r--r--usr/src/lib/libshell/common/include/streval.h17
-rw-r--r--usr/src/lib/libshell/common/include/terminal.h2
-rw-r--r--usr/src/lib/libshell/common/include/test.h6
-rw-r--r--usr/src/lib/libshell/common/include/timeout.h2
-rw-r--r--usr/src/lib/libshell/common/include/ulimit.h2
-rw-r--r--usr/src/lib/libshell/common/include/variables.h49
-rw-r--r--usr/src/lib/libshell/common/include/version.h4
27 files changed, 171 insertions, 68 deletions
diff --git a/usr/src/lib/libshell/common/include/argnod.h b/usr/src/lib/libshell/common/include/argnod.h
index 7d59fb41f1..524cc49d61 100644
--- a/usr/src/lib/libshell/common/include/argnod.h
+++ b/usr/src/lib/libshell/common/include/argnod.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -61,6 +61,8 @@ struct slnod /* struct for link list of stacks */
struct slnod *slnext;
struct slnod *slchild;
Stak_t *slptr;
+ /* slpad aligns struct functnod = struct slnod + 1 on some architectures */
+ struct slnod *slpad;
};
/*
diff --git a/usr/src/lib/libshell/common/include/builtins.h b/usr/src/lib/libshell/common/include/builtins.h
index 9fc32de97d..900bc35937 100644
--- a/usr/src/lib/libshell/common/include/builtins.h
+++ b/usr/src/lib/libshell/common/include/builtins.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -124,6 +124,7 @@ extern const char e_badbase[];
extern const char e_overlimit[];
extern const char e_eneedsarg[];
+extern const char e_oneoperand[];
extern const char e_toodeep[];
extern const char e_badname[];
extern const char e_badsyntax[];
diff --git a/usr/src/lib/libshell/common/include/defs.h b/usr/src/lib/libshell/common/include/defs.h
index f5e03fd98e..57c39b6dec 100644
--- a/usr/src/lib/libshell/common/include/defs.h
+++ b/usr/src/lib/libshell/common/include/defs.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -37,6 +37,7 @@
#include "fault.h"
#include "argnod.h"
#include "name.h"
+#include <ctype.h>
#define _SH_PRIVATE
#include <shcmd.h>
#undef _SH_PRIVATE
@@ -149,6 +150,7 @@ struct limits
pid_t bckpid; /* background process id */ \
pid_t cpid; \
pid_t spid; /* subshell process id */ \
+ pid_t pipepid; \
int32_t ppid; /* parent process id of shell */ \
int topfd; \
int sigmax; /* maximum number of signals */ \
@@ -167,6 +169,7 @@ struct limits
char indebug; /* set when in debug trap */ \
unsigned char lastsig; /* last signal received */ \
char subshare; /* set when in ${..} comsub */ \
+ char toomany; /* set when out of fd's */ \
char *readscript; /* set before reading a script */ \
int *inpipe; /* input pipe pointer */ \
int *outpipe; /* output pipe pointer */ \
@@ -226,10 +229,12 @@ struct limits
Shopt_t glob_options; \
Namval_t *typeinit; \
int *stats; \
- Namfun_t nvfun;
+ Namfun_t nvfun; \
+ struct Regress_s*regress;
#include <shell.h>
+#include "regress.h"
/* error exits from various parts of shell */
#define NIL(type) ((type)0)
@@ -248,8 +253,7 @@ struct limits
/* states */
/* low numbered states are same as options */
-#define SH_NOFORK 0 /* set when fork not necessary, not a state */
-#define SH_COMPLETE 0 /* set for command completion */
+#define SH_NOFORK 0 /* set when fork not necessary */
#define SH_FORKED 7 /* set when process has been forked */
#define SH_PROFILE 8 /* set when processing profiles */
#define SH_NOALIAS 9 /* do not expand non-exported aliases */
@@ -262,6 +266,7 @@ struct limits
#define SH_TTYWAIT 16 /* waiting for keyboard input */
#define SH_FCOMPLETE 17 /* set for filename completion */
#define SH_PREINIT 18 /* set with SH_INIT before parsing options */
+#define SH_COMPLETE 19 /* set for command completion */
#define SH_BASH 41
#define SH_BRACEEXPAND 42
@@ -335,6 +340,7 @@ struct limits
#define MATCH_MAX 64
#define SH_READEVAL 0x4000 /* for sh_eval */
+#define SH_FUNEVAL 0x10000 /* for sh_eval for function load */
extern Shell_t *nv_shell(Namval_t*);
extern int sh_addlib(void*);
@@ -343,6 +349,7 @@ extern char **sh_argbuild(Shell_t*,int*,const struct comnod*,int);
extern struct dolnod *sh_argfree(Shell_t *, struct dolnod*,int);
extern struct dolnod *sh_argnew(Shell_t*,char*[],struct dolnod**);
extern void *sh_argopen(Shell_t*);
+extern struct argnod *sh_argprocsub(Shell_t*,struct argnod*);
extern void sh_argreset(Shell_t*,struct dolnod*,struct dolnod*);
extern Namval_t *sh_assignok(Namval_t*,int);
extern struct dolnod *sh_arguse(Shell_t*);
diff --git a/usr/src/lib/libshell/common/include/edit.h b/usr/src/lib/libshell/common/include/edit.h
index c477130ed1..3e8fe73f8d 100644
--- a/usr/src/lib/libshell/common/include/edit.h
+++ b/usr/src/lib/libshell/common/include/edit.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/env.h b/usr/src/lib/libshell/common/include/env.h
index 93db7f5c27..c8b30a2c68 100644
--- a/usr/src/lib/libshell/common/include/env.h
+++ b/usr/src/lib/libshell/common/include/env.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/fault.h b/usr/src/lib/libshell/common/include/fault.h
index e754ea56eb..97a4280b0d 100644
--- a/usr/src/lib/libshell/common/include/fault.h
+++ b/usr/src/lib/libshell/common/include/fault.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/fcin.h b/usr/src/lib/libshell/common/include/fcin.h
index b498efa7f2..310cc6693c 100644
--- a/usr/src/lib/libshell/common/include/fcin.h
+++ b/usr/src/lib/libshell/common/include/fcin.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/history.h b/usr/src/lib/libshell/common/include/history.h
index 53e2b24964..40351707f9 100644
--- a/usr/src/lib/libshell/common/include/history.h
+++ b/usr/src/lib/libshell/common/include/history.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/io.h b/usr/src/lib/libshell/common/include/io.h
index 4f3d280262..bd2a8bdb87 100644
--- a/usr/src/lib/libshell/common/include/io.h
+++ b/usr/src/lib/libshell/common/include/io.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -92,6 +92,7 @@ extern const char e_create[];
extern const char e_tmpcreate[];
extern const char e_exists[];
extern const char e_file[];
+extern const char e_redirect[];
extern const char e_formspec[];
extern const char e_badregexp[];
extern const char e_open[];
diff --git a/usr/src/lib/libshell/common/include/jobs.h b/usr/src/lib/libshell/common/include/jobs.h
index 068f0a1abe..513667e1ab 100644
--- a/usr/src/lib/libshell/common/include/jobs.h
+++ b/usr/src/lib/libshell/common/include/jobs.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -84,6 +84,9 @@ struct jobs
unsigned int in_critical; /* >0 => in critical region */
int savesig; /* active signal */
int numpost; /* number of posted jobs */
+#ifdef SHOPT_BGX
+ int numbjob; /* number of background jobs */
+#endif /* SHOPT_BGX */
short fd; /* tty descriptor number */
#ifdef JOBS
int suspend; /* suspend character */
@@ -116,9 +119,17 @@ extern struct jobs job;
#define vmbusy() 0
#endif
-
#define job_lock() (job.in_critical++)
-#define job_unlock() do{if(!--job.in_critical&&job.savesig&&!vmbusy())job_reap(job.savesig);}while(0)
+#define job_unlock() \
+ do { \
+ int sig; \
+ if (!--job.in_critical && (sig = job.savesig)) \
+ { \
+ if (!job.in_critical++ && !vmbusy()) \
+ job_reap(sig); \
+ job.in_critical--; \
+ } \
+ } while(0)
extern const char e_jobusage[];
extern const char e_done[];
@@ -153,6 +164,9 @@ extern int job_wait(pid_t);
extern int job_post(pid_t,pid_t);
extern void *job_subsave(void);
extern void job_subrestore(void*);
+#ifdef SHOPT_BGX
+extern void job_chldtrap(Shell_t*, const char*,int);
+#endif /* SHOPT_BGX */
#ifdef JOBS
extern void job_init(Shell_t*,int);
extern int job_close(Shell_t*);
diff --git a/usr/src/lib/libshell/common/include/lexstates.h b/usr/src/lib/libshell/common/include/lexstates.h
index 77f351c88d..e3f75446e4 100644
--- a/usr/src/lib/libshell/common/include/lexstates.h
+++ b/usr/src/lib/libshell/common/include/lexstates.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -138,6 +138,7 @@ extern const char e_lexobsolete3[];
extern const char e_lexobsolete4[];
extern const char e_lexobsolete5[];
extern const char e_lexobsolete6[];
+extern const char e_lexnonstandard[];
extern const char e_lexusebrace[];
extern const char e_lexusequote[];
extern const char e_lexescape[];
diff --git a/usr/src/lib/libshell/common/include/name.h b/usr/src/lib/libshell/common/include/name.h
index 60821ee706..80d970055c 100644
--- a/usr/src/lib/libshell/common/include/name.h
+++ b/usr/src/lib/libshell/common/include/name.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -107,7 +107,7 @@ struct Ufunction
/* attributes of Namval_t items */
/* The following attributes are for internal use */
-#define NV_NOCHANGE (NV_EXPORT|NV_IMPORT|NV_RDONLY|NV_TAGGED|NV_NOFREE)
+#define NV_NOCHANGE (NV_EXPORT|NV_IMPORT|NV_RDONLY|NV_TAGGED|NV_NOFREE|NV_ARRAY)
#define NV_ATTRIBUTES (~(NV_NOSCOPE|NV_ARRAY|NV_NOARRAY|NV_IDENT|NV_ASSIGN|NV_REF|NV_VARNAME|NV_STATIC))
#define NV_PARAM NV_NODISC /* expansion use positional params */
@@ -115,6 +115,7 @@ struct Ufunction
#define NV_TYPE 0x1000000
#define NV_STATIC 0x2000000
#define NV_COMVAR 0x4000000
+#define NV_UNJUST 0x8000000 /* clear justify attributes */
#define NV_FUNCTION (NV_RJUST|NV_FUNCT) /* value is shell function */
#define NV_FPOSIX NV_LJUST /* posix function semantics */
#define NV_FTMP NV_ZFILL /* function source in tmpfile */
@@ -166,12 +167,13 @@ extern int array_maxindex(Namval_t*);
extern char *nv_endsubscript(Namval_t*, char*, int);
extern Namfun_t *nv_cover(Namval_t*);
extern Namarr_t *nv_arrayptr(Namval_t*);
+extern int nv_arrayisset(Namval_t*, Namarr_t*);
extern int nv_arraysettype(Namval_t*, Namval_t*,const char*,int);
extern int nv_aimax(Namval_t*);
extern int nv_atypeindex(Namval_t*, const char*);
extern int nv_setnotify(Namval_t*,char **);
extern int nv_unsetnotify(Namval_t*,char **);
-extern void nv_setlist(struct argnod*, int);
+extern void nv_setlist(struct argnod*, int, Namval_t*);
extern struct argnod* nv_onlist(struct argnod*, const char*);
extern void nv_optimize(Namval_t*);
extern void nv_outname(Sfio_t*,char*, int);
@@ -197,6 +199,7 @@ extern int nv_compare(Dt_t*, Void_t*, Void_t*, Dtdisc_t*);
extern void nv_outnode(Namval_t*,Sfio_t*, int, int);
extern int nv_subsaved(Namval_t*);
extern void nv_typename(Namval_t*, Sfio_t*);
+extern void nv_newtype(Namval_t*);
extern const Namdisc_t RESTRICTED_disc;
extern const Namdisc_t ENUM_disc;
@@ -219,6 +222,7 @@ extern const char e_notenum[];
extern const char e_aliname[];
extern const char e_badexport[];
extern const char e_badref[];
+extern const char e_badsubscript[];
extern const char e_noref[];
extern const char e_selfref[];
extern const char e_envmarker[];
@@ -228,4 +232,5 @@ extern const char e_redef[];
extern const char e_required[];
extern const char e_badappend[];
extern const char e_unknowntype[];
+extern const char e_globalref[];
#endif /* _NV_PRIVATE */
diff --git a/usr/src/lib/libshell/common/include/national.h b/usr/src/lib/libshell/common/include/national.h
index 542bb583d6..41fe6e5316 100644
--- a/usr/src/lib/libshell/common/include/national.h
+++ b/usr/src/lib/libshell/common/include/national.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/nval.h b/usr/src/lib/libshell/common/include/nval.h
index def26ebb18..2a4c61f0ac 100644
--- a/usr/src/lib/libshell/common/include/nval.h
+++ b/usr/src/lib/libshell/common/include/nval.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -265,6 +265,7 @@ extern Namfun_t *nv_isvtree(Namval_t*);
extern Namval_t *nv_lastdict(void);
extern Namval_t *nv_mkinttype(char*, size_t, int, const char*, Namdisc_t*);
extern void nv_newattr(Namval_t*,unsigned,int);
+extern void nv_newtype(Namval_t*);
extern Namval_t *nv_open(const char*,Dt_t*,int);
extern void nv_putval(Namval_t*,const char*,int);
extern void nv_putv(Namval_t*,const char*,int,Namfun_t*);
diff --git a/usr/src/lib/libshell/common/include/path.h b/usr/src/lib/libshell/common/include/path.h
index 15c4e9694b..39f45e8883 100644
--- a/usr/src/lib/libshell/common/include/path.h
+++ b/usr/src/lib/libshell/common/include/path.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -44,7 +44,7 @@
#define PATH_STD_DIR 0100 /* directory is on $(getconf PATH) */
#define PATH_OFFSET 2 /* path offset for path_join */
-#define MAXDEPTH (sizeof(char*)==2?64:2048) /* maximum recursion depth*/
+#define MAXDEPTH (sizeof(char*)==2?64:1024) /* maximum recursion depth*/
/*
* path component structure for path searching
diff --git a/usr/src/lib/libshell/common/include/regress.h b/usr/src/lib/libshell/common/include/regress.h
new file mode 100644
index 0000000000..e47cc2cf17
--- /dev/null
+++ b/usr/src/lib/libshell/common/include/regress.h
@@ -0,0 +1,66 @@
+/***********************************************************************
+* *
+* This software is part of the ast package *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
+* and is licensed under the *
+* Common Public License, Version 1.0 *
+* by AT&T Intellectual Property *
+* *
+* A copy of the License is available at *
+* http://www.opensource.org/licenses/cpl1.0.txt *
+* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
+* *
+* Information and Software Systems Research *
+* AT&T Research *
+* Florham Park NJ *
+* *
+* David Korn <dgk@research.att.com> *
+* *
+***********************************************************************/
+#pragma prototyped
+/*
+ * David Korn
+ * AT&T Labs
+ *
+ * Shell interface private definitions
+ *
+ */
+
+#ifndef _REGRESS_H
+#define _REGRESS_H 1
+
+#if SHOPT_REGRESS
+
+typedef struct Regress_s
+{
+ Shopt_t options;
+} Regress_t;
+
+#define sh_isregress(r) is_option(&sh.regress->options,r)
+#define sh_onregress(r) on_option(&sh.regress->options,r)
+#define sh_offregress(r) off_option(&sh.regress->options,r)
+
+#define REGRESS(r,i,f) do { if (sh_isregress(REGRESS_##r)) sh_regress(REGRESS_##r, i, sfprints f, __LINE__, __FILE__); } while (0)
+
+#define REGRESS_egid 1
+#define REGRESS_euid 2
+#define REGRESS_p_suid 3
+#define REGRESS_source 4
+#define REGRESS_etc 5
+
+#undef SHOPT_P_SUID
+#define SHOPT_P_SUID sh_regress_p_suid(__LINE__, __FILE__)
+
+extern int b___regress__(int, char**, void*);
+extern void sh_regress_init(Shell_t*);
+extern void sh_regress(unsigned int, const char*, const char*, unsigned int, const char*);
+extern uid_t sh_regress_p_suid(unsigned int, const char*);
+extern char* sh_regress_etc(const char*, unsigned int, const char*);
+
+#else
+
+#define REGRESS(r,i,f)
+
+#endif /* SHOPT_REGRESS */
+
+#endif /* _REGRESS_H */
diff --git a/usr/src/lib/libshell/common/include/shell.h b/usr/src/lib/libshell/common/include/shell.h
index b82e582cfc..d649dbf271 100644
--- a/usr/src/lib/libshell/common/include/shell.h
+++ b/usr/src/lib/libshell/common/include/shell.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -137,8 +137,8 @@ struct Shell_s
int inlineno; /* line number of current input file */
int exitval; /* most recent exit value */
unsigned char trapnote; /* set when trap/signal is pending */
- char subshell; /* set for virtual subshell */
char shcomp; /* set when runing shcomp */
+ short subshell; /* set for virtual subshell */
#ifdef _SH_PRIVATE
_SH_PRIVATE
#endif /* _SH_PRIVATE */
diff --git a/usr/src/lib/libshell/common/include/shlex.h b/usr/src/lib/libshell/common/include/shlex.h
index 8f5277c246..371e01b001 100644
--- a/usr/src/lib/libshell/common/include/shlex.h
+++ b/usr/src/lib/libshell/common/include/shlex.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -41,6 +41,7 @@ typedef struct _shlex_
int lastline; /* last line number */
int lasttok; /* previous token number */
int digits; /* numerical value with word token */
+ int nonstandard; /* nonstandard construct in profile */
char aliasok; /* on when alias is legal */
char assignok; /* on when name=value is legal */
char inexec; /* on when processing exec */
@@ -110,6 +111,7 @@ typedef struct _shlex_
#define FALLTHRUSYM (SYMAMP|';')
#define COOPSYM (SYMAMP|'|')
#define IORDWRSYM (SYMGT|'<')
+#define IORDWRSYMT (SYMSEMI|'<')
#define IOCLOBSYM (SYMPIPE|'>')
#define IPROCSYM (SYMLPAR|'<')
#define OPROCSYM (SYMLPAR|'>')
diff --git a/usr/src/lib/libshell/common/include/shnodes.h b/usr/src/lib/libshell/common/include/shnodes.h
index e55cfc42eb..176a0d9e5f 100644
--- a/usr/src/lib/libshell/common/include/shnodes.h
+++ b/usr/src/lib/libshell/common/include/shnodes.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -186,6 +186,7 @@ struct arithnod
#define IOARITH 0x40000 /* arithmetic seek <# ((expr)) */
#define IOREWRITE 0x80000 /* arithmetic seek <# ((expr)) */
#define IOCOPY IOCLOB /* copy skipped lines onto standard output */
+#define IOPROCSUB IOARITH /* process substitution redirection */
union Shnode_u
{
diff --git a/usr/src/lib/libshell/common/include/shtable.h b/usr/src/lib/libshell/common/include/shtable.h
index 041372b431..f8953f651d 100644
--- a/usr/src/lib/libshell/common/include/shtable.h
+++ b/usr/src/lib/libshell/common/include/shtable.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/streval.h b/usr/src/lib/libshell/common/include/streval.h
index 4ec3181f15..001f2d1ea1 100644
--- a/usr/src/lib/libshell/common/include/streval.h
+++ b/usr/src/lib/libshell/common/include/streval.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -151,13 +151,14 @@ typedef struct _arith_
#define A_JMPZ 44
#define A_JMPNZ 45
#define A_JMP 46
-#define A_CALL0 47
-#define A_CALL1 48
-#define A_CALL2 49
-#define A_CALL3 50
-#define A_DOT 51
-#define A_LIT 52
-#define A_NOTNOT 53
+#define A_CALL1F 47
+#define A_CALL2F 48
+#define A_CALL3F 49
+#define A_CALL1I 50
+#define A_CALL2I 51
+#define A_DOT 52
+#define A_LIT 53
+#define A_NOTNOT 54
/* define error messages */
diff --git a/usr/src/lib/libshell/common/include/terminal.h b/usr/src/lib/libshell/common/include/terminal.h
index a0e813c935..7192039013 100644
--- a/usr/src/lib/libshell/common/include/terminal.h
+++ b/usr/src/lib/libshell/common/include/terminal.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/test.h b/usr/src/lib/libshell/common/include/test.h
index 593bd5852b..1a38632d44 100644
--- a/usr/src/lib/libshell/common/include/test.h
+++ b/usr/src/lib/libshell/common/include/test.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -51,8 +51,8 @@
#define TEST_EF 3
#define TEST_NT 10
#define TEST_OT 12
-#define TEST_SLT 15
-#define TEST_SGT 16
+#define TEST_SLT 16
+#define TEST_SGT 17
#define TEST_END 8
#define TEST_REP 20
diff --git a/usr/src/lib/libshell/common/include/timeout.h b/usr/src/lib/libshell/common/include/timeout.h
index 803c6b09d2..276cf131a1 100644
--- a/usr/src/lib/libshell/common/include/timeout.h
+++ b/usr/src/lib/libshell/common/include/timeout.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/ulimit.h b/usr/src/lib/libshell/common/include/ulimit.h
index d5f3b21391..39fedeed78 100644
--- a/usr/src/lib/libshell/common/include/ulimit.h
+++ b/usr/src/lib/libshell/common/include/ulimit.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
diff --git a/usr/src/lib/libshell/common/include/variables.h b/usr/src/lib/libshell/common/include/variables.h
index ac9c5a536b..098e8743aa 100644
--- a/usr/src/lib/libshell/common/include/variables.h
+++ b/usr/src/lib/libshell/common/include/variables.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -69,40 +69,41 @@
#define LCNUMNOD (sh.bltin_nodes+39)
#define FIGNORENOD (sh.bltin_nodes+40)
#define VERSIONNOD (sh.bltin_nodes+41)
-#define DOTSHNOD (sh.bltin_nodes+42)
-#define ED_CHRNOD (sh.bltin_nodes+43)
-#define ED_COLNOD (sh.bltin_nodes+44)
-#define ED_TXTNOD (sh.bltin_nodes+45)
-#define ED_MODENOD (sh.bltin_nodes+46)
-#define SH_NAMENOD (sh.bltin_nodes+47)
-#define SH_SUBSCRNOD (sh.bltin_nodes+48)
-#define SH_VALNOD (sh.bltin_nodes+49)
-#define SH_VERSIONNOD (sh.bltin_nodes+50)
-#define SH_DOLLARNOD (sh.bltin_nodes+51)
-#define SH_MATCHNOD (sh.bltin_nodes+52)
-#define SH_COMMANDNOD (sh.bltin_nodes+53)
-#define SH_PATHNAMENOD (sh.bltin_nodes+54)
-#define SH_FUNNAMENOD (sh.bltin_nodes+55)
-#define SH_SUBSHELLNOD (sh.bltin_nodes+56)
-#define SH_LEVELNOD (sh.bltin_nodes+57)
-#define SH_LINENO (sh.bltin_nodes+58)
-#define SH_STATS (sh.bltin_nodes+59)
-#define SHLVL (sh.bltin_nodes+60)
+#define JOBMAXNOD (sh.bltin_nodes+42)
+#define DOTSHNOD (sh.bltin_nodes+43)
+#define ED_CHRNOD (sh.bltin_nodes+44)
+#define ED_COLNOD (sh.bltin_nodes+45)
+#define ED_TXTNOD (sh.bltin_nodes+46)
+#define ED_MODENOD (sh.bltin_nodes+47)
+#define SH_NAMENOD (sh.bltin_nodes+48)
+#define SH_SUBSCRNOD (sh.bltin_nodes+49)
+#define SH_VALNOD (sh.bltin_nodes+50)
+#define SH_VERSIONNOD (sh.bltin_nodes+51)
+#define SH_DOLLARNOD (sh.bltin_nodes+52)
+#define SH_MATCHNOD (sh.bltin_nodes+53)
+#define SH_COMMANDNOD (sh.bltin_nodes+54)
+#define SH_PATHNAMENOD (sh.bltin_nodes+55)
+#define SH_FUNNAMENOD (sh.bltin_nodes+56)
+#define SH_SUBSHELLNOD (sh.bltin_nodes+57)
+#define SH_LEVELNOD (sh.bltin_nodes+58)
+#define SH_LINENO (sh.bltin_nodes+59)
+#define SH_STATS (sh.bltin_nodes+60)
+#define SHLVL (sh.bltin_nodes+61)
#if SHOPT_FS_3D
-# define VPATHNOD (sh.bltin_nodes+61)
+# define VPATHNOD (sh.bltin_nodes+62)
# define NFS_3D 1
#else
# define NFS_3D 0
#endif /* SHOPT_FS_3D */
#if SHOPT_VPIX
-# define DOSPATHNOD (sh.bltin_nodes+61+NFS_3D)
-# define VPIXNOD (sh.bltin_nodes+62+NFS_3D)
+# define DOSPATHNOD (sh.bltin_nodes+62+NFS_3D)
+# define VPIXNOD (sh.bltin_nodes+63+NFS_3D)
# define NVPIX (NFS_3D+2)
#else
# define NVPIX NFS_3D
#endif /* SHOPT_VPIX */
#ifdef apollo
-# define SYSTYPENOD (sh.bltin_nodes+61+NVPIX)
+# define SYSTYPENOD (sh.bltin_nodes+62+NVPIX)
#endif /* apollo */
#endif /* SH_VALNOD */
diff --git a/usr/src/lib/libshell/common/include/version.h b/usr/src/lib/libshell/common/include/version.h
index 8f025169ff..b22c513e65 100644
--- a/usr/src/lib/libshell/common/include/version.h
+++ b/usr/src/lib/libshell/common/include/version.h
@@ -1,7 +1,7 @@
/***********************************************************************
* *
* This software is part of the ast package *
-* Copyright (c) 1982-2008 AT&T Intellectual Property *
+* Copyright (c) 1982-2009 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
@@ -17,4 +17,4 @@
* David Korn <dgk@research.att.com> *
* *
***********************************************************************/
-#define SH_RELEASE "93t 2008-11-04"
+#define SH_RELEASE "93t+ 2009-10-12"