summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-06-23 16:54:50 +0200
committerVolker Lendecke <vl@samba.org>2011-06-24 21:24:17 +0200
commitdaec41c84614b485c8df90fc95467024bcb68110 (patch)
tree5efc8a8b6090b16be30665cc76c3f0ed577ae021 /source3/client
parentd637cd23809c9b5ace233e24df3ea25df4735d7a (diff)
downloadsamba-daec41c84614b485c8df90fc95467024bcb68110.tar.gz
samba-daec41c84614b485c8df90fc95467024bcb68110.tar.bz2
samba-daec41c84614b485c8df90fc95467024bcb68110.zip
s3: Use reparse point style symlinks
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 79b5799135..15c5e9cc94 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -36,6 +36,7 @@
#include "libsmb/clirap.h"
#include "trans2.h"
#include "libsmb/nmblib.h"
+#include "include/ntioctl.h"
#ifndef REGISTER
#define REGISTER 0
@@ -3014,26 +3015,25 @@ static int cmd_symlink(void)
/* Oldname (link target) must be an untouched blob. */
oldname = buf;
- newname = talloc_asprintf(ctx,
- "%s%s",
- client_get_cur_dir(),
- buf2);
- if (!newname) {
- return 1;
- }
-
- /* New name must be present in share namespace. */
- if (!cli_resolve_path(ctx, "", auth_info, cli, newname, &newcli, &newname)) {
- d_printf("link %s: %s\n", oldname, cli_errstr(cli));
- return 1;
- }
-
- if (!SERVER_HAS_UNIX_CIFS(newcli)) {
- d_printf("Server doesn't support UNIX CIFS calls.\n");
- return 1;
+ if (SERVER_HAS_UNIX_CIFS(cli)) {
+ newname = talloc_asprintf(ctx, "%s%s", client_get_cur_dir(),
+ buf2);
+ if (!newname) {
+ return 1;
+ }
+ /* New name must be present in share namespace. */
+ if (!cli_resolve_path(ctx, "", auth_info, cli, newname,
+ &newcli, &newname)) {
+ d_printf("link %s: %s\n", oldname, cli_errstr(cli));
+ return 1;
+ }
+ status = cli_posix_symlink(newcli, oldname, newname);
+ } else {
+ status = cli_symlink(
+ cli, oldname, buf2,
+ buf2[0] == '\\' ? 0 : SYMLINK_FLAG_RELATIVE);
}
- status = cli_posix_symlink(newcli, oldname, newname);
if (!NT_STATUS_IS_OK(status)) {
d_printf("%s symlinking files (%s -> %s)\n",
nt_errstr(status), newname, newname);