From e4962b80f88d9937b2b509fcbffe02c94e1a5b69 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 23 Sep 1998 01:58:27 +0000 Subject: smbd/oplock.c: Use O_CREAT and O_TRUNC and correct mode flags when creating oplock test file. smbd/server.c: Check for existance of kernel oplocks before becoming a daemon. Jeremy. (This used to be commit b42779e17e754d4a2f75904e2187c9209e0a53f0) --- source3/smbd/oplock.c | 2 +- source3/smbd/server.c | 4 ++-- 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(); -- cgit