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

FYI: Fix for issue 3180 (will be done together with #3168) #3181

Closed
wants to merge 1 commit into from

Conversation

jsmeix
Copy link
Member

@jsmeix jsmeix commented Mar 18, 2024

In sbin/rear do

QuietAddExitTask cleanup_build_area_and_end_program

after the build area was successfully created to fix
#3180
but still before the first possible call
of the 'Error' function to avoid to error out
but leave the build area behind, see
#2633

In sbin/rear do
QuietAddExitTask cleanup_build_area_and_end_program
after the build area was successfully created to fix
#3180
but still before the first possible call of the 'Error' function
to avoid to error out but leave the build area behind
see #2633
@jsmeix jsmeix requested a review from pcahyna March 18, 2024 14:43
@jsmeix jsmeix self-assigned this Mar 18, 2024
@jsmeix jsmeix added bug The code does not do what it is meant to do blocker The next ReaR version is not released unless that issue is solved. labels Mar 18, 2024
@jsmeix jsmeix added this to the ReaR v2.8 milestone Mar 18, 2024
@jsmeix
Copy link
Member Author

jsmeix commented Mar 18, 2024

With the changes of this pull request I get

# export TMPDIR=QQQ

# ls QQQ
ls: cannot access 'QQQ': No such file or directory

# usr/sbin/rear -D mkrescue
tac: failed to create temporary file in 'QQQ': No such file or directory
tac: failed to create temporary file in 'QQQ': No such file or directory
mktemp: failed to create directory via template 'QQQ/rear.XXXXXXXXXXXXXXX': No such file or directory
ERROR: Could not create build area ''
+ LogPrint 'Exiting rear mkrescue (PID 4187) and its descendant processes ...'
+ Log 'Exiting rear mkrescue (PID 4187) and its descendant processes ...'
+ test -w /root/rear.github.master/var/log/rear/rear-localhost.log
+ return 0
+ Print 'Exiting rear mkrescue (PID 4187) and its descendant processes ...'
Exiting rear mkrescue (PID 4187) and its descendant processes ...
...
Running exit tasks
...
+ eval '(( EXIT_FAIL_MESSAGE )) && echo '\''rear mkrescue failed, check /root/rear.github.master/var/log/rear/rear-localhost.log for details'\'' 1>&8'
...
rear mkrescue failed, check /root/rear.github.master/var/log/rear/rear-localhost.log for details
...
+ eval 'exec 8>&-'
...
+ eval 'exec 7>&-'
...
+ eval 'exec 6<&-'

jsmeix added a commit that referenced this pull request Mar 18, 2024
In sbin/rear set TMPDIR to ReaR's TMP_DIR
in any case unless in RECOVERY_MODE,
see #3167 (comment)
Additionally remember what TMPDIR was
originally set when ReaR was launched
and provide meaningful debug info
when ReaR uses a different TMPDIR.
Furthermore added the changes from
#3181
to fix #3180
@jsmeix jsmeix marked this pull request as draft March 18, 2024 15:45
@jsmeix jsmeix changed the title Fix for issue 3180 FYI: Fix for issue 3180 (will be done together with https://github.com/rear/rear/pull/3168) Mar 18, 2024
@jsmeix jsmeix changed the title FYI: Fix for issue 3180 (will be done together with https://github.com/rear/rear/pull/3168) FYI: Fix for issue 3180 (will be done together with #3168) Mar 18, 2024
@jsmeix
Copy link
Member Author

jsmeix commented Mar 18, 2024

This one is obsoleted by one part of
b741883

jsmeix added a commit that referenced this pull request Mar 26, 2024
In usr/sbin/rear set TMPDIR to ReaR's TMP_DIR (within BUILD_DIR)
(except in RECOVERY_MODE to avoid failures in "chroot /mnt/local").
This ensures that also for programs that are called by ReaR
ReaR will clean up all temporary stuff carefully and completely
via the function cleanup_build_area_and_end_program() and
it ensures that temporary files from programs that are called by ReaR
are sufficiently safe against unwanted access by non-root users
via 'mktemp -d' where BUILD_DIR and implicitly TMP_DIR=$BUILD_DIR/tmp
has permissions only for root but none for the group or others,
see #3167
Furthermore added the changes from
#3181
to fix #3180
which is also about BUILD_DIR / TMPDIR related code.
@jsmeix
Copy link
Member Author

jsmeix commented Mar 26, 2024

With #3168 merged
the changes of this pull request are also merged
so this pull request can be closed.

@jsmeix jsmeix closed this Mar 26, 2024
@jsmeix jsmeix deleted the jsmeix-fix3180 branch March 26, 2024 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker The next ReaR version is not released unless that issue is solved. bug The code does not do what it is meant to do won't fix / can't fix / obsolete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant