Skip to content

Fix global find to be limited #14

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

Open
verm opened this issue Jun 4, 2025 · 1 comment
Open

Fix global find to be limited #14

verm opened this issue Jun 4, 2025 · 1 comment

Comments

@verm
Copy link

verm commented Jun 4, 2025

In

https://github.com/FreeBSDFoundation/pkgbasify/blob/main/pkgbasify.lua#L369

There is a find /. This bit me as I have about 15 NFS mounts so it sat there scanning all of them until it finally quit:

stack traceback:
	[C]: in function 'assert'
	./pkgbasify.lua:396: in function 'capture'
	./pkgbasify.lua:369: in function 'merge_pkgsaves'
	./pkgbasify.lua:145: in function 'execute_conversion'
	./pkgbasify.lua:70: in function 'main'
	./pkgbasify.lua:422: in main chunk
	[C]: in ?

There was no way for me to remove the mounts or do anything as now my system is in a broken state as it wiped out several files in /etc/ for instance /etc/passwd was reset along with several other files. Luckily I had an emergency terminal open just in case and was able to repair.

@grahamperrin
Copy link
Contributor

pkgbasify/pkgbasify.lua

Lines 368 to 369 in ee835d5

function merge_pkgsaves(workdir)
for ours in capture("find / -name '*.pkgsave'"):gmatch("[^\n]+") do

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants