Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit 6aa1163

Browse files
author
Vishvananda Ishaya Abrams
committed
fix nss: true
1 parent 60bed10 commit 6aa1163

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

build.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ func buildContainer(tarfile string, buildOpts *buildOptions) bool {
153153
return false
154154
}
155155

156-
nss, err := PopulateNss(outputDir, pkg.User, pkg.Groups)
156+
nss, err := PopulateNss(outputDir, pkg.User, pkg.Groups, pkg.Nss)
157157
if err != nil {
158158
logrus.Errorf("Failed to populate nss: %v", err)
159159
return false

nss.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ const (
2626
// parameters. This function will overwrite any existing passwd, group or
2727
// nsswitch.conf files. It returns true if the user string specified a
2828
// non-numeric user or group.
29-
30-
func PopulateNss(outputDir string, user string, groups []string) (bool, error) {
31-
uid, gid, u, g, nss := ParseUser(user)
32-
if !nss && len(groups) == 0 {
29+
func PopulateNss(outputDir string, user string, groups []string, nss bool) (bool, error) {
30+
uid, gid, u, g, n := ParseUser(user)
31+
if !nss && !n && len(groups) == 0 {
3332
return false, nil
3433
}
3534
etcDir := filepath.Join(outputDir, "etc")

0 commit comments

Comments
 (0)