[Xastir-Dev] TODO for "stable"?

Magne Mæhre magne at samfundet.no
Sat May 10 16:35:02 EDT 2003


>>>>>>>>>>>> Magne Mæhre wrote (2003-05-10 21:48:27):
| >>>>>>>>>>>> Curt Mills, WE7U wrote (2003-05-10 08:55:07):
| | 
| | The bug-fixes I've done lately added too much new code, which has
| | caused two new packet-of-death bugs to appear.  I had to fix those as
| | well.  Please forward any packets causing new packet-of-death
| | segfaults directly to me, and quickly!  I'm done adding new code
| | unless another major bug pops up somewhere.
| 
| I've seen a segfault problem when storing tracks lately (for the
| last week or so).  Whenever I go into station details and press
| "store track", it segfaults (log is below).  If the station is
| fixed, there is no segfault, but for every station with track data,
| I get a segfault..
| 
| I'm not yet too familiar with the xastir code, but I'll look into it.

Ok, the problem was in create_shapefile_map (maps.c).  If the
current user hasn't privilege to write to the maps/GPS
directory, the DBFAddField calls will segfault.

In my case, it will try to write these files to
/usr/local/xastir/maps/GPS/<filename> , which is protected.  I haven't
seen a configuration that lets me override this per user (and I don't
want to let every user write to this place).
 
Anyway, here is a diff for a check that bails out if the shapefiles
can't be created:


--Magne / la1bfa

Index: src/maps.c
===================================================================
RCS file: /cvsroot/xastir/xastir/src/maps.c,v
retrieving revision 1.268
diff -u -r1.268 maps.c
--- src/maps.c  9 May 2003 17:43:56 -0000       1.268
+++ src/maps.c  10 May 2003 20:33:33 -0000
@@ -1180,6 +1180,12 @@
     my_shp_handle = SHPCreate(temp_shapefile_name, type);
          my_dbf_handle = DBFCreate(temp_shapefile_name);

	  +    if ((my_shp_handle == NULL) || (my_dbf_handle == NULL)) {
	  +        // Probably write-protected directory
	  +        fprintf(stderr, "Could not create shapefile %s\n",
	  +                temp_shapefile_name);
	  +        return;
	  +    }
	       // Create the different fields we'll use to store the
	       // attributes:
	       //



More information about the Xastir-dev mailing list