summaryrefslogtreecommitdiffstats
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
parent30dfa00877514274aef2cd3e1bd954b017beed10 (diff)
downloadsamba-9f804556c4d0bb68f9b7acaf2b679bc0a02ea8f9.tar.gz
samba-9f804556c4d0bb68f9b7acaf2b679bc0a02ea8f9.tar.xz
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)
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/include/smb.h2
-rw-r--r--source3/param/loadparm.c4
-rw-r--r--source3/smbd/quotas.c7
-rw-r--r--source3/smbd/server.c16
-rw-r--r--source3/utils/make_printerdef.c2
6 files changed, 26 insertions, 6 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 1724c312dbb..fceb83b2822 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -300,6 +300,7 @@ char *lp_volume(int );
char *lp_mangled_map(int );
char *lp_veto_files(int );
char *lp_hide_files(int );
+char *lp_veto_oplocks(int );
char *lp_driverlocation(int );
BOOL lp_alternate_permissions(int );
BOOL lp_revalidate(int );
diff --git a/source3/include/smb.h b/source3/include/smb.h
index afa9e3d9b90..6056ccd70f7 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -1502,6 +1502,7 @@ typedef struct
int num_files_open;
name_compare_entry *hide_list; /* Per-share list of files to return as hidden. */
name_compare_entry *veto_list; /* Per-share list of files to veto (never show). */
+ name_compare_entry *veto_oplock_list; /* Per-share list of files to refuse oplocks on. */
} connection_struct;
@@ -1680,6 +1681,7 @@ struct connect_record
#define MAP_ARCHIVE(cnum) (OPEN_CNUM(cnum) && lp_map_archive(SNUM(cnum)))
#define IS_HIDDEN_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].hide_list))
#define IS_VETO_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_list))
+#define IS_VETO_OPLOCK_PATH(cnum,path) (is_in_path((path),Connections[(cnum)].veto_oplock_list))
#define SMBENCRYPT() (lp_encrypted_passwords())
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 69c5fbd5c23..3b8a06f02e7 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -233,6 +233,7 @@ typedef struct
char *szMangledMap;
char *szVetoFiles;
char *szHideFiles;
+ char *szVetoOplockFiles;
char *comment;
char *force_user;
char *force_group;
@@ -317,6 +318,7 @@ static service sDefault =
NULL, /* szMangledMap */
NULL, /* szVetoFiles */
NULL, /* szHideFiles */
+ NULL, /* szVetoOplockFiles */
NULL, /* comment */
NULL, /* force user */
NULL, /* force group */
@@ -556,6 +558,7 @@ struct parm_struct
{"delete veto files",P_BOOL, P_LOCAL, &sDefault.bDeleteVetoFiles, NULL},
{"veto files", P_STRING, P_LOCAL, &sDefault.szVetoFiles, NULL},
{"hide files", P_STRING, P_LOCAL, &sDefault.szHideFiles, NULL},
+ {"veto oplock files",P_STRING, P_LOCAL, &sDefault.szVetoOplockFiles,NULL},
{"guest only", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL},
{"only guest", P_BOOL, P_LOCAL, &sDefault.bGuest_only, NULL},
{"guest ok", P_BOOL, P_LOCAL, &sDefault.bGuest_ok, NULL},
@@ -966,6 +969,7 @@ FN_LOCAL_STRING(lp_volume,volume)
FN_LOCAL_STRING(lp_mangled_map,szMangledMap)
FN_LOCAL_STRING(lp_veto_files,szVetoFiles)
FN_LOCAL_STRING(lp_hide_files,szHideFiles)
+FN_LOCAL_STRING(lp_veto_oplocks,szVetoFiles)
FN_LOCAL_STRING(lp_driverlocation,szPrinterDriverLocation)
FN_LOCAL_BOOL(lp_alternate_permissions,bAlternatePerm)
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 8810bcd909d..562d8fd5db5 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 e3328690b03..d51c43c2f79 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,"");
diff --git a/source3/utils/make_printerdef.c b/source3/utils/make_printerdef.c
index 8b49925ad86..22621112739 100644
--- a/source3/utils/make_printerdef.c
+++ b/source3/utils/make_printerdef.c
@@ -143,7 +143,7 @@ char *find_desc(FILE *fichier,char *text)
char *chaine;
char *long_desc;
char *short_desc;
- char *crap;
+ char *crap = NULL;
char *p;
int found=0;