Makefile.in: Removed rpc_server/srv_ldap_helpers.c per J.F.'s instructions.
authorJeremy Allison <jra@samba.org>
Mon, 9 Nov 1998 20:33:37 +0000 (20:33 +0000)
committerJeremy Allison <jra@samba.org>
Mon, 9 Nov 1998 20:33:37 +0000 (20:33 +0000)
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)

13 files changed:
source3/Makefile.in
source3/client/client.c
source3/client/clitar.c
source3/include/client.h
source3/include/proto.h
source3/lib/util.c
source3/libsmb/clientgen.c
source3/printing/printing.c
source3/rpc_server/srv_ldap_helpers.c [deleted file]
source3/smbd/quotas.c
source3/smbwrapper/smbw.c
source3/smbwrapper/smbw_dir.c
source3/smbwrapper/smbw_stat.c

index a4a234ba3555d5298168fa0f2b41bd8775700039..253f7f2809f74613cd871c6cedabc44db2fc1eaa 100644 (file)
@@ -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 \
index 13f5adec05c2395cf3865d01e06937fee63e173e..e23875fc1b537089c82fe9e037c9433c48d87251 100644 (file)
@@ -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);
index 8ebe9dc853ca4813dc334e7fcbd197fc4867d260..aade8fcb6ff7881d14f039e33b03f5ebfee52ba2 100644 (file)
@@ -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;
index 1caf78bf0e8d84a3f12bc0c7dfab06e0605efd22..0d5d2ea8fb0020e6720d80db0797910cf91b491a 100644 (file)
@@ -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 */
index 1a17d50ac37b0b3e8c251cb1cc5d12a0715d47c3..3840ec24c96394b882783ce999e651ed66c72321 100644 (file)
@@ -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,
index a0500295485349e56ec92140680d6e63b4afed09..ae9527d99578280ebbac7c5f9d8c74dd697ada17 100644 (file)
@@ -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;
 
index 650b9a27a3d25483d79faeecccb5e0298aa4a039..fc4c7f1d5db660c9fe58fe3378a64db8aed3bbf9 100644 (file)
@@ -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;
index ddc0f70d1890934c5f8cfb4e4b71549b83dc092f..faa099c3593f9e8b639435efe87e5e1709fe6830 100644 (file)
@@ -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 (file)
index fb24427..0000000
+++ /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 */
index d5ecf73451be59fc341ff949349a66d5b5ced1be..6df668e279b86f21a547749f184eeb67f7e17711 100644 (file)
@@ -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)
index 26dec4646e921d0ccf3293817264cc7758a2f5d6..42979bcf0047d366cff14b21b3e6c156711c3cb9 100644 (file)
@@ -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;
index 4b8381176b3922e19bef3b7b6f12ef1ab01bbe88..95b2ac4b64260c9610ab563fb8e363ee1ff05cfb 100644 (file)
@@ -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;
 
index 443c898eb50315d50ca846702633d8c86c87f704..c84140f3629ae05debf34414b125a4fde2933c0d 100644 (file)
@@ -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);