validateDevice validates a path for devices
(val string, serverOS string)
| 1073 | |
| 1074 | // validateDevice validates a path for devices |
| 1075 | func validateDevice(val string, serverOS string) (string, error) { |
| 1076 | switch serverOS { |
| 1077 | case "linux": |
| 1078 | return validateLinuxPath(val, validDeviceMode) |
| 1079 | case "windows": |
| 1080 | // Windows does validation entirely server-side |
| 1081 | return val, nil |
| 1082 | } |
| 1083 | return "", fmt.Errorf("unknown server OS: %s", serverOS) |
| 1084 | } |
| 1085 | |
| 1086 | // validateLinuxPath is the implementation of validateDevice knowing that the |
| 1087 | // target server operating system is a Linux daemon. |
searching dependent graphs…