Opened 15 years ago
Closed 14 years ago
#103 closed defect/bug (fixed)
Failed to load a garmin map
Reported by: | agnonchik@… | Owned by: | KaZeR |
---|---|---|---|
Priority: | major | Milestone: | version 0.1.0 |
Component: | mapdrivers/Garmin | Version: | |
Severity: | 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 (8)
comment:1 Changed 15 years ago by agnonchik@…
comment:2 Changed 15 years ago by KaZeR
- Component changed from core to mapdrivers/Garmin
- Milestone set to version 0.1.0
- Owner changed from somebody to zaxl
comment:3 Changed 15 years ago 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)
comment:4 Changed 15 years ago 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....)
comment:5 Changed 15 years ago by KaZeR
- Description modified (diff)
- Owner changed from zaxl to KaZeR
- Status changed from new to assigned
comment:6 Changed 15 years ago by KaZeR
- Owner changed from KaZeR to zaxl
- Status changed from assigned to new
comment:7 Changed 15 years ago 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! :)
comment:8 Changed 14 years ago by zaxl
- Resolution set to fixed
- Status changed from assigned to closed
Plan completed. If open fails with EPERM retry without O_NOATIME.
The map is downloadable from the web: http://www.gpsportal.ru/cgi-bin/CMS/getfile.cgi?file=50.img&ident=53616c7465645f5f494c694e66d5ad41984c3ac0acc31897a05e8cfc4a87bf7f2272a77af26efc078162cf147cace70ccb0ed215630631b79f5ebd5e47ce8462
Thanks, Val.