-char *resolve_path(void *alloc_ctx, const char *path, const char *current_dev)
-{
- static const char s_file[] = "file://";
- char *ret;
- const char *devpath, *sep;
-
- /* test for urls */
-
- if (!strncasecmp(path, s_file, sizeof(s_file) - 1))
- path += sizeof(s_file) - 1;
- else if (strstr(path, "://"))
- return talloc_strdup(alloc_ctx, path);
-
- sep = strchr(path, ':');
- if (!sep) {
- devpath = mountpoint_for_device(current_dev);
- ret = join_paths(alloc_ctx, devpath, path);
- } else {
- /* parse just the device name into dev */
- char *tmp, *dev;
- tmp = talloc_strndup(NULL, path, sep - path);
- dev = parse_device_path(NULL, tmp, current_dev);
-
- devpath = mountpoint_for_device(dev);
- ret = join_paths(alloc_ctx, devpath, sep + 1);
-
- talloc_free(dev);
- talloc_free(tmp);
- }