mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
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 commit is contained in:
@ -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 );
|
||||
|
@ -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())
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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,"");
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user