static void smb_set_posix_lock_done(struct tevent_req *subreq);
-NTSTATUS smb_set_posix_lock(connection_struct *conn,
- struct smb_request *req,
- const char *pdata,
- int total_data,
- files_struct *fsp)
+static NTSTATUS smb_set_posix_lock(connection_struct *conn,
+ struct smb_request *req,
+ const char *pdata,
+ int total_data,
+ files_struct *fsp)
{
struct tevent_req *subreq = NULL;
struct smbd_lock_element *lck = NULL;
NTSTATUS status = NT_STATUS_OK;
+ if (!CAN_WRITE(conn)) {
+ return NT_STATUS_DOS(ERRSRV, ERRaccess);
+ }
+
if (fsp == NULL ||
fsp->fsp_flags.is_pathref ||
fsp_get_io_fd(fsp) == -1)
struct files_struct *fsp = NULL;
char *params = *pparams;
int data_return_size = 0;
+ bool info_level_handled;
NTSTATUS status;
int ret;
}
}
+ info_level_handled = true; /* Untouched in switch cases below */
+
+ switch (info_level) {
+
+ default:
+ info_level_handled = false;
+ break;
+
+ case SMB_SET_POSIX_LOCK:
+ status = smb_set_posix_lock(
+ conn, req, *ppdata, total_data, fsp);
+ break;
+ }
+
+ if (info_level_handled) {
+ handle_trans2setfilepathinfo_result(
+ conn,
+ req,
+ info_level,
+ status,
+ *ppdata,
+ data_return_size,
+ max_data_bytes);
+ return;
+ }
+
status = smbd_do_setfilepathinfo(
conn,
req,
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-NTSTATUS smb_set_posix_lock(connection_struct *conn,
- struct smb_request *req,
- const char *pdata,
- int total_data,
- files_struct *fsp);
void reply_trans2(struct smb_request *req);
void reply_transs2(struct smb_request *req);
}
#endif
-#if defined(WITH_SMB1SERVER)
- case SMB_SET_POSIX_LOCK:
- {
- if (fsp == NULL) {
- return NT_STATUS_INVALID_LEVEL;
- }
- status = smb_set_posix_lock(conn, req,
- pdata, total_data, fsp);
- break;
- }
-#endif
-
default:
return NT_STATUS_INVALID_LEVEL;
}