mirror of
https://github.com/jech/galene.git
synced 2024-11-22 00:25:58 +01:00
Create directories for subgroups.
This commit is contained in:
parent
da4a225e96
commit
bbd9ef1f5c
2 changed files with 20 additions and 1 deletions
|
@ -380,7 +380,14 @@ func rewriteDescriptionFile(filename string, desc *Description) error {
|
|||
return ErrDescriptionsNotWritable
|
||||
}
|
||||
|
||||
f, err := os.CreateTemp(path.Dir(filename), "*.temp")
|
||||
dir := filepath.Dir(filename)
|
||||
|
||||
err = os.MkdirAll(dir, 0700)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
f, err := os.CreateTemp(dir, "*.temp")
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -306,3 +306,15 @@ func TestWritableGroups(t *testing.T) {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
func TestSubGroup(t *testing.T) {
|
||||
err := setupTest(t.TempDir(), t.TempDir(), true)
|
||||
if err != nil {
|
||||
t.Fatalf("setupTest: %v", err)
|
||||
}
|
||||
|
||||
err = UpdateDescription("dir/test", "", &Description{})
|
||||
if err != nil {
|
||||
t.Fatalf("UpdateDescription: got %v", err)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue