~ken-vandine/content-hub/url-dispatcher

« back to all changes in this revision

Viewing changes to tools/send/exporter.cpp

  • Committer: Ken VanDine
  • Date: 2015-05-15 14:20:49 UTC
  • Revision ID: ken.vandine@canonical.com-20150515142049-d3st0wg4azysej38
Don't support file transfers via url-dispatcher

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
    if (query->hasQueryItem("handler"))
71
71
        handler = query->queryItemValue("handler").toStdString();
72
72
    url = query->queryItemValue("url");
 
73
 
 
74
    /* Don't support file transfers via url-dispatcher
 
75
     * it would allow unconfined access to any file simply
 
76
     * by constructing an evil file url
 
77
     */
 
78
    if (url.startsWith("file")) {
 
79
        qWarning() << "File transfers are not supported";
 
80
        return 1;
 
81
    }
 
82
 
73
83
    text = query->queryItemValue("text");
74
84
    TRACE() << "URL:" << url;
75
85
    TRACE() << "PKG:" << pkg;
77
87
    TRACE() << "VER:" << ver;
78
88
    TRACE() << "HANDLER:" << handler.c_str();
79
89
 
80
 
 
81
90
    appId = QString::fromLocal8Bit(ubuntu_app_launch_triplet_to_app_id(pkg, app, ver));
82
91
    if (appId.isNull())
83
92
        appId = QString(pkg);