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 \
static pstring workgroup;
static char *cmdstr;
static BOOL got_pass;
-static BOOL no_pass;
extern struct in_addr ipzero;
extern pstring scope;
/****************************************************************************
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;
****************************************************************************/
static void cmd_dir(void)
{
- int attribute = aDIR | aSYSTEM | aHIDDEN;
+ uint16 attribute = aDIR | aSYSTEM | aHIDDEN;
pstring mask;
fstring buf;
char *p=buf;
****************************************************************************/
static void cmd_du(void)
{
- int attribute = aDIR | aSYSTEM | aHIDDEN;
+ uint16 attribute = aDIR | aSYSTEM | aHIDDEN;
pstring mask;
fstring buf;
char *p=buf;
char *data;
struct timeval tp_start;
int read_size = 65520;
- uint32 attr;
+ uint16 attr;
size_t size;
off_t nread = 0;
}
if (archive_level >= 2 && (attr & aARCH)) {
- cli_setatr(cli, rname, attr & ~aARCH, 0);
+ cli_setatr(cli, rname, attr & ~(uint16)aARCH, 0);
}
{
****************************************************************************/
static void cmd_mget(void)
{
- int attribute = aSYSTEM | aHIDDEN;
+ uint16 attribute = aSYSTEM | aHIDDEN;
pstring mget_mask;
fstring buf;
char *p=buf;
pstring rname;
fstring buf;
char *p=buf;
- file_info finfo;
- finfo = def_finfo;
pstrcpy(rname,cur_dir);
pstrcat(rname,"\\");
DEBUG(0,("%s does not exist\n",lname));
return;
}
- finfo.mtime = st.st_mtime;
}
do_put(rname,lname);
{
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;
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);
{
pstring mask;
fstring buf;
- int attribute = aSYSTEM | aHIDDEN;
+ uint16 attribute = aSYSTEM | aHIDDEN;
if (recurse)
attribute |= aDIR;
break;
case 'N':
got_pass = True;
- no_pass = True;
break;
case 'n':
pstrcpy(global_myname,optarg);
struct file_info_struct
{
- int size;
- int mode;
+ size_t size;
+ uint16 mode;
int uid;
int gid;
/* These times are normally kept in GMT */
#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)
}
-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;
{
int fnum;
uint32 nread=0;
- char *p, ftype;
+ char ftype;
file_info2 finfo;
BOOL close_done = False;
BOOL shallitime=True;
writetarheader(tarhandle, rname, finfo.size, finfo.mtime, "100644 \0", ftype);
while (nread < finfo.size && !close_done) {
- p=NULL;
DEBUG(3,("nread=%d\n",nread));
char *q;
fstring buf;
pstring fname;
- int attra[2];
+ uint16 attra[2];
int direct=1;
attra[0] = attra[1] = 0;
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 */
/*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);
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);
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);
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);
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,
/*******************************************************************
return a string representing an attribute for a file
********************************************************************/
-char *attrib_string(int mode)
+char *attrib_string(uint16 mode)
{
static fstring attrstr;
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);
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;
/****************************************************************************
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;
****************************************************************************/
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;
****************************************************************************/
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;
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);
}
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)
{
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);
}
/****************************************************************************
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;
#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 */
#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 */
+++ /dev/null
-#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 */
/****************************************************************************
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)
struct smbw_server *srv;
fstring server, share;
pstring path;
- uint32 mode;
+ uint16 mode;
if (!fname) {
errno = EINVAL;
struct smbw_server *srv;
fstring server, share;
pstring path;
- uint32 mode;
+ uint16 mode;
if (!fname) {
errno = EINVAL;
struct smbw_server *srv;
fstring server, share;
pstring path;
- uint32 mode = aDIR;
+ uint16 mode = aDIR;
char *cwd;
int len;
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)
{
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++;
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);