NetApp filers expect paths in Open AndX Request to have a leading slash.
Windows clients send the leading slash, so we should too.
{
ret = smbc_read(fd, buffer, sizeof(buffer));
savedErrno = errno;
+ if (ret > 0) fwrite(buffer, 1, ret, stdout);
} while (ret > 0);
smbc_close(fd);
}
- safe_strcpy(path, p, path_len - 1);
+ /*
+ * Prepend a leading slash if there's a file path, as required by
+ * NetApp filers.
+ */
+ *path = '\0';
+ if (*p != '\0') {
+ *path = '/';
+ safe_strcpy(path + 1, p, path_len - 2);
+ }
all_string_sub(path, "/", "\\", 0);