Ticket #103 (closed defect/bug: fixed)

Opened 9 months ago

Last modified 5 months ago

Failed to load a garmin map

Reported by: agnonchik@yandex.ru Assigned to: KaZeR
Priority: major Milestone: version 0.1.0
Component: mapdrivers/Garmin Version:
Keywords: Cc:

Description (Last modified by KaZeR)

Hi,

Navit failed to load a garmin map:

garmin.c:193:1|libgarmin 0.1-r278 initializing as GPS Backend
garmin.c:447:1|Loading /usr/local/share/navit/maps/50.img as TDB
garmin_tdb.c:66:1|Can not open:[/usr/local/share/navit/maps/50.img] errno=1(Operation not permitted)
garmin.c:226:1|Implement me

I'll appload the map.

Thanks, Val.

Change History

04/02/08 14:47:55 changed by KaZeR

  • owner changed from somebody to zaxl.
  • component changed from core to mapdrivers/Garmin.
  • milestone set to version 0.1.0.

07/23/08 09:29:46 changed by anonymous

Some more details: If the map is owned the user who is running navit the map does work. (although the user who is running navit has full right on the file, file is world readable)

07/23/08 11:04:22 changed by Ed

I think i found a workarround:

after strace-ing navit i find that i get the following error:

nav4.16148:open("/data/data2/canada/00068676.img", O_RDONLY|O_NOATIME) = -1 EPERM (Operation not permitted)

Acording to man 2 open:

EPERM The O_NOATIME flag was specified, but the effective user ID of the caller did not match the owner of
the file and the caller was not privileged (CAP_FOWNER).

Which seems to confirm that it only happens if the file is not owned by the user running navit.

So as a proof-of-concept, i removed the O_NOATIME flag:

diff ./src/libgarmin_priv.h ./src/libgarmin_priv.h.org

20c20

'< #define OPENFLAGS (O_RDONLY|O_BINARY)'

---

'> #define OPENFLAGS (O_RDONLY|O_NOATIME|O_BINARY)'

i did a make, make install and did the same for navit.

Now the error is gone and navit is working again.

Can you please fix this ( in a more elegant way....)

07/23/08 11:07:10 changed by KaZeR

  • owner changed from zaxl to KaZeR.
  • status changed from new to assigned.
  • description changed.

07/23/08 11:12:43 changed by KaZeR

  • owner changed from KaZeR to zaxl.
  • status changed from assigned to new.

07/31/08 09:22:23 changed by KaZeR

  • owner changed from zaxl to KaZeR.
  • status changed from new to assigned.

Comments from Zaxl (libgarmin's author):

I've read the ticket but i dont like the solution. Changing the ownership is easy for now. NO_ATIME gives a quite big speedup on slow media, like my sd card. I can detect the EPERM from the open and remove the flag. That's the plan! :)

08/13/08 15:38:05 changed by zaxl

  • status changed from assigned to closed.
  • resolution set to fixed.

Plan completed. If open fails with EPERM retry without O_NOATIME.