diff --git a/CHANGELOG.md b/CHANGELOG.md index cfd58f6f..cadff4cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,9 +46,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## v4.5.8, unreleased +### Added + +- Added `--syncuser` flag to `wwctl container shell`. #1358 + ### Changed - Interleave tmpfs across all available NUMA nodes. #1347, #1348 +- Syncuser watches for changes in mtime rather than ctime. #1358 ### Fixed diff --git a/internal/app/wwctl/container/exec/main.go b/internal/app/wwctl/container/exec/main.go index 336218a9..a0d1787e 100644 --- a/internal/app/wwctl/container/exec/main.go +++ b/internal/app/wwctl/container/exec/main.go @@ -166,7 +166,7 @@ func getTime(path string) time.Time { return time.Time{} } else { unixStat := fileStat.Sys().(*syscall.Stat_t) - return time.Unix(int64(unixStat.Ctim.Sec), int64(unixStat.Ctim.Nsec)) + return time.Unix(int64(unixStat.Mtim.Sec), int64(unixStat.Mtim.Nsec)) } } 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) } diff --git a/internal/app/wwctl/container/shell/root.go b/internal/app/wwctl/container/shell/root.go index e1ae01d3..b6d2e60b 100644 --- a/internal/app/wwctl/container/shell/root.go +++ b/internal/app/wwctl/container/shell/root.go @@ -25,6 +25,7 @@ var ( } binds []string nodeName string + syncUser bool ) func init() { @@ -33,6 +34,7 @@ Bind a local path which must exist into the container. If destination is not set, uses the same path as source. "ro" binds read-only. "copy" temporarily copies the file into the container.`) baseCmd.PersistentFlags().StringVarP(&nodeName, "node", "n", "", "Create a read only view of the container for the given node") + baseCmd.PersistentFlags().BoolVar(&syncUser, "syncuser", false, "Synchronize UIDs/GIDs from host to container") } // GetRootCommand returns the root cobra.Command for the application.