Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8588047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:43:10+00:00 2026-06-11T22:43:10+00:00

I have an elevated process and I want to make sure the SQLite files

  • 0

I have an elevated process and I want to make sure the SQLite files that it creates are readable by other processes. For some reason umask doesn’t seem to do what I want (set permissions of sqlite file created by process).

I’m using write-ahead logging, so -wal and -shm files are created in addition to the database file. I want all 3 to be chmodded correctly.

I wonder if it’s possible to get in after the SQLite file is created and chmod it.

Possible approaches:

  1. touch all 3 files before SQLite tries to create them, then chmod and hope the mask stays the same
  2. Intercept when the files are created and chmod them.
  3. Work out how to get umask to work for the process.
  4. Mystery option four.

What’s the best way to go?

Questions for approaches:

  1. Will SQLite be OK with this?
  2. Do we know when all 3 files are created? Is there some kind of callback I can give a function pointer to? Do we know if the same wal and shm files are around forever? Or are they deleted and re-created?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:43:11+00:00Added an answer on June 11, 2026 at 10:43 pm

    You can touch the database file before opening it. (When you use the sqlite3 command-line tool to open a new file, but do nothing but begin; and commit;, SQLite itself will create a zero-sized file.)

    If you want to intercept file operations, you can register your own VFS.

    The -wal and -shm files are created dynamically, but SQLite will give them the same permission bits as the main database file. The comments for robust_open() in os_unix.c say:

    If the file creation mode “m” is 0 then set it to the default for
    SQLite. The default is SQLITE_DEFAULT_FILE_PERMISSIONS (normally
    0644) as modified by the system umask. If m is not 0, then
    make the file creation mode be exactly m ignoring the umask.

    The m parameter will be non-zero only when creating -wal, -journal,
    and -shm files. We want those files to have exactly the same
    permissions as their original database, unadulterated by the umask.
    In that way, if a database file is -rw-rw-rw or -rw-rw-r-, and a
    transaction crashes and leaves behind hot journals, then any
    process that is able to write to the database will also be able to
    recover the hot journals.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an admin app that runs with elevated privileges and I need it
I have a small script that performs the build and install process on Windows
I have some utility methods that use Microsoft.Web.Administration.ServerManager that I've been having some issues
I have a simple process which reads from one queue, processes the messages, and
With the new Silverlight 5, we can now have an In-Browser elevated-trust application. However,
I have an app with a manifest that requires running as administrator, but part
On Windows 7, I have a command-line program that fails due to file write permission
I am wanting to retrieve all the files in some directories. Here is my
I have a simple PowerShell script to stop a process: $p = get-process $args
I have developed a C# Windows Forms application that runs in the background as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.