FreeBSD Bugzilla – Attachment 197291 Details for
Bug 231441
12.0-ALPHA6 network does not start at boot
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
skip shell_quote() call for regexes
devd.diff (text/plain), 2.65 KB, created by
Yuri Pankov
on 2018-09-21 05:08:19 UTC
(
hide
)
Description:
skip shell_quote() call for regexes
Filename:
MIME Type:
Creator:
Yuri Pankov
Created:
2018-09-21 05:08:19 UTC
Size:
2.65 KB
patch
obsolete
>diff --git a/sbin/devd/devd.cc b/sbin/devd/devd.cc >index e81f718159b1..619c21b6887e 100644 >--- a/sbin/devd/devd.cc >+++ b/sbin/devd/devd.cc >@@ -280,7 +280,7 @@ my_system(const char *command) > bool > action::do_action(config &c) > { >- string s = c.expand_string(_cmd.c_str()); >+ string s = c.expand_string(_cmd.c_str(), true); > devdlog(LOG_INFO, "Executing '%s'\n", s.c_str()); > my_system(s.c_str()); > return (true); >@@ -289,7 +289,7 @@ action::do_action(config &c) > match::match(config &c, const char *var, const char *re) : > _inv(re[0] == '!'), > _var(var), >- _re(c.expand_string(_inv ? re + 1 : re, "^", "$")) >+ _re(c.expand_string(_inv ? re + 1 : re, false, "^", "$")) > { > regcomp(&_regex, _re.c_str(), REG_EXTENDED | REG_NOSUB | REG_ICASE); > } >@@ -666,7 +666,7 @@ config::shell_quote(const string &s) > } > > void >-config::expand_one(const char *&src, string &dst) >+config::expand_one(const char *&src, string &dst, bool squote) > { > int count; > string buffer; >@@ -705,11 +705,15 @@ config::expand_one(const char *&src, string &dst) > do { > buffer += *src++; > } while (is_id_char(*src)); >- dst.append(shell_quote(get_variable(buffer))); >+ if (squote) >+ dst.append(shell_quote(get_variable(buffer))); >+ else >+ dst.append(get_variable(buffer)); > } > > const string >-config::expand_string(const char *src, const char *prepend, const char *append) >+config::expand_string(const char *src, bool squote, const char *prepend, >+ const char *append) > { > const char *var_at; > string dst; >@@ -731,7 +735,7 @@ config::expand_string(const char *src, const char *prepend, const char *append) > } > dst.append(src, var_at - src); > src = var_at; >- expand_one(src, dst); >+ expand_one(src, dst, squote); > } > > if (append != NULL) >diff --git a/sbin/devd/devd.hh b/sbin/devd/devd.hh >index 534c4d4c5a9d..32541307b809 100644 >--- a/sbin/devd/devd.hh >+++ b/sbin/devd/devd.hh >@@ -164,7 +164,7 @@ public: > void pop_var_table(); > void set_variable(const char *var, const char *val); > const std::string &get_variable(const std::string &var); >- const std::string expand_string(const char * var, >+ const std::string expand_string(const char * var, bool squote, > const char * prepend = NULL, const char * append = NULL); > char *set_vars(char *); > void find_and_execute(char); >@@ -172,7 +172,7 @@ protected: > void sort_vector(std::vector<event_proc *> &); > void parse_one_file(const char *fn); > void parse_files_in_dir(const char *dirname); >- void expand_one(const char *&src, std::string &dst); >+ void expand_one(const char *&src, std::string &dst, bool squote); > std::string shell_quote(const std::string &s); > bool is_id_char(char) const; > bool chop_var(char *&buffer, char *&lhs, char *&rhs) const;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 231441
: 197291