diff options
author | Jeremy Allison <jra@samba.org> | 1998-09-23 01:58:27 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-09-23 01:58:27 +0000 |
commit | e4962b80f88d9937b2b509fcbffe02c94e1a5b69 (patch) | |
tree | 7a8f02680ea0aea2f53e7fde586d050a020bb560 | |
parent | aab2fe021643417854451c65e564932f4ac25f10 (diff) | |
download | samba-e4962b80f88d9937b2b509fcbffe02c94e1a5b69.tar.gz samba-e4962b80f88d9937b2b509fcbffe02c94e1a5b69.tar.bz2 samba-e4962b80f88d9937b2b509fcbffe02c94e1a5b69.zip |
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)
-rw-r--r-- | source3/smbd/oplock.c | 2 | ||||
-rw-r--r-- | 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(); |