@@ -170,7 +170,7 @@ func getFlavor(version string) string {
170
170
if ! common .FileExists (filePath ) {
171
171
return common .MySQLFlavor
172
172
}
173
- flavor , err := os .ReadFile (filePath )
173
+ flavor , err := os .ReadFile (filePath ) // #nosec G304
174
174
if err != nil || string (flavor ) == "" {
175
175
return common .MySQLFlavor
176
176
}
@@ -290,7 +290,7 @@ func buildTests(templateDir, dataDir, label string, data map[string]string) erro
290
290
}
291
291
292
292
if ! common .DirExists (dataDir ) {
293
- err := os .Mkdir (dataDir , 0755 )
293
+ err := os .Mkdir (dataDir , 0750 )
294
294
if err != nil {
295
295
return fmt .Errorf ("[buildTests] error creating directory %s: %s" , dataDir , err )
296
296
}
@@ -329,21 +329,21 @@ func buildTests(templateDir, dataDir, label string, data map[string]string) erro
329
329
continue
330
330
}
331
331
conditionalPrint ("processing file %s\n " , fName )
332
- contents , err := os .ReadFile (f )
332
+ contents , err := os .ReadFile (f ) // #nosec G304
333
333
if err != nil {
334
334
return fmt .Errorf ("[buildTests] error reading file %s: %s" , f , err )
335
335
}
336
336
337
337
subDataDir := path .Join (dataDir , sectionName )
338
338
if ! common .DirExists (subDataDir ) {
339
- err := os .Mkdir (subDataDir , 0755 )
339
+ err := os .Mkdir (subDataDir , 0750 )
340
340
if err != nil {
341
341
return fmt .Errorf ("[buildTests] error creating directory %s: %s" , subDataDir , err )
342
342
}
343
343
}
344
344
endDataDir := path .Join (subDataDir , label )
345
345
if ! common .DirExists (endDataDir ) {
346
- err := os .Mkdir (endDataDir , 0755 )
346
+ err := os .Mkdir (endDataDir , 0750 )
347
347
if err != nil {
348
348
return fmt .Errorf ("[buildTests] error creating directory %s: %s" , endDataDir , err )
349
349
}
@@ -363,20 +363,20 @@ func buildTests(templateDir, dataDir, label string, data map[string]string) erro
363
363
}
364
364
versionFile := path .Join (endDataDir , "DB_VERSION" )
365
365
if ! common .FileExists (versionFile ) {
366
- err = os .WriteFile (versionFile , []byte (data ["DbVersion" ]), 0644 )
366
+ err = os .WriteFile (versionFile , []byte (data ["DbVersion" ]), 0600 )
367
367
if err != nil {
368
368
return fmt .Errorf ("[buildTests] error writing version file %s: %s" , versionFile , err )
369
369
}
370
370
}
371
371
flavorFile := path .Join (endDataDir , "DB_FLAVOR" )
372
372
if ! common .FileExists (flavorFile ) {
373
- err = os .WriteFile (flavorFile , []byte (data ["DbFlavor" ]), 0644 )
373
+ err = os .WriteFile (flavorFile , []byte (data ["DbFlavor" ]), 0600 )
374
374
if err != nil {
375
375
return fmt .Errorf ("[buildTests] error writing flavor file %s: %s" , flavorFile , err )
376
376
}
377
377
}
378
378
testName := path .Join (endDataDir , fName + "_" + label + ".txtar" )
379
- err = os .WriteFile (testName , buf .Bytes (), 0644 )
379
+ err = os .WriteFile (testName , buf .Bytes (), 0600 )
380
380
if err != nil {
381
381
return fmt .Errorf ("[buildTests] error writing text file %s: %s" , testName , err )
382
382
}
0 commit comments