diff --git a/.build/VERSION b/.build/VERSION index 9cbd34da..7ef40656 100644 --- a/.build/VERSION +++ b/.build/VERSION @@ -1 +1 @@ -1.50.1 +1.50.2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b4eb1e8..c237e270 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.50.2 07-Jun-2020 + +### BUGS FIXED + +* Fix incorrect privileges when updating dbdeployer as root + ## 1.50.1 06-Jun-2020 ### BUGS FIXED diff --git a/cmd/update.go b/cmd/update.go index 4c9cb668..f7bed6f0 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -65,6 +65,12 @@ func updateDbDeployer(cmd *cobra.Command, args []string) { targetDirectory := newPath programName := common.BaseName(os.Args[0]) + fullProgramName := common.Which(programName) + fileInfo, err := os.Stat(fullProgramName) + if err != nil { + common.Exitf(1, "error retrieving file info for %s", fullProgramName) + } + filePermissions := fileInfo.Mode().Perm() dbdeployerPath := common.DirName(common.Which(programName)) if targetDirectory == "" { targetDirectory = dbdeployerPath @@ -197,7 +203,9 @@ func updateDbDeployer(cmd *cobra.Command, args []string) { if verbose { fmt.Printf("File %s removed\n", tarballName) } - err = os.Chmod(fileName, globals.ExecutableFileAttr) + + // Give the new file the same attributes of the existing dbdeployer executable + err = os.Chmod(fileName, filePermissions) common.ErrCheckExitf(err, 1, "error changing attributes of %s", fileName) if currentOS != OS && targetDirectory == dbdeployerPath { fmt.Printf("OS of the remote file (%s) different from current OS (%s)\n", OS, currentOS) diff --git a/common/version.go b/common/version.go index c3b03693..a936389a 100644 --- a/common/version.go +++ b/common/version.go @@ -16,9 +16,9 @@ package common // This file was generated during build. Do not edit. -// Build time: 2020-06-06 05:33 +// Build time: 2020-06-06 15:16 -var VersionDef string = "1.50.1" // 2020-06-06 +var VersionDef string = "1.50.2" // 2020-06-06 // Compatible version is the version used to mark compatible archives (templates, configuration). // It is usually major.minor.0, except when we are at version 0.x, when