From 81cce1332129b97a5538f35c70367858f460935c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 1 Mar 2007 21:01:22 +0000 Subject: r21638: Change POSIX_UNLINK to allow clients to differentiate between unlink/rmdir calls. Jeremy. (This used to be commit f0c8488d382ada32fabe79399f64ba1c6486d009) --- source3/smbd/trans2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source3/smbd/trans2.c') diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 5bbd618231..2952c9b1dc 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -5132,12 +5132,24 @@ static NTSTATUS smb_posix_unlink(connection_struct *conn, { NTSTATUS status = NT_STATUS_OK; files_struct *fsp = NULL; + uint16 flags = 0; int info = 0; + if (total_data < 2) { + return NT_STATUS_INVALID_PARAMETER; + } + + flags = SVAL(pdata,0); + if (!VALID_STAT(*psbuf)) { return NT_STATUS_OBJECT_NAME_NOT_FOUND; } + if ((flags == SMB_POSIX_UNLINK_DIRECTORY_TARGET) && + !VALID_STAT_OF_DIR(*psbuf)) { + return NT_STATUS_NOT_A_DIRECTORY; + } + if (VALID_STAT_OF_DIR(*psbuf)) { status = open_directory(conn, fname, -- cgit