summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJames Peach <jpeach@samba.org>2007-12-22 14:01:44 -0800
committerJames Peach <jpeach@samba.org>2007-12-22 14:01:44 -0800
commitbf2269a04e5af056037c392fb7f29014b62d1bb2 (patch)
tree38a2c68c2835bb65725003dd479a3a6fdbee1a51 /source3/smbd
parent1176e04c76e28d9ee9ab355c5e9edcd1b627ac03 (diff)
parenta000fa4ee5491ae32c60881b28b3536e88e82e27 (diff)
downloadsamba-bf2269a04e5af056037c392fb7f29014b62d1bb2.tar.gz
samba-bf2269a04e5af056037c392fb7f29014b62d1bb2.tar.bz2
samba-bf2269a04e5af056037c392fb7f29014b62d1bb2.zip
Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-test
(This used to be commit 30cb2d215f1a4a440d5ecaab3f898daa714eee2b)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/close.c7
-rw-r--r--source3/smbd/open.c24
-rw-r--r--source3/smbd/posix_acls.c6
-rw-r--r--source3/smbd/reply.c4
-rw-r--r--source3/smbd/server.c6
-rw-r--r--source3/smbd/vfs.c2
6 files changed, 28 insertions, 21 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index eb610f7d1a..5d30e467d0 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -27,7 +27,7 @@ extern struct current_user current_user;
Run a file if it is a magic script.
****************************************************************************/
-static void check_magic(files_struct *fsp,connection_struct *conn)
+static void check_magic(struct files_struct *fsp)
{
int ret;
const char *magic_output = NULL;
@@ -35,6 +35,7 @@ static void check_magic(files_struct *fsp,connection_struct *conn)
int tmp_fd, outfd;
TALLOC_CTX *ctx = NULL;
const char *p;
+ struct connection_struct *conn = fsp->conn;
if (!*lp_magicscript(SNUM(conn))) {
return;
@@ -389,11 +390,11 @@ static NTSTATUS close_normal_file(files_struct *fsp, enum file_close_type close_
locking_close_file(smbd_messaging_context(), fsp);
- status = fd_close(conn, fsp);
+ status = fd_close(fsp);
/* check for magic scripts */
if (close_type == NORMAL_CLOSE) {
- check_magic(fsp,conn);
+ check_magic(fsp);
}
/*
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index b83d6844d6..9428b47b6a 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -70,7 +70,7 @@ static NTSTATUS fd_open(struct connection_struct *conn,
Close the file associated with a fsp.
****************************************************************************/
-NTSTATUS fd_close(struct connection_struct *conn, files_struct *fsp)
+NTSTATUS fd_close(files_struct *fsp)
{
if (fsp->fh->fd == -1) {
return NT_STATUS_OK; /* What we used to call a stat open. */
@@ -78,7 +78,7 @@ NTSTATUS fd_close(struct connection_struct *conn, files_struct *fsp)
if (fsp->fh->ref_count > 1) {
return NT_STATUS_OK; /* Shared handle. Only close last reference. */
}
- return fd_close_posix(conn, fsp);
+ return fd_close_posix(fsp);
}
/****************************************************************************
@@ -353,7 +353,7 @@ static NTSTATUS open_file(files_struct *fsp,
/* For a non-io open, this stat failing means file not found. JRA */
if (ret == -1) {
status = map_nt_error_from_unix(errno);
- fd_close(conn, fsp);
+ fd_close(fsp);
return status;
}
}
@@ -365,7 +365,7 @@ static NTSTATUS open_file(files_struct *fsp,
*/
if(S_ISDIR(psbuf->st_mode)) {
- fd_close(conn, fsp);
+ fd_close(fsp);
errno = EISDIR;
return NT_STATUS_FILE_IS_A_DIRECTORY;
}
@@ -1688,7 +1688,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (lck == NULL) {
DEBUG(0, ("open_file_ntcreate: Could not get share "
"mode lock for %s\n", fname));
- fd_close(conn, fsp);
+ fd_close(fsp);
file_free(fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1699,7 +1699,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
oplock_request)) {
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
- fd_close(conn, fsp);
+ fd_close(fsp);
file_free(fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1718,7 +1718,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
oplock_request)) {
schedule_defer_open(lck, request_time, req);
TALLOC_FREE(lck);
- fd_close(conn, fsp);
+ fd_close(fsp);
file_free(fsp);
return NT_STATUS_SHARING_VIOLATION;
}
@@ -1727,7 +1727,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if (!NT_STATUS_IS_OK(status)) {
struct deferred_open_record state;
- fd_close(conn, fsp);
+ fd_close(fsp);
file_free(fsp);
state.delayed_for_oplocks = False;
@@ -1768,7 +1768,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
if(ret_flock == -1 ){
TALLOC_FREE(lck);
- fd_close(conn, fsp);
+ fd_close(fsp);
file_free(fsp);
return NT_STATUS_SHARING_VIOLATION;
@@ -1793,7 +1793,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
(SMB_VFS_FSTAT(fsp,fsp->fh->fd,psbuf)==-1)) {
status = map_nt_error_from_unix(errno);
TALLOC_FREE(lck);
- fd_close(conn,fsp);
+ fd_close(fsp);
file_free(fsp);
return status;
}
@@ -1850,7 +1850,7 @@ NTSTATUS open_file_ntcreate(connection_struct *conn,
/* Remember to delete the mode we just added. */
del_share_mode(lck, fsp);
TALLOC_FREE(lck);
- fd_close(conn,fsp);
+ fd_close(fsp);
file_free(fsp);
return status;
}
@@ -1974,7 +1974,7 @@ NTSTATUS open_file_fchmod(connection_struct *conn, const char *fname,
NTSTATUS close_file_fchmod(files_struct *fsp)
{
- NTSTATUS status = fd_close(fsp->conn, fsp);
+ NTSTATUS status = fd_close(fsp);
file_free(fsp);
return status;
}
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index d8794e2114..2810b5e587 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -891,7 +891,7 @@ static bool nt4_compatible_acls(void)
****************************************************************************/
static SEC_ACCESS map_canon_ace_perms(int snum,
- int *pacl_type,
+ enum security_ace_type *pacl_type,
mode_t perms,
bool directory_ace)
{
@@ -2869,7 +2869,7 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
{
canon_ace *ace;
- int nt_acl_type;
+ enum security_ace_type nt_acl_type;
int i;
if (nt4_compatible_acls() && dir_ace) {
@@ -3210,7 +3210,7 @@ static NTSTATUS append_ugw_ace(files_struct *fsp,
{
mode_t perms;
SEC_ACCESS acc;
- int nt_acl_type;
+ enum security_ace_type nt_acl_type;
DOM_SID trustee;
switch (ugw) {
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 45081808e1..575ca13ff6 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1163,8 +1163,8 @@ void reply_dskattr(connection_struct *conn, struct smb_request *req)
total_space = dsize * (double)bsize;
free_space = dfree * (double)bsize;
- dsize = (total_space+63*512) / (64*512);
- dfree = (free_space+63*512) / (64*512);
+ dsize = (SMB_BIG_UINT)((total_space+63*512) / (64*512));
+ dfree = (SMB_BIG_UINT)((free_space+63*512) / (64*512));
if (dsize > 0xFFFF) dsize = 0xFFFF;
if (dfree > 0xFFFF) dfree = 0xFFFF;
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 40037074f6..43a6d62a28 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1191,6 +1191,12 @@ extern void build_options(bool screen);
if (smbd_messaging_context() == NULL)
exit(1);
+ if (smbd_memcache() == NULL) {
+ exit(1);
+ }
+
+ memcache_set_global(smbd_memcache());
+
/* Initialise the password backed before the global_sam_sid
to ensure that we fetch from ldap before we make a domain sid up */
diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c
index 96d71da8d9..fefae38932 100644
--- a/source3/smbd/vfs.c
+++ b/source3/smbd/vfs.c
@@ -280,7 +280,7 @@ void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
{
struct vfs_fsp_data *head;
- head = vfs_memctx_fsp_extension(handle, fsp);
+ head = (struct vfs_fsp_data *)vfs_memctx_fsp_extension(handle, fsp);
if (head != NULL) {
return EXT_DATA_AREA(head);
}