isValidDeviceMode checks if the mode for device is valid or not. isValid mode is a composition of r (read), w (write), and m (mknod).
(mode string)
| 138 | // isValidDeviceMode checks if the mode for device is valid or not. |
| 139 | // isValid mode is a composition of r (read), w (write), and m (mknod). |
| 140 | func isValidDeviceMode(mode string) bool { |
| 141 | var legalDeviceMode = map[rune]bool{ |
| 142 | 'r': true, |
| 143 | 'w': true, |
| 144 | 'm': true, |
| 145 | } |
| 146 | if mode == "" { |
| 147 | return false |
| 148 | } |
| 149 | for _, c := range mode { |
| 150 | if !legalDeviceMode[c] { |
| 151 | return false |
| 152 | } |
| 153 | legalDeviceMode[c] = false |
| 154 | } |
| 155 | return true |
| 156 | } |
| 157 | |
| 158 | // ValidateVolumeHostDir validates a volume mount's source directory |
| 159 | func ValidateVolumeHostDir(hostDir string) error { |
no outgoing calls
searching dependent graphs…