Skip to contentSkip to conversation

rfcomm 'anycommand' bug

PATCH In review Filippo Giunchedi 2 participants 2 messages Jun 2, 2006 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rfcomm 'anycommand' bug

Hi,
as reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=229167 rfcomm silently exits (or better, does a print_dev_list()) if an unknown command without parameters is passed. attached there is a patch (of the 'works-here' type) which should solve the problem.

thanks,
filippo
--
Filippo Giunchedi - http://esaurito.net
PGP key: 0x6B79D401
random quote follows:

A child of five would understand this. Send someone to fetch a child of five. -- Groucho Marx

main.c +13 -1
@@ -621,8 +621,20 @@
 	argv += optind;
 	optind = 0;
 
-	if (argc < 2)
+	if (argc == 0) {
+        show_all = 1;
+    }else if (argc == 1){
+        for(i = 0; command[i].cmd; i++) {
+		    if ((strncmp(command[i].cmd, argv[0], 4) == 0) &&
+                (strncmp(command[i].alt, argv[0], 4) == 0) )
+			    break;
+            
+            if (command[i+1].cmd == NULL)
+                usage();
+                exit(0);
+        }
 		show_all = 1;
+    }
 
 	if ((ctl = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_RFCOMM)) < 0 ) {
 		perror("Can't open RFCOMM control socket");

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

maintainer
#1 lore raw

Hi Filippo,

Quoted 4 lines

as reported in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=229167 rfcomm silently exits (or better, does a print_dev_list()) if an unknown command without parameters is passed. attached there is a patch (of the 'works-here' type) which should solve the problem.

this patch is totally messed up. Unless someone fixes the coding style, I am not even looking at it.

Regards

Marcel

_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel