Create LB/FW/IP temporary files under /tmp directory #27
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.
When run loxicmd save -c "dir" with --ip or --firewall or --lb from BPFire web interface with user "nobody" when "dir" is owned by user "nobody", web inrerface got error "Can't create dump file".
The issue is reported in vincentmli/BPFire#30 with the help of libbpf-tools opensnoop, the permission error shows below:
PID COMM FD ERR PATH
23194 loxicmd -1 13 lbconfig_2024-08-23_19:00:35.txt
ERR 13 is EACCESS, and the PATH is lbconfig_2024-08-23_19:00:35.txt
"lbconfig_2024-08-23_19:00:35.txt" is neither under "dir" nor "/tmp" which web user "nobody" has permission to create file in.
since "lbconfig_2024-08-23_19:00:35.txt" is temporary file, we can create the temporary file under /tmp directory and automatically get removed after loxicmd exit.
fix: #26