Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to specify the mode when creating a temp dir #14208

Merged
merged 1 commit into from
Mar 23, 2023

Conversation

FlorentClarret
Copy link
Member

@FlorentClarret FlorentClarret commented Mar 22, 2023

What does this PR do?

Allow to specify the mode when creating a temp dir

Motivation

  • By default, the directory has 0o700, see https://github.com/python/cpython/blob/main/Lib/tempfile.py#L344-L379
  • In my case, I use this to create a dir to store some secrets generated on the fly that I'm mounting in docker containers. Only the root user can access and modify this folder, however some of the docker images I have are using a different user, so this user can't access the data and write to this folder. I ended up calling chmod on my side and it worked

Additional Notes

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have changelog/ and integration/ labels attached
  • If the PR doesn't need to be tested during QA, please add a qa/skip-qa label.

@ghost ghost added the dev_package label Mar 22, 2023
@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/tempdir-permissions branch from 5631320 to d087c02 Compare March 22, 2023 10:06
@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Merging #14208 (bee2f71) into master (3150426) will decrease coverage by 0.73%.
The diff coverage is 100.00%.

Flag Coverage Δ
active_directory 100.00% <ø> (+17.64%) ⬆️
activemq_xml 82.31% <ø> (ø)
amazon_msk 89.07% <ø> (ø)
ambari 85.75% <ø> (ø)
apache 95.08% <ø> (ø)
arangodb 98.21% <ø> (ø)
avi_vantage 92.54% <ø> (ø)
azure_iot_edge 82.00% <ø> (ø)
boundary 100.00% <ø> (ø)
btrfs 82.91% <ø> (ø)
cisco_aci 95.27% <ø> (ø)
citrix_hypervisor 87.50% <ø> (ø)
cloud_foundry_api 95.98% <ø> (+0.12%) ⬆️
cloudera 99.82% <ø> (ø)
consul 91.64% <ø> (ø)
coredns 94.54% <ø> (ø)
crio 89.79% <ø> (ø)
datadog_checks_base 89.67% <ø> (+0.34%) ⬆️
datadog_checks_dev 80.02% <100.00%> (-2.46%) ⬇️
datadog_checks_downloader 80.48% <ø> (ø)
datadog_cluster_agent 90.00% <ø> (ø)
ddev 98.64% <ø> (ø)
directory 96.50% <ø> (ø)
disk 89.64% <ø> (-2.15%) ⬇️
dns_check 93.90% <ø> (ø)
dotnetclr 94.93% <ø> (+15.18%) ⬆️
druid 97.70% <ø> (ø)
ecs_fargate 80.92% <ø> (ø)
eks_fargate 94.05% <ø> (ø)
envoy 94.18% <ø> (ø)
external_dns 89.09% <ø> (ø)
fluentd 94.77% <ø> (ø)
foundationdb 78.50% <ø> (ø)
go_expvar 92.73% <ø> (ø)
harbor 80.04% <ø> (ø)
http_check 95.81% <ø> (+2.15%) ⬆️
ibm_i 81.95% <ø> (ø)
impala 97.97% <ø> (ø)
kube_apiserver_metrics 97.95% <ø> (ø)
kube_controller_manager 96.00% <ø> (ø)
kube_metrics_server 94.87% <ø> (ø)
kube_proxy 96.80% <ø> (ø)
kube_scheduler 96.53% <ø> (ø)
kubelet 90.96% <ø> (ø)
kubernetes_state 89.18% <ø> (ø)
kyototycoon 85.96% <ø> (ø)
linux_proc_extras 96.22% <ø> (ø)
mapreduce 81.81% <ø> (+0.46%) ⬆️
mcache 93.50% <ø> (ø)
mesos_slave 93.63% <ø> (ø)
nagios 89.01% <ø> (ø)
network 63.08% <ø> (-29.97%) ⬇️
nfsstat 95.20% <ø> (ø)
openmetrics 97.90% <ø> (ø)
openstack 51.45% <ø> (ø)
openstack_controller 91.12% <ø> (ø)
php_fpm 90.25% <ø> (+0.84%) ⬆️
powerdns_recursor 96.65% <ø> (ø)
process 85.42% <ø> (+0.28%) ⬆️
pulsar 100.00% <ø> (ø)
rethinkdb 97.93% <ø> (ø)
riak 99.22% <ø> (ø)
silk 93.51% <ø> (ø)
snowflake 96.47% <ø> (ø)
system_swap 98.30% <ø> (ø)
tcp_check 91.58% <ø> (ø)
tokumx 58.40% <ø> (ø)
twistlock 79.62% <ø> (ø)

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

@FlorentClarret FlorentClarret marked this pull request as ready for review March 22, 2023 10:15
@FlorentClarret FlorentClarret requested a review from a team as a code owner March 22, 2023 10:15
iliakur
iliakur previously approved these changes Mar 22, 2023
Copy link
Contributor

@iliakur iliakur left a comment

Choose a reason for hiding this comment

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

I'm getting a dejavu with this change of a PR I saw when I just started, I can swear it was also about exposing the mode of tempdirs. I can't find it naturally :)

@FlorentClarret
Copy link
Member Author

I'll fix the windows tests this afternoon

@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/tempdir-permissions branch from d087c02 to 1567887 Compare March 22, 2023 11:01
@ghost ghost added the integration/openldap label Mar 22, 2023
@FlorentClarret FlorentClarret force-pushed the florentclarret/ddev/tempdir-permissions branch from bee2f71 to 4ecb59b Compare March 22, 2023 12:46
@FlorentClarret FlorentClarret merged commit d73606c into master Mar 23, 2023
@FlorentClarret FlorentClarret deleted the florentclarret/ddev/tempdir-permissions branch March 23, 2023 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants