GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: use 0644 permissions for runtime data files in .func/ by Ankitsinghsisodya · Pull Request #3867 · knative/func

Conversation

@Ankitsinghsisodya

@Ankitsinghsisodya Ankitsinghsisodya commented May 30, 2026

Copy link
Copy Markdown
Contributor

Problem

.func/built-image and .func/built-hash were written using os.ModePerm
(0777), which sets the execute bit on plain data files and is inconsistent
with the rest of the codebase.

The pkg/config package already writes ~/.func/config.yaml with explicit
0600 permissions and has a dedicated test enforcing this. The runtime data
directory had no such discipline.

Changes

  • pkg/functions/function.go:577 — BuiltHash file now written with 0644
  • pkg/functions/function.go:833 — BuiltImage file now written with 0644

client.go:1277 (MkdirAll for the .func/ directory) is intentionally
unchanged — using os.ModePerm with MkdirAll is standard Go practice for
directories; the umask produces the correct 0755 result.

Why 0644 and not 0600

These files contain build metadata (image references, content hashes), not
credentials. They do not need to be private to the owner. 0644 gives the
owner read/write and others read-only, with no execute bits — appropriate for
data files.

Testing

  • make test passes with no changes to existing tests

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Ankitsinghsisodya
fix: update file permissions for written files in function.go
f1e0bc4
Changed file permission mode from os.ModePerm to 0644 for files written in the Stamp and WriteRuntimeBuiltImage functions to ensure proper access control.
Copilot AI review requested due to automatic review settings May 30, 2026 09:56
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos May 30, 2026 09:56
@knative-prow knative-prow Bot added size/XS 🤖 PR changes 0-9 lines, ignoring generated files. needs-ok-to-test 🤖 Needs an org member to approve testing labels May 30, 2026
@knative-prow

knative-prow Bot commented May 30, 2026

Copy link
Copy Markdown

Hi @Ankitsinghsisodya. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed May 30, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR tightens the permissions used when writing function build metadata files, avoiding overly permissive file modes.

Changes:

  • Change os.WriteFile permissions from os.ModePerm (0777) to 0644 when writing the built hash.
  • Change os.WriteFile permissions from os.ModePerm (0777) to 0644 when writing the built image reference.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/functions/function.go

// Write out the hash
if err = os.WriteFile(filepath.Join(f.Root, RunDataDir, BuiltHash), []byte(hash), os.ModePerm); err != nil {
if err = os.WriteFile(filepath.Join(f.Root, RunDataDir, BuiltHash), []byte(hash), 0644); err != nil {
Comment thread pkg/functions/function.go
}

return os.WriteFile(path, []byte(f.Build.Image), os.ModePerm)
return os.WriteFile(path, []byte(f.Build.Image), 0644)
@codecov

codecov Bot commented May 30, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 50.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 53.39%. Comparing base (5b32fef) to head (f1e0bc4).
⚠️ Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
pkg/functions/function.go 50.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3867      +/-   ##
==========================================
- Coverage   53.40%   53.39%   -0.02%     
==========================================
  Files         200      200              
  Lines       23413    23413              
==========================================
- Hits        12504    12501       -3     
- Misses       9659     9661       +2     
- Partials     1250     1251       +1     
Flag Coverage Δ
e2e 33.67% <50.00%> (ø)
e2e go 29.59% <50.00%> (ø)
e2e node 25.88% <50.00%> (ø)
e2e python 29.92% <50.00%> (ø)
e2e quarkus 25.99% <50.00%> (ø)
e2e rust 25.46% <50.00%> (ø)
e2e springboot 24.12% <50.00%> (ø)
e2e typescript 25.98% <50.00%> (ø)
e2e-config-ci 26.82% <50.00%> (ø)
integration 15.76% <50.00%> (-0.02%) ⬇️
unit macos-14 42.23% <50.00%> (ø)
unit macos-latest 42.23% <50.00%> (ø)
unit ubuntu-24.04-arm 42.52% <50.00%> (ø)
unit ubuntu-latest 43.09% <50.00%> (ø)
unit windows-latest 42.30% <50.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@matejvasek

matejvasek commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

/approve
/lgtm

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot assigned matejvasek Jun 11, 2026
@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Jun 11, 2026
@knative-prow

knative-prow Bot commented Jun 11, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Ankitsinghsisodya, matejvasek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [matejvasek]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label Jun 11, 2026
@matejvasek

matejvasek commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

/ok-to-test

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot added ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test 🤖 Needs an org member to approve testing labels Jun 11, 2026
@knative-prow
knative-prow Bot merged commit be8b24d into knative:main Jun 11, 2026
66 of 67 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@dsimansk dsimansk Awaiting requested review from dsimansk
@jrangelramos jrangelramos Awaiting requested review from jrangelramos

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@matejvasek matejvasek

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. lgtm 🤖 PR is ready to be merged. ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. size/XS 🤖 PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Ankitsinghsisodya @matejvasek
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.