Fix #95411: "//" temp directory prefix causing crash #118872
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#118872
Loading…
Reference in New Issue
No description provided.
Delete Branch "ideasman42:pr-temp-dir-sanitize"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
which is used for the user preferences & environment variables.
This is an alternative fix to #118856 which ignores these directories.
Since temporary directories may be set via environment variables & "//example/tmp/" is a valid path, I'd suggest to support these paths.
After this PR the following works:
Temp: /tmp/foo/blender_YyTCaH/
is printed.2697eff0e5
to0d0d6ea0c2
0d0d6ea0c2
to2048825d44
2048825d44
to0b3b35683a
After putting in
//
forTemporary Files
I am still getting a warning (similar to without this patch -- now a single slash)
WARN (bke.appdir): source/blender/blenkernel/intern/appdir.cc:1160 tempdir_session_create: Could not generate a temp file name for '/blender_f0jAHj', falling back to '/'
Collada still crashes.
The output of the following also seems wrong
0b3b35683a
to958024b7c6
@lichtwerk this patch makes it so
//path
becomes/path
, however//
also becomes/
.Entering
/
on it's own also has this problem, unrelated to relative paths.I've added a check that the temporary directory is writable, so that means directories without permissions to write will be rejected, although we could consider the issue of "users pointing the temp directory to a path they don't have permissions to write to" separate from paths being interpreted as relative.
Further, Collada crashing without write permissions is suspicious, a file system may fail to write for all sorts of reasons, Blender should report an error that the operation failed - instead of crashing, but that's a separate issue.
From a logical PoV, change LGTM.
Wondering if we should not try to use actual C++ for such new code (although it does add a bit of pain to use it in C-code context...)? And effectively converting the file to C++ one of course.
Something like
std::optional<std::string> blender::temp_directory_path_copy_if_valid(blender::StringRefNull dirpath);
maybe?@HooglyBoogly would know better about that though.
discussed a bit further in chat, accepting (but since Collada will still crash on certain input, will look into separate fix for that...)
Committed
c19cdc343f
, closing.Pull request closed