platform9 / ssh-provider

SSH Machine Controller for the Cluster API
11 stars 4 forks source link

Machine client sets incorrect permissions on directory #36

Closed dlipovetsky closed 6 years ago

dlipovetsky commented 6 years ago

In #27, MkdirAll

cmd = fmt.Sprintf("chmod %d %s", mode, path)

The file mode is a bit field stored as a uint32, but string formatting outputs its integer value, rather than the bit field representation. For example, see https://play.golang.org/p/2RKyDuBXOYu

sarun87 commented 6 years ago

Very good catch. The uint32 converting the octet bit format to a number problem. We could use strings to begin with rather than using os.FileMode. Fixing this with unit32 -> octet string conversion for now.