You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been spending a lot of time in lcfs_mount lately and there are a few weird issues around options->image_mountdir.
this is specified by the user as a const char * but we internally cast it to char * so that we can pass it to some functions which require it to be char *. But those functions don't modify it and can be changed to consume const char * without issue.
in the normal exit path (error or not error) we check that we were the ones that created the temporary directory before we remove it:
if (created_tmpdir) {
rmdir(imagemount);
}
but we have an early exit path which removes it unconditionally (if we failed to mount the erofs)
if (err<0) {
rmdir(imagemount);
returnerr;
}
but maybe we just want to eliminate this feature entirely. It's used by nothing else inside of composefs itself. ostree uses it, though, so maybe we decide to keep it....
but in that case, we should definitely improve the const-correctness issues and also fix the bug where we rmdir() the user's directory in some error cases but not others
all of this goes a little bit towards how complicated the error handling in C in libcomposefs has become....
The text was updated successfully, but these errors were encountered:
I've been spending a lot of time in
lcfs_mount
lately and there are a few weird issues aroundoptions->image_mountdir
.this is specified by the user as a
const char *
but we internally cast it tochar *
so that we can pass it to some functions which require it to bechar *
. But those functions don't modify it and can be changed to consumeconst char *
without issue.in the normal exit path (error or not error) we check that we were the ones that created the temporary directory before we remove it:
but maybe we just want to eliminate this feature entirely. It's used by nothing else inside of composefs itself. ostree uses it, though, so maybe we decide to keep it....
but in that case, we should definitely improve the const-correctness issues and also fix the bug where we rmdir() the user's directory in some error cases but not others
all of this goes a little bit towards how complicated the error handling in C in libcomposefs has become....
The text was updated successfully, but these errors were encountered: