Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-82126

Help viewer requires write access to program install location?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12.7
    • Fix Version/s: 6.0 (Next Major Release)
    • Component/s: Tools: Assistant
    • Labels:
      None
    • Environment:
      macOS 10.14.6
    • Platform/s:
      macOS

      Description

      Hi, Qt folks,

      I'm building a Qt-enabled Mac packaging of GNU Octave called Octave.app. http://octave-app.org/

      We use the Qt Help Collection functionality, where we build .qhc files and register them with Qt's GUI help viewer.

      I wanted to lock down the installation of our program so that users wouldn't accidentally modify parts of the core application. (Octave is an interpreted language, and parts of it are shipped as *.m source code files that a user might accidentally edit and overwrite.) So I locked down the installation by doing a "chmod -R a-r <install_location>" on my program.

      Once I did that, on program startup, I started getting this error message:

      > Could not copy help collection to temporary file. Search capabilities may be affected. Cannot unregister index tables in file /Applications/Octave-4.4.1.app/Contents/Resources/usr/Cellar/octave-octave-app@4.4.1/4.4.1/share/octave/4.4.1/doc/octave-interpreter.qhc.

      Uh oh!

      Opening up write access to all the dirs and *.qhc files in my program installation made the error go away:

      find "$app_build_usr/Cellar/$octave_formula" -name '*.qhc' | xargs chmod u+w
      find "$app_build_usr/Cellar/$octave_formula" -type d -exec chmod u+w "{}" \;

       

      But this seems like Not the Right Thing: there are scenarios where a program installation location will or should be read-only. Like in my case, where I'm creating a macOS Application Bundle which I want to sign; that requires all the files in my app bundle to be unchanging, and they should probably be locked down with respect to write permissions. Or maybe in a corporate environment, someone wants to install their application on a read-only network share that various users mount and run the app from.

      Does Qt Help really need write access to the .qhc files? And it looks like it's creating a temporary file in the same directory as the .qhc file or whatever; shouldn't it be creating its temporary files in $TMPDIR or some other user- or system-specific temporary directory, instead of in the application installation location?

      Bug report against my application here: https://github.com/octave-app/octave-app/issues/188

       

      BTW, it looks like you're using Atlassian Jira for your bug tracking system. I'm also using Jira at work, but your Jira is much nicer than my Jira, in terms of user interaction and bug views. Did you customize your Jira setup?

       

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-82126
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              jkobus Jarek Kobus
              Reporter:
              apjanke Andrew Janke
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes