Fix improper umask calculation on socket creation

This commit fixes a subtle bug with umask calculation when the
guest-agent command monitor is creating the unix domain socket.
The buggy calculation uses the demical 777 instead of octal 0777.
This means that if `filemode` is 0770, which is the default value
defined in
`internal/command/command_monitor.go`,
then the actual computed umask is:

777 (dec) - 504 (dec) = 273 (dec) = 0421 (oct)

Which is a nonsensical umask for our purpose.

PiperOrigin-RevId: 919864282
1 file changed
tree: f9183159134c45c2ecf913d7cb01057410fdbce0
  1. build/
  2. cmd/
  3. internal/
  4. pkg/
  5. CONTRIBUTING.md
  6. go.mod
  7. go.sum
  8. LICENSE
  9. Makefile
  10. README.md
  11. version
README.md

Public Cloud Docs

Guest Agent for Google Compute Engine.

This repository contains the source code and packaging artifacts for the Google guest agent. These components are installed on Windows and Linux GCE VMs in order to enable GCE platform features.

Building Guest Agent

In the codebase there's a GNU Make based build system with targets to build and test the guest agent.

In order to build both the guest-agent and core_plugins, run

make

To build only one or the other, run the respective make target:

make build cmd/google_guest_agent/google_guest_agent
make build cmd/core_plugin/core_plugin

To run all the go tests, run:

make test

For more targets and info about the build system run:

make help