muesli / pam-beacon

PAM module for multi-factor authentication with Bluetooth Devices & Beacons
MIT License
45 stars 6 forks source link

Newbie problem compiling #3

Closed ju916 closed 5 years ago

ju916 commented 5 years ago

Preamble: This is my first go project, so please bear with me if this is a stupid mistake on my side.

When doing "make deps" I get:

...
github.com/pkg/errors (download)
pam-beacon
# pam-beacon
./main.go:56: undefined: linux.NewBtMgmt
Makefile:7: recipe for target 'deps' failed
make: *** [deps] Error 2

I have Ubuntu 18.04 LTS with Go 1.10 (golang-1.10) and did:

# cd ~/go/src
# git clone pam-beacon
# cd pam-beacon
# make deps

It looks like it is downloading all the reuqired Go packages, but it does not find/use them. grep shows me that NewBtMgmt() is defined in ../github.com/muka/go-bluetooth/linux/btmgmt/btmgmt.go

ju916 commented 5 years ago

I fixed that error for me by correcting the imports:

$ diff main.go-org main.go
18c18
<   "github.com/muka/go-bluetooth/linux"
---
>   "github.com/muka/go-bluetooth/linux/btmgmt"
56c56
<   a := linux.NewBtMgmt(adapterID)
---
>   a := btmgmt.NewBtMgmt(adapterID)
muesli commented 5 years ago

Thanks for noticing! I've just committed the required changes to master.

ju916 commented 5 years ago

FYI: You might want to "fix" another installation issue. make install tries to copy to /usr/lib/security This does not exist on Ubuntu. I used /lib/security instead.