Fix getJailFromArray: the returned reference was to a copy of the jail
This commit is contained in:
parent
71f345dff4
commit
a7aaa11de6
@ -383,9 +383,9 @@ func getFstab(path string) ([]Mount, error) {
|
|||||||
* Get a specific jail reference, to update properties after a range loop
|
* Get a specific jail reference, to update properties after a range loop
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
func getJailFromArray(name string, jarray []Jail) (*Jail, error) {
|
func getJailFromArray(name string, jarray []Jail) (*Jail, error) {
|
||||||
for _, j := range jarray {
|
for i, j := range jarray {
|
||||||
if name == j.Name {
|
if name == j.Name {
|
||||||
return &j, nil
|
return &jarray[i], nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return &Jail{}, errors.New("Jail not found")
|
return &Jail{}, errors.New("Jail not found")
|
||||||
|
Loading…
Reference in New Issue
Block a user