ash: builtin: Mark more regular built-ins
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 16 Feb 2020 17:29:52 +0000 (18:29 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 16 Feb 2020 18:14:45 +0000 (19:14 +0100)
Upstream commit:

    Date: Sat, 19 May 2018 02:39:49 +0800
    builtin: Mark more regular built-ins

    This patch marks the following built-ins as regular, meaning that
    they cannot be overriden using PATH search:

            hash
            pwd
            type
            ulimit

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c

index 75edebd8d8ded4e5a8cc86d4c09e15b36cdcf0eb..78ca1d99c19be50e1ecb16eeb7683c967d72a674 100644 (file)
@@ -9962,7 +9962,7 @@ static const struct builtincmd builtintab[] = {
 #if ENABLE_ASH_GETOPTS
        { BUILTIN_REGULAR       "getopts" , getoptscmd },
 #endif
-       { BUILTIN_NOSPEC        "hash"    , hashcmd    },
+       { BUILTIN_REGULAR       "hash"    , hashcmd    },
 #if ENABLE_ASH_HELP
        { BUILTIN_NOSPEC        "help"    , helpcmd    },
 #endif
@@ -9980,7 +9980,7 @@ static const struct builtincmd builtintab[] = {
 #if ENABLE_ASH_PRINTF
        { BUILTIN_REGULAR       "printf"  , printfcmd  },
 #endif
-       { BUILTIN_NOSPEC        "pwd"     , pwdcmd     },
+       { BUILTIN_REGULAR       "pwd"     , pwdcmd     },
        { BUILTIN_REGULAR       "read"    , readcmd    },
        { BUILTIN_SPEC_REG_ASSG "readonly", exportcmd  },
        { BUILTIN_SPEC_REG      "return"  , returncmd  },
@@ -9995,8 +9995,8 @@ static const struct builtincmd builtintab[] = {
        { BUILTIN_SPEC_REG      "times"   , timescmd   },
        { BUILTIN_SPEC_REG      "trap"    , trapcmd    },
        { BUILTIN_REGULAR       "true"    , truecmd    },
-       { BUILTIN_NOSPEC        "type"    , typecmd    },
-       { BUILTIN_NOSPEC        "ulimit"  , ulimitcmd  },
+       { BUILTIN_REGULAR       "type"    , typecmd    },
+       { BUILTIN_REGULAR       "ulimit"  , ulimitcmd  },
        { BUILTIN_REGULAR       "umask"   , umaskcmd   },
 #if ENABLE_ASH_ALIAS
        { BUILTIN_REGULAR       "unalias" , unaliascmd },