summaryrefslogtreecommitdiff
path: root/source3/smbd/msdfs.c
diff options
context:
space:
mode:
authorTim Prouty <tprouty@samba.org>2009-07-02 09:27:44 -0700
committerTim Prouty <tprouty@samba.org>2009-07-06 15:38:36 -0700
commit258952aa85f2a68e2d2362522f6114c6a439f1e3 (patch)
tree696d8f4425cb6d82c95c0923ba1b0405d39a1f5e /source3/smbd/msdfs.c
parent133e915a81510f543f6458f377857d4f1b680970 (diff)
downloadsamba-258952aa85f2a68e2d2362522f6114c6a439f1e3.tar.gz
samba-258952aa85f2a68e2d2362522f6114c6a439f1e3.tar.bz2
samba-258952aa85f2a68e2d2362522f6114c6a439f1e3.zip
s3: Plumb smb_filename through SMB_VFS_UNLINK
Diffstat (limited to 'source3/smbd/msdfs.c')
-rw-r--r--source3/smbd/msdfs.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index e6f877cfbb..d40b8a8902 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -1415,9 +1415,22 @@ bool create_msdfs_link(const struct junction_map *jucn)
if(SMB_VFS_SYMLINK(conn, msdfs_link, path) < 0) {
if (errno == EEXIST) {
- if(SMB_VFS_UNLINK(conn,path)!=0) {
+ struct smb_filename *smb_fname = NULL;
+ NTSTATUS status;
+
+ status = create_synthetic_smb_fname(talloc_tos(), path,
+ NULL, NULL,
+ &smb_fname);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
goto out;
}
+
+ if(SMB_VFS_UNLINK(conn, smb_fname)!=0) {
+ TALLOC_FREE(smb_fname);
+ goto out;
+ }
+ TALLOC_FREE(smb_fname);
}
if (SMB_VFS_SYMLINK(conn, msdfs_link, path) < 0) {
DEBUG(1,("create_msdfs_link: symlink failed "
@@ -1441,15 +1454,26 @@ bool remove_msdfs_link(const struct junction_map *jucn)
char *cwd;
connection_struct *conn;
bool ret = False;
+ struct smb_filename *smb_fname = NULL;
+ NTSTATUS status;
if (!junction_to_local_path(jucn, &path, &conn, &cwd)) {
return false;
}
- if( SMB_VFS_UNLINK(conn, path) == 0 ) {
+ status = create_synthetic_smb_fname(talloc_tos(), path,
+ NULL, NULL,
+ &smb_fname);
+ if (!NT_STATUS_IS_OK(status)) {
+ errno = map_errno_from_nt_status(status);
+ return false;
+ }
+
+ if( SMB_VFS_UNLINK(conn, smb_fname) == 0 ) {
ret = True;
}
+ TALLOC_FREE(smb_fname);
vfs_ChDir(conn, cwd);
conn_free_internal(conn);
return ret;