Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
F
fontconfig
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 152
    • Issues 152
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 17
    • Merge Requests 17
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • fontconfig
  • fontconfig
  • Merge Requests
  • !73

Open
Opened Oct 28, 2019 by Matthieu Herrb@mherrb
  • Report abuse
Report abuse

Avoid chmod() calls on directories

  • Overview 3
  • Commits 1
  • Pipelines 2
  • Changes 2

There are several reasons for that:

  • the reason that triggered this patch is that the pledge() sandboxing system on OpenBSD forbids chmod() by default in many pledged applications. When one of these needs to rebuild the font cache it will fail because of these unneeded chmod() calls.
  • trying to change existing directories access rights isn't a good idea
  • and lastly doing mkdir() && chmod() is racy. Use umask() to make shure the directory is created with the proper access rights from start.

Note that this will revert the fix for https://bugs.freedesktop.org/show_bug.cgi?id=18934

If a user decides to shoot himself in the foot with a bad umask, fontconfig shouldn't try to prevent it. (other programs like vi or cc won't)

The system cache should be generated with umask 022 explicitely, like that to avoid umask issues:

# umask 022 ; fc-cache -s -v

Signed-off-by: Matthieu Herrb matthieu@herrb.eu

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: fontconfig/fontconfig!73
Source branch: no-chmod