[Bug 4676] New: Can't use '#' in mdev.conf CMD
bugzilla at busybox.net
bugzilla at busybox.net
Fri Jan 6 09:56:29 UTC 2012
https://bugs.busybox.net/show_bug.cgi?id=4676
Summary: Can't use '#' in mdev.conf CMD
Product: Busybox
Version: 1.18.x
Platform: Other
OS/Version: Linux
Status: NEW
Severity: major
Priority: P5
Component: Other
AssignedTo: unassigned at busybox.net
ReportedBy: Nikolay.Yaroshevich at synesis.ru
CC: busybox-cvs at busybox.net
Estimated Hours: 0.0
Sample string from my mdev.conf:
dvb[0123]\..* 0:0 660 @N=${MDEV%.*}; N=${N#dvb};
D=${MDEV#dvb?.}; mkdir -p dvb/adapter${N}; chmod 755 dvb dvb/adapter${N}; mv
MDEV dvb/adapter${N}/${D}
Executing that cmd on corresponding event causes error:
sh: syntax error: missing '}'
After some tracing it looks like '#' is treated as start of comment.
in util-linux/mdev.c:
if (ENABLE_FEATURE_MDEV_EXEC && command) {
/* setenv will leak memory, use putenv/unsetenv/free */
char *s = xasprintf("%s=%s", "MDEV", node_name);
char *s1 = xasprintf("%s=%s", "SUBSYSTEM", G.subsystem);
putenv(s);
putenv(s1);
------> bb_error_msg("\n*** trying to exec '%s' ***\n", command);
if (system(command) == -1)
bb_perror_msg("can't run '%s'", command);
bb_unsetenv_and_free(s1);
bb_unsetenv_and_free(s);
free(command);
}
Resulting output:
mdev:
*** trying to exec 'N=${MDEV%.*}; N=${N' ***
sh: syntax error: missing '}'
mdev:
*** trying to exec 'N=${MDEV%.*}; N=${N' ***
sh: syntax error: missing '}'
--
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the busybox-cvs
mailing list