#define SEPARATORS " \t\n\r"
extern int DEBUGLEVEL;
extern struct cli_state *cli;
+extern FILE *dbf;
/* These defines are for the do_setrattr routine, to indicate
* setting and reseting of file attributes in the function call */
static void do_setrattr(char *name, uint16 attr, int set)
{
uint16 oldattr;
- time_t t;
- if (!cli_getatr(cli, name, &oldattr, NULL, &t)) return;
+ if (!cli_getatr(cli, name, &oldattr, NULL, NULL)) return;
if (set == ATTRSET) {
attr |= oldattr;
attr = oldattr & ~attr;
}
- if (!cli_setatr(cli, name, attr, t)) {
+ if (!cli_setatr(cli, name, attr, 0)) {
DEBUG(1,("setatr failed: %s\n", cli_errstr(cli)));
}
}
}
ntarf++; /* Make sure we have a file on there */
safe_strcpy(mtar_mask,cur_dir, sizeof(pstring));
- safe_strcat(mtar_mask,"*.*", sizeof(pstring));
+ safe_strcat(mtar_mask,"*", sizeof(pstring));
+ DEBUG(5, ("Doing list with mtar_mask: %s\n", mtar_mask));
do_list(mtar_mask, attribute, do_tar, False, True);
safe_strcpy(cur_dir,saved_curdir, sizeof(pstring));
}
static int get_file(file_info2 finfo)
{
int fsize = finfo.size;
- int fnum, pos = 0, dsize = 0, rsize = 0, bpos = 0;
+ int fnum = -1, pos = 0, dsize = 0, rsize = 0, bpos = 0;
DEBUG(5, ("get_file: file: %s, size %i\n", finfo.name, fsize));
if (!next_token(NULL,buf,NULL,sizeof(buf)))
{
- DEBUG(0, ("setmode <filename> <perm=[+|-]rsha>\n"));
+ DEBUG(0, ("setmode <filename> <[+|-]rsha>\n"));
return;
}
if (attra[ATTRSET]==0 && attra[ATTRRESET]==0)
{
- DEBUG(0, ("setmode <filename> <perm=[+|-]rsha>\n"));
+ DEBUG(0, ("setmode <filename> <[+|-]rsha>\n"));
return;
}
DEBUG(2, ("\nperm set %d %d\n", attra[ATTRSET], attra[ATTRRESET]));
- (void) do_setrattr(fname, attra[ATTRSET], ATTRSET);
- (void) do_setrattr(fname, attra[ATTRRESET], ATTRRESET);
+ do_setrattr(fname, attra[ATTRSET], ATTRSET);
+ do_setrattr(fname, attra[ATTRRESET], ATTRRESET);
}
/****************************************************************************
safe_strcpy(cur_dir, tarmac, sizeof(pstring));
*(strrchr(cur_dir, '\\')+1)='\0';
+ DEBUG(5, ("process_tar, do_list with tarmac: %s\n", tarmac));
do_list(tarmac,attribute,do_tar, False, True);
safe_strcpy(cur_dir,saved_dir, sizeof(pstring));
} else {
safe_strcpy(tarmac, cur_dir, sizeof(pstring));
safe_strcat(tarmac, cliplist[i], sizeof(pstring));
+ DEBUG(5, ("process_tar, do_list with tarmac: %s\n", tarmac));
do_list(tarmac,attribute,do_tar, False, True);
}
}
} else {
pstring mask;
safe_strcpy(mask,cur_dir, sizeof(pstring));
- safe_strcat(mask,"\\*.*", sizeof(pstring));
+ DEBUG(5, ("process_tar, do_list with mask: %s\n", mask));
+ safe_strcat(mask,"\\*", sizeof(pstring));
do_list(mask,attribute,do_tar,False, True);
}
clipn = 0;
buf[MAXPATHLEN] = '\0'; /* guarantee null-termination */
- if ((inclusion = fopen(filename, "r")) == NULL) {
+ if ((inclusion = sys_fopen(filename, "r")) == NULL) {
/* XXX It would be better to include a reason for failure, but without
* autoconf, it's hard to use strerror, sys_errlist, etc.
*/
if (Optind>=argc || !strcmp(argv[Optind], "-")) {
/* Sets tar handle to either 0 or 1, as appropriate */
tarhandle=(tar_type=='c');
+ /*
+ * Make sure that dbf points to stderr if we are using stdout for
+ * tar output
+ */
+ if (tarhandle == 1)
+ dbf = stderr;
} else {
if (tar_type=='c' && (dry_run || strcmp(argv[Optind], "/dev/null")==0))
{
}
tarhandle=-1;
} else
- if ((tar_type=='x' && (tarhandle = open(argv[Optind], O_RDONLY)) == -1)
- || (tar_type=='c' && (tarhandle=creat(argv[Optind], 0644)) < 0))
+ if ((tar_type=='x' && (tarhandle = sys_open(argv[Optind], O_RDONLY, 0)) == -1)
+ || (tar_type=='c' && (tarhandle=sys_creat(argv[Optind], 0644)) < 0))
{
DEBUG(0,("Error opening local file %s - %s\n",
argv[Optind], strerror(errno)));