Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #14 to support some arch linux #15

Merged
merged 1 commit into from
Mar 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion user/config_gnutls.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package user

import (
"os"
"path/filepath"
"strings"
)

Expand Down Expand Up @@ -48,7 +49,12 @@ func (this *GnutlsConfig) Check() error {
soPath, e := getDynPathByElf(this.Curlpath, "libgnutls.so")
if e != nil {
//this.logger.Printf("get bash:%s dynamic library error:%v.\n", bash, e)
this.Gnutls = "/lib/x86_64-linux-gnu/libgnutls.so.30"
_, e = os.Stat(X86_BINARY_PREFIX)
prefix := X86_BINARY_PREFIX
if e != nil {
prefix = OTHERS_BINARY_PREFIX
}
this.Gnutls = filepath.Join(prefix, "libgnutls.so.30")
this.elfType = ELF_TYPE_SO
_, e = os.Stat(this.Gnutls)
if e != nil {
Expand Down
8 changes: 7 additions & 1 deletion user/config_nspr.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package user

import (
"os"
"path/filepath"
"strings"
)

Expand Down Expand Up @@ -48,7 +49,12 @@ func (this *NsprConfig) Check() error {
soPath, e := getDynPathByElf(this.Nsprpath, "libnspr4.so")
if e != nil {
//this.logger.Printf("get bash:%s dynamic library error:%v.\n", bash, e)
this.Nsprpath = "/lib/x86_64-linux-gnu/libnspr4.so"
_, e = os.Stat(X86_BINARY_PREFIX)
prefix := X86_BINARY_PREFIX
if e != nil {
prefix = OTHERS_BINARY_PREFIX
}
this.Nsprpath = filepath.Join(prefix, "libnspr4.so")
//this.Gnutls = "/usr/lib/firefox/libnss3.so"
//"/usr/lib/firefox/libnspr4.so"
this.elfType = ELF_TYPE_SO
Expand Down
8 changes: 7 additions & 1 deletion user/config_openssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package user

import (
"os"
"path/filepath"
"strings"
)

Expand Down Expand Up @@ -48,7 +49,12 @@ func (this *OpensslConfig) Check() error {
soPath, e := getDynPathByElf(this.Curlpath, "libssl.so")
if e != nil {
//this.logger.Printf("get bash:%s dynamic library error:%v.\n", bash, e)
this.Openssl = "/lib/x86_64-linux-gnu/libssl.so.1.1"
_, e = os.Stat(X86_BINARY_PREFIX)
prefix := X86_BINARY_PREFIX
if e != nil {
prefix = OTHERS_BINARY_PREFIX
}
this.Openssl = filepath.Join(prefix, "libssl.so.1.1")
this.elfType = ELF_TYPE_SO
_, e = os.Stat(this.Openssl)
if e != nil {
Expand Down
5 changes: 5 additions & 0 deletions user/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ const (
ELF_TYPE_BIN uint8 = 1
ELF_TYPE_SO uint8 = 2
)

const (
X86_BINARY_PREFIX = "/lib/x86_64-linux-gnu"
OTHERS_BINARY_PREFIX = "/usr/lib"
)