Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
7aab3381
Commit
7aab3381
authored
Nov 04, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/vmware: check for ifconfig in /sbin [GH-591]
parent
cf0ac15e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
CHANGELOG.md
CHANGELOG.md
+1
-0
builder/vmware/host_ip_ifconfig.go
builder/vmware/host_ip_ifconfig.go
+15
-3
No files found.
CHANGELOG.md
View file @
7aab3381
...
...
@@ -22,6 +22,7 @@ BUG FIXES:
[GH-554]
*
builder/openstack: Properly scrub password from logs [GH-554]
*
builder/virtualbox: No panic if SSH host port min/max is the same. [GH-594]
*
builder/vmware: checks if
`ifconfig`
is in
`/sbin`
[GH-591]
*
builder/vmware: Host IP lookup works for non-C locales. [GH-592]
*
common/uuid: Use cryptographically secure PRNG when generating
UUIDs. [GH-552]
...
...
builder/vmware/host_ip_ifconfig.go
View file @
7aab3381
...
...
@@ -3,6 +3,7 @@ package vmware
import
(
"bytes"
"errors"
"os"
"os/exec"
"regexp"
)
...
...
@@ -13,9 +14,20 @@ type IfconfigIPFinder struct {
}
func
(
f
*
IfconfigIPFinder
)
HostIP
()
(
string
,
error
)
{
ifconfigPath
,
err
:=
exec
.
LookPath
(
"ifconfig"
)
if
err
!=
nil
{
return
""
,
err
var
ifconfigPath
string
// On some systems, ifconfig is in /sbin which is generally not
// on the PATH for a standard user, so we just check that first.
if
_
,
err
:=
os
.
Stat
(
"/sbin/ifconfig"
);
err
==
nil
{
ifconfigPath
=
"/sbin/ifconfig"
}
if
ifconfigPath
==
""
{
var
err
error
ifconfigPath
,
err
=
exec
.
LookPath
(
"ifconfig"
)
if
err
!=
nil
{
return
""
,
err
}
}
stdout
:=
new
(
bytes
.
Buffer
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment