From 96119484d855ef61ac9695fa4703fab4d316b50a Mon Sep 17 00:00:00 2001 From: Jonathon Anderson Date: Sat, 14 Sep 2024 22:38:55 -0600 Subject: [PATCH] Move syncuser pass from shell to exec Signed-off-by: Jonathon Anderson --- internal/app/wwctl/container/exec/main.go | 4 ---- internal/app/wwctl/container/shell/main.go | 6 +----- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/internal/app/wwctl/container/exec/main.go b/internal/app/wwctl/container/exec/main.go index c57cc731..a0d1787e 100644 --- a/internal/app/wwctl/container/exec/main.go +++ b/internal/app/wwctl/container/exec/main.go @@ -124,10 +124,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error { } } - // getting syncuser from cmd, e.g., shell comamnd will call exec command and passing --syncuser - if syncUserFlag, err := cmd.Flags().GetBool("syncuser"); err == nil { - SyncUser = SyncUser || syncUserFlag - } userdbChanged := false if !beforePasswdTime.IsZero() { afterPasswdTime := getTime(path.Join(containerPath, "/etc/passwd")) diff --git a/internal/app/wwctl/container/shell/main.go b/internal/app/wwctl/container/shell/main.go index 2d2cc5a9..d31ecdc6 100644 --- a/internal/app/wwctl/container/shell/main.go +++ b/internal/app/wwctl/container/shell/main.go @@ -22,11 +22,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error { wwlog.Error("Unknown Warewulf container: %s", containerName) os.Exit(1) } - /* - for _, b := range binds { - allargs = append(allargs, "--bind", b) - } - */ shellName := os.Getenv("SHELL") if !container.ValidSource(containerName) { wwlog.Error("Unknown Warewulf container: %s", containerName) @@ -49,5 +44,6 @@ func CobraRunE(cmd *cobra.Command, args []string) error { wwlog.Debug("Calling exec with args: %s", allargs) cntexec.SetBinds(binds) cntexec.SetNode(nodeName) + cntexec.SyncUser = syncUser return cntexec.CobraRunE(cmd, allargs) }