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