1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

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 b42779e17e)
This commit is contained in:
Jeremy Allison 1998-09-23 01:58:27 +00:00
parent aab2fe0216
commit e4962b80f8
2 changed files with 3 additions and 3 deletions

View File

@ -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 );

View File

@ -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();