summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-11-17 19:16:38 +0000
committerJeremy Allison <jra@samba.org>1997-11-17 19:16:38 +0000
commit9f804556c4d0bb68f9b7acaf2b679bc0a02ea8f9 (patch)
tree869fdc138c242f9a059e62562ef267043941ec09 /source3/smbd
parent30dfa00877514274aef2cd3e1bd954b017beed10 (diff)
downloadsamba-9f804556c4d0bb68f9b7acaf2b679bc0a02ea8f9.tar.gz
samba-9f804556c4d0bb68f9b7acaf2b679bc0a02ea8f9.tar.bz2
samba-9f804556c4d0bb68f9b7acaf2b679bc0a02ea8f9.zip
loadparm.c : Added "veto oplock files" parameter.
make_printerdef.c: Fixed warning. quotas.c: Fixed irix root errors. server.c: Fixed oplock reference count bug. smb.h: Added IS_VETO_OPLOCK_PATH(). Jeremy. (This used to be commit c28487df63e29bc0f8d2ece876a07a2a076d4c73)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/quotas.c7
-rw-r--r--source3/smbd/server.c16
2 files changed, 18 insertions, 5 deletions
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 8810bcd909..562d8fd5db 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -473,6 +473,8 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
{
r=quotactl (Q_GETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &D);
+ seteuid(euser_id); /* Restore the original uid status. */
+
if (r==-1)
return(False);
@@ -502,6 +504,8 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
{
r=quotactl (Q_XGETQUOTA, mnt->mnt_fsname, euser_id, (caddr_t) &F);
+ seteuid(euser_id); /* Restore the original uid status. */
+
if (r==-1)
return(False);
@@ -531,7 +535,10 @@ BOOL disk_quotas(char *path, int *bsize, int *dfree, int *dsize)
}
else
+ {
+ seteuid(euser_id); /* Restore the original uid status. */
return(False);
+ }
return (True);
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index e3328690b0..d51c43c2f7 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1473,6 +1473,9 @@ void close_file(int fnum, BOOL normal_close)
if (normal_close)
check_magic(fnum,cnum);
+ if(fs_p->granted_oplock == True)
+ global_oplocks_open--;
+
DEBUG(2,("%s %s closed file %s (numopen=%d)\n",
timestring(),Connections[cnum].user,fs_p->name,
Connections[cnum].num_files_open));
@@ -1680,9 +1683,9 @@ int check_share_mode( share_mode_entry *share, int deny_mode, char *fname,
(access_allowed == AREAD && *flags == O_WRONLY) ||
(access_allowed == AWRITE && *flags == O_RDONLY))
{
- DEBUG(2,("Share violation on file (%d,%d,%d,%d,%s) = %d\n",
+ DEBUG(2,("Share violation on file (%d,%d,%d,%d,%s,fcbopen = %d, flags = %d) = %d\n",
deny_mode,old_deny_mode,old_open_mode,
- share->pid,fname, access_allowed));
+ share->pid,fname, fcbopen, *flags, access_allowed));
return False;
}
@@ -1928,7 +1931,8 @@ dev = %x, inode = %x\n", old_shares[i].op_type, fname, dev, inode));
be extended to level II oplocks (multiple reader
oplocks). */
- if(oplock_request && (num_share_modes == 0) && lp_oplocks(SNUM(cnum)))
+ if(oplock_request && (num_share_modes == 0) && lp_oplocks(SNUM(cnum)) &&
+ !IS_VETO_OPLOCK_PATH(cnum,fname))
{
fs_p->granted_oplock = True;
global_oplocks_open++;
@@ -2918,9 +2922,8 @@ inode = %x).\n", timestring(), fsp->name, fnum, dev, inode));
from the sharemode. */
/* Paranoia.... */
fsp->granted_oplock = False;
- }
-
global_oplocks_open--;
+ }
/* Santity check - remove this later. JRA */
if(global_oplocks_open < 0)
@@ -3391,6 +3394,7 @@ int make_connection(char *service,char *user,char *password, int pwlen, char *de
pcon->dirptr = NULL;
pcon->veto_list = NULL;
pcon->hide_list = NULL;
+ pcon->veto_oplock_list = NULL;
string_set(&pcon->dirpath,"");
string_set(&pcon->user,user);
@@ -3541,6 +3545,7 @@ int make_connection(char *service,char *user,char *password, int pwlen, char *de
{
set_namearray( &pcon->veto_list, lp_veto_files(SNUM(cnum)));
set_namearray( &pcon->hide_list, lp_hide_files(SNUM(cnum)));
+ set_namearray( &pcon->veto_oplock_list, lp_veto_oplocks(SNUM(cnum)));
}
{
@@ -4070,6 +4075,7 @@ void close_cnum(int cnum, uint16 vuid)
free_namearray(Connections[cnum].veto_list);
free_namearray(Connections[cnum].hide_list);
+ free_namearray(Connections[cnum].veto_oplock_list);
string_set(&Connections[cnum].user,"");
string_set(&Connections[cnum].dirpath,"");