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

fix nss: true #27

Merged
merged 1 commit into from
Nov 7, 2017
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
2 changes: 1 addition & 1 deletion build.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func buildContainer(tarfile string, buildOpts *buildOptions) bool {
return false
}

nss, err := PopulateNss(outputDir, pkg.User, pkg.Groups)
nss, err := PopulateNss(outputDir, pkg.User, pkg.Groups, pkg.Nss)
if err != nil {
logrus.Errorf("Failed to populate nss: %v", err)
return false
Expand Down
7 changes: 3 additions & 4 deletions nss.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ const (
// parameters. This function will overwrite any existing passwd, group or
// nsswitch.conf files. It returns true if the user string specified a
// non-numeric user or group.

func PopulateNss(outputDir string, user string, groups []string) (bool, error) {
uid, gid, u, g, nss := ParseUser(user)
if !nss && len(groups) == 0 {
func PopulateNss(outputDir string, user string, groups []string, nss bool) (bool, error) {
uid, gid, u, g, n := ParseUser(user)
if !nss && !n && len(groups) == 0 {
return false, nil
}
etcDir := filepath.Join(outputDir, "etc")
Expand Down