summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-02-22 16:17:10 +0100
committerVolker Lendecke <vl@samba.org>2008-02-22 17:15:09 +0100
commit14aa57a9e3368fed5b8b7d1ac0f6e94b9b1ac20e (patch)
tree7507c3d4204a983e6f61d25d75507e0b50b8d739 /source3/smbd/nttrans.c
parent0f0998a06b3444fab45942563079c445f50ec955 (diff)
downloadsamba-14aa57a9e3368fed5b8b7d1ac0f6e94b9b1ac20e.tar.gz
samba-14aa57a9e3368fed5b8b7d1ac0f6e94b9b1ac20e.tar.bz2
samba-14aa57a9e3368fed5b8b7d1ac0f6e94b9b1ac20e.zip
Don't use fname after create_file has been called
create_file calls unix_convert internally, so modifies fname. So we can't use "fname" after create_file has returned. Use fsp->fsp_name instead. Found during a lengthy debugging session with Karolin testing the xattr_tdb module... (This used to be commit 183fe570469963923864b732817a87f8660341ed)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r--source3/smbd/nttrans.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 9381174af0..5293ca5347 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -558,7 +558,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
}
file_len = sbuf.st_size;
- fattr = dos_mode(conn,fname,&sbuf);
+ fattr = dos_mode(conn,fsp->fsp_name,&sbuf);
if (fattr == 0) {
fattr = FILE_ATTRIBUTE_NORMAL;
}
@@ -626,7 +626,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
uint32 perms = 0;
p += 25;
if (fsp->is_directory
- || can_write_to_file(conn, fname, &sbuf)) {
+ || can_write_to_file(conn, fsp->fsp_name, &sbuf)) {
perms = FILE_GENERIC_ALL;
} else {
perms = FILE_GENERIC_READ|FILE_EXECUTE;
@@ -1007,7 +1007,7 @@ static void call_nt_transact_create(connection_struct *conn,
}
file_len = sbuf.st_size;
- fattr = dos_mode(conn,fname,&sbuf);
+ fattr = dos_mode(conn,fsp->fsp_name,&sbuf);
if (fattr == 0) {
fattr = FILE_ATTRIBUTE_NORMAL;
}
@@ -1075,7 +1075,7 @@ static void call_nt_transact_create(connection_struct *conn,
uint32 perms = 0;
p += 25;
if (fsp->is_directory
- || can_write_to_file(conn, fname, &sbuf)) {
+ || can_write_to_file(conn, fsp->fsp_name, &sbuf)) {
perms = FILE_GENERIC_ALL;
} else {
perms = FILE_GENERIC_READ|FILE_EXECUTE;
@@ -1083,7 +1083,7 @@ static void call_nt_transact_create(connection_struct *conn,
SIVAL(p,0,perms);
}
- DEBUG(5,("call_nt_transact_create: open name = %s\n", fname));
+ DEBUG(5,("call_nt_transact_create: open name = %s\n", fsp->fsp_name));
/* Send the required number of replies */
send_nt_replies(conn, req, NT_STATUS_OK, params, param_len, *ppdata, 0);