syncthing / syncthing

Poor file permissions used when creating a file or using os.Chmod GSC-G302
Security
Major
4 occurrences in this check
Expect file permissions to be 0600 or less
 75	path := filepath.Join(dir, "file")
 76	defer os.RemoveAll(dir)
 77
 78	defer os.Chmod(path, 0666) 79
 80	fd, err := os.Create(path)
 81	if err != nil {
Expect file permissions to be 0600 or less
 42	}
 43	fd.Close()
 44
 45	if err := os.Chmod(path, 0666); err != nil { 46		t.Error(err)
 47	}
 48
Expect file permissions to be 0600 or less
 34	path := filepath.Join(dir, "file")
 35	defer os.RemoveAll(dir)
 36
 37	defer os.Chmod(path, 0666) 38
 39	fd, err := os.Create(path)
 40	if err != nil {
Expect file permissions to be 0600 or less
252	if err != nil {
253		return nil, err
254	}
255	fd, err := os.OpenFile(name, OptReadOnly, 0777)256	if err != nil {
257		return nil, err
258	}