diff options
author | Volker Lendecke <vl@samba.org> | 2011-06-23 16:54:50 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-06-24 21:24:17 +0200 |
commit | daec41c84614b485c8df90fc95467024bcb68110 (patch) | |
tree | 5efc8a8b6090b16be30665cc76c3f0ed577ae021 | |
parent | d637cd23809c9b5ace233e24df3ea25df4735d7a (diff) | |
download | samba-daec41c84614b485c8df90fc95467024bcb68110.tar.gz samba-daec41c84614b485c8df90fc95467024bcb68110.tar.bz2 samba-daec41c84614b485c8df90fc95467024bcb68110.zip |
s3: Use reparse point style symlinks
-rw-r--r-- | source3/client/client.c | 36 |
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); |