summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/oplock.c2
-rw-r--r--source3/smbd/server.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 0cd6f0bef6..b87d664046 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -1035,7 +1035,7 @@ void check_kernel_oplocks(void)
return;
}
- if((fd = open(tmpname, O_RDWR)) < 0) {
+ if((fd = open(tmpname, O_RDWR|O_CREAT|O_TRUNC, 0600)) < 0) {
DEBUG(0,("check_kernel_oplocks: Unable to open temp test file %s. Error was %s\n",
tmpname, strerror(errno) ));
unlink( tmpname );
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index c06c0ce1cb..e1b5e42764 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -661,6 +661,8 @@ static void usage(char *pname)
DEBUG(3,( "loaded services\n"));
+ check_kernel_oplocks();
+
if (!is_daemon && !is_a_socket(0)) {
DEBUG(0,("standard input is not a socket, assuming -D option\n"));
is_daemon = True;
@@ -700,8 +702,6 @@ static void usage(char *pname)
if( !open_oplock_ipc() )
exit(1);
- check_kernel_oplocks();
-
smbd_process();
close_sockets();