diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-14 16:25:50 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-11-14 16:25:50 -0800 |
commit | 18d767fb17ec197d3ed24ec27a5364ee84b612ca (patch) | |
tree | 73f664a55c8a42afd3b72bb33ff5b389ad63905f /general.c | |
parent | bff0c156047ae6ca0bb9a5e04587ebe1d1ef5249 (diff) | |
download | vyatta-bash-18d767fb17ec197d3ed24ec27a5364ee84b612ca.tar.gz vyatta-bash-18d767fb17ec197d3ed24ec27a5364ee84b612ca.zip |
* add restricted modes ("output" and "full").
* support "root-level" programmable completion in restricted modes.
Diffstat (limited to 'general.c')
-rw-r--r-- | general.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -1023,3 +1023,25 @@ get_group_array (ngp) *ngp = ngroups; return group_iarray; } + +int +in_vyatta_restricted_mode(enum vyatta_restricted_type type) +{ + char *rval = getenv("VYATTA_RESTRICTED_MODE"); + int output = 0, full = 0; + if (rval == NULL) { + return 0; + } + output = (strcmp(rval, "output") == 0); + full = (strcmp(rval, "full") == 0); + + if (type == OUTPUT && (output || full)) { + return 1; + } + if (type == FULL && full) { + return 1; + } + + return 0; +} + |