summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-09-29 20:24:17 +0000
committerJeremy Allison <jra@samba.org>1998-09-29 20:24:17 +0000
commit9066025a8a4afe1f7f559c455d86fc023792ed17 (patch)
tree6ced773fa584a81c9a0fe957cac357c1f8a9aa2d /source3/client
parent282eb4f3e8ea2f19c5609bc498d24a68a1ca48a5 (diff)
downloadsamba-9066025a8a4afe1f7f559c455d86fc023792ed17.tar.gz
samba-9066025a8a4afe1f7f559c455d86fc023792ed17.tar.bz2
samba-9066025a8a4afe1f7f559c455d86fc023792ed17.zip
Got very strict about the differences and uses of
uid_t, gid_t and vuid. Added sys_getgroups() to get around the int * return problem. Set correct datatypes for all uid, gid and vuid variables. Jeremy. (This used to be commit e570db46fc3a78e499523fd342e9a34cebb18998)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c61
-rw-r--r--source3/client/clientutil.c17
-rw-r--r--source3/client/smbmount.c17
3 files changed, 45 insertions, 50 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index 0d27039cb9..c94c3ccb8c 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -71,12 +71,10 @@ extern int DEBUGLEVEL;
BOOL translation = False;
-extern int cnum;
-extern int mid;
-extern int pid;
-extern int tid;
-extern int gid;
-extern int uid;
+extern uint16 cnum;
+extern uint16 mid;
+extern uint16 pid;
+extern uint16 vuid;
extern BOOL have_ip;
extern int max_xmit;
@@ -805,17 +803,18 @@ static int do_short_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (
/****************************************************************************
do a directory listing, calling fn on each file found
****************************************************************************/
-void do_dir(char *inbuf,char *outbuf,char *Mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo)
+void do_dir(char *inbuf,char *outbuf,char *mask,int attribute,void (*fn)(file_info *),BOOL recurse_dir, BOOL dirstoo)
{
- DEBUG(5,("do_dir(%s,%x,%s)\n",Mask,attribute,BOOLSTR(recurse_dir)));
+ dos_format(mask);
+ DEBUG(5,("do_dir(%s,%x,%s)\n",mask,attribute,BOOLSTR(recurse_dir)));
if (Protocol >= PROTOCOL_LANMAN2)
{
- if (do_long_dir(inbuf,outbuf,Mask,attribute,fn,recurse_dir,dirstoo) > 0)
+ if (do_long_dir(inbuf,outbuf,mask,attribute,fn,recurse_dir,dirstoo) > 0)
return;
}
- expand_mask(Mask,False);
- do_short_dir(inbuf,outbuf,Mask,attribute,fn,recurse_dir,dirstoo);
+ expand_mask(mask,False);
+ do_short_dir(inbuf,outbuf,mask,attribute,fn,recurse_dir,dirstoo);
return;
}
@@ -1051,13 +1050,13 @@ static void cmd_dir(char *inbuf,char *outbuf)
if(mask[strlen(mask)-1]!='\\')
pstrcat(mask,"\\");
- if (next_token(NULL,buf,NULL,sizeof(buf)))
- {
- if (*p == '\\')
- pstrcpy(mask,p);
- else
- pstrcat(mask,p);
- }
+ if (next_token(NULL,buf,NULL,sizeof(buf))) {
+ dos_format(p);
+ if (*p == '\\')
+ pstrcpy(mask,p);
+ else
+ pstrcat(mask,p);
+ }
else {
pstrcat(mask,"*");
}
@@ -1086,12 +1085,13 @@ static void cmd_du(char *inbuf,char *outbuf)
pstrcat(mask,"\\");
if (next_token(NULL,buf,NULL,sizeof(buf)))
- {
- if (*p == '\\')
- pstrcpy(mask,p);
- else
- pstrcat(mask,p);
- }
+ {
+ dos_format(p);
+ if (*p == '\\')
+ pstrcpy(mask,p);
+ else
+ pstrcat(mask,p);
+ }
else {
pstrcat(mask,"*");
}
@@ -1135,10 +1135,10 @@ static void do_get(char *rname,char *lname,file_info *finfo1)
outbuf = (char *)malloc(BUFFER_SIZE + SAFETY_MARGIN);
if (!inbuf || !outbuf)
- {
- DEBUG(0,("out of memory\n"));
- return;
- }
+ {
+ DEBUG(0,("out of memory\n"));
+ return;
+ }
bzero(outbuf,smb_size);
set_message(outbuf,15,1 + strlen(rname),True);
@@ -3807,9 +3807,8 @@ static void usage(char *pname)
pstrcpy(workgroup,lp_workgroup());
load_interfaces();
- pid = getpid();
- uid = getuid();
- gid = getgid();
+ pid = (uint16)getpid();
+ vuid = (uint16)getuid();
mid = pid + 100;
myumask = umask(0);
umask(myumask);
diff --git a/source3/client/clientutil.c b/source3/client/clientutil.c
index 7f5943cb01..8b61567485 100644
--- a/source3/client/clientutil.c
+++ b/source3/client/clientutil.c
@@ -57,11 +57,10 @@ BOOL writebraw_supported = False;
extern int DEBUGLEVEL;
-int cnum = 0;
-int pid = 0;
-int gid = 0;
-int uid = 0;
-int mid = 0;
+uint16 cnum = 0;
+uint16 pid = 0;
+uint16 vuid = 0;
+uint16 mid = 0;
int max_xmit = BUFFER_SIZE;
@@ -80,7 +79,7 @@ setup basics in a outgoing packet
void cli_setup_pkt(char *outbuf)
{
SSVAL(outbuf,smb_pid,pid);
- SSVAL(outbuf,smb_uid,uid);
+ SSVAL(outbuf,smb_uid,vuid);
SSVAL(outbuf,smb_mid,mid);
if (Protocol > PROTOCOL_COREPLUS)
{
@@ -726,10 +725,10 @@ BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup,
}
/* use the returned uid from now on */
- if (SVAL(inbuf,smb_uid) != uid)
+ if (SVAL(inbuf,smb_uid) != vuid)
DEBUG(3,("Server gave us a UID of %d. We gave %d\n",
- SVAL(inbuf,smb_uid),uid));
- opt.server_uid = uid = SVAL(inbuf,smb_uid);
+ SVAL(inbuf,smb_uid),(int)vuid));
+ opt.server_vuid = vuid = SVAL(inbuf,smb_uid);
}
if (opt.sec_mode & 1) {
diff --git a/source3/client/smbmount.c b/source3/client/smbmount.c
index dadccc819d..60ee0605db 100644
--- a/source3/client/smbmount.c
+++ b/source3/client/smbmount.c
@@ -80,12 +80,10 @@ extern int DEBUGLEVEL;
BOOL translation = False;
-extern int cnum;
-extern int mid;
-extern int pid;
-extern int tid;
-extern int gid;
-extern int uid;
+extern uint16 cnum;
+extern uint16 mid;
+extern uint16 pid;
+extern uint16 vuid;
extern BOOL have_ip;
extern int max_xmit;
@@ -97,7 +95,7 @@ extern BOOL tar_reset;
/* clitar bits end */
-int myumask = 0755;
+mode_t myumask = 0755;
extern pstring scope;
@@ -642,9 +640,8 @@ static void usage(char *pname)
TimeInit();
charset_initialise();
- pid = getpid();
- uid = getuid();
- gid = getgid();
+ pid = (uint16)getpid();
+ uid = (uint16)getuid();
mid = pid + 100;
myumask = umask(0);
umask(myumask);