Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. creating temporary view in a read-only database
Forum Updated to NodeBB v4.3 + New Features

creating temporary view in a read-only database

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 265 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    user4592357
    wrote on last edited by
    #1

    i'm testing my application, where i create a temporary view in the application.
    i tried to make the database file (sqlite) read-only: chmod 444 ~/path/to/db.
    however, still got no error and the views were created successfully and all data from the views were retrieved.
    how come this is possible?

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by Kent-Dorfman
      #2

      probably because you didn't recursively change the permissions on all the files and folders within that path. Looks like you only changed the permissions on the DB directory...which IIRC would make it impossible to chdir into that directory as 444 because the (x) bit needs to be set on directories to make them the cdir.

      I'd strongly suggest learning to use the other form of chmod "o-w,g-w,u-w" to prohibit writes without affecting other bits and using the recursive -R option.

      U 1 Reply Last reply
      0
      • Kent-DorfmanK Kent-Dorfman

        probably because you didn't recursively change the permissions on all the files and folders within that path. Looks like you only changed the permissions on the DB directory...which IIRC would make it impossible to chdir into that directory as 444 because the (x) bit needs to be set on directories to make them the cdir.

        I'd strongly suggest learning to use the other form of chmod "o-w,g-w,u-w" to prohibit writes without affecting other bits and using the recursive -R option.

        U Offline
        U Offline
        user4592357
        wrote on last edited by
        #3

        @kent-dorfman
        i only changed the permissions of the database FILE, sorry for confusion.

        1 Reply Last reply
        0
        • Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on last edited by
          #4

          The views are temporary, right? so they are probably only created in the memory (cache) of the currect DB connection. I'd wager that if you close the connection and reopen it without recreating the views then they no longer exist.

          1 Reply Last reply
          2

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved