Skip to content

Commit 066c09a

Browse files
authored
fix(core): fix require_literal_leading_dot flipped behavior (#7227)
1 parent 28921cb commit 066c09a

File tree

6 files changed

+13
-7
lines changed

6 files changed

+13
-7
lines changed

.changes/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"bug": "Bug Fixes",
88
"pref": "Performance Improvements",
99
"changes": "What's Changed",
10+
"sec": "Security fixes",
1011
"deps": "Dependencies"
1112
},
1213
"defaultChangeTag": "changes",

.changes/core-leading-dot.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'tauri': 'patch:sec'
3+
---
4+
5+
Fix regression in `1.4` where the default behavior of the file system scope was changed to allow reading hidden files and directories by default.

core/tauri-config-schema/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,7 @@
21022102
}
21032103
},
21042104
"requireLiteralLeadingDot": {
2105-
"description": "Whether or not paths that contain components that start with a `.` will require that `.` appears literally in the pattern; `*`, `?`, `**`, or `[...]` will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files.\n\nDefaults to `false` on Unix systems and `true` on Windows",
2105+
"description": "Whether or not paths that contain components that start with a `.` will require that `.` appears literally in the pattern; `*`, `?`, `**`, or `[...]` will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files.\n\nDefaults to `true` on Unix systems and `false` on Windows",
21062106
"type": [
21072107
"boolean",
21082108
"null"

core/tauri-utils/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,7 +1329,7 @@ pub enum FsAllowlistScope {
13291329
/// conventionally considered hidden on Unix systems and it might be
13301330
/// desirable to skip them when listing files.
13311331
///
1332-
/// Defaults to `false` on Unix systems and `true` on Windows
1332+
/// Defaults to `true` on Unix systems and `false` on Windows
13331333
// dotfiles are not supposed to be exposed by default on unix
13341334
#[serde(alias = "require-literal-leading-dot")]
13351335
require_literal_leading_dot: Option<bool>,

core/tauri/src/scope/fs.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ impl Scope {
114114
} => *require,
115115
// dotfiles are not supposed to be exposed by default on unix
116116
#[cfg(unix)]
117-
_ => false,
118-
#[cfg(windows)]
119117
_ => true,
118+
#[cfg(windows)]
119+
_ => false,
120120
};
121121

122122
Ok(Self {
@@ -287,9 +287,9 @@ mod tests {
287287
require_literal_separator: true,
288288
// dotfiles are not supposed to be exposed by default on unix
289289
#[cfg(unix)]
290-
require_literal_leading_dot: false,
291-
#[cfg(windows)]
292290
require_literal_leading_dot: true,
291+
#[cfg(windows)]
292+
require_literal_leading_dot: false,
293293
..Default::default()
294294
},
295295
}

tooling/cli/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,7 @@
21022102
}
21032103
},
21042104
"requireLiteralLeadingDot": {
2105-
"description": "Whether or not paths that contain components that start with a `.` will require that `.` appears literally in the pattern; `*`, `?`, `**`, or `[...]` will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files.\n\nDefaults to `false` on Unix systems and `true` on Windows",
2105+
"description": "Whether or not paths that contain components that start with a `.` will require that `.` appears literally in the pattern; `*`, `?`, `**`, or `[...]` will not match. This is useful because such files are conventionally considered hidden on Unix systems and it might be desirable to skip them when listing files.\n\nDefaults to `true` on Unix systems and `false` on Windows",
21062106
"type": [
21072107
"boolean",
21082108
"null"

0 commit comments

Comments
 (0)