POOLMEM *sys_fname; /* system filename */
POOLMEM *fname_save; /* save when stripping path */
POOLMEM *link_save; /* save when stripping path */
+ POOLMEM *ignoredir_fname; /* used to ignore directories */
char *digest; /* set to file digest when the file is a hardlink */
struct stat statp; /* stat packet */
uint32_t digest_len; /* set to the digest len when the file is a hardlink*/
dir_ff_pkt->linkhash = NULL;
dir_ff_pkt->fname_save = NULL;
dir_ff_pkt->link_save = NULL;
+ dir_ff_pkt->ignoredir_fname = NULL;
return dir_ff_pkt;
}
if (dir_ff_pkt->link_save) {
free_pool_memory(dir_ff_pkt->link_save);
}
+ if (dir_ff_pkt->ignoredir_fname) {
+ free_pool_memory(dir_ff_pkt->ignoredir_fname);
+ }
free(dir_ff_pkt);
}
static bool have_ignoredir(FF_PKT *ff_pkt)
{
struct stat sb;
- char tmp_name[MAXPATHLEN];
char *ignoredir;
/* Ensure that pointers are defined */
ignoredir = ff_pkt->fileset->incexe->ignoredir;
if (ignoredir) {
- if (strlen(ff_pkt->fname) + strlen(ignoredir) + 2 > MAXPATHLEN) {
- return false;
+ if (!ff_pkt->ignoredir_fname) {
+ ff_pkt->ignoredir_fname = get_pool_memory(PM_FNAME);
}
-
- strcpy(tmp_name, ff_pkt->fname);
- strcat(tmp_name, "/");
- strcat(tmp_name, ignoredir);
- if (stat(tmp_name, &sb) == 0) {
+ Mmsg(ff_pkt->ignoredir_fname, "%s/%s", ff_pkt->fname, ignoredir);
+ if (stat(ff_pkt->ignoredir_fname, &sb) == 0) {
Dmsg2(100, "Directory '%s' ignored (found %s)\n",
ff_pkt->fname, ignoredir);
return true; /* Just ignore this directory */