From: Kern Sibbald Date: Sun, 9 Mar 2003 21:43:14 +0000 (+0000) Subject: Integrate Phil's code, lex updates X-Git-Tag: Release-1.30~93 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0a62e8eacaa64193bb3f901762d706487d302764;p=bacula%2Fbacula Integrate Phil's code, lex updates git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@374 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index 3ac47139e9..04dc7f2e48 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,5 +1,5 @@ Kern's ToDo List - 01 March 2003 + 09 March 2003 Documentation to do: (a little bit at a time) - Document running a test version. @@ -8,17 +8,20 @@ Documentation to do: (a little bit at a time) - Document how to automatically backup all local partitions - Document problems with Verify and pruning. - Document how to use multiple databases. +- Document Maximum File Size Testing to do: (painful) -- that console command line options work +- that ALL console command line options work and are always implemented - blocksize recognition code. - multiple simultaneous Volumes For 1.30 release: -- Implement max_file_size in block.c +- Fix "access not allowed" for backup of files on WinXP. +- Fix Error: bnet.c:408 gethostbyname() for lpmatou failed: ERR=Operation not permited + loop. - Add code if there is no mtio.h. -- Add a section to the doc on Manual cycling +- Add a section to the doc on Manual cycling of Volumes. - Look at purge jobs volume (at least document it, and see if it is logical). - Add list volumes pool=* @@ -878,3 +881,4 @@ Done: (see kernsdone for more) scheduled. - Implement TCP/IP connection for MySQL - Pull a canceled job from the Scheduling queue. +- Implement max_file_size in block.c (already done, just tweaked). diff --git a/bacula/src/filed/win32/bin/CygwinInstall.bat b/bacula/src/filed/win32/bin/CygwinInstall.bat new file mode 100755 index 0000000000..10c4329d4a --- /dev/null +++ b/bacula/src/filed/win32/bin/CygwinInstall.bat @@ -0,0 +1,3 @@ +cd \bacula\bin +bacula-fd.exe /install + diff --git a/bacula/src/lib/bnet.c b/bacula/src/lib/bnet.c index bb0757db91..9035e5cf70 100644 --- a/bacula/src/lib/bnet.c +++ b/bacula/src/lib/bnet.c @@ -30,6 +30,7 @@ #include "bacula.h" +#include "jcr.h" extern time_t watchdog_time; @@ -494,13 +495,17 @@ bnet_open(void *jcr, char *name, char *host, char *service, int port) * Try to connect to host for max_retry_time at retry_time intervals. */ BSOCK * -bnet_connect(void *jcr, int retry_interval, int max_retry_time, char *name, +bnet_connect(void *vjcr, int retry_interval, int max_retry_time, char *name, char *host, char *service, int port, int verbose) { int i; BSOCK *bsock; + JCR *jcr = (JCR *)vjcr; for (i=0; (bsock = bnet_open(jcr, name, host, service, port)) == NULL; i -= retry_interval) { + if (job_cancelled(jcr)) { + break; + } Dmsg4(100, "Unable to connect to %s on %s:%d. ERR=%s\n", name, host, port, strerror(errno)); if (i < 0) { diff --git a/bacula/src/lib/lex.c b/bacula/src/lib/lex.c index 6e9118d054..9474ab6444 100644 --- a/bacula/src/lib/lex.c +++ b/bacula/src/lib/lex.c @@ -153,8 +153,9 @@ lex_open_file(LEX *lf, char *filename, LEX_ERROR_HANDLER *scan_error) int lex_get_char(LEX *lf) { - if (lf->ch == L_EOF) + if (lf->ch == L_EOF) { Emsg0(M_ABORT, 0, "get_char: called after EOF\n"); + } if (lf->ch == L_EOL) { if (fgets(lf->line, MAXSTRING, lf->fd) == NULL) { lf->ch = L_EOF; @@ -357,10 +358,16 @@ lex_get_token(LEX *lf, int expect) if (ch == L_EOL) { lf->state = lex_none; token = T_EOL; + } else if (ch == L_EOF) { + token = T_ERROR; } break; case lex_number: Dmsg2(290, "Lex state lex_number ch=%x %c\n", ch, ch); + if (ch == L_EOF) { + token = T_ERROR; + break; + } /* Might want to allow trailing specifications here */ if (B_ISDIGIT(ch)) { add_str(lf, ch); @@ -377,10 +384,18 @@ lex_get_token(LEX *lf, int expect) lex_unget_char(lf); break; case lex_ip_addr: + if (ch == L_EOF) { + token = T_ERROR; + break; + } Dmsg1(290, "Lex state lex_ip_addr ch=%x\n", ch); break; case lex_string: Dmsg1(290, "Lex state lex_string ch=%x\n", ch); + if (ch == L_EOF) { + token = T_ERROR; + break; + } if (ch == '\n' || ch == L_EOL || ch == '=' || ch == '}' || ch == '{' || ch == ';' || ch == ',' || ch == '#' || (B_ISSPACE(ch)) ) { lex_unget_char(lf); @@ -415,6 +430,10 @@ lex_get_token(LEX *lf, int expect) break; case lex_quoted_string: Dmsg2(290, "Lex state lex_quoted_string ch=%x %c\n", ch, ch); + if (ch == L_EOF) { + token = T_ERROR; + break; + } if (ch == L_EOL) { esc_next = FALSE; break; @@ -436,6 +455,10 @@ lex_get_token(LEX *lf, int expect) add_str(lf, ch); break; case lex_include: /* scanning a filename */ + if (ch == L_EOF) { + token = T_ERROR; + break; + } if (B_ISSPACE(ch) || ch == '\n' || ch == L_EOL || ch == '}' || ch == '{' || ch == ';' || ch == ',' || ch == '"' || ch == '#') { lf->state = lex_none; @@ -536,7 +559,7 @@ lex_get_token(LEX *lf, int expect) case T_STRING: if (token != T_IDENTIFIER && token != T_UNQUOTED_STRING && token != T_QUOTED_STRING) { - scan_err2(lf, "expected a name, got %s: %s", + scan_err2(lf, "expected a string, got %s: %s", lex_tok_to_str(token), lf->str); token = T_ERROR; } else {