diff options
author | Volker Lendecke <vl@samba.org> | 2008-06-22 20:33:28 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-06-22 20:45:53 +0200 |
commit | 13ebf889b39e0b71f1f98198b0d003f5461d42a6 (patch) | |
tree | b87e507b621e7c486e5ea14850ce0dc5557242d6 /source3/smbd | |
parent | 19654e232cc3b761931259aa587af24d7313781b (diff) | |
download | samba-13ebf889b39e0b71f1f98198b0d003f5461d42a6.tar.gz samba-13ebf889b39e0b71f1f98198b0d003f5461d42a6.tar.xz samba-13ebf889b39e0b71f1f98198b0d003f5461d42a6.zip |
Remove the "exists" parameter from create_msdfs_link
Jeremy, setting "exists" to True in _dfs_Add prevented the initial creation of
a new symlink for me, because the SMB_VFS_UNLINK failed. This also exists in
3.2. I only check it into 3.3 as I would like you to look at it first.
Thanks,
Volker
(This used to be commit f58b098a4172949018e84c4d0c722d6eb9bba514)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/msdfs.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c index bc7cd81337..062ab804cc 100644 --- a/source3/smbd/msdfs.c +++ b/source3/smbd/msdfs.c @@ -1318,8 +1318,7 @@ static bool junction_to_local_path(const struct junction_map *jucn, return True; } -bool create_msdfs_link(const struct junction_map *jucn, - bool exists) +bool create_msdfs_link(const struct junction_map *jucn) { char *path = NULL; char *msdfs_link = NULL; @@ -1369,19 +1368,20 @@ bool create_msdfs_link(const struct junction_map *jucn, DEBUG(5,("create_msdfs_link: Creating new msdfs link: %s -> %s\n", path, msdfs_link)); - if(exists) { - if(SMB_VFS_UNLINK(conn,path)!=0) { + if(SMB_VFS_SYMLINK(conn, msdfs_link, path) < 0) { + if (errno == EEXIST) { + if(SMB_VFS_UNLINK(conn,path)!=0) { + goto out; + } + } + if (SMB_VFS_SYMLINK(conn, msdfs_link, path) < 0) { + DEBUG(1,("create_msdfs_link: symlink failed " + "%s -> %s\nError: %s\n", + path, msdfs_link, strerror(errno))); goto out; } } - if(SMB_VFS_SYMLINK(conn, msdfs_link, path) < 0) { - DEBUG(1,("create_msdfs_link: symlink failed " - "%s -> %s\nError: %s\n", - path, msdfs_link, strerror(errno))); - goto out; - } - ret = True; out: |