Skip to content

If Dockerfile exists in same directory as service, we should not use it. - #12092

Merged
openshift-merge-robot merged 1 commit into
podman-container-tools:mainfrom
rhatdan:build
Oct 26, 2021
Merged

If Dockerfile exists in same directory as service, we should not use it.#12092
openshift-merge-robot merged 1 commit into
podman-container-tools:mainfrom
rhatdan:build

Conversation

@rhatdan

@rhatdan rhatdan commented Oct 25, 2021

Copy link
Copy Markdown
Contributor

We should only use the Containerfiles/Dockerfiles found in the context
directory.

Fixes: #12054

[NO NEW TEST NEEDED] It is difficult to setup a test for this in the
CI/CD system, but build tests should find if this PR broke anything.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

What this PR does / why we need it:

How to verify it

Which issue(s) this PR fixes:

Special notes for your reviewer:

@openshift-ci

openshift-ci Bot commented Oct 25, 2021

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan

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:

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

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 25, 2021
We should only use the Containerfiles/Dockerfiles found in the context
directory.

Fixes: podman-container-tools#12054

[NO NEW TESTS NEEDED] It is difficult to setup a test for this in the
CI/CD system, but build tests should find if this PR broke anything.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
if err := json.Unmarshal([]byte(query.Dockerfile), &m); err != nil {
// it's not json, assume just a string
m = append(m, query.Dockerfile)
m = []string{filepath.Join(contextDirectory, query.Dockerfile)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is contextDirectory secure at this point? Could someone somehow mess with it to insert some bizarre symlink to create a security issue?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Well we do this all over the place, Bottom line if you can talk to this API, you can get it to do stuff with the server privs. Passing a bad contextDirectory is the least of the problems in that case.

@ashley-cui ashley-cui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mheon

mheon commented Oct 26, 2021

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Oct 26, 2021
@openshift-merge-robot
openshift-merge-robot merged commit 22e5dc1 into podman-container-tools:main Oct 26, 2021
@github-actions github-actions Bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Podman server uses current working directory's Dockerfile instead of the one from input tarball

5 participants