View Single Post
tz1's Avatar
Posts: 716 | Thanked: 236 times | Joined on Dec 2007
#13
I changed it not to fork, and to do seteuid(suid_id) before, then seteuid(0) after gpsbt_start. setEuid, not setuid.

Nokia's GPS is not quite useless, but close. After standing outside for several minutes without lock I got the BT one from my motorcycle (in my room not near a window it locks in 30 seconds).

Fresh from a reboot (RSS feeder refreshes 8 hours, everything else off, etc. - anything that "turns on" the connection kills kismet), I ran the server in one xterm, the client in a second xterm (the base kismet program didn't work for some reason) and it just worked. Like when I wardrove with my Zaurus. Over 30 minutes, with GPS.

I had to reboot once to get wifi back, but most times just disconnect and reconnect worked.

Only conf file changes from stock (deb) install were gpson and pointing at /media/mmc1/Kismet for log files and the revised kismet_server.

Code:
diff -Bburw kismet-2008-05-R1/kismet_server.cc ../kismet-2008-05-R1/kismet_server.cc
--- kismet-2008-05-R1/kismet_server.cc  2008-04-08 02:39:47.000000000 -0500
+++ ../kismet-2008-05-R1/kismet_server.cc       2008-07-09 19:48:08.000000000 -0500
@@ -2533,12 +2533,12 @@
 
 #ifdef HAVE_HILDON
                fprintf(stderr, "Waiting for Hildon gps to enable...\n");
-               if (gpsbt_start(NULL, 0, 0, 0 /* default port */, 
-                                               status, STATUS_MAX, 
-                                               0, &gpsbt_ctx) < 0) {
-                       printf("Hildon BT failed: %s\n", status);
-               }
-               sleep(1);
+       seteuid(suid_id);
+       int gbret = gpsbt_start(NULL, 0, 0, 0 /* default port */, 
+                               status, STATUS_MAX, 0, &gpsbt_ctx);
+       seteuid(0);
+       printf("Hildon BT %d: %s\n", gbret, status);
+       sleep(1); // for gpsd to start and open everything
 #endif
 
     } else {
 

The Following User Says Thank You to tz1 For This Useful Post: