v.0.34 : Jail names can be shortened
This commit is contained in:
@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
gVersion = "0.33c"
|
||||
gVersion = "0.34"
|
||||
|
||||
// TODO : Get from $jail_zpool/defaults.json
|
||||
MIN_DYN_DEVFS_RULESET = 1000
|
||||
|
@ -772,7 +772,8 @@ func getJailFromArray(name string, jarray []Jail) (*Jail, error) {
|
||||
}
|
||||
|
||||
for i, j := range jarray {
|
||||
if jail == j.Name {
|
||||
//if jail == j.Name {
|
||||
if strings.HasPrefix(j.Name, jail) {
|
||||
if len(ds) > 0 {
|
||||
if strings.EqualFold(ds, j.Datastore) {
|
||||
return &jarray[i], nil
|
||||
@ -786,7 +787,7 @@ func getJailFromArray(name string, jarray []Jail) (*Jail, error) {
|
||||
}
|
||||
if len(jails) > 0 {
|
||||
if len(jails) > 1 {
|
||||
return &Jail{}, errors.New("More than one jail found with this name, please use datastore/jail format")
|
||||
return &Jail{}, errors.New("More than one jail matching, please use datastore/jail format or full name")
|
||||
} else {
|
||||
return &jails[0], nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user