From 11959d5911e90aa58a9b0109a9b777da3e916b47 Mon Sep 17 00:00:00 2001 From: James Golovich Date: Tue, 13 Sep 2022 16:33:27 -0700 Subject: [PATCH] Separate generic and os specific locale functions --- implant/sliver/locale/locale.go | 34 +++++++++++++++++++++++++ implant/sliver/locale/locale_generic.go | 17 ++++--------- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/implant/sliver/locale/locale.go b/implant/sliver/locale/locale.go index 73ffe6ed02..c89b58a369 100644 --- a/implant/sliver/locale/locale.go +++ b/implant/sliver/locale/locale.go @@ -1 +1,35 @@ +//go:build darwin || linux || windows + package locale + +/* + Sliver Implant Framework + Copyright (C) 2021 Bishop Fox + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +import ( + "github.com/bishopfox/sliver/implant/sliver/locale/jibberjabber" +) + +// GetLocale returns the default language set +func GetLocale() string { + userLocale, err := jibberjabber.DetectIETF() + if err != nil { + return "" + } + return userLocale +} diff --git a/implant/sliver/locale/locale_generic.go b/implant/sliver/locale/locale_generic.go index e112f20d92..d4ed897123 100644 --- a/implant/sliver/locale/locale_generic.go +++ b/implant/sliver/locale/locale_generic.go @@ -1,3 +1,5 @@ +//go:build !darwin && !(windows && (amd64 || 386)) && !(linux && (amd64 || 386)) + package locale /* @@ -18,20 +20,11 @@ package locale along with this program. If not, see . ----------------------------------------------------------------------- - - Hopefully the generic works for everything. + Place holder so we don't get undefined functions in generic builds. */ -import ( - "github.com/cubiest/jibberjabber" -) - // GetLocale returns the default language set func GetLocale() string { - userLocale, err := jibberjabber.DetectIETF() - if err != nil { - return "" - } - return userLocale -} \ No newline at end of file + return "" +}