aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-29 23:38:12 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-29 23:38:12 +0000
commite844cd1c557e78d2d1b67d63a8f21e8c5406c335 (patch)
tree0ab355a9fe4946a4312b6b1e1dbc968a447d15be
parent617bd16ad6d8ec456fb1848121a3c4d6b95f7588 (diff)
downloadbusybox-w32-e844cd1c557e78d2d1b67d63a8f21e8c5406c335.tar.gz
busybox-w32-e844cd1c557e78d2d1b67d63a8f21e8c5406c335.tar.bz2
busybox-w32-e844cd1c557e78d2d1b67d63a8f21e8c5406c335.zip
run_parts: do not check path portion of a name for "bad chars".
Needed for ifupdown. Patch by "Gabriel L. Somlo" <somlo@cmu.edu> git-svn-id: svn://busybox.net/trunk/busybox@18531 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--debianutils/run_parts.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c
index eb2fb94b3..e6dec04bc 100644
--- a/debianutils/run_parts.c
+++ b/debianutils/run_parts.c
@@ -60,14 +60,17 @@ struct globals {
60 */ 60 */
61static bool invalid_name(const char *c) 61static bool invalid_name(const char *c)
62{ 62{
63 while (*c) { 63 const char *base_name = strrchr(c, '/');
64 if (!isalnum(*c) && (*c != '_') && (*c != '-' && (*c != '/'))) { 64
65 return 1; 65 if (base_name)
66 } 66 c = base_name + 1;
67 ++c; 67
68 } 68 while (*c && (isalnum(*c) || *c == '_' || *c == '-'))
69 return 0; 69 c++;
70
71 return *c; /* TRUE (!0) if terminating NUL is not reached */
70} 72}
73
71#define RUN_PARTS_OPT_a (1<<0) 74#define RUN_PARTS_OPT_a (1<<0)
72#define RUN_PARTS_OPT_u (1<<1) 75#define RUN_PARTS_OPT_u (1<<1)
73#define RUN_PARTS_OPT_t (1<<2) 76#define RUN_PARTS_OPT_t (1<<2)
@@ -81,6 +84,7 @@ static bool invalid_name(const char *c)
81#else 84#else
82#define list_mode (0) 85#define list_mode (0)
83#endif 86#endif
87
84static int act(const char *file, struct stat *statbuf, void *args, int depth) 88static int act(const char *file, struct stat *statbuf, void *args, int depth)
85{ 89{
86 int ret; 90 int ret;