summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-08-05 05:37:39 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-08-05 05:37:39 +0000
commit6bba8994c83cb007356c0b358bdc5dda9bdff59a (patch)
treef5614bf30164836bd19fd515db76dd384a1932c0
parente41fb20b888901da7c29bc9fa096f6cc4b6b3542 (diff)
Escape more shell specific characters
-rw-r--r--hcid/security.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hcid/security.c b/hcid/security.c
index 718fff3d..fb4c813e 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -302,7 +302,7 @@ static void call_pin_helper(int dev, bdaddr_t *sba, struct hci_conn_info *ci)
{
pin_code_reply_cp pr;
struct sigaction sa;
- char addr[18], str[512], *pin, name[249], tmp[499], *ptr;
+ char addr[18], str[512], *pin, name[249], tmp[497], *ptr;
FILE *pipe;
int i, ret, len;
@@ -332,8 +332,13 @@ static void call_pin_helper(int dev, bdaddr_t *sba, struct hci_conn_info *ci)
for (i = 0; i < 248 && name[i]; i++)
if (isprint(name[i])) {
- if (name[i] == '"')
+ switch (name[i]) {
+ case '"':
+ case '`':
+ case '$':
+ case '\\':
*ptr++ = '\\';
+ }
*ptr++ = name[i];
} else
*ptr++ = '.';