From e4f974c611c179a5e7827ec8325e01811db6540b Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 9 Nov 1998 20:33:37 +0000 Subject: [PATCH] Makefile.in: Removed rpc_server/srv_ldap_helpers.c per J.F.'s instructions. client/client.c: client/clitar.c: include/client.h: smbwrapper/smbw_dir.c: smbwrapper/smbw_stat.c: smbwrapper/smbw.c: lib/util.c: Converted all use of 'mode' to uint16. smbd/quotas.c: Fixed stupid comment bug I put in there :-(. printing/printing.c: Fix from J.F. to new code. Jeremy. (This used to be commit bacd3e9d2036a804e73644a28fc498f229c8446c) --- source3/Makefile.in | 2 +- source3/client/client.c | 28 ++++------------ source3/client/clitar.c | 15 ++++----- source3/include/client.h | 2 +- source3/include/proto.h | 47 ++++++--------------------- source3/lib/util.c | 2 +- source3/libsmb/clientgen.c | 26 +++++++-------- source3/printing/printing.c | 4 +-- source3/rpc_server/srv_ldap_helpers.c | 14 -------- source3/smbd/quotas.c | 2 +- source3/smbwrapper/smbw.c | 4 +-- source3/smbwrapper/smbw_dir.c | 2 +- source3/smbwrapper/smbw_stat.c | 6 ++-- 13 files changed, 49 insertions(+), 105 deletions(-) delete mode 100644 source3/rpc_server/srv_ldap_helpers.c diff --git a/source3/Makefile.in b/source3/Makefile.in index a4a234ba355..253f7f2809f 100644 --- a/source3/Makefile.in +++ b/source3/Makefile.in @@ -101,7 +101,7 @@ LIBSMB_OBJ = libsmb/clientgen.o libsmb/namequery.o libsmb/nmblib.o \ libsmb/nterr.o libsmb/smbdes.o libsmb/smbencrypt.o \ libsmb/smberr.o libsmb/credentials.o libsmb/pwd_cache.o -RPC_SERVER_OBJ = rpc_server/srv_ldap_helpers.o rpc_server/srv_lsa.o \ +RPC_SERVER_OBJ = rpc_server/srv_lsa.o \ rpc_server/srv_lsa_hnd.o rpc_server/srv_netlog.o \ rpc_server/srv_pipe_hnd.o rpc_server/srv_reg.o \ rpc_server/srv_samr.o rpc_server/srv_srvsvc.o \ diff --git a/source3/client/client.c b/source3/client/client.c index 13f5adec05c..e23875fc1b5 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -40,7 +40,6 @@ static pstring username; static pstring workgroup; static char *cmdstr; static BOOL got_pass; -static BOOL no_pass; extern struct in_addr ipzero; extern pstring scope; @@ -390,7 +389,7 @@ static void do_list_helper(file_info *f, const char *mask) /**************************************************************************** a wrapper around cli_list that adds recursion ****************************************************************************/ -void do_list(const char *mask,int attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs) +void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs) { do_list_recurse = rec; do_list_dirs = dirs; @@ -405,7 +404,7 @@ void do_list(const char *mask,int attribute,void (*fn)(file_info *),BOOL rec, BO ****************************************************************************/ static void cmd_dir(void) { - int attribute = aDIR | aSYSTEM | aHIDDEN; + uint16 attribute = aDIR | aSYSTEM | aHIDDEN; pstring mask; fstring buf; char *p=buf; @@ -439,7 +438,7 @@ static void cmd_dir(void) ****************************************************************************/ static void cmd_du(void) { - int attribute = aDIR | aSYSTEM | aHIDDEN; + uint16 attribute = aDIR | aSYSTEM | aHIDDEN; pstring mask; fstring buf; char *p=buf; @@ -477,7 +476,7 @@ static void do_get(char *rname,char *lname) char *data; struct timeval tp_start; int read_size = 65520; - uint32 attr; + uint16 attr; size_t size; off_t nread = 0; @@ -539,7 +538,7 @@ static void do_get(char *rname,char *lname) } if (archive_level >= 2 && (attr & aARCH)) { - cli_setatr(cli, rname, attr & ~aARCH, 0); + cli_setatr(cli, rname, attr & ~(uint16)aARCH, 0); } { @@ -691,7 +690,7 @@ do a mget command ****************************************************************************/ static void cmd_mget(void) { - int attribute = aSYSTEM | aHIDDEN; + uint16 attribute = aSYSTEM | aHIDDEN; pstring mget_mask; fstring buf; char *p=buf; @@ -893,8 +892,6 @@ static void cmd_put(void) pstring rname; fstring buf; char *p=buf; - file_info finfo; - finfo = def_finfo; pstrcpy(rname,cur_dir); pstrcat(rname,"\\"); @@ -921,7 +918,6 @@ static void cmd_put(void) DEBUG(0,("%s does not exist\n",lname)); return; } - finfo.mtime = st.st_mtime; } do_put(rname,lname); @@ -965,12 +961,9 @@ static void cmd_mput(void) { pstring lname; pstring rname; - file_info finfo; fstring buf; char *p=buf; - finfo = def_finfo; - while (next_token(NULL,p,NULL,sizeof(buf))) { SMB_STRUCT_STAT st; pstring cmd; @@ -1030,12 +1023,6 @@ static void cmd_mput(void) dos_format(rname); - /* null size so do_put knows to ignore it */ - finfo.size = -1; - - /* set the date on the file */ - finfo.mtime = st.st_mtime; - do_put(rname,lname); } fclose(f); @@ -1145,7 +1132,7 @@ static void cmd_del(void) { pstring mask; fstring buf; - int attribute = aSYSTEM | aHIDDEN; + uint16 attribute = aSYSTEM | aHIDDEN; if (recurse) attribute |= aDIR; @@ -2055,7 +2042,6 @@ static int do_message_op(void) break; case 'N': got_pass = True; - no_pass = True; break; case 'n': pstrcpy(global_myname,optarg); diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 8ebe9dc853c..aade8fcb6ff 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -45,8 +45,8 @@ typedef struct file_info_struct file_info2; struct file_info_struct { - int size; - int mode; + size_t size; + uint16 mode; int uid; int gid; /* These times are normally kept in GMT */ @@ -77,7 +77,7 @@ extern struct cli_state *cli; #define ATTRSET 1 #define ATTRRESET 0 -static int attribute = aDIR | aSYSTEM | aHIDDEN; +static uint16 attribute = aDIR | aSYSTEM | aHIDDEN; #ifndef CLIENT_TIMEOUT #define CLIENT_TIMEOUT (30*1000) @@ -596,9 +596,9 @@ static int padit(char *buf, int bufsize, int padsize) } -static void do_setrattr(char *name, int attr, int set) +static void do_setrattr(char *name, uint16 attr, int set) { - int oldattr; + uint16 oldattr; time_t t; if (!cli_getatr(cli, name, &oldattr, NULL, &t)) return; @@ -622,7 +622,7 @@ static void do_atar(char *rname,char *lname,file_info *finfo1) { int fnum; uint32 nread=0; - char *p, ftype; + char ftype; file_info2 finfo; BOOL close_done = False; BOOL shallitime=True; @@ -718,7 +718,6 @@ static void do_atar(char *rname,char *lname,file_info *finfo1) writetarheader(tarhandle, rname, finfo.size, finfo.mtime, "100644 \0", ftype); while (nread < finfo.size && !close_done) { - p=NULL; DEBUG(3,("nread=%d\n",nread)); @@ -1348,7 +1347,7 @@ void cmd_setmode(void) char *q; fstring buf; pstring fname; - int attra[2]; + uint16 attra[2]; int direct=1; attra[0] = attra[1] = 0; diff --git a/source3/include/client.h b/source3/include/client.h index 1caf78bf0e8..0d5d2ea8fb0 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -36,7 +36,7 @@ typedef struct file_info { SMB_OFF_T size; - int mode; + uint16 mode; uid_t uid; gid_t gid; /* these times are normally kept in GMT */ diff --git a/source3/include/proto.h b/source3/include/proto.h index 1a17d50ac37..3840ec24c96 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -5,32 +5,9 @@ /*The following definitions come from client/client.c */ -void do_list(const char *mask,int attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs); +void do_list(const char *mask,uint16 attribute,void (*fn)(file_info *),BOOL rec, BOOL dirs); struct cli_state *do_connect(char *server, char *share); -/*The following definitions come from client/clientutil.c */ - -void cli_setup_pkt(char *outbuf); -BOOL cli_call_api(char *pipe_name, int pipe_name_len, - int prcnt,int drcnt, int srcnt, - int mprcnt,int mdrcnt, - int *rprcnt,int *rdrcnt, - char *param,char *data, uint16 *setup, - char **rparam,char **rdata); -BOOL cli_receive_trans_response(char *inbuf,int trans, - int *data_len,int *param_len, - char **data,char **param); -BOOL cli_send_trans_request(char *outbuf,int trans, - char *name,int namelen, int fid,int flags, - char *data,char *param,uint16 *setup, - int ldata,int lparam,int lsetup, - int mdata,int mparam,int msetup); -BOOL cli_send_session_request(char *inbuf,char *outbuf); -BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup, struct connection_options *options); -void cli_send_logout(char *dum_in, char *dum_out); -BOOL cli_open_sockets(int port ); -BOOL cli_reopen_connection(char *inbuf,char *outbuf); - /*The following definitions come from client/clitar.c */ void cmd_block(void); @@ -245,7 +222,7 @@ BOOL file_exist(char *fname,SMB_STRUCT_STAT *sbuf); time_t file_modtime(char *fname); BOOL directory_exist(char *dname,SMB_STRUCT_STAT *st); SMB_OFF_T file_size(char *file_name); -char *attrib_string(int mode); +char *attrib_string(uint16 mode); int StrCaseCmp(char *s, char *t); int StrnCaseCmp(char *s, char *t, int n); BOOL strequal(char *s1, char *s2); @@ -396,23 +373,23 @@ ssize_t cli_write(struct cli_state *cli, int fnum, uint16 write_mode, char *buf, off_t offset, size_t size); BOOL cli_getattrE(struct cli_state *cli, int fd, - uint32 *attr, size_t *size, + uint16 *attr, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time); BOOL cli_getatr(struct cli_state *cli, char *fname, - uint32 *attr, size_t *size, time_t *t); -BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t); + uint16 *attr, size_t *size, time_t *t); +BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t); BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, time_t *c_time, time_t *a_time, time_t *m_time, - size_t *size, uint32 *mode); + size_t *size, uint16 *mode); BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, time_t *c_time, time_t *a_time, time_t *m_time, - time_t *w_time, size_t *size, uint32 *mode, + time_t *w_time, size_t *size, uint16 *mode, SMB_INO_T *ino); BOOL cli_qfileinfo(struct cli_state *cli, int fnum, - uint32 *mode, size_t *size, + uint16 *mode, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time, time_t *w_time, SMB_INO_T *ino); -int cli_list(struct cli_state *cli,const char *Mask,int attribute, +int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute, void (*fn)(file_info *, const char *)); BOOL cli_oem_change_password(struct cli_state *cli, char *user, char *new_password, char *old_password); @@ -1880,10 +1857,6 @@ void make_wks_r_query_info(WKS_R_QUERY_INFO *r_u, int status) ; void wks_io_r_query_info(char *desc, WKS_R_QUERY_INFO *r_u, prs_struct *ps, int depth); -/*The following definitions come from rpc_server/srv_ldap_helpers.c */ - -void ldap_helper_dummy(void); - /*The following definitions come from rpc_server/srv_lsa.c */ BOOL api_ntlsa_rpc(pipes_struct *p, prs_struct *data); @@ -2465,7 +2438,7 @@ off_t smbw_telldir(DIR *dirp); void smbw_setup_stat(struct stat *st, char *fname, size_t size, int mode); BOOL smbw_getatr(struct smbw_server *srv, char *path, - uint32 *mode, size_t *size, + uint16 *mode, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time, SMB_INO_T *ino); int smbw_stat_printjob(struct smbw_server *srv,char *path, diff --git a/source3/lib/util.c b/source3/lib/util.c index a0500295485..ae9527d9957 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -608,7 +608,7 @@ SMB_OFF_T file_size(char *file_name) /******************************************************************* return a string representing an attribute for a file ********************************************************************/ -char *attrib_string(int mode) +char *attrib_string(uint16 mode) { static fstring attrstr; diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 650b9a27a3d..fc4c7f1d5db 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -1466,7 +1466,7 @@ ssize_t cli_write(struct cli_state *cli, do a SMBgetattrE call ****************************************************************************/ BOOL cli_getattrE(struct cli_state *cli, int fd, - uint32 *attr, size_t *size, + uint16 *attr, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time) { bzero(cli->outbuf,smb_size); @@ -1517,7 +1517,7 @@ BOOL cli_getattrE(struct cli_state *cli, int fd, do a SMBgetatr call ****************************************************************************/ BOOL cli_getatr(struct cli_state *cli, char *fname, - uint32 *attr, size_t *size, time_t *t) + uint16 *attr, size_t *size, time_t *t) { char *p; @@ -1563,7 +1563,7 @@ BOOL cli_getatr(struct cli_state *cli, char *fname, /**************************************************************************** do a SMBsetatr call ****************************************************************************/ -BOOL cli_setatr(struct cli_state *cli, char *fname, int attr, time_t t) +BOOL cli_setatr(struct cli_state *cli, char *fname, uint16 attr, time_t t) { char *p; @@ -1602,7 +1602,7 @@ send a qpathinfo call ****************************************************************************/ BOOL cli_qpathinfo(struct cli_state *cli, const char *fname, time_t *c_time, time_t *a_time, time_t *m_time, - size_t *size, uint32 *mode) + size_t *size, uint16 *mode) { int data_len = 0; int param_len = 0; @@ -1677,7 +1677,7 @@ send a qpathinfo call with the SMB_QUERY_FILE_ALL_INFO info level ****************************************************************************/ BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, time_t *c_time, time_t *a_time, time_t *m_time, - time_t *w_time, size_t *size, uint32 *mode, + time_t *w_time, size_t *size, uint16 *mode, SMB_INO_T *ino) { int data_len = 0; @@ -1724,12 +1724,12 @@ BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, if (w_time) { *w_time = interpret_long_date(rdata+24) - cli->serverzone; } + if (mode) { + *mode = SVAL(rdata, 32); + } if (size) { *size = IVAL(rdata, 40); } - if (mode) { - *mode = IVAL(rdata, 32); - } if (ino) { *ino = IVAL(rdata, 64); } @@ -1744,7 +1744,7 @@ BOOL cli_qpathinfo2(struct cli_state *cli, const char *fname, send a qfileinfo call ****************************************************************************/ BOOL cli_qfileinfo(struct cli_state *cli, int fnum, - uint32 *mode, size_t *size, + uint16 *mode, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time, time_t *w_time, SMB_INO_T *ino) { @@ -1796,12 +1796,12 @@ BOOL cli_qfileinfo(struct cli_state *cli, int fnum, if (w_time) { *w_time = interpret_long_date(rdata+24) - cli->serverzone; } + if (mode) { + *mode = SVAL(rdata, 32); + } if (size) { *size = IVAL(rdata, 40); } - if (mode) { - *mode = IVAL(rdata, 32); - } if (ino) { *ino = IVAL(rdata, 64); } @@ -1922,7 +1922,7 @@ static int interpret_long_filename(int level,char *p,file_info *finfo) /**************************************************************************** do a directory listing, calling fn on each file found ****************************************************************************/ -int cli_list(struct cli_state *cli,const char *Mask,int attribute, +int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute, void (*fn)(file_info *, const char *)) { int max_matches = 512; diff --git a/source3/printing/printing.c b/source3/printing/printing.c index ddc0f70d189..faa099c3593 100644 --- a/source3/printing/printing.c +++ b/source3/printing/printing.c @@ -207,7 +207,7 @@ static BOOL parse_lpq_bsd(char *line,print_queue_struct *buf,BOOL first) #define USERTOK 2 #define JOBTOK 3 #define FILETOK 4 -#define TOTALTOK (count - 1) +#define TOTALTOK (count - 2) #define NTOK 6 #define MAXTOK 128 #else /* OSF1 */ @@ -215,7 +215,7 @@ static BOOL parse_lpq_bsd(char *line,print_queue_struct *buf,BOOL first) #define USERTOK 1 #define JOBTOK 2 #define FILETOK 3 -#define TOTALTOK (count - 1) +#define TOTALTOK (count - 2) #define NTOK 5 #define MAXTOK 128 #endif /* OSF1 */ diff --git a/source3/rpc_server/srv_ldap_helpers.c b/source3/rpc_server/srv_ldap_helpers.c deleted file mode 100644 index fb2442789c8..00000000000 --- a/source3/rpc_server/srv_ldap_helpers.c +++ /dev/null @@ -1,14 +0,0 @@ -#ifdef USE_LDAP - -#include "includes.h" -#include "lber.h" -#include "ldap.h" - -extern int DEBUGLEVEL; - - -#else /* USE_LDAP */ -/* this keeps fussy compilers happy */ -void ldap_helper_dummy(void) -{} -#endif /* USE_LDAP */ diff --git a/source3/smbd/quotas.c b/source3/smbd/quotas.c index d5ecf73451b..6df668e279b 100644 --- a/source3/smbd/quotas.c +++ b/source3/smbd/quotas.c @@ -239,7 +239,7 @@ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_U /**************************************************************************** try to get the disk space from disk quotas (SunOS & Solaris2 version) -/* Quota code by Peter Urbanec (amiga@cse.unsw.edu.au) */ +Quota code by Peter Urbanec (amiga@cse.unsw.edu.au). ****************************************************************************/ BOOL disk_quotas(char *path, SMB_BIG_UINT *bsize, SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize) diff --git a/source3/smbwrapper/smbw.c b/source3/smbwrapper/smbw.c index 26dec4646e9..42979bcf004 100644 --- a/source3/smbwrapper/smbw.c +++ b/source3/smbwrapper/smbw.c @@ -1014,7 +1014,7 @@ static int smbw_settime(const char *fname, time_t t) struct smbw_server *srv; fstring server, share; pstring path; - uint32 mode; + uint16 mode; if (!fname) { errno = EINVAL; @@ -1083,7 +1083,7 @@ int smbw_chown(const char *fname, uid_t owner, gid_t group) struct smbw_server *srv; fstring server, share; pstring path; - uint32 mode; + uint16 mode; if (!fname) { errno = EINVAL; diff --git a/source3/smbwrapper/smbw_dir.c b/source3/smbwrapper/smbw_dir.c index 4b8381176b3..95b2ac4b642 100644 --- a/source3/smbwrapper/smbw_dir.c +++ b/source3/smbwrapper/smbw_dir.c @@ -361,7 +361,7 @@ int smbw_chdir(const char *name) struct smbw_server *srv; fstring server, share; pstring path; - uint32 mode = aDIR; + uint16 mode = aDIR; char *cwd; int len; diff --git a/source3/smbwrapper/smbw_stat.c b/source3/smbwrapper/smbw_stat.c index 443c898eb50..c84140f3629 100644 --- a/source3/smbwrapper/smbw_stat.c +++ b/source3/smbwrapper/smbw_stat.c @@ -65,7 +65,7 @@ try to do a QPATHINFO and if that fails then do a getatr this is needed because win95 sometimes refuses the qpathinfo *******************************************************/ BOOL smbw_getatr(struct smbw_server *srv, char *path, - uint32 *mode, size_t *size, + uint16 *mode, size_t *size, time_t *c_time, time_t *a_time, time_t *m_time, SMB_INO_T *ino) { @@ -130,7 +130,7 @@ int smbw_fstat(int fd, struct stat *st) struct smbw_file *file; time_t c_time, a_time, m_time; size_t size; - uint32 mode; + uint16 mode; SMB_INO_T ino = 0; smbw_busy++; @@ -178,7 +178,7 @@ int smbw_stat(const char *fname, struct stat *st) pstring path; time_t m_time=0, a_time=0, c_time=0; size_t size=0; - uint32 mode=0; + uint16 mode=0; SMB_INO_T ino = 0; ZERO_STRUCTP(st); -- 2.34.1