Skip to content

patch request for FreeBSD #312

Closed
Closed
@sheo0147

Description

@sheo0147

Apply following patch.

$ diff -c freebsd.go.orig freebsd.go
*** freebsd.go.orig    Mon Feb  6 14:38:18 2017
--- freebsd.go    Mon Feb  6 14:39:37 2017
***************
*** 48,54 ****
  
      if r := exec(c, "uname", noSudo); r.isSuccess() {
          if strings.Contains(r.Stdout, "FreeBSD") == true {
!             if b := exec(c, "uname -r", noSudo); b.isSuccess() {
                  rel := strings.TrimSpace(b.Stdout)
                  bsd.setDistro("FreeBSD", rel)
                  return true, bsd
--- 48,54 ----
  
      if r := exec(c, "uname", noSudo); r.isSuccess() {
          if strings.Contains(r.Stdout, "FreeBSD") == true {
!             if b := exec(c, "freebsd-version", noSudo); b.isSuccess() {
                  rel := strings.TrimSpace(b.Stdout)
                  bsd.setDistro("FreeBSD", rel)
                  return true, bsd

There are 2 version information on FreeBSD. One is kernel version, and other is system version. FreeBSD uname outputs kernel version only. You can get FreeBSD system version by freebsd-version command.
So vuls need to run freebsd-version insted of uname -r.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions