This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

The following commit(s) were added to refs/heads/master by this push:
     new 61cabd62cb ff_mkdir_p: skip Windows drive letter to avoid spurious 
EACCES
61cabd62cb is described below

commit 61cabd62cbf0d240620ef7caa382d665268e61b4
Author:     Khalil Elemam <[email protected]>
AuthorDate: Wed Aug 26 07:38:01 2026 +0000
Commit:     Daniel Verkamp <[email protected]>
CommitDate: Sat Sep 12 07:27:42 2026 +0000

    ff_mkdir_p: skip Windows drive letter to avoid spurious EACCES
    
    ff_mkdir_p walks the path and calls mkdir() on each prefix component,
    including the bare drive letter (e.g. "C:"). On Windows, "C:" is a
    drive-relative path that resolves to the process's saved current directory
    on that drive. When the process CWD is on a different drive, "C:" resolves
    to the drive root (C:\), and mkdir on the root returns EACCES.
    
    This causes spurious "Permission denied" errors when creating output
    directories (e.g. HLS segments) on a drive different from the process
    working directory.
    
    Fix: skip the drive letter (X:) and the following separator(s) before
    the component walk, so the first mkdir targets an absolute path.
    
    Fixes #24263
---
 libavformat/utils.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index dabd958397..4874a825a0 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -436,6 +436,15 @@ int ff_mkdir_p(const char *path)
         pos++;
     } else if (!av_strncasecmp(temp, "./", 2) || !av_strncasecmp(temp, ".\\", 
2)) {
         pos += 2;
+    } else if (is_dos_path(temp)) {
+        /* Skip Windows drive letter (e.g. "C:") and the separator(s) after it.
+         * Otherwise the loop below calls mkdir("C:"), which on Windows is a
+         * drive-relative path. When the process CWD is on a different drive,
+         * "C:" resolves to the drive root (C:\), and mkdir on the root
+         * returns EACCES, causing spurious "Permission denied" errors. */
+        pos += 2;
+        while (*pos == '/' || *pos == '\\')
+            pos++;
     }
 
     for ( ; *pos != '\0'; ++pos) {

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to