summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-11-17 20:50:07 +0000
committerJeremy Allison <jra@samba.org>1998-11-17 20:50:07 +0000
commit768761820e8d7481c586c4e0ab4ac7cb36d18c4b (patch)
tree675f36b6854bfccca433842e68e0df4b86cda575 /source3/smbd
parentbb5bea4e195eaf5776284c027d667812b7365b56 (diff)
downloadsamba-768761820e8d7481c586c4e0ab4ac7cb36d18c4b.tar.gz
samba-768761820e8d7481c586c4e0ab4ac7cb36d18c4b.tar.bz2
samba-768761820e8d7481c586c4e0ab4ac7cb36d18c4b.zip
Added the same open()/fopen()/creat()/mmap() -> sys_XXX calls.
Tidied up some of the mess (no other word for it). Still doesn't compile cleanly. There are calls with incorrect parameters that don't seem to be doing the right thing. This code still needs surgery :-(. Jeremy. (This used to be commit 18ff93a9abbf68ee8c59c0af3e57c63e4a015dac)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/chgpasswd.c6
-rw-r--r--source3/smbd/connection.c6
-rw-r--r--source3/smbd/groupname.c4
-rw-r--r--source3/smbd/ipc.c6
-rw-r--r--source3/smbd/message.c2
-rw-r--r--source3/smbd/open.c4
-rw-r--r--source3/smbd/oplock.c2
-rw-r--r--source3/smbd/password.c2
-rw-r--r--source3/smbd/quotas.c4
9 files changed, 18 insertions, 18 deletions
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index 52ca364070..69ac69b59b 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -65,7 +65,7 @@ static int findpty(char **slave)
#endif /* !HAVE_GRANTPT */
#if defined(HAVE_GRANTPT)
- if ((master = open("/dev/ptmx", O_RDWR)) >= 1) {
+ if ((master = sys_open("/dev/ptmx", O_RDWR, 0)) >= 1) {
grantpt(master);
unlockpt(master);
*slave = ptsname(master);
@@ -90,7 +90,7 @@ static int findpty(char **slave)
DEBUG(3,("pty: try to open %s, line was %s\n", dpname, line ) );
line[8] = dpname[3];
line[9] = dpname[4];
- if ((master = open(line, O_RDWR)) >= 0) {
+ if ((master = sys_open(line, O_RDWR, 0)) >= 0) {
DEBUG(3,("pty: opened %s\n", line ) );
line[5] = 't';
*slave = line;
@@ -133,7 +133,7 @@ static int dochild(int master,char *slavedev, char *name, char *passwordprogram,
}
/* Open slave pty and acquire as new controlling terminal. */
- if ((slave = open(slavedev, O_RDWR)) < 0) {
+ if ((slave = sys_open(slavedev, O_RDWR, 0)) < 0) {
DEBUG(3,("More weirdness, could not open %s\n",
slavedev));
return(False);
diff --git a/source3/smbd/connection.c b/source3/smbd/connection.c
index af74e40f6a..db6c66f1d5 100644
--- a/source3/smbd/connection.c
+++ b/source3/smbd/connection.c
@@ -51,7 +51,7 @@ BOOL yield_connection(connection_struct *conn,char *name,int max_connections)
pstrcat(fname,name);
pstrcat(fname,".LCK");
- fd = open(fname,O_RDWR);
+ fd = sys_open(fname,O_RDWR,0);
if (fd == -1) {
DEBUG(2,("Couldn't open lock file %s (%s)\n",fname,strerror(errno)));
return(False);
@@ -137,11 +137,11 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO
pstrcat(fname,".LCK");
if (!file_exist(fname,NULL)) {
- fd = open(fname,O_RDWR|O_CREAT|O_EXCL, 0644);
+ fd = sys_open(fname,O_RDWR|O_CREAT|O_EXCL, 0644);
}
if (fd == -1) {
- fd = open(fname,O_RDWR);
+ fd = sys_open(fname,O_RDWR,0);
}
if (fd == -1) {
diff --git a/source3/smbd/groupname.c b/source3/smbd/groupname.c
index 2b87cad330..44625cf54a 100644
--- a/source3/smbd/groupname.c
+++ b/source3/smbd/groupname.c
@@ -330,7 +330,7 @@ static void load_name_map(GROUP_TYPE type)
* Load the file.
*/
- fp = fopen(map_file,"r");
+ fp = sys_fopen(map_file,"r");
if (!fp)
{
DEBUG(0,("load_name_map: can't open name map %s. Error was %s\n",
@@ -461,7 +461,7 @@ static BOOL map_sid_to_ntname(GROUP_TYPE type, ubi_slList *map_list,
{
fstrcpy(ntname, gmep->grp.nt_domain);
}
- DEBUG(7,("map_sid_to_ntname: Mapping unix group %s to nt group \%s\%s\n",
+ DEBUG(7,("map_sid_to_ntname: Mapping unix group %s to nt group \\%s\\%s\n",
gmep->grp.unix_name,
gmep->grp.nt_domain, gmep->grp.nt_name ));
return True;
diff --git a/source3/smbd/ipc.c b/source3/smbd/ipc.c
index eed5a71401..d5ff7ddf28 100644
--- a/source3/smbd/ipc.c
+++ b/source3/smbd/ipc.c
@@ -635,7 +635,7 @@ static void fill_printq_info(connection_struct *conn, int snum, int uLevel,
pstring fname;
pstrcpy(fname,lp_driverfile());
- f=fopen(fname,"r");
+ f=sys_fopen(fname,"r");
if (!f) {
DEBUG(3,("fill_printq_info: Can't open %s - %s\n",fname,strerror(errno)));
desc->errcode=NERR_notsupported;
@@ -741,7 +741,7 @@ static int get_printerdrivernumber(int snum)
pstrcpy(fname,lp_driverfile());
DEBUG(4,("In get_printerdrivernumber: %s\n",fname));
- f=fopen(fname,"r");
+ f=sys_fopen(fname,"r");
if (!f) {
DEBUG(3,("get_printerdrivernumber: Can't open %s - %s\n",fname,strerror(errno)));
return(0);
@@ -999,7 +999,7 @@ static int get_server_info(uint32 servertype,
pstrcat(fname,"/");
pstrcat(fname,SERVER_LIST);
- f = fopen(fname,"r");
+ f = sys_fopen(fname,"r");
if (!f) {
DEBUG(4,("Can't open %s - %s\n",fname,strerror(errno)));
diff --git a/source3/smbd/message.c b/source3/smbd/message.c
index 001fc652b2..d13dfda1e0 100644
--- a/source3/smbd/message.c
+++ b/source3/smbd/message.c
@@ -56,7 +56,7 @@ static void msg_deliver(void)
slprintf(s,sizeof(s)-1, "%s/msg.XXXXXX",tmpdir());
fstrcpy(name,(char *)mktemp(s));
- fd = open(name,O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,0600);
+ fd = sys_open(name,O_WRONLY|O_CREAT|O_TRUNC|O_EXCL,0600);
if (fd == -1) {
DEBUG(1,("can't open message file %s\n",name));
return;
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index c81334c8ae..d7cef6d63b 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -552,8 +552,8 @@ static void mmap_open_file(files_struct *fsp)
if (!fsp->can_write) {
fsp->mmap_size = file_size(fsp->fsp_name);
if (fsp->mmap_size < MAX_MMAP_SIZE) {
- fsp->mmap_ptr = (char *)mmap(NULL,fsp->mmap_size,
- PROT_READ,MAP_SHARED,fsp->fd_ptr->fd,0);
+ fsp->mmap_ptr = (char *)sys_mmap(NULL,fsp->mmap_size,
+ PROT_READ,MAP_SHARED,fsp->fd_ptr->fd,(SMB_OFF_T)0);
if (fsp->mmap_ptr == (char *)-1 || !fsp->mmap_ptr) {
DEBUG(3,("Failed to mmap() %s - %s\n",
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 19a3afa998..1d38b362ec 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -1056,7 +1056,7 @@ void check_kernel_oplocks(void)
return;
}
- if((fd = open(tmpname, O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 0600)) < 0) {
+ if((fd = sys_open(tmpname, O_RDWR|O_CREAT|O_TRUNC|O_EXCL, 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/password.c b/source3/smbd/password.c
index 0c8eb124ff..9011b9b95e 100644
--- a/source3/smbd/password.c
+++ b/source3/smbd/password.c
@@ -813,7 +813,7 @@ static BOOL check_user_equiv(char *user, char *remote, char *equiv_file)
int plus_allowed = 1;
char *file_host;
char *file_user;
- FILE *fp = fopen(equiv_file, "r");
+ FILE *fp = sys_fopen(equiv_file, "r");
DEBUG(5, ("check_user_equiv %s %s %s\n", user, remote, equiv_file));
if (! fp) return False;
while(fgets(buf, sizeof(buf), fp))
diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c
index 5cd5a895c6..afabb1befd 100644
--- a/source3/smbd/quotas.c
+++ b/source3/smbd/quotas.c
@@ -270,7 +270,7 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U
if ( devno != devno_cached ) {
devno_cached = devno ;
#if defined(SUNOS5)
- if ((fd = fopen(MNTTAB, "r")) == NULL)
+ if ((fd = sys_fopen(MNTTAB, "r")) == NULL)
return(False) ;
found = False ;
@@ -320,7 +320,7 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U
#if defined(SUNOS5)
DEBUG(5,("disk_quotas: looking for quotas file \"%s\"\n", name));
- if((file=open(name, O_RDONLY))<0) {
+ if((file=sys_open(name, O_RDONLY,0))<0) {
setuid(user_id); /* Restore the original UID status */
seteuid(euser_id);
return(False);