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
Copy file name to clipboardExpand all lines: README.md
+131-7Lines changed: 131 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,23 +8,24 @@
8
8
9
9
A robust shell script library for parsing and manipulating INI configuration files in Bash.
10
10
11
-
## Try It Online
12
-
13
-
You can try the Bash INI Parser directly in your browser through our interactive web demo. The demo provides a terminal environment with pre-loaded example files so you can test the library without installation.
14
-
15
-
**[Try Bash INI Parser Online](https://lsferreira42.github.io/bash-ini-parser/)**
16
-
17
11
## Features
18
12
19
13
-**Read and write** values from/to INI files
20
14
-**List sections and keys** in INI files
21
15
-**Add, update, and remove** sections and keys
16
+
-**Rename sections and keys** with validation
17
+
-**Validate INI file structure** for correctness
18
+
-**Format and organize** INI files with indentation and sorting
19
+
-**Batch operations** for efficient bulk updates
20
+
-**Merge files** with configurable conflict resolution strategies
21
+
-**Export to JSON and YAML** formats
22
22
-**Supports complex values** including quotes, spaces, and special characters
23
23
-**Array support** for storing multiple values
24
24
-**Import/export functionality** between files and environment variables
25
25
-**Extensive error handling** with detailed error messages
26
26
-**Debug mode** for troubleshooting
27
27
-**Configurable behavior** through environment variables
28
+
-**Security features** including path validation, file locking, and atomic operations
28
29
-**Backwards compatible** with previous versions
29
30
30
31
## Installation
@@ -120,6 +121,91 @@ if ini_key_exists "config.ini" "app" "version"; then
The library's behavior can be customized by setting these variables either directly in your script after sourcing the library or as environment variables before sourcing the library:
@@ -155,9 +241,15 @@ INI_ALLOW_SPACES_IN_NAMES=1
155
241
### Security Improvements
156
242
157
243
-**Input validation** for all parameters
244
+
-**Path traversal protection** to prevent directory traversal attacks
158
245
-**Secure regex handling** with proper escaping of special characters
159
-
-**Temporary file security**to prevent data corruption
246
+
-**Temporary file security**with automatic cleanup and tracking
160
247
-**File permission checks** to ensure proper access rights
248
+
-**File locking** to prevent race conditions during concurrent writes
249
+
-**Atomic operations** with backup creation for data integrity
250
+
-**Symlink resolution** to prevent malicious symlink attacks
251
+
-**File size validation** to prevent resource exhaustion
252
+
-**Environment variable name sanitization** for safe export
161
253
-**Automatic directory creation** when needed
162
254
163
255
### Core Function Enhancements
@@ -175,10 +267,26 @@ INI_ALLOW_SPACES_IN_NAMES=1
175
267
-`ini_debug` - Displays debug messages when debug mode is enabled
176
268
-`ini_error` - Standardized error message format
177
269
-`ini_validate_section_name` and `ini_validate_key_name` - Validate input data
270
+
-`ini_validate_path` - Validates file paths and prevents traversal attacks
0 commit comments