Commit 85e3360
committed
Resolve database aliases before comparing input/output paths in gbak
When gbak -b is called with a database alias as source and the resolved
path as destination (e.g., gbak -b db_alias /path/to/db.gdb), the
duplicate file check in the validation loop only compared raw strings,
missing the overlap. This could silently overwrite the live database
with backup data.
Enhance the existing all-pairs file comparison loop to expand both
paths via expandDatabaseName() (already used for one side) and emit
the correct error: msg 11 (input and output have the same name) when
source matches a destination, msg 9 (multiple sources or destinations)
for duplicate destinations.1 parent 806dab4 commit 85e3360
1 file changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1162 | 1162 | | |
1163 | 1163 | | |
1164 | 1164 | | |
| 1165 | + | |
| 1166 | + | |
1165 | 1167 | | |
1166 | 1168 | | |
1167 | 1169 | | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | 1170 | | |
1175 | 1171 | | |
1176 | | - | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
1177 | 1175 | | |
1178 | | - | |
1179 | | - | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1180 | 1182 | | |
1181 | 1183 | | |
1182 | 1184 | | |
| |||
0 commit comments