Bug#841233: marble: Does not follow symlinks

2016-10-19 Thread Marcos Dione
On Wed, Oct 19, 2016 at 09:24:45AM +0200, Maximiliano Curia wrote:
> ¡Hola Marcos!

Hey chango

> El 2016-10-18 a las 20:25 +0200, Marcos Dione escribió:
> >marble has for ages disabled symlinks traversal in a great part of
> > the local cache code. I know for certain that developers have decided to
> > do so to avoid user reports related to dangling symlinks (sorry, I can't
> > find a reference now).
> 
> This also avoids the "recursion too deep" problems.
> 
> > This bug report is to see if the Debian maintainers agree this is wrong.
> 
> What's the benefit that you seek by enabling symlinks?
> 
> As package maintainers we prefer to avoid diverging too much from upstream.
> 
> In particular, this patch is simple enough, but it creates a vector for the
> kind of bugs that upstream wants to avoid. How would we avoid dangling
> symlinks problems?

I'm using symlinks to cache tiles in a particular storage
device/filesystem. I could bind-mount directories, but that complicates
the setup a little. I think that those who are using symlinks (which
involves investigating how marble stores the caches and other data) are
clever enough to dig themselves out of the holes they dug... but I could
be mistaken.

> > Attached you'll find a patch that removes all the references to
> > QDir::NoSymLinks from the code. I tested it and it works fine now. I
> > will keep having this patch around, but I hope you find it useful too,
> > so everyone else can profit from it, and I don't have to recompile
> > marble from time to time :)
> 
> How about trying to send this upstream, maybe making this an option?

I think I did a couple of years ago, and I got the answer I mentioned
in the bug report. Yes, I could do it again. I'll try; if I don't
succeed, I think I'll go the bind-mount way... or keep compiling with my
patch.

Thanks for your time. Cheers,

-- Marcos.

-- 
(Not so) Random fortune:
Terrorism isn't a crime against people or property. It's a crime against
our minds, using the death of innocents and destruction of property to
make us fearful.
-- Bruce Schneier



Bug#841233: marble: Does not follow symlinks

2016-10-19 Thread Maximiliano Curia

¡Hola Marcos!

El 2016-10-18 a las 20:25 +0200, Marcos Dione escribió:
   marble has for ages disabled symlinks traversal in a great part of 
the local cache code. I know for certain that developers have decided to 
do so to avoid user reports related to dangling symlinks (sorry, I can't 
find a reference now).


This also avoids the "recursion too deep" problems.


This bug report is to see if the Debian maintainers agree this is wrong.


What's the benefit that you seek by enabling symlinks?

As package maintainers we prefer to avoid diverging too much from upstream.

In particular, this patch is simple enough, but it creates a vector for the 
kind of bugs that upstream wants to avoid. How would we avoid dangling 
symlinks problems?


Attached you'll find a patch that 
removes all the references to QDir::NoSymLinks from the code. I tested it 
and it works fine now. I will keep having this patch around, but I hope 
you find it useful too, so everyone else can profit from it, and I don't 
have to recompile marble from time to time :)


How about trying to send this upstream, maybe making this an option?

Happy hacking,
--
"Las computadoras son inútiles, solo pueden darte respuestas."
-- Pablo Picasso
Saludos /\/\ /\ >< `/


signature.asc
Description: PGP signature


Bug#841233: marble: Does not follow symlinks

2016-10-18 Thread Marcos Dione
Package: marble
Version: 4:16.04.1-3
Severity: wishlist

Dear Maintainer,

marble has for ages disabled symlinks traversal in a great part of
the local cache code. I know for certain that developers have decided to
do so to avoid user reports related to dangling symlinks (sorry, I can't
find a reference now). This bug report is to see if the Debian
maintainers agree this is wrong. Attached you'll find a patch that
removes all the references to QDir::NoSymLinks from the code. I tested it
and it works fine now. I will keep having this patch around, but I hope
you find it useful too, so everyone else can profit from it, and I don't
have to recompile marble from time to time :)

Cheers,

-- Marcos.


-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (700, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages marble depends on:
ii  libc6   2.24-3
ii  libgcc1 1:6.2.0-6
ii  libkf5configcore5   5.26.0-1
ii  libkf5configgui55.26.0-1
ii  libkf5configwidgets55.26.0-1
ii  libkf5coreaddons5   5.26.0-3
ii  libkf5i18n5 5.26.0-1
ii  libkf5kiowidgets5   5.26.0-1
ii  libkf5newstuff5 5.26.0-1
ii  libkf5parts55.26.0-1
ii  libkf5runner5   5.26.0-1
ii  libkf5widgetsaddons55.26.0-1
ii  libkf5xmlgui5   5.26.0-1
ii  libmarblewidget-qt5-24  4:16.04.1-3
ii  libqt5core5a5.6.1+dfsg-3+b1
ii  libqt5dbus5 5.6.1+dfsg-3+b1
ii  libqt5gui5  5.6.1+dfsg-3+b1
ii  libqt5network5  5.6.1+dfsg-3+b1
ii  libqt5printsupport5 5.6.1+dfsg-3+b1
ii  libqt5widgets5  5.6.1+dfsg-3+b1
ii  libqt5xml5  5.6.1+dfsg-3+b1
ii  libstdc++6  6.2.0-6
ii  marble-data 4:16.04.1-3
ii  marble-plugins  4:16.04.1-3

marble recommends no packages.

Versions of packages marble suggests:
pn  gosmore   
pn  monav-routing-daemon  
pn  routino   

-- no debconf information

-- 
(Not so) Random fortune:
Terrorism isn't a crime against people or property. It's a crime against
our minds, using the death of innocents and destruction of property to
make us fearful.
-- Bruce Schneier
--- a/src/lib/marble/DataMigration.cpp
+++ b/src/lib/marble/DataMigration.cpp
@@ -130,10 +130,8 @@
 QDir sourceDir( sourceDirPath );
 // Creating child file/dir lists.
 QStringList files = sourceDir.entryList( QDir::Files
- | QDir::NoSymLinks
  | QDir::NoDotAndDotDot );
 QStringList childDirs = sourceDir.entryList( QDir::Dirs
- | QDir::NoSymLinks
  | 
QDir::NoDotAndDotDot );
 int childSliceSize = 0;
 if( !childDirs.isEmpty() ) {
--- a/src/lib/marble/FileStoragePolicy.cpp
+++ b/src/lib/marble/FileStoragePolicy.cpp
@@ -111,7 +111,7 @@
 continue;
 }
 
-QDirIterator itTile( tileDirectory, QDir::Files | 
QDir::NoSymLinks, QDirIterator::Subdirectories );
+QDirIterator itTile( tileDirectory, QDir::Files, 
QDirIterator::Subdirectories );
 while (itTile.hasNext()) {
 itTile.next();
 QString filePath = itTile.filePath();
--- a/src/lib/marble/MapThemeManager.cpp
+++ b/src/lib/marble/MapThemeManager.cpp
@@ -273,7 +273,6 @@
 
 QStringList mapPaths = paths.entryList( QStringList( "*" ),
 QDir::AllDirs
-| QDir::NoSymLinks
 | QDir::NoDotAndDotDot );
 QStringList mapDirs;
 
@@ -282,7 +281,6 @@
 QStringList themeMapPaths = themeDir.entryList(
  QStringList( "*" ),
  QDir::AllDirs |
- QDir::NoSymLinks |
  QDir::NoDotAndDotDot );
 for ( int theme = 0; theme < themeMapPaths.size(); ++theme ) {
 mapDirs << mapPathName + '/' + mapPaths.at( planet ) + '/'
@@ -296,7 +294,7 @@
 QString themeDir = it.next() + '/';
 QString themeDirName = QDir( themeDir ).path().section( '/', -2, -1 );
 QStringList tmp = QDir( themeDir ).entryList( QStringList( "*.dgml" ),
-  QDir::Files | 
QDir::NoSymLinks );
+  QDir::Files );
 if ( !tmp.isEmpty() ) {