Skip to content

Commit

Permalink
Merge pull request oracle#27 from oracle/fixnss
Browse files Browse the repository at this point in the history
fix nss: true
  • Loading branch information
vishvananda committed Nov 7, 2017
2 parents 60bed10 + 6aa1163 commit bc4d01a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit bc4d01a

Please sign in to comment.