svn commit: trunk/busybox/shell
Eric Spakman
E.Spakman at inter.nl.net
Tue Jan 9 21:49:42 UTC 2007
Hi Bernhard,
There are some more problems with this revision. I just filled in a bug
report and attached a small patch:
http://bugs.busybox.net/view.php?id=1149
But I wonder what the use of this "is_safe_applet" function is...
Eric
>> Author: vda
>> Date: 2006-12-26 13:31:11 -0800 (Tue, 26 Dec 2006)
>> New Revision: 17085
>>
>>
>> Log:
>> ash: is_safe_applet mustn't affect disabled applets
>>
>>
>>
>> Modified:
>> trunk/busybox/shell/ash.c
>>
>>
>>
>> Changeset:
>> Modified: trunk/busybox/shell/ash.c
>> ===================================================================
>> --- trunk/busybox/shell/ash.c 2006-12-26 18:17:42 UTC (rev 17084)
>> +++ trunk/busybox/shell/ash.c 2006-12-26 21:31:11 UTC (rev 17085)
>> @@ -1381,17 +1381,9 @@
>> { BUILTIN_REGULAR "wait", waitcmd },
>> };
>>
>>
>> -#define NUMBUILTINS (sizeof (builtincmd) / sizeof (struct builtincmd)
>> )
>> +#define NUMBUILTINS (sizeof(builtincmd) / sizeof(builtincmd[0]))
>>
>>
>> -static const char *safe_applets[] = {
>> - "[", "test", "echo", "cat",
>> - "ln", "cp", "touch", "mkdir", "rm",
>> - "cut", "hexdump", "awk", "sort",
>> - "find", "xargs", "ls", "dd",
>> - "chown", "chmod"
>> -};
>>
>>
>> -
>> struct cmdentry { int cmdtype; union param { @@ -2042,7 +2034,30 @@
>>
>>
>> static int is_safe_applet(char *name) {
>> - int n = sizeof(safe_applets) / sizeof(char *);
>> + /* It isn't a bug to have non-existent applet here... */
>> + /* ...just a waste of space... */
>> + static const char safe_applets[][8] = {
>> + "["
>>
>
> Didn't look in detail, but
> why isn't "[" USE_TEST too apart from lazyness WRT a big #if
> THIS|THAT|ONE_OF_THE_OTHERS around the safe_applets and related code ?
>
>
> thanks,
>> + USE_AWK (, "awk" )
>> + USE_CAT (, "cat" )
>> + USE_CHMOD (, "chmod" )
>> + USE_CHOWN (, "chown" )
>> + USE_CP (, "cp" )
>> + USE_CUT (, "cut" )
>> + USE_DD (, "dd" )
>> + USE_ECHO (, "echo" )
>> + USE_FIND (, "find" )
>> + USE_HEXDUMP(, "hexdump")
>> + USE_LN (, "ln" )
>> + USE_LS (, "ls" )
>> + USE_MKDIR (, "mkdir" )
>> + USE_RM (, "rm" )
>> + USE_SORT (, "sort" )
>> + USE_TEST (, "test" )
>> + USE_TOUCH (, "touch" )
>> + USE_XARGS (, "xargs" )
>> + };
>> + int n = sizeof(safe_applets) / sizeof(safe_applets[0]);
>> int i; for (i = 0; i < n; i++) if (strcmp(safe_applets[i], name) == 0)
> _______________________________________________
> busybox mailing list busybox at busybox.net
> http://busybox.net/cgi-bin/mailman/listinfo/busybox
>
>
More information about the busybox
mailing list