mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (samba): prevent panic in nil pointer dereference
the samba lib was crashing with nil pointer dereference when username is an empty string ?!? Too lazy to provide a better fix so this will do for now
This commit is contained in:
parent
04154556f3
commit
6028a4363b
1 changed files with 3 additions and 0 deletions
|
|
@ -44,6 +44,9 @@ func (smb Samba) Init(params map[string]string, app *App) (IBackend, error) {
|
||||||
if params["port"] == "" {
|
if params["port"] == "" {
|
||||||
params["port"] = "445"
|
params["port"] = "445"
|
||||||
}
|
}
|
||||||
|
if params["username"] == "" {
|
||||||
|
params["username"] = "Guest"
|
||||||
|
}
|
||||||
conn, err := net.DialTimeout(
|
conn, err := net.DialTimeout(
|
||||||
"tcp",
|
"tcp",
|
||||||
fmt.Sprintf("%s:%s", params["host"], params["port"]),
|
fmt.Sprintf("%s:%s", params["host"], params["port"]),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue