*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
+#include "fake_file.h"
#include "librpc/gen_ndr/messaging.h"
#include "../librpc/gen_ndr/ndr_security.h"
NTSTATUS smb1_file_se_access_check(struct connection_struct *conn,
const struct security_descriptor *sd,
- const NT_USER_TOKEN *token,
+ const struct security_token *token,
uint32_t access_desired,
uint32_t *access_granted)
{
state->id, (char *)state, sizeof(*state))) {
exit_server("push_deferred_open_message_smb failed");
}
- add_deferred_open(lck, req->mid, request_time, state->id);
+ add_deferred_open(lck, req->mid, request_time,
+ sconn_server_id(req->sconn), state->id);
}
Remove the deferred open entry under lock.
****************************************************************************/
-void remove_deferred_open_entry(struct file_id id, uint64_t mid)
+void remove_deferred_open_entry(struct file_id id, uint64_t mid,
+ struct server_id pid)
{
struct share_mode_lock *lck = get_share_mode_lock(talloc_tos(), id,
NULL, NULL, NULL);
if (lck == NULL) {
DEBUG(0, ("could not get share mode lock\n"));
} else {
- del_deferred_open_entry(lck, mid);
+ del_deferred_open_entry(lck, mid, pid);
TALLOC_FREE(lck);
}
}
return NT_STATUS_INTERNAL_ERROR;
}
- return print_fsp_open(req, conn, smb_fname->base_name,
- req->vuid, fsp);
+ return print_spool_open(fsp, smb_fname->base_name,
+ req->vuid);
}
if (!parent_dirname(talloc_tos(), smb_fname->base_name, &parent_dir,
see if this has timed out. */
/* Remove the deferred open entry under lock. */
- remove_deferred_open_entry(state->id, req->mid);
+ remove_deferred_open_entry(
+ state->id, req->mid,
+ sconn_server_id(req->sconn));
/* Ensure we don't reprocess this message. */
remove_deferred_open_message_smb(req->mid);
* If requested, truncate the file.
*/
- if (flags2&O_TRUNC) {
+ if (file_existed && (flags2&O_TRUNC)) {
/*
* We are modifing the file after open - update the stat
* struct..
/* If this is a successful open, we must remove any deferred open
* records. */
if (req != NULL) {
- del_deferred_open_entry(lck, req->mid);
+ del_deferred_open_entry(lck, req->mid,
+ sconn_server_id(req->sconn));
}
TALLOC_FREE(lck);