aboutsummaryrefslogtreecommitdiff
path: root/debianutils
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2021-06-07 11:34:06 +0100
committerRon Yorston <rmy@pobox.com>2021-06-07 11:34:06 +0100
commitabe872e2a0342357a5608342cb2892e94027b3e7 (patch)
tree297cdccf332fbb5e4eb31b1eac643180059f9b5f /debianutils
parent1f33f42d7bcb019b268d938df643a7a785dc19ab (diff)
parent4d983dcddeee94892d3072e84c7c9a01d4696055 (diff)
downloadbusybox-w32-abe872e2a0342357a5608342cb2892e94027b3e7.tar.gz
busybox-w32-abe872e2a0342357a5608342cb2892e94027b3e7.tar.bz2
busybox-w32-abe872e2a0342357a5608342cb2892e94027b3e7.zip
Merge branch 'busybox' into merge
Diffstat (limited to 'debianutils')
-rw-r--r--debianutils/run_parts.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c
index 585a4b58f..f528c88ff 100644
--- a/debianutils/run_parts.c
+++ b/debianutils/run_parts.c
@@ -113,13 +113,24 @@ enum {
113}; 113};
114 114
115/* Is this a valid filename (upper/lower alpha, digits, 115/* Is this a valid filename (upper/lower alpha, digits,
116 * underscores, and hyphens only?) 116 * underscores, hyphens, and non-leading dots only?)
117 */ 117 */
118static bool invalid_name(const char *c) 118static bool invalid_name(const char *c)
119{ 119{
120 c = bb_basename(c); 120 c = bb_basename(c);
121 121
122 while (*c && (isalnum(*c) || *c == '_' || *c == '-')) 122 if (*c == '.')
123 return *c;
124
125 /* Debian run-parts 4.8.3, manpage:
126 * "...the names must consist entirely of ASCII letters,
127 * ASCII digits, ASCII underscores, and ASCII minus-hyphens.
128 * However, the name must not begin with a period."
129 * The last sentence is a giveaway that something is fishy
130 * (why mention leading dot if dots are not allowed anyway?).
131 * Yes, you guessed it right: in fact non-leading dots ARE allowed.
132 */
133 while (isalnum(*c) || *c == '_' || *c == '-' || *c == '.')
123 c++; 134 c++;
124 135
125 return *c; /* TRUE (!0) if terminating NUL is not reached */ 136 return *c; /* TRUE (!0) if terminating NUL is not reached */