From: (no author) <(no author)@91ce42f0-d328-0410-95d8-f526ca767f89> Date: Thu, 6 Apr 2006 21:15:16 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create tag X-Git-Tag: Release-1.38.7 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4e1cdc03714d6f531108e2e2d42f4742f998b299;p=bacula%2Fbacula This commit was manufactured by cvs2svn to create tag 'Release-1.38.7'. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/tags/Release-1.38.7@2883 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 5825c672d3..6c665fdd0b 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -1,5 +1,161 @@ -Release 1.38.4 16Jan06 released 17 Jan 06: +Release 1.38.7 (06Apr06) released 07Apr06 +- Remove timed wait for VSS on Win2K3 as it is not yet + implemented. +- Correct bacula.in script to reference bacula-ctl-xx in the + sysconfig directory rather than the bin directory. + +Release 1.38.6 (28Mar06) released 29Mar06 +28Mar06 +- Back port from 1.39 fixes to lib/jcr.c to use foreach_jcr() + and new jcr chain locking. +26Mar06 +- Fix a long standing bug in the bacula start/stop scripts. +- Attempt to add the new bacula-ctl-* files to the rpm. +- Switch to using typeof() for list traversing to avoid + as many FC5 g++ compiler warnings as possible. +25Mar06 +- Split the bacula start/start script into four files: + bacula -- starts and stops calling other scripts + bacula-ctl-dir -- starts/stops the director + bacula-ctl-fd -- starts/stops the File daemon + bacula-ctl-sd -- starts/stops the Storage daemon +24Mar06 +- Create datestyle fix for PostgreSQL. Fixes bug #574. +- Correct editing of JobId from int to int64 in fd_cmds.c +- Eliminate FileSet name race with bash_spaces() and multiple + threads by bashing in a local. +- Fix error return from 'use storage' to print a correct error + message rather than nothing. +- Correct false re-read last block error message when two jobs + are simultaneously writing at the end of a tape. +- Simplify exit conditions in the reserve.c code to avoid + possible non-release of reservation_lock(). +- Suffle lock order in reserve to avoid deadlock between + reservation lock and device mutex. +- Add Thorsten's VSS timeout code to 1.38 branch. +21Mar06 +- Initialize jcr mutex before first use. Thanks to Thorsten for + tracking this down for me !!!! as it broke the Win32 build. +20Mar06 +- Integrate addition of line count limitation to bsmtp -l from + Sebastian Stark +17Mar06 +- Implement regex test program in tools directory. +- Attempt to fix time problem with bsmtp with foreign langs. +- Add strip_trailing_newline() submitted by user. + +Release 1.38.6 beta6 +16Mar06 +- Fix bug #537 to allow arbitrary time to mount a volume for + restore, if polling is turned on. +- Disallow multiple storage specifications for a job. Should fix Arno's + problem. +- Add back a missing store of poolid in jr.poolid. +- If dir_user or dir-group is specified in ./configure apply it to + the working-dir. Fixes bug #533. +- If rescheduling a job cancel the previous incarnation with the SD. + Fixes bugs #566 and 557. +- Fix bug #567 do_message() definition type conflict. + +Release 1.38.6 beta5 +14Mar06 +- Add more jcr methods and make mutex and use_count private. +- Create lock/unlock methods for jcr. +- Fix PostgreSQL bug doing sql_data_seeek() by explicitly reading + records to get to seek position. +- Integrate patch from bug #561 to correct conio.c signal definitions. +- Fix Rescheduling failed Jobs. Ensure that SD message thread + terminates correctly by doing pthread_kill(). Do not destroy + SD cond wait variable between executions of the job. Use local + mutex for cond variable to avoid blocking jcr chain. Fix poor + use of jcr use count in jobq.c for restarted jobs. +- Fix obsolete usage of foreach_dlist() to use foreach_jcr() in + lib/jcr.c -- prevents locking the jcr chaing. +- Apply patch from bug #564, which corrects listing volumes with + multiple autochangers. Apply same fix to next volume list. +- Fix bug #562 where restore bootstrap file is not unique. +- Use new routine lock_reservations() to lock the reservations + system, and call it while looking for a volume in askdir.c. + This could possibly fix bug #543. +- Stop SD command loop if job is canceled. + +Beta4 attached to a bug report but not distributed. +04Mar06 +- Fix new sql_use_result() code to properly release the + buffers in all cases. +- Convert to using new Python class definitons with (object). +- Use the keyword ujobid to mean the unique job id; job or jobname + to mean the Job name given on the Name directive, and jobid to + be the numeric (non-unique) job id. +- Allow listing by any of the above. +- Add the user friendly job report code for reporting job elapsed time + and rates with suffexes. +- Add Priority and JobLevel as Python settable items. +- Use TEMPORARY table creation where the table is created by + Bacula. +- Add new code submitted by Eric for waiting on specific jobid. +- Add ACL checking for the dot commands. +- Fix restore of writable FIFOs. +- Fix a bug in bpipe where the string was freed too early. + +26Feb06 +- Fix bug reported by Arno listing blocks with bls +- Update the po files at Eric's request. + +Release 1.38.6-beta2 25Feb06 +25Feb06 +- Add sql_use_result() define. + +Release 1.38.6 beta1 24Feb06 +24Feb06 +- Don't open default catalog if not in ACL. +22Feb06 +- Add virtual disk autochanger code. +- Add user supplied bug fix to make two autochangers work + correctly using StorageId with InChanger checks. +- Correct new/old_jcr confusion in copy_storage(). +- Remove & from Job during scan in msgchan.c -- probably + trashed the stack. +- When getting the next Volume if no Volume in Append mode + exists and we are dealing with an Autochanger, search + for a Scratch Volume. +- Check for missing value in dot commands -- bug fix. +- Fix bug in update barcodes command line scanning. +- Make sure Pool Max Vols is respected. +- Check that user supplied a value before referencing + it in restore -- pointed out by Karl Hakimian. +- Add Karl Hakimian's table insert code. +- Don't ask user to select a specific Volume when + updating all volumes in a Pool. +- Remove reservation if set for read when removing dcr. +- Lock code that requests next appendable volume so that + two jobs to get the same Volume at the same time. +- Add new Device Type = xxx code. Values are file, tape, + dvd, and fifo. +- Preserve certain modes (ST_LABEL|ST_APPEND|ST_READ) across + a re-open to change read/write permission on a device. +- Correct a misplaced double quote in certain autochanger + scripts. +- Make make_catalog_backup.in a bit more portable. +- Implement Karl Hakimian's sql_use_result(), which speeds + up restore tree building and reduces the memory load. +- Correct a number of minor bugs in getting a Volume from + the Scratch Pool. +- Implement additional command line options for update Volume. +- Don't require user to enter a Volume name when updating + all Volumes in a pool. + +Release 1.38.5 released 19Jan06: +19Jan06 +- Apply label barcodes fix supplied by Rudolf Cejka. +18Jan06 +- Modify standard rpm installation to set SD group to disk + so that SD will by default have access to tape drives. +- Allow users to specify user/group and start options + for each daemon in /etc/sysconf/bacula file. + +Release 1.38.4 14Jan06 released 17 Jan 06: 16Jan06 - Add two new queries to query.sql provided by Arno. One list volumes known to the Storage device, and the other @@ -71,7 +227,7 @@ Beta release 23Dec05: volume so that it can handle multiple returns from the wait code. - Modify the wait code to permit multiple returns. -- Return a zero when "autochanger drives" is called and +- Return a zero when 'autochanger drives' is called and it is not an autochanger. - Make rewind_dev() a method taking a DCR as an argument. This permits closing and reopening the drive if the @@ -183,9 +339,9 @@ Beta release 20Dec05: 04Dec05 - Apply days keyword patch from Alexander.Bergolth at wu-wien.ac.at If this patch is applied, the number of days can be specified with - "list nextvol days=xx" + 'list nextvol days=xx' or - "status dir days=xx" + 'status dir days=xx' My use case is to be able to preview the next scheduled job (and the next tape to be used) on fridays if there are no scheduled jobs during the weekend. @@ -237,7 +393,7 @@ Changes to 1.38.1: 15 November 2005 the user. - Add Solaris ACL detection in configure.in as supplied by Attila Fulop. -- Implement "autochanger drives" protocol so that Dir knows +- Implement 'autochanger drives' protocol so that Dir knows how many drives an autochanger has. - Do not request drive number in label, ... if only one drive. - Turn off debug code. @@ -411,7 +567,7 @@ Changes to 1.37.39: - Make new_volume walk through all Vols looking for dev to release. 16Sep05 -- Make "quit" command in console always allowed. +- Make 'quit' command in console always allowed. - Remove the storage list between each console command to keep Dir from remembering a previously selected SD. - Add code to reservation VOLRES subroutines to try to ensure @@ -422,7 +578,7 @@ Changes to 1.37.39: - Apply Nicolas' dvd-freespace.in patch. - Make sure SQL table names are not translated. - Eliminate incorrect message saying barcodes not - found in "label barcodes" -- fixes bug report. + found in 'label barcodes' -- fixes bug report. Changes to 1.37.38: 07Sep05 @@ -447,7 +603,7 @@ Changes to 1.37.37: - Correct ssize_t problem in build of Win32 - Add code to llprint pools and volumes to debug next item. - From bug report, fix resetting Pool defaults in Volume. It - was a typo "Max" was missing in several places. + was a typo 'Max' was missing in several places. - Don't allow translation of database Volume Status values. Changes to 1.37.37 released 26 Aug 05 @@ -484,7 +640,7 @@ Changes to 1.37.36 released 22 Aug 05 other searches. - Fix picking up drive in Dir so that it is not done in the status command. -- Eliminate double check on "loaded" for autochanger. +- Eliminate double check on 'loaded' for autochanger. 17Aug05 - Start coding better reservation algorithm - Always look for slot for label command. @@ -543,7 +699,7 @@ Changes to 1.37.34: search to avoid two threads competing for the same resource. - Correct a return code in find_suitable_device_for_job() - Possibly cause of "busy writing to another volume". + Possibly cause of 'busy writing to another volume'. 03Aug05 - Modify open() for tape so nonblocking really works. - Use fcntl() to reset blocking status rather than close() @@ -672,7 +828,7 @@ Changes to 1.37.31: been adapted. - Remove set_exit_on_error function 07Apr05 - - Fix "unknown device type" problem with DVD devices. + - Fix 'unknown device type' problem with DVD devices. - Fix crash when there is no media in the DVD drive. 09Jan05 - Update the documentation and ReleaseNotes. @@ -705,12 +861,12 @@ Changes to 1.37.31: 29Dec04 - Add VolParts field in Media table - Add MaximumPartSize directive in Device (SD configuration file) - - File Volumes can now be splitted in multiple files ("parts") - - Fix SQL error in sql_list while doing "llist jobmedia" + - File Volumes can now be splitted in multiple files ('parts') + - Fix SQL error in sql_list while doing 'llist jobmedia' Changes to 1.37.30 released 16 July 2005: 14Jul05 -- Fix "dir" command scanning field misalignment in +- Fix 'dir' command scanning field misalignment in wx-console. - Switch to using the wxWidgets Unicode library. - Include msvcr71.dll in distribution. @@ -790,7 +946,7 @@ Changes to 1.37.28: file sizes for restore and dir of catalog, otherwise GB sizes are truncated -- fixes bug report. - Modify wx-console to know about 10 character widths. -- Allow decending into top level directory if "recurse=no" +- Allow decending into top level directory if 'recurse=no' is set. Fixes a bug report. - Install pthreadVCE.dll when installing console or wx-console on Win32 systems. Fixes bug report. @@ -808,12 +964,12 @@ Changes to 1.37.28: 30Jun05 - Detect device mounted for DVD and suppress be sure to mount message after label. -- Set Cleaning tape status to "Cleaning" and force no +- Set Cleaning tape status to 'Cleaning' and force no MediaType. - Get DVD writing working with new standard Bacula open() code. - Rename get_filename() to make more sense. -- Detect "is already mounted on" on mount command so to avoid +- Detect 'is already mounted on' on mount command so to avoid error if device is already mounted. - Eliminated guess_name() code. It may be necessary to add it back later. @@ -904,7 +1060,7 @@ Changes from Nicolas Boichat: been adapted. - Remove set_exit_on_error function 07Apr05 - - Fix "unknown device type" problem with DVD devices. + - Fix 'unknown device type' problem with DVD devices. - Fix crash when there is no media in the DVD drive. 09Jan05 - Update the documentation and ReleaseNotes. @@ -937,8 +1093,8 @@ Changes from Nicolas Boichat: 29Dec04 - Add VolParts field in Media table - Add MaximumPartSize directive in Device (SD configuration file) - - File Volumes can now be splitted in multiple files ("parts") - - Fix SQL error in sql_list while doing "llist jobmedia" + - File Volumes can now be splitted in multiple files ('parts') + - Fix SQL error in sql_list while doing 'llist jobmedia' Changes to 1.37.23: - Renamed to make unique version for open_next_part() @@ -1038,7 +1194,7 @@ Changes to 1.37.19: - Make restore.bsr have unique name. - Allow user to define bsr filename on restore command line with bootstrap=xxx.bsr -- Add limit=nnn to "list jobs" command. +- Add limit=nnn to 'list jobs' command. - Remove old restore code that did not use .bsr file. - unlink automatically generated bsr file. - Cleanup heartbeat code so that duped fd is almost sure @@ -1178,7 +1334,7 @@ Changes to 1.37.14: by a user. 26Apr05 - Apply Tru64 patch supplied by Pascal Pederiva -- Apply Unicode fixes for Win32 from "Thorsten Engel" +- Apply Unicode fixes for Win32 from 'Thorsten Engel' - More work on Python read feature in FD. 22Apr05 @@ -1346,21 +1502,21 @@ Changes to 1.37.6: - Fix scanf of PoolId in catreq to handle 64 bit Ids. 10Mar05 - Add new ua_update.c file and move update_cmd there. -- Modify "update slots" to obtain actual number of slots. +- Modify 'update slots' to obtain actual number of slots. - Tweak autochanger code to handle new slots request. - Modify autochanger code to lock/unlock around slots and update slots code. 09Mar05 - Patch the FD so that it does not issue an error message if it attempts to restore the permissions on a Win32 drive. -- Edit "Resource-name" (physical-name) for the device name +- Edit 'Resource-name' (physical-name) for the device name everywhere in the SD. - Remove .linked.tex files in preparation for cutover to using .tex in place of .wml. 08Mar05 - Copy latest config.sub and config.guess from autoconf. - Try new way of identifying drives with: - "resource-name" (physical-name) + 'resource-name' (physical-name) More work need to a complete conversion. 07Mar05 - Rework some of the autochanger data so that the DIR has @@ -1375,7 +1531,7 @@ Changes to 1.37.6: - Force all the Media Type records of all devices in an Autochanger to be the same. 06Mar05 -- Add new "run" command to Job resource in DIR. This permits +- Add new 'run' command to Job resource in DIR. This permits cloning a job as many times as you want. - Pass PoolId to SD on Query request. It is now used in the Find_media catalog request. @@ -1441,7 +1597,7 @@ Changes to 1.37.4: attempt to fix a bug report. 23Feb05 - Corrected SunOs to SunOS in btraceback (user submitted). -- Applied patch from Roger Haa¥kansson +- Applied patch from Roger Haakansson to warn the user of defective AWKs during ./configure. 20Feb05 - Add some changes submitted by a user for HP client build. @@ -1496,7 +1652,7 @@ Changes to 1.37.3: 15Feb05 - Fix Media LabelDate and FirstWritten to be correctly set. - Fix deadlock in multiple simultaneous jobs. -- Fix tape "truncation"/"number of files" after restore bug. +- Fix tape 'truncation'/'number of files' after restore bug. 10Feb05 - Ensure that correct error messages are returned when reading an ANSI label. @@ -1552,7 +1708,7 @@ Changes to 1.37.3: boot correctly. - Implement ANSI labels -- not yet tested. This required changes to DB format. No upgrade script yet. - Note, more work needed to modify "update" command to handle + Note, more work needed to modify 'update' command to handle changing label types, also must restrict volume name lengths to 6 characters. - Add new Device, Storage, and MediaType records to DB. No @@ -1568,7 +1724,7 @@ Changes to 1.37.3: a single alist, and imply sending data to each Storage daemon simultaneously. - Implement Device query command between DIR and SD. -- Allow DIR to "reserve" a Device. It will then be acquired +- Allow DIR to 'reserve' a Device. It will then be acquired when the FD connects to the SD. - Turn all DIR resources into classes, and implement a few class methods -- more to come. @@ -1698,7 +1854,7 @@ Changes to 1.37.2: - Remove duplicate code from chksum.h (mentioned by Preben). 13Dec04 - Integrate Tim Oberfoell patch to ACLs - to handle both the "standard" and "default" ACLs. + to handle both the 'standard' and 'default' ACLs. 12Dec04 - Integrated Preben 'Peppe' Guldberg three cleanup patches (btest, verify, find). @@ -1751,7 +1907,7 @@ Changes to 1.37.2: - Add python 2.3 to config search list (user submitted patch) - Add JobStatus to Python variables. 28Nov04 -- Add "python restart" command in Console. +- Add 'python restart' command in Console. - Make built-in variables table driven. - First cut of Python Events for Bacula. Director only. StartJob, EndJob, NewVolume events. @@ -1768,7 +1924,7 @@ Changes to 1.37.*: 19Oct05 - configure: add check for dd, remove check for df - block.c:do_dvd_size_checks: Check we are writing to a dvd before doing tests - (reported by David Raine on the list, "[Bacula-users] LTO drive - End Of Volume error"). + (reported by David Raine on the list, '[Bacula-users] LTO drive - End Of Volume error'). - Update bacula-sd.conf.in to use dvd-handler correctly. - dvd.c:dvd_write_part: Increase timeout when writing the first part (see the code for more details). @@ -1782,7 +1938,7 @@ Changes to 1.37.*: 16Oct05 - Remove scripts/dvd-freespace and scripts/dvd-writepart, as they are now merged into scripts/dvd-handler. Note: Documentation needs to be updated. - - scripts/dvd-handler: "zero" brand-new DVD+/-RW to fix a problem with some + - scripts/dvd-handler: 'zero' brand-new DVD+/-RW to fix a problem with some DVD-writers, thanks to Arno Lehmann for reporting this, and providing the way to fix it. - new scripts/dvd-handler. Note: it also needs a patched version of dvd+rw-tools. @@ -1815,7 +1971,7 @@ Changes to 1.37.*: been adapted. - Remove set_exit_on_error function 07Apr05 - - Fix "unknown device type" problem with DVD devices. + - Fix 'unknown device type' problem with DVD devices. - Fix crash when there is no media in the DVD drive. 09Jan05 - Update the documentation and ReleaseNotes. @@ -1848,5 +2004,5 @@ Changes to 1.37.*: 29Dec04 - Add VolParts field in Media table - Add MaximumPartSize directive in Device (SD configuration file) - - File Volumes can now be splitted in multiple files ("parts") - - Fix SQL error in sql_list while doing "llist jobmedia" + - File Volumes can now be splitted in multiple files ('parts') + - Fix SQL error in sql_list while doing 'llist jobmedia' diff --git a/bacula/Makefile.in b/bacula/Makefile.in index 64042e8390..d4d60707d0 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -4,6 +4,8 @@ @MCOMMON@ working_dir=@working_dir@ +dir_group=@dir_group@ +dir_user=@dir_user@ srcdir = @srcdir@ VPATH = @srcdir@ @@ -88,6 +90,10 @@ installdirs: $(MKDIR) $(DESTDIR)$(sysconfdir) $(MKDIR) $(DESTDIR)$(scriptdir) $(MKDIR) $(DESTDIR)$(working_dir) + if test "x$(dir_user)" != "x" ; then \ + chown -f $(dir_user) $(DESTDIR)$(working_dir); fi + if test "x$(dir_group)" != "x" ; then \ + chown -f :$(dir_group) $(DESTDIR)$(working_dir); fi # $(MKDIR) $(DESTDIR)$(mandir) gnomedirs: diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index e4346a291a..09a0a9ca77 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -1,10 +1,264 @@ - Release Notes for Bacula 1.38.3 + Release Notes for Bacula 1.38.7 - Bacula code: Total files = 424 Total lines = 140,955 (*.h *.c *.in) + Bacula code: Total files = 419 Total lines = 137,078 (*.h *.c *.in) 20,440 additional lines of code since version 1.36.3 -Changes to 1.38.3: +!!!! Important !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + In Bacula version 1.38.5 and prior, there was apparently a + compiler bug that caused the Storage daemon to seg fault. + I have applied a workaround in version 1.38.6 and greater that + seems to work. If you experience problems, follow the instructions + below. + + If you are compiling for a 64 bit machine, you need to ensure + that the code is compiled with the -O0 (- oh zero) option otherwise + the SD will crash on most all operations -- apparently due to + a compiler bug in gcc's 64 bit code generation. +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +New features: +- For autochanger get Scratch tape if in autochanger if + no appendable Volumes are available. +- New virtual disk autochanger. See scripts/disk-changer for + documentation. +- New optional Device resource directive in SD. 'Device Type =', + which may have types: File, DVD, Tape, or FIFO. This can + be useful for writing DVDs on FreeBSD where Bacula cannot + correctly detect the DVD. +- Faster restore tree building and uses less memory. +- The command line keyword job (or jobname) now refers to the + name of the job specified in the Job resource; jobid refers + as before to the non-unique numeric jobid; and ujobid refers + to the unique job identification that Bacula creates for each + job. +- The job report for Backups has a few more user friendly ways + of displaying the information. +- The wait command can now be made to wait for jobids. +- New command line keywords are permitted in update volume. They + are Inchanger=yes/no, slot=nn. +- Add two new console commands: enable job= and + disable job=. When a job is disabled, it will not + be started by the scheduler. If you disable a job and restart + Bacula or reload the .conf file, the job will be re-enabled. +- Add a new Job resource directive "enable = yes|no". +- There is a new program named regex in the tools directory that + allows you to try regular expressions on your system. + +Major bug fixes: +- Fix race condition in multiple-drive autochangers where + both drives want the same Volume. +- Do not allow opening default catalog for restricted console + if it is not in ACL. +- Writable FIFOs now work for restore. +- ACLs are now checked in all dot commands. +- Multiple drive autochangers and multiple different autochangers + should now work correctly (no race conditions for Volume names, + update slots use correct StorageId). +- Fix bug where drive was always reserved if a restore job failed + while in the reservation process. + + +Minor bug fixes: +- See below: + +Release 1.38.6-1 (05Apr06) released +- Remove timed wait for VSS on Win2K3 as it is not yet + implemented. +- Correct bacula.in script to reference bacula-ctl-xx in the + sysconfig directory rather than the bin directory. + +Release 1.38.6 (28Mar06) released 29Mar06 +28Mar06 +- Back port from 1.39 fixes to lib/jcr.c to use foreach_jcr() + and new jcr chain locking. +26Mar06 +- Fix a long standing bug in the bacula start/stop scripts. +- Attempt to add the new bacula-ctl-* files to the rpm. +- Switch to using typeof() for list traversing to avoid + as many FC5 g++ compiler warnings as possible. +25Mar06 +- Split the bacula start/start script into four files: + bacula -- starts and stops calling other scripts + bacula-ctl-dir -- starts/stops the director + bacula-ctl-fd -- starts/stops the File daemon + bacula-ctl-sd -- starts/stops the Storage daemon +- Create datestyle fix for PostgreSQL. Fixes bug #574. +- Correct editing of JobId from int to int64 in fd_cmds.c +- Eliminate FileSet name race with bash_spaces() and multiple + threads by bashing in a local. +- Fix error return from 'use storage' to print a correct error + message rather than nothing. +- Correct false re-read last block error message when two jobs + are simultaneously writing at the end of a tape. +- Simplify exit conditions in the reserve.c code to avoid + possible non-release of reservation_lock(). +- Suffle lock order in reserve to avoid deadlock between + reservation lock and device mutex. +- Add Thorsten's VSS timeout code to 1.38 branch. +- Initialize jcr mutex before first use. Thanks to Thorsten for + tracking this down for me !!!! as it broke the Win32 build. +- Integrate addition of line count limitation to bsmtp -l from + Sebastian Stark +- Implement regex test program in tools directory. +- Attempt to fix time problem with bsmtp with foreign langs. +- Add strip_trailing_newline() submitted by user. + +Release 1.38.6 beta6 16Mar06 +- Fix bug #537 to allow arbitrary time to mount a volume for + restore, if polling is turned on. +- Disallow multiple storage specifications for a job. Should fix Arno's + problem. +- Add back a missing store of poolid in jr.poolid. +- If dir_user or dir-group is specified in ./configure apply it to + the working-dir. Fixes bug #533. +- If rescheduling a job cancel the previous incarnation with the SD. + Fixes bugs #566 and 557. +- Fix bug #567 do_message() definition type conflict. + +Release 1.38.6 beta5 14Mar06 +- Add more jcr methods and make mutex and use_count private. +- Create lock/unlock methods for jcr. +- Fix PostgreSQL bug doing sql_data_seeek() by explicitly reading + records to get to seek position. +- Integrate patch from bug #561 to correct conio.c signal definitions. +- Fix Rescheduling failed Jobs. Ensure that SD message thread + terminates correctly by doing pthread_kill(). Do not destroy + SD cond wait variable between executions of the job. Use local + mutex for cond variable to avoid blocking jcr chain. Fix poor + use of jcr use count in jobq.c for restarted jobs. +- Fix obsolete usage of foreach_dlist() to use foreach_jcr() in + lib/jcr.c -- prevents locking the jcr chaing. +- Apply patch from bug #564, which corrects listing volumes with + multiple autochangers. Apply same fix to next volume list. +- Fix bug #562 where restore bootstrap file is not unique. +- Use new routine lock_reservations() to lock the reservations + system, and call it while looking for a volume in askdir.c. + This could possibly fix bug #543. +- Stop SD command loop if job is canceled. + +Release 1.38.6 beta3 4Mar06 +04Mar06 +- The po files should now be current. +- Fix new sql_use_result() code to properly release the + buffers in all cases. +- Convert to using new Python class definitons with (object). +- Use the keyword ujobid to mean the unique job id; job or jobname + to mean the Job name given on the Name directive, and jobid to + be the numeric (non-unique) job id. +- Allow listing by any of the above. +- Add the user friendly job report code for reporting job elapsed time + and rates with suffexes. +- Add Priority and JobLevel as Python settable items. +- Use TEMPORARY table creation where the table is created by + Bacula. +- Add new code submitted by Eric for waiting on specific jobid. +- Add ACL checking for the dot commands. +- Fix restore of writable FIFOs. +- Fix a bug in bpipe where the string was freed too early. + +26Feb06 +- Fix bug reported by Arno listing blocks with bls +- Update the po files at Eric's request. + +Release 1.38.6-beta2 25Feb06 +25Feb06 +- Add sql_use_result() define. + +Changes to 1.38.6-beta1 +- Don't open default catalog if not in ACL. +- Add virtual disk autochanger code. +- Add user supplied bug fix to make two autochangers work + correctly using StorageId with InChanger checks. +- Correct new/old_jcr confusion in copy_storage(). +- Remove & from Job during scan in msgchan.c -- probably + trashed the stack. +- When getting the next Volume if no Volume in Append mode + exists and we are dealing with an Autochanger, search + for a Scratch Volume. +- Check for missing value in dot commands -- bug fix. +- Fix bug in update barcodes command line scanning. +- Make sure Pool Max Vols is respected. +- Check that user supplied a value before referencing + it in restore -- pointed out by Karl Hakimian. +- Add Karl Hakimian's table insert code. +- Don't ask user to select a specific Volume when + updating all volumes in a Pool. +- Remove reservation if set for read when removing dcr. +- Lock code that requests next appendable volume so that + two jobs to get the same Volume at the same time. +- Add new Device Type = xxx code. Values are file, tape, + dvd, and fifo. +- Preserve certain modes (ST_LABEL|ST_APPEND|ST_READ) across + a re-open to change read/write permission on a device. +- Correct a misplaced double quote in certain autochanger + scripts. +- Make make_catalog_backup.in a bit more portable. +- Implement Karl Hakimian's sql_use_result(), which speeds + up restore tree building and reduces the memory load. +- Correct a number of minor bugs in getting a Volume from + the Scratch Pool. +- Implement additional command line options for update Volume. +- Don't require user to enter a Volume name when updating + all Volumes in a pool. + +Release 1.38.5 released 19Jan06: +- Apply label barcodes fix supplied by Rudolf Cejka. +- Modify standard rpm installation to set SD group to disk + so that SD will by default have access to tape drives. +- Allow users to specify user/group and start options + for each daemon in /etc/sysconf/bacula file. + +Changes to 1.38.4 released 17Jan06: +- The main changes are to the Director and the Storage daemon, + thus there is no need to update your File daemons. Just the + same, I do recommend running with the release 1.38.3 Win32 + FD or later. +- Add two new queries to query.sql provided by Arno. One + list volumes known to the Storage device, and the other + lists volumes possibly needing replacement (error, ...). +- Add periodic (every 24 hours) garbage collection of memory + pool by releasing free buffers. +- Correct bug counting sized (for display only) in smartall.c +- Print FD mempool stats if debug > 0 rather than 5. +- Correct bug in alist.c that re-allocated the list if the + number of items goes to zero. +- Move the reservation system thread locking to the top level + so that one job at a time tries all possible drives before + waiting. +- Implement a reservation 'fail' message queue that is built + and destroyed on each pass through the reservation system. + These messages are displayed in a 'Jobs waiting to reserve + a drive' list during a 'status storage='. Note, multiple + messages will generally print for each JobId because they + represent the different problems with either the same drive + or different drives. If this output proves too confusing + of voluminous, I will display it only when debug level 1 + or greater is enabled in the SD. +- Add enable/disable job=. This command prevents + the specified job from being scheduled. Even when disabled, + the job can be manually started from the console. +- During 'update slots' clear all InChanger flags where the + StorageId is zero (old Media records). +- Fix autochanger code to strip leading spaces from returned + slots number. Remove bc from chio-changer. +- Back port a bit of 1.39 crypto code to reduce diffs. +- Fix first call to autochanger that missed close()ing the + drive. Put close() just before each run_program(). Fixes + Arno's changer bug. +- Add PoolId to Job record when updating it at job start time. +- Pull in more code from 1.39 so that there are fewer file + differences (the new ua_dotcmds.c, base64.h, crypto.h + hmac.c jcr.c (dird and lib) lib.h md5.h parse_conf.c + util.c. Aside from ua_dotcmds.c these are mostly crypto + upgrades. +- Implement new method of walking the jcr chain. The + incr/dec of the use_count is done within the walking + routines. This should prevent a jcr from being freed + from under the walk routines. + + +Changes to 1.38.3 released 05Jan06: - This is mainly a bug release fix. In addition, the multiple drive reservation algorithm has been rewritten. - In addition, the method of handling waiting for tapes to be @@ -13,7 +267,7 @@ Changes to 1.38.3: - Simplify code in askdir.c that waits for creating an appendable volume so that it can handle multiple returns from the wait code. - Modify the wait code to permit multiple returns. -- Return a zero when "autochanger drives" is called and +- Return a zero when 'autochanger drives' is called and it is not an autochanger. - Make rewind_dev() a method taking a DCR as an argument. This permits closing and reopening the drive if the @@ -88,9 +342,9 @@ Changes to 1.38.3: at the same time. - Apply days keyword patch from Alexander.Bergolth at wu-wien.ac.at If this patch is applied, the number of days can be specified with - "list nextvol days=xx" + 'list nextvol days=xx' or - "status dir days=xx" + 'status dir days=xx' My use case is to be able to preview the next scheduled job (and the next tape to be used) on fridays if there are no scheduled jobs during the weekend. @@ -183,7 +437,7 @@ Major Changes in 1.38: - Volume Shadow Copy support for Win32 thus the capability to backup exclusively opened files (thanks to Thorsten Engel). A VSS enabled Win32 FD is available. You must explicitly - turn on VSS with "Enable VSS = yes" in your FileSet resource. + turn on VSS with 'Enable VSS = yes' in your FileSet resource. - New manual format with an index (thanks to Karl Cunningham). - New Web site format (thanks to Michael Scherer). - SQLite3 support. @@ -194,13 +448,13 @@ Major Changes in 1.38: in native languages. Thanks to Nicolas Boichat. New Directives: -- New Job directive "Prefer Mounted Volumes = yes|no" causes the +- New Job directive 'Prefer Mounted Volumes = yes|no' causes the SD to select either an Autochanger or a drive with a valid Volume already mounted in preference. If none is available, it will select the first available drive. - New Run directive in Job resource of DIR. It permits cloning of jobs. To clone a copy of the current job, use - Run = "job-name level=%l since=\"%s\"" + Run = 'job-name level=%l since=\'%s\'' Note, job-name is normally the same name as the job that is running but there is no restriction on what you put. If you want to start the job by hand and use job overrides such as @@ -288,7 +542,7 @@ New Directives: of the manual. New Commands: -- "python restart" restarts the Python interpreter. Rather brutal, make +- 'python restart' restarts the Python interpreter. Rather brutal, make sure no Python scripts are running. This permits you to change a Python script and get Bacula to use the new script. @@ -302,11 +556,11 @@ Items to note!!! - The Storage daemon now keeps track of what tapes it is using (was not the case in 1.36.x). This means that you must be much more careful when removing tapes and putting up a new one. In - general, you should always do a "unmount" prior to removing a - tape, and a "mount" after putting a new one into the drive. + general, you should always do a 'unmount' prior to removing a + tape, and a 'mount' after putting a new one into the drive. - If you use an Autochanger, you MUST update your SD conf file to use the new Autochanger resource. Otherwise, certain commands - such as "update slots" may not work. + such as 'update slots' may not work. - You must add --with-python=[DIR] to the configure command line if you want Python support. Python 2.2, 2.3 and 2.4 should be automatically detected if in the standard place. @@ -340,7 +594,7 @@ Items to note!!! compiling. -Other Items: +Other Items Fixed: - Security fixes for temp files created in mtx-changer, during ./configure, and during making of Rescue disk. - A new script, dvd-handler, in the scripts directory, @@ -351,7 +605,7 @@ Other Items: /patches/dvd+rw-tools-5.21.4.10.8.bacula.patch You must have Python installed to run the scripts. - Part files support: File volumes can now be split into multiple - files, called "parts". + files, called 'parts'. - For the details of the Python scripting support, please see the new Python Scripting chapter in the manual. - The default user/group for the Director and Storage daemon installed diff --git a/bacula/autoconf/config.h.in b/bacula/autoconf/config.h.in index 87af24d6af..89a173a392 100644 --- a/bacula/autoconf/config.h.in +++ b/bacula/autoconf/config.h.in @@ -271,9 +271,6 @@ /* Set if Bacula conio support enabled */ #undef HAVE_CONIO -/* Define if encryption support should be enabled */ -#undef HAVE_CRYPTO - /* Define to 1 if you have the header file. */ #undef HAVE_CURSES_H @@ -513,9 +510,6 @@ /* Define to 1 if you have the `setsid' function. */ #undef HAVE_SETSID -/* Define if the SHA-2 family of digest algorithms is available */ -#undef HAVE_SHA2 - /* Define to 1 if you have the `signal' function. */ #undef HAVE_SIGNAL diff --git a/bacula/autoconf/configure.in b/bacula/autoconf/configure.in index 984b356e95..4a0ca2197b 100644 --- a/bacula/autoconf/configure.in +++ b/bacula/autoconf/configure.in @@ -193,7 +193,6 @@ support_conio=yes support_gnome=no support_wx_console=no support_tls=no -support_crypto=no gnome_version= wx_version= support_static_tools=no @@ -752,34 +751,19 @@ if test "x$with_openssl_directory" != "x"; then AC_TRY_LINK([ #include ], [ CRYPTO_set_id_callback(NULL); ], - [ - support_tls="yes" - support_crypto="yes" - ], + [ support_tls="yes" ], [ support_tls="no" ] ) - AC_TRY_LINK([ #include ], - [ EVP_sha512(); ], - [ ac_cv_openssl_sha2="yes" ], - [ ac_cv_openssl_sha2="no" ] - ) - LIBS="$saved_LIBS" CFLAGS="$saved_CFLAGS" if test "$support_tls" = "yes"; then AC_DEFINE(HAVE_OPENSSL, 1, [Define if OpenSSL library is available]) AC_DEFINE(HAVE_TLS, 1, [Define if TLS support should be enabled]) - AC_DEFINE(HAVE_CRYPTO, 1, [Define if encryption support should be enabled]) - fi - - if test "$ac_cv_openssl_sha2" = "yes"; then - AC_DEFINE(HAVE_SHA2, 1, [Define if the SHA-2 family of digest algorithms is available]) fi else support_tls="no" - support_crypto="no" OPENSSL_LIBS="" OPENSSL_INC="" fi @@ -1921,6 +1905,9 @@ AC_OUTPUT([autoconf/Make.common \ scripts/bconsole \ scripts/gconsole \ scripts/bacula \ + scripts/bacula-ctl-dir \ + scripts/bacula-ctl-fd \ + scripts/bacula-ctl-sd \ scripts/devel_bacula \ scripts/Makefile \ scripts/logrotate \ @@ -1997,7 +1984,6 @@ AC_OUTPUT([autoconf/Make.common \ src/cats/drop_bacula_tables \ src/cats/drop_bacula_database \ src/findlib/Makefile \ - src/pygtk-console/Makefile \ src/tools/Makefile \ src/win32/winbacula.nsi \ src/win32/baculafd/bacula-fd.conf \ @@ -2132,7 +2118,6 @@ Configuration on `date`: readline support: ${got_readline} ${PRTREADLINE_SRC} TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS} TLS support: ${support_tls} - Encryption support: ${support_crypto} ZLIB support: ${have_zlib} enable-smartalloc: ${support_smartalloc} enable-gnome: ${support_gnome} ${gnome_version} diff --git a/bacula/configure b/bacula/configure index 6adc9896de..68d7f60b06 100755 --- a/bacula/configure +++ b/bacula/configure @@ -12770,7 +12770,6 @@ support_conio=yes support_gnome=no support_wx_console=no support_tls=no -support_crypto=no gnome_version= wx_version= support_static_tools=no @@ -15881,64 +15880,13 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - - support_tls="yes" - support_crypto="yes" - + support_tls="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 support_tls="no" -fi -rm -f conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - #include -int -main () -{ - EVP_sha512(); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_openssl_sha2="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_openssl_sha2="no" - fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -15957,23 +15905,9 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_TLS 1 _ACEOF - -cat >>confdefs.h <<\_ACEOF -#define HAVE_CRYPTO 1 -_ACEOF - - fi - - if test "$ac_cv_openssl_sha2" = "yes"; then - -cat >>confdefs.h <<\_ACEOF -#define HAVE_SHA2 1 -_ACEOF - fi else support_tls="no" - support_crypto="no" OPENSSL_LIBS="" OPENSSL_INC="" fi @@ -29834,7 +29768,7 @@ if test "x${subsysdir}" = "x${sbindir}" ; then exit 1 fi - ac_config_files="$ac_config_files autoconf/Make.common Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/pygtk-console/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf src/win32/wx-console/wx-console.conf src/win32/pebuilder/Makefile po/Makefile.in $PFILES" + ac_config_files="$ac_config_files autoconf/Make.common Makefile scripts/startmysql scripts/stopmysql scripts/btraceback scripts/startit scripts/stopit scripts/bconsole scripts/gconsole scripts/bacula scripts/bacula-ctl-dir scripts/bacula-ctl-fd scripts/bacula-ctl-sd scripts/devel_bacula scripts/Makefile scripts/logrotate scripts/bacula.desktop.gnome1 scripts/bacula.desktop.gnome2 scripts/bacula.desktop.gnome1.consolehelper scripts/bacula.desktop.gnome2.consolehelper scripts/bacula.desktop.gnome1.xsu scripts/bacula.desktop.gnome2.xsu scripts/gnome-console.console_apps scripts/mtx-changer scripts/disk-changer scripts/dvd-handler scripts/bacula-tray-monitor.desktop scripts/logwatch/Makefile scripts/logwatch/logfile.bacula.conf src/Makefile src/host.h src/console/Makefile src/console/bconsole.conf src/gnome2-console/Makefile src/gnome2-console/gnome-console.conf src/wx-console/Makefile src/wx-console/wx-console.conf src/tray-monitor/Makefile src/tray-monitor/tray-monitor.conf src/dird/Makefile src/dird/bacula-dir.conf src/lib/Makefile src/stored/Makefile src/stored/bacula-sd.conf src/filed/Makefile src/filed/bacula-fd.conf src/filed/win32/Makefile src/cats/Makefile src/cats/make_catalog_backup src/cats/delete_catalog_backup src/cats/create_postgresql_database src/cats/update_postgresql_tables src/cats/make_postgresql_tables src/cats/grant_postgresql_privileges src/cats/drop_postgresql_tables src/cats/drop_postgresql_database src/cats/create_mysql_database src/cats/update_mysql_tables src/cats/make_mysql_tables src/cats/grant_mysql_privileges src/cats/drop_mysql_tables src/cats/drop_mysql_database src/cats/create_sqlite_database src/cats/update_sqlite_tables src/cats/make_sqlite_tables src/cats/grant_sqlite_privileges src/cats/drop_sqlite_tables src/cats/drop_sqlite_database src/cats/create_sqlite3_database src/cats/update_sqlite3_tables src/cats/make_sqlite3_tables src/cats/grant_sqlite3_privileges src/cats/drop_sqlite3_tables src/cats/drop_sqlite3_database src/cats/sqlite src/cats/mysql src/cats/create_bdb_database src/cats/update_bdb_tables src/cats/make_bdb_tables src/cats/grant_bdb_privileges src/cats/drop_bdb_tables src/cats/drop_bdb_database src/cats/create_bacula_database src/cats/update_bacula_tables src/cats/grant_bacula_privileges src/cats/make_bacula_tables src/cats/drop_bacula_tables src/cats/drop_bacula_database src/findlib/Makefile src/tools/Makefile src/win32/winbacula.nsi src/win32/baculafd/bacula-fd.conf src/win32/Makefile src/win32/console/bconsole.conf src/win32/wx-console/wx-console.conf src/win32/pebuilder/Makefile po/Makefile.in $PFILES" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -30387,6 +30321,9 @@ do "scripts/bconsole" ) CONFIG_FILES="$CONFIG_FILES scripts/bconsole" ;; "scripts/gconsole" ) CONFIG_FILES="$CONFIG_FILES scripts/gconsole" ;; "scripts/bacula" ) CONFIG_FILES="$CONFIG_FILES scripts/bacula" ;; + "scripts/bacula-ctl-dir" ) CONFIG_FILES="$CONFIG_FILES scripts/bacula-ctl-dir" ;; + "scripts/bacula-ctl-fd" ) CONFIG_FILES="$CONFIG_FILES scripts/bacula-ctl-fd" ;; + "scripts/bacula-ctl-sd" ) CONFIG_FILES="$CONFIG_FILES scripts/bacula-ctl-sd" ;; "scripts/devel_bacula" ) CONFIG_FILES="$CONFIG_FILES scripts/devel_bacula" ;; "scripts/Makefile" ) CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "scripts/logrotate" ) CONFIG_FILES="$CONFIG_FILES scripts/logrotate" ;; @@ -30463,7 +30400,6 @@ do "src/cats/drop_bacula_tables" ) CONFIG_FILES="$CONFIG_FILES src/cats/drop_bacula_tables" ;; "src/cats/drop_bacula_database" ) CONFIG_FILES="$CONFIG_FILES src/cats/drop_bacula_database" ;; "src/findlib/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/findlib/Makefile" ;; - "src/pygtk-console/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/pygtk-console/Makefile" ;; "src/tools/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/tools/Makefile" ;; "src/win32/winbacula.nsi" ) CONFIG_FILES="$CONFIG_FILES src/win32/winbacula.nsi" ;; "src/win32/baculafd/bacula-fd.conf" ) CONFIG_FILES="$CONFIG_FILES src/win32/baculafd/bacula-fd.conf" ;; @@ -31606,7 +31542,6 @@ Configuration on `date`: readline support: ${got_readline} ${PRTREADLINE_SRC} TCP Wrappers support: ${TCPW_MSG} ${WRAPLIBS} TLS support: ${support_tls} - Encryption support: ${support_crypto} ZLIB support: ${have_zlib} enable-smartalloc: ${support_smartalloc} enable-gnome: ${support_gnome} ${gnome_version} diff --git a/bacula/examples/python/DirStartUp.py b/bacula/examples/python/DirStartUp.py index 5433ad8b87..a6f3995600 100644 --- a/bacula/examples/python/DirStartUp.py +++ b/bacula/examples/python/DirStartUp.py @@ -7,7 +7,7 @@ import sys, bacula # This is the list of Bacula daemon events that you # can receive. -class BaculaEvents: +class BaculaEvents(object): def __init__(self): # Called here when a new Bacula Events class is # is created. Normally not used @@ -43,7 +43,7 @@ bacula.set_events(BaculaEvents()) # register daemon events desired """ There are the Job events that you can receive. """ -class JobEvents: +class JobEvents(object): def __init__(self): # Called here when you instantiate the Job. Not # normally used diff --git a/bacula/examples/python/FDStartUp.py b/bacula/examples/python/FDStartUp.py index 0c274c8c0f..4d53e33bfc 100644 --- a/bacula/examples/python/FDStartUp.py +++ b/bacula/examples/python/FDStartUp.py @@ -6,7 +6,7 @@ import sys, bacula # This is the list of Bacula daemon events that you # can receive. -class BaculaEvents: +class BaculaEvents(object): def __init__(self): # Called here when a new Bacula Events class is # is created. Normally not used @@ -44,7 +44,7 @@ bacula.set_events(BaculaEvents()) # register daemon events desired """ There are the Job events that you can receive. """ -class JobEvents: +class JobEvents(object): def __init__(self): # Called here when you instantiate the Job. Not # normally used diff --git a/bacula/examples/python/SDStartUp.py b/bacula/examples/python/SDStartUp.py index 8430e4f1ce..1f08beda4c 100644 --- a/bacula/examples/python/SDStartUp.py +++ b/bacula/examples/python/SDStartUp.py @@ -6,7 +6,7 @@ import sys, bacula # This is the list of Bacula daemon events that you # can receive. -class BaculaEvents: +class BaculaEvents(object): def __init__(self): # Called here when a new Bacula Events class is # is created. Normally not used @@ -45,7 +45,7 @@ bacula.set_events(BaculaEvents()) # register daemon events desired """ There are the Job events that you can receive. """ -class JobEvents: +class JobEvents(object): def __init__(self): # Called here when you instantiate the Job. Not # normally used diff --git a/bacula/examples/recover.pl b/bacula/examples/recover.pl new file mode 100755 index 0000000000..fe6e946743 --- /dev/null +++ b/bacula/examples/recover.pl @@ -0,0 +1,2886 @@ +#!/usr/bin/perl -w + +=head1 NAME + +recover.pl - a script to provide an interface for restore files similar +to Legatto Networker's recover program. + +=cut + +use strict; +use Getopt::Std; +use DBI; +use Term::ReadKey; +use Term::ReadLine; +use Fcntl ':mode'; +use Time::ParseDate; +use Date::Format; +use Text::ParseWords; + +# Location of config file. +my $CONF_FILE = "$ENV{HOME}/.recoverrc"; +my $HIST_FILE = "$ENV{HOME}/.recover.hist"; + +######################################################################## +### Queries needed to gather files from directory. +######################################################################## + +my %queries = ( + 'postgres' => { + 'dir' => + "( + select + distinct on (name) + Filename.name, + Path.path, + File.lstat, + File.fileid, + File.fileindex, + Job.jobtdate - ? as visible, + Job.jobid + from + Path, + File, + Filename, + Job + where + clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + Path.path = ? and + File.pathid = Path.pathid and + Filename.filenameid = File.filenameid and + Filename.name != '' and + File.jobid = Job.jobid + order by + name, + jobid desc + ) + union + ( + select + distinct on (name) + substring(Path.path from ? + 1) as name, + substring(Path.path from 1 for ?) as path, + File.lstat, + File.fileid, + File.fileindex, + Job.jobtdate - ? as visible, + Job.jobid + from + Path, + File, + Filename, + Job + where + clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + File.jobid = Job.jobid and + Filename.name = '' and + Filename.filenameid = File.filenameid and + File.pathid = Path.pathid and + Path.path ~ ('^' || ? || '[^/]*/\$') + order by + name, + jobid desc + ) + order by + name + ", + 'sel' => + "( + select + distinct on (name) + Path.path || Filename.name as name, + File.fileid, + File.lstat, + File.fileindex, + Job.jobid + from + Path, + File, + Filename, + Job + where + clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + Job.jobtdate >= ? and + Path.path like ? || '%' and + File.pathid = Path.pathid and + Filename.filenameid = File.filenameid and + Filename.name != '' and + File.jobid = Job.jobid + order by + name, jobid desc + ) + union + ( + select + distinct on (name) + Path.path as name, + File.fileid, + File.lstat, + File.fileindex, + Job.jobid + from + Path, + File, + Filename, + Job + where + clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + Job.jobtdate >= ? and + File.jobid = Job.jobid and + Filename.name = '' and + Filename.filenameid = File.filenameid and + File.pathid = Path.pathid and + Path.path like ? || '%' + order by + name, jobid desc + ) + ", + 'cache' => + "select + distinct on (path, name) + Path.path, + Filename.name, + File.fileid, + File.lstat, + File.fileindex, + Job.jobtdate - ? as visible, + Job.jobid + from + Path, + File, + Filename, + Job + where + clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + Job.jobtdate >= ? and + File.pathid = Path.pathid and + File.filenameid = Filename.filenameid and + File.jobid = Job.jobid + order by + path, name, jobid desc + ", + 'ver' => + "select + Path.path, + Filename.name, + File.fileid, + File.fileindex, + File.lstat, + Job.jobtdate, + Job.jobid, + Job.jobtdate - ? as visible, + Media.volumename + from + Job, Path, Filename, File, JobMedia, Media + where + File.pathid = Path.pathid and + File.filenameid = Filename.filenameid and + File.jobid = Job.jobid and + File.Jobid = JobMedia.jobid and + File.fileindex >= JobMedia.firstindex and + File.fileindex <= JobMedia.lastindex and + Job.jobtdate <= ? and + JobMedia.mediaid = Media.mediaid and + Path.path = ? and + Filename.name = ? and + Job.clientid = ? and + Job.name = ? + order by job + " + }, + 'mysql' => { + 'dir' => + " + ( + select + distinct(Filename.name), + Path.path, + File.lstat, + File.fileid, + File.fileindex, + Job.jobtdate - ? as visible, + Job.jobid + from + Path, + File, + Filename, + Job + where + clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + Path.path = ? and + File.pathid = Path.pathid and + Filename.filenameid = File.filenameid and + Filename.name != '' and + File.jobid = Job.jobid + group by + name + order by + name, + jobid desc + ) + union + ( + select + distinct(substring(Path.path from ? + 1)) as name, + substring(Path.path from 1 for ?) as path, + File.lstat, + File.fileid, + File.fileindex, + Job.jobtdate - ? as visible, + Job.jobid + from + Path, + File, + Filename, + Job + where + clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + File.jobid = Job.jobid and + Filename.name = '' and + Filename.filenameid = File.filenameid and + File.pathid = Path.pathid and + Path.path rlike concat('^', ?, '[^/]*/\$') + group by + name + order by + name, + jobid desc + ) + order by + name + ", + 'sel' => + " + ( + select + distinct(concat(Path.path, Filename.name)) as name, + File.fileid, + File.lstat, + File.fileindex, + Job.jobid + from + Path, + File, + Filename, + Job + where + Job.clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + Job.jobtdate >= ? and + Path.path like concat(?, '%') and + File.pathid = Path.pathid and + Filename.filenameid = File.filenameid and + Filename.name != '' and + File.jobid = Job.jobid + group by + path, name + order by + name, + jobid desc + ) + union + ( + select + distinct(Path.path) as name, + File.fileid, + File.lstat, + File.fileindex, + Job.jobid + from + Path, + File, + Filename, + Job + where + Job.clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + Job.jobtdate >= ? and + File.jobid = Job.jobid and + Filename.name = '' and + Filename.filenameid = File.filenameid and + File.pathid = Path.pathid and + Path.path like concat(?, '%') + group by + path + order by + name, + jobid desc + ) + ", + 'cache' => + "select + distinct path, + Filename.name, + File.fileid, + File.lstat, + File.fileindex, + Job.jobtdate - ? as visible, + Job.jobid + from + Path, + File, + Filename, + Job + where + clientid = ? and + Job.name = ? and + Job.jobtdate <= ? and + Job.jobtdate >= ? and + File.pathid = Path.pathid and + File.filenameid = Filename.filenameid and + File.jobid = Job.jobid + group by + path, name + order by + path, name, jobid desc + ", + 'ver' => + "select + Path.path, + Filename.name, + File.fileid, + File.fileindex, + File.lstat, + Job.jobtdate, + Job.jobid, + Job.jobtdate - ? as visible, + Media.volumename + from + Job, Path, Filename, File, JobMedia, Media + where + File.pathid = Path.pathid and + File.filenameid = Filename.filenameid and + File.jobid = Job.jobid and + File.Jobid = JobMedia.jobid and + File.fileindex >= JobMedia.firstindex and + File.fileindex <= JobMedia.lastindex and + Job.jobtdate <= ? and + JobMedia.mediaid = Media.mediaid and + Path.path = ? and + Filename.name = ? and + Job.clientid = ? and + Job.name = ? + order by job + " + } +); + +############################################################################ +### Command lists for help and file completion +############################################################################ + +my %COMMANDS = ( + 'add' => '(add files) - Add files recursively to restore list', + 'bootstrap' => 'print bootstrap file', + 'cd' => '(cd dir) - Change working directory', + 'changetime', '(changetime date/time) - Change database view to date', + 'client' => '(client client-name) - change client to view', + 'debug' => 'toggle debug flag', + 'delete' => 'Remove files from restore list.', + 'help' => 'Display this list', + 'history', 'Print command history', + 'info', '(info files) - Print stat and tape information about files', + 'ls' => '(ls [opts] files) - List files in current directory', + 'pwd' => 'Print current working directory', + 'quit' => 'Exit program', + 'recover', 'Create table for bconsole to use in recover', + 'relocate', '(relocate dir) - specify new location for recovered files', + 'show', '(show item) - Display information about item', + 'verbose' => 'toggle verbose flag', + 'versions', '(versions files) - Show all versions of file on tape', + 'volumes', 'Show volumes needed for restore.' +); + +my %SHOW = ( + 'cache' => 'Display cached directories', + 'catalog' => 'Display name of current catalog from config file', + 'client' => 'Display current client', + 'clients' => 'Display clients available in this catalog', + 'restore' => 'Display information about pending restore', + 'volumes' => 'Show volumes needed for restore.' +); + +############################################################################## +### Read config and command line. +############################################################################## + +my %catalogs; +my $catalog; # Current catalog + +## Globals + +my %restore; +my $rnum = 0; +my $rbytes = 0; +my $debug = 0; +my $verbose = 0; +my $rtime; +my $cwd; +my $lwd; +my $files; +my $restore_to = '/'; +my $start_dir; +my $preload; +my $dircache = {}; +my $usecache = 1; + +=head1 SYNTAX + +B [B<-b> I] [B<-c> I B<-j> I] +[B<-i> I] [B<-p>] [B<-t> I] + +B [B<-h>] + +Most of the command line arguments can be specified in the init file +B<$HOME/.recoverrc> (see CONFIG FILE FORMAT below). The command +line arguments will override the options in the init file. If no +I is specified, the first one found in the init file will +be used. + +=head1 DESCRIPTION + +B will read the specified catalog and provide a shell like +environment from which a time based view of the specified client/jobname +and be exampled and selected for restoration. + +The command line option B<-b> specified the DBI compatible connect +script to use when connecting to the catalog database. The B<-c> and +B<-j> options specify the client and jobname respectively to view from +the catalog database. The B<-i> option will set the initial directory +you are viewing to the specified directory. if B<-i> is not specified, +it will default to /. You can set the initial time to view the catalog +from using the B<-t> option. + +The B<-p> option will pre-load the entire catalog into memory. This +could take a lot of memory, so use it with caution. + +The B<-d> option turns on debugging and the B<-v> option turns on +verbose output. + +By specifying a I, the default options for connecting to +the catalog database will be taken from the section of the inti file +specified by that name. + +The B<-h> option will display this document. + +In order for this program to have a chance of not being painfully slow, +the following indexs should be added to your database. + +B + +B + +=cut + +my $vars = {}; +getopts("c:b:hi:j:pt:vd", $vars) || die "Usage: bad arguments\n"; + +if ($vars->{'h'}) { + system("perldoc $0"); + exit; +} + +$preload = $vars->{'p'} if ($vars->{'p'}); +$debug = $vars->{'d'} if ($vars->{'d'}); +$verbose = $vars->{'v'} if ($vars->{'v'}); + +# Set initial time to view the catalog + +if ($vars->{'t'}) { + $rtime = parsedate($vars->{'t'}, FUZZY => 1, PREFER_PAST => 1); +} +else { + $rtime = time(); +} + +my $dbconnect; +my $username = ""; +my $password = ""; +my $db; +my $client; +my $jobname; +my $jobs; +my $ftime; + +my $cstr; + +# Read config file (if available). + +&read_config($CONF_FILE); + +# Set defaults + +$catalog = $ARGV[0] if (@ARGV); + +if ($catalog) { + $cstr = ${catalogs{$catalog}}->{'client'} + if (${catalogs{$catalog}}->{'client'}); + + $jobname = $catalogs{$catalog}->{'jobname'} + if ($catalogs{$catalog}->{'jobname'}); + + $dbconnect = $catalogs{$catalog}->{'dbconnect'} + if ($catalogs{$catalog}->{'dbconnect'}); + + $username = $catalogs{$catalog}->{'username'} + if ($catalogs{$catalog}->{'username'}); + + $password = $catalogs{$catalog}->{'password'} + if ($catalogs{$catalog}->{'password'}); + + $start_dir = $catalogs{$catalog}->{'cd'} + if ($catalogs{$catalog}->{'cd'}); + + $preload = $catalogs{$catalog}->{'preload'} + if ($catalogs{$catalog}->{'preload'} && !defined($vars->{'p'})); + + $verbose = $catalogs{$catalog}->{'verbose'} + if ($catalogs{$catalog}->{'verbose'} && !defined($vars->{'v'})); + + $debug = $catalogs{$catalog}->{'debug'} + if ($catalogs{$catalog}->{'debug'} && !defined($vars->{'d'})); +} + +#### Command line overries config file + +$start_dir = $vars->{'i'} if ($vars->{'i'}); +$start_dir = '/' if (!$start_dir); + +$start_dir .= '/' if (substr($start_dir, length($start_dir) - 1, 1) ne '/'); + +if ($vars->{'b'}) { + $dbconnect = $vars->{'b'}; +} + +die "You must supply a db connect string.\n" if (!defined($dbconnect)); + +if ($dbconnect =~ /^dbi:Pg/) { + $db = 'postgres'; +} +elsif ($dbconnect =~ /^dbi:mysql/) { + $db = 'mysql'; +} +else { + die "Unknown database type specified in $dbconnect\n"; +} + +# Initialize database connection + +print STDERR "DBG: Connect using: $dbconnect\n" if ($debug); + +my $dbh = DBI->connect($dbconnect, $username, $password) || + die "Can't open bacula database\nDatabase connect string '$dbconnect'"; + +die "Client id required.\n" if (!($cstr || $vars->{'c'})); + +$cstr = $vars->{'c'} if ($vars->{'c'}); +$client = &lookup_client($cstr); + +# Set job information +$jobname = $vars->{'j'} if ($vars->{'j'}); + +die "You need to specify a job name.\n" if (!$jobname); + +&setjob; + +die "Failed to set client\n" if (!$client); + +# Prepare our query +my $dir_sth = $dbh->prepare($queries{$db}->{'dir'}) + || die "Can't prepare $queries{$db}->{'dir'}\n"; + +my $sel_sth = $dbh->prepare($queries{$db}->{'sel'}) + || die "Can't prepare $queries{$db}->{'sel'}\n"; + +my $ver_sth = $dbh->prepare($queries{$db}->{'ver'}) + || die "Can't prepare $queries{$db}->{'ver'}\n"; + +my $clients; + +# Initialize readline. +my $term = new Term::ReadLine('Bacula Recover'); +$term->ornaments(0); + +my $readline = $term->ReadLine; +my $tty_attribs = $term->Attribs; + +# Needed for base64 decode + +my @base64_digits = ( + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', + 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', + 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', + 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '+', '/' +); +my @base64_map = (0) x 128; + +for (my $i=0; $i<64; $i++) { + $base64_map[ord($base64_digits[$i])] = $i; +} + +############################################################################## +### Support routines +############################################################################## + +=head1 FILES + +B<$HOME/.recoverrc> Configuration file for B. + +=head1 CONFIG FILE FORMAT + +The config file will allow you to specify the defaults for your +catalog(s). Each catalog definition starts with B<[>IB<]>. +Blank lines and lines starting with # are ignored. + +The first catalog specified will be used as the default catalog. + +All values are specified in I B<=> I format. You can +specify the following Is for each catalog. + +=cut + +sub read_config { + my $conf_file = shift; + my $c; + + # No nothing if config file can't be read. + + if (-r $conf_file) { + open(CONF, "<$conf_file") || die "$!: Can't open $conf_file\n"; + + while () { + chomp; + # Skip comments and blank links + next if (/^\s*#/); + next if (/^\s*$/); + + if (/^\[(\w+)\]$/) { + $c = $1; + $catalog = $c if (!$catalog); + + if ($catalogs{$c}) { + die "Duplicate catalog definition in $conf_file\n"; + } + + $catalogs{$c} = {}; + } + elsif (!$c) { + die "Conf file must start with catalog definition [catname]\n"; + } + else { + + if (/^(\w+)\s*=\s*(.*)/) { + my $item = $1; + my $value = $2; + +=head2 client + +The name of the default client to view when connecting to this +catalog. This can be changed later with the B command. + +=cut + + if ($item eq 'client') { + $catalogs{$c}->{'client'} = $value; + } + +=head2 dbconnect + +The DBI compatible database string to use to connect to this catalog. + +=over 4 + +=item B + +dbi:Pg:dbname=bacula;host=backuphost + +=back + +=cut + elsif ($item eq 'dbconnect') { + $catalogs{$c}->{'dbconnect'} = $value; + } + +=head2 jobname + +The name of the default job to view when connecting to the catalog. This +can be changed later with the B command. + +=cut + elsif ($item eq 'jobname') { + $catalogs{$c}->{'jobname'} = $value; + } + +=head2 password + +The password to use when connecing to the catalog database. + +=cut + elsif ($item eq 'password') { + $catalogs{$c}->{'password'} = $value; + } + +=head2 preload + +Set the preload flag. A preload flag of 1 or on will load the entire +catalog when recover.pl is start. This is a memory hog, so use with +caution. + +=cut + elsif ($item eq 'preload') { + + if ($value =~ /^(1|on)$/i) { + $catalogs{$c}->{'preload'} = 1; + } + elsif ($value =~ /^(0|off)$/i) { + $catalogs{$c}->{'preload'} = 0; + } + else { + die "$value: Unknown value for preload.\n"; + } + + } + +=head2 username + +The username to use when connecing to the catalog database. + +=cut + elsif ($item eq 'username') { + $catalogs{$c}->{'username'} = $value; + } + else { + die "Unknown opton $item in $conf_file.\n"; + } + + } + else { + die "Bad line $_ in $conf_file.\n"; + } + + } + + } + + close(CONF); + } + +} + +sub create_file_entry { + my $name = shift; + my $fileid = shift; + my $fileindex = shift; + my $jobid = shift; + my $visible = shift; + my $lstat = shift; + + print STDERR "DBG: name = $name\n" if ($debug); + print STDERR "DBG: fileid = $fileid\n" if ($debug); + print STDERR "DBG: fileindex = $fileindex\n" if ($debug); + print STDERR "DBG: jobid = $jobid\n" if ($debug); + print STDERR "DBG: visible = $visible\n" if ($debug); + print STDERR "DBG: lstat = $lstat\n" if ($debug); + + my $data = { + fileid => $fileid, + fileindex => $fileindex, + jobid => $jobid, + visible => ($visible >= 0) ? 1 : 0 + }; + + # decode file stat + my @stat = (); + + foreach my $s (split(' ', $lstat)) { + print STDERR "DBG: Add $s to stat array.\n" if ($debug); + push(@stat, from_base64($s)); + } + + $data->{'lstat'} = { + 'st_dev' => $stat[0], + 'st_ino' => $stat[1], + 'st_mode' => $stat[2], + 'st_nlink' => $stat[3], + 'st_uid' => $stat[4], + 'st_gid' => $stat[5], + 'st_rdev' => $stat[6], + 'st_size' => $stat[7], + 'st_blksize' => $stat[8], + 'st_blocks' => $stat[9], + 'st_atime' => $stat[10], + 'st_mtime' => $stat[11], + 'st_ctime' => $stat[12], + 'LinkFI' => $stat[13], + 'st_flags' => $stat[14], + 'data_stream' => $stat[15] + }; + + # Create mode string. + my $sstr = &mode2str($stat[2]); + $data->{'lstat'}->{'statstr'} = $sstr; + return $data; +} +# Read directory data, return hash reference. + +sub fetch_dir { + my $dir = shift; + + return $dircache->{$dir} if ($dircache->{$dir}); + + print "$dir not cached, fetching from database.\n" if ($verbose); + my $data = {}; + my $fmax = 0; + + my $dl = length($dir); + + print STDERR "? - 1: ftime = $ftime\n" if ($debug); + print STDERR "? - 2: client = $client\n" if ($debug); + print STDERR "? - 3: jobname = $jobname\n" if ($debug); + print STDERR "? - 4: rtime = $rtime\n" if ($debug); + print STDERR "? - 5: dir = $dir\n" if ($debug); + print STDERR "? - 6, 7: dl = $dl, $dl\n" if ($debug); + print STDERR "? - 8: ftime = $ftime\n" if ($debug); + print STDERR "? - 9: client = $client\n" if ($debug); + print STDERR "? - 10: jobname = $jobname\n" if ($debug); + print STDERR "? - 11: rtime = $rtime\n" if ($debug); + print STDERR "? - 12: dir = $dir\n" if ($debug); + + print STDERR "DBG: Execute - $queries{$db}->{'dir'}\n" if ($debug); + $dir_sth->execute( + $ftime, + $client, + $jobname, + $rtime, + $dir, + $dl, $dl, + $ftime, + $client, + $jobname, + $rtime, + $dir + ) || die "Can't execute $queries{$db}->{'dir'}\n"; + + while (my $ref = $dir_sth->fetchrow_hashref) { + my $file = $$ref{name}; + print STDERR "DBG: File $file found in database.\n" if ($debug); + my $l = length($file); + $fmax = $l if ($l > $fmax); + + $data->{$file} = &create_file_entry( + $file, + $ref->{'fileid'}, + $ref->{'fileindex'}, + $ref->{'jobid'}, + $ref->{'visible'}, + $ref->{'lstat'} + ); + } + + return undef if (!$fmax); + + $dircache->{$dir} = $data if ($usecache); + return $data; +} + +sub cache_catalog { + print "Loading entire catalog, please wait...\n"; + my $sth = $dbh->prepare($queries{$db}->{'cache'}) + || die "Can't prepare $queries{$db}->{'cache'}\n"; + print STDERR "DBG: Execute - $queries{$db}->{'cache'}\n" if ($debug); + $sth->execute($ftime, $client, $jobname, $rtime, $ftime) + || die "Can't execute $queries{$db}->{'cache'}\n"; + + print "Query complete, building catalog cache...\n" if ($verbose); + + while (my $ref = $sth->fetchrow_hashref) { + my $dir = $ref->{path}; + my $file = $ref->{name}; + print STDERR "DBG: File $dir$file found in database.\n" if ($debug); + + next if ($dir eq '/' and $file eq ''); # Skip data for / + + # Rearrange directory + + if ($file eq '' and $dir =~ m|(.*/)([^/]+/)$|) { + $dir = $1; + $file = $2; + } + + my $data = &create_file_entry( + $file, + $ref->{'fileid'}, + $ref->{'fileindex'}, + $ref->{'jobid'}, + $ref->{'visible'}, + $ref->{'lstat'} + ); + + $dircache->{$dir} = {} if (!$dircache->{$dir}); + $dircache->{$dir}->{$file} = $data; + } + + $sth->finish(); +} + +# Break a path up into dir and file. + +sub path_parts { + my $path = shift; + my $fqdir; + my $dir; + my $file; + + if (substr($path, 0, 1) eq '/') { + + # Find dir vs. file + if ($path =~ m|^(/.*/)([^/]*$)|) { + $fqdir = $dir = $1; + $file = $2; + } + else { # Must be in / + $fqdir = $dir = '/'; + $file = substr($path, 1); + } + + print STDERR "DBG: / Dir - $dir; file = $file\n" if ($debug); + } + # relative path + elsif ($path =~ m|^(.*/)([^/]*)$|) { + $fqdir = "$cwd$1"; + $dir = $1; + $file = $2; + print STDERR "DBG: Dir - $dir; file = $file\n" if ($debug); + } + # File is in our current directory. + else { + $fqdir = $cwd; + $dir = ''; + $file = $path; + print STDERR "DBG: Set dir to $dir\n" if ($debug); + } + + return ($fqdir, $dir, $file); +} + +sub lookup_client { + my $c = shift; + + if (!$clients) { + $clients = {}; + my $query = "select clientid, name from Client"; + my $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + $sth->execute || die "Can't execute $query\n"; + + while (my $ref = $sth->fetchrow_hashref) { + $clients->{$ref->{'name'}} = $ref->{'clientid'}; + } + + $sth->finish; + } + + if ($c !~ /^\d+$/) { + + if ($clients->{$c}) { + $c = $clients->{$c}; + } + else { + warn "Could not find client $c\n"; + $c = $client; + } + + } + + return $c; +} + +sub setjob { + + if (!$jobs) { + $jobs = {}; + my $query = "select distinct name from Job order by name"; + my $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + $sth->execute || die "Can't execute $query\n"; + + while (my $ref = $sth->fetchrow_hashref) { + $jobs->{$$ref{'name'}} = $$ref{'name'}; + } + + $sth->finish; + } + + my $query = "select + jobtdate + from + Job + where + jobtdate <= $rtime and + name = '$jobname' and + level = 'F' + order by jobtdate desc + limit 1 + "; + + my $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + $sth->execute || die "Can't execute $query\n"; + + if ($sth->rows == 1) { + my $ref = $sth->fetchrow_hashref; + $ftime = $$ref{jobtdate}; + } + else { + warn "Could not find full backup. Setting full time to 0.\n"; + $ftime = 0; + } + + $sth->finish; +} + +sub select_files { + my $mark = shift; + my $opts = shift; + my $dir = shift; + my @flist = @_; + + if (!@flist) { + + if ($cwd eq '/') { + my $finfo = &fetch_dir('/'); + @flist = keys %$finfo; + } + else { + @flist = ($cwd); + } + + } + + foreach my $f (@flist) { + $f =~ s|/+$||; + my $path = (substr($f, 0, 1) eq '/') ? $f : "$dir$f"; + my ($fqdir, $dir, $file) = &path_parts($path); + my $finfo = &fetch_dir($fqdir); + + if (!$finfo->{$file}) { + + if (!$finfo->{"$file/"}) { + warn "$f: File not found.\n"; + next; + } + + $file .= '/'; + } + + my $info = $finfo->{$file}; + + my $fid = $info->{'fileid'}; + my $fidx = $info->{'fileindex'}; + my $jid = $info->{'jobid'}; + my $size = $info->{'lstat'}->{'st_size'}; + + if ($opts->{'all'} || $info->{'visible'}) { + print STDERR "DBG: $file - $size bytes\n" + if ($debug); + + if ($mark) { + + if (!$restore{$fid}) { + print "Adding $fqdir$file\n" if (!$opts->{'quiet'}); + $restore{$fid} = [$jid, $fidx]; + $rnum++; + $rbytes += $size; + } + + } + else { + + if ($restore{$fid}) { + print "Removing $fqdir$file\n" if (!$opts->{'quiet'}); + delete $restore{$fid}; + $rnum--; + $rbytes -= $size; + } + + } + + if ($file =~ m|/$|) { + + # Use preloaded files if we already retrieved them. + if ($preload) { + my $newdir = "$dir$file"; + my $finfo = &fetch_dir($newdir); + &select_files($mark, $opts, $newdir, keys %$finfo); + next; + } + else { + my $newdir = "$fqdir$file"; + my $begin = ($opts->{'all'}) ? 0 : $ftime; + + print STDERR "DBG: Execute - $queries{$db}->{'sel'}\n" + if ($debug); + + $sel_sth->execute( + $client, + $jobname, + $rtime, + $begin, + $newdir, + $client, + $jobname, + $rtime, + $begin, + $newdir + ) || die "Can't execute $queries{$db}->{'sel'}\n"; + + while (my $ref = $sel_sth->fetchrow_hashref) { + my $file = $$ref{'name'}; + my $fid = $$ref{'fileid'}; + my $fidx = $$ref{'fileindex'}; + my $jid = $$ref{'jobid'}; + my @stat_enc = split(' ', $$ref{'lstat'}); + my $size = &from_base64($stat_enc[7]); + + if ($mark) { + + if (!$restore{$fid}) { + print "Adding $file\n" if (!$opts->{'quiet'}); + $restore{$fid} = [$jid, $fidx]; + $rnum++; + $rbytes += $size; + } + + } + else { + + if ($restore{$fid}) { + print "Removing $file\n" if (!$opts->{'quiet'}); + delete $restore{$fid}; + $rnum--; + $rbytes -= $size; + } + + } + + } + + } + + } + + } + + } + +} + +# Expand shell wildcards + +sub expand_files { + my $path = shift; + my ($fqdir, $dir, $file) = &path_parts($path); + my $finfo = &fetch_dir($fqdir); + return ($path) if (!$finfo); + + my $pat = "^$file\$"; + + # Add / for dir match + my $dpat = $file; + $dpat =~ s|/+$||; + $dpat = "^$dpat/\$"; + + my @match; + + $pat =~ s/\./\\./g; + $dpat =~ s/\./\\./g; + $pat =~ s/\?/./g; + $dpat =~ s/\?/./g; + $pat =~ s/\*/.*/g; + $dpat =~ s/\*/.*/g; + + foreach my $f (sort keys %$finfo) { + + if ($f =~ /$pat/) { + push (@match, ($fqdir eq $cwd) ? $f : "$fqdir$f"); + } + elsif ($f =~ /$dpat/) { + push (@match, ($fqdir eq $cwd) ? $f : "$fqdir$f"); + } + + } + + return ($path) if (!@match); + return @match; +} + +sub expand_dirs { + my $path = shift; + my ($fqdir, $dir, $file) = &path_parts($path, 1); + + print STDERR "Expand $path\n" if ($debug); + + my $finfo = &fetch_dir($fqdir); + return ($path) if (!$finfo); + + $file =~ s|/+$||; + + my $pat = "^$file/\$"; + my @match; + + $pat =~ s/\./\\./g; + $pat =~ s/\?/./g; + $pat =~ s/\*/.*/g; + + foreach my $f (sort keys %$finfo) { + print STDERR "Match $f to $pat\n" if ($debug); + push (@match, ($fqdir eq $cwd) ? $f : "$fqdir$f") if ($f =~ /$pat/); + } + + return ($path) if (!@match); + return @match; +} + +sub mode2str { + my $mode = shift; + my $sstr = ''; + + if (S_ISDIR($mode)) { + $sstr = 'd'; + } + elsif (S_ISCHR($mode)) { + $sstr = 'c'; + } + elsif (S_ISBLK($mode)) { + $sstr = 'b'; + } + elsif (S_ISREG($mode)) { + $sstr = '-'; + } + elsif (S_ISFIFO($mode)) { + $sstr = 'f'; + } + elsif (S_ISLNK($mode)) { + $sstr = 'l'; + } + elsif (S_ISSOCK($mode)) { + $sstr = 's'; + } + else { + $sstr = '?'; + } + + $sstr .= ($mode&S_IRUSR) ? 'r' : '-'; + $sstr .= ($mode&S_IWUSR) ? 'w' : '-'; + $sstr .= ($mode&S_IXUSR) ? + (($mode&S_ISUID) ? 's' : 'x') : + (($mode&S_ISUID) ? 'S' : '-'); + $sstr .= ($mode&S_IRGRP) ? 'r' : '-'; + $sstr .= ($mode&S_IWGRP) ? 'w' : '-'; + $sstr .= ($mode&S_IXGRP) ? + (($mode&S_ISGID) ? 's' : 'x') : + (($mode&S_ISGID) ? 'S' : '-'); + $sstr .= ($mode&S_IROTH) ? 'r' : '-'; + $sstr .= ($mode&S_IWOTH) ? 'w' : '-'; + $sstr .= ($mode&S_IXOTH) ? + (($mode&S_ISVTX) ? 't' : 'x') : + (($mode&S_ISVTX) ? 'T' : '-'); + + return $sstr; +} + +# Base 64 decoder +# Algorithm copied from bacula source + +sub from_base64 { + my $where = shift; + my $val = 0; + my $i = 0; + my $neg = 0; + + if (substr($where, 0, 1) eq '-') { + $neg = 1; + $where = substr($where, 1); + } + + while ($where ne '') { + $val <<= 6; + my $d = substr($where, 0, 1); + #print STDERR "\n$d - " . ord($d) . " - " . $base64_map[ord($d)] . "\n"; + $val += $base64_map[ord(substr($where, 0, 1))]; + $where = substr($where, 1); + } + + return $val; +} + +### Command completion code + +sub get_match { + my @m = @_; + my $r = ''; + + for (my $i = 0, my $matched = 1; $i < length($m[0]) && $matched; $i++) { + my $c = substr($m[0], $i, 1); + + for (my $j = 1; $j < @m; $j++) { + + if ($c ne substr($m[$j], $i, 1)) { + $matched = 0; + last; + } + + } + + $r .= $c if ($matched); + } + + return $r; +} + +sub complete { + my $text = shift; + my $line = shift; + my $start = shift; + my $end = shift; + + $tty_attribs->{'completion_append_character'} = ' '; + $tty_attribs->{completion_entry_function} = \&nocomplete; + print STDERR "\nDBG: text - $text; line - $line; start - $start; end = $end\n" + if ($debug); + + # Complete command if we are at start of line. + + if ($start == 0 || substr($line, 0, $start) =~ /^\s*$/) { + my @list = grep (/^$text/, sort keys %COMMANDS); + return () if (!@list); + my $match = (@list > 1) ? &get_match(@list) : ''; + return $match, @list; + } + else { + # Count arguments + my $cstr = $line; + $cstr =~ s/^\s+//; # Remove leading spaces + + my ($cmd, @args) = shellwords($cstr); + return () if (!defined($cmd)); + + # Complete dirs for cd + if ($cmd eq 'cd') { + return () if (@args > 1); + return &complete_files($text, 1); + } + # Complete files/dirs for info and ls + elsif ($cmd =~ /^(add|delete|info|ls|mark|unmark|versions)$/) { + return &complete_files($text, 0); + } + # Complete clients for client + elsif ($cmd eq 'client') { + return () if (@args > 2); + my $pat = $text; + $pat =~ s/\./\\./g; + my @flist; + + print STDERR "DBG: " . (@args) . " arguments found.\n" if ($debug); + + if (@args < 1 || (@args == 1 and $line =~ /[^\s]$/)) { + @flist = grep (/^$pat/, sort keys %$clients); + } + else { + @flist = grep (/^$pat/, sort keys %$jobs); + } + + return () if (!@flist); + my $match = (@flist > 1) ? &get_match(@flist) : ''; + + #return $match, map {s/ /\\ /g; $_} @flist; + return $match, @flist; + } + # Complete show options for show + elsif ($cmd eq 'show') { + return () if (@args > 1); + # attempt to suggest match. + my @list = grep (/^$text/, sort keys %SHOW); + return () if (!@list); + my $match = (@list > 1) ? &get_match(@list) : ''; + return $match, @list; + } + elsif ($cmd =~ /^(bsr|bootstrap|relocate)$/) { + $tty_attribs->{completion_entry_function} = + $tty_attribs->{filename_completion_function}; + } + + } + + return (); +} + +sub complete_files { + my $path = shift; + my $dironly = shift; + my $finfo; + my @flist; + + my ($fqdir, $dir, $pat) = &path_parts($path, 1); + + $pat =~ s/([.\[\]\\])/\\$1/g; + # First check for absolute name. + + $finfo = &fetch_dir($fqdir); + print STDERR "DBG: " . join(', ', keys %$finfo) . "\n" if ($debug); + return () if (!$finfo); # Nothing if dir not found. + + if ($dironly) { + @flist = grep (m|^$pat.*/$|, sort keys %$finfo); + } + else { + @flist = grep (/^$pat/, sort keys %$finfo); + } + + return undef if (!@flist); + + print STDERR "DBG: Files found\n" if ($debug); + + if (@flist == 1 && $flist[0] =~ m|/$|) { + $tty_attribs->{'completion_append_character'} = ''; + } + + @flist = map {s/ /\\ /g; ($fqdir eq $cwd) ? $_ : "$dir$_"} @flist; + my $match = (@flist > 1) ? &get_match(@flist) : ''; + + print STDERR "DBG: Dir - $dir; cwd - $cwd\n" if ($debug); + # Fill in dir if necessary. + return $match, @flist; +} + +sub nocomplete { + return (); +} + +# subroutine to create printf format for long listing of ls + +sub long_fmt { + my $flist = shift; + my $fmax = 0; + my $lmax = 0; + my $umax = 0; + my $gmax = 0; + my $smax = 0; + + foreach my $f (@$flist) { + my $file = $f->[0]; + my $info = $f->[1]; + my $lstat = $info->{'lstat'}; + + my $l = length($file); + $fmax = $l if ($l > $fmax); + + $l = length($lstat->{'st_nlink'}); + $lmax = $l if ($l > $lmax); + $l = length($lstat->{'st_uid'}); + $umax = $l if ($l > $umax); + $l = length($lstat->{'st_gid'}); + $gmax = $l if ($l > $gmax); + $l = length($lstat->{'st_size'}); + $smax = $l if ($l > $smax); + } + + return "%s %${lmax}d %${umax}d %${gmax}d %${smax}d %s %s\n"; +} + +sub print_by_cols { + my @list = @_; + my $l = @list; + my $w = $term->get_screen_size; + my @wds = (1); + my $m = $w/3 + 1; + my $max_cols = ($m < @list) ? $w : @list; + my $fpc = 1; + my $cols = 1; + + print STDERR "Need to print $l files\n" if ($debug); + + while($max_cols > 1) { + my $used = 0; + + # Initialize array of widths + @wds = 0 x $max_cols; + + for ($cols = 0; $cols < $max_cols && $used < $w; $cols++) { + my $cw = 0; + + for (my $j = $cols*$fpc; $j < ($cols + 1)*$fpc && $j < $l; $j++ ) { + my $fl = length($list[$j]->[0]); + $cw = $fl if ($fl > $cw); + } + + $wds[$cols] = $cw; + $used += $cw; + print STDERR "DBG: Total so far is $used\n" if ($debug); + + if ($used >= $w) { + $cols++; + last; + } + + $used += 3; + } + + print STDERR "DBG: $cols of $max_cols columns uses $used space.\n" + if ($debug); + + print STDERR "DBG: Print $fpc files per column\n" + if ($debug); + + last if ($used <= $w && $cols == $max_cols); + $fpc = int($l/$cols); + $fpc++ if ($l % $cols); + $max_cols = $cols - 1; + } + + if ($max_cols == 1) { + $cols = 1; + $fpc = $l; + } + + print STDERR "Print out $fpc rows with $cols columns\n" + if ($debug); + + for (my $i = 0; $i < $fpc; $i++) { + + for (my $j = $i; $j < $fpc*$cols; $j += $fpc) { + my $cw = $wds[($j - $i)/$fpc]; + my $fmt = "%s%-${cw}s"; + my $file; + my $r; + + if ($j < @list) { + $file = $list[$j]->[0]; + my $fdata = $list[$j]->[1]; + $r = ($restore{$fdata->{'fileid'}}) ? '+' : ' '; + } + else { + $file = ''; + $r = ' '; + } + + print ' ' if ($i != $j); + printf $fmt, $r, $file; + } + + print "\n"; + } + +} + +sub ls_date { + my $seconds = shift; + my $date; + + if (abs(time() - $seconds) > 15724800) { + $date = time2str('%b %e %Y', $seconds); + } + else { + $date = time2str('%b %e %R', $seconds); + } + + return $date; +} + +# subroutine to load entire bacula database. +=head1 SHELL + +Once running, B will present the user with a shell like +environment where file can be exampled and selected for recover. The +shell will provide command history and editing and if you have the +Gnu readline module installed on your system, it will also provide +command completion. When interacting with files, wildcards should work +as expected. + +The following commands are understood. + +=cut + +sub parse_command { + my $cstr = shift; + my @command; + my $cmd; + my @args; + + # Nop on blank or commented lines + return ('nop') if ($cstr =~ /^\s*$/); + return ('nop') if ($cstr =~ /^\s*#/); + + # Get rid of leading white space to make shellwords work better + $cstr =~ s/^\s*//; + + ($cmd, @args) = shellwords($cstr); + + if (!defined($cmd)) { + warn "Could not warse $cstr\n"; + return ('nop'); + } + +=head2 add [I] + +Mark I for recovery. If I is not specified, mark all +files in the current directory. B is an alias for this command. + +=cut + elsif ($cmd eq 'add' || $cmd eq 'mark') { + my $options = {}; + @ARGV = @args; + + # Parse ls options + my $vars = {}; + getopts("aq", $vars) || return ('error', 'Add: Usage add [-q|-a] files'); + $options->{'all'} = $vars->{'a'}; + $options->{'quiet'} =$vars->{'q'}; + + + @command = ('add', $options); + + foreach my $a (@ARGV) { + push(@command, &expand_files($a)); + } + + } + +=head2 bootstrap I + +Create a bootstrap file suitable for use with the bacula B +command. B is an alias for this command. + +=cut + elsif ($cmd eq 'bootstrap' || $cmd eq 'bsr') { + return ('error', 'bootstrap takes single argument (file to write to)') + if (@args != 1); + @command = ('bootstrap', $args[0]); + } + +=head2 cd I + +Allows you to set your current directory. This command understands . for +the current directory and .. for the parent. Also, cd - will change you +back to the previous directory you were in. + +=cut + elsif ($cmd eq 'cd') { + # Cd with no args goes to / + @args = ('/') if (!@args); + + if (@args != 1) { + return ('error', 'Bad cd. cd requires 1 and only 1 argument.'); + } + + my $todir = $args[0]; + + # cd - should cd to previous directory. It is handled later. + return ('cd', '-') if ($todir eq '-'); + + # Expand wilecards + my @e = expand_dirs($todir); + + if (@e > 1) { + return ('error', 'Bad cd. Wildcard expands to more than 1 dir.'); + } + + $todir = $e[0]; + + print STDERR "Initial target is $todir\n" if ($debug); + + # remove prepended . + + while ($todir =~ m|^\./(.*)|) { + $todir = $1; + $todir = '.' if (!$todir); + } + + # If only . is left, replace with current directory. + $todir = $cwd if ($todir eq '.'); + print STDERR "target after . processing is $todir\n" if ($debug); + + # Now deal with .. + my $prefix = $cwd; + + while ($todir =~ m|^\.\./(.*)|) { + $todir = $1; + print STDERR "DBG: ../ found, new todir - $todir\n" if ($debug); + $prefix =~ s|/[^/]*/$|/|; + } + + if ($todir eq '..') { + $prefix =~ s|/[^/]*/$|/|; + $todir = ''; + } + + print STDERR "target after .. processing is $todir\n" if ($debug); + print STDERR "DBG: Final prefix - $prefix\n" if ($debug); + + $todir = "$prefix$todir" if ($prefix ne $cwd); + + print STDERR "DBG: todir after .. handling - $todir\n" if ($debug); + + # Turn relative directories into absolute directories. + + if (substr($todir, 0, 1) ne '/') { + print STDERR "DBG: $todir has no leading /, prepend $cwd\n" if ($debug); + $todir = "$cwd$todir"; + } + + # Make sure we have a trailing / + + if (substr($todir, length($todir) - 1) ne '/') { + print STDERR "DBG: No trailing /, append /\n" if ($debug); + $todir .= '/'; + } + + @command = ('cd', $todir); + } + +=head2 changetime I + +This command changes the time used in generating the view of the +filesystem. Files that were backed up before the specified time +(optionally until the next full backup) will be the only files seen. + +The time can be specifed in almost any reasonable way. Here are a few +examples: + +=over 4 + +=item 1/1/2006 + +=item yesterday + +=item sunday + +=item 5 days ago + +=item last month + +=back + +=cut + elsif ($cmd eq 'changetime') { + @command = ($cmd, join(' ', @args)); + } + +=head2 client I I + +Specify the client and jobname to view. + +=cut + elsif ($cmd eq 'client') { + + if (@args != 2) { + return ('error', 'client takes a two arguments client-name job-name'); + } + + @command = ('client', @args); + } + +=head2 debug + +Toggle debug flag. + +=cut + elsif ($cmd eq 'debug') { + @command = ('debug'); + } + +=head2 delete [I] + +Un-mark file that were previous marked for recovery. If I is +not specified, mark all files in the current directory. B is an +alias for this command. + +=cut + elsif ($cmd eq 'delete' || $cmd eq 'unmark') { + @command = ('delete'); + + foreach my $a (@args) { + push(@command, &expand_files($a)); + } + + } + +=head2 help + +Show list of command with brief description of what they do. + +=cut + elsif ($cmd eq 'help') { + @command = ('help'); + } + +=head2 history + +Display command line history. B is an alias for this command. + +=cut + elsif ($cmd eq 'h' || $cmd eq 'history') { + @command = ('history'); + } + +=head2 info [I] + +Display information about the specified files. The format of the +information provided is reminiscent of the bootstrap file. + +=cut + elsif ($cmd eq 'info') { + push(@command, 'info'); + + foreach my $a (@args) { + push(@command, &expand_files($a)); + } + + } + +=head2 ls [I] + +This command will list the specified files (defaults to all files in +the current directory). Files are sorted alphabetically be default. It +understand the following options. + +=over 4 + +=item -a + +Causes ls to list files even if they are only on backups preceding the +closest full backup to the currently selected date/time. + +=item -l + +List files in long format (like unix ls command). + +=item -r + +reverse direction of sort. + +=item -S + +Sort files by size. + +=item -t + +Sort files by time + +=back + +=cut + elsif ($cmd eq 'ls' || $cmd eq 'dir' || $cmd eq 'll') { + my $options = {}; + @ARGV = @args; + + # Parse ls options + my $vars = {}; + getopts("altSr", $vars) || return ('error', 'Bad ls usage.'); + $options->{'all'} = $vars->{'a'}; + $options->{'long'} = $vars->{'l'}; + $options->{'long'} = 1 if ($cmd eq 'dir' || $cmd eq 'll'); + + $options->{'sort'} = 'time' if ($vars->{'t'}); + + return ('error', 'Only one sort at a time allowed.') + if ($options->{'sort'} && ($vars->{'S'})); + + $options->{'sort'} = 'size' if ($vars->{'S'}); + $options->{'sort'} = 'alpha' if (!$options->{'sort'}); + + $options->{'sort'} = 'r' . $options->{'sort'} if ($vars->{'r'}); + + @command = ('ls', $options); + + foreach my $a (@ARGV) { + push(@command, &expand_files($a)); + } + + } + +=head2 pwd + +Show current directory. + +=cut + elsif ($cmd eq 'pwd') { + @command = ('pwd'); + } + +=head2 quit + +Exit program. + +B, B and B are all aliases for this command. + +=cut + elsif ($cmd eq 'quit' || $cmd eq 'q' || $cmd eq 'exit' || $cmd eq 'x') { + @command = ('quit'); + } + +=head2 recover + +This command creates a table in the bacula catalog that case be used to +restore the selected files. It will also display the command to enter +into bconsole to start the restore. + +=cut + elsif ($cmd eq 'recover') { + @command = ('recover'); + } + +=head2 relocate I + +Specify the directory to restore files to. Defaults to /. + +=cut + elsif ($cmd eq 'relocate') { + return ('error', 'relocate required a single directory to relocate to') + if (@args != 1); + + my $todir = $args[0]; + $todir = `pwd` . $todir if (substr($todir, 0, 1) ne '/'); + @command = ('relocate', $todir); + } + +=head2 show I + +Show various information about B. The following items can be specified. + +=over 4 + +=item cache + +Display's a list of cached directories. + +=item catalog + +Displays the name of the catalog we are talking to. + +=item client + +Display current client and job named that are being viewed. + +=item restore + +Display the number of files and size to be restored. + +=item volumes + +Display the volumes that will be required to perform a restore on the +selected files. + +=back + +=cut + elsif ($cmd eq 'show') { + return ('error', 'show takes a single argument') if (@args != 1); + @command = ('show', $args[0]); + } + +=head2 verbose + +Toggle verbose flag. + +=cut + elsif ($cmd eq 'verbose') { + @command = ('verbose'); + } + +=head2 versions [I] + +View all version of specified files available from the current +time. B is an alias for this command. + +=cut + elsif ($cmd eq 'versions' || $cmd eq 'ver') { + push(@command, 'versions'); + + foreach my $a (@args) { + push(@command, &expand_files($a)); + } + + } + +=head2 volumes + +Display the volumes that will be required to perform a restore on the +selected files. + +=cut + elsif ($cmd eq 'volumes') { + @command = ('volumes'); + } + else { + @command = ('error', "$cmd: Unknown command"); + } + + return @command; +} + +############################################################################## +### Command processing +############################################################################## + +# Add files to restore list. + +sub cmd_add { + my $opts = shift; + my @flist = @_; + + my $save_rnum = $rnum; + &select_files(1, $opts, $cwd, @flist); + print "" . ($rnum - $save_rnum) . " files marked for restore\n"; +} + +sub cmd_bootstrap { + my $bsrfile = shift; + my %jobs; + my @media; + my %bootstrap; + + # Get list of job ids to restore from. + + foreach my $fid (keys %restore) { + $jobs{$restore{$fid}->[0]} = 1; + } + + my $jlist = join(', ', sort keys %jobs); + + if (!$jlist) { + print "Nothing to restore.\n"; + return; + } + + # Read in media info + + my $query = "select + Job.jobid, + volumename, + mediatype, + volsessionid, + volsessiontime, + firstindex, + lastindex, + startfile as volfile, + JobMedia.startblock, + JobMedia.endblock, + volindex + from + Job, + Media, + JobMedia + where + Job.jobid in ($jlist) and + Job.jobid = JobMedia.jobid and + JobMedia.mediaid = Media.mediaid + order by + volumename, + volsessionid, + volindex + "; + + my $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + $sth->execute || die "Can't execute $query\n"; + + while (my $ref = $sth->fetchrow_hashref) { + push(@media, { + 'jobid' => $ref->{'jobid'}, + 'volumename' => $ref->{'volumename'}, + 'mediatype' => $ref->{'mediatype'}, + 'volsessionid' => $ref->{'volsessionid'}, + 'volsessiontime' => $ref->{'volsessiontime'}, + 'firstindex' => $ref->{'firstindex'}, + 'lastindex' => $ref->{'lastindex'}, + 'volfile' => $ref->{'volfile'}, + 'startblock' => $ref->{'startblock'}, + 'endblock' => $ref->{'endblock'}, + 'volindex' => $ref->{'volindex'} + }); + } + +# Gather bootstrap info +# +# key - jobid.volumename.volumesession.volindex +# job +# name +# type +# session +# time +# file +# startblock +# endblock +# array of file indexes. + + for my $info (values %restore) { + my $jobid = $info->[0]; + my $fidx = $info->[1]; + + foreach my $m (@media) { + + if ($jobid == $m->{'jobid'} && $fidx >= $m->{'firstindex'} && $fidx <= $m->{'lastindex'}) { + my $key = "$jobid."; + $key .= "$m->{volumename}.$m->{volsessionid}.$m->{volindex}"; + + $bootstrap{$key} = { + 'job' => $jobid, + 'name' => $m->{'volumename'}, + 'type' => $m->{'mediatype'}, + 'session' => $m->{'volsessionid'}, + 'index' => $m->{'volindex'}, + 'time' => $m->{'volsessiontime'}, + 'file' => $m->{'volfile'}, + 'startblock' => $m->{'startblock'}, + 'endblock' => $m->{'endblock'} + } + if (!$bootstrap{$key}); + + $bootstrap{$key}->{'files'} = [] + if (!$bootstrap{$key}->{'files'}); + push(@{$bootstrap{$key}->{'files'}}, $fidx); + } + + } + + } + + # print bootstrap + + print STDERR "DBG: Keys = " . join(', ', keys %bootstrap) . "\n" + if ($debug); + + my @keys = sort { + return $bootstrap{$a}->{'time'} <=> $bootstrap{$b}->{'time'} + if ($bootstrap{$a}->{'time'} != $bootstrap{$b}->{'time'}); + return $bootstrap{$a}->{'name'} cmp $bootstrap{$b}->{'name'} + if ($bootstrap{$a}->{'name'} ne $bootstrap{$b}->{'name'}); + return $bootstrap{$a}->{'session'} <=> $bootstrap{$b}->{'session'} + if ($bootstrap{$a}->{'session'} != $bootstrap{$b}->{'session'}); + return $bootstrap{$a}->{'index'} <=> $bootstrap{$b}->{'index'}; + } keys %bootstrap; + + if (!open(BSR, ">$bsrfile")) { + warn "$bsrfile: $|\n"; + return; + } + + foreach my $key (@keys) { + my $info = $bootstrap{$key}; + print BSR "Volume=\"$info->{name}\"\n"; + print BSR "MediaType=\"$info->{type}\"\n"; + print BSR "VolSessionId=$info->{session}\n"; + print BSR "VolSessionTime=$info->{time}\n"; + print BSR "VolFile=$info->{file}\n"; + print BSR "VolBlock=$info->{startblock}-$info->{endblock}\n"; + + my @fids = sort { $a <=> $b} @{$bootstrap{$key}->{'files'}}; + my $first; + my $prev; + + for (my $i = 0; $i < @fids; $i++) { + $first = $fids[$i] if (!$first); + + if ($prev) { + + if ($fids[$i] != $prev + 1) { + print BSR "FileIndex=$first"; + print BSR "-$prev" if ($first != $prev); + print BSR "\n"; + $first = $fids[$i]; + } + + } + + $prev = $fids[$i]; + } + + print BSR "FileIndex=$first"; + print BSR "-$prev" if ($first != $prev); + print BSR "\n"; + print BSR "Count=" . (@fids) . "\n"; + } + + close(BSR); +} + +# Change directory + +sub cmd_cd { + my $dir = shift; + + my $save = $files; + + $dir = $lwd if ($dir eq '-' && defined($lwd)); + + if ($dir ne '-') { + $files = &fetch_dir($dir); + } + else { + warn "Previous director not defined.\n"; + } + + if ($files) { + $lwd = $cwd; + $cwd = $dir; + } + else { + print STDERR "Could not locate directory $dir\n"; + $files = $save; + } + + $cwd = '/' if (!$cwd); +} + +sub cmd_changetime { + my $tstr = shift; + + if (!$tstr) { + print "Time currently set to " . localtime($rtime) . "\n"; + return; + } + + my $newtime = parsedate($tstr, FUZZY => 1, PREFER_PAST => 1); + + if (defined($newtime)) { + print STDERR "Time evaluated to $newtime\n" if ($debug); + $rtime = $newtime; + print "Setting date/time to " . localtime($rtime) . "\n"; + &setjob; + + # Clean cache. + $dircache = {}; + &cache_catalog if ($preload); + + # Get directory based on new time. + $files = &fetch_dir($cwd); + } + else { + print STDERR "Could not parse $tstr as date/time\n"; + } + +} + +# Change client + +sub cmd_client { + my $c = shift; + $jobname = shift; # Set global job name + + # Lookup client id. + $client = &lookup_client($c); + + # Clear cache, we changed machines/jobs + $dircache = {}; + &cache_catalog if ($preload); + + # Find last full backup time. + &setjob; + + # Get current directory on new client. + $files = &fetch_dir($cwd); + + # Clear restore info + $rnum = 0; + $rbytes = 0; + %restore = (); +} + +sub cmd_debug { + $debug = 1 - $debug; +} + +sub cmd_delete { + my @flist = @_; + my $opts = {quiet=>1}; + + my $save_rnum = $rnum; + &select_files(0, $opts, $cwd, @flist); + print "" . ($save_rnum - $rnum) . " files un-marked for restore\n"; +} + +sub cmd_help { + + foreach my $h (sort keys %COMMANDS) { + printf "%-12s %s\n", $h, $COMMANDS{$h}; + } + +} + +sub cmd_history { + + foreach my $h ($term->GetHistory) { + print "$h\n"; + } + +} + +# Print catalog/tape info about files + +sub cmd_info { + my @flist = @_; + @flist = ($cwd) if (!@flist); + + foreach my $f (@flist) { + $f =~ s|/+$||; + my ($fqdir, $dir, $file) = &path_parts($f); + my $finfo = &fetch_dir($fqdir); + + if (!$finfo->{$file}) { + + if (!$finfo->{"$file/"}) { + warn "$f: File not found.\n"; + next; + } + + $file .= '/'; + } + + my $fileid = $finfo->{$file}->{fileid}; + my $fileindex = $finfo->{$file}->{fileindex}; + my $jobid = $finfo->{$file}->{jobid}; + + print "#$f -\n"; + print "#FileID : $finfo->{$file}->{fileid}\n"; + print "#JobID : $jobid\n"; + print "#Visible : $finfo->{$file}->{visible}\n"; + + my $query = "select + volumename, + mediatype, + volsessionid, + volsessiontime, + startfile, + JobMedia.startblock, + JobMedia.endblock + from + Job, + Media, + JobMedia + where + Job.jobid = $jobid and + Job.jobid = JobMedia.jobid and + $fileindex >= firstindex and + $fileindex <= lastindex and + JobMedia.mediaid = Media.mediaid + "; + + my $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + $sth->execute || die "Can't execute $query\n"; + + while (my $ref = $sth->fetchrow_hashref) { + print "Volume=\"$ref->{volumename}\"\n"; + print "MediaType=\"$ref->{mediatype}\"\n"; + print "VolSessionId=$ref->{volsessionid}\n"; + print "VolSessionTime=$ref->{volsessiontime}\n"; + print "VolFile=$ref->{startfile}\n"; + print "VolBlock=$ref->{startblock}-$ref->{endblock}\n"; + print "FileIndex=$finfo->{$file}->{fileindex}\n"; + print "Count=1\n"; + } + + $sth->finish; + } + +} + +# List files. + +sub cmd_ls { + my $opts = shift; + my @flist = @_; + my @keys; + + print STDERR "DBG: " . (@flist) . " files to list.\n" if ($debug); + + if (!@flist) { + @flist = keys %$files; + } + + # Sort files as specified. + + if ($opts->{sort} eq 'alpha') { + print STDERR "DBG: Sort by alpha\n" if ($debug); + @keys = sort @flist; + } + elsif ($opts->{sort} eq 'ralpha') { + print STDERR "DBG: Sort by reverse alpha\n" if ($debug); + @keys = sort {$b cmp $a} @flist; + } + elsif ($opts->{sort} eq 'time') { + print STDERR "DBG: Sort by time\n" if ($debug); + @keys = sort { + return $a cmp $b + if ($files->{$b}->{'lstat'}->{'st_mtime'} == + $files->{$a}->{'lstat'}->{'st_mtime'}); + $files->{$b}->{'lstat'}->{'st_mtime'} <=> + $files->{$a}->{'lstat'}->{'st_mtime'} + } @flist; + } + elsif ($opts->{sort} eq 'rtime') { + print STDERR "DBG: Sort by reverse time\n" if ($debug); + @keys = sort { + return $b cmp $a + if ($files->{$a}->{'lstat'}->{'st_mtime'} == + $files->{$b}->{'lstat'}->{'st_mtime'}); + $files->{$a}->{'lstat'}->{'st_mtime'} <=> + $files->{$b}->{'lstat'}->{'st_mtime'} + } @flist; + } + elsif ($opts->{sort} eq 'size') { + print STDERR "DBG: Sort by size\n" if ($debug); + @keys = sort { + return $a cmp $b + if ($files->{$a}->{'lstat'}->{'st_size'} == + $files->{$b}->{'lstat'}->{'st_size'}); + $files->{$b}->{'lstat'}->{'st_size'} <=> + $files->{$a}->{'lstat'}->{'st_size'} + } @flist; + } + elsif ($opts->{sort} eq 'rsize') { + print STDERR "DBG: Sort by reverse size\n" if ($debug); + @keys = sort { + return $b cmp $a + if ($files->{$a}->{'lstat'}->{'st_size'} == + $files->{$b}->{'lstat'}->{'st_size'}); + $files->{$a}->{'lstat'}->{'st_size'} <=> + $files->{$b}->{'lstat'}->{'st_size'} + } @flist; + } + else { + print STDERR "DBG: $opts->{sort}, no sort\n" if ($debug); + @keys = @flist; + } + + @flist = (); + + foreach my $f (@keys) { + print STDERR "DBG: list $f\n" if ($debug); + $f =~ s|/+$||; + my ($fqdir, $dir, $file) = &path_parts($f); + my $finfo = &fetch_dir($fqdir); + + if (!$finfo->{$file}) { + + if (!$finfo->{"$file/"}) { + warn "$f: File not found.\n"; + next; + } + + $file .= '/'; + } + + my $fdata = $finfo->{$file}; + + if ($opts->{'all'} || $fdata->{'visible'}) { + push(@flist, ["$dir$file", $fdata]); + } + + } + + if ($opts->{'long'}) { + my $lfmt = &long_fmt(\@flist) if ($opts->{'long'}); + + foreach my $f (@flist) { + my $file = $f->[0]; + my $fdata = $f->[1]; + my $r = ($restore{$fdata->{'fileid'}}) ? '+' : ' '; + my $lstat = $fdata->{'lstat'}; + + printf $lfmt, $lstat->{'statstr'}, $lstat->{'st_nlink'}, + $lstat->{'st_uid'}, $lstat->{'st_gid'}, $lstat->{'st_size'}, + ls_date($lstat->{'st_mtime'}), "$r$file"; + } + } + else { + &print_by_cols(@flist); + } + +} + +sub cmd_pwd { + print "$cwd\n"; +} + +# Create restore data for bconsole + +sub cmd_recover { + my $query = "create table recover (jobid int, fileindex int)"; + + $dbh->do($query) + || warn "Could not create recover table. Hope it's already there.\n"; + + if ($db eq 'postgres') { + $query = "COPY recover FROM STDIN"; + + $dbh->do($query) || die "Can't execute $query\n"; + + foreach my $finfo (values %restore) { + $dbh->pg_putline("$finfo->[0]\t$finfo->[1]\n"); + } + + $dbh->pg_endcopy; + } + else { + + foreach my $finfo (values %restore) { + $query = "insert into recover ( + 'jobid', 'fileindex' + ) + values ( + $finfo->[0], $finfo->[1] + )"; + $dbh->do($query) || die "Can't execute $query\n"; + } + + } + + $query = "GRANT all on recover to bacula"; + $dbh->do($query) || die "Can't execute $query\n"; + + $query = "select name from Client where clientid = $client"; + my $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + $sth->execute || die "Can't execute $query\n"; + + my $ref = $sth->fetchrow_hashref; + print "Restore prepared. Run bconsole and enter the following command\n"; + print "restore client=$$ref{name} where=$restore_to file=\?recover\n"; + $sth->finish; +} + +sub cmd_relocate { + $restore_to = shift; +} + +# Display information about recover's state + +sub cmd_show { + my $what = shift; + + if ($what eq 'clients') { + + foreach my $c (sort keys %$clients) { + print "$c\n"; + } + + } + elsif ($what eq 'catalog') { + print "$catalog\n"; + } + elsif ($what eq 'client') { + my $query = "select name from Client where clientid = $client"; + my $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + $sth->execute || die "Can't execute $query\n"; + + my $ref = $sth->fetchrow_hashref; + print "$$ref{name}; $jobname\n"; + $sth->finish; + } + elsif ($what eq 'cache') { + print "The following directories are cached\n"; + + foreach my $d (sort keys %$dircache) { + print "$d\n"; + } + + } + elsif ($what eq 'restore') { + print "There are $rnum files marked for restore.\n"; + + print STDERR "DBG: Bytes = $rbytes\n" if ($debug); + + if ($rbytes < 1024) { + print "The restore will require $rbytes bytes.\n"; + } + elsif ($rbytes < 1024*1024) { + my $rk = $rbytes/1024; + printf "The restore will require %.2f KB.\n", $rk; + } + elsif ($rbytes < 1024*1024*1024) { + my $rm = $rbytes/1024/1024; + printf "The restore will require %.2f MB.\n", $rm; + } + else { + my $rg = $rbytes/1024/1024/1024; + printf "The restore will require %.2f GB.\n", $rg; + } + + print "Restores will be placed in $restore_to\n"; + } + elsif ($what eq 'volumes') { + &cmd_volumes; + } + elsif ($what eq 'qinfo') { + my $dl = length($cwd); + print "? - 1: ftime = $ftime\n"; + print "? - 2: client = $client\n"; + print "? - 3: jobname = $jobname\n"; + print "? - 4: rtime = $rtime\n"; + print "? - 5: dir = $cwd\n"; + print "? - 6, 7: dl = $dl\n"; + print "? - 8: ftime = $ftime\n"; + print "? - 9: client = $client\n"; + print "? - 10: jobname = $jobname\n"; + print "? - 11: rtime = $rtime\n"; + print "? - 12: dir = $cwd\n"; + } + else { + warn "Don't know how to show $what\n"; + } + +} + +sub cmd_verbose { + $verbose = 1 - $verbose; +} + +sub cmd_versions { + my @flist = @_; + + @flist = ($cwd) if (!@flist); + + foreach my $f (@flist) { + my $path; + my $data = {}; + + print STDERR "DBG: Get versions for $f\n" if ($debug); + + $f =~ s|/+$||; + my ($fqdir, $dir, $file) = &path_parts($f); + my $finfo = &fetch_dir($fqdir); + + if (!$finfo->{$file}) { + + if (!$finfo->{"$file/"}) { + warn "$f: File not found.\n"; + next; + } + + $file .= '/'; + } + + if ($file =~ m|/$|) { + $path = "$fqdir$file"; + $file = ''; + } + else { + $path = $fqdir; + } + + print STDERR "DBG: Use $ftime, $path, $file, $client, $jobname\n" + if ($debug); + + $ver_sth->execute($ftime, $rtime, $path, $file, $client, $jobname) + || die "Can't execute $queries{$db}->{'ver'}\n"; + + # Gather stats + + while (my $ref = $ver_sth->fetchrow_hashref) { + my $f = "$ref->{name};$ref->{jobtdate}"; + $data->{$f} = &create_file_entry( + $f, + $ref->{'fileid'}, + $ref->{'fileindex'}, + $ref->{'jobid'}, + $ref->{'visible'}, + $ref->{'lstat'} + ); + + $data->{$f}->{'jobtdate'} = $ref->{'jobtdate'}; + $data->{$f}->{'volume'} = $ref->{'volumename'}; + } + + my @keys = sort { + $data->{$a}->{'jobtdate'} <=> + $data->{$b}->{'jobtdate'} + } keys %$data; + + my @list = (); + + foreach my $f (@keys) { + push(@list, [$file, $data->{$f}]); + } + + my $lfmt = &long_fmt(\@list); + print "\nVersions of \`$path$file' earlier than "; + print localtime($rtime) . ":\n\n"; + + foreach my $f (@keys) { + my $lstat = $data->{$f}->{'lstat'}; + printf $lfmt, $lstat->{'statstr'}, $lstat->{'st_nlink'}, + $lstat->{'st_uid'}, $lstat->{'st_gid'}, $lstat->{'st_size'}, + time2str('%c', $lstat->{'st_mtime'}), $file; + print "save time: " . localtime($data->{$f}->{'jobtdate'}) . "\n"; + print " location: $data->{$f}->{volume}\n\n"; + } + + } + +} + +# List volumes needed for restore. + +sub cmd_volumes { + my %media; + my @jobmedia; + my %volumes; + + # Get media. + my $query = "select mediaid, volumename from Media"; + my $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + + $sth->execute || die "Can't execute $query\n"; + + while (my $ref = $sth->fetchrow_hashref) { + $media{$$ref{'mediaid'}} = $$ref{'volumename'}; + } + + $sth->finish(); + + # Get media usage. + $query = "select mediaid, jobid, firstindex, lastindex from JobMedia"; + $sth = $dbh->prepare($query) || die "Can't prepare $query\n"; + + $sth->execute || die "Can't execute $query\n"; + + while (my $ref = $sth->fetchrow_hashref) { + push(@jobmedia, { + 'mediaid' => $$ref{'mediaid'}, + 'jobid' => $$ref{'jobid'}, + 'firstindex' => $$ref{'firstindex'}, + 'lastindex' => $$ref{'lastindex'} + }); + } + + $sth->finish(); + + # Find needed volumes + + foreach my $fileid (keys %restore) { + my ($jobid, $idx) = @{$restore{$fileid}}; + + foreach my $jm (@jobmedia) { + next if ($jm->{'jobid'}) != $jobid; + + if ($idx >= $jm->{'firstindex'} && $idx <= $jm->{'lastindex'}) { + $volumes{$media{$jm->{'mediaid'}}} = 1; + } + + } + + } + + print "The following volumes are needed for restore.\n"; + + foreach my $v (sort keys %volumes) { + print "$v\n"; + } + +} + +sub cmd_error { + my $msg = shift; + print STDERR "$msg\n"; +} + +############################################################################## +### Start of program +############################################################################## + +&cache_catalog if ($preload); + +print "Using $readline for command processing\n" if ($verbose); + +# Initialize command completion + +# Add binding for Perl readline. Issue warning. +if ($readline eq 'Term::ReadLine::Gnu') { + $term->ReadHistory($HIST_FILE); + print STDERR "DBG: FCD - $tty_attribs->{filename_completion_desired}\n" + if ($debug); + $tty_attribs->{attempted_completion_function} = \&complete; + $tty_attribs->{attempted_completion_function} = \&complete; + print STDERR "DBG: Quote chars = '$tty_attribs->{filename_quote_characters}'\n" if ($debug); +} +elsif ($readline eq 'Term::ReadLine::Perl') { + readline::rl_bind('TAB', 'ViComplete'); + warn "Command completion disabled. $readline is seriously broken\n"; +} +else { + warn "Can't deal with $readline, Command completion disabled.\n"; +} + +&cmd_cd($start_dir); + +while (defined($cstr = $term->readline('recover> '))) { + print "\n" if ($readline eq 'Term::ReadLine::Perl'); + my @command = parse_command($cstr); + last if ($command[0] eq 'quit'); + next if ($command[0] eq 'nop'); + + print STDERR "Execute $command[0] command.\n" if ($debug); + + my $cmd = \&{"cmd_$command[0]"}; + + # The following line will call the subroutine named cmd_ prepended to + # the name of the command returned by parse_command. + + &$cmd(@command[1..$#command]); +}; + +$dir_sth->finish(); +$sel_sth->finish(); +$ver_sth->finish(); +$dbh->disconnect(); + +print "\n" if (!defined($cstr)); + +$term->WriteHistory($HIST_FILE) if ($readline eq 'Term::ReadLine::Gnu'); + +=head1 DEPENDENCIES + +The following CPAN modules are required to run this program. + +DBI, Term::ReadKey, Time::ParseDate, Date::Format, Text::ParseWords + +Additionally, you will only get command line completion if you also have + +Term::ReadLine::Gnu + +=head1 AUTHOR + +Karl Hakimian + +=head1 LICENSE + +Copyright (C) 2006 Karl Hakimian + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +=cut diff --git a/bacula/kernstodo b/bacula/kernstodo index 99ad0fb52a..a857ee2233 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,5 +1,5 @@ Kern's ToDo List - 22 February 2006 + 11 January 2006 Major development: Project Developer @@ -15,18 +15,14 @@ Document: - %d and %v only valid on Director, not for ClientRunBefore/After. Priority: +- Implement a way to disable a drive (so you can use the second + drive of an autochanger, and the first one will not be used or + even defined). - Implement code that makes the Dir aware that a drive is an autochanger (so the user doesn't need to use the Autochanger = yes directive). For 1.39: -- Does Bacula backup Windows shortcuts? -- Add recycle count to Media record. -- Add initial write date to Media record. -- Job retention period in a Pool (and hence Volume). The job would - then be migrated. -- Detect resource deadlock in Migrate when same job wants to read - and write the same device. - Make hardlink code at line 240 of find_one.c use binary search. - Queue warning/error messages during restore so that they are reported at the end of the report rather than being @@ -1280,9 +1276,3 @@ Block Position: 0 integers. - Implement status that shows why a job is being held in reserve, or rather why none of the drives are suitable. -- Implement a way to disable a drive (so you can use the second - drive of an autochanger, and the first one will not be used or - even defined). -- Make sure Maximum Volumes is respected in Pools when adding - Volumes (e.g. when pulling a Scratch volume). -- Keep same dcr when switching device ... diff --git a/bacula/kes-1.38 b/bacula/kes-1.38 index 2de8cb1522..5e38d64a0d 100644 --- a/bacula/kes-1.38 +++ b/bacula/kes-1.38 @@ -2,6 +2,161 @@ Kern Sibbald General: +Release 1.38.7 (06Apr06) released 07Apr06 +- Remove timed wait for VSS on Win2K3 as it is not yet + implemented. +- Correct bacula.in script to reference bacula-ctl-xx in the + sysconfig directory rather than the bin directory. + +Release 1.38.6 (28Mar06) released 29Mar06 +28Mar06 +- Back port from 1.39 fixes to lib/jcr.c to use foreach_jcr() + and new jcr chain locking. +26Mar06 +- Fix a long standing bug in the bacula start/stop scripts. +- Attempt to add the new bacula-ctl-* files to the rpm. +- Switch to using typeof() for list traversing to avoid + as many FC5 g++ compiler warnings as possible. +25Mar06 +- Split the bacula start/start script into four files: + bacula -- starts and stops calling other scripts + bacula-ctl-dir -- starts/stops the director + bacula-ctl-fd -- starts/stops the File daemon + bacula-ctl-sd -- starts/stops the Storage daemon +24Mar06 +- Create datestyle fix for PostgreSQL. Fixes bug #574. +- Correct editing of JobId from int to int64 in fd_cmds.c +- Eliminate FileSet name race with bash_spaces() and multiple + threads by bashing in a local. +- Fix error return from 'use storage' to print a correct error + message rather than nothing. +- Correct false re-read last block error message when two jobs + are simultaneously writing at the end of a tape. +- Simplify exit conditions in the reserve.c code to avoid + possible non-release of reservation_lock(). +- Suffle lock order in reserve to avoid deadlock between + reservation lock and device mutex. +- Add Thorsten's VSS timeout code to 1.38 branch. +21Mar06 +- Initialize jcr mutex before first use. Thanks to Thorsten for + tracking this down for me !!!! as it broke the Win32 build. +20Mar06 +- Integrate addition of line count limitation to bsmtp -l from + Sebastian Stark +17Mar06 +- Implement regex test program in tools directory. +- Attempt to fix time problem with bsmtp with foreign langs. +- Add strip_trailing_newline() submitted by user. + +16Mar06 +- Fix bug #537 to allow arbitrary time to mount a volume for + restore, if polling is turned on. +- Disallow multiple storage specifications for a job. Should fix Arno's + problem. +- Add back a missing store of poolid in jr.poolid. +- If dir_user or dir-group is specified in ./configure apply it to + the working-dir. Fixes bug #533. +- If rescheduling a job cancel the previous incarnation with the SD. + Fixes bugs #566 and 557. +- Fix bug #567 do_message() definition type conflict. + + +14Mar06 +- Add more jcr methods and make mutex and use_count private. +- Create lock/unlock methods for jcr. +- Fix PostgreSQL bug doing sql_data_seeek() by explicitly reading + records to get to seek position. +- Integrate patch from bug #561 to correct conio.c signal definitions. +- Fix Rescheduling failed Jobs. Ensure that SD message thread + terminates correctly by doing pthread_kill(). Do not destroy + SD cond wait variable between executions of the job. Use local + mutex for cond variable to avoid blocking jcr chain. Fix poor + use of jcr use count in jobq.c for restarted jobs. +- Fix obsolete usage of foreach_dlist() to use foreach_jcr() in + lib/jcr.c -- prevents locking the jcr chaing. +- Apply patch from bug #564, which corrects listing volumes with + multiple autochangers. Apply same fix to next volume list. +- Fix bug #562 where restore bootstrap file is not unique. +- Use new routine lock_reservations() to lock the reservations + system, and call it while looking for a volume in askdir.c. + This could possibly fix bug #543. +- Stop SD command loop if job is canceled. + +09Mar06 +- Use John Kodis' edit_with_suffix code to edit VolBytes. +- Backport some fixes for acquire.c. Most importantly, to explicitly + have a reserved_device flag for acquire_for_read(). Hopefully + this will correct the remaining issues with failed restores holding + a drive. +- Add a job_canceled() check in SD command loop. + +Release 1.38.6 beta3 4Mar06 +04Mar06 +- The po files should now be current. +- Fix new sql_use_result() code to properly release the + buffers in all cases. +- Convert to using new Python class definitons with (object). +- Use the keyword ujobid to mean the unique job id; job or jobname + to mean the Job name given on the Name directive, and jobid to + be the numeric (non-unique) job id. +- Allow listing by any of the above. +- Add the user friendly job report code for reporting job elapsed time + and rates with suffexes from John Kodis . +- Add Priority and JobLevel as Python settable items. +- Use TEMPORARY table creation where the table is created by + Bacula. +- Add new code submitted by Eric for waiting on specific jobid. +- Add ACL checking for the dot commands. +- Fix restore of writable FIFOs. +- Fix a bug in bpipe where the string was freed too early. + +26Feb06 +- Fix bug reported by Arno listing blocks with bls +- Update the po files at Eric's request. + +Release 1.38.6-beta2 25Feb06 +25Feb06 +- Add sql_use_result() define. + +Release 1.38.6 beta1 24Feb06 +24Feb06 +- Don't open default catalog if not in ACL. + +22Feb06 +- Add virtual disk autochanger code. +- Add user supplied bug fix to make two autochangers work + correctly using StorageId with InChanger checks. +- Correct new/old_jcr confusion in copy_storage(). +- Remove & from Job during scan in msgchan.c -- probably + trashed the stack. +- When getting the next Volume if no Volume in Append mode + exists and we are dealing with an Autochanger, search + for a Scratch Volume. +- Check for missing value in dot commands -- bug fix. +- Fix bug in update barcodes command line scanning. +- Make sure Pool Max Vols is respected. +- Check that user supplied a value before referencing + it in restore -- pointed out by Karl Hakimian. +- Add Karl Hakimian's table insert code. +- Don't ask user to select a specific Volume when + updating all volumes in a Pool. +- Remove reservation if set for read when removing dcr. +- Lock code that requests next appendable volume so that + two jobs to get the same Volume at the same time. +- Add new Device Type = xxx code. Values are file, tape, + dvd, and fifo. +- Preserve certain modes (ST_LABEL|ST_APPEND|ST_READ) across + a re-open to change read/write permission on a device. +- Correct a misplaced double quote in certain autochanger + scripts. +- Make make_catalog_backup.in a bit more portable. +- Implement Karl Hakimian's sql_use_result(), which speeds + up restore tree building and reduces the memory load. +- Correct a number of minor bugs in getting a Volume from + the Scratch Pool. +- Implement additional command line options for update Volume. +- Don't require user to enter a Volume name when updating + all Volumes in a pool. Release 1.38.5 released 19Jan06: 19Jan06 diff --git a/bacula/kes-1.39 b/bacula/kes-1.39 deleted file mode 100644 index 6af59114a5..0000000000 --- a/bacula/kes-1.39 +++ /dev/null @@ -1,375 +0,0 @@ - Technical notes on version 1.39 - Kern Sibbald - -General: - -Changes to 1.39.6 -23Feb06 -- Add Rudolf Cejka's new rc-chio-changer. -- Implement pulling Volume from Scratch Pool if the - Volume is in the autochanger. -- Implement additional command arguments for update Volume. - -Changes to 1.39.5 -22Feb06 -- Back port changes to 1.38.5 -- Fix recycle SQL for StorageId. -- Fix misplaced quote in mtx-changer script. -20Feb06 -- Note. Your database must be updated, or you must create - a new database. I have not yet incremented the database level. -- Add Location table. -- Add LocationId, DeviceId, and MediaTypeId to Media record. -18Feb06 -- Implement create/get mac record in database for adding extended - Migration data to the job record. -- Add new MAC table to update/make database scripts. -- Return Storage name used when getting VolumeNames for a job. -- Change bsr file keyword Storage to Device, which is more accurate. -- Ensure that Mac records are pruned/purged. -- Tweak SD tools to deal with changing media type. -- Integrate more dev.c subroutines as methods (e.g. strerror, bsr, ...) -- Pass pointer to dcr pointer to acquire_device_for_read() so - that the subroutine can switch devices, and hence dcrs. -- Modify the multiple MediaType read code to re-use the same - dcr when switching devices. This makes the code much more - robust. -- Integrate patch from Karl Hakimian that reads JobIds, FileIndexes - from a table for restore. -- Add Storage name to VolParams, but it really should be Device. -14Feb06 -- Add disk-changer to scripts directory + configure/Makefile -- Eliminate PoolId from jcr -- it is in jcr->jr.PoolId -- Implement store_bit scanner to replace store_yesno. Mostly done. -- Implement new store_bool that stores in a bool. -- Add true/false to yes/no conf directives. -- Make first cut at changing appropriate store_yesno to store_bool. -- Complete implementation of Pool storage devices. -- Move starting clones to job.c -- Move create_restore_bootstrap_file() to job.c -- Make copy_storage() more general to be able to handle - Pool storage. -- Cleanup a lot of migration code for manual running, including - using Pool storage. -- Move getting a scratch Volume into a subroutine. -- Make all places a Volume that is added to a pool to - respect max vols. -- Fix bug in autochanger recycle code (improper edit 64 bit). -- Fix segfault in restore command when no value specified. -- Start adding code to handle multiple MediaTypes in restore. -- Eliminate race condition in getting Volume name for - two drive autochanger. -- More debug code in autochanger. -- Add storage keyword to bootstrap file, add parsing. -- Move slot in bsr file into Volume record as there will be - a different slot for each Volume. -- Create reserve.h -07Feb06 -- Implement Pool storage overrides. -06Feb06 -- Implement first cut of Migration. -- Implement mysql_use_result() from patch by Karl Hakimian. - This reduces significantly the memory consumption during - the restore tree building, and hence runs faster too. -- Implement StorageId patch supplied by user (reggie) in bug - #536. This should permit Bacula to work correctly with two - autochangers. -- Implement Job listing variations suggested by a user. -- Move updating bootstrap code in backup.c to subroutine - update_bootstrap_file(). -- Add new job status elapsed time and bytes written user - friendly job report output patch sent by a user. -- Implement a storage list in Pools. -- Separate out setup_job() code from run_job(). -- Get migration working -- lots of changes in mac.c in both - DIR and SD. -- Apply patch from user (Eric Bollinger I think) that fixes a - DIR crash when no arguments are supplied to a dot command. -- Fix typo (strcpy->strcmp) in ua_prune.c as reported by Martin. -- Fix command arg name->volume in label command of gnome-console. -- Fix SD acquire.c to release correct DCR by explicitly testing - on the dcr address rather than trying to devine if it is a read - or write dcr. This failed in error conditions when the device was - not fully setup. - -30Jan06 -- Apply user supplied patch for more readable rate output - in job report. -- Continue implementing migration. -- Implement support for removable filesystems in SD. -- Ensure that btraceback scripts can be read by anyone. -- Replace dvd-freespace and dvd-writepart by dvd-handler. -- Correct bug where canceling restore before the FD contacts - the SD causes the drive to be left in read mode. -- Move ofline_or_rewind into DEVICE::close(). -- Eliminate close_device. -- Convert several dev subroutines to methods (e.g. bsf, - eod, ...) -- Eliminate force_close_device(). -- Implement Device Type directive in Device resource that - can have values File, Tape, Fifo, DVD, or Prog. -- Add has_cap() method to Device. -Changes to 1.39.4 -17Jan06 -- Add patch from bug #527 to allow RedHat user to specify - options/user/group for starting each daemon in - /etc/sysconf/bacula. -16Jan06 -- Add two new queries to query.sql provided by Arno. One - list volumes known to the Storage device, and the other - lists volumes possibly needing replacement (error, ...). -15Jan06 -- Add periodic (every 24 hours) garbage collection of memory - pool by releasing free buffers. -14Jan06 -- Correct bug counting sized (for display only) in smartall.c -- Print FD mempool stats if debug > 0 rather than 5. -12Jan06 -- Make db_lock() mutex error fail the job rather than abort - Bacula. Canceling the job caused the mutex to fail. -- Correct bug in alist.c that re-allocated the list if the - number of items goes to zero. -- Move the reservation system thread locking to the top level - so that one job at a time tries all possible drives before - waiting. -- Implement a reservation 'fail' message queue that is built - and destroyed on each pass through the reservation system. - These messages are displayed in a 'Jobs waiting to reserve - a drive' list during a 'status storage='. Note, multiple - messages will generally print for each JobId because they - represent the different problems with either the same drive - or different drives. If this output proves too confusing - of voluminous, I will display it only when debug level 1 - or greater is enabled in the SD. -11Jan06 -- Add enable/disable job=. This command prevents - the specified job from being scheduled. Even when disabled, - the job can be manually started from the console. -- During 'update slots' clear all InChanger flags where the - StorageId is zero (old Media records). - -Beta release 1.38.4: -09Jan06 -- Fix autochanger code to strip leading spaces from returned - slots number. Remove bc from chio-changer. -- Back port a bit of 1.39 crypto code to reduce diffs. -- Fix first call to autochanger that missed close()ing the - drive. Put close() just before each run_program(). Fixes - Arno's changer bug. -07Jan06 -- Add PoolId to Job record when updating it at job start time. -06Jan06 -- Pull in more code from 1.39 so that there are fewer file - differences (the new ua_dotcmds.c, base64.h, crypto.h - hmac.c jcr.c (dird and lib) lib.h md5.h parse_conf.c - util.c. Aside from ua_dotcmds.c these are mostly crypto - upgrades. -- Implement new method of walking the jcr chain. The - incr/dec of the use_count is done within the walking - routines. This should prevent a jcr from being freed - from under the walk routines. - - -Changes to 1.39.3: -04Jan06 -- Start implementing Verify list output. -- Move the suitable_drive flag to a better place to prevent - premature termination of the reservation if all drives - are busy -- should fix Arno's diff/inc pool failures. -26Dec05 -- Add mutex to single thread VSS code in Win32. -22Dec05 -- Simplify code in askdir.c that waits for creating an appendable - volume so that it can handle multiple returns from the wait - code. -- Modify the wait code to permit multiple returns. -- Return a zero when "autochanger drives" is called and - it is not an autochanger. -- Make rewind_dev() a method taking a DCR as an argument. - This permits closing and reopening the drive if the - rewind fails as happens if the drive was loaded while the - file descriptor was open. This refreshes the file descriptor. -- Remove the ST_OPENED flag and always rely on fd < 0 for knowing - if the device is open or not. This should eliminate - Arnos problem. -- Return error if reserve cannot find at least one suitable device. -- Make wait_for_sysop() return correct state information. -- Fix Win32 state file problem. write was not using compat - code. This should fix bug #500. -21Dec05 -- Modify gui on command to set only GUI mode and not batch. -- Modify .messages command to always print messages regardless - of the mode. -- If GUI mode is on, suppress automatic printing of - You have messages. -- Delete old bnet packet code. -- Ignore new BNET_START_SELECT and BNET_END_SELECT signals in - wx-console. -- Modify restore command in wx-console to set gui on and to use - only .messages instead of messages. Hopefully this fixes bug - #514. -- Fix seg fault in exit of acquire when canceling a job -- - reported by Wolfgang Denk -- Pull in latest reservation system changes from 1.38 -- Make .messages command always print messages regardless - of the automessages flag. -17Dec05 -- Fix seg fault if user labels a drive directory bug #513 -- Remove quotes around Version as it breaks things. -16Dec05 -- Merge in Aleksandar Milivojevic's mods to the spec file. -- Apply sparse code fix for raw drives and fifos. Bug 506 -- Thorsten fixed Unicode cd problem with wx-console bug 505. -14Dec05 -- Correct reservation system to do a last ditch try - for any mounted volume, then anyone anywhere. -- Add quotes around table Version because of - error in MySQL 4.1.15 -- bug report submitted. -- Correct some minor problems with btape in the fill - command. -- Updates to ssh-tunnel from Joshua Kugler. -- Added a report.pl program from Jonas Bjorklund. -- Simplify the O_NONBLOCK open() code for tape drives, - and always open nonblocking. -- Do not wait for open() if EIO returned (shouldn't happen). -- Eliminate 3 argument to tape open(). -- Correct the slot # edited in the 3995 Bad autochanger unload - message. -- With -S on bscan (show progress) do not divide by zero. -13Dec05 -- Make cancel pthread_cond_signal() pthread_cond_broadcast(). -- When dcr is freed, also broadcast dev->wait_next_vol signal. -- Remove unused code in wait_for_device. -- Make wait_for_device() always return after 60 seconds of wait. - -Changes to 1.39.2: -13Dec05 -- Add stubs for non-crypto build. -12Dec05 -- Use localhost if no network configured -11Dec05 -- Eliminated duplicate MaxVolBytes in cat update -- bug 509. -- Remove debug print. -- Add bail_out in error during state file reading. -10Dec05 -- Merge changes made to 1.38.3 into HEAD -- Add stubs for pygtk-console code -- Create Makefile.in for pygtk-console code -09Dec05 -- Merge updates into 1.38 branch -- Update specs to include mysql4 define. -- Fix when attributes are sent, must be after binit(). -- Stop read_record() if status not ok in second loop. -- Return rec->FileIndex in dcr->VolLastIndex for normal - and partial records in read_record(). This allows bscan - to get FileIndex at EOT correct. -- Fix butil.c to correctly set dcr -- fixes seg fault in bls. -08Dec05 -- Fix Win32 built to work with new crypto code. -- Apply patch supplied by user (slightly modified) to fix - correct detection of holes in block devices and FIFOs. - Bug # 506. -- Apply patch supplied by user (slightly modified) - to fix SD hang with multiple pools and bad client - IP. Fixes bug # 508. -07Dec05 -- Add nagios plugin to the examples directory. Submitted by - Christian Masopust. -- Remove warning message about multiple saves of hardlinked files - from find_one.c as it can generate too many warning messages. -- Modify most restore error messages to be queued so that they - appear at the end of the job rather than mixted with the restore - listing where they could be "lost". -06Dec05 -- Reset timeout values before select() per patch from - Frank Sweetser for problems with non-blocking sockets. -- Unlink the state file if either reading or writing it gets - errors. Hopefully this will fix Win32 exit problems. -- Add sanity check in append.c to ensure that dcr is not NULL. - This can happen if multiple drive autochanger SCSI control - channel and drive indicies do not correspond. -05Dec05 -- Get next volume from Scratch pool before creating a volume. -- Set new Pool defaults in Vol when moved from Scratch Pool. -- Remove argument from create_bacula_database for SQLite as it - caused an error. -- Add back index code so that two drive autochangers can get - a second tape. -- Change a bunch of debug levels to aid debugging autochangers. -- Fix reservation so that mutexes are properly applied. -- Rework reservation algorithm so that two drives can be used - at the same time. -04Dec05 -- Landon merged his data encription changes into the HEAD -- Apply days keyword patch from Alexander.Bergolth at wu-wien.ac.at - If this patch is applied, the number of days can be specified with - "list nextvol days=xx" - or - "status dir days=xx" - My use case is to be able to preview the next scheduled job (and the - next tape to be used) on fridays if there are no scheduled jobs during - the weekend. -Changes to 1.39.1: -03Dec05 -- Fix font code in gnome2 console user patch. Fixes bug #501. -- Fix malformatted bnet error message that caused seg fault - fixes bug 502 -- Applied user patch to improve README.vc8 in src/win32. -29Nov05 -- Add Migrate, Copy, Archive Job types (some where there) -- Correct some more editing of JobId's (for 64 bit compatibility). -- Ensure that StorageId is stored in Media record when ever possible. -- Add Migration Job to Job. -- Add Migration Time, Migration High Bytes, Migration Low Bytes - Next Pool to Pool resource. -- Add more code to mac.c (migration archive copy). -- Change Start Storage daemon job to require read and write storage - pointers. -- Pass read storage data to SD as well as write storage data. -- Remove old code from winservice.cpp -- Break on error in scan. -- Fix typo in signal.c -- Separate read/write DCR in SD. Add jcr->read_dcr. -- Cleanup how find_device() works. -- Add read output to Status in SD. -Changes to 1.39.0: -23Nov05 -- Add red-black btree routines -21Nov05 -- Remove abs() in bfile.c so that it compiles on Solaris. - Bug #491. -20Nov05 -- Fix crash in tray-monitor when daemon disconnects. Bug #479. -- Fix bnet-server bug found on OpenBSD. Bug #486 -- Fix cancel failure bug. Bug #481 -- Fix failure when Pool name has spaces. Bug #487 -- Fix SD crash in autochanger code. Mutex failure. Bug #488 -- Fix a couple of free()s in src/filed/acl.c -- Fix memory overrun in bfile.c in building OS X resource - fork filename. Bug #489 -- Add Pool name to SD status output. -14Nov05 -- Apply SunOS patch for ACLs submitted by David Duchscher. -- Make sure to set storage before trying to set drive. -- Add bacula_mail_summary.sh to examples directory. It makes - a single email summary of any number of jobs. Submitted - by Adrew J. Millar. -- Make sure when we do a mount to unblock the device even - if the drive could not be opened. -13Nov05 -- Remove the USE_WIN32STREAMEXTRACTION #defines (always on) - and correct a few minor problems to make it build on Linux. -10Nov05 -- Remove delete of CVS from all Makefiles -- Fix seg fault when clicking on Add button in wx-console - restore panel. Bug #470. -- Fix copyright date and URL typo -- bug #468. -- Change autostart install for FreeBSD to look for rc.conf - rather than rc.local as suggested fix for bug #466. -- Apply patch supplied by Eric Bollinger to fix PostgreSQL - grant on status. Bug #465 -- Apply patch supplied by Eric Bollinger to fix PostgreSQL - update script. Bug #464 -- Tweak #ifdefing a bit in new Win32 stream code. -- Fix #ifdeffing for FD_NO_SEND_TEST. -- Add documentation of performance #defines diff --git a/bacula/nb-1.37 b/bacula/nb-1.37 new file mode 100644 index 0000000000..b9bcce64f8 --- /dev/null +++ b/bacula/nb-1.37 @@ -0,0 +1,93 @@ + Technical notes on version 1.37 + Nicolas Boichat + +General: + +Changes to 1.37.*: +26Oct05 + - dvd.c: update VolParts when writing the last part. +19Oct05 + - configure: add check for dd, remove check for df + - block.c:do_dvd_size_checks: Check we are writing to a dvd before doing tests + (reported by David Raine on the list, "[Bacula-users] LTO drive - End Of Volume error"). + - Update bacula-sd.conf.in to use dvd-handler correctly. + - dvd.c:dvd_write_part: Increase timeout when writing the first part (see the code for + more details). +18Oct05 + - Modify .backups command to get a fileset parameter (fix bug #444). +17Oct05 + - Fix bug when recycling DVD devices (append flag was removed). + - Add tests for dvd+rw-format in configure script. + - scripts/dvd-handler: Reformat DVD-RW when needed. This needs dvd+rw-format. + - Add patch for dvd+rw-tools in patches dir (this should probably be elsewhere). +16Oct05 + - Remove scripts/dvd-freespace and scripts/dvd-writepart, as they are now + merged into scripts/dvd-handler. Note: Documentation needs to be updated. + - scripts/dvd-handler: "zero" brand-new DVD+/-RW to fix a problem with some + DVD-writers, thanks to Arno Lehmann for reporting this, and providing the + way to fix it. + - new scripts/dvd-handler. Note: it also needs a patched version of dvd+rw-tools. + - new scripts/dvd-freespace. Note: it needs a patched version of dvd+rw-tools. + - dvd.c:dvd_write_part: Don't write empty part. (Fix 4GB crossing bug reported by Arno Lehmann) +14Oct05 + - dvd.c:dvd_write_part: Use part_size and not max_part_size when setting write timeout. + - dvd.c:do_mount_dev: When checking if the DVD is mounted, do not count ., .. and .keep (needed on Gentoo). +15Aug05 + - Convert dvd-writepart to Python. + - Increase delay from 3 seconds to 5 seconds between SIGTERM and SIGKILL when + killing external programs. +13Aug05 + - Add gettext macros in autoconf/gettext-macros. + - Modify how localedir is set in configure.in. + - Remove setlocale check (useless). +10Aug05 + - Mark translatable strings in all source files. +08Aug05 + - Create French and Italian translation files (fr.po, it.po). + - Add support for translation in configure and Makefiles. + - Update autoconf/aclocal.m4 so it is automatically created with aclocal + (Note: autoconf/gnome-macros is not used anymore, it may be removed). +30Jul05 + - Fix src/lib/bpipe.c:run_program and run_program_full_output to detect if the watchdog + killed the program, and return an error if it is the case. +26Apr05 + - Modify parse_config to get a LEX_ERROR_HANDLER as a parameter + - lex_open_file now returns NULL if the file can't be opened. All calling functions have + been adapted. + - Remove set_exit_on_error function +07Apr05 + - Fix "unknown device type" problem with DVD devices. + - Fix crash when there is no media in the DVD drive. +09Jan05 + - Update the documentation and ReleaseNotes. +05Jan05 + - Add FreeSpaceCommand in Device (SD configuration file) and implement it. + - Some modifications (again) on how guessed volume names are handled (now it should work). + - Part files on the hard disk are removed if they are empty. +04Jan05 + - Major fixes on how guessed volume names are handled. + - Minor fix in src/stored/append.c. + - Replace, when possible, POOLMEM by POOL_MEM in the new code of src/stored/dev.c. + - New script, scripts/dvd-freespace, which gets the free space available on a writable DVD. +03Jan05 + - Add WritePartAfterJob directive in Job resource (Director) + - Add WritePartAfterJob directive in Schedule Resource (Director) + - Implement these new directives +02Jan05 + - New function, open_guess_name_dev in src/stored/dev.c, which tries to guess the volume + name of a mounted device, so the label can be read. + - New script, scripts/dvd-writepart, which write parts to DVD+/-R(W). + - Removed WriteFirstPartCommand directive in Device (SD configuration file). + - Use readdir_r instead of readdir (src/stored/dev.c:open_guess_name_dev). +01Jan05 + - Add RequiresMount, MountPoint, MountCommand, UnmountCommand directives in Device (SD configuration file). + - Implement these directives (volumes can now be restored from a manually written DVD). + - Add WriteFirstPartCommand, WritePartCommand directives in Device (SD configuration file). + - Implement these directives (DVD writing now works). + - New function run_program_full_output in src/lib/bpipe.c. + - Lots of bugfixes and cleanups in the new code. +29Dec04 + - Add VolParts field in Media table + - Add MaximumPartSize directive in Device (SD configuration file) + - File Volumes can now be splitted in multiple files ("parts") + - Fix SQL error in sql_list while doing "llist jobmedia" diff --git a/bacula/nb-1.38 b/bacula/nb-1.38 deleted file mode 100644 index b12fa906ad..0000000000 --- a/bacula/nb-1.38 +++ /dev/null @@ -1,6 +0,0 @@ - Technical notes on version 1.38 - Nicolas Boichat - -General: - -Release 1.38.0: 31 October 2005 diff --git a/bacula/patches/1.38.6-script.patch b/bacula/patches/1.38.6-script.patch new file mode 100644 index 0000000000..7bce5fdf33 --- /dev/null +++ b/bacula/patches/1.38.6-script.patch @@ -0,0 +1,63 @@ + + This patch fixes a bug in the bacula start/stop script where + the binary directory is used rather than the scripts directory. + Apply the patch to version 1.38.6 with: + + cd + patch -p0 <1.38.6-script.patch + make Makefiles + make install + ... + +Index: scripts/bacula.in +=================================================================== +RCS file: /cvsroot/bacula/bacula/scripts/bacula.in,v +retrieving revision 1.13.2.3 +diff -u -r1.13.2.3 bacula.in +--- scripts/bacula.in 28 Mar 2006 16:42:19 -0000 1.13.2.3 ++++ scripts/bacula.in 29 Mar 2006 16:24:51 -0000 +@@ -13,25 +13,22 @@ + # easier to "steal" this code for the development + # environment where they are different. + # +-BACFDBIN=@sbindir@ + BACFDCFG=@sysconfdir@ +-BACSDBIN=@sbindir@ + BACSDCFG=@sysconfdir@ +-BACDIRBIN=@sbindir@ + BACDIRCFG=@sysconfdir@ + + case "$1" in + start) +- [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd $1 $2 +- [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd $1 $2 +- [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir $1 $2 ++ [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2 ++ [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2 ++ [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2 + ;; + + stop) + # Stop the FD first so that SD will fail jobs and update catalog +- [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd $1 $2 +- [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd $1 $2 +- [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir $1 $2 ++ [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2 ++ [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2 ++ [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2 + echo + sleep 6 + ;; +@@ -42,9 +39,9 @@ + ;; + + status) +- [ -x ${BACSDBIN}/bacula-ctl-sd ] && ${BACSDBIN}/bacula-ctl-sd status +- [ -x ${BACFDBIN}/bacula-ctl-fd ] && ${BACFDBIN}/bacula-ctl-fd status +- [ -x ${BACDIRBIN}/bacula-ctl-dir ] && ${BACDIRBIN}/bacula-ctl-dir status ++ [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd status ++ [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd status ++ [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir status + ;; + + *) diff --git a/bacula/platforms/mandrake/bacula.spec.in b/bacula/platforms/mandrake/bacula.spec.in index f6a1730653..f0fa1a5dfa 100644 --- a/bacula/platforms/mandrake/bacula.spec.in +++ b/bacula/platforms/mandrake/bacula.spec.in @@ -5,7 +5,7 @@ # basic defines for every build %define depkgs ../depkgs -%define depkgs_version 22Jun05 +%define depkgs_version 28Mar06 %define sqlite_bindir /usr/lib/bacula/sqlite %define working_dir /var/bacula %define director_daemon_user bacula @@ -18,7 +18,8 @@ %define group_file /etc/group %define useradd /usr/sbin/useradd %define groupadd /usr/sbin/groupadd -%define _rescuever 1.8.2 +%define usermod /usr/sbin/usermod +%define _rescuever 1.8.3 # platform defines - set one below or define the build_xxx on the command line # RedHat builds @@ -121,7 +122,7 @@ exit 1 %define _dist %(grep -i SuSE /etc/SuSE-release) %endif %if %{mdk} -%define _dist %(grep Mandrake /etc/mandrake-release) +%define _dist %(grep Mand /etc/mandrake-release) %endif # Should we build gconsole, possible only if gnome >= 2.0 available @@ -130,6 +131,8 @@ exit 1 %else %define gconsole 1 %endif +# specifically disallow gconsole if desired +%{?nobuild_gconsole:%define gconsole 0} Summary: Bacula - The Network Backup Solution Name: bacula @@ -142,6 +145,8 @@ Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.t Source2: Release_Notes-%{version}-%{release}.tar.gz Source3:http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz Source4:http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz +Patch0: bacula-1.38.6-script.patch +Patch1: bacula-1.38.6-makefile.patch BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team @@ -152,19 +157,23 @@ Packager: D. Scott Barninger %define _rescuesrc ../%{name}-rescue-%{_rescuever} BuildRequires: atk-devel, ncurses-devel, pango-devel, perl -BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig +BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel BuildRequires: openssl-devel +%if %{gconsole} +BuildRequires: pkgconfig +%endif %if %{rh7} BuildRequires: libtermcap-devel BuildRequires: glibc-devel >= 2.2 -BuildRequires: ORBit-devel %endif %if %{su9} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su9} && %{gconsole} BuildRequires: libgnome >= 2.0 BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -176,10 +185,12 @@ BuildRequires: freetype2-devel %endif %if %{su10} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su10} && %{gconsole} BuildRequires: libgnome >= 2.12 BuildRequires: gtk2-devel >= 2.8 BuildRequires: libgnomeui-devel >= 2.12 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.10 @@ -194,24 +205,28 @@ BuildRequires: libpng-devel %endif %if %{mdk} BuildRequires: libtermcap-devel +BuildRequires: libstdc++-static-devel +BuildRequires: glibc-static-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{mdk} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui2-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: libORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo2_0-devel BuildRequires: libbonoboui2_0-devel BuildRequires: libbonobo-activation-devel BuildRequires: libGConf2-devel -BuildRequires: libstdc++-static-devel -BuildRequires: glibc-static-devel BuildRequires: freetype2-devel %endif %if %{fc3} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc3} && %{gconsole} BuildRequires: gtk2-devel >= 2.4 BuildRequires: libgnomeui-devel >= 2.8 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -222,9 +237,11 @@ BuildRequires: freetype-devel %endif %if %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.6 BuildRequires: libgnomeui-devel >= 2.10 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -235,9 +252,11 @@ BuildRequires: freetype-devel %endif %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -560,6 +579,9 @@ server packages. %setup -T -D -b 3 %setup -T -D -b 4 +%patch0 +%patch1 -p1 + %build %if %{su9} || %{su10} @@ -613,9 +635,9 @@ export LDFLAGS=-L/usr/lib64/mysql --with-scriptdir=/etc/bacula \ --enable-smartalloc \ --enable-client-only \ - %if %{mdk} - --disable-nls \ - %endif + %if %{mdk} + --disable-nls \ + %endif --enable-static-fd make @@ -715,6 +737,11 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql %endif +# fixme - make installs gconsole script for build without gconsole +%if ! %{gconsole} +rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +%endif + rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd # install the init scripts @@ -863,6 +890,10 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb %attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler @@ -934,7 +965,8 @@ if [ -s /etc/bacula/console.conf ];then cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf fi -# create the daemon user and group +# create the daemon users and groups +# first create the groups if they don't exist HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then %{groupadd} -r %{daemon_group} > /dev/null 2>&1 @@ -947,24 +979,41 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{storage_daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now create the users if they do not exist +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 echo "The user %{storage_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 echo "The user %{director_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary groups, this is ok to call even if the users already exist +# we only do this if the user is NOT root +IS_ROOT=%{director_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{director_daemon_user} -G %{daemon_group} +fi +IS_ROOT=%{storage_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group} +fi +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %if %{mysql} %post mysql @@ -1133,12 +1182,20 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary group, this is ok to call even if the user already exists +# we only do this if the user is NOT root +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %post client # add our link @@ -1239,6 +1296,10 @@ fi %endif %changelog +* Sun Apr 02 2006 D. Scott Barninger +- 1.38.6 release +- fix problem specifying more than one primary group for user bacula +- add build switch to not build gconsole regardless of platform * Sun Jan 29 2006 D. Scott Barninger - add centos3 build tag - fix link error of static-fd on Mandrake with --disable-nls diff --git a/bacula/platforms/redhat/bacula.spec.in b/bacula/platforms/redhat/bacula.spec.in index f6a1730653..f0fa1a5dfa 100644 --- a/bacula/platforms/redhat/bacula.spec.in +++ b/bacula/platforms/redhat/bacula.spec.in @@ -5,7 +5,7 @@ # basic defines for every build %define depkgs ../depkgs -%define depkgs_version 22Jun05 +%define depkgs_version 28Mar06 %define sqlite_bindir /usr/lib/bacula/sqlite %define working_dir /var/bacula %define director_daemon_user bacula @@ -18,7 +18,8 @@ %define group_file /etc/group %define useradd /usr/sbin/useradd %define groupadd /usr/sbin/groupadd -%define _rescuever 1.8.2 +%define usermod /usr/sbin/usermod +%define _rescuever 1.8.3 # platform defines - set one below or define the build_xxx on the command line # RedHat builds @@ -121,7 +122,7 @@ exit 1 %define _dist %(grep -i SuSE /etc/SuSE-release) %endif %if %{mdk} -%define _dist %(grep Mandrake /etc/mandrake-release) +%define _dist %(grep Mand /etc/mandrake-release) %endif # Should we build gconsole, possible only if gnome >= 2.0 available @@ -130,6 +131,8 @@ exit 1 %else %define gconsole 1 %endif +# specifically disallow gconsole if desired +%{?nobuild_gconsole:%define gconsole 0} Summary: Bacula - The Network Backup Solution Name: bacula @@ -142,6 +145,8 @@ Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.t Source2: Release_Notes-%{version}-%{release}.tar.gz Source3:http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz Source4:http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz +Patch0: bacula-1.38.6-script.patch +Patch1: bacula-1.38.6-makefile.patch BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team @@ -152,19 +157,23 @@ Packager: D. Scott Barninger %define _rescuesrc ../%{name}-rescue-%{_rescuever} BuildRequires: atk-devel, ncurses-devel, pango-devel, perl -BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig +BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel BuildRequires: openssl-devel +%if %{gconsole} +BuildRequires: pkgconfig +%endif %if %{rh7} BuildRequires: libtermcap-devel BuildRequires: glibc-devel >= 2.2 -BuildRequires: ORBit-devel %endif %if %{su9} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su9} && %{gconsole} BuildRequires: libgnome >= 2.0 BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -176,10 +185,12 @@ BuildRequires: freetype2-devel %endif %if %{su10} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su10} && %{gconsole} BuildRequires: libgnome >= 2.12 BuildRequires: gtk2-devel >= 2.8 BuildRequires: libgnomeui-devel >= 2.12 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.10 @@ -194,24 +205,28 @@ BuildRequires: libpng-devel %endif %if %{mdk} BuildRequires: libtermcap-devel +BuildRequires: libstdc++-static-devel +BuildRequires: glibc-static-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{mdk} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui2-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: libORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo2_0-devel BuildRequires: libbonoboui2_0-devel BuildRequires: libbonobo-activation-devel BuildRequires: libGConf2-devel -BuildRequires: libstdc++-static-devel -BuildRequires: glibc-static-devel BuildRequires: freetype2-devel %endif %if %{fc3} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc3} && %{gconsole} BuildRequires: gtk2-devel >= 2.4 BuildRequires: libgnomeui-devel >= 2.8 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -222,9 +237,11 @@ BuildRequires: freetype-devel %endif %if %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.6 BuildRequires: libgnomeui-devel >= 2.10 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -235,9 +252,11 @@ BuildRequires: freetype-devel %endif %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -560,6 +579,9 @@ server packages. %setup -T -D -b 3 %setup -T -D -b 4 +%patch0 +%patch1 -p1 + %build %if %{su9} || %{su10} @@ -613,9 +635,9 @@ export LDFLAGS=-L/usr/lib64/mysql --with-scriptdir=/etc/bacula \ --enable-smartalloc \ --enable-client-only \ - %if %{mdk} - --disable-nls \ - %endif + %if %{mdk} + --disable-nls \ + %endif --enable-static-fd make @@ -715,6 +737,11 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql %endif +# fixme - make installs gconsole script for build without gconsole +%if ! %{gconsole} +rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +%endif + rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd # install the init scripts @@ -863,6 +890,10 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb %attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler @@ -934,7 +965,8 @@ if [ -s /etc/bacula/console.conf ];then cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf fi -# create the daemon user and group +# create the daemon users and groups +# first create the groups if they don't exist HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then %{groupadd} -r %{daemon_group} > /dev/null 2>&1 @@ -947,24 +979,41 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{storage_daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now create the users if they do not exist +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 echo "The user %{storage_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 echo "The user %{director_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary groups, this is ok to call even if the users already exist +# we only do this if the user is NOT root +IS_ROOT=%{director_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{director_daemon_user} -G %{daemon_group} +fi +IS_ROOT=%{storage_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group} +fi +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %if %{mysql} %post mysql @@ -1133,12 +1182,20 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary group, this is ok to call even if the user already exists +# we only do this if the user is NOT root +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %post client # add our link @@ -1239,6 +1296,10 @@ fi %endif %changelog +* Sun Apr 02 2006 D. Scott Barninger +- 1.38.6 release +- fix problem specifying more than one primary group for user bacula +- add build switch to not build gconsole regardless of platform * Sun Jan 29 2006 D. Scott Barninger - add centos3 build tag - fix link error of static-fd on Mandrake with --disable-nls diff --git a/bacula/platforms/suse/bacula.spec.in b/bacula/platforms/suse/bacula.spec.in index f6a1730653..f0fa1a5dfa 100644 --- a/bacula/platforms/suse/bacula.spec.in +++ b/bacula/platforms/suse/bacula.spec.in @@ -5,7 +5,7 @@ # basic defines for every build %define depkgs ../depkgs -%define depkgs_version 22Jun05 +%define depkgs_version 28Mar06 %define sqlite_bindir /usr/lib/bacula/sqlite %define working_dir /var/bacula %define director_daemon_user bacula @@ -18,7 +18,8 @@ %define group_file /etc/group %define useradd /usr/sbin/useradd %define groupadd /usr/sbin/groupadd -%define _rescuever 1.8.2 +%define usermod /usr/sbin/usermod +%define _rescuever 1.8.3 # platform defines - set one below or define the build_xxx on the command line # RedHat builds @@ -121,7 +122,7 @@ exit 1 %define _dist %(grep -i SuSE /etc/SuSE-release) %endif %if %{mdk} -%define _dist %(grep Mandrake /etc/mandrake-release) +%define _dist %(grep Mand /etc/mandrake-release) %endif # Should we build gconsole, possible only if gnome >= 2.0 available @@ -130,6 +131,8 @@ exit 1 %else %define gconsole 1 %endif +# specifically disallow gconsole if desired +%{?nobuild_gconsole:%define gconsole 0} Summary: Bacula - The Network Backup Solution Name: bacula @@ -142,6 +145,8 @@ Source1:http://www.prdownloads.sourceforge.net/bacula/depkgs-%{depkgs_version}.t Source2: Release_Notes-%{version}-%{release}.tar.gz Source3:http://www.prdownloads.sourceforge.net/bacula/%{name}-docs-%{version}.tar.gz Source4:http://www.prdownloads.sourceforge.net/bacula/%{name}-rescue-%{_rescuever}.tar.gz +Patch0: bacula-1.38.6-script.patch +Patch1: bacula-1.38.6-makefile.patch BuildRoot: %{_tmppath}/%{name}-root URL: http://www.bacula.org/ Vendor: The Bacula Team @@ -152,19 +157,23 @@ Packager: D. Scott Barninger %define _rescuesrc ../%{name}-rescue-%{_rescuever} BuildRequires: atk-devel, ncurses-devel, pango-devel, perl -BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel, pkgconfig +BuildRequires: libstdc++-devel, libxml2-devel, zlib-devel BuildRequires: openssl-devel +%if %{gconsole} +BuildRequires: pkgconfig +%endif %if %{rh7} BuildRequires: libtermcap-devel BuildRequires: glibc-devel >= 2.2 -BuildRequires: ORBit-devel %endif %if %{su9} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su9} && %{gconsole} BuildRequires: libgnome >= 2.0 BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -176,10 +185,12 @@ BuildRequires: freetype2-devel %endif %if %{su10} BuildRequires: termcap +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{su10} && %{gconsole} BuildRequires: libgnome >= 2.12 BuildRequires: gtk2-devel >= 2.8 BuildRequires: libgnomeui-devel >= 2.12 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.10 @@ -194,24 +205,28 @@ BuildRequires: libpng-devel %endif %if %{mdk} BuildRequires: libtermcap-devel +BuildRequires: libstdc++-static-devel +BuildRequires: glibc-static-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{mdk} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui2-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: libORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo2_0-devel BuildRequires: libbonoboui2_0-devel BuildRequires: libbonobo-activation-devel BuildRequires: libGConf2-devel -BuildRequires: libstdc++-static-devel -BuildRequires: glibc-static-devel BuildRequires: freetype2-devel %endif %if %{fc3} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc3} && %{gconsole} BuildRequires: gtk2-devel >= 2.4 BuildRequires: libgnomeui-devel >= 2.8 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -222,9 +237,11 @@ BuildRequires: freetype-devel %endif %if %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.6 BuildRequires: libgnomeui-devel >= 2.10 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.3 BuildRequires: libbonobo-devel >= 2.8 @@ -235,9 +252,11 @@ BuildRequires: freetype-devel %endif %if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} BuildRequires: libtermcap-devel +BuildRequires: glibc-devel >= 2.3 +%endif +%if ! %{rh7} && ! %{su9} && ! %{su10} && ! %{mdk} && ! %{fc3} && ! %{fc4} && %{gconsole} BuildRequires: gtk2-devel >= 2.0 BuildRequires: libgnomeui-devel >= 2.0 -BuildRequires: glibc-devel >= 2.3 BuildRequires: ORBit2-devel BuildRequires: libart_lgpl-devel >= 2.0 BuildRequires: libbonobo-devel >= 2.0 @@ -560,6 +579,9 @@ server packages. %setup -T -D -b 3 %setup -T -D -b 4 +%patch0 +%patch1 -p1 + %build %if %{su9} || %{su10} @@ -613,9 +635,9 @@ export LDFLAGS=-L/usr/lib64/mysql --with-scriptdir=/etc/bacula \ --enable-smartalloc \ --enable-client-only \ - %if %{mdk} - --disable-nls \ - %endif + %if %{mdk} + --disable-nls \ + %endif --enable-static-fd make @@ -715,6 +737,11 @@ rm -f $RPM_BUILD_ROOT/etc/bacula/startmysql rm -f $RPM_BUILD_ROOT/etc/bacula/stopmysql %endif +# fixme - make installs gconsole script for build without gconsole +%if ! %{gconsole} +rm -f $RPM_BUILD_ROOT/etc/bacula/gconsole +%endif + rm -f $RPM_BUILD_ROOT/usr/sbin/static-bacula-fd # install the init scripts @@ -863,6 +890,10 @@ chmod 644 $RPM_BUILD_ROOT/etc/bacula/tray-monitor.conf %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.dbx %attr(-, root, %{daemon_group}) /etc/bacula/btraceback.gdb %attr(-, root, %{daemon_group}) /etc/bacula/rescue +%attr(-, root, %{daemon_group}) /etc/bacula/disk-changer +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-dir +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-fd +%attr(-, root, %{daemon_group}) /etc/bacula/bacula-ctl-sd %attr(-, root, %{daemon_group}) /etc/init.d/bacula-dir %attr(-, root, %{daemon_group}) /etc/init.d/bacula-fd %attr(-, root, %{storage_daemon_group}) /etc/bacula/dvd-handler @@ -934,7 +965,8 @@ if [ -s /etc/bacula/console.conf ];then cp -p /etc/bacula/console.conf /etc/bacula/bconsole.conf fi -# create the daemon user and group +# create the daemon users and groups +# first create the groups if they don't exist HAVE_BACULA=`grep %{daemon_group} %{group_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then %{groupadd} -r %{daemon_group} > /dev/null 2>&1 @@ -947,24 +979,41 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{storage_daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now create the users if they do not exist +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{storage_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{storage_daemon_group} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{storage_daemon_user} > /dev/null 2>&1 echo "The user %{storage_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{director_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{director_daemon_user} > /dev/null 2>&1 echo "The user %{director_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary groups, this is ok to call even if the users already exist +# we only do this if the user is NOT root +IS_ROOT=%{director_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{director_daemon_user} -G %{daemon_group} +fi +IS_ROOT=%{storage_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{storage_daemon_user} -G %{daemon_group},%{storage_daemon_group} +fi +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %if %{mysql} %post mysql @@ -1133,12 +1182,20 @@ if [ -z "$HAVE_BACULA" ]; then echo "The group %{daemon_group} has been added to %{group_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# we do not use the -g option allowing the primary group to be set to system default +# this will be a unique group on redhat type systems or the group users on some systems HAVE_BACULA=`grep %{file_daemon_user} %{user_file} 2>/dev/null` if [ -z "$HAVE_BACULA" ]; then - %{useradd} -r -c "Bacula" -d %{working_dir} -g %{daemon_group} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 + %{useradd} -r -c "Bacula" -d %{working_dir} -M -n -s /sbin/nologin %{file_daemon_user} > /dev/null 2>&1 echo "The user %{file_daemon_user} has been added to %{user_file}." echo "See the manual chapter \"Running Bacula\" for details." fi +# now we add the supplementary group, this is ok to call even if the user already exists +# we only do this if the user is NOT root +IS_ROOT=%{file_daemon_user} +if [ "$IS_ROOT" != "root" ]; then +%{usermod} %{file_daemon_user} -G %{daemon_group} +fi %post client # add our link @@ -1239,6 +1296,10 @@ fi %endif %changelog +* Sun Apr 02 2006 D. Scott Barninger +- 1.38.6 release +- fix problem specifying more than one primary group for user bacula +- add build switch to not build gconsole regardless of platform * Sun Jan 29 2006 D. Scott Barninger - add centos3 build tag - fix link error of static-fd on Mandrake with --disable-nls diff --git a/bacula/po/POTFILES.in b/bacula/po/POTFILES.in index 1feb607bda..c57fcb0b33 100644 --- a/bacula/po/POTFILES.in +++ b/bacula/po/POTFILES.in @@ -41,6 +41,7 @@ ./src/dird/msgchan.c ./src/dird/newvol.c ./src/dird/next_vol.c +./src/dird/pythondir.c ./src/dird/recycle.c ./src/dird/restore.c ./src/dird/run_conf.c @@ -61,34 +62,33 @@ ./src/dird/ua_server.c ./src/dird/ua_status.c ./src/dird/ua_tree.c -./src/dird/verify.c ./src/dird/ua_update.c -./src/dird/pythondir.c +./src/dird/verify.c ./src/filed/win32/popup.c +./src/filed/acl.c ./src/filed/authenticate.c ./src/filed/backup.c +./src/filed/chksum.c ./src/filed/estimate.c ./src/filed/filed.c ./src/filed/filed_conf.c ./src/filed/heartbeat.c ./src/filed/job.c +./src/filed/pythonfd.c ./src/filed/restore.c ./src/filed/status.c ./src/filed/verify.c ./src/filed/verify_vol.c -./src/filed/acl.c -./src/filed/chksum.c -./src/filed/pythonfd.c ./src/findlib/attribs.c ./src/findlib/bfile.c ./src/findlib/create_file.c ./src/findlib/enable_priv.c ./src/findlib/find.c ./src/findlib/find_one.c +./src/findlib/fstype.c ./src/findlib/makepath.c ./src/findlib/match.c ./src/findlib/save-cwd.c -./src/findlib/fstype.c ./src/gnome2-console/authenticate.c ./src/gnome2-console/callbacks.c ./src/gnome2-console/console.c @@ -96,6 +96,7 @@ ./src/gnome2-console/interface.c ./src/gnome2-console/restore.c ./src/gnome2-console/support.c +./src/lib/tls.c ./src/lib/address_conf.c ./src/lib/alist.c ./src/lib/alloc.c @@ -127,8 +128,10 @@ ./src/lib/mem_pool.c ./src/lib/message.c ./src/lib/parse_conf.c -./src/lib/regex.c +./src/lib/pythonlib.c ./src/lib/queue.c +./src/lib/regex.c +./src/lib/res.c ./src/lib/rwlock.c ./src/lib/scan.c ./src/lib/semlock.c @@ -140,12 +143,10 @@ ./src/lib/util.c ./src/lib/var.c ./src/lib/watchdog.c -./src/lib/workq.c -./src/lib/pythonlib.c -./src/lib/res.c -./src/lib/tls.c ./src/lib/winapi.c +./src/lib/workq.c ./src/stored/acquire.c +./src/stored/ansi_label.c ./src/stored/append.c ./src/stored/askdir.c ./src/stored/authenticate.c @@ -160,30 +161,29 @@ ./src/stored/dev.c ./src/stored/device.c ./src/stored/dircmd.c +./src/stored/dvd.c +./src/stored/ebcdic.c ./src/stored/fd_cmds.c ./src/stored/job.c ./src/stored/label.c ./src/stored/match_bsr.c ./src/stored/mount.c ./src/stored/parse_bsr.c +./src/stored/pythonsd.c ./src/stored/read.c ./src/stored/read_record.c ./src/stored/record.c +./src/stored/reserve.c ./src/stored/spool.c ./src/stored/status.c ./src/stored/stored.c ./src/stored/stored_conf.c -./src/stored/ansi_label.c -./src/stored/dvd.c -./src/stored/ebcdic.c ./src/stored/wait.c -./src/stored/pythonsd.c -./src/stored/reserve.c ./src/tools/bsmtp.c ./src/tools/dbcheck.c +./src/tools/fstype.c ./src/tools/testfind.c ./src/tools/testls.c -./src/tools/fstype.c ./src/tray-monitor/authenticate.c ./src/tray-monitor/eggmarshalers.c ./src/tray-monitor/eggstatusicon.c @@ -193,8 +193,8 @@ ./src/win32/compat/getopt.c ./src/wx-console/authenticate.c ./src/wx-console/console_conf.c -./autoconf/confdefs.h ./autoconf/acconfig.h +./autoconf/confdefs.h ./src/baconfig.h ./src/bacula.h ./src/bc_types.h @@ -219,15 +219,16 @@ ./src/filed/win32/winservice.h ./src/filed/win32/winstat.h ./src/filed/win32/wintray.h +./src/filed/acl.h +./src/filed/chksum.h ./src/filed/filed.h ./src/filed/filed_conf.h ./src/filed/protos.h -./src/filed/acl.h -./src/filed/chksum.h ./src/findlib/bfile.h ./src/findlib/find.h ./src/findlib/protos.h ./src/findlib/save-cwd.h +./src/host.h ./src/gnome2-console/callbacks.h ./src/gnome2-console/console.h ./src/gnome2-console/console_conf.h @@ -240,6 +241,7 @@ ./src/lib/berrno.h ./src/lib/bits.h ./src/lib/bpipe.h +./src/lib/bregex.h ./src/lib/bsd_queue.h ./src/lib/bshm.h ./src/lib/bsock.h @@ -263,14 +265,15 @@ ./src/lib/sha1.h ./src/lib/smartall.h ./src/lib/tcpd.h +./src/lib/crypto.h +./src/lib/tls.h ./src/lib/tree.h ./src/lib/var.h ./src/lib/waitq.h ./src/lib/watchdog.h -./src/lib/workq.h -./src/lib/bregex.h -./src/lib/tls.h ./src/lib/winapi.h +./src/lib/workq.h +./src/lib/base64.h ./src/stored/block.h ./src/stored/bsr.h ./src/stored/dev.h @@ -278,7 +281,6 @@ ./src/stored/record.h ./src/stored/stored.h ./src/stored/stored_conf.h -./src/host.h ./src/tray-monitor/eggmarshalers.h ./src/tray-monitor/eggstatusicon.h ./src/tray-monitor/eggtrayicon.h @@ -305,11 +307,11 @@ ./src/win32/compat/strings.h ./src/win32/compat/syslog.h ./src/win32/compat/unistd.h +./src/win32/compat/vss.h ./src/win32/compat/winconfig.h ./src/win32/compat/winhost.h ./src/win32/compat/winsock.h ./src/win32/compat/netinet/in.h -./src/win32/compat/vss.h ./src/win32/console/StdAfx.h ./src/win32/wx-console/w32api.h ./src/wx-console/console_conf.h @@ -335,8 +337,8 @@ ./src/win32/baculafd/StdAfx.cpp ./src/win32/compat/compat.cpp ./src/win32/compat/print.cpp -./src/win32/compat/vss_W2K3.cpp ./src/win32/compat/vss.cpp +./src/win32/compat/vss_W2K3.cpp ./src/win32/compat/vss_XP.cpp ./src/win32/compat/vss_generic.cpp ./src/win32/console/StdAfx.cpp @@ -345,6 +347,7 @@ ./src/win32/console/console_conf.cpp ./src/win32/filed/authenticate.cpp ./src/win32/filed/backup.cpp +./src/win32/filed/chksum.cpp ./src/win32/filed/estimate.cpp ./src/win32/filed/filed.cpp ./src/win32/filed/filed_conf.cpp @@ -354,18 +357,17 @@ ./src/win32/filed/status.cpp ./src/win32/filed/verify.cpp ./src/win32/filed/verify_vol.cpp -./src/win32/filed/chksum.cpp ./src/win32/findlib/attribs.cpp ./src/win32/findlib/bfile.cpp ./src/win32/findlib/create_file.cpp ./src/win32/findlib/enable_priv.cpp ./src/win32/findlib/find.cpp ./src/win32/findlib/find_one.cpp +./src/win32/findlib/fstype.cpp ./src/win32/findlib/makepath.cpp ./src/win32/findlib/match.cpp ./src/win32/findlib/save-cwd.cpp ./src/win32/findlib/winapi.cpp -./src/win32/findlib/fstype.cpp ./src/win32/lib/address_conf.cpp ./src/win32/lib/alist.cpp ./src/win32/lib/alloc.cpp @@ -397,7 +399,10 @@ ./src/win32/lib/mem_pool.cpp ./src/win32/lib/message.cpp ./src/win32/lib/parse_conf.cpp +./src/win32/lib/pythonlib.cpp ./src/win32/lib/queue.cpp +./src/win32/lib/regex.cpp +./src/win32/lib/res.cpp ./src/win32/lib/rwlock.cpp ./src/win32/lib/scan.cpp ./src/win32/lib/semlock.cpp @@ -405,16 +410,13 @@ ./src/win32/lib/sha1.cpp ./src/win32/lib/signal.cpp ./src/win32/lib/smartall.cpp +./src/win32/lib/tls.cpp ./src/win32/lib/tree.cpp ./src/win32/lib/util.cpp ./src/win32/lib/var.cpp ./src/win32/lib/watchdog.cpp -./src/win32/lib/workq.cpp -./src/win32/lib/pythonlib.cpp -./src/win32/lib/regex.cpp -./src/win32/lib/res.cpp -./src/win32/lib/tls.cpp ./src/win32/lib/winapi.cpp +./src/win32/lib/workq.cpp ./src/win32/wx-console/authenticate.cpp ./src/win32/wx-console/console_conf.cpp ./src/wx-console/console_thread.cpp @@ -423,8 +425,8 @@ ./src/wx-console/wxbconfigpanel.cpp ./src/wx-console/wxbhistorytextctrl.cpp ./src/wx-console/wxblistctrl.cpp +./src/wx-console/wxbmainframe.cpp ./src/wx-console/wxbrestorepanel.cpp ./src/wx-console/wxbtableparser.cpp ./src/wx-console/wxbtreectrl.cpp ./src/wx-console/wxbutils.cpp -./src/wx-console/wxbmainframe.cpp diff --git a/bacula/po/bacula.pot b/bacula/po/bacula.pot index 2a781f46cd..51ce43ed49 100644 --- a/bacula/po/bacula.pot +++ b/bacula/po/bacula.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: bacula-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2005-08-19 11:20+0200\n" +"POT-Creation-Date: 2006-02-26 13:10+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,35 +16,35 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: src/cats/bdb.c:135 +#: src/cats/bdb.c:128 msgid "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" msgstr "" -#: src/cats/bdb.c:136 +#: src/cats/bdb.c:129 msgid "WARNING!!!! The Internal Database is NOT OPERATIONAL!\n" msgstr "" -#: src/cats/bdb.c:137 +#: src/cats/bdb.c:130 msgid "You should use SQLite, PostgreSQL, or MySQL\n" msgstr "" -#: src/cats/bdb.c:159 src/cats/mysql.c:130 src/cats/postgresql.c:128 +#: src/cats/bdb.c:152 src/cats/mysql.c:124 src/cats/postgresql.c:128 #: src/cats/sqlite.c:122 #, c-format msgid "Unable to initialize DB lock. ERR=%s\n" msgstr "" -#: src/cats/bdb.c:169 +#: src/cats/bdb.c:162 #, c-format msgid "Unable to open Catalog DB control file %s: ERR=%s\n" msgstr "" -#: src/cats/bdb.c:224 +#: src/cats/bdb.c:217 #, c-format msgid "Error reading catalog DB control file. ERR=%s\n" msgstr "" -#: src/cats/bdb.c:227 +#: src/cats/bdb.c:220 #, c-format msgid "" "Error, catalog DB control file wrong version. Wanted %d, got %d\n" @@ -61,11 +61,11 @@ msgstr "" msgid "Error updating DB Media file. ERR=%s\n" msgstr "" -#: src/cats/mysql.c:66 +#: src/cats/mysql.c:60 msgid "A user name for MySQL must be supplied.\n" msgstr "" -#: src/cats/mysql.c:167 +#: src/cats/mysql.c:161 #, c-format msgid "" "Unable to connect to MySQL server. \n" @@ -73,7 +73,7 @@ msgid "" "It is probably not running or your password is incorrect.\n" msgstr "" -#: src/cats/mysql.c:326 src/cats/postgresql.c:264 src/cats/sqlite.c:323 +#: src/cats/mysql.c:320 src/cats/postgresql.c:264 src/cats/sqlite.c:323 #, c-format msgid "Query failed: %s: ERR=%s\n" msgstr "" @@ -133,15 +133,15 @@ msgid "" "%s\n" msgstr "" -#: src/cats/sql.c:209 src/cats/sql.c:216 src/cats/sql_create.c:772 -#: src/cats/sql_get.c:180 src/cats/sql_get.c:231 src/cats/sql_get.c:563 -#: src/cats/sql_get.c:638 src/cats/sql_get.c:865 +#: src/cats/sql.c:209 src/cats/sql.c:216 src/cats/sql_create.c:773 +#: src/cats/sql_get.c:180 src/cats/sql_get.c:231 src/cats/sql_get.c:564 +#: src/cats/sql_get.c:639 src/cats/sql_get.c:866 #, c-format msgid "error fetching row: %s\n" msgstr "" -#: src/cats/sql.c:326 src/dird/catreq.c:360 src/dird/catreq.c:392 -#: src/dird/catreq.c:417 +#: src/cats/sql.c:326 src/dird/catreq.c:369 src/dird/catreq.c:401 +#: src/dird/catreq.c:426 #, c-format msgid "Attribute create error. %s" msgstr "" @@ -160,215 +160,141 @@ msgstr "" msgid "Create DB Job record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:91 src/dird/dird_conf.c:532 src/dird/ua_cmds.c:422 -#: src/dird/ua_prune.c:454 src/dird/ua_run.c:643 src/dird/ua_select.c:228 -#: src/dird/ua_select.c:249 -msgid "Job" -msgstr "" - -#: src/cats/sql_create.c:131 +#: src/cats/sql_create.c:132 #, c-format msgid "Create JobMedia record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:140 +#: src/cats/sql_create.c:141 #, c-format msgid "Update Media record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:170 +#: src/cats/sql_create.c:171 #, c-format msgid "pool record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:196 +#: src/cats/sql_create.c:197 #, c-format msgid "Create db Pool record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:201 src/dird/ua_run.c:650 src/dird/ua_select.c:464 -#: src/dird/ua_select.c:554 src/dird/ua_update.c:356 src/dird/ua_update.c:426 -#: src/wx-console/wxbrestorepanel.cpp:362 -#: src/wx-console/wxbrestorepanel.cpp:548 -#: src/wx-console/wxbrestorepanel.cpp:558 -#: src/wx-console/wxbrestorepanel.cpp:1754 -msgid "Pool" -msgstr "" - -#: src/cats/sql_create.c:227 +#: src/cats/sql_create.c:228 #, c-format msgid "Device record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:243 +#: src/cats/sql_create.c:244 #, c-format msgid "Create db Device record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:248 -msgid "Device" -msgstr "" - -#: src/cats/sql_create.c:276 +#: src/cats/sql_create.c:277 #, c-format msgid "More than one Storage record!: %d\n" msgstr "" -#: src/cats/sql_create.c:281 +#: src/cats/sql_create.c:282 #, c-format msgid "error fetching Storage row: %s\n" msgstr "" -#: src/cats/sql_create.c:301 +#: src/cats/sql_create.c:302 #, c-format msgid "Create DB Storage record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:306 src/dird/ua_run.c:642 src/dird/ua_select.c:152 -#: src/wx-console/wxbrestorepanel.cpp:363 -#: src/wx-console/wxbrestorepanel.cpp:379 -#: src/wx-console/wxbrestorepanel.cpp:500 -#: src/wx-console/wxbrestorepanel.cpp:501 -#: src/wx-console/wxbrestorepanel.cpp:511 -#: src/wx-console/wxbrestorepanel.cpp:512 -#: src/wx-console/wxbrestorepanel.cpp:1116 -#: src/wx-console/wxbrestorepanel.cpp:1765 -#: src/wx-console/wxbrestorepanel.cpp:1831 -msgid "Storage" -msgstr "" - -#: src/cats/sql_create.c:333 +#: src/cats/sql_create.c:334 #, c-format msgid "mediatype record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:349 +#: src/cats/sql_create.c:350 #, c-format msgid "Create db mediatype record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:354 -msgid "MediaType" -msgstr "" - -#: src/cats/sql_create.c:383 +#: src/cats/sql_create.c:384 #, c-format msgid "Volume \"%s\" already exists.\n" msgstr "" -#: src/cats/sql_create.c:421 +#: src/cats/sql_create.c:422 #, c-format msgid "Create DB Media record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:425 -msgid "Media" -msgstr "" - -#: src/cats/sql_create.c:469 +#: src/cats/sql_create.c:470 #, c-format msgid "More than one Client!: %d\n" msgstr "" -#: src/cats/sql_create.c:474 +#: src/cats/sql_create.c:475 #, c-format msgid "error fetching Client row: %s\n" msgstr "" -#: src/cats/sql_create.c:501 +#: src/cats/sql_create.c:502 #, c-format msgid "Create DB Client record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:507 src/dird/ua_run.c:645 src/dird/ua_select.c:272 -#: src/dird/ua_select.c:379 src/wx-console/wxbrestorepanel.cpp:360 -#: src/wx-console/wxbrestorepanel.cpp:378 -#: src/wx-console/wxbrestorepanel.cpp:452 -#: src/wx-console/wxbrestorepanel.cpp:453 -#: src/wx-console/wxbrestorepanel.cpp:463 -#: src/wx-console/wxbrestorepanel.cpp:464 -#: src/wx-console/wxbrestorepanel.cpp:707 -#: src/wx-console/wxbrestorepanel.cpp:1086 -#: src/wx-console/wxbrestorepanel.cpp:1173 -#: src/wx-console/wxbrestorepanel.cpp:1758 -#: src/wx-console/wxbrestorepanel.cpp:1760 -#: src/wx-console/wxbrestorepanel.cpp:1829 -#: src/wx-console/wxbrestorepanel.cpp:1884 -msgid "Client" -msgstr "" - -#: src/cats/sql_create.c:544 +#: src/cats/sql_create.c:545 #, c-format msgid "Create DB Counters record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:577 +#: src/cats/sql_create.c:578 #, c-format msgid "More than one FileSet!: %d\n" msgstr "" -#: src/cats/sql_create.c:582 +#: src/cats/sql_create.c:583 #, c-format msgid "error fetching FileSet row: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:612 +#: src/cats/sql_create.c:613 #, c-format msgid "Create DB FileSet record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:618 src/dird/ua_restore.c:1035 src/dird/ua_run.c:644 -#: src/dird/ua_select.c:173 -msgid "FileSet" -msgstr "" - -#: src/cats/sql_create.c:669 +#: src/cats/sql_create.c:670 #, c-format msgid "Attempt to put non-attributes into catalog. Stream=%d\n" msgstr "" -#: src/cats/sql_create.c:732 +#: src/cats/sql_create.c:733 #, c-format msgid "Create db File record %s failed. ERR=%s" msgstr "" -#: src/cats/sql_create.c:738 src/gnome2-console/restore.c:121 -msgid "File" -msgstr "" - -#: src/cats/sql_create.c:765 src/cats/sql_get.c:224 +#: src/cats/sql_create.c:766 src/cats/sql_get.c:224 #, c-format msgid "More than one Path!: %s for path: %s\n" msgstr "" -#: src/cats/sql_create.c:796 +#: src/cats/sql_create.c:797 #, c-format msgid "Create db Path record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:802 -msgid "Path" -msgstr "" - -#: src/cats/sql_create.c:829 +#: src/cats/sql_create.c:830 #, c-format msgid "More than one Filename! %s for file: %s\n" msgstr "" -#: src/cats/sql_create.c:835 +#: src/cats/sql_create.c:836 #, c-format msgid "Error fetching row for file=%s: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:851 +#: src/cats/sql_create.c:852 #, c-format msgid "Create db Filename record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:856 src/wx-console/wxbrestorepanel.cpp:314 -msgid "Filename" -msgstr "" - #: src/cats/sql_delete.c:79 #, c-format msgid "No pool record %s exists\n" @@ -407,27 +333,27 @@ msgid "" "CMD=%s\n" msgstr "" -#: src/cats/sql_find.c:222 +#: src/cats/sql_find.c:224 #, c-format -msgid "Unknown Job level=%c\n" +msgid "Unknown Job level=%d\n" msgstr "" -#: src/cats/sql_find.c:232 +#: src/cats/sql_find.c:234 #, c-format msgid "No Job found for: %s.\n" msgstr "" -#: src/cats/sql_find.c:243 +#: src/cats/sql_find.c:245 #, c-format msgid "No Job found for: %s\n" msgstr "" -#: src/cats/sql_find.c:312 +#: src/cats/sql_find.c:317 #, c-format msgid "Request for Volume item %d greater than max %d\n" msgstr "" -#: src/cats/sql_find.c:324 +#: src/cats/sql_find.c:329 #, c-format msgid "No Volume record found for item %d.\n" msgstr "" @@ -491,104 +417,104 @@ msgstr "" msgid "No Job found for JobId %s\n" msgstr "" -#: src/cats/sql_get.c:343 src/cats/sql_get.c:398 +#: src/cats/sql_get.c:344 src/cats/sql_get.c:399 #, c-format msgid "No volumes found for JobId=%d\n" msgstr "" -#: src/cats/sql_get.c:349 src/cats/sql_get.c:407 +#: src/cats/sql_get.c:350 src/cats/sql_get.c:408 #, c-format msgid "Error fetching row %d: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:363 +#: src/cats/sql_get.c:364 #, c-format msgid "No Volume for JobId %d found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:479 +#: src/cats/sql_get.c:480 #, c-format msgid "Pool id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:516 +#: src/cats/sql_get.c:517 #, c-format msgid "Client id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:558 +#: src/cats/sql_get.c:559 #, c-format msgid "More than one Pool!: %s\n" msgstr "" -#: src/cats/sql_get.c:599 +#: src/cats/sql_get.c:600 msgid "Pool record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:633 +#: src/cats/sql_get.c:634 #, c-format msgid "More than one Client!: %s\n" msgstr "" -#: src/cats/sql_get.c:650 src/cats/sql_get.c:654 +#: src/cats/sql_get.c:651 src/cats/sql_get.c:655 msgid "Client record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:679 +#: src/cats/sql_get.c:680 #, c-format msgid "More than one Counter!: %d\n" msgstr "" -#: src/cats/sql_get.c:684 +#: src/cats/sql_get.c:685 #, c-format msgid "error fetching Counter row: %s\n" msgstr "" -#: src/cats/sql_get.c:704 +#: src/cats/sql_get.c:705 #, c-format msgid "Counter record: %s not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:740 +#: src/cats/sql_get.c:741 #, c-format msgid "Error got %s FileSets but expected only one!\n" msgstr "" -#: src/cats/sql_get.c:745 +#: src/cats/sql_get.c:746 #, c-format msgid "FileSet record \"%s\" not found.\n" msgstr "" -#: src/cats/sql_get.c:755 +#: src/cats/sql_get.c:756 msgid "FileSet record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:812 +#: src/cats/sql_get.c:813 #, c-format msgid "Media id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:860 +#: src/cats/sql_get.c:861 #, c-format msgid "More than one Volume!: %s\n" msgstr "" -#: src/cats/sql_get.c:905 +#: src/cats/sql_get.c:906 #, c-format msgid "Media record MediaId=%s not found.\n" msgstr "" -#: src/cats/sql_get.c:908 +#: src/cats/sql_get.c:909 #, c-format msgid "Media record for Volume \"%s\" not found.\n" msgstr "" -#: src/cats/sql_get.c:915 +#: src/cats/sql_get.c:916 #, c-format msgid "Media record for MediaId=%u not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:918 +#: src/cats/sql_get.c:919 #, c-format msgid "Media record for Vol=%s not found in Catalog.\n" msgstr "" @@ -608,7 +534,7 @@ msgstr "" msgid "Unable to open Database=%s. ERR=%s\n" msgstr "" -#: src/cats/sqlite.c:162 src/lib/bnet_server.c:372 +#: src/cats/sqlite.c:162 src/lib/bnet_server.c:371 msgid "unknown" msgstr "" @@ -627,38 +553,38 @@ msgstr "" msgid "next_index update error: ERR=%s\n" msgstr "" -#: src/console/authenticate.c:104 src/dird/authenticate.c:106 -#: src/dird/authenticate.c:206 src/filed/authenticate.c:124 -#: src/filed/authenticate.c:220 src/stored/authenticate.c:128 -#: src/stored/authenticate.c:232 src/wx-console/authenticate.c:101 +#: src/console/authenticate.c:100 src/dird/authenticate.c:106 +#: src/dird/authenticate.c:206 src/filed/authenticate.c:119 +#: src/filed/authenticate.c:215 src/stored/authenticate.c:128 +#: src/stored/authenticate.c:232 src/wx-console/authenticate.c:106 msgid "" "Authorization problem: Remote server did not advertise required TLS " "support.\n" msgstr "" -#: src/console/authenticate.c:111 src/dird/authenticate.c:113 -#: src/dird/authenticate.c:213 src/filed/authenticate.c:132 -#: src/filed/authenticate.c:228 src/stored/authenticate.c:136 -#: src/stored/authenticate.c:240 src/wx-console/authenticate.c:108 +#: src/console/authenticate.c:107 src/dird/authenticate.c:113 +#: src/dird/authenticate.c:213 src/filed/authenticate.c:127 +#: src/filed/authenticate.c:223 src/stored/authenticate.c:136 +#: src/stored/authenticate.c:240 src/wx-console/authenticate.c:112 msgid "Authorization problem: Remote server requires TLS.\n" msgstr "" -#: src/console/authenticate.c:121 src/wx-console/authenticate.c:118 +#: src/console/authenticate.c:117 src/wx-console/authenticate.c:121 msgid "TLS negotiation failed\n" msgstr "" -#: src/console/authenticate.c:133 src/gnome2-console/authenticate.c:85 +#: src/console/authenticate.c:129 src/gnome2-console/authenticate.c:85 #: src/tray-monitor/authenticate.c:87 #, c-format msgid "Bad response to Hello command: ERR=%s\n" msgstr "" -#: src/console/authenticate.c:140 src/gnome2-console/authenticate.c:95 -#: src/tray-monitor/authenticate.c:94 src/wx-console/authenticate.c:133 +#: src/console/authenticate.c:136 src/gnome2-console/authenticate.c:95 +#: src/tray-monitor/authenticate.c:94 src/wx-console/authenticate.c:136 msgid "Director rejected Hello command\n" msgstr "" -#: src/console/authenticate.c:150 src/wx-console/authenticate.c:143 +#: src/console/authenticate.c:146 src/wx-console/authenticate.c:146 msgid "" "Director authorization problem.\n" "Most likely the passwords do not agree.\n" @@ -703,7 +629,7 @@ msgstr "" msgid "output to file" msgstr "" -#: src/console/console.c:152 src/dird/ua_cmds.c:106 +#: src/console/console.c:152 src/dird/ua_cmds.c:110 msgid "quit" msgstr "" @@ -715,7 +641,7 @@ msgstr "" msgid "sleep specified time" msgstr "" -#: src/console/console.c:155 src/dird/ua_cmds.c:118 +#: src/console/console.c:155 src/dird/ua_cmds.c:122 msgid "print current time" msgstr "" @@ -723,7 +649,7 @@ msgstr "" msgid "print Console's version" msgstr "" -#: src/console/console.c:157 src/dird/ua_cmds.c:95 +#: src/console/console.c:157 src/dird/ua_cmds.c:99 msgid "exit = quit" msgstr "" @@ -731,13 +657,12 @@ msgstr "" msgid "zed_keys = use zed keys instead of bash keys" msgstr "" -#: src/console/console.c:191 src/dird/ua_dotcmds.c:106 +#: src/console/console.c:191 src/dird/ua_dotcmds.c:108 msgid ": is an illegal command\n" msgstr "" -#: src/console/console.c:400 src/dird/dird.c:196 src/filed/filed.c:183 -#: src/gnome2-console/console.c:271 src/stored/stored.c:189 -#: src/wx-console/console_thread.cpp:233 +#: src/console/console.c:400 src/filed/filed.c:183 +#: src/gnome2-console/console.c:271 msgid "TLS library initialization failed.\n" msgstr "" @@ -771,14 +696,14 @@ msgstr "" msgid "Connecting to Director %s:%d\n" msgstr "" -#: src/console/console.c:471 src/gnome2-console/console.c:508 -#: src/wx-console/console_thread.cpp:367 +#: src/console/console.c:471 src/gnome2-console/console.c:504 +#: src/wx-console/console_thread.cpp:370 #, c-format msgid "Failed to initialize TLS context for Console \"%s\".\n" msgstr "" -#: src/console/console.c:492 src/gnome2-console/console.c:530 -#: src/wx-console/console_thread.cpp:388 +#: src/console/console.c:492 src/gnome2-console/console.c:526 +#: src/wx-console/console_thread.cpp:391 #, c-format msgid "Failed to initialize TLS context for Director \"%s\".\n" msgstr "" @@ -791,8 +716,8 @@ msgstr "" #: src/dird/dird.c:711 src/dird/dird.c:777 src/dird/dird.c:829 #: src/filed/filed.c:302 src/filed/filed.c:348 #: src/gnome2-console/console.c:140 src/gnome2-console/console.c:169 -#: src/stored/stored.c:310 src/wx-console/console_thread.cpp:96 -#: src/wx-console/console_thread.cpp:125 +#: src/stored/stored.c:309 src/wx-console/console_thread.cpp:94 +#: src/wx-console/console_thread.cpp:120 msgid "TLS required but not configured in Bacula.\n" msgstr "" @@ -840,18 +765,18 @@ msgid "Cannot open file %s for output. ERR=%s\n" msgstr "" #: src/console/console_conf.c:123 src/gnome2-console/console_conf.c:122 -#: src/wx-console/console_conf.c:124 +#: src/wx-console/console_conf.c:128 #, c-format msgid "No record for %d %s\n" msgstr "" -#: src/console/console_conf.c:132 src/wx-console/console_conf.c:133 +#: src/console/console_conf.c:132 src/wx-console/console_conf.c:137 #, c-format msgid "Console: name=%s rcfile=%s histfile=%s\n" msgstr "" #: src/console/console_conf.c:136 src/gnome2-console/console_conf.c:131 -#: src/wx-console/console_conf.c:137 +#: src/wx-console/console_conf.c:141 #, c-format msgid "Director: name=%s address=%s DIRport=%d\n" msgstr "" @@ -861,25 +786,25 @@ msgstr "" #: src/filed/filed_conf.c:268 src/filed/filed_conf.c:327 #: src/filed/filed_conf.c:357 src/gnome2-console/console_conf.c:142 #: src/gnome2-console/console_conf.c:220 src/gnome2-console/console_conf.c:268 -#: src/gnome2-console/console_conf.c:298 src/stored/stored_conf.c:467 -#: src/stored/stored_conf.c:555 src/stored/stored_conf.c:590 -#: src/wx-console/console_conf.c:141 src/wx-console/console_conf.c:216 -#: src/wx-console/console_conf.c:261 src/wx-console/console_conf.c:288 +#: src/gnome2-console/console_conf.c:298 src/stored/stored_conf.c:510 +#: src/stored/stored_conf.c:598 src/stored/stored_conf.c:633 +#: src/wx-console/console_conf.c:145 src/wx-console/console_conf.c:220 +#: src/wx-console/console_conf.c:265 src/wx-console/console_conf.c:292 #, c-format msgid "Unknown resource type %d\n" msgstr "" -#: src/console/console_conf.c:242 src/dird/dird_conf.c:1109 -#: src/dird/dird_conf.c:1124 src/filed/filed_conf.c:296 +#: src/console/console_conf.c:242 src/dird/dird_conf.c:1112 +#: src/dird/dird_conf.c:1127 src/filed/filed_conf.c:296 #: src/gnome2-console/console_conf.c:246 src/tray-monitor/tray_conf.c:262 -#: src/wx-console/console_conf.c:242 +#: src/wx-console/console_conf.c:246 #, c-format msgid "%s item is required in %s resource, but not found.\n" msgstr "" -#: src/console/console_conf.c:304 src/dird/dird_conf.c:1296 +#: src/console/console_conf.c:304 src/dird/dird_conf.c:1299 #: src/filed/filed_conf.c:374 src/gnome2-console/console_conf.c:314 -#: src/tray-monitor/tray_conf.c:341 src/wx-console/console_conf.c:304 +#: src/tray-monitor/tray_conf.c:341 src/wx-console/console_conf.c:308 #, c-format msgid "Attempt to define second %s resource named \"%s\" is not permitted.\n" msgstr "" @@ -889,7 +814,7 @@ msgstr "" msgid "Start Admin JobId %d, Job=%s\n" msgstr "" -#: src/dird/admin.c:82 src/dird/backup.c:339 src/dird/mac.c:228 +#: src/dird/admin.c:82 src/dird/backup.c:343 src/dird/mac.c:287 #, c-format msgid "Error getting job record for stats: %s" msgstr "" @@ -906,8 +831,8 @@ msgstr "" msgid "Admin Canceled" msgstr "" -#: src/dird/admin.c:102 src/dird/backup.c:451 src/dird/mac.c:330 -#: src/dird/restore.c:258 +#: src/dird/admin.c:102 src/dird/backup.c:455 src/dird/mac.c:389 +#: src/dird/restore.c:246 #, c-format msgid "Inappropriate term code: %c\n" msgstr "" @@ -940,7 +865,7 @@ msgstr "" #: src/dird/authenticate.c:95 msgid "" -"Unable to authenticate with Storage daemon. Possible causes:\n" +"Director unable to authenticate with Storage daemon. Possible causes:\n" "Passwords or names not the same or\n" "Maximum Concurrent Jobs exceeded on the SD or\n" "SD networking messed up (restart daemon).\n" @@ -949,8 +874,8 @@ msgid "" msgstr "" #: src/dird/authenticate.c:123 src/dird/authenticate.c:223 -#: src/dird/authenticate.c:356 src/filed/authenticate.c:141 -#: src/filed/authenticate.c:237 src/stored/authenticate.c:145 +#: src/dird/authenticate.c:356 src/filed/authenticate.c:136 +#: src/filed/authenticate.c:232 src/stored/authenticate.c:145 #: src/stored/authenticate.c:249 msgid "TLS negotiation failed.\n" msgstr "" @@ -1039,84 +964,84 @@ msgid "" "\n" msgstr "" -#: src/dird/backup.c:88 src/dird/backup.c:94 src/dird/mac.c:92 -#: src/dird/ua_output.c:609 +#: src/dird/backup.c:88 src/dird/backup.c:94 src/dird/mac.c:124 +#: src/dird/ua_output.c:611 #, c-format msgid "Pool %s not in database. %s" msgstr "" -#: src/dird/backup.c:92 src/dird/mac.c:96 src/dird/ua_output.c:617 +#: src/dird/backup.c:92 src/dird/mac.c:128 src/dird/ua_output.c:619 #, c-format msgid "Pool %s created in database.\n" msgstr "" -#: src/dird/backup.c:117 +#: src/dird/backup.c:120 msgid "Could not start clone job.\n" msgstr "" -#: src/dird/backup.c:119 +#: src/dird/backup.c:122 #, c-format msgid "Clone JobId %d started.\n" msgstr "" -#: src/dird/backup.c:144 +#: src/dird/backup.c:148 #, c-format -msgid "Start Backup JobId %u, Job=%s\n" +msgid "Start Backup JobId %s, Job=%s\n" msgstr "" -#: src/dird/backup.c:272 +#: src/dird/backup.c:276 #, c-format msgid "Unexpected Client Job message: %s\n" msgstr "" -#: src/dird/backup.c:280 +#: src/dird/backup.c:284 #, c-format msgid "Network error with FD during %s: ERR=%s\n" msgstr "" -#: src/dird/backup.c:296 +#: src/dird/backup.c:300 msgid "No Job status returned from FD.\n" msgstr "" -#: src/dird/backup.c:346 +#: src/dird/backup.c:350 #, c-format msgid "Error getting client record for stats: %s" msgstr "" -#: src/dird/backup.c:352 src/dird/mac.c:235 +#: src/dird/backup.c:356 src/dird/mac.c:294 #, c-format msgid "Error getting Media record for Volume \"%s\": ERR=%s" msgstr "" -#: src/dird/backup.c:380 src/dird/mac.c:263 +#: src/dird/backup.c:384 src/dird/mac.c:322 #, c-format msgid "Could not get Job Volume Parameters to update Bootstrap file. ERR=%s\n" msgstr "" -#: src/dird/backup.c:414 src/dird/mac.c:293 +#: src/dird/backup.c:418 src/dird/mac.c:352 #, c-format msgid "" "Could not open WriteBootstrap file:\n" "%s: ERR=%s\n" msgstr "" -#: src/dird/backup.c:424 src/dird/mac.c:303 +#: src/dird/backup.c:428 src/dird/mac.c:362 msgid "Backup OK -- with warnings" msgstr "" -#: src/dird/backup.c:426 src/dird/mac.c:305 src/stored/bscan.c:1054 +#: src/dird/backup.c:430 src/dird/mac.c:364 src/stored/bscan.c:1060 msgid "Backup OK" msgstr "" -#: src/dird/backup.c:431 src/dird/mac.c:310 src/stored/bscan.c:1058 +#: src/dird/backup.c:435 src/dird/mac.c:369 src/stored/bscan.c:1064 msgid "*** Backup Error ***" msgstr "" -#: src/dird/backup.c:441 src/dird/mac.c:320 src/stored/bscan.c:1061 +#: src/dird/backup.c:445 src/dird/mac.c:379 src/stored/bscan.c:1067 msgid "Backup Canceled" msgstr "" -#: src/dird/backup.c:491 +#: src/dird/backup.c:495 #, c-format msgid "" "Bacula %s (%s): %s\n" @@ -1159,29 +1084,29 @@ msgstr "" msgid "Unable to get Job Volume Parameters. ERR=%s\n" msgstr "" -#: src/dird/bsr.c:201 +#: src/dird/bsr.c:203 #, c-format msgid "Unable to create bootstrap file %s. ERR=%s\n" msgstr "" -#: src/dird/bsr.c:210 +#: src/dird/bsr.c:212 msgid "Error writing bsr file.\n" msgstr "" -#: src/dird/bsr.c:216 +#: src/dird/bsr.c:218 #, c-format msgid "Bootstrap records written to %s\n" msgstr "" -#: src/dird/bsr.c:220 +#: src/dird/bsr.c:222 msgid "The job will require the following Volumes:\n" msgstr "" -#: src/dird/bsr.c:235 +#: src/dird/bsr.c:254 msgid "No Volumes found to restore.\n" msgstr "" -#: src/dird/catreq.c:109 src/dird/catreq.c:298 +#: src/dird/catreq.c:109 src/dird/catreq.c:297 #, c-format msgid "1990 Invalid Catalog Request: %s" msgstr "" @@ -1191,72 +1116,87 @@ msgstr "" msgid "Invalid Catalog request; DB not open: %s" msgstr "" -#: src/dird/catreq.c:131 +#: src/dird/catreq.c:135 msgid "1901 No Media.\n" msgstr "" -#: src/dird/catreq.c:159 +#: src/dird/catreq.c:163 msgid "not in Pool" msgstr "" -#: src/dird/catreq.c:161 +#: src/dird/catreq.c:165 msgid "not correct MediaType" msgstr "" -#: src/dird/catreq.c:187 +#: src/dird/catreq.c:181 #, c-format msgid "1998 Volume \"%s\" status is %s, %s.\n" msgstr "" -#: src/dird/catreq.c:192 +#: src/dird/catreq.c:186 #, c-format msgid "1997 Volume \"%s\" not in catalog.\n" msgstr "" -#: src/dird/catreq.c:213 +#: src/dird/catreq.c:207 #, c-format msgid "Unable to get Media record for Volume %s: ERR=%s\n" msgstr "" -#: src/dird/catreq.c:215 +#: src/dird/catreq.c:209 #, c-format msgid "1991 Catalog Request for vol=%s failed: %s" msgstr "" -#: src/dird/catreq.c:235 +#: src/dird/catreq.c:229 #, c-format msgid "" "Volume Files at %u being set to %u for Volume \"%s\". This is incorrect.\n" msgstr "" -#: src/dird/catreq.c:238 src/dird/catreq.c:270 -msgid "1992 Update Media error\n" +#: src/dird/catreq.c:232 +#, c-format +msgid "1992 Update Media error. VolFiles=%u, CatFiles=%u\n" msgstr "" -#: src/dird/catreq.c:268 +#: src/dird/catreq.c:264 #, c-format msgid "Catalog error updating Media record. %s" msgstr "" -#: src/dird/catreq.c:287 +#: src/dird/catreq.c:266 +msgid "1993 Update Media error\n" +msgstr "" + +#: src/dird/catreq.c:286 #, c-format msgid "Catalog error creating JobMedia record. %s" msgstr "" -#: src/dird/catreq.c:289 +#: src/dird/catreq.c:288 msgid "1991 Update JobMedia error\n" msgstr "" -#: src/dird/catreq.c:299 +#: src/dird/catreq.c:298 #, c-format msgid "Invalid Catalog request: %s" msgstr "" -#: src/dird/catreq.c:398 +#: src/dird/catreq.c:332 +#, c-format +msgid "1991 Invalid Catalog Update: %s" +msgstr "" + +#: src/dird/catreq.c:333 +#, c-format +msgid "Invalid Catalog Update; DB not open: %s" +msgstr "" + +#: src/dird/catreq.c:407 msgid "Got MD5/SHA1 but not same File as attributes\n" msgstr "" -#: src/dird/catreq.c:422 +#: src/dird/catreq.c:431 #, c-format msgid "Catalog error updating MD5/SHA1. %s" msgstr "" @@ -1282,6 +1222,10 @@ msgid "" "\n" msgstr "" +#: src/dird/dird.c:196 src/stored/stored.c:189 +msgid "Cryptography library initialization failed.\n" +msgstr "" + #: src/dird/dird.c:396 msgid "Too many open reload requests. Request ignored.\n" msgstr "" @@ -1311,17 +1255,17 @@ msgstr "" msgid "Only one Director resource permitted in %s\n" msgstr "" -#: src/dird/dird.c:502 src/filed/filed.c:357 src/stored/stored.c:362 +#: src/dird/dird.c:502 src/filed/filed.c:357 src/stored/stored.c:361 #, c-format msgid "\"TLS Certificate\" file not defined for Director \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:508 src/filed/filed.c:363 src/stored/stored.c:368 +#: src/dird/dird.c:508 src/filed/filed.c:363 src/stored/stored.c:367 #, c-format msgid "\"TLS Key\" file not defined for Director \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:514 src/filed/filed.c:369 src/stored/stored.c:374 +#: src/dird/dird.c:514 src/filed/filed.c:369 src/stored/stored.c:373 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " @@ -1329,7 +1273,7 @@ msgid "" "using \"TLS Verify Peer\".\n" msgstr "" -#: src/dird/dird.c:533 src/filed/filed.c:388 src/stored/stored.c:393 +#: src/dird/dird.c:533 src/filed/filed.c:388 src/stored/stored.c:392 #, c-format msgid "Failed to initialize TLS context for Director \"%s\" in %s.\n" msgstr "" @@ -1353,8 +1297,8 @@ msgstr "" msgid "Too many items in Job resource\n" msgstr "" -#: src/dird/dird.c:672 src/dird/job.c:101 src/dird/ua_cmds.c:1425 -#: src/dird/ua_output.c:598 +#: src/dird/dird.c:672 src/dird/job.c:101 src/dird/ua_cmds.c:1480 +#: src/dird/ua_output.c:600 #, c-format msgid "Could not open database \"%s\".\n" msgstr "" @@ -1371,7 +1315,7 @@ msgid "" "Storage \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:733 src/stored/stored.c:348 +#: src/dird/dird.c:733 src/stored/stored.c:347 #, c-format msgid "Failed to initialize TLS context for Storage \"%s\" in %s.\n" msgstr "" @@ -1406,55 +1350,55 @@ msgid "" "File daemon \"%s\" in %s.\n" msgstr "" -#: src/dird/dird_conf.c:441 src/tray-monitor/tray_conf.c:152 +#: src/dird/dird_conf.c:443 src/tray-monitor/tray_conf.c:152 #, c-format msgid "No %s resource defined\n" msgstr "" -#: src/dird/dird_conf.c:450 +#: src/dird/dird_conf.c:452 #, c-format msgid "Director: name=%s MaxJobs=%d FDtimeout=%s SDtimeout=%s\n" msgstr "" -#: src/dird/dird_conf.c:455 +#: src/dird/dird_conf.c:457 #, c-format msgid " query_file=%s\n" msgstr "" -#: src/dird/dird_conf.c:458 src/dird/dird_conf.c:483 src/dird/dird_conf.c:497 -#: src/dird/dird_conf.c:541 src/dird/dird_conf.c:545 src/dird/dird_conf.c:549 -#: src/dird/dird_conf.c:573 src/dird/dird_conf.c:578 src/dird/dird_conf.c:582 -#: src/dird/dird_conf.c:586 src/dird/dird_conf.c:590 src/dird/dird_conf.c:594 -#: src/dird/dird_conf.c:604 +#: src/dird/dird_conf.c:460 src/dird/dird_conf.c:485 src/dird/dird_conf.c:499 +#: src/dird/dird_conf.c:544 src/dird/dird_conf.c:548 src/dird/dird_conf.c:552 +#: src/dird/dird_conf.c:576 src/dird/dird_conf.c:581 src/dird/dird_conf.c:585 +#: src/dird/dird_conf.c:589 src/dird/dird_conf.c:593 src/dird/dird_conf.c:597 +#: src/dird/dird_conf.c:607 msgid " --> " msgstr "" -#: src/dird/dird_conf.c:464 src/dird/dird_conf.c:467 +#: src/dird/dird_conf.c:466 src/dird/dird_conf.c:469 #, c-format msgid "Console: name=%s SSL=%d\n" msgstr "" -#: src/dird/dird_conf.c:473 +#: src/dird/dird_conf.c:475 #, c-format msgid "Counter: name=%s min=%d max=%d cur=%d wrapcntr=%s\n" msgstr "" -#: src/dird/dird_conf.c:478 +#: src/dird/dird_conf.c:480 #, c-format msgid "Counter: name=%s min=%d max=%d\n" msgstr "" -#: src/dird/dird_conf.c:489 +#: src/dird/dird_conf.c:491 #, c-format msgid "Client: name=%s address=%s FDport=%d MaxJobs=%u\n" msgstr "" -#: src/dird/dird_conf.c:492 +#: src/dird/dird_conf.c:494 #, c-format msgid " JobRetention=%s FileRetention=%s AutoPrune=%d\n" msgstr "" -#: src/dird/dird_conf.c:504 +#: src/dird/dird_conf.c:506 #, c-format msgid "" "Device: name=%s ok=%d num_writers=%d max_writers=%d\n" @@ -1463,245 +1407,252 @@ msgid "" " poolid=%s volname=%s MediaType=%s\n" msgstr "" -#: src/dird/dird_conf.c:514 +#: src/dird/dird_conf.c:516 #, c-format msgid "" "Storage: name=%s address=%s SDport=%d MaxJobs=%u\n" " DeviceName=%s MediaType=%s StorageId=%s\n" msgstr "" -#: src/dird/dird_conf.c:523 +#: src/dird/dird_conf.c:525 #, c-format msgid "" "Catalog: name=%s address=%s DBport=%d db_name=%s\n" " db_user=%s MutliDBConn=%d\n" msgstr "" -#: src/dird/dird_conf.c:531 +#: src/dird/dird_conf.c:533 #, c-format -msgid "%s: name=%s JobType=%d level=%s Priority=%d MaxJobs=%u\n" +msgid "%s: name=%s JobType=%d level=%s Priority=%d Enabled=%d\n" +msgstr "" + +#: src/dird/dird_conf.c:534 src/dird/ua_cmds.c:430 src/dird/ua_prune.c:454 +#: src/dird/ua_run.c:643 src/dird/ua_select.c:234 src/dird/ua_select.c:257 +msgid "Job" msgstr "" -#: src/dird/dird_conf.c:532 +#: src/dird/dird_conf.c:534 msgid "JobDefs" msgstr "" -#: src/dird/dird_conf.c:536 +#: src/dird/dird_conf.c:538 #, c-format -msgid " Resched=%d Times=%d Interval=%s Spool=%d WritePartAfterJob=%d\n" +msgid "" +" MaxJobs=%u Resched=%d Times=%d Interval=%s Spool=%d WritePartAfterJob=%" +"d\n" msgstr "" -#: src/dird/dird_conf.c:553 +#: src/dird/dird_conf.c:556 #, c-format msgid " --> Where=%s\n" msgstr "" -#: src/dird/dird_conf.c:556 +#: src/dird/dird_conf.c:559 #, c-format msgid " --> Bootstrap=%s\n" msgstr "" -#: src/dird/dird_conf.c:559 +#: src/dird/dird_conf.c:562 #, c-format msgid " --> RunBefore=%s\n" msgstr "" -#: src/dird/dird_conf.c:562 +#: src/dird/dird_conf.c:565 #, c-format msgid " --> RunAfter=%s\n" msgstr "" -#: src/dird/dird_conf.c:565 +#: src/dird/dird_conf.c:568 #, c-format msgid " --> RunAfterFailed=%s\n" msgstr "" -#: src/dird/dird_conf.c:568 +#: src/dird/dird_conf.c:571 #, c-format msgid " --> WriteBootstrap=%s\n" msgstr "" -#: src/dird/dird_conf.c:600 +#: src/dird/dird_conf.c:603 #, c-format msgid " --> Run=%s\n" msgstr "" -#: src/dird/dird_conf.c:611 +#: src/dird/dird_conf.c:614 #, c-format msgid "FileSet: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:673 src/dird/dird_conf.c:752 +#: src/dird/dird_conf.c:676 src/dird/dird_conf.c:755 #, c-format msgid "Schedule: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:678 +#: src/dird/dird_conf.c:681 #, c-format msgid " --> Run Level=%s\n" msgstr "" -#: src/dird/dird_conf.c:679 +#: src/dird/dird_conf.c:682 msgid " hour=" msgstr "" -#: src/dird/dird_conf.c:688 +#: src/dird/dird_conf.c:691 msgid " mday=" msgstr "" -#: src/dird/dird_conf.c:697 +#: src/dird/dird_conf.c:700 msgid " month=" msgstr "" -#: src/dird/dird_conf.c:706 +#: src/dird/dird_conf.c:709 msgid " wday=" msgstr "" -#: src/dird/dird_conf.c:715 +#: src/dird/dird_conf.c:718 msgid " wom=" msgstr "" -#: src/dird/dird_conf.c:724 +#: src/dird/dird_conf.c:727 msgid " woy=" msgstr "" -#: src/dird/dird_conf.c:733 +#: src/dird/dird_conf.c:736 #, c-format msgid " mins=%d\n" msgstr "" -#: src/dird/dird_conf.c:735 src/dird/dird_conf.c:739 src/dird/dird_conf.c:743 +#: src/dird/dird_conf.c:738 src/dird/dird_conf.c:742 src/dird/dird_conf.c:746 msgid " --> " msgstr "" -#: src/dird/dird_conf.c:756 +#: src/dird/dird_conf.c:759 #, c-format msgid "Pool: name=%s PoolType=%s\n" msgstr "" -#: src/dird/dird_conf.c:758 +#: src/dird/dird_conf.c:761 #, c-format msgid " use_cat=%d use_once=%d acpt_any=%d cat_files=%d\n" msgstr "" -#: src/dird/dird_conf.c:761 +#: src/dird/dird_conf.c:764 #, c-format msgid " max_vols=%d auto_prune=%d VolRetention=%s\n" msgstr "" -#: src/dird/dird_conf.c:764 +#: src/dird/dird_conf.c:767 #, c-format msgid " VolUse=%s recycle=%d LabelFormat=%s\n" msgstr "" -#: src/dird/dird_conf.c:768 +#: src/dird/dird_conf.c:771 #, c-format msgid " CleaningPrefix=%s LabelType=%d\n" msgstr "" -#: src/dird/dird_conf.c:770 +#: src/dird/dird_conf.c:773 #, c-format msgid " RecyleOldest=%d PurgeOldest=%d MaxVolJobs=%d MaxVolFiles=%d\n" msgstr "" -#: src/dird/dird_conf.c:776 +#: src/dird/dird_conf.c:779 #, c-format msgid "Messages: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:778 +#: src/dird/dird_conf.c:781 #, c-format msgid " mailcmd=%s\n" msgstr "" -#: src/dird/dird_conf.c:780 +#: src/dird/dird_conf.c:783 #, c-format msgid " opcmd=%s\n" msgstr "" -#: src/dird/dird_conf.c:783 src/tray-monitor/tray_conf.c:179 +#: src/dird/dird_conf.c:786 src/tray-monitor/tray_conf.c:179 #, c-format msgid "Unknown resource type %d in dump_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1077 src/tray-monitor/tray_conf.c:232 +#: src/dird/dird_conf.c:1080 src/tray-monitor/tray_conf.c:232 #, c-format msgid "Unknown resource type %d in free_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1115 src/lib/parse_conf.c:211 +#: src/dird/dird_conf.c:1118 src/lib/parse_conf.c:211 #: src/tray-monitor/tray_conf.c:268 #, c-format msgid "Too many items in %s resource\n" msgstr "" -#: src/dird/dird_conf.c:1149 +#: src/dird/dird_conf.c:1152 #, c-format msgid "Cannot find Console resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1155 src/filed/filed_conf.c:316 -#: src/stored/stored_conf.c:523 +#: src/dird/dird_conf.c:1158 src/filed/filed_conf.c:316 +#: src/stored/stored_conf.c:566 #, c-format msgid "Cannot find Director resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1162 src/stored/stored_conf.c:529 +#: src/dird/dird_conf.c:1165 src/stored/stored_conf.c:572 #, c-format msgid "Cannot find Storage resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1171 +#: src/dird/dird_conf.c:1174 #, c-format msgid "Cannot find Job resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1189 +#: src/dird/dird_conf.c:1192 #, c-format msgid "Cannot find Counter resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1197 src/filed/filed_conf.c:322 +#: src/dird/dird_conf.c:1200 src/filed/filed_conf.c:322 #, c-format msgid "Cannot find Client resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1209 +#: src/dird/dird_conf.c:1212 #, c-format msgid "Cannot find Schedule resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1214 src/tray-monitor/tray_conf.c:287 +#: src/dird/dird_conf.c:1217 src/tray-monitor/tray_conf.c:287 #, c-format msgid "Unknown resource type %d in save_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1274 src/tray-monitor/tray_conf.c:322 +#: src/dird/dird_conf.c:1277 src/tray-monitor/tray_conf.c:322 #, c-format msgid "Unknown resource type %d in save_resrouce.\n" msgstr "" -#: src/dird/dird_conf.c:1289 +#: src/dird/dird_conf.c:1292 #, c-format msgid "Name item is required in %s resource, but not found.\n" msgstr "" -#: src/dird/dird_conf.c:1301 +#: src/dird/dird_conf.c:1304 #, c-format msgid "Inserting %s res: %s index=%d pass=%d\n" msgstr "" -#: src/dird/dird_conf.c:1374 +#: src/dird/dird_conf.c:1377 #, c-format msgid "Expected a Job Type keyword, got: %s" msgstr "" -#: src/dird/dird_conf.c:1398 +#: src/dird/dird_conf.c:1401 #, c-format msgid "Expected a Job Level keyword, got: %s" msgstr "" -#: src/dird/dird_conf.c:1418 +#: src/dird/dird_conf.c:1421 #, c-format msgid "Expected a Restore replacement option, got: %s" msgstr "" @@ -1787,7 +1738,7 @@ msgstr "" msgid "Unimplemented backup level %d %c\n" msgstr "" -#: src/dird/fd_cmds.c:320 src/filed/job.c:565 +#: src/dird/fd_cmds.c:320 src/filed/job.c:566 #, c-format msgid "Cannot run program: %s. ERR=%s\n" msgstr "" @@ -1806,7 +1757,7 @@ msgstr "" msgid "Cannot open included file: %s. ERR=%s\n" msgstr "" -#: src/dird/fd_cmds.c:441 src/filed/job.c:1617 +#: src/dird/fd_cmds.c:441 src/filed/job.c:1622 #, c-format msgid "Could not open bootstrap file %s: ERR=%s\n" msgstr "" @@ -1818,7 +1769,7 @@ msgid "" "msglen=%d msg=%s\n" msgstr "" -#: src/dird/fd_cmds.c:571 src/dird/verify.c:696 +#: src/dird/fd_cmds.c:571 src/dird/verify.c:700 #, c-format msgid "MD5/SHA1 index %d not same as attributes %d\n" msgstr "" @@ -1828,28 +1779,28 @@ msgstr "" msgid " | ] -- cancel a job" msgstr "" -#: src/dird/ua_cmds.c:92 +#: src/dird/ua_cmds.c:94 msgid "create DB Pool from resource" msgstr "" -#: src/dird/ua_cmds.c:93 +#: src/dird/ua_cmds.c:95 msgid "delete [pool= | media volume=]" msgstr "" -#: src/dird/ua_cmds.c:94 +#: src/dird/ua_cmds.c:96 +msgid "disable -- disable a job" +msgstr "" + +#: src/dird/ua_cmds.c:97 +msgid "enable -- enable a job" +msgstr "" + +#: src/dird/ua_cmds.c:98 msgid "performs FileSet estimate, listing gives full listing" msgstr "" -#: src/dird/ua_cmds.c:96 +#: src/dird/ua_cmds.c:100 msgid "gui [on|off] -- non-interactive gui mode" msgstr "" -#: src/dird/ua_cmds.c:97 src/stored/btape.c:2533 +#: src/dird/ua_cmds.c:101 src/stored/btape.c:2540 msgid "print this command" msgstr "" -#: src/dird/ua_cmds.c:98 +#: src/dird/ua_cmds.c:102 msgid "" "list [pools | jobs | jobtotals | media | files ]; " "from catalog" msgstr "" -#: src/dird/ua_cmds.c:99 +#: src/dird/ua_cmds.c:103 msgid "label a tape" msgstr "" -#: src/dird/ua_cmds.c:100 +#: src/dird/ua_cmds.c:104 msgid "full or long list like list command" msgstr "" -#: src/dird/ua_cmds.c:101 +#: src/dird/ua_cmds.c:105 msgid "messages" msgstr "" -#: src/dird/ua_cmds.c:102 +#: src/dird/ua_cmds.c:106 msgid "mount " msgstr "" -#: src/dird/ua_cmds.c:103 +#: src/dird/ua_cmds.c:107 msgid "prune expired records from catalog" msgstr "" -#: src/dird/ua_cmds.c:104 +#: src/dird/ua_cmds.c:108 msgid "purge records from catalog" msgstr "" -#: src/dird/ua_cmds.c:105 +#: src/dird/ua_cmds.c:109 msgid "python control commands" msgstr "" -#: src/dird/ua_cmds.c:107 +#: src/dird/ua_cmds.c:111 msgid "query catalog" msgstr "" -#: src/dird/ua_cmds.c:108 +#: src/dird/ua_cmds.c:112 msgid "restore files" msgstr "" -#: src/dird/ua_cmds.c:109 +#: src/dird/ua_cmds.c:113 msgid "relabel a tape" msgstr "" -#: src/dird/ua_cmds.c:110 +#: src/dird/ua_cmds.c:114 msgid "release " msgstr "" -#: src/dird/ua_cmds.c:111 +#: src/dird/ua_cmds.c:115 msgid "reload conf file" msgstr "" -#: src/dird/ua_cmds.c:112 +#: src/dird/ua_cmds.c:116 msgid "run " msgstr "" -#: src/dird/ua_cmds.c:113 +#: src/dird/ua_cmds.c:117 msgid "status [storage | client]=" msgstr "" -#: src/dird/ua_cmds.c:114 +#: src/dird/ua_cmds.c:118 msgid "sets debug level" msgstr "" -#: src/dird/ua_cmds.c:115 +#: src/dird/ua_cmds.c:119 msgid "sets new client address -- if authorized" msgstr "" -#: src/dird/ua_cmds.c:116 +#: src/dird/ua_cmds.c:120 msgid "show (resource records) [jobs | pools | ... | all]" msgstr "" -#: src/dird/ua_cmds.c:117 +#: src/dird/ua_cmds.c:121 msgid "use SQL to query catalog" msgstr "" -#: src/dird/ua_cmds.c:119 +#: src/dird/ua_cmds.c:123 msgid "turn on/off trace to file" msgstr "" -#: src/dird/ua_cmds.c:120 +#: src/dird/ua_cmds.c:124 msgid "unmount " msgstr "" -#: src/dird/ua_cmds.c:121 +#: src/dird/ua_cmds.c:125 msgid "umount for old-time Unix guys" msgstr "" -#: src/dird/ua_cmds.c:122 +#: src/dird/ua_cmds.c:126 msgid "update Volume, Pool or slots" msgstr "" -#: src/dird/ua_cmds.c:123 +#: src/dird/ua_cmds.c:127 msgid "use catalog xxx" msgstr "" -#: src/dird/ua_cmds.c:124 +#: src/dird/ua_cmds.c:128 msgid "does variable expansion" msgstr "" -#: src/dird/ua_cmds.c:125 +#: src/dird/ua_cmds.c:129 msgid "print Director version" msgstr "" -#: src/dird/ua_cmds.c:126 +#: src/dird/ua_cmds.c:130 msgid "wait until no jobs are running" msgstr "" -#: src/dird/ua_cmds.c:158 +#: src/dird/ua_cmds.c:168 #, c-format msgid "%s: is an illegal command.\n" msgstr "" -#: src/dird/ua_cmds.c:196 +#: src/dird/ua_cmds.c:206 msgid "" "You probably don't want to be using this command since it\n" "creates database records without labeling the Volumes.\n" @@ -2552,220 +2565,230 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_cmds.c:215 +#: src/dird/ua_cmds.c:225 #, c-format msgid "Pool already has maximum volumes = %d\n" msgstr "" -#: src/dird/ua_cmds.c:217 +#: src/dird/ua_cmds.c:227 msgid "Enter new maximum (zero for unlimited): " msgstr "" -#: src/dird/ua_cmds.c:238 +#: src/dird/ua_cmds.c:248 #, c-format msgid "Enter number of Volumes to create. 0=>fixed name. Max=%d: " msgstr "" -#: src/dird/ua_cmds.c:244 +#: src/dird/ua_cmds.c:254 #, c-format msgid "The number must be between 0 and %d\n" msgstr "" -#: src/dird/ua_cmds.c:251 +#: src/dird/ua_cmds.c:261 msgid "Enter Volume name: " msgstr "" -#: src/dird/ua_cmds.c:255 +#: src/dird/ua_cmds.c:265 msgid "Enter base volume name: " msgstr "" -#: src/dird/ua_cmds.c:264 src/dird/ua_label.c:590 +#: src/dird/ua_cmds.c:274 src/dird/ua_label.c:605 msgid "Volume name too long.\n" msgstr "" -#: src/dird/ua_cmds.c:268 src/dird/ua_label.c:596 src/lib/edit.c:413 +#: src/dird/ua_cmds.c:278 src/dird/ua_label.c:611 src/lib/edit.c:413 msgid "Volume name must be at least one character long.\n" msgstr "" -#: src/dird/ua_cmds.c:277 +#: src/dird/ua_cmds.c:287 msgid "Enter the starting number: " msgstr "" -#: src/dird/ua_cmds.c:282 +#: src/dird/ua_cmds.c:292 msgid "Start number must be greater than zero.\n" msgstr "" -#: src/dird/ua_cmds.c:293 +#: src/dird/ua_cmds.c:303 msgid "Enter slot (0 for none): " msgstr "" -#: src/dird/ua_cmds.c:297 +#: src/dird/ua_cmds.c:307 msgid "InChanger? yes/no: " msgstr "" -#: src/dird/ua_cmds.c:324 +#: src/dird/ua_cmds.c:334 #, c-format msgid "%d Volumes created in pool %s\n" msgstr "" -#: src/dird/ua_cmds.c:340 src/dird/ua_cmds.c:866 +#: src/dird/ua_cmds.c:350 src/dird/ua_cmds.c:917 msgid "Turn on or off? " msgstr "" -#: src/dird/ua_cmds.c:348 src/dird/ua_cmds.c:874 +#: src/dird/ua_cmds.c:358 src/dird/ua_cmds.c:925 msgid "off" msgstr "" -#: src/dird/ua_cmds.c:368 +#: src/dird/ua_cmds.c:378 msgid "jobid" msgstr "" -#: src/dird/ua_cmds.c:375 +#: src/dird/ua_cmds.c:385 #, c-format msgid "JobId %s is not running. Use Job name to cancel inactive jobs.\n" msgstr "" -#: src/dird/ua_cmds.c:379 +#: src/dird/ua_cmds.c:389 msgid "job" msgstr "" -#: src/dird/ua_cmds.c:384 +#: src/dird/ua_cmds.c:394 #, c-format msgid "Warning Job %s is not running. Continuing anyway ...\n" msgstr "" -#: src/dird/ua_cmds.c:407 src/filed/status.c:193 src/stored/status.c:315 +#: src/dird/ua_cmds.c:416 src/filed/status.c:195 src/stored/status.c:343 msgid "No Jobs running.\n" msgstr "" -#: src/dird/ua_cmds.c:410 +#: src/dird/ua_cmds.c:419 msgid "Select Job:\n" msgstr "" -#: src/dird/ua_cmds.c:417 +#: src/dird/ua_cmds.c:425 #, c-format msgid "JobId=%s Job=%s" msgstr "" -#: src/dird/ua_cmds.c:422 +#: src/dird/ua_cmds.c:430 msgid "Choose Job to cancel" msgstr "" -#: src/dird/ua_cmds.c:426 +#: src/dird/ua_cmds.c:434 msgid "Confirm cancel (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:434 +#: src/dird/ua_cmds.c:442 #, c-format msgid "Job %s not found.\n" msgstr "" -#: src/dird/ua_cmds.c:539 +#: src/dird/ua_cmds.c:547 #, c-format msgid "" "Error: Pool %s already exists.\n" "Use update to change it.\n" msgstr "" -#: src/dird/ua_cmds.c:550 +#: src/dird/ua_cmds.c:558 #, c-format msgid "Pool %s created.\n" msgstr "" -#: src/dird/ua_cmds.c:563 +#: src/dird/ua_cmds.c:571 msgid "restart" msgstr "" -#: src/dird/ua_cmds.c:567 +#: src/dird/ua_cmds.c:575 msgid "Python interpreter restarted.\n" msgstr "" -#: src/dird/ua_cmds.c:569 src/dird/ua_cmds.c:1094 +#: src/dird/ua_cmds.c:577 src/dird/ua_cmds.c:1145 msgid "Nothing done.\n" msgstr "" -#: src/dird/ua_cmds.c:585 +#: src/dird/ua_cmds.c:593 src/dird/ua_cmds.c:639 msgid "Illegal command from this console.\n" msgstr "" -#: src/dird/ua_cmds.c:592 src/dird/ua_run.c:353 +#: src/dird/ua_cmds.c:600 src/dird/ua_run.c:353 #, c-format msgid "Client \"%s\" not found.\n" msgstr "" -#: src/dird/ua_cmds.c:601 +#: src/dird/ua_cmds.c:609 #, c-format msgid "Client \"%s\" address set to %s\n" msgstr "" -#: src/dird/ua_cmds.c:616 src/dird/ua_status.c:286 +#: src/dird/ua_cmds.c:634 +#, c-format +msgid "Job \"%s\" not found.\n" +msgstr "" + +#: src/dird/ua_cmds.c:643 +#, c-format +msgid "Job \"%s\" %sabled\n" +msgstr "" + +#: src/dird/ua_cmds.c:667 src/dird/ua_status.c:286 #, c-format msgid "Connecting to Storage daemon %s at %s:%d\n" msgstr "" -#: src/dird/ua_cmds.c:622 src/dird/ua_status.c:297 +#: src/dird/ua_cmds.c:673 src/dird/ua_status.c:297 msgid "Connected to storage daemon\n" msgstr "" -#: src/dird/ua_cmds.c:642 src/dird/ua_cmds.c:981 src/dird/ua_status.c:324 +#: src/dird/ua_cmds.c:693 src/dird/ua_cmds.c:1032 src/dird/ua_status.c:324 #, c-format msgid "Connecting to Client %s at %s:%d\n" msgstr "" -#: src/dird/ua_cmds.c:645 src/dird/ua_cmds.c:984 +#: src/dird/ua_cmds.c:696 src/dird/ua_cmds.c:1035 msgid "Failed to connect to Client.\n" msgstr "" -#: src/dird/ua_cmds.c:761 +#: src/dird/ua_cmds.c:812 msgid "Enter new debug level: " msgstr "" -#: src/dird/ua_cmds.c:827 +#: src/dird/ua_cmds.c:878 msgid "Available daemons are: \n" msgstr "" -#: src/dird/ua_cmds.c:832 +#: src/dird/ua_cmds.c:883 msgid "Select daemon type to set debug level" msgstr "" -#: src/dird/ua_cmds.c:936 src/dird/ua_run.c:478 +#: src/dird/ua_cmds.c:987 src/dird/ua_run.c:478 #, c-format msgid "Level %s not valid.\n" msgstr "" -#: src/dird/ua_cmds.c:949 +#: src/dird/ua_cmds.c:1000 msgid "No job specified.\n" msgstr "" -#: src/dird/ua_cmds.c:989 +#: src/dird/ua_cmds.c:1040 msgid "Error sending include list.\n" msgstr "" -#: src/dird/ua_cmds.c:994 +#: src/dird/ua_cmds.c:1045 msgid "Error sending exclude list.\n" msgstr "" -#: src/dird/ua_cmds.c:1080 +#: src/dird/ua_cmds.c:1131 msgid "" "In general it is not a good idea to delete either a\n" "Pool or a Volume since they may contain data.\n" "\n" msgstr "" -#: src/dird/ua_cmds.c:1083 +#: src/dird/ua_cmds.c:1134 msgid "Choose catalog item to delete" msgstr "" -#: src/dird/ua_cmds.c:1151 +#: src/dird/ua_cmds.c:1202 msgid "Enter JobId to delete: " msgstr "" -#: src/dird/ua_cmds.c:1194 +#: src/dird/ua_cmds.c:1245 #, c-format msgid "Job %s and associated records deleted from the catalog.\n" msgstr "" -#: src/dird/ua_cmds.c:1207 +#: src/dird/ua_cmds.c:1258 #, c-format msgid "" "\n" @@ -2773,58 +2796,62 @@ msgid "" "and all Jobs saved on that volume from the Catalog\n" msgstr "" -#: src/dird/ua_cmds.c:1211 +#: src/dird/ua_cmds.c:1262 msgid "Are you sure you want to delete this Volume? (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:1232 +#: src/dird/ua_cmds.c:1283 msgid "Are you sure you want to delete this Pool? (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:1329 +#: src/dird/ua_cmds.c:1380 #, c-format msgid "Using Catalog name=%s DB=%s\n" msgstr "" -#: src/dird/ua_cmds.c:1370 src/dird/ua_tree.c:594 src/stored/btape.c:2580 +#: src/dird/ua_cmds.c:1421 src/dird/ua_tree.c:622 src/stored/btape.c:2587 #, c-format msgid "" " Command Description\n" " ======= ===========\n" msgstr "" -#: src/dird/ua_cmds.c:1372 +#: src/dird/ua_cmds.c:1423 #, c-format msgid " %-10s %s\n" msgstr "" -#: src/dird/ua_cmds.c:1374 +#: src/dird/ua_cmds.c:1425 msgid "" "\n" "When at a prompt, entering a period cancels the command.\n" "\n" msgstr "" -#: src/dird/ua_cmds.c:1390 +#: src/dird/ua_cmds.c:1441 #, c-format msgid "%s Version: %s (%s)\n" msgstr "" -#: src/dird/ua_cmds.c:1409 +#: src/dird/ua_cmds.c:1460 msgid "Could not find a Catalog resource\n" msgstr "" -#: src/dird/ua_cmds.c:1412 +#: src/dird/ua_cmds.c:1463 +msgid "You must specify a \"use \" command before continuing.\n" +msgstr "" + +#: src/dird/ua_cmds.c:1467 #, c-format msgid "Using default Catalog name=%s DB=%s\n" msgstr "" -#: src/dird/ua_dotcmds.c:121 +#: src/dird/ua_dotcmds.c:131 msgid "The Director will segment fault.\n" msgstr "" -#: src/dird/ua_dotcmds.c:221 src/dird/ua_restore.c:747 -#: src/dird/ua_restore.c:785 +#: src/dird/ua_dotcmds.c:231 src/dird/ua_restore.c:740 +#: src/dird/ua_restore.c:778 src/dird/ua_restore.c:809 #, c-format msgid "Query failed: %s. ERR=%s\n" msgstr "" @@ -2838,15 +2865,16 @@ msgstr "" msgid "Expected a positive integer, got: %s\n" msgstr "" -#: src/dird/ua_input.c:120 src/dird/ua_run.c:860 src/dird/ua_select.c:54 -#: src/dird/ua_update.c:232 src/dird/ua_update.c:247 src/dird/ua_update.c:495 +#: src/dird/ua_input.c:120 src/dird/ua_run.c:862 src/dird/ua_select.c:54 +#: src/dird/ua_update.c:223 src/dird/ua_update.c:237 src/dird/ua_update.c:247 +#: src/dird/ua_update.c:261 src/dird/ua_update.c:551 #: src/stored/parse_bsr.c:741 src/tools/dbcheck.c:1098 msgid "yes" msgstr "" -#: src/dird/ua_input.c:124 src/dird/ua_select.c:57 src/dird/ua_update.c:234 -#: src/dird/ua_update.c:247 src/dird/ua_update.c:495 -#: src/stored/parse_bsr.c:741 +#: src/dird/ua_input.c:124 src/dird/ua_select.c:57 src/dird/ua_update.c:225 +#: src/dird/ua_update.c:237 src/dird/ua_update.c:249 src/dird/ua_update.c:261 +#: src/dird/ua_update.c:551 src/stored/parse_bsr.c:741 msgid "no" msgstr "" @@ -2854,271 +2882,287 @@ msgstr "" msgid "Invalid response. You must answer yes or no.\n" msgstr "" -#: src/dird/ua_label.c:88 +#: src/dird/ua_label.c:89 msgid "Negative numbers not permitted\n" msgstr "" -#: src/dird/ua_label.c:94 +#: src/dird/ua_label.c:95 msgid "Range end is not integer.\n" msgstr "" -#: src/dird/ua_label.c:99 +#: src/dird/ua_label.c:100 msgid "Range start is not an integer.\n" msgstr "" -#: src/dird/ua_label.c:105 +#: src/dird/ua_label.c:106 msgid "Range end not bigger than start.\n" msgstr "" -#: src/dird/ua_label.c:111 +#: src/dird/ua_label.c:112 msgid "Input value is not an integer.\n" msgstr "" -#: src/dird/ua_label.c:117 +#: src/dird/ua_label.c:118 msgid "Values must be be greater than zero.\n" msgstr "" -#: src/dird/ua_label.c:121 +#: src/dird/ua_label.c:122 msgid "Slot too large.\n" msgstr "" -#: src/dird/ua_label.c:176 src/dird/ua_label.c:463 +#: src/dird/ua_label.c:176 src/dird/ua_label.c:473 msgid "No slots in changer to scan.\n" msgstr "" -#: src/dird/ua_label.c:188 src/dird/ua_label.c:474 +#: src/dird/ua_label.c:188 src/dird/ua_label.c:484 msgid "No Volumes found to label, or no barcodes.\n" msgstr "" -#: src/dird/ua_label.c:195 +#: src/dird/ua_label.c:198 #, c-format -msgid "Slot %d larger than max %d ignored.\n" +msgid "Slot %d greater than max %d ignored.\n" msgstr "" -#: src/dird/ua_label.c:224 +#: src/dird/ua_label.c:227 #, c-format -msgid "No VolName for Slot=%d set InChanger to zero.\n" +msgid "No VolName for Slot=%d InChanger set to zero.\n" msgstr "" -#: src/dird/ua_label.c:239 +#: src/dird/ua_label.c:242 #, c-format msgid "Catalog record for Volume \"%s\" updated to reference slot %d.\n" msgstr "" -#: src/dird/ua_label.c:243 +#: src/dird/ua_label.c:246 #, c-format msgid "Catalog record for Volume \"%s\" is up to date.\n" msgstr "" -#: src/dird/ua_label.c:249 +#: src/dird/ua_label.c:252 #, c-format -msgid "Record for Volume \"%s\" not found in catalog.\n" +msgid "Volume \"%s\" not found in catalog. Slot=%d InChanger set to zero.\n" msgstr "" -#: src/dird/ua_label.c:334 +#: src/dird/ua_label.c:344 #, c-format msgid "" "Volume \"%s\" has VolStatus %s. It must be Purged or Recycled before " "relabeling.\n" msgstr "" -#: src/dird/ua_label.c:350 +#: src/dird/ua_label.c:360 msgid "Enter new Volume name: " msgstr "" -#: src/dird/ua_label.c:363 +#: src/dird/ua_label.c:373 #, c-format msgid "Media record for new Volume \"%s\" already exists.\n" msgstr "" -#: src/dird/ua_label.c:378 +#: src/dird/ua_label.c:388 msgid "Enter slot (0 or Enter for none): " msgstr "" -#: src/dird/ua_label.c:403 +#: src/dird/ua_label.c:413 #, c-format msgid "Delete of Volume \"%s\" failed. ERR=%s" msgstr "" -#: src/dird/ua_label.c:406 +#: src/dird/ua_label.c:416 #, c-format msgid "Old volume \"%s\" deleted from catalog.\n" msgstr "" -#: src/dird/ua_label.c:417 +#: src/dird/ua_label.c:427 #, c-format msgid "Requesting to mount %s ...\n" msgstr "" -#: src/dird/ua_label.c:439 +#: src/dird/ua_label.c:449 msgid "Do not forget to mount the drive!!!\n" msgstr "" -#: src/dird/ua_label.c:479 +#: src/dird/ua_label.c:489 msgid "" "The following Volumes will be labeled:\n" "Slot Volume\n" "==============\n" msgstr "" -#: src/dird/ua_label.c:488 src/stored/btape.c:608 +#: src/dird/ua_label.c:498 src/stored/btape.c:606 msgid "Do you want to continue? (y/n): " msgstr "" -#: src/dird/ua_label.c:509 +#: src/dird/ua_label.c:519 #, c-format msgid "Media record for Slot %d Volume \"%s\" already exists.\n" msgstr "" -#: src/dird/ua_label.c:515 +#: src/dird/ua_label.c:525 #, c-format msgid "Error setting InChanger: ERR=%s" msgstr "" -#: src/dird/ua_label.c:540 +#: src/dird/ua_label.c:548 +#, c-format +msgid "Maximum pool Volumes=%d reached.\n" +msgstr "" + +#: src/dird/ua_label.c:555 #, c-format msgid "Catalog record for cleaning tape \"%s\" successfully created.\n" msgstr "" -#: src/dird/ua_label.c:547 +#: src/dird/ua_label.c:562 #, c-format msgid "Catalog error on cleaning tape: %s" msgstr "" -#: src/dird/ua_label.c:583 +#: src/dird/ua_label.c:598 #, c-format msgid "Illegal character \"%c\" in a volume name.\n" msgstr "" -#: src/dird/ua_label.c:628 +#: src/dird/ua_label.c:643 #, c-format msgid "Sending relabel command from \"%s\" to \"%s\" ...\n" msgstr "" -#: src/dird/ua_label.c:635 +#: src/dird/ua_label.c:650 #, c-format msgid "Sending label command for Volume \"%s\" Slot %d ...\n" msgstr "" -#: src/dird/ua_label.c:665 +#: src/dird/ua_label.c:682 #, c-format msgid "Catalog record for Volume \"%s\", Slot %d successfully created.\n" msgstr "" -#: src/dird/ua_label.c:678 +#: src/dird/ua_label.c:695 #, c-format msgid "Label command failed for Volume %s.\n" msgstr "" -#: src/dird/ua_label.c:688 +#: src/dird/ua_label.c:705 #, c-format msgid "Connecting to Storage daemon %s at %s:%d ...\n" msgstr "" -#: src/dird/ua_label.c:716 +#: src/dird/ua_label.c:733 msgid "Could not open SD socket.\n" msgstr "" -#: src/dird/ua_label.c:722 +#: src/dird/ua_label.c:739 #, c-format msgid "readlabel %s Slot=%d drive=%d\n" msgstr "" -#: src/dird/ua_label.c:764 +#: src/dird/ua_label.c:781 #, c-format msgid "autochanger list %s \n" msgstr "" -#: src/dird/ua_label.c:788 src/dird/ua_label.c:798 +#: src/dird/ua_label.c:805 src/dird/ua_label.c:815 #, c-format msgid "Invalid Slot number: %s\n" msgstr "" -#: src/dird/ua_label.c:807 +#: src/dird/ua_label.c:824 #, c-format msgid "Invalid Volume name: %s\n" msgstr "" -#: src/dird/ua_label.c:876 +#: src/dird/ua_label.c:893 #, c-format -msgid "autochanger slots %s \n" +msgid "autochanger slots %s\n" msgstr "" -#: src/dird/ua_label.c:886 +#: src/dird/ua_label.c:903 #, c-format msgid "Device \"%s\" has %d slots.\n" msgstr "" -#: src/dird/ua_label.c:902 +#: src/dird/ua_label.c:925 +#, c-format +msgid "autochanger drives %s\n" +msgstr "" + +#: src/dird/ua_label.c:952 #, c-format msgid "Pool \"%s\" resource not found!\n" msgstr "" -#: src/dird/ua_output.c:64 src/dird/ua_output.c:90 +#: src/dird/ua_output.c:64 src/dird/ua_output.c:88 msgid "ON or OFF keyword missing.\n" msgstr "" -#: src/dird/ua_output.c:178 +#: src/dird/ua_output.c:176 msgid "Keywords for the show command are:\n" msgstr "" -#: src/dird/ua_output.c:184 +#: src/dird/ua_output.c:182 #, c-format msgid "%s resource %s not found.\n" msgstr "" -#: src/dird/ua_output.c:187 +#: src/dird/ua_output.c:185 #, c-format msgid "Resource %s not found\n" msgstr "" -#: src/dird/ua_output.c:253 +#: src/dird/ua_output.c:251 msgid "Hey! DB is NULL\n" msgstr "" -#: src/dird/ua_output.c:353 +#: src/dird/ua_output.c:358 #, c-format msgid "Jobid %d used %d Volume(s): %s\n" msgstr "" -#: src/dird/ua_output.c:365 +#: src/dird/ua_output.c:376 msgid "No Pool specified.\n" msgstr "" -#: src/dird/ua_output.c:375 src/dird/ua_select.c:446 +#: src/dird/ua_output.c:387 src/dird/ua_select.c:458 #, c-format msgid "Error obtaining pool ids. ERR=%s\n" msgstr "" -#: src/dird/ua_output.c:385 +#: src/dird/ua_output.c:397 #, c-format msgid "Pool: %s\n" msgstr "" -#: src/dird/ua_output.c:396 -msgid "No Volume Name specified.\n" +#: src/dird/ua_output.c:413 src/dird/ua_status.c:452 +msgid "Ignoring illegal value for days.\n" msgstr "" -#: src/dird/ua_output.c:409 +#: src/dird/ua_output.c:422 #, c-format msgid "Unknown list keyword: %s\n" msgstr "" -#: src/dird/ua_output.c:434 +#: src/dird/ua_output.c:448 #, c-format msgid "%s is not a job name.\n" msgstr "" -#: src/dird/ua_output.c:450 src/dird/ua_output.c:462 -msgid "Could not find next Volume.\n" +#: src/dird/ua_output.c:469 +#, c-format +msgid "Could not find next Volume for Job %s (%s, %s).\n" +msgstr "" + +#: src/dird/ua_output.c:473 +#, c-format +msgid "The next Volume to be used by Job \"%s\" (%s, %s) will be %s\n" msgstr "" -#: src/dird/ua_output.c:452 +#: src/dird/ua_output.c:483 #, c-format -msgid "The next Volume to be used by Job \"%s\" will be %s\n" +msgid "Could not find next Volume for Job %s.\n" msgstr "" -#: src/dird/ua_output.c:671 +#: src/dird/ua_output.c:673 msgid "You have no messages.\n" msgstr "" @@ -3278,32 +3322,32 @@ msgstr "" msgid "End query mode.\n" msgstr "" -#: src/dird/ua_restore.c:151 +#: src/dird/ua_restore.c:115 msgid "" "No Restore Job Resource found in bacula-dir.conf.\n" "You must create at least one before running this command.\n" msgstr "" -#: src/dird/ua_restore.c:167 +#: src/dird/ua_restore.c:131 msgid "Restore not done.\n" msgstr "" -#: src/dird/ua_restore.c:178 +#: src/dird/ua_restore.c:142 msgid "Unable to construct a valid BSR. Cannot continue.\n" msgstr "" -#: src/dird/ua_restore.c:182 src/dird/ua_restore.c:196 +#: src/dird/ua_restore.c:146 src/dird/ua_restore.c:160 msgid "No files selected to be restored.\n" msgstr "" -#: src/dird/ua_restore.c:190 +#: src/dird/ua_restore.c:154 msgid "" "\n" "1 file selected to be restored.\n" "\n" msgstr "" -#: src/dird/ua_restore.c:193 +#: src/dird/ua_restore.c:157 #, c-format msgid "" "\n" @@ -3311,80 +3355,85 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_restore.c:211 +#: src/dird/ua_restore.c:175 msgid "No Restore Job resource found!\n" msgstr "" -#: src/dird/ua_restore.c:309 +#: src/dird/ua_restore.c:237 +#, c-format +msgid "Missing value for keyword: %s\n" +msgstr "" + +#: src/dird/ua_restore.c:286 msgid "List last 20 Jobs run" msgstr "" -#: src/dird/ua_restore.c:310 +#: src/dird/ua_restore.c:287 msgid "List Jobs where a given File is saved" msgstr "" -#: src/dird/ua_restore.c:311 +#: src/dird/ua_restore.c:288 msgid "Enter list of comma separated JobIds to select" msgstr "" -#: src/dird/ua_restore.c:312 +#: src/dird/ua_restore.c:289 msgid "Enter SQL list command" msgstr "" -#: src/dird/ua_restore.c:313 +#: src/dird/ua_restore.c:290 msgid "Select the most recent backup for a client" msgstr "" -#: src/dird/ua_restore.c:314 +#: src/dird/ua_restore.c:291 msgid "Select backup for a client before a specified time" msgstr "" -#: src/dird/ua_restore.c:315 +#: src/dird/ua_restore.c:292 msgid "Enter a list of files to restore" msgstr "" -#: src/dird/ua_restore.c:316 +#: src/dird/ua_restore.c:293 msgid "Enter a list of files to restore before a specified time" msgstr "" -#: src/dird/ua_restore.c:317 +#: src/dird/ua_restore.c:294 msgid "Find the JobIds of the most recent backup for a client" msgstr "" -#: src/dird/ua_restore.c:318 +#: src/dird/ua_restore.c:295 msgid "Find the JobIds for a backup for a client before a specified time" msgstr "" -#: src/dird/ua_restore.c:319 +#: src/dird/ua_restore.c:296 msgid "Enter a list of directories to restore for found JobIds" msgstr "" -#: src/dird/ua_restore.c:320 src/dird/ua_status.c:702 src/filed/status.c:249 -#: src/stored/status.c:367 src/wx-console/wxbconfigpanel.cpp:191 +#: src/dird/ua_restore.c:297 src/dird/ua_status.c:713 src/filed/status.c:251 +#: src/stored/status.c:412 src/wx-console/wxbconfigpanel.cpp:191 msgid "Cancel" msgstr "" -#: src/dird/ua_restore.c:356 +#: src/dird/ua_restore.c:333 #, c-format msgid "Unknown keyword: %s\n" msgstr "" -#: src/dird/ua_restore.c:374 +#: src/dird/ua_restore.c:357 #, c-format msgid "Improper date format: %s\n" msgstr "" -#: src/dird/ua_restore.c:408 src/dird/ua_select.c:576 +#: src/dird/ua_restore.c:397 src/dird/ua_select.c:590 #, c-format msgid "Error: Pool resource \"%s\" does not exist.\n" msgstr "" -#: src/dird/ua_restore.c:413 +#: src/dird/ua_restore.c:402 #, c-format msgid "Error: Pool resource \"%s\" access not allowed.\n" msgstr "" -#: src/dird/ua_restore.c:432 +#: src/dird/ua_restore.c:421 msgid "" "\n" "First you select one or more JobIds that contain files\n" @@ -3394,217 +3443,226 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_restore.c:444 +#: src/dird/ua_restore.c:433 msgid "To select the JobIds, you have the following choices:\n" msgstr "" -#: src/dird/ua_restore.c:449 +#: src/dird/ua_restore.c:438 msgid "Select item: " msgstr "" -#: src/dird/ua_restore.c:463 +#: src/dird/ua_restore.c:452 msgid "Enter Filename (no path):" msgstr "" -#: src/dird/ua_restore.c:478 src/dird/ua_restore.c:578 +#: src/dird/ua_restore.c:467 src/dird/ua_restore.c:567 msgid "Enter JobId(s), comma separated, to restore: " msgstr "" -#: src/dird/ua_restore.c:484 +#: src/dird/ua_restore.c:473 msgid "Enter SQL list command: " msgstr "" -#: src/dird/ua_restore.c:512 src/dird/ua_restore.c:537 +#: src/dird/ua_restore.c:501 src/dird/ua_restore.c:526 msgid "" "Enter file names with paths, or < to enter a filename\n" "containg a list of file names with paths, and terminate\n" "them with a blank line.\n" msgstr "" -#: src/dird/ua_restore.c:516 src/dird/ua_restore.c:541 +#: src/dird/ua_restore.c:505 src/dird/ua_restore.c:530 msgid "Enter full filename: " msgstr "" -#: src/dird/ua_restore.c:576 +#: src/dird/ua_restore.c:565 #, c-format msgid "You have already seleted the following JobIds: %s\n" msgstr "" -#: src/dird/ua_restore.c:591 +#: src/dird/ua_restore.c:580 msgid "" "Enter full directory names or start the name\n" "with a < to indicate it is a filename containg a list\n" "of directories and terminate them with a blank line.\n" msgstr "" -#: src/dird/ua_restore.c:595 +#: src/dird/ua_restore.c:584 msgid "Enter directory name: " msgstr "" -#: src/dird/ua_restore.c:620 +#: src/dird/ua_restore.c:609 msgid "No Jobs selected.\n" msgstr "" -#: src/dird/ua_restore.c:624 +#: src/dird/ua_restore.c:613 #, c-format msgid "You have selected the following JobIds: %s\n" msgstr "" -#: src/dird/ua_restore.c:627 +#: src/dird/ua_restore.c:616 #, c-format msgid "You have selected the following JobId: %s\n" msgstr "" -#: src/dird/ua_restore.c:636 +#: src/dird/ua_restore.c:624 msgid "Invalid JobId in list.\n" msgstr "" -#: src/dird/ua_restore.c:648 +#: src/dird/ua_restore.c:637 #, c-format msgid "Unable to get Job record for JobId=%s: ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:653 +#: src/dird/ua_restore.c:642 #, c-format msgid "No authorization. Job \"%s\" not selected.\n" msgstr "" -#: src/dird/ua_restore.c:667 +#: src/dird/ua_restore.c:656 msgid "" "The restored files will the most current backup\n" "BEFORE the date you specify below.\n" "\n" msgstr "" -#: src/dird/ua_restore.c:670 +#: src/dird/ua_restore.c:659 msgid "Enter date as YYYY-MM-DD HH:MM:SS :" msgstr "" -#: src/dird/ua_restore.c:676 +#: src/dird/ua_restore.c:665 msgid "Improper date format.\n" msgstr "" -#: src/dird/ua_restore.c:697 +#: src/dird/ua_restore.c:686 #, c-format msgid "Cannot open file %s: ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:705 src/dird/ua_restore.c:709 +#: src/dird/ua_restore.c:694 src/dird/ua_restore.c:698 #, c-format msgid "Error occurred on line %d of %s\n" msgstr "" -#: src/dird/ua_restore.c:751 src/dird/ua_restore.c:789 +#: src/dird/ua_restore.c:744 src/dird/ua_restore.c:782 #, c-format msgid "No database record found for: %s\n" msgstr "" -#: src/dird/ua_restore.c:776 +#: src/dird/ua_restore.c:769 msgid "No JobId specified cannot continue.\n" msgstr "" -#: src/dird/ua_restore.c:895 +#: src/dird/ua_restore.c:813 +#, c-format +msgid "No table found: %s\n" +msgstr "" + +#: src/dird/ua_restore.c:918 #, c-format msgid "" "\n" "Building directory tree for JobId %s ... " msgstr "" -#: src/dird/ua_restore.c:914 +#: src/dird/ua_restore.c:937 msgid "" "\n" "There were no files inserted into the tree, so file selection\n" "is not possible.Most likely your retention policy pruned the files\n" msgstr "" -#: src/dird/ua_restore.c:916 +#: src/dird/ua_restore.c:939 msgid "" "\n" "Do you want to restore all the files? (yes|no): " msgstr "" -#: src/dird/ua_restore.c:932 +#: src/dird/ua_restore.c:955 #, c-format msgid "" "\n" "1 Job, %s files inserted into the tree and marked for extraction.\n" msgstr "" -#: src/dird/ua_restore.c:936 +#: src/dird/ua_restore.c:959 #, c-format msgid "" "\n" "1 Job, %s files inserted into the tree.\n" msgstr "" -#: src/dird/ua_restore.c:942 +#: src/dird/ua_restore.c:965 #, c-format msgid "" "\n" "%d Jobs, %s files inserted into the tree and marked for extraction.\n" msgstr "" -#: src/dird/ua_restore.c:946 +#: src/dird/ua_restore.c:969 #, c-format msgid "" "\n" "%d Jobs, %s files inserted into the tree.\n" msgstr "" -#: src/dird/ua_restore.c:1023 +#: src/dird/ua_restore.c:1046 #, c-format msgid "Error getting FileSet \"%s\": ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:1031 src/dird/ua_select.c:165 +#: src/dird/ua_restore.c:1054 src/dird/ua_select.c:167 msgid "The defined FileSet resources are:\n" msgstr "" -#: src/dird/ua_restore.c:1035 src/dird/ua_select.c:173 +#: src/dird/ua_restore.c:1058 src/dird/ua_run.c:644 src/dird/ua_select.c:175 +msgid "FileSet" +msgstr "" + +#: src/dird/ua_restore.c:1058 src/dird/ua_select.c:175 msgid "Select FileSet resource" msgstr "" -#: src/dird/ua_restore.c:1042 +#: src/dird/ua_restore.c:1065 #, c-format msgid "Error getting FileSet record: %s\n" msgstr "" -#: src/dird/ua_restore.c:1043 +#: src/dird/ua_restore.c:1066 msgid "" "This probably means you modified the FileSet.\n" "Continuing anyway.\n" msgstr "" -#: src/dird/ua_restore.c:1058 +#: src/dird/ua_restore.c:1081 #, c-format msgid "Pool \"%s\" not found, using any pool.\n" msgstr "" -#: src/dird/ua_restore.c:1084 src/dird/ua_restore.c:1100 +#: src/dird/ua_restore.c:1107 src/dird/ua_restore.c:1123 #, c-format msgid "No Full backup before %s found.\n" msgstr "" -#: src/dird/ua_restore.c:1123 +#: src/dird/ua_restore.c:1146 msgid "No jobs found.\n" msgstr "" -#: src/dird/ua_restore.c:1289 +#: src/dird/ua_restore.c:1312 msgid "" "Warning, the JobIds that you selected refer to more than one MediaType.\n" "Restore is not possible. The MediaTypes used are:\n" msgstr "" -#: src/dird/ua_restore.c:1297 +#: src/dird/ua_restore.c:1320 msgid "No MediaType found for your JobIds.\n" msgstr "" -#: src/dird/ua_restore.c:1329 +#: src/dird/ua_restore.c:1352 #, c-format msgid "Warning default storage overridden by %s on command line.\n" msgstr "" -#: src/dird/ua_restore.c:1340 +#: src/dird/ua_restore.c:1363 #, c-format msgid "" "\n" @@ -3759,7 +3817,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:507 src/lib/util.c:301 +#: src/dird/ua_run.c:507 src/lib/util.c:295 msgid "Admin" msgstr "" @@ -3777,7 +3835,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:528 src/lib/util.c:292 +#: src/dird/ua_run.c:528 src/lib/util.c:286 msgid "Backup" msgstr "" @@ -3796,7 +3854,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:554 src/lib/util.c:295 +#: src/dird/ua_run.c:554 src/lib/util.c:289 msgid "Verify" msgstr "" @@ -3849,7 +3907,7 @@ msgstr "" msgid "mod" msgstr "" -#: src/dird/ua_run.c:640 src/dird/ua_update.c:415 +#: src/dird/ua_run.c:640 src/dird/ua_update.c:464 msgid "Parameters to modify:\n" msgstr "" @@ -3857,40 +3915,79 @@ msgstr "" msgid "Level" msgstr "" -#: src/dird/ua_run.c:646 src/wx-console/wxbrestorepanel.cpp:380 -#: src/wx-console/wxbrestorepanel.cpp:808 -#: src/wx-console/wxbrestorepanel.cpp:1833 +#: src/dird/ua_run.c:642 src/dird/ua_select.c:152 +#: src/wx-console/wxbrestorepanel.cpp:321 +#: src/wx-console/wxbrestorepanel.cpp:337 +#: src/wx-console/wxbrestorepanel.cpp:458 +#: src/wx-console/wxbrestorepanel.cpp:459 +#: src/wx-console/wxbrestorepanel.cpp:469 +#: src/wx-console/wxbrestorepanel.cpp:470 +#: src/wx-console/wxbrestorepanel.cpp:1133 +#: src/wx-console/wxbrestorepanel.cpp:1794 +#: src/wx-console/wxbrestorepanel.cpp:1865 +msgid "Storage" +msgstr "" + +#: src/dird/ua_run.c:645 src/dird/ua_select.c:282 src/dird/ua_select.c:391 +#: src/wx-console/wxbrestorepanel.cpp:318 +#: src/wx-console/wxbrestorepanel.cpp:336 +#: src/wx-console/wxbrestorepanel.cpp:410 +#: src/wx-console/wxbrestorepanel.cpp:411 +#: src/wx-console/wxbrestorepanel.cpp:421 +#: src/wx-console/wxbrestorepanel.cpp:422 +#: src/wx-console/wxbrestorepanel.cpp:669 +#: src/wx-console/wxbrestorepanel.cpp:1103 +#: src/wx-console/wxbrestorepanel.cpp:1190 +#: src/wx-console/wxbrestorepanel.cpp:1787 +#: src/wx-console/wxbrestorepanel.cpp:1789 +#: src/wx-console/wxbrestorepanel.cpp:1863 +#: src/wx-console/wxbrestorepanel.cpp:1918 +msgid "Client" +msgstr "" + +#: src/dird/ua_run.c:646 src/wx-console/wxbrestorepanel.cpp:338 +#: src/wx-console/wxbrestorepanel.cpp:823 +#: src/wx-console/wxbrestorepanel.cpp:1867 msgid "When" msgstr "" -#: src/dird/ua_run.c:647 src/wx-console/wxbrestorepanel.cpp:381 -#: src/wx-console/wxbrestorepanel.cpp:1079 -#: src/wx-console/wxbrestorepanel.cpp:1835 +#: src/dird/ua_run.c:647 src/wx-console/wxbrestorepanel.cpp:339 +#: src/wx-console/wxbrestorepanel.cpp:1096 +#: src/wx-console/wxbrestorepanel.cpp:1869 msgid "Priority" msgstr "" +#: src/dird/ua_run.c:650 src/dird/ua_select.c:476 src/dird/ua_select.c:566 +#: src/dird/ua_update.c:400 src/dird/ua_update.c:475 +#: src/wx-console/wxbrestorepanel.cpp:320 +#: src/wx-console/wxbrestorepanel.cpp:506 +#: src/wx-console/wxbrestorepanel.cpp:516 +#: src/wx-console/wxbrestorepanel.cpp:1783 +msgid "Pool" +msgstr "" + #: src/dird/ua_run.c:652 msgid "Verify Job" msgstr "" -#: src/dird/ua_run.c:655 src/wx-console/wxbrestorepanel.cpp:373 -#: src/wx-console/wxbrestorepanel.cpp:1814 +#: src/dird/ua_run.c:655 src/wx-console/wxbrestorepanel.cpp:331 +#: src/wx-console/wxbrestorepanel.cpp:1848 msgid "Bootstrap" msgstr "" -#: src/dird/ua_run.c:656 src/wx-console/wxbrestorepanel.cpp:374 -#: src/wx-console/wxbrestorepanel.cpp:1055 -#: src/wx-console/wxbrestorepanel.cpp:1816 +#: src/dird/ua_run.c:656 src/wx-console/wxbrestorepanel.cpp:332 +#: src/wx-console/wxbrestorepanel.cpp:1072 +#: src/wx-console/wxbrestorepanel.cpp:1850 msgid "Where" msgstr "" -#: src/dird/ua_run.c:657 src/wx-console/wxbrestorepanel.cpp:376 -#: src/wx-console/wxbrestorepanel.cpp:1063 -#: src/wx-console/wxbrestorepanel.cpp:1820 -#: src/wx-console/wxbrestorepanel.cpp:1821 -#: src/wx-console/wxbrestorepanel.cpp:1822 -#: src/wx-console/wxbrestorepanel.cpp:1823 -#: src/wx-console/wxbrestorepanel.cpp:1824 +#: src/dird/ua_run.c:657 src/wx-console/wxbrestorepanel.cpp:334 +#: src/wx-console/wxbrestorepanel.cpp:1080 +#: src/wx-console/wxbrestorepanel.cpp:1854 +#: src/wx-console/wxbrestorepanel.cpp:1855 +#: src/wx-console/wxbrestorepanel.cpp:1856 +#: src/wx-console/wxbrestorepanel.cpp:1857 +#: src/wx-console/wxbrestorepanel.cpp:1858 msgid "Replace" msgstr "" @@ -3898,7 +3995,7 @@ msgstr "" msgid "JobId" msgstr "" -#: src/dird/ua_run.c:660 src/dird/ua_update.c:430 +#: src/dird/ua_run.c:660 src/dird/ua_update.c:479 msgid "Select parameter to modify" msgstr "" @@ -3907,27 +4004,27 @@ msgid "Levels:\n" msgstr "" #: src/dird/ua_run.c:665 src/filed/status.c:368 src/lib/util.c:319 -#: src/stored/status.c:406 +#: src/stored/status.c:451 msgid "Base" msgstr "" -#: src/dird/ua_run.c:666 src/dird/ua_update.c:106 src/dird/ua_update.c:438 -#: src/filed/status.c:370 src/lib/util.c:321 src/stored/status.c:408 +#: src/dird/ua_run.c:666 src/filed/status.c:370 src/lib/util.c:321 +#: src/stored/status.c:453 msgid "Full" msgstr "" #: src/dird/ua_run.c:667 src/filed/status.c:373 src/lib/util.c:324 -#: src/stored/status.c:411 +#: src/stored/status.c:456 msgid "Incremental" msgstr "" #: src/dird/ua_run.c:668 src/filed/status.c:376 src/lib/util.c:327 -#: src/stored/status.c:414 +#: src/stored/status.c:459 msgid "Differential" msgstr "" #: src/dird/ua_run.c:669 src/filed/status.c:379 src/lib/util.c:330 -#: src/stored/status.c:417 +#: src/stored/status.c:462 msgid "Since" msgstr "" @@ -3940,7 +4037,7 @@ msgid "Initialize Catalog" msgstr "" #: src/dird/ua_run.c:693 src/filed/status.c:382 src/lib/util.c:333 -#: src/stored/status.c:420 +#: src/stored/status.c:465 msgid "Verify Catalog" msgstr "" @@ -3999,16 +4096,16 @@ msgid "" "You must set the bootstrap file to NULL to be able to specify a JobId.\n" msgstr "" -#: src/dird/ua_run.c:867 +#: src/dird/ua_run.c:869 msgid "Job failed.\n" msgstr "" -#: src/dird/ua_run.c:870 +#: src/dird/ua_run.c:872 #, c-format msgid "Job started. JobId=%s\n" msgstr "" -#: src/dird/ua_run.c:876 +#: src/dird/ua_run.c:878 msgid "Job not run.\n" msgstr "" @@ -4041,199 +4138,199 @@ msgstr "" msgid "Select Storage resource" msgstr "" -#: src/dird/ua_select.c:189 +#: src/dird/ua_select.c:193 msgid "catalog" msgstr "" -#: src/dird/ua_select.c:197 +#: src/dird/ua_select.c:201 msgid "The defined Catalog resources are:\n" msgstr "" -#: src/dird/ua_select.c:205 +#: src/dird/ua_select.c:209 msgid "Catalog" msgstr "" -#: src/dird/ua_select.c:205 +#: src/dird/ua_select.c:209 msgid "Select Catalog resource" msgstr "" -#: src/dird/ua_select.c:220 +#: src/dird/ua_select.c:226 msgid "The defined Job resources are:\n" msgstr "" -#: src/dird/ua_select.c:228 +#: src/dird/ua_select.c:234 msgid "Select Job resource" msgstr "" -#: src/dird/ua_select.c:241 +#: src/dird/ua_select.c:249 msgid "The defined Restore Job resources are:\n" msgstr "" -#: src/dird/ua_select.c:249 +#: src/dird/ua_select.c:257 msgid "Select Restore Job" msgstr "" -#: src/dird/ua_select.c:264 +#: src/dird/ua_select.c:274 msgid "The defined Client resources are:\n" msgstr "" -#: src/dird/ua_select.c:272 +#: src/dird/ua_select.c:282 msgid "Select Client (File daemon) resource" msgstr "" -#: src/dird/ua_select.c:297 +#: src/dird/ua_select.c:309 #, c-format msgid "Error: Client resource %s does not exist.\n" msgstr "" -#: src/dird/ua_select.c:322 +#: src/dird/ua_select.c:334 #, c-format msgid "Could not find Client %s: ERR=%s" msgstr "" -#: src/dird/ua_select.c:325 src/lib/bnet_server.c:285 -#: src/lib/bnet_server.c:379 +#: src/dird/ua_select.c:337 src/lib/bnet_server.c:284 +#: src/lib/bnet_server.c:378 msgid "client" msgstr "" -#: src/dird/ua_select.c:326 +#: src/dird/ua_select.c:338 msgid "fd" msgstr "" -#: src/dird/ua_select.c:332 src/dird/ua_select.c:386 +#: src/dird/ua_select.c:344 src/dird/ua_select.c:398 #, c-format msgid "Could not find Client \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:361 +#: src/dird/ua_select.c:373 #, c-format msgid "Error obtaining client ids. ERR=%s\n" msgstr "" -#: src/dird/ua_select.c:365 +#: src/dird/ua_select.c:377 msgid "No clients defined. You must run a job before using this command.\n" msgstr "" -#: src/dird/ua_select.c:369 +#: src/dird/ua_select.c:381 msgid "Defined Clients:\n" msgstr "" -#: src/dird/ua_select.c:379 +#: src/dird/ua_select.c:391 msgid "Select the Client" msgstr "" -#: src/dird/ua_select.c:412 src/dird/ua_select.c:435 src/dird/ua_select.c:471 +#: src/dird/ua_select.c:424 src/dird/ua_select.c:447 src/dird/ua_select.c:483 #, c-format msgid "Could not find Pool \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:450 +#: src/dird/ua_select.c:462 msgid "No pools defined. Use the \"create\" command to create one.\n" msgstr "" -#: src/dird/ua_select.c:454 +#: src/dird/ua_select.c:466 msgid "Defined Pools:\n" msgstr "" -#: src/dird/ua_select.c:464 +#: src/dird/ua_select.c:476 msgid "Select the Pool" msgstr "" -#: src/dird/ua_select.c:494 +#: src/dird/ua_select.c:506 #, c-format msgid "No access to Pool \"%s\"\n" msgstr "" -#: src/dird/ua_select.c:520 +#: src/dird/ua_select.c:532 msgid "Enter MediaId or Volume name: " msgstr "" -#: src/dird/ua_select.c:546 +#: src/dird/ua_select.c:558 msgid "The defined Pool resources are:\n" msgstr "" -#: src/dird/ua_select.c:554 +#: src/dird/ua_select.c:566 msgid "Select Pool resource" msgstr "" -#: src/dird/ua_select.c:587 +#: src/dird/ua_select.c:601 msgid "Enter the JobId to select: " msgstr "" -#: src/dird/ua_select.c:624 +#: src/dird/ua_select.c:638 #, c-format msgid "Could not find Job \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:687 +#: src/dird/ua_select.c:705 #, c-format msgid "Automatically selected %s: %s\n" msgstr "" -#: src/dird/ua_select.c:692 +#: src/dird/ua_select.c:710 #, c-format msgid "Cannot select %s in batch mode.\n" msgstr "" -#: src/dird/ua_select.c:708 +#: src/dird/ua_select.c:722 msgid "Selection is empty!\n" msgstr "" -#: src/dird/ua_select.c:714 +#: src/dird/ua_select.c:728 msgid "Item 1 selected automatically.\n" msgstr "" -#: src/dird/ua_select.c:725 +#: src/dird/ua_select.c:739 msgid "Selection aborted, nothing done.\n" msgstr "" -#: src/dird/ua_select.c:730 +#: src/dird/ua_select.c:744 #, c-format msgid "Please enter a number between 1 and %d\n" msgstr "" -#: src/dird/ua_select.c:778 +#: src/dird/ua_select.c:793 msgid "Storage name given twice.\n" msgstr "" -#: src/dird/ua_select.c:795 +#: src/dird/ua_select.c:810 #, c-format msgid "Expecting jobid=nn command, got: %s\n" msgstr "" -#: src/dird/ua_select.c:799 +#: src/dird/ua_select.c:814 #, c-format msgid "JobId %s is not running.\n" msgstr "" -#: src/dird/ua_select.c:808 +#: src/dird/ua_select.c:823 #, c-format msgid "Expecting job=xxx, got: %s.\n" msgstr "" -#: src/dird/ua_select.c:812 +#: src/dird/ua_select.c:827 #, c-format msgid "Job \"%s\" is not running.\n" msgstr "" -#: src/dird/ua_select.c:828 +#: src/dird/ua_select.c:843 #, c-format msgid "Storage resource \"%s\": not found\n" msgstr "" -#: src/dird/ua_select.c:850 +#: src/dird/ua_select.c:875 msgid "Enter autochanger drive[0]: " msgstr "" -#: src/dird/ua_select.c:879 +#: src/dird/ua_select.c:905 msgid "Media Types defined in conf file:\n" msgstr "" -#: src/dird/ua_select.c:885 +#: src/dird/ua_select.c:911 msgid "Media Type" msgstr "" -#: src/dird/ua_select.c:885 +#: src/dird/ua_select.c:911 msgid "Select the Media Type" msgstr "" @@ -4259,24 +4356,24 @@ msgstr "" msgid "%s Version: %s (%s) %s %s %s\n" msgstr "" -#: src/dird/ua_status.c:249 src/stored/status.c:70 +#: src/dird/ua_status.c:249 src/stored/status.c:71 #, c-format msgid "Daemon started %s, 1 Job run since started.\n" msgstr "" -#: src/dird/ua_status.c:252 src/stored/status.c:73 +#: src/dird/ua_status.c:252 src/stored/status.c:74 #, c-format msgid "Daemon started %s, %d Jobs run since started.\n" msgstr "" -#: src/dird/ua_status.c:257 src/filed/status.c:119 src/stored/status.c:77 +#: src/dird/ua_status.c:257 src/filed/status.c:121 src/stored/status.c:78 #, c-format msgid " Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n" msgstr "" -#: src/dird/ua_status.c:277 src/dird/ua_status.c:482 src/dird/ua_status.c:644 -#: src/filed/status.c:196 src/filed/status.c:275 src/stored/status.c:317 -#: src/stored/status.c:393 +#: src/dird/ua_status.c:277 src/dird/ua_status.c:493 src/dird/ua_status.c:655 +#: src/filed/status.c:198 src/filed/status.c:277 src/stored/status.c:345 +#: src/stored/status.c:361 src/stored/status.c:438 msgid "====\n" msgstr "" @@ -4319,244 +4416,244 @@ msgstr "" msgid "%-14s %-8s %3d %-18s %-18s %s\n" msgstr "" -#: src/dird/ua_status.c:480 +#: src/dird/ua_status.c:491 msgid "No Scheduled Jobs.\n" msgstr "" -#: src/dird/ua_status.c:497 src/stored/status.c:269 +#: src/dird/ua_status.c:508 src/stored/status.c:277 msgid "" "\n" "Running Jobs:\n" msgstr "" -#: src/dird/ua_status.c:506 +#: src/dird/ua_status.c:516 #, c-format msgid "Console connected at %s\n" msgstr "" -#: src/dird/ua_status.c:514 +#: src/dird/ua_status.c:526 msgid "" "No Jobs running.\n" "====\n" msgstr "" -#: src/dird/ua_status.c:519 +#: src/dird/ua_status.c:531 msgid " JobId Level Name Status\n" msgstr "" -#: src/dird/ua_status.c:520 src/filed/status.c:219 src/stored/status.c:337 +#: src/dird/ua_status.c:532 src/filed/status.c:221 src/stored/status.c:382 msgid "======================================================================\n" msgstr "" -#: src/dird/ua_status.c:529 +#: src/dird/ua_status.c:540 msgid "is waiting execution" msgstr "" -#: src/dird/ua_status.c:532 +#: src/dird/ua_status.c:543 msgid "is running" msgstr "" -#: src/dird/ua_status.c:535 +#: src/dird/ua_status.c:546 msgid "is blocked" msgstr "" -#: src/dird/ua_status.c:538 +#: src/dird/ua_status.c:549 msgid "has terminated" msgstr "" -#: src/dird/ua_status.c:541 +#: src/dird/ua_status.c:552 msgid "has erred" msgstr "" -#: src/dird/ua_status.c:544 +#: src/dird/ua_status.c:555 msgid "has errors" msgstr "" -#: src/dird/ua_status.c:547 +#: src/dird/ua_status.c:558 msgid "has a fatal error" msgstr "" -#: src/dird/ua_status.c:550 +#: src/dird/ua_status.c:561 msgid "has verify differences" msgstr "" -#: src/dird/ua_status.c:553 +#: src/dird/ua_status.c:564 msgid "has been canceled" msgstr "" -#: src/dird/ua_status.c:557 +#: src/dird/ua_status.c:568 #, c-format msgid "is waiting on Client %s" msgstr "" -#: src/dird/ua_status.c:563 +#: src/dird/ua_status.c:574 #, c-format msgid "is waiting on Storage %s" msgstr "" -#: src/dird/ua_status.c:568 +#: src/dird/ua_status.c:579 msgid "is waiting on max Storage jobs" msgstr "" -#: src/dird/ua_status.c:571 +#: src/dird/ua_status.c:582 msgid "is waiting on max Client jobs" msgstr "" -#: src/dird/ua_status.c:574 +#: src/dird/ua_status.c:585 msgid "is waiting on max Job jobs" msgstr "" -#: src/dird/ua_status.c:577 +#: src/dird/ua_status.c:588 msgid "is waiting on max total jobs" msgstr "" -#: src/dird/ua_status.c:580 +#: src/dird/ua_status.c:591 msgid "is waiting for its start time" msgstr "" -#: src/dird/ua_status.c:583 +#: src/dird/ua_status.c:594 msgid "is waiting for higher priority jobs to finish" msgstr "" -#: src/dird/ua_status.c:588 +#: src/dird/ua_status.c:599 #, c-format msgid "is in unknown state %c" msgstr "" -#: src/dird/ua_status.c:602 +#: src/dird/ua_status.c:613 msgid "is waiting for a mount request" msgstr "" -#: src/dird/ua_status.c:609 +#: src/dird/ua_status.c:620 msgid "is waiting for an appendable Volume" msgstr "" -#: src/dird/ua_status.c:616 +#: src/dird/ua_status.c:627 #, c-format msgid "is waiting for Client %s to connect to Storage %s" msgstr "" -#: src/dird/ua_status.c:632 +#: src/dird/ua_status.c:643 #, c-format msgid "%6d %-6s %-20s %s\n" msgstr "" -#: src/dird/ua_status.c:654 src/filed/status.c:209 src/stored/status.c:328 +#: src/dird/ua_status.c:665 src/filed/status.c:211 src/stored/status.c:373 msgid "No Terminated Jobs.\n" msgstr "" -#: src/dird/ua_status.c:659 src/stored/status.c:333 +#: src/dird/ua_status.c:670 src/stored/status.c:378 msgid "" "\n" "Terminated Jobs:\n" msgstr "" -#: src/dird/ua_status.c:660 +#: src/dird/ua_status.c:671 msgid " JobId Level Files Bytes Status Finished Name \n" msgstr "" -#: src/dird/ua_status.c:661 +#: src/dird/ua_status.c:672 msgid "========================================================================\n" msgstr "" -#: src/dird/ua_status.c:692 src/filed/status.c:239 src/lib/util.c:184 -#: src/stored/status.c:357 +#: src/dird/ua_status.c:703 src/filed/status.c:241 src/lib/util.c:178 +#: src/stored/status.c:402 msgid "Created" msgstr "" -#: src/dird/ua_status.c:696 src/filed/status.c:243 src/lib/util.c:197 -#: src/lib/util.c:264 src/stored/status.c:361 +#: src/dird/ua_status.c:707 src/filed/status.c:245 src/lib/util.c:191 +#: src/lib/util.c:258 src/stored/status.c:406 msgid "Error" msgstr "" -#: src/dird/ua_status.c:699 src/filed/status.c:246 src/stored/status.c:364 +#: src/dird/ua_status.c:710 src/filed/status.c:248 src/stored/status.c:409 msgid "Diffs" msgstr "" -#: src/dird/ua_status.c:705 src/filed/status.c:252 src/lib/util.c:193 -#: src/lib/util.c:260 src/stored/btape.c:1160 src/stored/status.c:370 +#: src/dird/ua_status.c:716 src/filed/status.c:254 src/lib/util.c:187 +#: src/lib/util.c:254 src/stored/btape.c:1158 src/stored/status.c:415 #: src/wx-console/wxbconfigpanel.cpp:180 msgid "OK" msgstr "" -#: src/dird/ua_status.c:708 src/filed/status.c:255 src/stored/status.c:373 +#: src/dird/ua_status.c:719 src/filed/status.c:257 src/stored/status.c:418 msgid "Other" msgstr "" -#: src/dird/ua_status.c:711 src/filed/status.c:266 src/stored/status.c:384 +#: src/dird/ua_status.c:722 src/filed/status.c:268 src/stored/status.c:429 #, c-format msgid "%6d %-6s %8s %14s %-7s %-8s %s\n" msgstr "" -#: src/dird/ua_status.c:719 src/stored/btape.c:180 +#: src/dird/ua_status.c:730 src/stored/btape.c:180 msgid "\n" msgstr "" -#: src/dird/ua_tree.c:57 +#: src/dird/ua_tree.c:58 msgid "change current directory" msgstr "" -#: src/dird/ua_tree.c:58 +#: src/dird/ua_tree.c:59 msgid "count marked files in and below the cd" msgstr "" -#: src/dird/ua_tree.c:59 +#: src/dird/ua_tree.c:60 src/dird/ua_tree.c:61 msgid "long list current directory, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:60 +#: src/dird/ua_tree.c:62 msgid "leave file selection mode" msgstr "" -#: src/dird/ua_tree.c:61 +#: src/dird/ua_tree.c:63 msgid "estimate restore size" msgstr "" -#: src/dird/ua_tree.c:62 +#: src/dird/ua_tree.c:64 msgid "same as done command" msgstr "" -#: src/dird/ua_tree.c:63 +#: src/dird/ua_tree.c:65 msgid "find files, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:64 src/dird/ua_tree.c:73 +#: src/dird/ua_tree.c:66 src/dird/ua_tree.c:75 msgid "print help" msgstr "" -#: src/dird/ua_tree.c:65 +#: src/dird/ua_tree.c:67 msgid "list current directory, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:66 +#: src/dird/ua_tree.c:68 msgid "list the marked files in and below the cd" msgstr "" -#: src/dird/ua_tree.c:67 -msgid "mark dir/file to be restored recursively in dirs" +#: src/dird/ua_tree.c:69 +msgid "mark dir/file to be restored recursively, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:68 +#: src/dird/ua_tree.c:70 msgid "mark directory name to be restored (no files)" msgstr "" -#: src/dird/ua_tree.c:69 +#: src/dird/ua_tree.c:71 msgid "print current working directory" msgstr "" -#: src/dird/ua_tree.c:70 +#: src/dird/ua_tree.c:72 msgid "unmark dir/file to be restored recursively in dir" msgstr "" -#: src/dird/ua_tree.c:71 +#: src/dird/ua_tree.c:73 msgid "unmark directory name only no recursion" msgstr "" -#: src/dird/ua_tree.c:72 +#: src/dird/ua_tree.c:74 msgid "quit and do not do restore" msgstr "" -#: src/dird/ua_tree.c:92 +#: src/dird/ua_tree.c:94 msgid "" "\n" "You are now entering file selection mode where you add (mark) and\n" @@ -4566,286 +4663,90 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_tree.c:102 src/dird/ua_tree.c:633 src/dird/ua_tree.c:641 +#: src/dird/ua_tree.c:104 src/dird/ua_tree.c:664 src/dird/ua_tree.c:672 #, c-format msgid "cwd is: %s\n" msgstr "" -#: src/dird/ua_tree.c:123 +#: src/dird/ua_tree.c:125 msgid "Illegal command. Enter \"done\" to exit.\n" msgstr "" -#: src/dird/ua_tree.c:296 src/dird/ua_tree.c:307 src/dird/ua_tree.c:324 +#: src/dird/ua_tree.c:298 src/dird/ua_tree.c:309 src/dird/ua_tree.c:326 msgid "No files marked.\n" msgstr "" -#: src/dird/ua_tree.c:309 +#: src/dird/ua_tree.c:311 msgid "1 file marked.\n" msgstr "" -#: src/dird/ua_tree.c:311 +#: src/dird/ua_tree.c:313 #, c-format msgid "%s files marked.\n" msgstr "" -#: src/dird/ua_tree.c:338 +#: src/dird/ua_tree.c:340 msgid "No directories marked.\n" msgstr "" -#: src/dird/ua_tree.c:340 +#: src/dird/ua_tree.c:342 msgid "1 directory marked.\n" msgstr "" -#: src/dird/ua_tree.c:342 +#: src/dird/ua_tree.c:344 #, c-format msgid "%s directories marked.\n" msgstr "" -#: src/dird/ua_tree.c:363 +#: src/dird/ua_tree.c:365 #, c-format msgid "%s total files/dirs. %s marked to be restored.\n" msgstr "" -#: src/dird/ua_tree.c:374 +#: src/dird/ua_tree.c:376 msgid "No file specification given.\n" msgstr "" -#: src/dird/ua_tree.c:502 +#: src/dird/ua_tree.c:520 #, c-format msgid "Node %s has no children.\n" msgstr "" -#: src/dird/ua_tree.c:583 +#: src/dird/ua_tree.c:611 #, c-format msgid "%d total files; %d marked to be restored; %s bytes.\n" msgstr "" -#: src/dird/ua_tree.c:625 +#: src/dird/ua_tree.c:656 msgid "Invalid path given.\n" msgstr "" -#: src/dird/ua_tree.c:652 src/dird/ua_tree.c:663 +#: src/dird/ua_tree.c:683 src/dird/ua_tree.c:694 msgid "No files unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:665 +#: src/dird/ua_tree.c:696 msgid "1 file unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:667 +#: src/dird/ua_tree.c:698 #, c-format msgid "%d files unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:678 src/dird/ua_tree.c:694 +#: src/dird/ua_tree.c:709 src/dird/ua_tree.c:725 msgid "No directories unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:696 +#: src/dird/ua_tree.c:727 msgid "1 directory unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:698 +#: src/dird/ua_tree.c:729 #, c-format msgid "%d directories unmarked.\n" msgstr "" -#: src/dird/verify.c:87 -msgid "" -"Unable to find JobId of previous InitCatalog Job.\n" -"Please run a Verify with Level=InitCatalog before\n" -"running the current Job.\n" -msgstr "" - -#: src/dird/verify.c:108 -#, c-format -msgid "Could not get job record for previous Job. ERR=%s" -msgstr "" - -#: src/dird/verify.c:113 -#, c-format -msgid "Last Job %d did not terminate normally. JobStatus=%c\n" -msgstr "" - -#: src/dird/verify.c:117 -#, c-format -msgid "Verifying against JobId=%d Job=%s\n" -msgstr "" - -#: src/dird/verify.c:183 -#, c-format -msgid "Start Verify JobId=%d Level=%s Job=%s\n" -msgstr "" - -#: src/dird/verify.c:262 -msgid "Deprecated feature ... use bootstrap.\n" -msgstr "" - -#: src/dird/verify.c:275 -#, c-format -msgid "Unimplemented Verify level %d(%c)\n" -msgstr "" - -#: src/dird/verify.c:327 -#, c-format -msgid "Unimplemented verify level %d\n" -msgstr "" - -#: src/dird/verify.c:382 -msgid "Verify OK" -msgstr "" - -#: src/dird/verify.c:386 -msgid "*** Verify Error ***" -msgstr "" - -#: src/dird/verify.c:390 -msgid "Verify warnings" -msgstr "" - -#: src/dird/verify.c:393 -msgid "Verify Canceled" -msgstr "" - -#: src/dird/verify.c:396 -msgid "Verify Differences" -msgstr "" - -#: src/dird/verify.c:401 -#, c-format -msgid "Inappropriate term code: %d %c\n" -msgstr "" - -#: src/dird/verify.c:415 -#, c-format -msgid "" -"Bacula %s (%s): %s\n" -" JobId: %d\n" -" Job: %s\n" -" FileSet: %s\n" -" Verify Level: %s\n" -" Client: %s\n" -" Verify JobId: %d\n" -" Verify Job: %s\n" -" Start time: %s\n" -" End time: %s\n" -" Files Expected: %s\n" -" Files Examined: %s\n" -" Non-fatal FD errors: %d\n" -" FD termination status: %s\n" -" SD termination status: %s\n" -" Termination: %s\n" -"\n" -msgstr "" - -#: src/dird/verify.c:450 -#, c-format -msgid "" -"Bacula %s (%s): %s\n" -" JobId: %d\n" -" Job: %s\n" -" FileSet: %s\n" -" Verify Level: %s\n" -" Client: %s\n" -" Verify JobId: %d\n" -" Verify Job: %s\n" -" Start time: %s\n" -" End time: %s\n" -" Files Examined: %s\n" -" Non-fatal FD errors: %d\n" -" FD termination status: %s\n" -" Termination: %s\n" -"\n" -msgstr "" - -#: src/dird/verify.c:526 -#, c-format -msgid "" -"birdqnext->qprev != qp called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:185 +#: src/lib/smartall.c:180 #, c-format msgid "qp->qprev->qnext != qp called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:194 +#: src/lib/smartall.c:189 #, c-format msgid "Buffer overrun called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:265 +#: src/lib/smartall.c:260 #, c-format msgid "sm_realloc size: %d\n" msgstr "" -#: src/lib/smartall.c:306 +#: src/lib/smartall.c:301 #, c-format msgid "sm_realloc %d at %x from %s:%d\n" msgstr "" -#: src/lib/smartall.c:368 +#: src/lib/smartall.c:363 #, c-format msgid "" "\n" @@ -7893,125 +8080,133 @@ msgid "" " Buffer address with bad links: %lx\n" msgstr "" -#: src/lib/smartall.c:379 +#: src/lib/smartall.c:374 #, c-format msgid "Orphaned buffer: %6u bytes allocated at line %d of %s %s\n" msgstr "" -#: src/lib/smartall.c:415 +#: src/lib/smartall.c:410 #, c-format msgid "Damaged buffer found. Called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:445 +#: src/lib/smartall.c:440 #, c-format msgid "" "\n" "Damaged buffers found at %s:%d\n" msgstr "" -#: src/lib/smartall.c:448 +#: src/lib/smartall.c:443 #, c-format msgid " discovery of bad prev link.\n" msgstr "" -#: src/lib/smartall.c:451 +#: src/lib/smartall.c:446 #, c-format msgid " discovery of bad next link.\n" msgstr "" -#: src/lib/smartall.c:454 +#: src/lib/smartall.c:449 #, c-format msgid " discovery of data overrun.\n" msgstr "" -#: src/lib/smartall.c:457 +#: src/lib/smartall.c:452 #, c-format msgid " Buffer address: %lx\n" msgstr "" -#: src/lib/smartall.c:464 +#: src/lib/smartall.c:459 #, c-format msgid "Damaged buffer: %6u bytes allocated at line %d of %s %s\n" msgstr "" -#: src/lib/util.c:187 +#: src/lib/util.c:181 msgid "Running" msgstr "" -#: src/lib/util.c:190 +#: src/lib/util.c:184 msgid "Blocked" msgstr "" -#: src/lib/util.c:200 +#: src/lib/util.c:194 msgid "Non-fatal error" msgstr "" -#: src/lib/util.c:203 src/lib/util.c:270 +#: src/lib/util.c:197 src/lib/util.c:264 msgid "Canceled" msgstr "" -#: src/lib/util.c:206 +#: src/lib/util.c:200 msgid "Verify differences" msgstr "" -#: src/lib/util.c:209 +#: src/lib/util.c:203 msgid "Waiting on FD" msgstr "" -#: src/lib/util.c:212 +#: src/lib/util.c:206 msgid "Wait on SD" msgstr "" -#: src/lib/util.c:215 +#: src/lib/util.c:209 msgid "Wait for new Volume" msgstr "" -#: src/lib/util.c:218 +#: src/lib/util.c:212 msgid "Waiting for mount" msgstr "" -#: src/lib/util.c:221 +#: src/lib/util.c:215 msgid "Waiting for Storage resource" msgstr "" -#: src/lib/util.c:224 +#: src/lib/util.c:218 msgid "Waiting for Job resource" msgstr "" -#: src/lib/util.c:227 +#: src/lib/util.c:221 msgid "Waiting for Client resource" msgstr "" -#: src/lib/util.c:230 +#: src/lib/util.c:224 msgid "Waiting on Max Jobs" msgstr "" -#: src/lib/util.c:233 +#: src/lib/util.c:227 msgid "Waiting for Start Time" msgstr "" -#: src/lib/util.c:236 +#: src/lib/util.c:230 msgid "Waiting on Priority" msgstr "" -#: src/lib/util.c:243 +#: src/lib/util.c:237 #, c-format msgid "Unknown Job termination status=%d" msgstr "" -#: src/lib/util.c:267 +#: src/lib/util.c:261 msgid "Fatal Error" msgstr "" -#: src/lib/util.c:273 +#: src/lib/util.c:267 msgid "Differences" msgstr "" -#: src/lib/util.c:276 +#: src/lib/util.c:270 msgid "Unknown term code" msgstr "" +#: src/lib/util.c:298 +msgid "Migrate" +msgstr "" + +#: src/lib/util.c:301 +msgid "Copy" +msgstr "" + #: src/lib/util.c:304 msgid "Unknown Type" msgstr "" @@ -8259,278 +8454,214 @@ msgstr "" msgid "rwl_writeunlock failure. ERR=%s\n" msgstr "" -#: src/lib/pythonlib.c:108 -msgid "Could not initialize Python\n" -msgstr "" - -#: src/lib/pythonlib.c:113 +#: src/stored/acquire.c:96 #, c-format -msgid "Could not Run Python string %s\n" -msgstr "" - -#: src/lib/pythonlib.c:125 -msgid "Could not initialize Python Job type.\n" +msgid "Hey! num_writers=%d!!!!\n" msgstr "" -#: src/lib/pythonlib.c:130 +#: src/stored/acquire.c:146 #, c-format -msgid "Could not import Python script %s/%s. Python disabled.\n" +msgid "Num_writers=%d not zero. Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:230 -msgid "Could not create Python Job Object.\n" +#: src/stored/acquire.c:154 +#, c-format +msgid "No volumes specified. Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:243 src/lib/pythonlib.c:267 +#: src/stored/acquire.c:182 src/stored/mount.c:73 #, c-format -msgid "Python function \"%s\" not found.\n" +msgid "Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:282 +#: src/stored/acquire.c:193 #, c-format -msgid "Unknown Python daemon event %s\n" +msgid "Open device %s Volume \"%s\" failed (EIO): ERR=%s\n" msgstr "" -#: src/lib/res.c:66 +#: src/stored/acquire.c:198 #, c-format -msgid "rwl_writelock failure at %s:%d: ERR=%s\n" +msgid "Open device %s Volume \"%s\" failed: ERR=%s\n" msgstr "" -#: src/lib/res.c:76 +#: src/stored/acquire.c:263 src/stored/mount.c:67 #, c-format -msgid "rwl_writeunlock failure at %s:%d:. ERR=%s\n" +msgid "Too many errors trying to mount device %s.\n" msgstr "" -#: src/lib/tls.c:108 +#: src/stored/acquire.c:272 #, c-format -msgid "" -"Error with certificate at depth: %d, issuer = %s, subject = %s, ERR=%d:%s\n" +msgid "Ready to read from volume \"%s\" on device %s.\n" msgstr "" -#: src/lib/tls.c:155 -msgid "Error initializing SSL context" +#: src/stored/acquire.c:311 +#, c-format +msgid "Device %s is busy reading.\n" msgstr "" -#: src/lib/tls.c:176 -msgid "Error loading certificate verification stores" +#: src/stored/acquire.c:341 +#, c-format +msgid "Wanted Volume \"%s\", but device %s is busy writing on \"%s\" .\n" msgstr "" -#: src/lib/tls.c:181 +#: src/stored/acquire.c:360 +#, c-format msgid "" -"Either a certificate file or a directory must be specified as a verification " -"store\n" +"Cannot recycle volume \"%s\" on device %s because it is in use by another " +"job.\n" msgstr "" -#: src/lib/tls.c:192 -msgid "Error loading certificate file" +#: src/stored/acquire.c:382 +#, c-format +msgid "Could not ready device %s for append.\n" msgstr "" -#: src/lib/tls.c:200 -msgid "Error loading private key" +#: src/stored/acquire.c:459 src/stored/block.c:354 src/stored/block.c:677 +#: src/stored/block.c:746 +#, c-format +msgid "Could not create JobMedia record for Volume=\"%s\" Job=%s\n" msgstr "" -#: src/lib/tls.c:208 -msgid "Unable to open DH parameters file" +#: src/stored/acquire.c:501 +#, c-format +msgid "Alert: %s" msgstr "" -#: src/lib/tls.c:214 -msgid "Unable to load DH parameters from specified file" +#: src/stored/acquire.c:509 +#, c-format +msgid "3997 Bad alert command: %s: ERR=%s.\n" msgstr "" -#: src/lib/tls.c:218 -msgid "Failed to set TLS Diffie-Hellman parameters" +#: src/stored/ansi_label.c:83 +#, c-format +msgid "Read error on device %s in ANSI label. ERR=%s\n" msgstr "" -#: src/lib/tls.c:227 -msgid "Error setting cipher list, no valid ciphers available\n" +#: src/stored/ansi_label.c:93 +msgid "Insane! End of tape while reading ANSI label.\n" msgstr "" -#: src/lib/tls.c:275 -msgid "Peer failed to present a TLS certificate\n" +#: src/stored/ansi_label.c:117 +msgid "No VOL1 label while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:317 +#: src/stored/ansi_label.c:137 #, c-format -msgid "Peer %s failed to present a TLS certificate\n" +msgid "Wanted ANSI Volume \"%s\" got \"%s\"\n" msgstr "" -#: src/lib/tls.c:416 -msgid "Error creating file descriptor-based BIO" +#: src/stored/ansi_label.c:148 +msgid "No HDR1 label while reading ANSI label.\n" msgstr "" -#: src/lib/tls.c:427 -msgid "Error creating new SSL object" +#: src/stored/ansi_label.c:154 +#, c-format +msgid "ANSI/IBM Volume \"%s\" does not belong to Bacula.\n" msgstr "" -#: src/lib/tls.c:493 src/lib/tls.c:510 -msgid "Connect failure" +#: src/stored/ansi_label.c:165 +msgid "No HDR2 label while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:587 src/lib/tls.c:591 -msgid "TLS shutdown failure." +#: src/stored/ansi_label.c:179 +msgid "Unknown or bad ANSI/IBM label record.\n" msgstr "" -#: src/lib/tls.c:642 src/lib/tls.c:658 -msgid "TLS read/write failure." +#: src/stored/ansi_label.c:186 +msgid "Too many records in while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:716 src/lib/tls.c:773 src/stored/dev.c:212 -#: src/stored/dev.c:230 src/stored/dev.c:236 src/stored/stored_conf.c:550 +#: src/stored/ansi_label.c:285 #, c-format -msgid "Unable to init mutex: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:736 src/lib/tls.c:805 -#, c-format -msgid "Unable to destroy mutex: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:870 -#, c-format -msgid "Unable to init OpenSSL threading: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:880 -msgid "Failed to seed OpenSSL PRNG\n" -msgstr "" - -#: src/lib/tls.c:906 -msgid "Failed to save OpenSSL PRNG\n" -msgstr "" - -#: src/stored/acquire.c:98 -#, c-format -msgid "Hey! num_writers=%d!!!!\n" -msgstr "" - -#: src/stored/acquire.c:146 -#, c-format -msgid "Num_writers=%d not zero. Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:154 -#, c-format -msgid "No volumes specified. Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:182 src/stored/mount.c:72 -#, c-format -msgid "Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:193 -#, c-format -msgid "Open device %s Volume \"%s\" failed (EIO): ERR=%s\n" -msgstr "" - -#: src/stored/acquire.c:208 -#, c-format -msgid "Open device %s Volume \"%s\" failed: ERR=%s\n" -msgstr "" - -#: src/stored/acquire.c:273 src/stored/mount.c:66 -#, c-format -msgid "Too many errors trying to mount device %s.\n" -msgstr "" - -#: src/stored/acquire.c:282 -#, c-format -msgid "Ready to read from volume \"%s\" on device %s.\n" +msgid "ANSI Volume label name \"%s\" longer than 6 chars.\n" msgstr "" -#: src/stored/acquire.c:328 src/stored/reserve.c:664 +#: src/stored/ansi_label.c:302 #, c-format -msgid "Device %s is busy reading.\n" +msgid "Could not write ANSI VOL1 label. ERR=%s\n" msgstr "" -#: src/stored/acquire.c:358 +#: src/stored/ansi_label.c:340 src/stored/ansi_label.c:369 #, c-format -msgid "Wanted Volume \"%s\", but device %s is busy writing on \"%s\" .\n" +msgid "Could not write ANSI HDR1 label. ERR=%s\n" msgstr "" -#: src/stored/acquire.c:377 -#, c-format -msgid "" -"Cannot recycle volume \"%s\" on device %s because it is in use by another " -"job.\n" +#: src/stored/ansi_label.c:345 src/stored/ansi_label.c:376 +msgid "Could not write ANSI HDR1 label.\n" msgstr "" -#: src/stored/acquire.c:399 +#: src/stored/ansi_label.c:381 #, c-format -msgid "Could not ready device %s for append.\n" +msgid "Error writing EOF to tape. ERR=%s" msgstr "" -#: src/stored/acquire.c:464 src/stored/block.c:353 src/stored/block.c:676 -#: src/stored/block.c:744 -#, c-format -msgid "Could not create JobMedia record for Volume=\"%s\" Job=%s\n" +#: src/stored/ansi_label.c:386 +msgid "write_ansi_ibm_label called for non-ANSI/IBM type\n" msgstr "" -#: src/stored/acquire.c:506 -#, c-format -msgid "Alert: %s" +#: src/stored/append.c:49 +msgid "DCR is NULL!!!\n" msgstr "" -#: src/stored/acquire.c:514 -#, c-format -msgid "3997 Bad alert command: %s: ERR=%s.\n" +#: src/stored/append.c:54 +msgid "DEVICE is NULL!!!\n" msgstr "" -#: src/stored/append.c:60 +#: src/stored/append.c:66 msgid "Unable to set network buffer size.\n" msgstr "" -#: src/stored/append.c:73 src/stored/append.c:82 src/stored/append.c:94 -#: src/stored/append.c:249 src/stored/append.c:264 src/stored/append.c:276 -#: src/stored/askdir.c:284 src/stored/askdir.c:285 +#: src/stored/append.c:79 src/stored/append.c:88 src/stored/append.c:100 +#: src/stored/append.c:256 src/stored/append.c:271 src/stored/append.c:283 +#: src/stored/askdir.c:294 src/stored/askdir.c:295 msgid "NULL Volume name. This shouldn't happen!!!\n" msgstr "" -#: src/stored/append.c:88 src/stored/btape.c:1853 +#: src/stored/append.c:94 src/stored/btape.c:1854 #, c-format msgid "Write session label failed. ERR=%s\n" msgstr "" -#: src/stored/append.c:100 +#: src/stored/append.c:106 #, c-format msgid "Network send error to FD. ERR=%s\n" msgstr "" -#: src/stored/append.c:137 +#: src/stored/append.c:143 #, c-format msgid "Error reading data header from FD. ERR=%s\n" msgstr "" -#: src/stored/append.c:159 +#: src/stored/append.c:165 #, c-format msgid "Malformed data header from FD: %s\n" msgstr "" -#: src/stored/append.c:169 +#: src/stored/append.c:175 msgid "File index from FD not positive or sequential\n" msgstr "" -#: src/stored/append.c:199 src/stored/append.c:269 src/stored/spool.c:247 +#: src/stored/append.c:206 src/stored/append.c:276 src/stored/spool.c:248 #, c-format msgid "Fatal append error on device %s: ERR=%s\n" msgstr "" -#: src/stored/append.c:224 +#: src/stored/append.c:231 #, c-format msgid "Error updating file attributes. ERR=%s\n" msgstr "" -#: src/stored/append.c:237 +#: src/stored/append.c:244 #, c-format msgid "Network error on data channel. ERR=%s\n" msgstr "" -#: src/stored/append.c:258 src/stored/btape.c:1969 +#: src/stored/append.c:265 src/stored/btape.c:1976 #, c-format msgid "Error writting end session label. ERR=%s\n" msgstr "" -#: src/stored/append.c:271 +#: src/stored/append.c:278 msgid "Set ok=FALSE after write_block_to_device.\n" msgstr "" @@ -8540,41 +8671,34 @@ msgstr "" #: src/stored/askdir.c:178 #, c-format -msgid "Error getting Volume info: %s\n" +msgid "Error getting Volume info: %s" msgstr "" -#: src/stored/askdir.c:289 src/stored/askdir.c:290 +#: src/stored/askdir.c:299 src/stored/askdir.c:300 msgid "Attempt to update_volume_info in read mode!!!\n" msgstr "" -#: src/stored/askdir.c:318 +#: src/stored/askdir.c:328 #, c-format msgid "Didn't get vol info vol=%s: ERR=%s" msgstr "" -#: src/stored/askdir.c:349 +#: src/stored/askdir.c:359 #, c-format msgid "Error creating JobMedia record: ERR=%s\n" msgstr "" -#: src/stored/askdir.c:356 +#: src/stored/askdir.c:366 #, c-format msgid "Error creating JobMedia record: %s\n" msgstr "" -#: src/stored/askdir.c:424 +#: src/stored/askdir.c:432 #, c-format msgid "Job %s canceled while waiting for mount on Storage Device \"%s\".\n" msgstr "" -#: src/stored/askdir.c:452 -#, c-format -msgid "" -"Please mount Volume \"%s\" on Storage Device %s for Job %s\n" -"Use \"mount\" command to release Job.\n" -msgstr "" - -#: src/stored/askdir.c:462 +#: src/stored/askdir.c:445 #, c-format msgid "" "Job %s waiting. Cannot find any appendable volumes.\n" @@ -8584,45 +8708,31 @@ msgid "" " Pool: %s\n" msgstr "" -#: src/stored/askdir.c:486 src/stored/askdir.c:588 +#: src/stored/askdir.c:469 src/stored/askdir.c:551 #, c-format msgid "Max time exceeded waiting to mount Storage Device %s for Job %s\n" msgstr "" -#: src/stored/askdir.c:496 src/stored/askdir.c:503 -#, c-format -msgid "pthread error in mount_next_volume stat=%d ERR=%s\n" -msgstr "" - -#: src/stored/askdir.c:514 -#, c-format -msgid "" -"Someone woke me up, but I cannot find any appendable\n" -"volumes for Job=%s.\n" +#: src/stored/askdir.c:479 +msgid "pthread error in mount_next_volume.\n" msgstr "" -#: src/stored/askdir.c:558 +#: src/stored/askdir.c:511 msgid "Cannot request another volume: no volume name given.\n" msgstr "" -#: src/stored/askdir.c:564 +#: src/stored/askdir.c:517 #, c-format msgid "Job %s canceled while waiting for mount on Storage Device %s.\n" msgstr "" -#: src/stored/askdir.c:570 +#: src/stored/askdir.c:532 #, c-format msgid "Please mount Volume \"%s\" on Storage Device %s for Job %s\n" msgstr "" -#: src/stored/askdir.c:598 -#, c-format -msgid "pthread error in mount_volume stat=%d ERR=%s\n" -msgstr "" - -#: src/stored/askdir.c:605 -#, c-format -msgid "pthread error in mount_next_volume stat=%d: ERR=%s\n" +#: src/stored/askdir.c:561 +msgid "pthread error in mount_volume\n" msgstr "" #: src/stored/authenticate.c:53 @@ -8650,71 +8760,91 @@ msgid "" "help.\n" msgstr "" -#: src/stored/autochanger.c:95 +#: src/stored/autochanger.c:53 +#, c-format +msgid "No Changer Name given for device %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:59 +#, c-format +msgid "No Changer Command given for device %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:72 +#, c-format +msgid "" +"Media Type not the same for all devices in changer %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:152 #, c-format msgid "3304 Issuing autochanger \"load slot %d, drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:102 +#: src/stored/autochanger.c:161 #, c-format msgid "3305 Autochanger \"load slot %d, drive %d\", status is OK.\n" msgstr "" -#: src/stored/autochanger.c:108 +#: src/stored/autochanger.c:167 #, c-format msgid "3992 Bad autochanger \"load slot %d, drive %d\": ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:153 +#: src/stored/autochanger.c:208 +msgid "3992 Missing Changer command.\n" +msgstr "" + +#: src/stored/autochanger.c:218 #, c-format msgid "3301 Issuing autochanger \"loaded drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:162 +#: src/stored/autochanger.c:227 #, c-format msgid "3302 Autochanger \"loaded drive %d\", result is Slot %d.\n" msgstr "" -#: src/stored/autochanger.c:166 +#: src/stored/autochanger.c:231 #, c-format msgid "3302 Autochanger \"loaded drive %d\", result: nothing loaded.\n" msgstr "" -#: src/stored/autochanger.c:173 +#: src/stored/autochanger.c:238 #, c-format msgid "3991 Bad autochanger \"loaded drive %d\" command: ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:234 src/stored/autochanger.c:304 +#: src/stored/autochanger.c:297 src/stored/autochanger.c:380 #, c-format msgid "3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:247 src/stored/autochanger.c:325 +#: src/stored/autochanger.c:310 src/stored/autochanger.c:401 #, c-format msgid "3995 Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:290 +#: src/stored/autochanger.c:369 #, c-format msgid "Volume %s is in use by device %s\n" msgstr "" -#: src/stored/autochanger.c:358 +#: src/stored/autochanger.c:439 #, c-format msgid "3993 Device %s not an autochanger device.\n" msgstr "" -#: src/stored/autochanger.c:372 +#: src/stored/autochanger.c:464 #, c-format msgid "3306 Issuing autochanger \"%s\" command.\n" msgstr "" -#: src/stored/autochanger.c:377 +#: src/stored/autochanger.c:467 msgid "3996 Open bpipe failed.\n" msgstr "" -#: src/stored/autochanger.c:401 +#: src/stored/autochanger.c:494 #, c-format msgid "Autochanger error: ERR=%s\n" msgstr "" @@ -8743,7 +8873,7 @@ msgstr "" msgid "Wrong number of arguments: \n" msgstr "" -#: src/stored/bcopy.c:172 src/stored/btape.c:334 src/stored/device.c:273 +#: src/stored/bcopy.c:172 src/stored/btape.c:333 src/stored/device.c:266 #, c-format msgid "dev open failed: %s\n" msgstr "" @@ -8757,7 +8887,7 @@ msgstr "" msgid "%u Jobs copied. %u records copied.\n" msgstr "" -#: src/stored/bcopy.c:205 src/stored/bscan.c:389 +#: src/stored/bcopy.c:205 src/stored/bscan.c:390 #, c-format msgid "Record: SessId=%u SessTim=%u FileIndex=%d Stream=%d len=%u\n" msgstr "" @@ -8771,7 +8901,7 @@ msgid "Volume label not copied.\n" msgstr "" #: src/stored/bcopy.c:235 src/stored/bcopy.c:242 src/stored/bcopy.c:265 -#: src/stored/btape.c:2335 +#: src/stored/btape.c:2342 #, c-format msgid "Cannot fixup device error. %s\n" msgstr "" @@ -8784,8 +8914,8 @@ msgstr "" msgid "EOT label not copied.\n" msgstr "" -#: src/stored/bcopy.c:290 src/stored/bextract.c:473 src/stored/bls.c:444 -#: src/stored/bscan.c:1227 src/stored/btape.c:2683 +#: src/stored/bcopy.c:290 src/stored/bextract.c:479 src/stored/bls.c:443 +#: src/stored/bscan.c:1234 src/stored/btape.c:2690 #, c-format msgid "Mount Volume \"%s\" on device %s and press return when ready: " msgstr "" @@ -8811,12 +8941,12 @@ msgid "" "\n" msgstr "" -#: src/stored/bextract.c:127 src/stored/bls.c:129 +#: src/stored/bextract.c:127 src/stored/bls.c:128 #, c-format msgid "Could not open exclude file: %s, ERR=%s\n" msgstr "" -#: src/stored/bextract.c:142 src/stored/bls.c:143 +#: src/stored/bextract.c:142 src/stored/bls.c:142 #, c-format msgid "Could not open include file: %s, ERR=%s\n" msgstr "" @@ -8846,11 +8976,11 @@ msgstr "" msgid "%u files restored.\n" msgstr "" -#: src/stored/bextract.c:278 src/stored/bextract.c:444 +#: src/stored/bextract.c:278 src/stored/bextract.c:450 msgid "Logic error output file should be open but is not.\n" msgstr "" -#: src/stored/bextract.c:285 src/stored/bls.c:365 src/stored/bscan.c:645 +#: src/stored/bextract.c:285 src/stored/bls.c:364 src/stored/bscan.c:647 msgid "Cannot continue.\n" msgstr "" @@ -8868,176 +8998,176 @@ msgstr "" msgid "===Write error===\n" msgstr "" -#: src/stored/bextract.c:435 +#: src/stored/bextract.c:441 msgid "Got Program Name or Data Stream. Ignored.\n" msgstr "" -#: src/stored/block.c:78 +#: src/stored/block.c:79 #, c-format msgid "" "Dump block %s %x: size=%d BlkNum=%d\n" " Hdrcksum=%x cksum=%x\n" msgstr "" -#: src/stored/block.c:91 +#: src/stored/block.c:92 #, c-format msgid " Rec: VId=%u VT=%u FI=%s Strm=%s len=%d p=%x\n" msgstr "" -#: src/stored/block.c:147 +#: src/stored/block.c:148 #, c-format msgid "%d block read errors not printed.\n" msgstr "" -#: src/stored/block.c:235 src/stored/block.c:251 src/stored/block.c:261 +#: src/stored/block.c:236 src/stored/block.c:252 src/stored/block.c:262 #, c-format msgid "" "Volume data error at %u:%u! Wanted ID: \"%s\", got \"%s\". Buffer " "discarded.\n" msgstr "" -#: src/stored/block.c:275 +#: src/stored/block.c:276 #, c-format msgid "" "Volume data error at %u:%u! Block length %u is insane (too large), probably " "due to a bad archive.\n" msgstr "" -#: src/stored/block.c:301 +#: src/stored/block.c:302 #, c-format msgid "" "Volume data error at %u:%u!\n" "Block checksum mismatch in block=%u len=%d: calc=%x blk=%x\n" msgstr "" -#: src/stored/block.c:409 +#: src/stored/block.c:410 msgid "Cannot write block. Device at EOM.\n" msgstr "" -#: src/stored/block.c:414 +#: src/stored/block.c:415 msgid "Attempt to write on read-only Volume.\n" msgstr "" -#: src/stored/block.c:466 +#: src/stored/block.c:467 #, c-format msgid "User defined maximum volume capacity %s exceeded on device %s.\n" msgstr "" -#: src/stored/block.c:481 +#: src/stored/block.c:482 #, c-format msgid "Unable to write EOF. ERR=%s\n" msgstr "" -#: src/stored/block.c:507 src/stored/block.c:518 +#: src/stored/block.c:508 src/stored/block.c:519 msgid "Write block header zeroed.\n" msgstr "" -#: src/stored/block.c:536 +#: src/stored/block.c:537 #, c-format msgid "Write error at %u:%u on device %s. ERR=%s.\n" msgstr "" -#: src/stored/block.c:543 +#: src/stored/block.c:544 #, c-format msgid "End of Volume \"%s\" at %u:%u on device %s. Write of %u bytes got %d.\n" msgstr "" -#: src/stored/block.c:618 src/stored/block.c:624 +#: src/stored/block.c:619 src/stored/block.c:625 #, c-format msgid "Backspace file at EOT failed. ERR=%s\n" msgstr "" -#: src/stored/block.c:631 +#: src/stored/block.c:632 #, c-format msgid "Backspace record at EOT failed. ERR=%s\n" msgstr "" -#: src/stored/block.c:648 +#: src/stored/block.c:649 #, c-format msgid "Re-read last block at EOT failed. ERR=%s" msgstr "" -#: src/stored/block.c:652 +#: src/stored/block.c:653 msgid "Re-read of last block succeeded.\n" msgstr "" -#: src/stored/block.c:655 +#: src/stored/block.c:656 #, c-format msgid "Re-read of last block failed. Last block=%u Current block=%u.\n" msgstr "" -#: src/stored/block.c:684 +#: src/stored/block.c:685 #, c-format msgid "" -"Error writing final EOF to tape. This tape may not be readable.\n" +"Error writing final EOF to tape. This Volume may not be readable.\n" "%s" msgstr "" -#: src/stored/block.c:790 src/stored/dvd.c:622 +#: src/stored/block.c:795 src/stored/dvd.c:689 #, c-format msgid "" "Error while writing, current part number is less than the total number of " "parts (%d/%d, device=%s)\n" msgstr "" -#: src/stored/block.c:798 src/stored/block.c:908 +#: src/stored/block.c:803 src/stored/block.c:913 #, c-format msgid "Unable to open device next part %s: ERR=%s\n" msgstr "" -#: src/stored/block.c:816 +#: src/stored/block.c:821 #, c-format msgid "" "End of Volume \"%s\" at %u:%u on device %s (part_size=%s, free_space=%s, " "free_space_errno=%d, errmsg=%s).\n" msgstr "" -#: src/stored/block.c:829 +#: src/stored/block.c:834 #, c-format msgid "" "End of Volume \"%s\" at %u:%u on device %s (part_size=%s, free_space=%s, " "free_space_errno=%d).\n" msgstr "" -#: src/stored/block.c:883 +#: src/stored/block.c:888 #, c-format msgid "Block buffer size looping problem on device %s\n" msgstr "" -#: src/stored/block.c:934 +#: src/stored/block.c:939 #, c-format msgid "Read error at file:blk %u:%u on device %s. ERR=%s.\n" msgstr "" -#: src/stored/block.c:947 +#: src/stored/block.c:952 #, c-format msgid "Read zero bytes at %u:%u on device %s.\n" msgstr "" -#: src/stored/block.c:960 +#: src/stored/block.c:965 #, c-format msgid "" "Volume data error at %u:%u! Very short block of %d bytes on device %s " "discarded.\n" msgstr "" -#: src/stored/block.c:985 +#: src/stored/block.c:990 #, c-format msgid "Block length %u is greater than buffer %u. Attempting recovery.\n" msgstr "" -#: src/stored/block.c:1004 +#: src/stored/block.c:1009 #, c-format msgid "Setting block buffer size to %u bytes.\n" msgstr "" -#: src/stored/block.c:1019 +#: src/stored/block.c:1024 #, c-format msgid "" "Volume data error at %u:%u! Short block of %d bytes on device %s discarded.\n" msgstr "" -#: src/stored/bls.c:69 +#: src/stored/bls.c:68 #, c-format msgid "" "Copyright (C) 2000-2005 Kern Sibbald.\n" @@ -9061,74 +9191,74 @@ msgid "" "\n" msgstr "" -#: src/stored/bls.c:190 +#: src/stored/bls.c:189 msgid "No archive name specified\n" msgstr "" -#: src/stored/bls.c:226 +#: src/stored/bls.c:224 #, c-format msgid "" "\n" "Warning, this Volume is a continuation of Volume %s\n" msgstr "" -#: src/stored/bls.c:268 +#: src/stored/bls.c:267 #, c-format msgid "Got EOM at file %u on device %s, Volume \"%s\"\n" msgstr "" -#: src/stored/bls.c:279 +#: src/stored/bls.c:278 #, c-format msgid "Mounted Volume \"%s\".\n" msgstr "" -#: src/stored/bls.c:281 +#: src/stored/bls.c:280 #, c-format msgid "Got EOF at file %u on device %s, Volume \"%s\"\n" msgstr "" -#: src/stored/bls.c:305 +#: src/stored/bls.c:304 #, c-format msgid "" "File:blk=%u:%u blk_num=%u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%" "s rlen=%d\n" msgstr "" -#: src/stored/bls.c:314 +#: src/stored/bls.c:313 #, c-format msgid "Block: %d size=%d\n" msgstr "" -#: src/stored/bls.c:381 +#: src/stored/bls.c:380 #, c-format msgid "FileIndex=%d VolSessionId=%d VolSessionTime=%d Stream=%d DataLen=%d\n" msgstr "" -#: src/stored/bls.c:398 src/stored/read_record.c:321 +#: src/stored/bls.c:397 src/stored/read_record.c:322 msgid "Fresh Volume Label" msgstr "" -#: src/stored/bls.c:401 src/stored/read_record.c:324 +#: src/stored/bls.c:400 src/stored/read_record.c:325 msgid "Volume Label" msgstr "" -#: src/stored/bls.c:405 src/stored/label.c:959 +#: src/stored/bls.c:404 src/stored/label.c:969 msgid "Begin Job Session" msgstr "" -#: src/stored/bls.c:409 src/stored/label.c:962 +#: src/stored/bls.c:408 src/stored/label.c:972 msgid "End Job Session" msgstr "" -#: src/stored/bls.c:412 +#: src/stored/bls.c:411 msgid "End of Medium" msgstr "" -#: src/stored/bls.c:415 src/stored/label.c:971 +#: src/stored/bls.c:414 src/stored/label.c:981 msgid "Unknown" msgstr "" -#: src/stored/bls.c:421 src/stored/read_record.c:342 +#: src/stored/bls.c:420 src/stored/read_record.c:343 #, c-format msgid "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n" msgstr "" @@ -9160,12 +9290,12 @@ msgid "" "\n" msgstr "" -#: src/stored/bscan.c:234 src/stored/stored.c:266 +#: src/stored/bscan.c:234 src/stored/stored.c:265 #, c-format msgid "No Storage resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/bscan.c:242 src/stored/stored.c:297 +#: src/stored/bscan.c:242 src/stored/stored.c:296 #, c-format msgid "No Working Directory defined in %s. Cannot continue.\n" msgstr "" @@ -9180,7 +9310,7 @@ msgstr "" msgid "Working Directory: %s is not a directory. Cannot continue.\n" msgstr "" -#: src/stored/bscan.c:268 src/stored/bscan.c:340 +#: src/stored/bscan.c:268 src/stored/bscan.c:341 #, c-format msgid "First Volume Size = %sn" msgstr "" @@ -9199,235 +9329,235 @@ msgstr "" msgid "Create JobMedia for Job %s\n" msgstr "" -#: src/stored/bscan.c:325 +#: src/stored/bscan.c:326 #, c-format msgid "Could not create JobMedia record for Volume=%s Job=%s\n" msgstr "" -#: src/stored/bscan.c:381 +#: src/stored/bscan.c:382 #, c-format msgid "done: %d%%\n" msgstr "" -#: src/stored/bscan.c:405 +#: src/stored/bscan.c:406 msgid "Volume is prelabeled. This tape cannot be scanned.\n" msgstr "" -#: src/stored/bscan.c:417 +#: src/stored/bscan.c:418 #, c-format msgid "Pool record for %s found in DB.\n" msgstr "" -#: src/stored/bscan.c:421 +#: src/stored/bscan.c:422 #, c-format msgid "VOL_LABEL: Pool record not found for Pool: %s\n" msgstr "" -#: src/stored/bscan.c:427 +#: src/stored/bscan.c:428 #, c-format msgid "VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n" msgstr "" -#: src/stored/bscan.c:431 +#: src/stored/bscan.c:432 #, c-format msgid "Pool type \"%s\" is OK.\n" msgstr "" -#: src/stored/bscan.c:441 +#: src/stored/bscan.c:442 #, c-format msgid "Media record for %s found in DB.\n" msgstr "" -#: src/stored/bscan.c:448 +#: src/stored/bscan.c:449 #, c-format msgid "VOL_LABEL: Media record not found for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:455 +#: src/stored/bscan.c:456 #, c-format msgid "VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n" msgstr "" -#: src/stored/bscan.c:459 +#: src/stored/bscan.c:460 #, c-format msgid "Media type \"%s\" is OK.\n" msgstr "" -#: src/stored/bscan.c:468 +#: src/stored/bscan.c:469 #, c-format msgid "VOL_LABEL: OK for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:475 +#: src/stored/bscan.c:476 #, c-format msgid "%d \"errors\" ignored before first Start of Session record.\n" msgstr "" -#: src/stored/bscan.c:486 +#: src/stored/bscan.c:487 #, c-format msgid "SOS_LABEL: Found Job record for JobId: %d\n" msgstr "" -#: src/stored/bscan.c:491 +#: src/stored/bscan.c:492 #, c-format msgid "SOS_LABEL: Job record not found for JobId: %d\n" msgstr "" -#: src/stored/bscan.c:531 +#: src/stored/bscan.c:532 #, c-format msgid "SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:537 +#: src/stored/bscan.c:538 #, c-format msgid "SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:543 +#: src/stored/bscan.c:544 #, c-format msgid "SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:561 src/stored/bscan.c:1007 +#: src/stored/bscan.c:562 src/stored/bscan.c:1013 #, c-format msgid "Could not find SessId=%d SessTime=%d for EOS record.\n" msgstr "" -#: src/stored/bscan.c:604 +#: src/stored/bscan.c:606 #, c-format msgid "Could not update job record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:615 +#: src/stored/bscan.c:617 #, c-format msgid "End of all Volumes. VolFiles=%u VolBlocks=%u VolBytes=%s\n" msgstr "" -#: src/stored/bscan.c:627 +#: src/stored/bscan.c:629 #, c-format msgid "Could not find Job for SessId=%d SessTime=%d record.\n" msgstr "" -#: src/stored/bscan.c:663 +#: src/stored/bscan.c:665 #, c-format msgid "%s file records. At file:blk=%s:%s bytes=%s\n" msgstr "" -#: src/stored/bscan.c:706 +#: src/stored/bscan.c:708 #, c-format msgid "Got MD5 record: %s\n" msgstr "" -#: src/stored/bscan.c:715 +#: src/stored/bscan.c:717 #, c-format msgid "Got SHA1 record: %s\n" msgstr "" -#: src/stored/bscan.c:723 +#: src/stored/bscan.c:725 #, c-format msgid "Got Prog Names Stream: %s\n" msgstr "" -#: src/stored/bscan.c:729 +#: src/stored/bscan.c:731 msgid "Got Prog Data Stream record.\n" msgstr "" -#: src/stored/bscan.c:733 +#: src/stored/bscan.c:735 #, c-format msgid "Unknown stream type!!! stream=%d data=%s\n" msgstr "" -#: src/stored/bscan.c:793 +#: src/stored/bscan.c:799 #, c-format msgid "Could not create File Attributes record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:799 +#: src/stored/bscan.c:805 #, c-format msgid "Created File record: %s\n" msgstr "" -#: src/stored/bscan.c:836 +#: src/stored/bscan.c:842 #, c-format msgid "Could not create media record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:840 src/stored/bscan.c:861 +#: src/stored/bscan.c:846 src/stored/bscan.c:867 #, c-format msgid "Could not update media record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:844 +#: src/stored/bscan.c:850 #, c-format msgid "Created Media record for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:865 +#: src/stored/bscan.c:871 #, c-format msgid "Updated Media record at end of Volume: %s\n" msgstr "" -#: src/stored/bscan.c:882 +#: src/stored/bscan.c:888 #, c-format msgid "Could not create pool record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:886 +#: src/stored/bscan.c:892 #, c-format msgid "Created Pool record for Pool: %s\n" msgstr "" -#: src/stored/bscan.c:906 +#: src/stored/bscan.c:912 #, c-format msgid "Created Client record for Client: %s\n" msgstr "" -#: src/stored/bscan.c:923 +#: src/stored/bscan.c:929 #, c-format msgid "Fileset \"%s\" already exists.\n" msgstr "" -#: src/stored/bscan.c:927 +#: src/stored/bscan.c:933 #, c-format msgid "Could not create FileSet record \"%s\". ERR=%s\n" msgstr "" -#: src/stored/bscan.c:932 +#: src/stored/bscan.c:938 #, c-format msgid "Created FileSet record \"%s\"\n" msgstr "" -#: src/stored/bscan.c:979 +#: src/stored/bscan.c:985 #, c-format msgid "Could not create JobId record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:985 +#: src/stored/bscan.c:991 #, c-format msgid "Could not update job start record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:988 +#: src/stored/bscan.c:994 #, c-format msgid "Created new JobId=%u record for original JobId=%u\n" msgstr "" -#: src/stored/bscan.c:1038 +#: src/stored/bscan.c:1044 #, c-format msgid "Could not update JobId=%u record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1043 +#: src/stored/bscan.c:1049 #, c-format msgid "Updated Job termination record for JobId=%u TermStat=%c\n" msgstr "" -#: src/stored/bscan.c:1065 +#: src/stored/bscan.c:1071 #, c-format msgid "Job Termination code: %d" msgstr "" -#: src/stored/bscan.c:1070 +#: src/stored/bscan.c:1076 #, c-format msgid "" "%s\n" @@ -9447,27 +9577,27 @@ msgid "" "\n" msgstr "" -#: src/stored/bscan.c:1134 +#: src/stored/bscan.c:1140 #, c-format msgid "Could not create JobMedia record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1138 +#: src/stored/bscan.c:1144 #, c-format msgid "Created JobMedia record JobId %d, MediaId %d\n" msgstr "" -#: src/stored/bscan.c:1154 +#: src/stored/bscan.c:1160 #, c-format msgid "Could not find SessId=%d SessTime=%d for MD5/SHA1 record.\n" msgstr "" -#: src/stored/bscan.c:1168 +#: src/stored/bscan.c:1174 #, c-format msgid "Could not add MD5/SHA1 to File record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1173 +#: src/stored/bscan.c:1179 msgid "Updated MD5/SHA1 record\n" msgstr "" @@ -9518,140 +9648,140 @@ msgstr "" msgid "Improper number of arguments specified.\n" msgstr "" -#: src/stored/btape.c:340 +#: src/stored/btape.c:338 #, c-format msgid "open device %s: OK\n" msgstr "" -#: src/stored/btape.c:361 +#: src/stored/btape.c:359 msgid "Enter Volume Name: " msgstr "" -#: src/stored/btape.c:368 +#: src/stored/btape.c:366 #, c-format msgid "Device open failed. ERR=%s\n" msgstr "" -#: src/stored/btape.c:373 +#: src/stored/btape.c:371 #, c-format msgid "Wrote Volume label for volume \"%s\".\n" msgstr "" -#: src/stored/btape.c:387 +#: src/stored/btape.c:385 msgid "Volume has no label.\n" msgstr "" -#: src/stored/btape.c:390 +#: src/stored/btape.c:388 msgid "Volume label read correctly.\n" msgstr "" -#: src/stored/btape.c:393 +#: src/stored/btape.c:391 #, c-format msgid "I/O error on device: ERR=%s" msgstr "" -#: src/stored/btape.c:396 +#: src/stored/btape.c:394 msgid "Volume name error\n" msgstr "" -#: src/stored/btape.c:399 +#: src/stored/btape.c:397 #, c-format msgid "Error creating label. ERR=%s" msgstr "" -#: src/stored/btape.c:402 +#: src/stored/btape.c:400 msgid "Volume version error.\n" msgstr "" -#: src/stored/btape.c:405 +#: src/stored/btape.c:403 msgid "Bad Volume label type.\n" msgstr "" -#: src/stored/btape.c:408 +#: src/stored/btape.c:406 msgid "Unknown error.\n" msgstr "" -#: src/stored/btape.c:426 +#: src/stored/btape.c:424 #, c-format msgid "Bad status from load. ERR=%s\n" msgstr "" -#: src/stored/btape.c:428 +#: src/stored/btape.c:426 #, c-format msgid "Loaded %s\n" msgstr "" -#: src/stored/btape.c:437 src/stored/btape.c:777 src/stored/btape.c:819 -#: src/stored/btape.c:889 src/stored/btape.c:931 src/stored/btape.c:1200 +#: src/stored/btape.c:435 src/stored/btape.c:775 src/stored/btape.c:817 +#: src/stored/btape.c:887 src/stored/btape.c:929 src/stored/btape.c:1198 #, c-format msgid "Bad status from rewind. ERR=%s\n" msgstr "" -#: src/stored/btape.c:440 src/stored/btape.c:1208 +#: src/stored/btape.c:438 src/stored/btape.c:1206 #, c-format msgid "Rewound %s\n" msgstr "" -#: src/stored/btape.c:467 src/stored/btape.c:1212 +#: src/stored/btape.c:465 src/stored/btape.c:1210 #, c-format msgid "Bad status from weof %d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:471 +#: src/stored/btape.c:469 #, c-format msgid "Wrote 1 EOF to %s\n" msgstr "" -#: src/stored/btape.c:474 +#: src/stored/btape.c:472 #, c-format msgid "Wrote %d EOFs to %s\n" msgstr "" -#: src/stored/btape.c:492 +#: src/stored/btape.c:490 msgid "Moved to end of medium.\n" msgstr "" -#: src/stored/btape.c:519 +#: src/stored/btape.c:517 #, c-format msgid "Bad status from bsf. ERR=%s\n" msgstr "" -#: src/stored/btape.c:521 +#: src/stored/btape.c:519 #, c-format msgid "Backspaced %d file%s.\n" msgstr "" -#: src/stored/btape.c:538 +#: src/stored/btape.c:536 #, c-format msgid "Bad status from bsr. ERR=%s\n" msgstr "" -#: src/stored/btape.c:540 +#: src/stored/btape.c:538 #, c-format msgid "Backspaced %d record%s.\n" msgstr "" -#: src/stored/btape.c:550 src/stored/status.c:220 +#: src/stored/btape.c:548 src/stored/status.c:227 #, c-format msgid "Configured device capabilities:\n" msgstr "" -#: src/stored/btape.c:568 +#: src/stored/btape.c:566 #, c-format msgid "Device status:\n" msgstr "" -#: src/stored/btape.c:582 src/stored/status.c:252 +#: src/stored/btape.c:580 src/stored/status.c:259 #, c-format msgid "Device parameters:\n" msgstr "" -#: src/stored/btape.c:587 +#: src/stored/btape.c:585 #, c-format msgid "Status:\n" msgstr "" -#: src/stored/btape.c:602 +#: src/stored/btape.c:600 msgid "" "Test writting larger and larger records.\n" "This is a torture test for records.\n" @@ -9660,20 +9790,20 @@ msgid "" "plus the header exceeds the block size (by default about 64K)\n" msgstr "" -#: src/stored/btape.c:610 src/stored/btape.c:1814 +#: src/stored/btape.c:608 src/stored/btape.c:1815 msgid "Command aborted.\n" msgstr "" -#: src/stored/btape.c:626 +#: src/stored/btape.c:624 #, c-format msgid "Block %d i=%d\n" msgstr "" -#: src/stored/btape.c:652 +#: src/stored/btape.c:650 msgid "Skipping read backwards test because BSR turned off.\n" msgstr "" -#: src/stored/btape.c:656 +#: src/stored/btape.c:654 msgid "" "\n" "=== Write, backup, and re-read test ===\n" @@ -9687,73 +9817,73 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:669 src/stored/btape.c:680 src/stored/btape.c:691 -#: src/stored/btape.c:789 src/stored/btape.c:805 src/stored/btape.c:901 -#: src/stored/btape.c:917 src/stored/btape.c:1526 src/stored/btape.c:2400 +#: src/stored/btape.c:667 src/stored/btape.c:678 src/stored/btape.c:689 +#: src/stored/btape.c:787 src/stored/btape.c:803 src/stored/btape.c:899 +#: src/stored/btape.c:915 src/stored/btape.c:1524 src/stored/btape.c:2407 msgid "Error writing record to block.\n" msgstr "" -#: src/stored/btape.c:673 src/stored/btape.c:684 src/stored/btape.c:695 -#: src/stored/btape.c:793 src/stored/btape.c:809 src/stored/btape.c:905 -#: src/stored/btape.c:921 src/stored/btape.c:1530 src/stored/btape.c:2404 +#: src/stored/btape.c:671 src/stored/btape.c:682 src/stored/btape.c:693 +#: src/stored/btape.c:791 src/stored/btape.c:807 src/stored/btape.c:903 +#: src/stored/btape.c:919 src/stored/btape.c:1528 src/stored/btape.c:2411 msgid "Error writing block to device.\n" msgstr "" -#: src/stored/btape.c:676 +#: src/stored/btape.c:674 #, c-format msgid "Wrote first record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:687 +#: src/stored/btape.c:685 #, c-format msgid "Wrote second record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:698 +#: src/stored/btape.c:696 #, c-format msgid "Wrote third record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:705 src/stored/btape.c:710 +#: src/stored/btape.c:703 src/stored/btape.c:708 #, c-format msgid "Backspace file failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:714 +#: src/stored/btape.c:712 msgid "Backspaced over EOF OK.\n" msgstr "" -#: src/stored/btape.c:716 +#: src/stored/btape.c:714 #, c-format msgid "Backspace record failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:719 +#: src/stored/btape.c:717 msgid "Backspace record OK.\n" msgstr "" -#: src/stored/btape.c:722 src/stored/btape.c:728 +#: src/stored/btape.c:720 src/stored/btape.c:726 #, c-format msgid "Read block failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:733 +#: src/stored/btape.c:731 msgid "Bad data in record. Test failed!\n" msgstr "" -#: src/stored/btape.c:737 +#: src/stored/btape.c:735 msgid "" "\n" "Block re-read correct. Test succeeded!\n" msgstr "" -#: src/stored/btape.c:738 +#: src/stored/btape.c:736 msgid "" "=== End Write, backup, and re-read test ===\n" "\n" msgstr "" -#: src/stored/btape.c:745 +#: src/stored/btape.c:743 msgid "" "This is not terribly serious since Bacula only uses\n" "this function to verify the last block written to the\n" @@ -9765,7 +9895,7 @@ msgid "" "to your Storage daemon's Device resource definition.\n" msgstr "" -#: src/stored/btape.c:769 +#: src/stored/btape.c:767 msgid "" "\n" "=== Write, rewind, and re-read test ===\n" @@ -9778,46 +9908,46 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:797 src/stored/btape.c:813 src/stored/btape.c:909 -#: src/stored/btape.c:925 +#: src/stored/btape.c:795 src/stored/btape.c:811 src/stored/btape.c:907 +#: src/stored/btape.c:923 #, c-format msgid "Wrote 1000 blocks of %d bytes.\n" msgstr "" -#: src/stored/btape.c:822 src/stored/btape.c:934 +#: src/stored/btape.c:820 src/stored/btape.c:932 msgid "Rewind OK.\n" msgstr "" -#: src/stored/btape.c:829 src/stored/btape.c:983 +#: src/stored/btape.c:827 src/stored/btape.c:981 msgid "Got EOF on tape.\n" msgstr "" -#: src/stored/btape.c:834 +#: src/stored/btape.c:832 #, c-format msgid "Read block %d failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:840 +#: src/stored/btape.c:838 #, c-format msgid "Read record failed. Block %d! ERR=%s\n" msgstr "" -#: src/stored/btape.c:846 src/stored/btape.c:1013 +#: src/stored/btape.c:844 src/stored/btape.c:1011 #, c-format msgid "Bad data in record. Expected %d, got %d at byte %d. Test failed!\n" msgstr "" -#: src/stored/btape.c:853 +#: src/stored/btape.c:851 msgid "1000 blocks re-read correctly.\n" msgstr "" -#: src/stored/btape.c:856 src/stored/btape.c:1020 +#: src/stored/btape.c:854 src/stored/btape.c:1018 msgid "" "=== Test Succeeded. End Write, rewind, and re-read test ===\n" "\n" msgstr "" -#: src/stored/btape.c:881 +#: src/stored/btape.c:879 msgid "" "\n" "=== Write, rewind, and position test ===\n" @@ -9830,23 +9960,23 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:974 +#: src/stored/btape.c:972 #, c-format msgid "Reposition to file:block %d:%d\n" msgstr "" -#: src/stored/btape.c:976 +#: src/stored/btape.c:974 msgid "Reposition error.\n" msgstr "" -#: src/stored/btape.c:989 +#: src/stored/btape.c:987 #, c-format msgid "" "Read block %d failed! file=%d blk=%d. ERR=%s\n" "\n" msgstr "" -#: src/stored/btape.c:991 +#: src/stored/btape.c:989 msgid "" "This may be because the tape drive block size is not\n" " set to variable blocking as normally used by Bacula.\n" @@ -9860,17 +9990,17 @@ msgid "" " in your Device resource.\n" msgstr "" -#: src/stored/btape.c:1007 +#: src/stored/btape.c:1005 #, c-format msgid "Read record failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:1018 +#: src/stored/btape.c:1016 #, c-format msgid "Block %d re-read correctly.\n" msgstr "" -#: src/stored/btape.c:1039 +#: src/stored/btape.c:1037 msgid "" "\n" "\n" @@ -9884,58 +10014,58 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1063 +#: src/stored/btape.c:1061 msgid "Now moving to end of medium.\n" msgstr "" -#: src/stored/btape.c:1065 src/stored/btape.c:1295 +#: src/stored/btape.c:1063 src/stored/btape.c:1293 #, c-format msgid "We should be in file 3. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1066 src/stored/btape.c:1084 src/stored/btape.c:1284 -#: src/stored/btape.c:1296 src/stored/btape.c:1309 src/stored/btape.c:1326 +#: src/stored/btape.c:1064 src/stored/btape.c:1082 src/stored/btape.c:1282 +#: src/stored/btape.c:1294 src/stored/btape.c:1307 src/stored/btape.c:1324 msgid "This is correct!" msgstr "" -#: src/stored/btape.c:1066 src/stored/btape.c:1084 src/stored/btape.c:1284 -#: src/stored/btape.c:1296 src/stored/btape.c:1309 src/stored/btape.c:1326 +#: src/stored/btape.c:1064 src/stored/btape.c:1082 src/stored/btape.c:1282 +#: src/stored/btape.c:1294 src/stored/btape.c:1307 src/stored/btape.c:1324 msgid "This is NOT correct!!!!" msgstr "" -#: src/stored/btape.c:1072 +#: src/stored/btape.c:1070 msgid "" "\n" "Now the important part, I am going to attempt to append to the tape.\n" "\n" msgstr "" -#: src/stored/btape.c:1079 +#: src/stored/btape.c:1077 msgid "" "Done appending, there should be no I/O errors\n" "\n" msgstr "" -#: src/stored/btape.c:1080 +#: src/stored/btape.c:1078 msgid "Doing Bacula scan of blocks:\n" msgstr "" -#: src/stored/btape.c:1082 +#: src/stored/btape.c:1080 msgid "End scanning the tape.\n" msgstr "" -#: src/stored/btape.c:1083 src/stored/btape.c:1308 +#: src/stored/btape.c:1081 src/stored/btape.c:1306 #, c-format msgid "We should be in file 4. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1108 +#: src/stored/btape.c:1106 msgid "" "\n" "Autochanger enabled, but no name or no command device specified.\n" msgstr "" -#: src/stored/btape.c:1112 +#: src/stored/btape.c:1110 msgid "" "\n" "Ah, I see you have an autochanger configured.\n" @@ -9943,13 +10073,13 @@ msgid "" " that I can write on in Slot 1.\n" msgstr "" -#: src/stored/btape.c:1115 +#: src/stored/btape.c:1113 msgid "" "\n" "Do you wish to continue with the Autochanger test? (y/n): " msgstr "" -#: src/stored/btape.c:1122 +#: src/stored/btape.c:1120 msgid "" "\n" "\n" @@ -9957,74 +10087,74 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1131 +#: src/stored/btape.c:1129 msgid "3301 Issuing autochanger \"loaded\" command.\n" msgstr "" -#: src/stored/btape.c:1140 +#: src/stored/btape.c:1138 #, c-format msgid "3991 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1141 +#: src/stored/btape.c:1139 #, c-format msgid "3991 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1145 +#: src/stored/btape.c:1143 #, c-format msgid "Slot %d loaded. I am going to unload it.\n" msgstr "" -#: src/stored/btape.c:1147 +#: src/stored/btape.c:1145 msgid "Nothing loaded in the drive. OK.\n" msgstr "" -#: src/stored/btape.c:1155 +#: src/stored/btape.c:1153 #, c-format msgid "3302 Issuing autochanger \"unload %d %d\" command.\n" msgstr "" -#: src/stored/btape.c:1160 +#: src/stored/btape.c:1158 #, c-format msgid "unload status=%s %d\n" msgstr "" -#: src/stored/btape.c:1160 +#: src/stored/btape.c:1158 msgid "Bad" msgstr "" -#: src/stored/btape.c:1163 +#: src/stored/btape.c:1161 #, c-format msgid "3992 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1164 +#: src/stored/btape.c:1162 #, c-format msgid "3992 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1174 +#: src/stored/btape.c:1172 #, c-format msgid "3303 Issuing autochanger \"load %d %d\" command.\n" msgstr "" -#: src/stored/btape.c:1182 +#: src/stored/btape.c:1180 #, c-format msgid "3303 Autochanger \"load %d %d\" status is OK.\n" msgstr "" -#: src/stored/btape.c:1186 +#: src/stored/btape.c:1184 #, c-format msgid "3993 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1187 +#: src/stored/btape.c:1185 #, c-format msgid "3993 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1202 +#: src/stored/btape.c:1200 msgid "" "\n" "The test failed, probably because you need to put\n" @@ -10032,12 +10162,12 @@ msgid "" "Adding a 30 second sleep and trying again ...\n" msgstr "" -#: src/stored/btape.c:1215 +#: src/stored/btape.c:1213 #, c-format msgid "Wrote EOF to %s\n" msgstr "" -#: src/stored/btape.c:1219 +#: src/stored/btape.c:1217 #, c-format msgid "" "\n" @@ -10049,18 +10179,18 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1224 +#: src/stored/btape.c:1222 msgid "" "\n" "The test autochanger worked!!\n" "\n" msgstr "" -#: src/stored/btape.c:1235 +#: src/stored/btape.c:1233 msgid "You must correct this error or the Autochanger will not work.\n" msgstr "" -#: src/stored/btape.c:1253 +#: src/stored/btape.c:1251 msgid "" "\n" "\n" @@ -10072,30 +10202,30 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1278 +#: src/stored/btape.c:1276 msgid "Now forward spacing 1 file.\n" msgstr "" -#: src/stored/btape.c:1280 src/stored/btape.c:1292 src/stored/btape.c:1305 -#: src/stored/btape.c:1323 src/stored/btape.c:1492 +#: src/stored/btape.c:1278 src/stored/btape.c:1290 src/stored/btape.c:1303 +#: src/stored/btape.c:1321 src/stored/btape.c:1490 #, c-format msgid "Bad status from fsr. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1283 +#: src/stored/btape.c:1281 #, c-format msgid "We should be in file 1. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1290 +#: src/stored/btape.c:1288 msgid "Now forward spacing 2 files.\n" msgstr "" -#: src/stored/btape.c:1303 +#: src/stored/btape.c:1301 msgid "Now forward spacing 4 files.\n" msgstr "" -#: src/stored/btape.c:1315 +#: src/stored/btape.c:1313 msgid "" "The test worked this time. Please add:\n" "\n" @@ -10104,35 +10234,35 @@ msgid "" "to your Device resource for this drive.\n" msgstr "" -#: src/stored/btape.c:1321 +#: src/stored/btape.c:1319 msgid "Now forward spacing 1 more file.\n" msgstr "" -#: src/stored/btape.c:1325 +#: src/stored/btape.c:1323 #, c-format msgid "We should be in file 5. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1330 +#: src/stored/btape.c:1328 msgid "" "\n" "=== End Forward space files test ===\n" "\n" msgstr "" -#: src/stored/btape.c:1334 +#: src/stored/btape.c:1332 msgid "" "\n" "The forward space file test failed.\n" msgstr "" -#: src/stored/btape.c:1336 +#: src/stored/btape.c:1334 msgid "" "You have Fast Forward Space File enabled.\n" "I am turning it off then retrying the test.\n" msgstr "" -#: src/stored/btape.c:1342 +#: src/stored/btape.c:1340 msgid "" "You must correct this error or Bacula will not work.\n" "Some systems, e.g. OpenBSD, require you to set\n" @@ -10140,7 +10270,7 @@ msgid "" "in your device resource. Use with caution.\n" msgstr "" -#: src/stored/btape.c:1374 +#: src/stored/btape.c:1372 msgid "" "\n" "Append test failed. Attempting again.\n" @@ -10150,7 +10280,7 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1382 +#: src/stored/btape.c:1380 msgid "" "\n" "\n" @@ -10162,14 +10292,14 @@ msgid "" "to your Device resource in the Storage conf file.\n" msgstr "" -#: src/stored/btape.c:1389 +#: src/stored/btape.c:1387 msgid "" "\n" "\n" "That appears *NOT* to have corrected the problem.\n" msgstr "" -#: src/stored/btape.c:1394 +#: src/stored/btape.c:1392 msgid "" "\n" "\n" @@ -10177,7 +10307,7 @@ msgid "" "Setting \"BSF at EOM = yes\" and retrying append test.\n" msgstr "" -#: src/stored/btape.c:1399 +#: src/stored/btape.c:1397 msgid "" "\n" "\n" @@ -10190,7 +10320,7 @@ msgid "" "to your Device resource in the Storage conf file.\n" msgstr "" -#: src/stored/btape.c:1410 +#: src/stored/btape.c:1408 msgid "" "\n" "Append test failed.\n" @@ -10217,7 +10347,7 @@ msgid "" "in your device resource. Use with caution.\n" msgstr "" -#: src/stored/btape.c:1431 +#: src/stored/btape.c:1429 msgid "" "\n" "The above Bacula scan should have output identical to what follows.\n" @@ -10241,116 +10371,116 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1470 +#: src/stored/btape.c:1468 #, c-format msgid "Bad status from fsf. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1474 +#: src/stored/btape.c:1472 msgid "Forward spaced 1 file.\n" msgstr "" -#: src/stored/btape.c:1477 +#: src/stored/btape.c:1475 #, c-format msgid "Forward spaced %d files.\n" msgstr "" -#: src/stored/btape.c:1496 +#: src/stored/btape.c:1494 msgid "Forward spaced 1 record.\n" msgstr "" -#: src/stored/btape.c:1499 +#: src/stored/btape.c:1497 #, c-format msgid "Forward spaced %d records.\n" msgstr "" -#: src/stored/btape.c:1533 +#: src/stored/btape.c:1531 #, c-format msgid "Wrote one record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:1535 +#: src/stored/btape.c:1533 msgid "Wrote block to device.\n" msgstr "" -#: src/stored/btape.c:1550 +#: src/stored/btape.c:1548 msgid "Enter length to read: " msgstr "" -#: src/stored/btape.c:1555 +#: src/stored/btape.c:1553 msgid "Bad length entered, using default of 1024 bytes.\n" msgstr "" -#: src/stored/btape.c:1564 +#: src/stored/btape.c:1562 #, c-format msgid "Read of %d bytes gives stat=%d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1587 src/stored/btape.c:1636 +#: src/stored/btape.c:1585 src/stored/btape.c:1634 #, c-format msgid "End of tape\n" msgstr "" -#: src/stored/btape.c:1592 +#: src/stored/btape.c:1590 #, c-format msgid "Starting scan at file %u\n" msgstr "" -#: src/stored/btape.c:1597 src/stored/dev.c:1238 +#: src/stored/btape.c:1595 src/stored/dev.c:1229 #, c-format msgid "read error on %s. ERR=%s.\n" msgstr "" -#: src/stored/btape.c:1599 +#: src/stored/btape.c:1597 #, c-format msgid "Bad status from read %d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1602 src/stored/btape.c:1616 src/stored/btape.c:1679 -#: src/stored/btape.c:1691 src/stored/btape.c:1704 src/stored/btape.c:1720 +#: src/stored/btape.c:1600 src/stored/btape.c:1614 src/stored/btape.c:1678 +#: src/stored/btape.c:1690 src/stored/btape.c:1703 src/stored/btape.c:1719 #, c-format msgid "1 block of %d bytes in file %d\n" msgstr "" -#: src/stored/btape.c:1605 src/stored/btape.c:1619 src/stored/btape.c:1682 -#: src/stored/btape.c:1694 src/stored/btape.c:1707 src/stored/btape.c:1723 +#: src/stored/btape.c:1603 src/stored/btape.c:1617 src/stored/btape.c:1681 +#: src/stored/btape.c:1693 src/stored/btape.c:1706 src/stored/btape.c:1722 #, c-format msgid "%d blocks of %d bytes in file %d\n" msgstr "" -#: src/stored/btape.c:1627 src/stored/btape.c:1698 +#: src/stored/btape.c:1625 src/stored/btape.c:1697 #, c-format msgid "End of File mark.\n" msgstr "" -#: src/stored/btape.c:1648 src/stored/btape.c:1751 +#: src/stored/btape.c:1646 src/stored/btape.c:1750 #, c-format msgid "Total files=%d, blocks=%d, bytes = %s\n" msgstr "" -#: src/stored/btape.c:1711 +#: src/stored/btape.c:1710 #, c-format msgid "Short block read.\n" msgstr "" -#: src/stored/btape.c:1714 +#: src/stored/btape.c:1713 #, c-format msgid "Error reading block. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1738 +#: src/stored/btape.c:1737 #, c-format msgid "" "Blk_block: %u dev_blk=%u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%" "s rlen=%d\n" msgstr "" -#: src/stored/btape.c:1760 +#: src/stored/btape.c:1759 #, c-format msgid "Device status: %u. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1788 +#: src/stored/btape.c:1789 msgid "" "\n" "This command simulates Bacula writing to a tape.\n" @@ -10375,95 +10505,98 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1805 +#: src/stored/btape.c:1806 msgid "" "Do you want to run the simplified test (s) with one tape\n" "or the complete multiple tape (m) test: (s/m) " msgstr "" -#: src/stored/btape.c:1808 +#: src/stored/btape.c:1809 msgid "Simple test (single tape) selected.\n" msgstr "" -#: src/stored/btape.c:1811 +#: src/stored/btape.c:1812 msgid "Multiple tape test selected.\n" msgstr "" -#: src/stored/btape.c:1827 +#: src/stored/btape.c:1828 msgid "Rewind failed.\n" msgstr "" -#: src/stored/btape.c:1830 +#: src/stored/btape.c:1831 msgid "Write EOF failed.\n" msgstr "" -#: src/stored/btape.c:1857 +#: src/stored/btape.c:1858 msgid "Wrote Start of Session label.\n" msgstr "" -#: src/stored/btape.c:1886 -msgid "Begin writing Bacula records to tape ...\n" +#: src/stored/btape.c:1889 +#, c-format +msgid "%s Begin writing Bacula records to tape ...\n" msgstr "" -#: src/stored/btape.c:1888 -msgid "Begin writing Bacula records to first tape ...\n" +#: src/stored/btape.c:1891 +#, c-format +msgid "%s Begin writing Bacula records to first tape ...\n" msgstr "" -#: src/stored/btape.c:1928 +#: src/stored/btape.c:1932 #, c-format msgid "Wrote blk_block=%u, dev_blk_num=%u VolBytes=%s rate=%.1f KB/s\n" msgstr "" -#: src/stored/btape.c:1935 -msgid "Flush block, write EOF\n" +#: src/stored/btape.c:1942 +#, c-format +msgid "%s Flush block, write EOF\n" msgstr "" -#: src/stored/btape.c:1946 +#: src/stored/btape.c:1953 msgid "Not OK\n" msgstr "" -#: src/stored/btape.c:1974 +#: src/stored/btape.c:1981 msgid "Set ok=false after write_block_to_device.\n" msgstr "" -#: src/stored/btape.c:1977 +#: src/stored/btape.c:1984 msgid "Wrote End of Session label.\n" msgstr "" -#: src/stored/btape.c:2001 +#: src/stored/btape.c:2008 #, c-format msgid "Wrote state file last_block_num1=%d last_block_num2=%d\n" msgstr "" -#: src/stored/btape.c:2005 +#: src/stored/btape.c:2012 #, c-format msgid "Could not create state file: %s ERR=%s\n" msgstr "" -#: src/stored/btape.c:2010 +#: src/stored/btape.c:2020 #, c-format msgid "" "\n" "\n" -"Done filling tape at %d:%d. Now beginning re-read of tape ...\n" +"%s Done filling tape at %d:%d. Now beginning re-read of tape ...\n" msgstr "" -#: src/stored/btape.c:2014 +#: src/stored/btape.c:2024 #, c-format msgid "" "\n" "\n" -"Done filling tapes at %d:%d. Now beginning re-read of first tape ...\n" +"%s Done filling tapes at %d:%d. Now beginning re-read of first tape ...\n" msgstr "" -#: src/stored/btape.c:2053 +#: src/stored/btape.c:2063 msgid "" "\n" "The state file level has changed. You must redo\n" "the fill command.\n" msgstr "" -#: src/stored/btape.c:2059 +#: src/stored/btape.c:2069 #, c-format msgid "" "\n" @@ -10471,95 +10604,95 @@ msgid "" "You must redo the fill command.\n" msgstr "" -#: src/stored/btape.c:2101 +#: src/stored/btape.c:2111 msgid "Mount first tape. Press enter when ready: " msgstr "" -#: src/stored/btape.c:2125 -msgid "Reading the first 10000 records.\n" +#: src/stored/btape.c:2131 +msgid "Rewinding.\n" msgstr "" -#: src/stored/btape.c:2128 src/stored/btape.c:2195 +#: src/stored/btape.c:2136 +#, c-format +msgid "Reading the first 10000 records from %u:%u.\n" +msgstr "" + +#: src/stored/btape.c:2140 src/stored/btape.c:2207 #, c-format msgid "Reposition from %u:%u to %u:%u\n" msgstr "" -#: src/stored/btape.c:2131 src/stored/btape.c:2182 src/stored/btape.c:2198 +#: src/stored/btape.c:2143 src/stored/btape.c:2194 src/stored/btape.c:2210 #, c-format msgid "Reposition error. ERR=%s\n" msgstr "" -#: src/stored/btape.c:2134 +#: src/stored/btape.c:2146 #, c-format msgid "Reading block %u.\n" msgstr "" -#: src/stored/btape.c:2136 src/stored/btape.c:2187 src/stored/btape.c:2203 +#: src/stored/btape.c:2148 src/stored/btape.c:2199 src/stored/btape.c:2215 #, c-format msgid "Error reading block: ERR=%s\n" msgstr "" -#: src/stored/btape.c:2141 +#: src/stored/btape.c:2153 msgid "" "\n" "The last block on the tape matches. Test succeeded.\n" "\n" msgstr "" -#: src/stored/btape.c:2143 +#: src/stored/btape.c:2155 msgid "" "\n" "The last block of the first tape matches.\n" "\n" msgstr "" -#: src/stored/btape.c:2168 +#: src/stored/btape.c:2180 msgid "Mount second tape. Press enter when ready: " msgstr "" -#: src/stored/btape.c:2180 +#: src/stored/btape.c:2192 #, c-format msgid "Reposition from %u:%u to 0:1\n" msgstr "" -#: src/stored/btape.c:2185 src/stored/btape.c:2201 +#: src/stored/btape.c:2197 src/stored/btape.c:2213 #, c-format msgid "Reading block %d.\n" msgstr "" -#: src/stored/btape.c:2191 +#: src/stored/btape.c:2203 msgid "" "\n" "The first block on the second tape matches.\n" "\n" msgstr "" -#: src/stored/btape.c:2207 +#: src/stored/btape.c:2219 msgid "" "\n" "The last block on the second tape matches. Test succeeded.\n" "\n" msgstr "" -#: src/stored/btape.c:2221 -#, c-format -msgid "ERROR! device at %d:%d count=%d\n" -msgstr "" - -#: src/stored/btape.c:2227 +#: src/stored/btape.c:2234 #, c-format -msgid "1000 records read now at %d:%d\n" +msgid "10000 records read now at %d:%d\n" msgstr "" -#: src/stored/btape.c:2250 src/stored/btape.c:2261 src/stored/btape.c:2309 +#: src/stored/btape.c:2257 src/stored/btape.c:2268 src/stored/btape.c:2316 msgid "Last block written" msgstr "" -#: src/stored/btape.c:2252 src/stored/btape.c:2262 +#: src/stored/btape.c:2259 src/stored/btape.c:2269 msgid "Block read back" msgstr "" -#: src/stored/btape.c:2253 +#: src/stored/btape.c:2260 #, c-format msgid "" "\n" @@ -10567,7 +10700,7 @@ msgid "" "The blocks differ at byte %u\n" msgstr "" -#: src/stored/btape.c:2254 +#: src/stored/btape.c:2261 msgid "" "\n" "\n" @@ -10577,177 +10710,177 @@ msgid "" "to write multi-tape Volumes.!!!!\n" msgstr "" -#: src/stored/btape.c:2293 +#: src/stored/btape.c:2300 #, c-format msgid "Last block at: %u:%u this_dev_block_num=%d\n" msgstr "" -#: src/stored/btape.c:2307 +#: src/stored/btape.c:2314 #, c-format msgid "Block not written: FileIndex=%u blk_block=%u Size=%u\n" msgstr "" -#: src/stored/btape.c:2311 +#: src/stored/btape.c:2318 msgid "Block not written" msgstr "" -#: src/stored/btape.c:2326 +#: src/stored/btape.c:2333 #, c-format msgid "End of tape %d:%d. VolumeCapacity=%s. Write rate = %.1f KB/s\n" msgstr "" -#: src/stored/btape.c:2376 +#: src/stored/btape.c:2383 msgid "Test writing blocks of 64512 bytes to tape.\n" msgstr "" -#: src/stored/btape.c:2378 +#: src/stored/btape.c:2385 msgid "How many blocks do you want to write? (1000): " msgstr "" -#: src/stored/btape.c:2393 +#: src/stored/btape.c:2400 #, c-format msgid "Begin writing %d Bacula blocks to tape ...\n" msgstr "" -#: src/stored/btape.c:2445 +#: src/stored/btape.c:2452 #, c-format msgid "Begin writing raw blocks of %u bytes.\n" msgstr "" -#: src/stored/btape.c:2465 +#: src/stored/btape.c:2472 #, c-format msgid "Write failed at block %u. stat=%d ERR=%s\n" msgstr "" -#: src/stored/btape.c:2495 +#: src/stored/btape.c:2502 #, c-format msgid "Begin writing Bacula blocks of %u bytes.\n" msgstr "" -#: src/stored/btape.c:2514 +#: src/stored/btape.c:2521 #, c-format msgid "Write failed at block %u.\n" msgstr "" -#: src/stored/btape.c:2521 +#: src/stored/btape.c:2528 msgid "test autochanger" msgstr "" -#: src/stored/btape.c:2522 +#: src/stored/btape.c:2529 msgid "backspace file" msgstr "" -#: src/stored/btape.c:2523 +#: src/stored/btape.c:2530 msgid "backspace record" msgstr "" -#: src/stored/btape.c:2524 +#: src/stored/btape.c:2531 msgid "fill tape using Bacula writes" msgstr "" -#: src/stored/btape.c:2525 +#: src/stored/btape.c:2532 msgid "list device capabilities" msgstr "" -#: src/stored/btape.c:2526 +#: src/stored/btape.c:2533 msgid "clear tape errors" msgstr "" -#: src/stored/btape.c:2527 +#: src/stored/btape.c:2534 msgid "go to end of Bacula data for append" msgstr "" -#: src/stored/btape.c:2528 +#: src/stored/btape.c:2535 msgid "go to the physical end of medium" msgstr "" -#: src/stored/btape.c:2529 +#: src/stored/btape.c:2536 msgid "fill tape, write onto second volume" msgstr "" -#: src/stored/btape.c:2530 +#: src/stored/btape.c:2537 msgid "read filled tape" msgstr "" -#: src/stored/btape.c:2531 +#: src/stored/btape.c:2538 msgid "forward space a file" msgstr "" -#: src/stored/btape.c:2532 +#: src/stored/btape.c:2539 msgid "forward space a record" msgstr "" -#: src/stored/btape.c:2534 +#: src/stored/btape.c:2541 msgid "write a Bacula label to the tape" msgstr "" -#: src/stored/btape.c:2535 +#: src/stored/btape.c:2542 msgid "load a tape" msgstr "" -#: src/stored/btape.c:2536 +#: src/stored/btape.c:2543 msgid "quit btape" msgstr "" -#: src/stored/btape.c:2537 +#: src/stored/btape.c:2544 msgid "use write() to fill tape" msgstr "" -#: src/stored/btape.c:2538 +#: src/stored/btape.c:2545 msgid "read and print the Bacula tape label" msgstr "" -#: src/stored/btape.c:2539 +#: src/stored/btape.c:2546 msgid "test record handling functions" msgstr "" -#: src/stored/btape.c:2540 +#: src/stored/btape.c:2547 msgid "rewind the tape" msgstr "" -#: src/stored/btape.c:2541 +#: src/stored/btape.c:2548 msgid "read() tape block by block to EOT and report" msgstr "" -#: src/stored/btape.c:2542 +#: src/stored/btape.c:2549 msgid "Bacula read block by block to EOT and report" msgstr "" -#: src/stored/btape.c:2543 +#: src/stored/btape.c:2550 msgid "print tape status" msgstr "" -#: src/stored/btape.c:2544 +#: src/stored/btape.c:2551 msgid "General test Bacula tape functions" msgstr "" -#: src/stored/btape.c:2545 +#: src/stored/btape.c:2552 msgid "write an EOF on the tape" msgstr "" -#: src/stored/btape.c:2546 +#: src/stored/btape.c:2553 msgid "write a single Bacula block" msgstr "" -#: src/stored/btape.c:2547 +#: src/stored/btape.c:2554 msgid "read a single record" msgstr "" -#: src/stored/btape.c:2548 +#: src/stored/btape.c:2555 msgid "quick fill command" msgstr "" -#: src/stored/btape.c:2569 +#: src/stored/btape.c:2576 #, c-format msgid "%s is an illegal command\n" msgstr "" -#: src/stored/btape.c:2579 +#: src/stored/btape.c:2586 #, c-format msgid "Interactive commands:\n" msgstr "" -#: src/stored/btape.c:2589 +#: src/stored/btape.c:2596 #, c-format msgid "" "Copyright (C) 2000-2005 Kern Sibbald.\n" @@ -10765,27 +10898,27 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:2680 +#: src/stored/btape.c:2687 #, c-format msgid "Mount second Volume on device %s and press return when ready: " msgstr "" -#: src/stored/btape.c:2707 +#: src/stored/btape.c:2714 #, c-format msgid "Mount blank Volume on device %s and press return when ready: " msgstr "" -#: src/stored/btape.c:2725 +#: src/stored/btape.c:2732 #, c-format msgid "End of Volume \"%s\"\n" msgstr "" -#: src/stored/btape.c:2737 +#: src/stored/btape.c:2744 #, c-format msgid "Read block=%u, VolBytes=%s rate=%.1f KB/s\n" msgstr "" -#: src/stored/btape.c:2752 src/stored/mount.c:493 +#: src/stored/btape.c:2759 src/stored/mount.c:500 #, c-format msgid "Cannot open Dev=%s, Vol=%s\n" msgstr "" @@ -10810,358 +10943,345 @@ msgstr "" msgid "cont," msgstr "" -#: src/stored/butil.c:128 +#: src/stored/butil.c:130 msgid "Volume name or names is too long. Please use a .bsr file.\n" msgstr "" -#: src/stored/butil.c:148 +#: src/stored/butil.c:150 #, c-format msgid "Cannot find device \"%s\" in config file %s.\n" msgstr "" -#: src/stored/butil.c:155 +#: src/stored/butil.c:157 #, c-format msgid "Cannot init device %s\n" msgstr "" -#: src/stored/butil.c:174 +#: src/stored/butil.c:178 #, c-format msgid "Cannot open %s\n" msgstr "" -#: src/stored/butil.c:253 +#: src/stored/butil.c:261 #, c-format msgid "Could not find device \"%s\" in config file %s.\n" msgstr "" -#: src/stored/butil.c:258 +#: src/stored/butil.c:266 #, c-format msgid "Using device: \"%s\" for reading.\n" msgstr "" -#: src/stored/butil.c:261 +#: src/stored/butil.c:269 #, c-format msgid "Using device: \"%s\" for writing.\n" msgstr "" -#: src/stored/butil.c:277 +#: src/stored/butil.c:285 msgid "Unexpected End of Data\n" msgstr "" -#: src/stored/butil.c:279 +#: src/stored/butil.c:287 msgid "Unexpected End of Tape\n" msgstr "" -#: src/stored/butil.c:281 +#: src/stored/butil.c:289 msgid "Unexpected End of File\n" msgstr "" -#: src/stored/butil.c:283 +#: src/stored/butil.c:291 msgid "Tape Door is Open\n" msgstr "" -#: src/stored/butil.c:285 +#: src/stored/butil.c:293 msgid "Unexpected Tape is Off-line\n" msgstr "" -#: src/stored/dev.c:110 +#: src/stored/dev.c:112 #, c-format msgid "Unable to stat device %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:125 +#: src/stored/dev.c:123 #, c-format msgid "" "%s is an unknown device type. Must be tape or directory\n" " or have RequiresMount=yes for DVD. st_mode=%x\n" msgstr "" -#: src/stored/dev.c:183 +#: src/stored/dev.c:179 #, c-format msgid "Unable to stat mount point %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:188 +#: src/stored/dev.c:186 msgid "" "Mount and unmount commands must defined for a device which requires mount.\n" msgstr "" -#: src/stored/dev.c:191 +#: src/stored/dev.c:189 msgid "Write part command must be defined for a device which requires mount.\n" msgstr "" -#: src/stored/dev.c:197 +#: src/stored/dev.c:194 #, c-format msgid "Block size %u on device %s is too large, using default %u\n" msgstr "" -#: src/stored/dev.c:202 +#: src/stored/dev.c:199 #, c-format msgid "Max block size %u not multiple of device %s block size.\n" msgstr "" -#: src/stored/dev.c:218 src/stored/dev.c:224 +#: src/stored/dev.c:215 src/stored/dev.c:221 #, c-format msgid "Unable to init cond variable: ERR=%s\n" msgstr "" -#: src/stored/dev.c:310 +#: src/stored/dev.c:312 msgid "Illegal mode given to open dev.\n" msgstr "" -#: src/stored/dev.c:376 src/stored/device.c:302 +#: src/stored/dev.c:355 src/stored/device.c:295 #, c-format msgid "Unable to open device %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:396 -#, c-format -msgid "fcntl error. ERR=%s\n" -msgstr "" - -#: src/stored/dev.c:434 src/stored/dev.c:493 +#: src/stored/dev.c:423 src/stored/dev.c:481 #, c-format msgid "Could not open file device %s. No Volume name given.\n" msgstr "" -#: src/stored/dev.c:459 src/stored/dev.c:573 +#: src/stored/dev.c:449 src/stored/dev.c:562 #, c-format msgid "Could not open: %s, ERR=%s\n" msgstr "" -#: src/stored/dev.c:518 +#: src/stored/dev.c:506 #, c-format msgid "" "The media in the device %s is not empty, please blank it before writing " "anything to it.\n" msgstr "" -#: src/stored/dev.c:534 +#: src/stored/dev.c:523 #, c-format msgid "There is no valid media in the device %s.\n" msgstr "" -#: src/stored/dev.c:541 +#: src/stored/dev.c:530 #, c-format msgid "Could not mount device %s.\n" msgstr "" -#: src/stored/dev.c:599 +#: src/stored/dev.c:588 #, c-format msgid "Could not fstat: %s, ERR=%s\n" msgstr "" -#: src/stored/dev.c:652 +#: src/stored/dev.c:631 #, c-format -msgid "Bad call to rewind_dev. Device %s not open\n" +msgid "Bad call to rewind. Device %s not open\n" msgstr "" -#: src/stored/dev.c:681 +#: src/stored/dev.c:677 #, c-format msgid "Rewind error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:691 src/stored/dev.c:804 src/stored/dev.c:941 -#: src/stored/dev.c:1466 +#: src/stored/dev.c:687 src/stored/dev.c:802 src/stored/dev.c:938 +#: src/stored/dev.c:1457 #, c-format msgid "lseek_dev error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:731 +#: src/stored/dev.c:727 msgid "unknown blocked code" msgstr "" -#: src/stored/dev.c:774 +#: src/stored/dev.c:772 #, c-format msgid "Bad call to eod_dev. Device %s not open\n" msgstr "" -#: src/stored/dev.c:840 +#: src/stored/dev.c:838 #, c-format msgid "ioctl MTEOM error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:848 src/stored/dev.c:981 +#: src/stored/dev.c:846 src/stored/dev.c:978 #, c-format msgid "ioctl MTIOCGET error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:927 +#: src/stored/dev.c:924 msgid "Bad device call. Device not open\n" msgstr "" -#: src/stored/dev.c:940 +#: src/stored/dev.c:937 #, c-format msgid "Seek error: ERR=%s\n" msgstr "" -#: src/stored/dev.c:976 +#: src/stored/dev.c:973 msgid " Bacula status:" msgstr "" -#: src/stored/dev.c:977 src/stored/dev.c:1026 src/stored/dev.c:1028 +#: src/stored/dev.c:974 src/stored/dev.c:1023 src/stored/dev.c:1025 #, c-format msgid " file=%d block=%d\n" msgstr "" -#: src/stored/dev.c:985 +#: src/stored/dev.c:982 msgid " Device status:" msgstr "" -#: src/stored/dev.c:1050 +#: src/stored/dev.c:1047 msgid "Bad call to load_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1061 src/stored/dev.c:1074 +#: src/stored/dev.c:1058 src/stored/dev.c:1071 #, c-format msgid "ioctl MTLOAD error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1093 -msgid "Bad call to offline_dev. Device not open\n" -msgstr "" - -#: src/stored/dev.c:1116 +#: src/stored/dev.c:1107 #, c-format msgid "ioctl MTOFFL error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1157 +#: src/stored/dev.c:1148 msgid "Bad call to fsf_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1167 src/stored/dev.c:1288 +#: src/stored/dev.c:1158 src/stored/dev.c:1279 #, c-format msgid "Device %s at End of Tape.\n" msgstr "" -#: src/stored/dev.c:1192 src/stored/dev.c:1268 +#: src/stored/dev.c:1183 src/stored/dev.c:1259 #, c-format msgid "ioctl MTFSF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1317 +#: src/stored/dev.c:1308 msgid "Bad call to bsf_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1323 +#: src/stored/dev.c:1314 #, c-format msgid "Device %s cannot BSF because it is not a tape.\n" msgstr "" -#: src/stored/dev.c:1338 +#: src/stored/dev.c:1329 #, c-format msgid "ioctl MTBSF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1358 +#: src/stored/dev.c:1349 msgid "Bad call to fsr. Device not open\n" msgstr "" -#: src/stored/dev.c:1367 +#: src/stored/dev.c:1358 #, c-format msgid "ioctl MTFSR not permitted on %s.\n" msgstr "" -#: src/stored/dev.c:1395 +#: src/stored/dev.c:1386 #, c-format msgid "ioctl MTFSR %d error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1415 +#: src/stored/dev.c:1406 msgid "Bad call to bsr_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1425 +#: src/stored/dev.c:1416 #, c-format msgid "ioctl MTBSR not permitted on %s.\n" msgstr "" -#: src/stored/dev.c:1438 +#: src/stored/dev.c:1429 #, c-format msgid "ioctl MTBSR error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1455 +#: src/stored/dev.c:1446 msgid "Bad call to reposition_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1523 +#: src/stored/dev.c:1514 msgid "Bad call to weof_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1533 +#: src/stored/dev.c:1524 msgid "Attempt to WEOF on non-appendable Volume\n" msgstr "" -#: src/stored/dev.c:1550 +#: src/stored/dev.c:1541 #, c-format msgid "ioctl MTWEOF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1592 +#: src/stored/dev.c:1583 msgid "Got ENOTTY on read/write!\n" msgstr "" -#: src/stored/dev.c:1639 +#: src/stored/dev.c:1630 #, c-format msgid "unknown func code %d" msgstr "" -#: src/stored/dev.c:1645 +#: src/stored/dev.c:1636 #, c-format msgid "I/O function \"%s\" not supported on this device.\n" msgstr "" -#: src/stored/dev.c:1783 src/stored/dvd.c:668 +#: src/stored/dev.c:1761 src/stored/dvd.c:734 #, c-format msgid "Unable to truncate device %s. ERR=%s\n" msgstr "" -#: src/stored/dev.c:1822 +#: src/stored/dev.c:1800 msgid "Bad call to term_dev. Device not open\n" msgstr "" -#: src/stored/device.c:105 +#: src/stored/device.c:100 #, c-format msgid "End of medium on Volume \"%s\" Bytes=%s Blocks=%s at %s.\n" msgstr "" -#: src/stored/device.c:119 +#: src/stored/device.c:114 #, c-format msgid "New volume \"%s\" mounted on device %s at %s.\n" msgstr "" -#: src/stored/device.c:131 +#: src/stored/device.c:126 #, c-format msgid "write_block_to_device Volume label failed. ERR=%s" msgstr "" -#: src/stored/device.c:168 +#: src/stored/device.c:162 #, c-format msgid "write_block_to_device overflow block failed. ERR=%s" msgstr "" -#: src/stored/device.c:304 +#: src/stored/device.c:297 #, c-format msgid "Unable to open archive %s: ERR=%s\n" msgstr "" -#: src/stored/device.c:328 -msgid "Bad call to force_close_dev. Device not open\n" -msgstr "" - -#: src/stored/device.c:346 +#: src/stored/device.c:332 #, c-format msgid "Device write lock failure. ERR=%s\n" msgstr "" -#: src/stored/device.c:354 +#: src/stored/device.c:340 #, c-format msgid "Device write unlock failure. ERR=%s\n" msgstr "" -#: src/stored/device.c:373 +#: src/stored/device.c:359 #, c-format msgid "pthread_cond_wait failure. ERR=%s\n" msgstr "" @@ -11182,72 +11302,72 @@ msgstr "" #: src/stored/dircmd.c:262 #, c-format -msgid "3902 Job %s not found.\n" +msgid "3904 Job %s not found.\n" msgstr "" -#: src/stored/dircmd.c:279 +#: src/stored/dircmd.c:283 #, c-format msgid "3000 Job %s marked to be canceled.\n" msgstr "" -#: src/stored/dircmd.c:283 +#: src/stored/dircmd.c:287 msgid "3903 Error scanning cancel command.\n" msgstr "" -#: src/stored/dircmd.c:356 src/stored/dircmd.c:655 src/stored/dircmd.c:720 -#: src/stored/dircmd.c:779 src/stored/dircmd.c:829 src/stored/dircmd.c:869 +#: src/stored/dircmd.c:364 src/stored/dircmd.c:680 src/stored/dircmd.c:756 +#: src/stored/dircmd.c:819 src/stored/dircmd.c:874 src/stored/dircmd.c:918 #, c-format -msgid "3999 Device \"%s\" not found\n" +msgid "3999 Device \"%s\" not found or could not be opened.\n" msgstr "" -#: src/stored/dircmd.c:361 +#: src/stored/dircmd.c:369 #, c-format msgid "3903 Error scanning label command: %s\n" msgstr "" -#: src/stored/dircmd.c:405 +#: src/stored/dircmd.c:412 #, c-format msgid "3920 Cannot label Volume because it is already labeled: \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:411 +#: src/stored/dircmd.c:419 msgid "3921 Wrong volume mounted.\n" msgstr "" -#: src/stored/dircmd.c:415 +#: src/stored/dircmd.c:423 msgid "3922 Cannot relabel an ANSI/IBM labeled Volume.\n" msgstr "" -#: src/stored/dircmd.c:423 src/stored/dircmd.c:432 +#: src/stored/dircmd.c:431 src/stored/dircmd.c:440 #, c-format msgid "3912 Failed to label Volume: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:435 +#: src/stored/dircmd.c:443 #, c-format msgid "3913 Cannot label Volume. Unknown status %d from read_volume_label()\n" msgstr "" -#: src/stored/dircmd.c:468 +#: src/stored/dircmd.c:476 #, c-format msgid "3001 Mounted Volume: %s\n" msgstr "" -#: src/stored/dircmd.c:472 src/stored/dircmd.c:905 +#: src/stored/dircmd.c:480 src/stored/dircmd.c:954 #, c-format msgid "" "3902 Cannot mount Volume on Storage Device %s because:\n" "%s" msgstr "" -#: src/stored/dircmd.c:495 src/stored/reserve.c:554 +#: src/stored/dircmd.c:508 src/stored/reserve.c:634 #, c-format msgid "" "\n" " Device \"%s\" requested by DIR could not be opened or does not exist.\n" msgstr "" -#: src/stored/dircmd.c:516 src/stored/reserve.c:550 +#: src/stored/dircmd.c:529 src/stored/reserve.c:630 #, c-format msgid "" "\n" @@ -11255,151 +11375,217 @@ msgid "" "does not exist.\n" msgstr "" -#: src/stored/dircmd.c:575 src/stored/dircmd.c:623 +#: src/stored/dircmd.c:593 src/stored/dircmd.c:646 #, c-format msgid "3901 open device failed: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:590 src/stored/dircmd.c:614 +#: src/stored/dircmd.c:613 src/stored/dircmd.c:637 #, c-format msgid "3001 Device %s is mounted with Volume \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:593 src/stored/dircmd.c:617 src/stored/dircmd.c:632 +#: src/stored/dircmd.c:616 src/stored/dircmd.c:640 src/stored/dircmd.c:655 #, c-format msgid "" "3905 Device %s open but no Bacula volume is mounted.\n" "If this is not a blank tape, try unmounting and remounting the Volume.\n" msgstr "" -#: src/stored/dircmd.c:602 +#: src/stored/dircmd.c:625 #, c-format msgid "3001 Device %s is doing acquire.\n" msgstr "" -#: src/stored/dircmd.c:607 src/stored/dircmd.c:698 +#: src/stored/dircmd.c:630 src/stored/dircmd.c:730 #, c-format msgid "3903 Device %s is being labeled.\n" msgstr "" -#: src/stored/dircmd.c:629 +#: src/stored/dircmd.c:652 #, c-format msgid "3001 Device %s is already mounted with Volume \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:638 +#: src/stored/dircmd.c:661 #, c-format msgid "3002 Device %s is mounted.\n" msgstr "" -#: src/stored/dircmd.c:641 +#: src/stored/dircmd.c:664 #, c-format msgid "3907 %s" msgstr "" -#: src/stored/dircmd.c:644 +#: src/stored/dircmd.c:667 #, c-format msgid "3906 File device %s is always mounted.\n" msgstr "" -#: src/stored/dircmd.c:650 +#: src/stored/dircmd.c:673 #, c-format msgid "3905 Bizarre wait state %d\n" msgstr "" -#: src/stored/dircmd.c:659 +#: src/stored/dircmd.c:684 #, c-format msgid "3909 Error scanning mount command: %s\n" msgstr "" -#: src/stored/dircmd.c:681 +#: src/stored/dircmd.c:711 #, c-format msgid "3901 Device %s is already unmounted.\n" msgstr "" -#: src/stored/dircmd.c:690 +#: src/stored/dircmd.c:722 #, c-format msgid "3001 Device %s unmounted.\n" msgstr "" -#: src/stored/dircmd.c:694 +#: src/stored/dircmd.c:726 #, c-format msgid "3902 Device %s is busy in acquire.\n" msgstr "" -#: src/stored/dircmd.c:715 +#: src/stored/dircmd.c:749 #, c-format msgid "3002 Device %s unmounted.\n" msgstr "" -#: src/stored/dircmd.c:725 +#: src/stored/dircmd.c:761 #, c-format msgid "3907 Error scanning unmount command: %s\n" msgstr "" -#: src/stored/dircmd.c:751 +#: src/stored/dircmd.c:789 #, c-format -msgid "3911 Device %s already released.\n" +msgid "3921 Device %s already released.\n" msgstr "" -#: src/stored/dircmd.c:758 +#: src/stored/dircmd.c:796 #, c-format -msgid "3912 Device %s waiting for mount.\n" +msgid "3922 Device %s waiting for mount.\n" msgstr "" -#: src/stored/dircmd.c:762 +#: src/stored/dircmd.c:800 #, c-format -msgid "3913 Device %s is busy in acquire.\n" +msgid "3923 Device %s is busy in acquire.\n" msgstr "" -#: src/stored/dircmd.c:766 +#: src/stored/dircmd.c:804 #, c-format msgid "3914 Device %s is being labeled.\n" msgstr "" -#: src/stored/dircmd.c:774 +#: src/stored/dircmd.c:812 #, c-format -msgid "3012 Device %s released.\n" +msgid "3022 Device %s released.\n" msgstr "" -#: src/stored/dircmd.c:784 +#: src/stored/dircmd.c:824 #, c-format -msgid "3917 Error scanning release command: %s\n" +msgid "3927 Error scanning release command: %s\n" msgstr "" -#: src/stored/dircmd.c:817 +#: src/stored/dircmd.c:860 #, c-format msgid "3995 Device %s is not an autochanger.\n" msgstr "" -#: src/stored/dircmd.c:833 +#: src/stored/dircmd.c:878 #, c-format -msgid "3908 Error scanning autocharger list/slots command: %s\n" +msgid "3908 Error scanning autocharger drives/list/slots command: %s\n" msgstr "" -#: src/stored/dircmd.c:873 +#: src/stored/dircmd.c:922 #, c-format msgid "3909 Error scanning readlabel command: %s\n" msgstr "" -#: src/stored/dircmd.c:901 +#: src/stored/dircmd.c:950 #, c-format msgid "3001 Volume=%s Slot=%d\n" msgstr "" -#: src/stored/dircmd.c:930 +#: src/stored/dircmd.c:979 #, c-format msgid "3910 Unable to open device %s: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:940 +#: src/stored/dircmd.c:991 +#, c-format +msgid "3931 Device %s is BLOCKED. user unmounted.\n" +msgstr "" + +#: src/stored/dircmd.c:995 +#, c-format +msgid "" +"3932 Device %s is BLOCKED. user unmounted during wait for media/mount.\n" +msgstr "" + +#: src/stored/dircmd.c:999 +#, c-format +msgid "3933 Device %s is BLOCKED waiting for media.\n" +msgstr "" + +#: src/stored/dircmd.c:1003 +#, c-format +msgid "3934 Device %s is being initialized.\n" +msgstr "" + +#: src/stored/dircmd.c:1007 +#, c-format +msgid "3935 Device %s is blocked labeling a Volume.\n" +msgstr "" + +#: src/stored/dircmd.c:1011 +#, c-format +msgid "3935 Device %s is blocked for unknown reason.\n" +msgstr "" + +#: src/stored/dircmd.c:1016 +#, c-format +msgid "3936 Device %s is busy reading.\n" +msgstr "" + +#: src/stored/dircmd.c:1019 +#, c-format +msgid "3937 Device %s is busy with %d writer(s).\n" +msgstr "" + +#: src/stored/dvd.c:153 +#, c-format +msgid "Device %s cannot be mounted. ERR=%s\n" +msgstr "" + +#: src/stored/dvd.c:271 +#, c-format +msgid "Cannot run free space command (%s)\n" +msgstr "" + +#: src/stored/dvd.c:374 +#, c-format +msgid "Error while writing current part to the DVD: %s" +msgstr "" + +#: src/stored/dvd.c:394 +#, c-format +msgid "Remaining free space %s on %s\n" +msgstr "" + +#: src/stored/dvd.c:464 +#, c-format +msgid "Next Volume part already exists on DVD. Cannot continue: %s\n" +msgstr "" + +#: src/stored/dvd.c:481 #, c-format -msgid "3911 Device %s is busy reading.\n" +msgid "open_next_part can't unlink existing part %s, ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:943 +#: src/stored/dvd.c:700 #, c-format -msgid "3912 Device %s is busy with %d writer(s).\n" +msgid "Unable to write part %s: ERR=%s\n" msgstr "" #: src/stored/fd_cmds.c:340 @@ -11483,52 +11669,52 @@ msgstr "" msgid "Cannot write Volume label to block for device %s\n" msgstr "" -#: src/stored/label.c:393 +#: src/stored/label.c:400 #, c-format msgid "Rewind error on device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:398 +#: src/stored/label.c:405 #, c-format msgid "Truncate error on device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:420 +#: src/stored/label.c:427 #, c-format msgid "Unable to write device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:448 +#: src/stored/label.c:455 #, c-format msgid "Recycled volume \"%s\" on device %s, all previous data lost.\n" msgstr "" -#: src/stored/label.c:451 +#: src/stored/label.c:458 #, c-format msgid "Wrote label to prelabeled Volume \"%s\" on device %s\n" msgstr "" -#: src/stored/label.c:648 +#: src/stored/label.c:657 #, c-format msgid "Bad session label = %d\n" msgstr "" -#: src/stored/label.c:666 src/stored/label.c:673 +#: src/stored/label.c:675 src/stored/label.c:682 #, c-format msgid "Error writing Session label to %s: %s\n" msgstr "" -#: src/stored/label.c:707 +#: src/stored/label.c:717 #, c-format msgid "Expecting Volume Label, got FI=%s Stream=%s len=%d\n" msgstr "" -#: src/stored/label.c:834 +#: src/stored/label.c:844 #, c-format msgid "Unknown %d" msgstr "" -#: src/stored/label.c:838 +#: src/stored/label.c:848 #, c-format msgid "" "\n" @@ -11545,17 +11731,17 @@ msgid "" "HostName : %s\n" msgstr "" -#: src/stored/label.c:860 +#: src/stored/label.c:870 #, c-format msgid "Date label written: %s\n" msgstr "" -#: src/stored/label.c:866 +#: src/stored/label.c:876 #, c-format msgid "Date label written: %04d-%02d-%02d at %02d:%02d\n" msgstr "" -#: src/stored/label.c:886 +#: src/stored/label.c:896 #, c-format msgid "" "\n" @@ -11568,7 +11754,7 @@ msgid "" "ClientName : %s\n" msgstr "" -#: src/stored/label.c:899 +#: src/stored/label.c:909 #, c-format msgid "" "Job (unique name) : %s\n" @@ -11577,7 +11763,7 @@ msgid "" "JobLevel : %c\n" msgstr "" -#: src/stored/label.c:908 +#: src/stored/label.c:918 #, c-format msgid "" "JobFiles : %s\n" @@ -11590,62 +11776,62 @@ msgid "" "JobStatus : %c\n" msgstr "" -#: src/stored/label.c:929 +#: src/stored/label.c:939 #, c-format msgid "Date written : %s\n" msgstr "" -#: src/stored/label.c:934 +#: src/stored/label.c:944 #, c-format msgid "Date written : %04d-%02d-%02d at %02d:%02d\n" msgstr "" -#: src/stored/label.c:953 +#: src/stored/label.c:963 msgid "Fresh Volume" msgstr "" -#: src/stored/label.c:956 +#: src/stored/label.c:966 msgid "Volume" msgstr "" -#: src/stored/label.c:965 src/stored/read_record.c:335 +#: src/stored/label.c:975 src/stored/read_record.c:336 msgid "End of Media" msgstr "" -#: src/stored/label.c:968 +#: src/stored/label.c:978 msgid "End of Tape" msgstr "" -#: src/stored/label.c:988 src/stored/label.c:996 src/stored/label.c:1029 +#: src/stored/label.c:998 src/stored/label.c:1006 src/stored/label.c:1039 #, c-format msgid "%s Record: File:blk=%u:%u SessId=%d SessTime=%d JobId=%d DataLen=%d\n" msgstr "" -#: src/stored/label.c:993 +#: src/stored/label.c:1003 msgid "End of physical tape.\n" msgstr "" -#: src/stored/label.c:1008 src/stored/label.c:1017 +#: src/stored/label.c:1018 src/stored/label.c:1027 #, c-format msgid "%s Record: File:blk=%u:%u SessId=%d SessTime=%d JobId=%d\n" msgstr "" -#: src/stored/label.c:1010 +#: src/stored/label.c:1020 #, c-format msgid " Job=%s Date=%s Level=%c Type=%c\n" msgstr "" -#: src/stored/label.c:1019 +#: src/stored/label.c:1029 #, c-format msgid " Date=%s Level=%c Type=%c Files=%s Bytes=%s Errors=%d Status=%c\n" msgstr "" -#: src/stored/mount.c:197 src/stored/mount.c:294 +#: src/stored/mount.c:198 src/stored/mount.c:295 #, c-format msgid "Volume \"%s\" not on device %s.\n" msgstr "" -#: src/stored/mount.c:230 +#: src/stored/mount.c:231 #, c-format msgid "" "Director wanted Volume \"%s\".\n" @@ -11653,51 +11839,65 @@ msgid "" " %s" msgstr "" -#: src/stored/mount.c:284 +#: src/stored/mount.c:285 #, c-format msgid "Labeled new Volume \"%s\" on device %s.\n" msgstr "" -#: src/stored/mount.c:289 +#: src/stored/mount.c:290 #, c-format msgid "Warning device %s not configured to autolabel Volumes.\n" msgstr "" -#: src/stored/mount.c:340 +#: src/stored/mount.c:342 #, c-format msgid "Volume \"%s\" previously written, moving to end of data.\n" msgstr "" -#: src/stored/mount.c:343 +#: src/stored/mount.c:345 #, c-format msgid "Unable to position to end of data on device %s: ERR=%s\n" msgstr "" -#: src/stored/mount.c:355 +#: src/stored/mount.c:357 #, c-format msgid "Ready to append to end of Volume \"%s\" at file=%d.\n" msgstr "" -#: src/stored/mount.c:358 +#: src/stored/mount.c:360 #, c-format msgid "" "I cannot write on Volume \"%s\" because:\n" "The number of files mismatch! Volume=%u Catalog=%u\n" msgstr "" -#: src/stored/mount.c:411 +#: src/stored/mount.c:388 +#, c-format +msgid "Ready to append to end of Volume \"%s\" at file address=%u.\n" +msgstr "" + +#: src/stored/mount.c:392 +#, c-format +msgid "" +"I cannot write on Volume \"%s\" because:\n" +"The EOD file address is wrong: Volume file address=%u != Catalog Endblock=%u" +"(+1)\n" +"You probably removed DVD last part in spool directory.\n" +msgstr "" + +#: src/stored/mount.c:418 #, c-format msgid "Marking Volume \"%s\" in Error in Catalog.\n" msgstr "" -#: src/stored/mount.c:427 +#: src/stored/mount.c:434 #, c-format msgid "" "Autochanger Volume \"%s\" not found in slot %d.\n" " Setting InChanger to zero in catalog.\n" msgstr "" -#: src/stored/mount.c:446 +#: src/stored/mount.c:453 msgid "Hey!!!!! WroteVol non-zero !!!!!\n" msgstr "" @@ -11831,13 +12031,26 @@ msgstr "" msgid "fast_reject : %d\n" msgstr "" -#: src/stored/read.c:55 -msgid "No Volume names found for restore.\n" +#: src/stored/pythonsd.c:202 +msgid "Error in ParseTuple\n" msgstr "" -#: src/stored/read.c:109 -#, c-format -msgid ">filed: Error Hdr=%s\n" +#: src/stored/pythonsd.c:218 +msgid "Parse tuple error in job_write\n" +msgstr "" + +#: src/stored/pythonsd.c:254 +#, c-format +msgid "Error in Python method %s\n" +msgstr "" + +#: src/stored/read.c:55 +msgid "No Volume names found for restore.\n" +msgstr "" + +#: src/stored/read.c:109 +#, c-format +msgid ">filed: Error Hdr=%s\n" msgstr "" #: src/stored/read.c:110 src/stored/read.c:125 @@ -11868,38 +12081,115 @@ msgstr "" msgid "Did fsr\n" msgstr "" -#: src/stored/read_record.c:275 +#: src/stored/read_record.c:276 #, c-format msgid "Reposition from (file:block) %u:%u to %u:%u\n" msgstr "" -#: src/stored/read_record.c:302 +#: src/stored/read_record.c:303 #, c-format msgid "Forward spacing to file:block %u:%u.\n" msgstr "" -#: src/stored/read_record.c:328 +#: src/stored/read_record.c:329 msgid "Begin Session" msgstr "" -#: src/stored/read_record.c:332 +#: src/stored/read_record.c:333 msgid "End Session" msgstr "" -#: src/stored/read_record.c:338 +#: src/stored/read_record.c:339 #, c-format msgid "Unknown code %d\n" msgstr "" -#: src/stored/record.c:61 +#: src/stored/record.c:60 #, c-format msgid "unknown: %d" msgstr "" -#: src/stored/record.c:332 +#: src/stored/record.c:343 msgid "Damaged buffer\n" msgstr "" +#: src/stored/reserve.c:467 src/stored/reserve.c:479 +#, c-format +msgid "Failed command: %s\n" +msgstr "" + +#: src/stored/reserve.c:469 +#, c-format +msgid "" +"\n" +" Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD " +"Device resources.\n" +msgstr "" + +#: src/stored/reserve.c:647 +#, c-format +msgid "3926 Could not get dcr for device: %s\n" +msgstr "" + +#: src/stored/reserve.c:709 +#, c-format +msgid "3601 JobId=%u device %s is BLOCKED due to user unmount.\n" +msgstr "" + +#: src/stored/reserve.c:718 +#, c-format +msgid "3602 JobId=%u device %s is busy (already reading/writing).\n" +msgstr "" + +#: src/stored/reserve.c:761 +#, c-format +msgid "3603 JobId=%u device %s is busy reading.\n" +msgstr "" + +#: src/stored/reserve.c:770 +#, c-format +msgid "3604 JobId=%u device %s is BLOCKED due to user unmount.\n" +msgstr "" + +#: src/stored/reserve.c:836 +#, c-format +msgid "3605 JobId=%u wants free drive but device %s is busy.\n" +msgstr "" + +#: src/stored/reserve.c:844 +#, c-format +msgid "3606 JobId=%u wants mounted, but drive %s has no Volume.\n" +msgstr "" + +#: src/stored/reserve.c:854 +#, c-format +msgid "3607 JobId=%u wants Vol=\"%s\" drive has Vol=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:890 +#, c-format +msgid "3608 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:933 +#, c-format +msgid "3609 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:941 src/stored/reserve.c:945 +msgid "Logic error!!!! Should not get here.\n" +msgstr "" + +#: src/stored/reserve.c:942 +#, c-format +msgid "3910 JobId=%u Logic error!!!! drive %s Should not get here.\n" +msgstr "" + +#: src/stored/reserve.c:948 +#, c-format +msgid "3911 JobId=%u failed reserve drive %s.\n" +msgstr "" + #: src/stored/spool.c:69 #, c-format msgid "" @@ -11927,256 +12217,272 @@ msgstr "" #: src/stored/spool.c:199 #, c-format -msgid "Committing spooled data to Volume. Despooling %s bytes ...\n" +msgid "Committing spooled data to Volume \"%s\". Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:203 +#: src/stored/spool.c:204 #, c-format msgid "Writing spooled data to Volume. Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:257 src/stored/spool.c:431 src/stored/spool.c:469 +#: src/stored/spool.c:258 src/stored/spool.c:432 src/stored/spool.c:470 #, c-format msgid "Ftruncate spool file failed: ERR=%s\n" msgstr "" -#: src/stored/spool.c:259 +#: src/stored/spool.c:260 #, c-format msgid "Bad return from ftruncate. ERR=%s\n" msgstr "" -#: src/stored/spool.c:308 +#: src/stored/spool.c:309 #, c-format msgid "Spool header read error. ERR=%s\n" msgstr "" -#: src/stored/spool.c:311 +#: src/stored/spool.c:312 #, c-format msgid "Spool read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:312 +#: src/stored/spool.c:313 #, c-format msgid "Spool header read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:318 src/stored/spool.c:319 +#: src/stored/spool.c:319 src/stored/spool.c:320 #, c-format msgid "Spool block too big. Max %u bytes, got %u\n" msgstr "" -#: src/stored/spool.c:324 src/stored/spool.c:325 +#: src/stored/spool.c:325 src/stored/spool.c:326 #, c-format msgid "Spool data read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:382 +#: src/stored/spool.c:383 msgid "User specified spool size reached.\n" msgstr "" -#: src/stored/spool.c:384 +#: src/stored/spool.c:385 msgid "Bad return from despool in write_block.\n" msgstr "" -#: src/stored/spool.c:392 +#: src/stored/spool.c:393 msgid "Spooling data again ...\n" msgstr "" -#: src/stored/spool.c:423 +#: src/stored/spool.c:424 #, c-format msgid "Error writing header to spool file. ERR=%s\n" msgstr "" -#: src/stored/spool.c:437 src/stored/spool.c:475 +#: src/stored/spool.c:438 src/stored/spool.c:476 msgid "Fatal despooling error." msgstr "" -#: src/stored/spool.c:444 +#: src/stored/spool.c:445 msgid "Retrying after header spooling error failed.\n" msgstr "" -#: src/stored/spool.c:458 +#: src/stored/spool.c:459 #, c-format msgid "Error writing data to spool file. ERR=%s\n" msgstr "" -#: src/stored/spool.c:485 +#: src/stored/spool.c:486 msgid "Retrying after data spooling error failed.\n" msgstr "" -#: src/stored/spool.c:540 src/stored/spool.c:547 +#: src/stored/spool.c:541 src/stored/spool.c:548 #, c-format msgid "Fseek on attributes file failed: ERR=%s\n" msgstr "" -#: src/stored/spool.c:557 +#: src/stored/spool.c:558 #, c-format msgid "Sending spooled attrs to the Director. Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:584 +#: src/stored/spool.c:585 #, c-format msgid "fopen attr spool file %s failed: ERR=%s\n" msgstr "" -#: src/stored/status.c:66 +#: src/stored/status.c:67 #, c-format msgid "" "\n" "%s Version: %s (%s) %s %s %s\n" msgstr "" -#: src/stored/status.c:97 +#: src/stored/status.c:103 msgid "" "\n" "Device status:\n" msgstr "" -#: src/stored/status.c:99 +#: src/stored/status.c:105 #, c-format msgid "Autochanger \"%s\" with devices:\n" msgstr "" -#: src/stored/status.c:113 +#: src/stored/status.c:119 #, c-format -msgid "Device %s is mounted with Volume \"%s\"\n" +msgid "Device %s is mounted with Volume=\"%s\" Pool=\"%s\"\n" msgstr "" -#: src/stored/status.c:116 +#: src/stored/status.c:123 #, c-format msgid "Device %s open but no Bacula volume is mounted.\n" msgstr "" -#: src/stored/status.c:126 +#: src/stored/status.c:133 #, c-format msgid " Total Bytes=%s Blocks=%s Bytes/block=%s\n" msgstr "" -#: src/stored/status.c:140 +#: src/stored/status.c:147 #, c-format msgid " Total Bytes Read=%s Blocks Read=%s Bytes/block=%s\n" msgstr "" -#: src/stored/status.c:145 +#: src/stored/status.c:152 #, c-format msgid " Positioned at File=%s Block=%s\n" msgstr "" -#: src/stored/status.c:151 +#: src/stored/status.c:158 #, c-format msgid "Device %s is not open or does not exist.\n" msgstr "" -#: src/stored/status.c:153 +#: src/stored/status.c:160 #, c-format msgid "Device \"%s\" is not open or does not exist.\n" msgstr "" -#: src/stored/status.c:158 src/stored/status.c:165 src/stored/status.c:168 +#: src/stored/status.c:165 src/stored/status.c:168 src/stored/status.c:172 +#: src/stored/status.c:174 msgid "" "====\n" "\n" msgstr "" -#: src/stored/status.c:159 -msgid "Volume status:\n" +#: src/stored/status.c:166 +msgid "In Use Volume status:\n" msgstr "" -#: src/stored/status.c:183 +#: src/stored/status.c:190 msgid "" "No DEVICE structure.\n" "\n" msgstr "" -#: src/stored/status.c:188 +#: src/stored/status.c:195 msgid " Device is BLOCKED. User unmounted.\n" msgstr "" -#: src/stored/status.c:191 +#: src/stored/status.c:198 msgid " Device is BLOCKED. User unmounted during wait for media/mount.\n" msgstr "" -#: src/stored/status.c:195 +#: src/stored/status.c:202 #, c-format msgid " Device is BLOCKED waiting for mount of volume \"%s\".\n" msgstr "" -#: src/stored/status.c:198 +#: src/stored/status.c:205 msgid " Device is BLOCKED waiting for media.\n" msgstr "" -#: src/stored/status.c:202 +#: src/stored/status.c:209 msgid " Device is being initialized.\n" msgstr "" -#: src/stored/status.c:205 +#: src/stored/status.c:212 msgid " Device is blocked labeling a Volume.\n" msgstr "" -#: src/stored/status.c:213 +#: src/stored/status.c:220 #, c-format msgid " Slot %d is loaded in drive %d.\n" msgstr "" -#: src/stored/status.c:216 +#: src/stored/status.c:223 #, c-format msgid " Drive %d is not loaded.\n" msgstr "" -#: src/stored/status.c:235 +#: src/stored/status.c:242 msgid "Device state:\n" msgstr "" -#: src/stored/status.c:249 +#: src/stored/status.c:256 #, c-format msgid "" "num_writers=%d JobStatus=%c block=%d\n" "\n" msgstr "" -#: src/stored/status.c:253 +#: src/stored/status.c:260 #, c-format msgid "Archive name: %s Device name: %s\n" msgstr "" -#: src/stored/status.c:255 +#: src/stored/status.c:262 #, c-format msgid "File=%u block=%u\n" msgstr "" -#: src/stored/status.c:256 +#: src/stored/status.c:263 #, c-format msgid "Min block=%u Max block=%u\n" msgstr "" -#: src/stored/status.c:272 +#: src/stored/status.c:280 #, c-format msgid "%s Job %s waiting for Client connection.\n" msgstr "" -#: src/stored/status.c:284 +#: src/stored/status.c:295 +#, c-format +msgid "" +"Reading: %s %s job %s JobId=%d Volume=\"%s\"\n" +" pool=\"%s\" device=\"%s\"\n" +msgstr "" + +#: src/stored/status.c:307 #, c-format -msgid "%s %s job %s JobId=%d Volume=\"%s\" device=\"%s\"\n" +msgid "" +"Writing: %s %s job %s JobId=%d Volume=\"%s\"\n" +" pool=\"%s\" device=\"%s\"\n" msgstr "" -#: src/stored/status.c:303 +#: src/stored/status.c:330 #, c-format msgid " FDReadSeqNo=%s in_msg=%u out_msg=%d fd=%d\n" msgstr "" -#: src/stored/status.c:308 +#: src/stored/status.c:335 msgid " FDSocket closed\n" msgstr "" -#: src/stored/status.c:335 +#: src/stored/status.c:352 +msgid "" +"\n" +"Jobs waiting to reserve a drive:\n" +msgstr "" + +#: src/stored/status.c:380 msgid " JobId Level Files Bytes Status Finished Name \n" msgstr "" -#: src/stored/status.c:469 +#: src/stored/status.c:514 msgid "3900 Bad .status command, missing argument.\n" msgstr "" -#: src/stored/status.c:494 +#: src/stored/status.c:537 msgid "3900 Bad .status command, wrong argument.\n" msgstr "" @@ -12210,37 +12516,37 @@ msgstr "" msgid "Unable to create thread. ERR=%s\n" msgstr "" -#: src/stored/stored.c:272 +#: src/stored/stored.c:271 #, c-format msgid "Only one Storage resource permitted in %s\n" msgstr "" -#: src/stored/stored.c:277 +#: src/stored/stored.c:276 #, c-format msgid "No Director resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:282 +#: src/stored/stored.c:281 #, c-format msgid "No Device resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:290 +#: src/stored/stored.c:289 #, c-format msgid "No Messages resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:317 +#: src/stored/stored.c:316 #, c-format msgid "\"TLS Certificate\" file not defined for Storage \"%s\" in %s.\n" msgstr "" -#: src/stored/stored.c:323 +#: src/stored/stored.c:322 #, c-format msgid "\"TLS Key\" file not defined for Storage \"%s\" in %s.\n" msgstr "" -#: src/stored/stored.c:329 +#: src/stored/stored.c:328 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " @@ -12248,235 +12554,72 @@ msgid "" "using \"TLS Verify Peer\".\n" msgstr "" -#: src/stored/stored.c:417 -#, c-format -msgid "No Changer Name given for device %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:423 -#, c-format -msgid "No Changer Command given for device %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:435 -#, c-format -msgid "" -"Media Type not the same for all devices in changer %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:496 +#: src/stored/stored.c:455 #, c-format msgid "Could not initialize %s\n" msgstr "" -#: src/stored/stored.c:509 +#: src/stored/stored.c:468 #, c-format msgid "Could not open device %s\n" msgstr "" -#: src/stored/stored.c:521 +#: src/stored/stored.c:481 #, c-format msgid "Could not mount device %s\n" msgstr "" -#: src/stored/stored_conf.c:188 +#: src/stored/stored_conf.c:216 +#, c-format +msgid "Expected a Device Type keyword, got: %s" +msgstr "" + +#: src/stored/stored_conf.c:231 #, c-format msgid "Warning: no \"%s\" resource (%d) defined.\n" msgstr "" -#: src/stored/stored_conf.c:191 +#: src/stored/stored_conf.c:234 #, c-format msgid "dump_resource type=%d\n" msgstr "" -#: src/stored/stored_conf.c:307 +#: src/stored/stored_conf.c:350 #, c-format msgid "Warning: unknown resource type %d\n" msgstr "" -#: src/stored/stored_conf.c:496 +#: src/stored/stored_conf.c:539 #, c-format msgid "\"%s\" item is required in \"%s\" resource, but not found.\n" msgstr "" -#: src/stored/stored_conf.c:502 +#: src/stored/stored_conf.c:545 #, c-format msgid "Too many items in \"%s\" resource\n" msgstr "" -#: src/stored/stored_conf.c:536 +#: src/stored/stored_conf.c:579 #, c-format msgid "Cannot find AutoChanger resource %s\n" msgstr "" -#: src/stored/stored_conf.c:607 +#: src/stored/stored_conf.c:650 #, c-format msgid "" "Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n" msgstr "" -#: src/stored/ansi_label.c:83 -#, c-format -msgid "Read error on device %s in ANSI label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:93 -msgid "Insane! End of tape while reading ANSI label.\n" -msgstr "" - -#: src/stored/ansi_label.c:117 -msgid "No VOL1 label while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:137 -#, c-format -msgid "Wanted ANSI Volume \"%s\" got \"%s\"\n" -msgstr "" - -#: src/stored/ansi_label.c:148 -msgid "No HDR1 label while reading ANSI label.\n" -msgstr "" - -#: src/stored/ansi_label.c:154 -#, c-format -msgid "ANSI/IBM Volume \"%s\" does not belong to Bacula.\n" -msgstr "" - -#: src/stored/ansi_label.c:165 -msgid "No HDR2 label while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:179 -msgid "Unknown or bad ANSI/IBM label record.\n" -msgstr "" - -#: src/stored/ansi_label.c:186 -msgid "Too many records in while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:285 -#, c-format -msgid "ANSI Volume label name \"%s\" longer than 6 chars.\n" -msgstr "" - -#: src/stored/ansi_label.c:302 -#, c-format -msgid "Could not write ANSI VOL1 label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:340 src/stored/ansi_label.c:369 -#, c-format -msgid "Could not write ANSI HDR1 label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:345 src/stored/ansi_label.c:376 -msgid "Could not write ANSI HDR1 label.\n" -msgstr "" - -#: src/stored/ansi_label.c:381 -#, c-format -msgid "Error writing EOF to tape. ERR=%s" -msgstr "" - -#: src/stored/ansi_label.c:386 -msgid "write_ansi_ibm_label called for non-ANSI/IBM type\n" -msgstr "" - -#: src/stored/dvd.c:153 -#, c-format -msgid "Device %s cannot be mounted. ERR=%s\n" -msgstr "" - -#: src/stored/dvd.c:261 -#, c-format -msgid "Cannot run free space command (%s)\n" -msgstr "" - -#: src/stored/dvd.c:322 -#, c-format -msgid "Error while writing current part to the DVD: %s" -msgstr "" - -#: src/stored/dvd.c:343 -#, c-format -msgid "Remaining free space %s on %s\n" -msgstr "" - -#: src/stored/dvd.c:412 -#, c-format -msgid "Next Volume part already exists on DVD. Cannot continue: %s\n" -msgstr "" - -#: src/stored/dvd.c:430 +#: src/stored/wait.c:114 #, c-format -msgid "open_next_part can't unlink existing part %s, ERR=%s\n" -msgstr "" - -#: src/stored/dvd.c:634 -#, c-format -msgid "Unable to write part %s: ERR=%s\n" +msgid "pthread timedwait error. ERR=%s\n" msgstr "" -#: src/stored/wait.c:178 src/stored/wait.c:236 +#: src/stored/wait.c:199 #, c-format msgid "Job %s waiting to reserve a device.\n" msgstr "" -#: src/stored/pythonsd.c:202 -msgid "Error in ParseTuple\n" -msgstr "" - -#: src/stored/pythonsd.c:218 -msgid "Parse tuple error in job_write\n" -msgstr "" - -#: src/stored/pythonsd.c:254 -#, c-format -msgid "Error in Python method %s\n" -msgstr "" - -#: src/stored/reserve.c:373 src/stored/reserve.c:390 -#, c-format -msgid "Failed command: %s\n" -msgstr "" - -#: src/stored/reserve.c:375 -#, c-format -msgid "" -"\n" -" Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD " -"Device resources.\n" -msgstr "" - -#: src/stored/reserve.c:564 -#, c-format -msgid "3926 Could not get dcr for device: %s\n" -msgstr "" - -#: src/stored/reserve.c:615 src/stored/reserve.c:670 -#, c-format -msgid "Device %s is BLOCKED due to user unmount.\n" -msgstr "" - -#: src/stored/reserve.c:623 -#, c-format -msgid "Device %s is busy.\n" -msgstr "" - -#: src/stored/reserve.c:678 -#, c-format -msgid "Device %s is busy writing on another Volume.\n" -msgstr "" - -#: src/stored/reserve.c:777 -#, c-format -msgid "Wanted Pool \"%s\", but device %s is using Pool \"%s\" .\n" -msgstr "" - -#: src/stored/reserve.c:784 src/stored/reserve.c:785 -msgid "Logic error!!!! Should not get here.\n" -msgstr "" - #: src/tools/bsmtp.c:85 #, c-format msgid "Fatal malformed reply from %s: %s\n" @@ -12888,24 +13031,43 @@ msgstr "" msgid "Found %d bad Path records.\n" msgstr "" -#: src/tools/testfind.c:49 +#: src/tools/fstype.c:34 #, c-format msgid "" "\n" -"Usage: testfind [-d debug_level] [-] [pattern1 ...]\n" -" -a print extended attributes (Win32 debug)\n" -" -dnn set debug level to nn\n" -" -e specify file of exclude patterns\n" -" -i specify file of include patterns\n" -" - read pattern(s) from stdin\n" -" -? print this message.\n" +"Usage: fstype [-d debug_level] path ...\n" "\n" -"Patterns are used for file inclusion -- normally directories.\n" -"Debug level >= 1 prints each file found.\n" -"Debug level >= 10 prints path/file for catalog.\n" -"Errors are always printed.\n" -"Files/paths truncated is the number of files/paths with len > 255.\n" -"Truncation is only in the catalog.\n" +" Print the file system type a given file/directory is on.\n" +" The following options are supported:\n" +"\n" +" -v print both path and file system type.\n" +" -? print this message.\n" +"\n" +msgstr "" + +#: src/tools/fstype.c:86 +#, c-format +msgid "%s: unknown\n" +msgstr "" + +#: src/tools/testfind.c:49 +#, c-format +msgid "" +"\n" +"Usage: testfind [-d debug_level] [-] [pattern1 ...]\n" +" -a print extended attributes (Win32 debug)\n" +" -dnn set debug level to nn\n" +" -e specify file of exclude patterns\n" +" -i specify file of include patterns\n" +" - read pattern(s) from stdin\n" +" -? print this message.\n" +"\n" +"Patterns are used for file inclusion -- normally directories.\n" +"Debug level >= 1 prints each file found.\n" +"Debug level >= 10 prints path/file for catalog.\n" +"Errors are always printed.\n" +"Files/paths truncated is the number of files/paths with len > 255.\n" +"Truncation is only in the catalog.\n" "\n" msgstr "" @@ -13033,25 +13195,6 @@ msgstr "" msgid "Skip: File system change prohibited. Directory not entered. %s\n" msgstr "" -#: src/tools/fstype.c:34 -#, c-format -msgid "" -"\n" -"Usage: fstype [-d debug_level] path ...\n" -"\n" -" Print the file system type a given file/directory is on.\n" -" The following options are supported:\n" -"\n" -" -v print both path and file system type.\n" -" -? print this message.\n" -"\n" -msgstr "" - -#: src/tools/fstype.c:86 -#, c-format -msgid "%s: unknown\n" -msgstr "" - #: src/tray-monitor/authenticate.c:78 msgid "" "Director authorization problem.\n" @@ -13178,24 +13321,11 @@ msgstr "" #: src/tray-monitor/tray-monitor.c:503 src/tray-monitor/tray-monitor.c:513 msgid "" -"Copyright (C) 2004 Kern Sibbald and John Walker\n" +"Copyright (C) 2004-2005 Kern Sibbald\n" "Written by Nicolas Boichat\n" msgstr "" -#: src/tray-monitor/tray-monitor.c:505 -msgid "Version" -msgstr "" - -#: src/tray-monitor/tray-monitor.c:509 -#, c-format -msgid "" -"%s\n" -"\n" -"%s\n" -"%s %s (%s) %s %s %s" -msgstr "" - -#: src/tray-monitor/tray-monitor.c:515 +#: src/tray-monitor/tray-monitor.c:505 src/tray-monitor/tray-monitor.c:515 msgid "Version:" msgstr "" @@ -13391,7 +13521,7 @@ msgstr "" msgid "<< Error: BNET_PROMPT signal received. >>\n" msgstr "" -#: src/tray-monitor/tray-monitor.c:953 src/wx-console/console_thread.cpp:445 +#: src/tray-monitor/tray-monitor.c:953 src/wx-console/console_thread.cpp:465 msgid "<< Heartbeat signal received, answered. >>\n" msgstr "" @@ -13436,94 +13566,271 @@ msgstr "" msgid "Storage: name=%s address=%s SDport=%d\n" msgstr "" -#: src/wx-console/authenticate.c:126 +#: src/wx-console/authenticate.c:129 msgid "Bad response to Hello command: ERR=" msgstr "" -#: src/baconfig.h:52 +#: src/baconfig.h:55 #, c-format msgid "Failed ASSERT: %s\n" msgstr "" -#: src/baconfig.h:59 +#: src/baconfig.h:62 msgid "*None*" msgstr "" -#: src/wx-console/console_thread.cpp:103 +#: src/filed/win32/winmain.cpp:228 src/filed/win32/winmain.cpp:236 +msgid "Bacula Usage" +msgstr "" + +#: src/filed/win32/winmain.cpp:233 +msgid "Bad Command Line Options" +msgstr "" + +#: src/filed/win32/winmain.cpp:326 +msgid "Another instance of Bacula is already running" +msgstr "" + +#: src/filed/win32/winservice.cpp:131 src/filed/win32/winservice.cpp:145 +msgid "No existing instance of Bacula could be contacted" +msgstr "" + +#: src/filed/win32/winservice.cpp:218 +msgid "KERNEL32.DLL not found: Bacula service not started" +msgstr "" + +#: src/filed/win32/winservice.cpp:228 +msgid "Registry service not found: Bacula service not started" +msgstr "" + +#: src/filed/win32/winservice.cpp:230 +msgid "Registry service not found" +msgstr "" + +#: src/filed/win32/winservice.cpp:260 +msgid "StartServiceCtrlDispatcher failed." +msgstr "" + +#: src/filed/win32/winservice.cpp:278 +msgid "RegisterServiceCtlHandler failed" +msgstr "" + +#: src/filed/win32/winservice.cpp:279 +msgid "Contact Register Service Handler failure" +msgstr "" + +#: src/filed/win32/winservice.cpp:295 +msgid "ReportStatus STOPPED failed 1" +msgstr "" + +#: src/filed/win32/winservice.cpp:318 +msgid "Report Service failure" +msgstr "" + +#: src/filed/win32/winservice.cpp:355 +msgid "Unable to install Bacula service" +msgstr "" + +#: src/filed/win32/winservice.cpp:373 +msgid "Service command length too long" +msgstr "" + +#: src/filed/win32/winservice.cpp:374 +msgid "Service command length too long. Service not registered." +msgstr "" + +#: src/filed/win32/winservice.cpp:389 +msgid "Cannot write System Registry" +msgstr "" + +#: src/filed/win32/winservice.cpp:390 +msgid "" +"The System Registry could not be updated - the Bacula service was not " +"installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:397 +msgid "Cannot add Bacula key to System Registry" +msgstr "" + +#: src/filed/win32/winservice.cpp:398 src/filed/win32/winservice.cpp:449 +msgid "The Bacula service could not be installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:406 +msgid "" +"The Bacula File service was successfully installed.\n" +"The service may be started by double clicking on the\n" +"Bacula \"Start\" icon and will be automatically\n" +"be run the next time this machine is rebooted. " +msgstr "" + +#: src/filed/win32/winservice.cpp:424 +msgid "" +"The Service Control Manager could not be contacted - the Bacula service was " +"not installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:455 +msgid "" +"Provides file backup and restore services. Bacula -- the network backup " +"solution." +msgstr "" + +#: src/filed/win32/winservice.cpp:462 +msgid "" +"The Bacula File service was successfully installed.\n" +"The service may be started from the Control Panel and will\n" +"automatically be run the next time this machine is rebooted." +msgstr "" + +#: src/filed/win32/winservice.cpp:471 +msgid "" +"Unknown Windows operating system.\n" +"Cannot install Bacula service.\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:496 +msgid "" +"Could not find registry entry.\n" +"Service probably not registerd - the Bacula service was not removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:501 +msgid "" +"Could not delete Registry key.\n" +"The Bacula service could not be removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:511 +msgid "Bacula could not be contacted, probably not running" +msgstr "" + +#: src/filed/win32/winservice.cpp:517 src/filed/win32/winservice.cpp:553 +msgid "The Bacula service has been removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:547 +msgid "The Bacula service could not be stopped" +msgstr "" + +#: src/filed/win32/winservice.cpp:555 +msgid "The Bacula service could not be removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:560 +msgid "The Bacula service could not be found" +msgstr "" + +#: src/filed/win32/winservice.cpp:565 +msgid "The SCM could not be contacted - the Bacula service was not removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:629 +msgid "SetServiceStatus failed" +msgstr "" + +#: src/filed/win32/winservice.cpp:657 +#, c-format +msgid "" +"\n" +"\n" +"%s error: %ld at %s:%d" +msgstr "" + +#: src/filed/win32/winservice.cpp:732 +#, c-format +msgid "Locked by: %s, duration: %ld seconds\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:736 +#, c-format +msgid "No longer locked\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:740 +msgid "Could not lock database" +msgstr "" + +#: src/wx-console/console_thread.cpp:101 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " "Director \"%s\" in config file.\n" -" At least one CA certificate store is required.\n" +"At least one CA certificate store is required.\n" msgstr "" -#: src/wx-console/console_thread.cpp:112 +#: src/wx-console/console_thread.cpp:108 msgid "" "No Director resource defined in config file.\n" "Without that I don't how to speak to the Director :-(\n" msgstr "" -#: src/wx-console/console_thread.cpp:132 +#: src/wx-console/console_thread.cpp:127 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " "Console \"%s\" in config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:154 +#: src/wx-console/console_thread.cpp:148 msgid "Error while initializing windows sockets...\n" msgstr "" -#: src/wx-console/console_thread.cpp:169 +#: src/wx-console/console_thread.cpp:163 msgid "Error while cleaning up windows sockets...\n" msgstr "" -#: src/wx-console/console_thread.cpp:207 +#: src/wx-console/console_thread.cpp:201 msgid "Error while initializing library." msgstr "" -#: src/wx-console/console_thread.cpp:237 +#: src/wx-console/console_thread.cpp:227 +msgid "Cryptographic library initialization failed.\n" +msgstr "" + +#: src/wx-console/console_thread.cpp:231 msgid "Please correct configuration file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:270 +#: src/wx-console/console_thread.cpp:273 msgid "Error : Library not initialized\n" msgstr "" -#: src/wx-console/console_thread.cpp:281 +#: src/wx-console/console_thread.cpp:284 msgid "Error : No configuration file loaded\n" msgstr "" -#: src/wx-console/console_thread.cpp:291 +#: src/wx-console/console_thread.cpp:294 msgid "Connecting...\n" msgstr "" -#: src/wx-console/console_thread.cpp:307 +#: src/wx-console/console_thread.cpp:310 msgid "Error : No director defined in config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:319 +#: src/wx-console/console_thread.cpp:322 msgid "Multiple directors found in your config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:328 +#: src/wx-console/console_thread.cpp:331 #, c-format msgid "Please choose a director (1-%d): " msgstr "" -#: src/wx-console/console_thread.cpp:400 +#: src/wx-console/console_thread.cpp:403 msgid "Failed to connect to the director\n" msgstr "" -#: src/wx-console/console_thread.cpp:410 +#: src/wx-console/console_thread.cpp:413 msgid "Connected\n" msgstr "" -#: src/wx-console/console_thread.cpp:448 +#: src/wx-console/console_thread.cpp:470 msgid "<< Unexpected signal received : " msgstr "" -#: src/wx-console/console_thread.cpp:466 +#: src/wx-console/console_thread.cpp:490 msgid "Connection terminated\n" msgstr "" @@ -13536,28 +13843,28 @@ msgstr "" msgid "Welcome to bacula wx-console %s (%s)!\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:41 +#: src/wx-console/wxbconfigfileeditor.cpp:44 msgid "Config file editor" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:57 -msgid "Save and close" +#: src/wx-console/wxbconfigfileeditor.cpp:54 +msgid "# Bacula wx-console Configuration File\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:58 -msgid "Close without saving" +#: src/wx-console/wxbconfigfileeditor.cpp:90 +msgid "Save and close" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:69 -msgid "# Bacula wx-console Configuration File\n" +#: src/wx-console/wxbconfigfileeditor.cpp:91 +msgid "Close without saving" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:100 +#: src/wx-console/wxbconfigfileeditor.cpp:118 #, c-format msgid "Unable to write to %s\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:101 +#: src/wx-console/wxbconfigfileeditor.cpp:119 msgid "Error while saving" msgstr "" @@ -13579,567 +13886,579 @@ msgstr "" msgid "Possible completions: " msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:258 -#: src/wx-console/wxbrestorepanel.cpp:1861 -#: src/wx-console/wxbrestorepanel.cpp:1890 -msgid "Enter restore mode" +#: src/wx-console/wxbmainframe.cpp:227 +msgid "&About...\tF1" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:261 -msgid "Cancel restore" +#: src/wx-console/wxbmainframe.cpp:227 +msgid "Show about dialog" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:287 -#: src/wx-console/wxbrestorepanel.cpp:341 -msgid "Add" +#: src/wx-console/wxbmainframe.cpp:229 src/wx-console/wxbmainframe.cpp:598 +msgid "Connect to the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:289 -#: src/wx-console/wxbrestorepanel.cpp:343 -msgid "Remove" +#: src/wx-console/wxbmainframe.cpp:230 +msgid "Disconnect" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:291 -#: src/wx-console/wxbrestorepanel.cpp:345 -msgid "Refresh" +#: src/wx-console/wxbmainframe.cpp:230 +msgid "Disconnect of the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:310 -msgid "M" +#: src/wx-console/wxbmainframe.cpp:232 +msgid "Change of configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:326 -msgid "Perm." +#: src/wx-console/wxbmainframe.cpp:232 +msgid "Change your default configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:359 -#: src/wx-console/wxbrestorepanel.cpp:372 -#: src/wx-console/wxbrestorepanel.cpp:524 -#: src/wx-console/wxbrestorepanel.cpp:534 -#: src/wx-console/wxbrestorepanel.cpp:537 -#: src/wx-console/wxbrestorepanel.cpp:1732 -#: src/wx-console/wxbrestorepanel.cpp:1812 -msgid "Job Name" +#: src/wx-console/wxbmainframe.cpp:233 +msgid "Edit your configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:361 -#: src/wx-console/wxbrestorepanel.cpp:377 -#: src/wx-console/wxbrestorepanel.cpp:476 -#: src/wx-console/wxbrestorepanel.cpp:477 -#: src/wx-console/wxbrestorepanel.cpp:487 -#: src/wx-console/wxbrestorepanel.cpp:488 -#: src/wx-console/wxbrestorepanel.cpp:1101 -#: src/wx-console/wxbrestorepanel.cpp:1768 -#: src/wx-console/wxbrestorepanel.cpp:1827 -msgid "Fileset" +#: src/wx-console/wxbmainframe.cpp:235 +msgid "E&xit\tAlt-X" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:364 -#: src/wx-console/wxbrestorepanel.cpp:1168 -#: src/wx-console/wxbrestorepanel.cpp:1183 -#: src/wx-console/wxbrestorepanel.cpp:1185 -#: src/wx-console/wxbrestorepanel.cpp:1193 -#: src/wx-console/wxbrestorepanel.cpp:1195 -#: src/wx-console/wxbrestorepanel.cpp:1212 -#: src/wx-console/wxbrestorepanel.cpp:1219 -#: src/wx-console/wxbrestorepanel.cpp:1759 -#: src/wx-console/wxbrestorepanel.cpp:1885 -msgid "Before" +#: src/wx-console/wxbmainframe.cpp:235 +msgid "Quit this program" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:366 -msgid "Please configure parameters concerning files to restore :" +#: src/wx-console/wxbmainframe.cpp:239 +msgid "&File" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -#: src/wx-console/wxbrestorepanel.cpp:1820 -msgid "always" +#: src/wx-console/wxbmainframe.cpp:240 +msgid "&Help" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -msgid "if newer" +#: src/wx-console/wxbmainframe.cpp:257 +msgid "Console" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -msgid "if older" +#: src/wx-console/wxbmainframe.cpp:264 +msgid "" +"Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -#: src/wx-console/wxbrestorepanel.cpp:1823 -msgid "never" +#: src/wx-console/wxbmainframe.cpp:268 +msgid "" +"Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode " +"support when handling non-ASCII filenames: Every non-ASCII character in such " +"filenames will be replaced by an interrogation mark.\n" +"If this behaviour disturbs you, please build wx-console against a Unicode " +"version of wxWidgets for GTK+ 2.0.\n" +"---\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:383 -msgid "Please configure parameters concerning files restoration :" +#: src/wx-console/wxbmainframe.cpp:279 +msgid "Send" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:448 -msgid "Getting parameters list." +#: src/wx-console/wxbmainframe.cpp:356 src/wx-console/wxbmainframe.cpp:368 +msgid "Error while parsing command line arguments, using defaults.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:456 -msgid "Error : no clients returned by the director." +#: src/wx-console/wxbmainframe.cpp:357 src/wx-console/wxbmainframe.cpp:369 +msgid "Usage: wx-console [-c configfile] [-w tmp]\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:480 -msgid "Error : no filesets returned by the director." +#: src/wx-console/wxbmainframe.cpp:397 +#, c-format +msgid "" +"It seems that it is the first time you run wx-console.\n" +"This file (%s) has been choosen as default configuration file.\n" +"Do you want to edit it? (if you click No you will have to select another " +"file)" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:504 -msgid "Error : no storage returned by the director." +#: src/wx-console/wxbmainframe.cpp:399 +msgid "First run" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:527 -#: src/wx-console/wxbrestorepanel.cpp:551 -msgid "Error : no jobs returned by the director." +#: src/wx-console/wxbmainframe.cpp:416 +#, c-format +msgid "" +"Unable to read %s\n" +"Error: %s\n" +"Do you want to choose another one? (Press no to edit this file)" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:537 -msgid "RestoreFiles" +#: src/wx-console/wxbmainframe.cpp:418 +msgid "Unable to read configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:572 -msgid "Please configure your restore parameters." +#: src/wx-console/wxbmainframe.cpp:430 +msgid "Please choose a configuration file to use" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:583 -msgid "Building restore tree..." +#: src/wx-console/wxbmainframe.cpp:443 +msgid "This configuration file has been successfully read, use it as default?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:622 -msgid "Error while starting restore: " +#: src/wx-console/wxbmainframe.cpp:444 +msgid "Configuration file read successfully" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:712 -msgid "" -"Right click on a file or on a directory, or double-click on its mark to add " -"it to the restore list." +#: src/wx-console/wxbmainframe.cpp:454 +#, c-format +msgid "Using this configuration file: %s\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:729 -msgid " files selected to be restored." +#: src/wx-console/wxbmainframe.cpp:459 +msgid "Connecting to the director..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:734 -msgid " file selected to be restored." +#: src/wx-console/wxbmainframe.cpp:474 +msgid "Failed to unregister a data parser !" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:741 -#, c-format -msgid "Please configure your restore (%ld files selected to be restored)..." +#: src/wx-console/wxbmainframe.cpp:482 +msgid "Quitting.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:751 -msgid "Restore failed : no file selected.\n" +#: src/wx-console/wxbmainframe.cpp:497 +msgid "" +"Welcome to Bacula wx-console.\n" +"Written by Nicolas Boichat \n" +"(C) 2005 Kern Sibbald\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:752 -msgid "Restore failed : no file selected." +#: src/wx-console/wxbmainframe.cpp:499 +msgid "About Bacula wx-console" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:762 -msgid "Restoring, please wait..." +#: src/wx-console/wxbmainframe.cpp:505 +msgid "Please choose your default configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:775 -msgid "Job started. JobId=" +#: src/wx-console/wxbmainframe.cpp:509 +msgid "Use this configuration file as default?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:777 -msgid "Restore started, jobid=" +#: src/wx-console/wxbmainframe.cpp:510 +msgid "Configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:781 -msgid "Job failed." +#: src/wx-console/wxbmainframe.cpp:581 +msgid "Console thread terminated." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:782 -msgid "Restore failed, please look at messages.\n" +#: src/wx-console/wxbmainframe.cpp:589 +msgid "Connection to the director lost. Quit program?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:783 -msgid "Restore failed, please look at messages in console." +#: src/wx-console/wxbmainframe.cpp:590 +msgid "Connection lost" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:789 -#: src/wx-console/wxbrestorepanel.cpp:790 -msgid "Failed to retrieve jobid.\n" +#: src/wx-console/wxbmainframe.cpp:606 +msgid "Connected to the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:816 -msgid "" -"Restore is scheduled in more than two minutes, wx-console will not wait for " -"its completion.\n" +#: src/wx-console/wxbmainframe.cpp:629 +msgid "Reconnect" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:817 -msgid "" -"Restore is scheduled in more than two minutes, wx-console will not wait for " -"its completion." +#: src/wx-console/wxbmainframe.cpp:630 +msgid "Reconnect to the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:841 -msgid "Restore job created, but not yet running." +#: src/wx-console/wxbmainframe.cpp:644 +msgid "Disconnected of the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:846 -#, c-format -msgid "Restore job running, please wait (%ld of %ld files restored)..." +#: src/wx-console/wxbmainframe.cpp:663 src/wx-console/wxbrestorepanel.cpp:689 +msgid "Unexpected question has been received.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:850 -msgid "Restore job terminated successfully." +#: src/wx-console/wxbmainframe.cpp:686 src/wx-console/wxbmainframe.cpp:703 +msgid "wx-console: unexpected director's question." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:851 -msgid "Restore job terminated successfully.\n" +#: src/wx-console/wxbrestorepanel.cpp:216 +#: src/wx-console/wxbrestorepanel.cpp:1895 +#: src/wx-console/wxbrestorepanel.cpp:1924 +msgid "Enter restore mode" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:856 -msgid "Restore job terminated in error, see messages in console." +#: src/wx-console/wxbrestorepanel.cpp:219 +msgid "Cancel restore" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:857 -msgid "Restore job terminated in error, see messages.\n" +#: src/wx-console/wxbrestorepanel.cpp:245 +#: src/wx-console/wxbrestorepanel.cpp:299 +msgid "Add" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:862 -msgid "Restore job reported a non-fatal error." +#: src/wx-console/wxbrestorepanel.cpp:247 +#: src/wx-console/wxbrestorepanel.cpp:301 +msgid "Remove" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:866 -msgid "Restore job reported a fatal error." +#: src/wx-console/wxbrestorepanel.cpp:249 +#: src/wx-console/wxbrestorepanel.cpp:303 +msgid "Refresh" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:871 -msgid "Restore job cancelled by user." +#: src/wx-console/wxbrestorepanel.cpp:268 +msgid "M" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:872 -msgid "Restore job cancelled by user.\n" +#: src/wx-console/wxbrestorepanel.cpp:272 +msgid "Filename" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:877 -msgid "Restore job is waiting on File daemon." +#: src/wx-console/wxbrestorepanel.cpp:284 +msgid "Perm." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:881 -msgid "Restore job is waiting for new media." +#: src/wx-console/wxbrestorepanel.cpp:317 +#: src/wx-console/wxbrestorepanel.cpp:330 +#: src/wx-console/wxbrestorepanel.cpp:482 +#: src/wx-console/wxbrestorepanel.cpp:492 +#: src/wx-console/wxbrestorepanel.cpp:495 +#: src/wx-console/wxbrestorepanel.cpp:1760 +#: src/wx-console/wxbrestorepanel.cpp:1846 +msgid "Job Name" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:885 -msgid "Restore job is waiting for storage resource." +#: src/wx-console/wxbrestorepanel.cpp:319 +#: src/wx-console/wxbrestorepanel.cpp:335 +#: src/wx-console/wxbrestorepanel.cpp:434 +#: src/wx-console/wxbrestorepanel.cpp:435 +#: src/wx-console/wxbrestorepanel.cpp:445 +#: src/wx-console/wxbrestorepanel.cpp:446 +#: src/wx-console/wxbrestorepanel.cpp:1118 +#: src/wx-console/wxbrestorepanel.cpp:1191 +#: src/wx-console/wxbrestorepanel.cpp:1798 +#: src/wx-console/wxbrestorepanel.cpp:1800 +#: src/wx-console/wxbrestorepanel.cpp:1861 +msgid "Fileset" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:889 -msgid "Restore job is waiting for job resource." +#: src/wx-console/wxbrestorepanel.cpp:322 +#: src/wx-console/wxbrestorepanel.cpp:1185 +#: src/wx-console/wxbrestorepanel.cpp:1201 +#: src/wx-console/wxbrestorepanel.cpp:1203 +#: src/wx-console/wxbrestorepanel.cpp:1211 +#: src/wx-console/wxbrestorepanel.cpp:1213 +#: src/wx-console/wxbrestorepanel.cpp:1232 +#: src/wx-console/wxbrestorepanel.cpp:1239 +#: src/wx-console/wxbrestorepanel.cpp:1788 +#: src/wx-console/wxbrestorepanel.cpp:1799 +#: src/wx-console/wxbrestorepanel.cpp:1919 +msgid "Before" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:893 -msgid "Restore job is waiting for Client resource." +#: src/wx-console/wxbrestorepanel.cpp:324 +msgid "Please configure parameters concerning files to restore :" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:897 -msgid "Restore job is waiting for maximum jobs." +#: src/wx-console/wxbrestorepanel.cpp:333 +#: src/wx-console/wxbrestorepanel.cpp:1854 +msgid "always" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:901 -msgid "Restore job is waiting for start time." +#: src/wx-console/wxbrestorepanel.cpp:333 +msgid "if newer" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:905 -msgid "Restore job is waiting for higher priority jobs to finish." +#: src/wx-console/wxbrestorepanel.cpp:333 +msgid "if older" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:954 -msgid "" -"The restore job has not been started within one minute, wx-console will not " -"wait for its completion anymore.\n" +#: src/wx-console/wxbrestorepanel.cpp:333 +#: src/wx-console/wxbrestorepanel.cpp:1857 +msgid "never" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:955 -msgid "" -"The restore job has not been started within one minute, wx-console will not " -"wait for its completion anymore." +#: src/wx-console/wxbrestorepanel.cpp:341 +msgid "Please configure parameters concerning files restoration :" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:965 -msgid "Restore done successfully.\n" +#: src/wx-console/wxbrestorepanel.cpp:406 +msgid "Getting parameters list." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:966 -msgid "Restore done successfully." +#: src/wx-console/wxbrestorepanel.cpp:414 +msgid "Error : no clients returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1037 -msgid "Applying restore configuration changes..." +#: src/wx-console/wxbrestorepanel.cpp:438 +msgid "Error : no filesets returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1088 -msgid "Failed to find the selected client." +#: src/wx-console/wxbrestorepanel.cpp:462 +msgid "Error : no storage returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1103 -msgid "Failed to find the selected fileset." +#: src/wx-console/wxbrestorepanel.cpp:485 +#: src/wx-console/wxbrestorepanel.cpp:509 +msgid "Error : no jobs returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1118 -msgid "Failed to find the selected storage." +#: src/wx-console/wxbrestorepanel.cpp:495 +msgid "RestoreFiles" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1135 -#: src/wx-console/wxbrestorepanel.cpp:1801 -msgid "Run Restore job" +#: src/wx-console/wxbrestorepanel.cpp:530 +msgid "Please configure your restore parameters." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1151 -msgid "Restore configuration changes were applied." +#: src/wx-console/wxbrestorepanel.cpp:541 +msgid "Building restore tree..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1160 -msgid "Restore cancelled.\n" +#: src/wx-console/wxbrestorepanel.cpp:584 +msgid "Error while starting restore: " msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1161 -msgid "Restore cancelled." +#: src/wx-console/wxbrestorepanel.cpp:674 +msgid "" +"Right click on a file or on a directory, or double-click on its mark to add " +"it to the restore list." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1182 -msgid "No results to list." +#: src/wx-console/wxbrestorepanel.cpp:711 +#: src/wx-console/wxbrestorepanel.cpp:733 +msgid "wx-console: unexpected restore question." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1184 -msgid "No backup found for this client." +#: src/wx-console/wxbrestorepanel.cpp:744 +msgid " files selected to be restored." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1191 -msgid "ERROR" +#: src/wx-console/wxbrestorepanel.cpp:749 +msgid " file selected to be restored." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1192 -msgid "Query failed" +#: src/wx-console/wxbrestorepanel.cpp:756 +#, c-format +msgid "Please configure your restore (%ld files selected to be restored)..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1194 -msgid "Cannot get previous backups list, see console." +#: src/wx-console/wxbrestorepanel.cpp:766 +msgid "Restore failed : no file selected.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1811 -msgid "JobName:" +#: src/wx-console/wxbrestorepanel.cpp:767 +msgid "Restore failed : no file selected." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1815 -msgid "Where:" +#: src/wx-console/wxbrestorepanel.cpp:777 +msgid "Restoring, please wait..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1818 -msgid "Replace:" +#: src/wx-console/wxbrestorepanel.cpp:790 +msgid "Job started. JobId=" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1821 -msgid "ifnewer" +#: src/wx-console/wxbrestorepanel.cpp:792 +msgid "Restore started, jobid=" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1822 -msgid "ifolder" +#: src/wx-console/wxbrestorepanel.cpp:796 +msgid "Job failed." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1826 -msgid "FileSet:" +#: src/wx-console/wxbrestorepanel.cpp:797 +msgid "Restore failed, please look at messages.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1942 -msgid "Restoring..." +#: src/wx-console/wxbrestorepanel.cpp:798 +msgid "Restore failed, please look at messages in console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:227 -msgid "&About...\tF1" +#: src/wx-console/wxbrestorepanel.cpp:804 +#: src/wx-console/wxbrestorepanel.cpp:805 +msgid "Failed to retrieve jobid.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:227 -msgid "Show about dialog" +#: src/wx-console/wxbrestorepanel.cpp:831 +msgid "" +"Restore is scheduled in more than two minutes, wx-console will not wait for " +"its completion.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:229 src/wx-console/wxbmainframe.cpp:591 -msgid "Connect to the director" +#: src/wx-console/wxbrestorepanel.cpp:832 +msgid "" +"Restore is scheduled in more than two minutes, wx-console will not wait for " +"its completion." msgstr "" -#: src/wx-console/wxbmainframe.cpp:230 -msgid "Disconnect" +#: src/wx-console/wxbrestorepanel.cpp:858 +msgid "Restore job created, but not yet running." msgstr "" -#: src/wx-console/wxbmainframe.cpp:230 -msgid "Disconnect of the director" +#: src/wx-console/wxbrestorepanel.cpp:863 +#, c-format +msgid "Restore job running, please wait (%ld of %ld files restored)..." msgstr "" -#: src/wx-console/wxbmainframe.cpp:232 -msgid "Change of configuration file" +#: src/wx-console/wxbrestorepanel.cpp:867 +msgid "Restore job terminated successfully." msgstr "" -#: src/wx-console/wxbmainframe.cpp:232 -msgid "Change your default configuration file" +#: src/wx-console/wxbrestorepanel.cpp:868 +msgid "Restore job terminated successfully.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:233 -msgid "Edit your configuration file" +#: src/wx-console/wxbrestorepanel.cpp:873 +msgid "Restore job terminated in error, see messages in console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:235 -msgid "E&xit\tAlt-X" +#: src/wx-console/wxbrestorepanel.cpp:874 +msgid "Restore job terminated in error, see messages.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:235 -msgid "Quit this program" +#: src/wx-console/wxbrestorepanel.cpp:879 +msgid "Restore job reported a non-fatal error." msgstr "" -#: src/wx-console/wxbmainframe.cpp:239 -msgid "&File" +#: src/wx-console/wxbrestorepanel.cpp:883 +msgid "Restore job reported a fatal error." msgstr "" -#: src/wx-console/wxbmainframe.cpp:240 -msgid "&Help" +#: src/wx-console/wxbrestorepanel.cpp:888 +msgid "Restore job cancelled by user." msgstr "" -#: src/wx-console/wxbmainframe.cpp:257 -msgid "Console" +#: src/wx-console/wxbrestorepanel.cpp:889 +msgid "Restore job cancelled by user.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:264 -msgid "" -"Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n" +#: src/wx-console/wxbrestorepanel.cpp:894 +msgid "Restore job is waiting on File daemon." msgstr "" -#: src/wx-console/wxbmainframe.cpp:268 -msgid "" -"Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode " -"support when handling non-ASCII filenames: Every non-ASCII character in such " -"filenames will be replaced by an interrogation mark.\n" -"If this behaviour disturbs you, please build wx-console against a Unicode " -"version of wxWidgets for GTK+ 2.0.\n" -"---\n" +#: src/wx-console/wxbrestorepanel.cpp:898 +msgid "Restore job is waiting for new media." msgstr "" -#: src/wx-console/wxbmainframe.cpp:279 -msgid "Send" +#: src/wx-console/wxbrestorepanel.cpp:902 +msgid "Restore job is waiting for storage resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:356 src/wx-console/wxbmainframe.cpp:368 -msgid "Error while parsing command line arguments, using defaults.\n" +#: src/wx-console/wxbrestorepanel.cpp:906 +msgid "Restore job is waiting for job resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:357 src/wx-console/wxbmainframe.cpp:369 -msgid "Usage: wx-console [-c configfile] [-w tmp]\n" +#: src/wx-console/wxbrestorepanel.cpp:910 +msgid "Restore job is waiting for Client resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:397 -#, c-format -msgid "" -"It seems that it is the first time you run wx-console.\n" -"This file (%s) has been choosen as default configuration file.\n" -"Do you want to edit it? (if you click No you will have to select another " -"file)" +#: src/wx-console/wxbrestorepanel.cpp:914 +msgid "Restore job is waiting for maximum jobs." msgstr "" -#: src/wx-console/wxbmainframe.cpp:401 -msgid "First run" +#: src/wx-console/wxbrestorepanel.cpp:918 +msgid "Restore job is waiting for start time." msgstr "" -#: src/wx-console/wxbmainframe.cpp:418 -#, c-format +#: src/wx-console/wxbrestorepanel.cpp:922 +msgid "Restore job is waiting for higher priority jobs to finish." +msgstr "" + +#: src/wx-console/wxbrestorepanel.cpp:971 msgid "" -"Unable to read %s\n" -"Error: %s\n" -"Do you want to choose another one? (Press no to edit this file)" +"The restore job has not been started within one minute, wx-console will not " +"wait for its completion anymore.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:422 -msgid "Unable to read configuration file" +#: src/wx-console/wxbrestorepanel.cpp:972 +msgid "" +"The restore job has not been started within one minute, wx-console will not " +"wait for its completion anymore." msgstr "" -#: src/wx-console/wxbmainframe.cpp:434 -msgid "Please choose a configuration file to use" +#: src/wx-console/wxbrestorepanel.cpp:982 +msgid "Restore done successfully.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:447 -msgid "This configuration file has been successfully read, use it as default?" +#: src/wx-console/wxbrestorepanel.cpp:983 +msgid "Restore done successfully." msgstr "" -#: src/wx-console/wxbmainframe.cpp:448 -msgid "Configuration file read successfully" +#: src/wx-console/wxbrestorepanel.cpp:1054 +msgid "Applying restore configuration changes..." msgstr "" -#: src/wx-console/wxbmainframe.cpp:458 -#, c-format -msgid "Using this configuration file: %s\n" +#: src/wx-console/wxbrestorepanel.cpp:1105 +msgid "Failed to find the selected client." msgstr "" -#: src/wx-console/wxbmainframe.cpp:463 -msgid "Connecting to the director..." +#: src/wx-console/wxbrestorepanel.cpp:1120 +msgid "Failed to find the selected fileset." msgstr "" -#: src/wx-console/wxbmainframe.cpp:478 -msgid "Failed to unregister a data parser !" +#: src/wx-console/wxbrestorepanel.cpp:1135 +msgid "Failed to find the selected storage." msgstr "" -#: src/wx-console/wxbmainframe.cpp:486 -msgid "Quitting.\n" +#: src/wx-console/wxbrestorepanel.cpp:1152 +#: src/wx-console/wxbrestorepanel.cpp:1835 +msgid "Run Restore job" msgstr "" -#: src/wx-console/wxbmainframe.cpp:501 -msgid "" -"Welcome to Bacula wx-console.\n" -"Written by Nicolas Boichat \n" -"(C) 2005 Kern Sibbald\n" +#: src/wx-console/wxbrestorepanel.cpp:1168 +msgid "Restore configuration changes were applied." msgstr "" -#: src/wx-console/wxbmainframe.cpp:503 -msgid "About Bacula wx-console" +#: src/wx-console/wxbrestorepanel.cpp:1177 +msgid "Restore cancelled.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:509 -msgid "Please choose your default configuration file" +#: src/wx-console/wxbrestorepanel.cpp:1178 +msgid "Restore cancelled." msgstr "" -#: src/wx-console/wxbmainframe.cpp:513 -msgid "Use this configuration file as default?" +#: src/wx-console/wxbrestorepanel.cpp:1200 +msgid "No results to list." msgstr "" -#: src/wx-console/wxbmainframe.cpp:514 -msgid "Configuration file" +#: src/wx-console/wxbrestorepanel.cpp:1202 +msgid "No backup found for this client." msgstr "" -#: src/wx-console/wxbmainframe.cpp:578 -msgid "Console thread terminated." +#: src/wx-console/wxbrestorepanel.cpp:1209 +msgid "ERROR" msgstr "" -#: src/wx-console/wxbmainframe.cpp:582 -msgid "Connection to the director lost. Quit program?" +#: src/wx-console/wxbrestorepanel.cpp:1210 +msgid "Query failed" msgstr "" -#: src/wx-console/wxbmainframe.cpp:583 -msgid "Connection lost" +#: src/wx-console/wxbrestorepanel.cpp:1212 +msgid "Cannot get previous backups list, see console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:599 -msgid "Connected to the director." +#: src/wx-console/wxbrestorepanel.cpp:1845 +msgid "JobName:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:613 -msgid "Reconnect" +#: src/wx-console/wxbrestorepanel.cpp:1849 +msgid "Where:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:614 -msgid "Reconnect to the director" +#: src/wx-console/wxbrestorepanel.cpp:1852 +msgid "Replace:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:624 -msgid "Disconnected of the director." +#: src/wx-console/wxbrestorepanel.cpp:1855 +msgid "ifnewer" msgstr "" -#: src/wx-console/wxbmainframe.cpp:643 -msgid "Unexpected question has been received.\n" +#: src/wx-console/wxbrestorepanel.cpp:1856 +msgid "ifolder" msgstr "" -#: src/wx-console/wxbmainframe.cpp:666 src/wx-console/wxbmainframe.cpp:681 -msgid "wx-console: unexpected director's question." +#: src/wx-console/wxbrestorepanel.cpp:1860 +msgid "FileSet:" +msgstr "" + +#: src/wx-console/wxbrestorepanel.cpp:1976 +msgid "Restoring..." msgstr "" diff --git a/bacula/po/de.gmo b/bacula/po/de.gmo index 62ef033656..2b0c096353 100644 Binary files a/bacula/po/de.gmo and b/bacula/po/de.gmo differ diff --git a/bacula/po/de.po b/bacula/po/de.po index 0485e5a5d3..0651566e5e 100644 --- a/bacula/po/de.po +++ b/bacula/po/de.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Bacula 1.38\n" "Report-Msgid-Bugs-To: bacula-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2005-08-19 11:20+0200\n" +"POT-Creation-Date: 2006-02-26 13:10+0100\n" "PO-Revision-Date: 2005-08-11 14:05+0200\n" "Last-Translator: \n" @@ -17,35 +17,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/cats/bdb.c:135 +#: src/cats/bdb.c:128 msgid "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" msgstr "" -#: src/cats/bdb.c:136 +#: src/cats/bdb.c:129 msgid "WARNING!!!! The Internal Database is NOT OPERATIONAL!\n" msgstr "" -#: src/cats/bdb.c:137 +#: src/cats/bdb.c:130 msgid "You should use SQLite, PostgreSQL, or MySQL\n" msgstr "" -#: src/cats/bdb.c:159 src/cats/mysql.c:130 src/cats/postgresql.c:128 +#: src/cats/bdb.c:152 src/cats/mysql.c:124 src/cats/postgresql.c:128 #: src/cats/sqlite.c:122 #, c-format msgid "Unable to initialize DB lock. ERR=%s\n" msgstr "" -#: src/cats/bdb.c:169 +#: src/cats/bdb.c:162 #, c-format msgid "Unable to open Catalog DB control file %s: ERR=%s\n" msgstr "" -#: src/cats/bdb.c:224 +#: src/cats/bdb.c:217 #, c-format msgid "Error reading catalog DB control file. ERR=%s\n" msgstr "" -#: src/cats/bdb.c:227 +#: src/cats/bdb.c:220 #, c-format msgid "" "Error, catalog DB control file wrong version. Wanted %d, got %d\n" @@ -62,11 +62,11 @@ msgstr "" msgid "Error updating DB Media file. ERR=%s\n" msgstr "" -#: src/cats/mysql.c:66 +#: src/cats/mysql.c:60 msgid "A user name for MySQL must be supplied.\n" msgstr "" -#: src/cats/mysql.c:167 +#: src/cats/mysql.c:161 #, c-format msgid "" "Unable to connect to MySQL server. \n" @@ -74,7 +74,7 @@ msgid "" "It is probably not running or your password is incorrect.\n" msgstr "" -#: src/cats/mysql.c:326 src/cats/postgresql.c:264 src/cats/sqlite.c:323 +#: src/cats/mysql.c:320 src/cats/postgresql.c:264 src/cats/sqlite.c:323 #, c-format msgid "Query failed: %s: ERR=%s\n" msgstr "" @@ -134,15 +134,15 @@ msgid "" "%s\n" msgstr "" -#: src/cats/sql.c:209 src/cats/sql.c:216 src/cats/sql_create.c:772 -#: src/cats/sql_get.c:180 src/cats/sql_get.c:231 src/cats/sql_get.c:563 -#: src/cats/sql_get.c:638 src/cats/sql_get.c:865 +#: src/cats/sql.c:209 src/cats/sql.c:216 src/cats/sql_create.c:773 +#: src/cats/sql_get.c:180 src/cats/sql_get.c:231 src/cats/sql_get.c:564 +#: src/cats/sql_get.c:639 src/cats/sql_get.c:866 #, c-format msgid "error fetching row: %s\n" msgstr "" -#: src/cats/sql.c:326 src/dird/catreq.c:360 src/dird/catreq.c:392 -#: src/dird/catreq.c:417 +#: src/cats/sql.c:326 src/dird/catreq.c:369 src/dird/catreq.c:401 +#: src/dird/catreq.c:426 #, c-format msgid "Attribute create error. %s" msgstr "" @@ -161,215 +161,141 @@ msgstr "" msgid "Create DB Job record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:91 src/dird/dird_conf.c:532 src/dird/ua_cmds.c:422 -#: src/dird/ua_prune.c:454 src/dird/ua_run.c:643 src/dird/ua_select.c:228 -#: src/dird/ua_select.c:249 -msgid "Job" -msgstr "" - -#: src/cats/sql_create.c:131 +#: src/cats/sql_create.c:132 #, c-format msgid "Create JobMedia record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:140 +#: src/cats/sql_create.c:141 #, c-format msgid "Update Media record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:170 +#: src/cats/sql_create.c:171 #, c-format msgid "pool record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:196 +#: src/cats/sql_create.c:197 #, c-format msgid "Create db Pool record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:201 src/dird/ua_run.c:650 src/dird/ua_select.c:464 -#: src/dird/ua_select.c:554 src/dird/ua_update.c:356 src/dird/ua_update.c:426 -#: src/wx-console/wxbrestorepanel.cpp:362 -#: src/wx-console/wxbrestorepanel.cpp:548 -#: src/wx-console/wxbrestorepanel.cpp:558 -#: src/wx-console/wxbrestorepanel.cpp:1754 -msgid "Pool" -msgstr "" - -#: src/cats/sql_create.c:227 +#: src/cats/sql_create.c:228 #, c-format msgid "Device record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:243 +#: src/cats/sql_create.c:244 #, c-format msgid "Create db Device record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:248 -msgid "Device" -msgstr "" - -#: src/cats/sql_create.c:276 +#: src/cats/sql_create.c:277 #, c-format msgid "More than one Storage record!: %d\n" msgstr "" -#: src/cats/sql_create.c:281 +#: src/cats/sql_create.c:282 #, c-format msgid "error fetching Storage row: %s\n" msgstr "" -#: src/cats/sql_create.c:301 +#: src/cats/sql_create.c:302 #, c-format msgid "Create DB Storage record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:306 src/dird/ua_run.c:642 src/dird/ua_select.c:152 -#: src/wx-console/wxbrestorepanel.cpp:363 -#: src/wx-console/wxbrestorepanel.cpp:379 -#: src/wx-console/wxbrestorepanel.cpp:500 -#: src/wx-console/wxbrestorepanel.cpp:501 -#: src/wx-console/wxbrestorepanel.cpp:511 -#: src/wx-console/wxbrestorepanel.cpp:512 -#: src/wx-console/wxbrestorepanel.cpp:1116 -#: src/wx-console/wxbrestorepanel.cpp:1765 -#: src/wx-console/wxbrestorepanel.cpp:1831 -msgid "Storage" -msgstr "" - -#: src/cats/sql_create.c:333 +#: src/cats/sql_create.c:334 #, c-format msgid "mediatype record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:349 +#: src/cats/sql_create.c:350 #, c-format msgid "Create db mediatype record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:354 -msgid "MediaType" -msgstr "" - -#: src/cats/sql_create.c:383 +#: src/cats/sql_create.c:384 #, c-format msgid "Volume \"%s\" already exists.\n" msgstr "" -#: src/cats/sql_create.c:421 +#: src/cats/sql_create.c:422 #, c-format msgid "Create DB Media record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:425 -msgid "Media" -msgstr "" - -#: src/cats/sql_create.c:469 +#: src/cats/sql_create.c:470 #, c-format msgid "More than one Client!: %d\n" msgstr "" -#: src/cats/sql_create.c:474 +#: src/cats/sql_create.c:475 #, c-format msgid "error fetching Client row: %s\n" msgstr "" -#: src/cats/sql_create.c:501 +#: src/cats/sql_create.c:502 #, c-format msgid "Create DB Client record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:507 src/dird/ua_run.c:645 src/dird/ua_select.c:272 -#: src/dird/ua_select.c:379 src/wx-console/wxbrestorepanel.cpp:360 -#: src/wx-console/wxbrestorepanel.cpp:378 -#: src/wx-console/wxbrestorepanel.cpp:452 -#: src/wx-console/wxbrestorepanel.cpp:453 -#: src/wx-console/wxbrestorepanel.cpp:463 -#: src/wx-console/wxbrestorepanel.cpp:464 -#: src/wx-console/wxbrestorepanel.cpp:707 -#: src/wx-console/wxbrestorepanel.cpp:1086 -#: src/wx-console/wxbrestorepanel.cpp:1173 -#: src/wx-console/wxbrestorepanel.cpp:1758 -#: src/wx-console/wxbrestorepanel.cpp:1760 -#: src/wx-console/wxbrestorepanel.cpp:1829 -#: src/wx-console/wxbrestorepanel.cpp:1884 -msgid "Client" -msgstr "" - -#: src/cats/sql_create.c:544 +#: src/cats/sql_create.c:545 #, c-format msgid "Create DB Counters record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:577 +#: src/cats/sql_create.c:578 #, c-format msgid "More than one FileSet!: %d\n" msgstr "" -#: src/cats/sql_create.c:582 +#: src/cats/sql_create.c:583 #, c-format msgid "error fetching FileSet row: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:612 +#: src/cats/sql_create.c:613 #, c-format msgid "Create DB FileSet record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:618 src/dird/ua_restore.c:1035 src/dird/ua_run.c:644 -#: src/dird/ua_select.c:173 -msgid "FileSet" -msgstr "" - -#: src/cats/sql_create.c:669 +#: src/cats/sql_create.c:670 #, c-format msgid "Attempt to put non-attributes into catalog. Stream=%d\n" msgstr "" -#: src/cats/sql_create.c:732 +#: src/cats/sql_create.c:733 #, c-format msgid "Create db File record %s failed. ERR=%s" msgstr "" -#: src/cats/sql_create.c:738 src/gnome2-console/restore.c:121 -msgid "File" -msgstr "" - -#: src/cats/sql_create.c:765 src/cats/sql_get.c:224 +#: src/cats/sql_create.c:766 src/cats/sql_get.c:224 #, c-format msgid "More than one Path!: %s for path: %s\n" msgstr "" -#: src/cats/sql_create.c:796 +#: src/cats/sql_create.c:797 #, c-format msgid "Create db Path record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:802 -msgid "Path" -msgstr "" - -#: src/cats/sql_create.c:829 +#: src/cats/sql_create.c:830 #, c-format msgid "More than one Filename! %s for file: %s\n" msgstr "" -#: src/cats/sql_create.c:835 +#: src/cats/sql_create.c:836 #, c-format msgid "Error fetching row for file=%s: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:851 +#: src/cats/sql_create.c:852 #, c-format msgid "Create db Filename record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:856 src/wx-console/wxbrestorepanel.cpp:314 -msgid "Filename" -msgstr "" - #: src/cats/sql_delete.c:79 #, c-format msgid "No pool record %s exists\n" @@ -408,27 +334,27 @@ msgid "" "CMD=%s\n" msgstr "" -#: src/cats/sql_find.c:222 +#: src/cats/sql_find.c:224 #, c-format -msgid "Unknown Job level=%c\n" +msgid "Unknown Job level=%d\n" msgstr "" -#: src/cats/sql_find.c:232 +#: src/cats/sql_find.c:234 #, c-format msgid "No Job found for: %s.\n" msgstr "" -#: src/cats/sql_find.c:243 +#: src/cats/sql_find.c:245 #, c-format msgid "No Job found for: %s\n" msgstr "" -#: src/cats/sql_find.c:312 +#: src/cats/sql_find.c:317 #, c-format msgid "Request for Volume item %d greater than max %d\n" msgstr "" -#: src/cats/sql_find.c:324 +#: src/cats/sql_find.c:329 #, c-format msgid "No Volume record found for item %d.\n" msgstr "" @@ -492,104 +418,104 @@ msgstr "" msgid "No Job found for JobId %s\n" msgstr "" -#: src/cats/sql_get.c:343 src/cats/sql_get.c:398 +#: src/cats/sql_get.c:344 src/cats/sql_get.c:399 #, c-format msgid "No volumes found for JobId=%d\n" msgstr "" -#: src/cats/sql_get.c:349 src/cats/sql_get.c:407 +#: src/cats/sql_get.c:350 src/cats/sql_get.c:408 #, c-format msgid "Error fetching row %d: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:363 +#: src/cats/sql_get.c:364 #, c-format msgid "No Volume for JobId %d found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:479 +#: src/cats/sql_get.c:480 #, c-format msgid "Pool id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:516 +#: src/cats/sql_get.c:517 #, c-format msgid "Client id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:558 +#: src/cats/sql_get.c:559 #, c-format msgid "More than one Pool!: %s\n" msgstr "" -#: src/cats/sql_get.c:599 +#: src/cats/sql_get.c:600 msgid "Pool record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:633 +#: src/cats/sql_get.c:634 #, c-format msgid "More than one Client!: %s\n" msgstr "" -#: src/cats/sql_get.c:650 src/cats/sql_get.c:654 +#: src/cats/sql_get.c:651 src/cats/sql_get.c:655 msgid "Client record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:679 +#: src/cats/sql_get.c:680 #, c-format msgid "More than one Counter!: %d\n" msgstr "" -#: src/cats/sql_get.c:684 +#: src/cats/sql_get.c:685 #, c-format msgid "error fetching Counter row: %s\n" msgstr "" -#: src/cats/sql_get.c:704 +#: src/cats/sql_get.c:705 #, c-format msgid "Counter record: %s not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:740 +#: src/cats/sql_get.c:741 #, c-format msgid "Error got %s FileSets but expected only one!\n" msgstr "" -#: src/cats/sql_get.c:745 +#: src/cats/sql_get.c:746 #, c-format msgid "FileSet record \"%s\" not found.\n" msgstr "" -#: src/cats/sql_get.c:755 +#: src/cats/sql_get.c:756 msgid "FileSet record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:812 +#: src/cats/sql_get.c:813 #, c-format msgid "Media id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:860 +#: src/cats/sql_get.c:861 #, c-format msgid "More than one Volume!: %s\n" msgstr "" -#: src/cats/sql_get.c:905 +#: src/cats/sql_get.c:906 #, c-format msgid "Media record MediaId=%s not found.\n" msgstr "" -#: src/cats/sql_get.c:908 +#: src/cats/sql_get.c:909 #, c-format msgid "Media record for Volume \"%s\" not found.\n" msgstr "" -#: src/cats/sql_get.c:915 +#: src/cats/sql_get.c:916 #, c-format msgid "Media record for MediaId=%u not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:918 +#: src/cats/sql_get.c:919 #, c-format msgid "Media record for Vol=%s not found in Catalog.\n" msgstr "" @@ -609,7 +535,7 @@ msgstr "" msgid "Unable to open Database=%s. ERR=%s\n" msgstr "" -#: src/cats/sqlite.c:162 src/lib/bnet_server.c:372 +#: src/cats/sqlite.c:162 src/lib/bnet_server.c:371 msgid "unknown" msgstr "" @@ -628,38 +554,38 @@ msgstr "" msgid "next_index update error: ERR=%s\n" msgstr "" -#: src/console/authenticate.c:104 src/dird/authenticate.c:106 -#: src/dird/authenticate.c:206 src/filed/authenticate.c:124 -#: src/filed/authenticate.c:220 src/stored/authenticate.c:128 -#: src/stored/authenticate.c:232 src/wx-console/authenticate.c:101 +#: src/console/authenticate.c:100 src/dird/authenticate.c:106 +#: src/dird/authenticate.c:206 src/filed/authenticate.c:119 +#: src/filed/authenticate.c:215 src/stored/authenticate.c:128 +#: src/stored/authenticate.c:232 src/wx-console/authenticate.c:106 msgid "" "Authorization problem: Remote server did not advertise required TLS " "support.\n" msgstr "" -#: src/console/authenticate.c:111 src/dird/authenticate.c:113 -#: src/dird/authenticate.c:213 src/filed/authenticate.c:132 -#: src/filed/authenticate.c:228 src/stored/authenticate.c:136 -#: src/stored/authenticate.c:240 src/wx-console/authenticate.c:108 +#: src/console/authenticate.c:107 src/dird/authenticate.c:113 +#: src/dird/authenticate.c:213 src/filed/authenticate.c:127 +#: src/filed/authenticate.c:223 src/stored/authenticate.c:136 +#: src/stored/authenticate.c:240 src/wx-console/authenticate.c:112 msgid "Authorization problem: Remote server requires TLS.\n" msgstr "" -#: src/console/authenticate.c:121 src/wx-console/authenticate.c:118 +#: src/console/authenticate.c:117 src/wx-console/authenticate.c:121 msgid "TLS negotiation failed\n" msgstr "" -#: src/console/authenticate.c:133 src/gnome2-console/authenticate.c:85 +#: src/console/authenticate.c:129 src/gnome2-console/authenticate.c:85 #: src/tray-monitor/authenticate.c:87 #, c-format msgid "Bad response to Hello command: ERR=%s\n" msgstr "" -#: src/console/authenticate.c:140 src/gnome2-console/authenticate.c:95 -#: src/tray-monitor/authenticate.c:94 src/wx-console/authenticate.c:133 +#: src/console/authenticate.c:136 src/gnome2-console/authenticate.c:95 +#: src/tray-monitor/authenticate.c:94 src/wx-console/authenticate.c:136 msgid "Director rejected Hello command\n" msgstr "" -#: src/console/authenticate.c:150 src/wx-console/authenticate.c:143 +#: src/console/authenticate.c:146 src/wx-console/authenticate.c:146 msgid "" "Director authorization problem.\n" "Most likely the passwords do not agree.\n" @@ -704,7 +630,7 @@ msgstr "" msgid "output to file" msgstr "" -#: src/console/console.c:152 src/dird/ua_cmds.c:106 +#: src/console/console.c:152 src/dird/ua_cmds.c:110 msgid "quit" msgstr "" @@ -716,7 +642,7 @@ msgstr "" msgid "sleep specified time" msgstr "" -#: src/console/console.c:155 src/dird/ua_cmds.c:118 +#: src/console/console.c:155 src/dird/ua_cmds.c:122 msgid "print current time" msgstr "" @@ -724,7 +650,7 @@ msgstr "" msgid "print Console's version" msgstr "" -#: src/console/console.c:157 src/dird/ua_cmds.c:95 +#: src/console/console.c:157 src/dird/ua_cmds.c:99 msgid "exit = quit" msgstr "" @@ -732,13 +658,12 @@ msgstr "" msgid "zed_keys = use zed keys instead of bash keys" msgstr "" -#: src/console/console.c:191 src/dird/ua_dotcmds.c:106 +#: src/console/console.c:191 src/dird/ua_dotcmds.c:108 msgid ": is an illegal command\n" msgstr "" -#: src/console/console.c:400 src/dird/dird.c:196 src/filed/filed.c:183 -#: src/gnome2-console/console.c:271 src/stored/stored.c:189 -#: src/wx-console/console_thread.cpp:233 +#: src/console/console.c:400 src/filed/filed.c:183 +#: src/gnome2-console/console.c:271 msgid "TLS library initialization failed.\n" msgstr "" @@ -772,14 +697,14 @@ msgstr "" msgid "Connecting to Director %s:%d\n" msgstr "" -#: src/console/console.c:471 src/gnome2-console/console.c:508 -#: src/wx-console/console_thread.cpp:367 +#: src/console/console.c:471 src/gnome2-console/console.c:504 +#: src/wx-console/console_thread.cpp:370 #, c-format msgid "Failed to initialize TLS context for Console \"%s\".\n" msgstr "" -#: src/console/console.c:492 src/gnome2-console/console.c:530 -#: src/wx-console/console_thread.cpp:388 +#: src/console/console.c:492 src/gnome2-console/console.c:526 +#: src/wx-console/console_thread.cpp:391 #, c-format msgid "Failed to initialize TLS context for Director \"%s\".\n" msgstr "" @@ -792,8 +717,8 @@ msgstr "" #: src/dird/dird.c:711 src/dird/dird.c:777 src/dird/dird.c:829 #: src/filed/filed.c:302 src/filed/filed.c:348 #: src/gnome2-console/console.c:140 src/gnome2-console/console.c:169 -#: src/stored/stored.c:310 src/wx-console/console_thread.cpp:96 -#: src/wx-console/console_thread.cpp:125 +#: src/stored/stored.c:309 src/wx-console/console_thread.cpp:94 +#: src/wx-console/console_thread.cpp:120 msgid "TLS required but not configured in Bacula.\n" msgstr "" @@ -841,18 +766,18 @@ msgid "Cannot open file %s for output. ERR=%s\n" msgstr "" #: src/console/console_conf.c:123 src/gnome2-console/console_conf.c:122 -#: src/wx-console/console_conf.c:124 +#: src/wx-console/console_conf.c:128 #, c-format msgid "No record for %d %s\n" msgstr "" -#: src/console/console_conf.c:132 src/wx-console/console_conf.c:133 +#: src/console/console_conf.c:132 src/wx-console/console_conf.c:137 #, c-format msgid "Console: name=%s rcfile=%s histfile=%s\n" msgstr "" #: src/console/console_conf.c:136 src/gnome2-console/console_conf.c:131 -#: src/wx-console/console_conf.c:137 +#: src/wx-console/console_conf.c:141 #, c-format msgid "Director: name=%s address=%s DIRport=%d\n" msgstr "" @@ -862,25 +787,25 @@ msgstr "" #: src/filed/filed_conf.c:268 src/filed/filed_conf.c:327 #: src/filed/filed_conf.c:357 src/gnome2-console/console_conf.c:142 #: src/gnome2-console/console_conf.c:220 src/gnome2-console/console_conf.c:268 -#: src/gnome2-console/console_conf.c:298 src/stored/stored_conf.c:467 -#: src/stored/stored_conf.c:555 src/stored/stored_conf.c:590 -#: src/wx-console/console_conf.c:141 src/wx-console/console_conf.c:216 -#: src/wx-console/console_conf.c:261 src/wx-console/console_conf.c:288 +#: src/gnome2-console/console_conf.c:298 src/stored/stored_conf.c:510 +#: src/stored/stored_conf.c:598 src/stored/stored_conf.c:633 +#: src/wx-console/console_conf.c:145 src/wx-console/console_conf.c:220 +#: src/wx-console/console_conf.c:265 src/wx-console/console_conf.c:292 #, c-format msgid "Unknown resource type %d\n" msgstr "" -#: src/console/console_conf.c:242 src/dird/dird_conf.c:1109 -#: src/dird/dird_conf.c:1124 src/filed/filed_conf.c:296 +#: src/console/console_conf.c:242 src/dird/dird_conf.c:1112 +#: src/dird/dird_conf.c:1127 src/filed/filed_conf.c:296 #: src/gnome2-console/console_conf.c:246 src/tray-monitor/tray_conf.c:262 -#: src/wx-console/console_conf.c:242 +#: src/wx-console/console_conf.c:246 #, c-format msgid "%s item is required in %s resource, but not found.\n" msgstr "" -#: src/console/console_conf.c:304 src/dird/dird_conf.c:1296 +#: src/console/console_conf.c:304 src/dird/dird_conf.c:1299 #: src/filed/filed_conf.c:374 src/gnome2-console/console_conf.c:314 -#: src/tray-monitor/tray_conf.c:341 src/wx-console/console_conf.c:304 +#: src/tray-monitor/tray_conf.c:341 src/wx-console/console_conf.c:308 #, c-format msgid "Attempt to define second %s resource named \"%s\" is not permitted.\n" msgstr "" @@ -890,7 +815,7 @@ msgstr "" msgid "Start Admin JobId %d, Job=%s\n" msgstr "" -#: src/dird/admin.c:82 src/dird/backup.c:339 src/dird/mac.c:228 +#: src/dird/admin.c:82 src/dird/backup.c:343 src/dird/mac.c:287 #, c-format msgid "Error getting job record for stats: %s" msgstr "" @@ -907,8 +832,8 @@ msgstr "" msgid "Admin Canceled" msgstr "" -#: src/dird/admin.c:102 src/dird/backup.c:451 src/dird/mac.c:330 -#: src/dird/restore.c:258 +#: src/dird/admin.c:102 src/dird/backup.c:455 src/dird/mac.c:389 +#: src/dird/restore.c:246 #, c-format msgid "Inappropriate term code: %c\n" msgstr "" @@ -941,7 +866,7 @@ msgstr "" #: src/dird/authenticate.c:95 msgid "" -"Unable to authenticate with Storage daemon. Possible causes:\n" +"Director unable to authenticate with Storage daemon. Possible causes:\n" "Passwords or names not the same or\n" "Maximum Concurrent Jobs exceeded on the SD or\n" "SD networking messed up (restart daemon).\n" @@ -950,8 +875,8 @@ msgid "" msgstr "" #: src/dird/authenticate.c:123 src/dird/authenticate.c:223 -#: src/dird/authenticate.c:356 src/filed/authenticate.c:141 -#: src/filed/authenticate.c:237 src/stored/authenticate.c:145 +#: src/dird/authenticate.c:356 src/filed/authenticate.c:136 +#: src/filed/authenticate.c:232 src/stored/authenticate.c:145 #: src/stored/authenticate.c:249 msgid "TLS negotiation failed.\n" msgstr "" @@ -1040,84 +965,84 @@ msgid "" "\n" msgstr "" -#: src/dird/backup.c:88 src/dird/backup.c:94 src/dird/mac.c:92 -#: src/dird/ua_output.c:609 +#: src/dird/backup.c:88 src/dird/backup.c:94 src/dird/mac.c:124 +#: src/dird/ua_output.c:611 #, c-format msgid "Pool %s not in database. %s" msgstr "" -#: src/dird/backup.c:92 src/dird/mac.c:96 src/dird/ua_output.c:617 +#: src/dird/backup.c:92 src/dird/mac.c:128 src/dird/ua_output.c:619 #, c-format msgid "Pool %s created in database.\n" msgstr "" -#: src/dird/backup.c:117 +#: src/dird/backup.c:120 msgid "Could not start clone job.\n" msgstr "" -#: src/dird/backup.c:119 +#: src/dird/backup.c:122 #, c-format msgid "Clone JobId %d started.\n" msgstr "" -#: src/dird/backup.c:144 +#: src/dird/backup.c:148 #, c-format -msgid "Start Backup JobId %u, Job=%s\n" +msgid "Start Backup JobId %s, Job=%s\n" msgstr "" -#: src/dird/backup.c:272 +#: src/dird/backup.c:276 #, c-format msgid "Unexpected Client Job message: %s\n" msgstr "" -#: src/dird/backup.c:280 +#: src/dird/backup.c:284 #, c-format msgid "Network error with FD during %s: ERR=%s\n" msgstr "" -#: src/dird/backup.c:296 +#: src/dird/backup.c:300 msgid "No Job status returned from FD.\n" msgstr "" -#: src/dird/backup.c:346 +#: src/dird/backup.c:350 #, c-format msgid "Error getting client record for stats: %s" msgstr "" -#: src/dird/backup.c:352 src/dird/mac.c:235 +#: src/dird/backup.c:356 src/dird/mac.c:294 #, c-format msgid "Error getting Media record for Volume \"%s\": ERR=%s" msgstr "" -#: src/dird/backup.c:380 src/dird/mac.c:263 +#: src/dird/backup.c:384 src/dird/mac.c:322 #, c-format msgid "Could not get Job Volume Parameters to update Bootstrap file. ERR=%s\n" msgstr "" -#: src/dird/backup.c:414 src/dird/mac.c:293 +#: src/dird/backup.c:418 src/dird/mac.c:352 #, c-format msgid "" "Could not open WriteBootstrap file:\n" "%s: ERR=%s\n" msgstr "" -#: src/dird/backup.c:424 src/dird/mac.c:303 +#: src/dird/backup.c:428 src/dird/mac.c:362 msgid "Backup OK -- with warnings" msgstr "" -#: src/dird/backup.c:426 src/dird/mac.c:305 src/stored/bscan.c:1054 +#: src/dird/backup.c:430 src/dird/mac.c:364 src/stored/bscan.c:1060 msgid "Backup OK" msgstr "" -#: src/dird/backup.c:431 src/dird/mac.c:310 src/stored/bscan.c:1058 +#: src/dird/backup.c:435 src/dird/mac.c:369 src/stored/bscan.c:1064 msgid "*** Backup Error ***" msgstr "" -#: src/dird/backup.c:441 src/dird/mac.c:320 src/stored/bscan.c:1061 +#: src/dird/backup.c:445 src/dird/mac.c:379 src/stored/bscan.c:1067 msgid "Backup Canceled" msgstr "" -#: src/dird/backup.c:491 +#: src/dird/backup.c:495 #, c-format msgid "" "Bacula %s (%s): %s\n" @@ -1160,29 +1085,29 @@ msgstr "" msgid "Unable to get Job Volume Parameters. ERR=%s\n" msgstr "" -#: src/dird/bsr.c:201 +#: src/dird/bsr.c:203 #, c-format msgid "Unable to create bootstrap file %s. ERR=%s\n" msgstr "" -#: src/dird/bsr.c:210 +#: src/dird/bsr.c:212 msgid "Error writing bsr file.\n" msgstr "" -#: src/dird/bsr.c:216 +#: src/dird/bsr.c:218 #, c-format msgid "Bootstrap records written to %s\n" msgstr "" -#: src/dird/bsr.c:220 +#: src/dird/bsr.c:222 msgid "The job will require the following Volumes:\n" msgstr "" -#: src/dird/bsr.c:235 +#: src/dird/bsr.c:254 msgid "No Volumes found to restore.\n" msgstr "" -#: src/dird/catreq.c:109 src/dird/catreq.c:298 +#: src/dird/catreq.c:109 src/dird/catreq.c:297 #, c-format msgid "1990 Invalid Catalog Request: %s" msgstr "" @@ -1192,72 +1117,87 @@ msgstr "" msgid "Invalid Catalog request; DB not open: %s" msgstr "" -#: src/dird/catreq.c:131 +#: src/dird/catreq.c:135 msgid "1901 No Media.\n" msgstr "" -#: src/dird/catreq.c:159 +#: src/dird/catreq.c:163 msgid "not in Pool" msgstr "" -#: src/dird/catreq.c:161 +#: src/dird/catreq.c:165 msgid "not correct MediaType" msgstr "" -#: src/dird/catreq.c:187 +#: src/dird/catreq.c:181 #, c-format msgid "1998 Volume \"%s\" status is %s, %s.\n" msgstr "" -#: src/dird/catreq.c:192 +#: src/dird/catreq.c:186 #, c-format msgid "1997 Volume \"%s\" not in catalog.\n" msgstr "" -#: src/dird/catreq.c:213 +#: src/dird/catreq.c:207 #, c-format msgid "Unable to get Media record for Volume %s: ERR=%s\n" msgstr "" -#: src/dird/catreq.c:215 +#: src/dird/catreq.c:209 #, c-format msgid "1991 Catalog Request for vol=%s failed: %s" msgstr "" -#: src/dird/catreq.c:235 +#: src/dird/catreq.c:229 #, c-format msgid "" "Volume Files at %u being set to %u for Volume \"%s\". This is incorrect.\n" msgstr "" -#: src/dird/catreq.c:238 src/dird/catreq.c:270 -msgid "1992 Update Media error\n" +#: src/dird/catreq.c:232 +#, c-format +msgid "1992 Update Media error. VolFiles=%u, CatFiles=%u\n" msgstr "" -#: src/dird/catreq.c:268 +#: src/dird/catreq.c:264 #, c-format msgid "Catalog error updating Media record. %s" msgstr "" -#: src/dird/catreq.c:287 +#: src/dird/catreq.c:266 +msgid "1993 Update Media error\n" +msgstr "" + +#: src/dird/catreq.c:286 #, c-format msgid "Catalog error creating JobMedia record. %s" msgstr "" -#: src/dird/catreq.c:289 +#: src/dird/catreq.c:288 msgid "1991 Update JobMedia error\n" msgstr "" -#: src/dird/catreq.c:299 +#: src/dird/catreq.c:298 #, c-format msgid "Invalid Catalog request: %s" msgstr "" -#: src/dird/catreq.c:398 +#: src/dird/catreq.c:332 +#, c-format +msgid "1991 Invalid Catalog Update: %s" +msgstr "" + +#: src/dird/catreq.c:333 +#, c-format +msgid "Invalid Catalog Update; DB not open: %s" +msgstr "" + +#: src/dird/catreq.c:407 msgid "Got MD5/SHA1 but not same File as attributes\n" msgstr "" -#: src/dird/catreq.c:422 +#: src/dird/catreq.c:431 #, c-format msgid "Catalog error updating MD5/SHA1. %s" msgstr "" @@ -1283,6 +1223,10 @@ msgid "" "\n" msgstr "" +#: src/dird/dird.c:196 src/stored/stored.c:189 +msgid "Cryptography library initialization failed.\n" +msgstr "" + #: src/dird/dird.c:396 msgid "Too many open reload requests. Request ignored.\n" msgstr "" @@ -1312,17 +1256,17 @@ msgstr "" msgid "Only one Director resource permitted in %s\n" msgstr "" -#: src/dird/dird.c:502 src/filed/filed.c:357 src/stored/stored.c:362 +#: src/dird/dird.c:502 src/filed/filed.c:357 src/stored/stored.c:361 #, c-format msgid "\"TLS Certificate\" file not defined for Director \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:508 src/filed/filed.c:363 src/stored/stored.c:368 +#: src/dird/dird.c:508 src/filed/filed.c:363 src/stored/stored.c:367 #, c-format msgid "\"TLS Key\" file not defined for Director \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:514 src/filed/filed.c:369 src/stored/stored.c:374 +#: src/dird/dird.c:514 src/filed/filed.c:369 src/stored/stored.c:373 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " @@ -1330,7 +1274,7 @@ msgid "" "using \"TLS Verify Peer\".\n" msgstr "" -#: src/dird/dird.c:533 src/filed/filed.c:388 src/stored/stored.c:393 +#: src/dird/dird.c:533 src/filed/filed.c:388 src/stored/stored.c:392 #, c-format msgid "Failed to initialize TLS context for Director \"%s\" in %s.\n" msgstr "" @@ -1354,8 +1298,8 @@ msgstr "" msgid "Too many items in Job resource\n" msgstr "" -#: src/dird/dird.c:672 src/dird/job.c:101 src/dird/ua_cmds.c:1425 -#: src/dird/ua_output.c:598 +#: src/dird/dird.c:672 src/dird/job.c:101 src/dird/ua_cmds.c:1480 +#: src/dird/ua_output.c:600 #, c-format msgid "Could not open database \"%s\".\n" msgstr "" @@ -1372,7 +1316,7 @@ msgid "" "Storage \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:733 src/stored/stored.c:348 +#: src/dird/dird.c:733 src/stored/stored.c:347 #, c-format msgid "Failed to initialize TLS context for Storage \"%s\" in %s.\n" msgstr "" @@ -1407,55 +1351,55 @@ msgid "" "File daemon \"%s\" in %s.\n" msgstr "" -#: src/dird/dird_conf.c:441 src/tray-monitor/tray_conf.c:152 +#: src/dird/dird_conf.c:443 src/tray-monitor/tray_conf.c:152 #, c-format msgid "No %s resource defined\n" msgstr "" -#: src/dird/dird_conf.c:450 +#: src/dird/dird_conf.c:452 #, c-format msgid "Director: name=%s MaxJobs=%d FDtimeout=%s SDtimeout=%s\n" msgstr "" -#: src/dird/dird_conf.c:455 +#: src/dird/dird_conf.c:457 #, c-format msgid " query_file=%s\n" msgstr "" -#: src/dird/dird_conf.c:458 src/dird/dird_conf.c:483 src/dird/dird_conf.c:497 -#: src/dird/dird_conf.c:541 src/dird/dird_conf.c:545 src/dird/dird_conf.c:549 -#: src/dird/dird_conf.c:573 src/dird/dird_conf.c:578 src/dird/dird_conf.c:582 -#: src/dird/dird_conf.c:586 src/dird/dird_conf.c:590 src/dird/dird_conf.c:594 -#: src/dird/dird_conf.c:604 +#: src/dird/dird_conf.c:460 src/dird/dird_conf.c:485 src/dird/dird_conf.c:499 +#: src/dird/dird_conf.c:544 src/dird/dird_conf.c:548 src/dird/dird_conf.c:552 +#: src/dird/dird_conf.c:576 src/dird/dird_conf.c:581 src/dird/dird_conf.c:585 +#: src/dird/dird_conf.c:589 src/dird/dird_conf.c:593 src/dird/dird_conf.c:597 +#: src/dird/dird_conf.c:607 msgid " --> " msgstr "" -#: src/dird/dird_conf.c:464 src/dird/dird_conf.c:467 +#: src/dird/dird_conf.c:466 src/dird/dird_conf.c:469 #, c-format msgid "Console: name=%s SSL=%d\n" msgstr "" -#: src/dird/dird_conf.c:473 +#: src/dird/dird_conf.c:475 #, c-format msgid "Counter: name=%s min=%d max=%d cur=%d wrapcntr=%s\n" msgstr "" -#: src/dird/dird_conf.c:478 +#: src/dird/dird_conf.c:480 #, c-format msgid "Counter: name=%s min=%d max=%d\n" msgstr "" -#: src/dird/dird_conf.c:489 +#: src/dird/dird_conf.c:491 #, c-format msgid "Client: name=%s address=%s FDport=%d MaxJobs=%u\n" msgstr "" -#: src/dird/dird_conf.c:492 +#: src/dird/dird_conf.c:494 #, c-format msgid " JobRetention=%s FileRetention=%s AutoPrune=%d\n" msgstr "" -#: src/dird/dird_conf.c:504 +#: src/dird/dird_conf.c:506 #, c-format msgid "" "Device: name=%s ok=%d num_writers=%d max_writers=%d\n" @@ -1464,245 +1408,252 @@ msgid "" " poolid=%s volname=%s MediaType=%s\n" msgstr "" -#: src/dird/dird_conf.c:514 +#: src/dird/dird_conf.c:516 #, c-format msgid "" "Storage: name=%s address=%s SDport=%d MaxJobs=%u\n" " DeviceName=%s MediaType=%s StorageId=%s\n" msgstr "" -#: src/dird/dird_conf.c:523 +#: src/dird/dird_conf.c:525 #, c-format msgid "" "Catalog: name=%s address=%s DBport=%d db_name=%s\n" " db_user=%s MutliDBConn=%d\n" msgstr "" -#: src/dird/dird_conf.c:531 +#: src/dird/dird_conf.c:533 #, c-format -msgid "%s: name=%s JobType=%d level=%s Priority=%d MaxJobs=%u\n" +msgid "%s: name=%s JobType=%d level=%s Priority=%d Enabled=%d\n" +msgstr "" + +#: src/dird/dird_conf.c:534 src/dird/ua_cmds.c:430 src/dird/ua_prune.c:454 +#: src/dird/ua_run.c:643 src/dird/ua_select.c:234 src/dird/ua_select.c:257 +msgid "Job" msgstr "" -#: src/dird/dird_conf.c:532 +#: src/dird/dird_conf.c:534 msgid "JobDefs" msgstr "" -#: src/dird/dird_conf.c:536 +#: src/dird/dird_conf.c:538 #, c-format -msgid " Resched=%d Times=%d Interval=%s Spool=%d WritePartAfterJob=%d\n" +msgid "" +" MaxJobs=%u Resched=%d Times=%d Interval=%s Spool=%d WritePartAfterJob=%" +"d\n" msgstr "" -#: src/dird/dird_conf.c:553 +#: src/dird/dird_conf.c:556 #, c-format msgid " --> Where=%s\n" msgstr "" -#: src/dird/dird_conf.c:556 +#: src/dird/dird_conf.c:559 #, c-format msgid " --> Bootstrap=%s\n" msgstr "" -#: src/dird/dird_conf.c:559 +#: src/dird/dird_conf.c:562 #, c-format msgid " --> RunBefore=%s\n" msgstr "" -#: src/dird/dird_conf.c:562 +#: src/dird/dird_conf.c:565 #, c-format msgid " --> RunAfter=%s\n" msgstr "" -#: src/dird/dird_conf.c:565 +#: src/dird/dird_conf.c:568 #, c-format msgid " --> RunAfterFailed=%s\n" msgstr "" -#: src/dird/dird_conf.c:568 +#: src/dird/dird_conf.c:571 #, c-format msgid " --> WriteBootstrap=%s\n" msgstr "" -#: src/dird/dird_conf.c:600 +#: src/dird/dird_conf.c:603 #, c-format msgid " --> Run=%s\n" msgstr "" -#: src/dird/dird_conf.c:611 +#: src/dird/dird_conf.c:614 #, c-format msgid "FileSet: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:673 src/dird/dird_conf.c:752 +#: src/dird/dird_conf.c:676 src/dird/dird_conf.c:755 #, c-format msgid "Schedule: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:678 +#: src/dird/dird_conf.c:681 #, c-format msgid " --> Run Level=%s\n" msgstr "" -#: src/dird/dird_conf.c:679 +#: src/dird/dird_conf.c:682 msgid " hour=" msgstr "" -#: src/dird/dird_conf.c:688 +#: src/dird/dird_conf.c:691 msgid " mday=" msgstr "" -#: src/dird/dird_conf.c:697 +#: src/dird/dird_conf.c:700 msgid " month=" msgstr "" -#: src/dird/dird_conf.c:706 +#: src/dird/dird_conf.c:709 msgid " wday=" msgstr "" -#: src/dird/dird_conf.c:715 +#: src/dird/dird_conf.c:718 msgid " wom=" msgstr "" -#: src/dird/dird_conf.c:724 +#: src/dird/dird_conf.c:727 msgid " woy=" msgstr "" -#: src/dird/dird_conf.c:733 +#: src/dird/dird_conf.c:736 #, c-format msgid " mins=%d\n" msgstr "" -#: src/dird/dird_conf.c:735 src/dird/dird_conf.c:739 src/dird/dird_conf.c:743 +#: src/dird/dird_conf.c:738 src/dird/dird_conf.c:742 src/dird/dird_conf.c:746 msgid " --> " msgstr "" -#: src/dird/dird_conf.c:756 +#: src/dird/dird_conf.c:759 #, c-format msgid "Pool: name=%s PoolType=%s\n" msgstr "" -#: src/dird/dird_conf.c:758 +#: src/dird/dird_conf.c:761 #, c-format msgid " use_cat=%d use_once=%d acpt_any=%d cat_files=%d\n" msgstr "" -#: src/dird/dird_conf.c:761 +#: src/dird/dird_conf.c:764 #, c-format msgid " max_vols=%d auto_prune=%d VolRetention=%s\n" msgstr "" -#: src/dird/dird_conf.c:764 +#: src/dird/dird_conf.c:767 #, c-format msgid " VolUse=%s recycle=%d LabelFormat=%s\n" msgstr "" -#: src/dird/dird_conf.c:768 +#: src/dird/dird_conf.c:771 #, c-format msgid " CleaningPrefix=%s LabelType=%d\n" msgstr "" -#: src/dird/dird_conf.c:770 +#: src/dird/dird_conf.c:773 #, c-format msgid " RecyleOldest=%d PurgeOldest=%d MaxVolJobs=%d MaxVolFiles=%d\n" msgstr "" -#: src/dird/dird_conf.c:776 +#: src/dird/dird_conf.c:779 #, c-format msgid "Messages: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:778 +#: src/dird/dird_conf.c:781 #, c-format msgid " mailcmd=%s\n" msgstr "" -#: src/dird/dird_conf.c:780 +#: src/dird/dird_conf.c:783 #, c-format msgid " opcmd=%s\n" msgstr "" -#: src/dird/dird_conf.c:783 src/tray-monitor/tray_conf.c:179 +#: src/dird/dird_conf.c:786 src/tray-monitor/tray_conf.c:179 #, c-format msgid "Unknown resource type %d in dump_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1077 src/tray-monitor/tray_conf.c:232 +#: src/dird/dird_conf.c:1080 src/tray-monitor/tray_conf.c:232 #, c-format msgid "Unknown resource type %d in free_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1115 src/lib/parse_conf.c:211 +#: src/dird/dird_conf.c:1118 src/lib/parse_conf.c:211 #: src/tray-monitor/tray_conf.c:268 #, c-format msgid "Too many items in %s resource\n" msgstr "" -#: src/dird/dird_conf.c:1149 +#: src/dird/dird_conf.c:1152 #, c-format msgid "Cannot find Console resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1155 src/filed/filed_conf.c:316 -#: src/stored/stored_conf.c:523 +#: src/dird/dird_conf.c:1158 src/filed/filed_conf.c:316 +#: src/stored/stored_conf.c:566 #, c-format msgid "Cannot find Director resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1162 src/stored/stored_conf.c:529 +#: src/dird/dird_conf.c:1165 src/stored/stored_conf.c:572 #, c-format msgid "Cannot find Storage resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1171 +#: src/dird/dird_conf.c:1174 #, c-format msgid "Cannot find Job resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1189 +#: src/dird/dird_conf.c:1192 #, c-format msgid "Cannot find Counter resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1197 src/filed/filed_conf.c:322 +#: src/dird/dird_conf.c:1200 src/filed/filed_conf.c:322 #, c-format msgid "Cannot find Client resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1209 +#: src/dird/dird_conf.c:1212 #, c-format msgid "Cannot find Schedule resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1214 src/tray-monitor/tray_conf.c:287 +#: src/dird/dird_conf.c:1217 src/tray-monitor/tray_conf.c:287 #, c-format msgid "Unknown resource type %d in save_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1274 src/tray-monitor/tray_conf.c:322 +#: src/dird/dird_conf.c:1277 src/tray-monitor/tray_conf.c:322 #, c-format msgid "Unknown resource type %d in save_resrouce.\n" msgstr "" -#: src/dird/dird_conf.c:1289 +#: src/dird/dird_conf.c:1292 #, c-format msgid "Name item is required in %s resource, but not found.\n" msgstr "" -#: src/dird/dird_conf.c:1301 +#: src/dird/dird_conf.c:1304 #, c-format msgid "Inserting %s res: %s index=%d pass=%d\n" msgstr "" -#: src/dird/dird_conf.c:1374 +#: src/dird/dird_conf.c:1377 #, c-format msgid "Expected a Job Type keyword, got: %s" msgstr "" -#: src/dird/dird_conf.c:1398 +#: src/dird/dird_conf.c:1401 #, c-format msgid "Expected a Job Level keyword, got: %s" msgstr "" -#: src/dird/dird_conf.c:1418 +#: src/dird/dird_conf.c:1421 #, c-format msgid "Expected a Restore replacement option, got: %s" msgstr "" @@ -1788,7 +1739,7 @@ msgstr "" msgid "Unimplemented backup level %d %c\n" msgstr "" -#: src/dird/fd_cmds.c:320 src/filed/job.c:565 +#: src/dird/fd_cmds.c:320 src/filed/job.c:566 #, c-format msgid "Cannot run program: %s. ERR=%s\n" msgstr "" @@ -1807,7 +1758,7 @@ msgstr "" msgid "Cannot open included file: %s. ERR=%s\n" msgstr "" -#: src/dird/fd_cmds.c:441 src/filed/job.c:1617 +#: src/dird/fd_cmds.c:441 src/filed/job.c:1622 #, c-format msgid "Could not open bootstrap file %s: ERR=%s\n" msgstr "" @@ -1819,7 +1770,7 @@ msgid "" "msglen=%d msg=%s\n" msgstr "" -#: src/dird/fd_cmds.c:571 src/dird/verify.c:696 +#: src/dird/fd_cmds.c:571 src/dird/verify.c:700 #, c-format msgid "MD5/SHA1 index %d not same as attributes %d\n" msgstr "" @@ -1829,28 +1780,28 @@ msgstr "" msgid " | ] -- cancel a job" msgstr "" -#: src/dird/ua_cmds.c:92 +#: src/dird/ua_cmds.c:94 msgid "create DB Pool from resource" msgstr "" -#: src/dird/ua_cmds.c:93 +#: src/dird/ua_cmds.c:95 msgid "delete [pool= | media volume=]" msgstr "" -#: src/dird/ua_cmds.c:94 +#: src/dird/ua_cmds.c:96 +msgid "disable -- disable a job" +msgstr "" + +#: src/dird/ua_cmds.c:97 +msgid "enable -- enable a job" +msgstr "" + +#: src/dird/ua_cmds.c:98 msgid "performs FileSet estimate, listing gives full listing" msgstr "" -#: src/dird/ua_cmds.c:96 +#: src/dird/ua_cmds.c:100 msgid "gui [on|off] -- non-interactive gui mode" msgstr "" -#: src/dird/ua_cmds.c:97 src/stored/btape.c:2533 +#: src/dird/ua_cmds.c:101 src/stored/btape.c:2540 msgid "print this command" msgstr "" -#: src/dird/ua_cmds.c:98 +#: src/dird/ua_cmds.c:102 msgid "" "list [pools | jobs | jobtotals | media | files ]; " "from catalog" msgstr "" -#: src/dird/ua_cmds.c:99 +#: src/dird/ua_cmds.c:103 msgid "label a tape" msgstr "" -#: src/dird/ua_cmds.c:100 +#: src/dird/ua_cmds.c:104 msgid "full or long list like list command" msgstr "" -#: src/dird/ua_cmds.c:101 +#: src/dird/ua_cmds.c:105 msgid "messages" msgstr "" -#: src/dird/ua_cmds.c:102 +#: src/dird/ua_cmds.c:106 msgid "mount " msgstr "" -#: src/dird/ua_cmds.c:103 +#: src/dird/ua_cmds.c:107 msgid "prune expired records from catalog" msgstr "" -#: src/dird/ua_cmds.c:104 +#: src/dird/ua_cmds.c:108 msgid "purge records from catalog" msgstr "" -#: src/dird/ua_cmds.c:105 +#: src/dird/ua_cmds.c:109 msgid "python control commands" msgstr "" -#: src/dird/ua_cmds.c:107 +#: src/dird/ua_cmds.c:111 msgid "query catalog" msgstr "" -#: src/dird/ua_cmds.c:108 +#: src/dird/ua_cmds.c:112 msgid "restore files" msgstr "" -#: src/dird/ua_cmds.c:109 +#: src/dird/ua_cmds.c:113 msgid "relabel a tape" msgstr "" -#: src/dird/ua_cmds.c:110 +#: src/dird/ua_cmds.c:114 msgid "release " msgstr "" -#: src/dird/ua_cmds.c:111 +#: src/dird/ua_cmds.c:115 msgid "reload conf file" msgstr "" -#: src/dird/ua_cmds.c:112 +#: src/dird/ua_cmds.c:116 msgid "run " msgstr "" -#: src/dird/ua_cmds.c:113 +#: src/dird/ua_cmds.c:117 msgid "status [storage | client]=" msgstr "" -#: src/dird/ua_cmds.c:114 +#: src/dird/ua_cmds.c:118 msgid "sets debug level" msgstr "" -#: src/dird/ua_cmds.c:115 +#: src/dird/ua_cmds.c:119 msgid "sets new client address -- if authorized" msgstr "" -#: src/dird/ua_cmds.c:116 +#: src/dird/ua_cmds.c:120 msgid "show (resource records) [jobs | pools | ... | all]" msgstr "" -#: src/dird/ua_cmds.c:117 +#: src/dird/ua_cmds.c:121 msgid "use SQL to query catalog" msgstr "" -#: src/dird/ua_cmds.c:119 +#: src/dird/ua_cmds.c:123 msgid "turn on/off trace to file" msgstr "" -#: src/dird/ua_cmds.c:120 +#: src/dird/ua_cmds.c:124 msgid "unmount " msgstr "" -#: src/dird/ua_cmds.c:121 +#: src/dird/ua_cmds.c:125 msgid "umount for old-time Unix guys" msgstr "" -#: src/dird/ua_cmds.c:122 +#: src/dird/ua_cmds.c:126 msgid "update Volume, Pool or slots" msgstr "" -#: src/dird/ua_cmds.c:123 +#: src/dird/ua_cmds.c:127 msgid "use catalog xxx" msgstr "" -#: src/dird/ua_cmds.c:124 +#: src/dird/ua_cmds.c:128 msgid "does variable expansion" msgstr "" -#: src/dird/ua_cmds.c:125 +#: src/dird/ua_cmds.c:129 msgid "print Director version" msgstr "" -#: src/dird/ua_cmds.c:126 +#: src/dird/ua_cmds.c:130 msgid "wait until no jobs are running" msgstr "" -#: src/dird/ua_cmds.c:158 +#: src/dird/ua_cmds.c:168 #, c-format msgid "%s: is an illegal command.\n" msgstr "" -#: src/dird/ua_cmds.c:196 +#: src/dird/ua_cmds.c:206 msgid "" "You probably don't want to be using this command since it\n" "creates database records without labeling the Volumes.\n" @@ -2553,220 +2566,230 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_cmds.c:215 +#: src/dird/ua_cmds.c:225 #, c-format msgid "Pool already has maximum volumes = %d\n" msgstr "" -#: src/dird/ua_cmds.c:217 +#: src/dird/ua_cmds.c:227 msgid "Enter new maximum (zero for unlimited): " msgstr "" -#: src/dird/ua_cmds.c:238 +#: src/dird/ua_cmds.c:248 #, c-format msgid "Enter number of Volumes to create. 0=>fixed name. Max=%d: " msgstr "" -#: src/dird/ua_cmds.c:244 +#: src/dird/ua_cmds.c:254 #, c-format msgid "The number must be between 0 and %d\n" msgstr "" -#: src/dird/ua_cmds.c:251 +#: src/dird/ua_cmds.c:261 msgid "Enter Volume name: " msgstr "" -#: src/dird/ua_cmds.c:255 +#: src/dird/ua_cmds.c:265 msgid "Enter base volume name: " msgstr "" -#: src/dird/ua_cmds.c:264 src/dird/ua_label.c:590 +#: src/dird/ua_cmds.c:274 src/dird/ua_label.c:605 msgid "Volume name too long.\n" msgstr "" -#: src/dird/ua_cmds.c:268 src/dird/ua_label.c:596 src/lib/edit.c:413 +#: src/dird/ua_cmds.c:278 src/dird/ua_label.c:611 src/lib/edit.c:413 msgid "Volume name must be at least one character long.\n" msgstr "" -#: src/dird/ua_cmds.c:277 +#: src/dird/ua_cmds.c:287 msgid "Enter the starting number: " msgstr "" -#: src/dird/ua_cmds.c:282 +#: src/dird/ua_cmds.c:292 msgid "Start number must be greater than zero.\n" msgstr "" -#: src/dird/ua_cmds.c:293 +#: src/dird/ua_cmds.c:303 msgid "Enter slot (0 for none): " msgstr "" -#: src/dird/ua_cmds.c:297 +#: src/dird/ua_cmds.c:307 msgid "InChanger? yes/no: " msgstr "" -#: src/dird/ua_cmds.c:324 +#: src/dird/ua_cmds.c:334 #, c-format msgid "%d Volumes created in pool %s\n" msgstr "" -#: src/dird/ua_cmds.c:340 src/dird/ua_cmds.c:866 +#: src/dird/ua_cmds.c:350 src/dird/ua_cmds.c:917 msgid "Turn on or off? " msgstr "" -#: src/dird/ua_cmds.c:348 src/dird/ua_cmds.c:874 +#: src/dird/ua_cmds.c:358 src/dird/ua_cmds.c:925 msgid "off" msgstr "" -#: src/dird/ua_cmds.c:368 +#: src/dird/ua_cmds.c:378 msgid "jobid" msgstr "" -#: src/dird/ua_cmds.c:375 +#: src/dird/ua_cmds.c:385 #, c-format msgid "JobId %s is not running. Use Job name to cancel inactive jobs.\n" msgstr "" -#: src/dird/ua_cmds.c:379 +#: src/dird/ua_cmds.c:389 msgid "job" msgstr "" -#: src/dird/ua_cmds.c:384 +#: src/dird/ua_cmds.c:394 #, c-format msgid "Warning Job %s is not running. Continuing anyway ...\n" msgstr "" -#: src/dird/ua_cmds.c:407 src/filed/status.c:193 src/stored/status.c:315 +#: src/dird/ua_cmds.c:416 src/filed/status.c:195 src/stored/status.c:343 msgid "No Jobs running.\n" msgstr "" -#: src/dird/ua_cmds.c:410 +#: src/dird/ua_cmds.c:419 msgid "Select Job:\n" msgstr "" -#: src/dird/ua_cmds.c:417 +#: src/dird/ua_cmds.c:425 #, c-format msgid "JobId=%s Job=%s" msgstr "" -#: src/dird/ua_cmds.c:422 +#: src/dird/ua_cmds.c:430 msgid "Choose Job to cancel" msgstr "" -#: src/dird/ua_cmds.c:426 +#: src/dird/ua_cmds.c:434 msgid "Confirm cancel (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:434 +#: src/dird/ua_cmds.c:442 #, c-format msgid "Job %s not found.\n" msgstr "" -#: src/dird/ua_cmds.c:539 +#: src/dird/ua_cmds.c:547 #, c-format msgid "" "Error: Pool %s already exists.\n" "Use update to change it.\n" msgstr "" -#: src/dird/ua_cmds.c:550 +#: src/dird/ua_cmds.c:558 #, c-format msgid "Pool %s created.\n" msgstr "" -#: src/dird/ua_cmds.c:563 +#: src/dird/ua_cmds.c:571 msgid "restart" msgstr "" -#: src/dird/ua_cmds.c:567 +#: src/dird/ua_cmds.c:575 msgid "Python interpreter restarted.\n" msgstr "" -#: src/dird/ua_cmds.c:569 src/dird/ua_cmds.c:1094 +#: src/dird/ua_cmds.c:577 src/dird/ua_cmds.c:1145 msgid "Nothing done.\n" msgstr "" -#: src/dird/ua_cmds.c:585 +#: src/dird/ua_cmds.c:593 src/dird/ua_cmds.c:639 msgid "Illegal command from this console.\n" msgstr "" -#: src/dird/ua_cmds.c:592 src/dird/ua_run.c:353 +#: src/dird/ua_cmds.c:600 src/dird/ua_run.c:353 #, c-format msgid "Client \"%s\" not found.\n" msgstr "" -#: src/dird/ua_cmds.c:601 +#: src/dird/ua_cmds.c:609 #, c-format msgid "Client \"%s\" address set to %s\n" msgstr "" -#: src/dird/ua_cmds.c:616 src/dird/ua_status.c:286 +#: src/dird/ua_cmds.c:634 +#, c-format +msgid "Job \"%s\" not found.\n" +msgstr "" + +#: src/dird/ua_cmds.c:643 +#, c-format +msgid "Job \"%s\" %sabled\n" +msgstr "" + +#: src/dird/ua_cmds.c:667 src/dird/ua_status.c:286 #, c-format msgid "Connecting to Storage daemon %s at %s:%d\n" msgstr "" -#: src/dird/ua_cmds.c:622 src/dird/ua_status.c:297 +#: src/dird/ua_cmds.c:673 src/dird/ua_status.c:297 msgid "Connected to storage daemon\n" msgstr "" -#: src/dird/ua_cmds.c:642 src/dird/ua_cmds.c:981 src/dird/ua_status.c:324 +#: src/dird/ua_cmds.c:693 src/dird/ua_cmds.c:1032 src/dird/ua_status.c:324 #, c-format msgid "Connecting to Client %s at %s:%d\n" msgstr "" -#: src/dird/ua_cmds.c:645 src/dird/ua_cmds.c:984 +#: src/dird/ua_cmds.c:696 src/dird/ua_cmds.c:1035 msgid "Failed to connect to Client.\n" msgstr "" -#: src/dird/ua_cmds.c:761 +#: src/dird/ua_cmds.c:812 msgid "Enter new debug level: " msgstr "" -#: src/dird/ua_cmds.c:827 +#: src/dird/ua_cmds.c:878 msgid "Available daemons are: \n" msgstr "" -#: src/dird/ua_cmds.c:832 +#: src/dird/ua_cmds.c:883 msgid "Select daemon type to set debug level" msgstr "" -#: src/dird/ua_cmds.c:936 src/dird/ua_run.c:478 +#: src/dird/ua_cmds.c:987 src/dird/ua_run.c:478 #, c-format msgid "Level %s not valid.\n" msgstr "" -#: src/dird/ua_cmds.c:949 +#: src/dird/ua_cmds.c:1000 msgid "No job specified.\n" msgstr "" -#: src/dird/ua_cmds.c:989 +#: src/dird/ua_cmds.c:1040 msgid "Error sending include list.\n" msgstr "" -#: src/dird/ua_cmds.c:994 +#: src/dird/ua_cmds.c:1045 msgid "Error sending exclude list.\n" msgstr "" -#: src/dird/ua_cmds.c:1080 +#: src/dird/ua_cmds.c:1131 msgid "" "In general it is not a good idea to delete either a\n" "Pool or a Volume since they may contain data.\n" "\n" msgstr "" -#: src/dird/ua_cmds.c:1083 +#: src/dird/ua_cmds.c:1134 msgid "Choose catalog item to delete" msgstr "" -#: src/dird/ua_cmds.c:1151 +#: src/dird/ua_cmds.c:1202 msgid "Enter JobId to delete: " msgstr "" -#: src/dird/ua_cmds.c:1194 +#: src/dird/ua_cmds.c:1245 #, c-format msgid "Job %s and associated records deleted from the catalog.\n" msgstr "" -#: src/dird/ua_cmds.c:1207 +#: src/dird/ua_cmds.c:1258 #, c-format msgid "" "\n" @@ -2774,58 +2797,62 @@ msgid "" "and all Jobs saved on that volume from the Catalog\n" msgstr "" -#: src/dird/ua_cmds.c:1211 +#: src/dird/ua_cmds.c:1262 msgid "Are you sure you want to delete this Volume? (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:1232 +#: src/dird/ua_cmds.c:1283 msgid "Are you sure you want to delete this Pool? (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:1329 +#: src/dird/ua_cmds.c:1380 #, c-format msgid "Using Catalog name=%s DB=%s\n" msgstr "" -#: src/dird/ua_cmds.c:1370 src/dird/ua_tree.c:594 src/stored/btape.c:2580 +#: src/dird/ua_cmds.c:1421 src/dird/ua_tree.c:622 src/stored/btape.c:2587 #, c-format msgid "" " Command Description\n" " ======= ===========\n" msgstr "" -#: src/dird/ua_cmds.c:1372 +#: src/dird/ua_cmds.c:1423 #, c-format msgid " %-10s %s\n" msgstr "" -#: src/dird/ua_cmds.c:1374 +#: src/dird/ua_cmds.c:1425 msgid "" "\n" "When at a prompt, entering a period cancels the command.\n" "\n" msgstr "" -#: src/dird/ua_cmds.c:1390 +#: src/dird/ua_cmds.c:1441 #, c-format msgid "%s Version: %s (%s)\n" msgstr "" -#: src/dird/ua_cmds.c:1409 +#: src/dird/ua_cmds.c:1460 msgid "Could not find a Catalog resource\n" msgstr "" -#: src/dird/ua_cmds.c:1412 +#: src/dird/ua_cmds.c:1463 +msgid "You must specify a \"use \" command before continuing.\n" +msgstr "" + +#: src/dird/ua_cmds.c:1467 #, c-format msgid "Using default Catalog name=%s DB=%s\n" msgstr "" -#: src/dird/ua_dotcmds.c:121 +#: src/dird/ua_dotcmds.c:131 msgid "The Director will segment fault.\n" msgstr "" -#: src/dird/ua_dotcmds.c:221 src/dird/ua_restore.c:747 -#: src/dird/ua_restore.c:785 +#: src/dird/ua_dotcmds.c:231 src/dird/ua_restore.c:740 +#: src/dird/ua_restore.c:778 src/dird/ua_restore.c:809 #, c-format msgid "Query failed: %s. ERR=%s\n" msgstr "" @@ -2839,15 +2866,16 @@ msgstr "" msgid "Expected a positive integer, got: %s\n" msgstr "" -#: src/dird/ua_input.c:120 src/dird/ua_run.c:860 src/dird/ua_select.c:54 -#: src/dird/ua_update.c:232 src/dird/ua_update.c:247 src/dird/ua_update.c:495 +#: src/dird/ua_input.c:120 src/dird/ua_run.c:862 src/dird/ua_select.c:54 +#: src/dird/ua_update.c:223 src/dird/ua_update.c:237 src/dird/ua_update.c:247 +#: src/dird/ua_update.c:261 src/dird/ua_update.c:551 #: src/stored/parse_bsr.c:741 src/tools/dbcheck.c:1098 msgid "yes" msgstr "" -#: src/dird/ua_input.c:124 src/dird/ua_select.c:57 src/dird/ua_update.c:234 -#: src/dird/ua_update.c:247 src/dird/ua_update.c:495 -#: src/stored/parse_bsr.c:741 +#: src/dird/ua_input.c:124 src/dird/ua_select.c:57 src/dird/ua_update.c:225 +#: src/dird/ua_update.c:237 src/dird/ua_update.c:249 src/dird/ua_update.c:261 +#: src/dird/ua_update.c:551 src/stored/parse_bsr.c:741 msgid "no" msgstr "" @@ -2855,271 +2883,287 @@ msgstr "" msgid "Invalid response. You must answer yes or no.\n" msgstr "" -#: src/dird/ua_label.c:88 +#: src/dird/ua_label.c:89 msgid "Negative numbers not permitted\n" msgstr "" -#: src/dird/ua_label.c:94 +#: src/dird/ua_label.c:95 msgid "Range end is not integer.\n" msgstr "" -#: src/dird/ua_label.c:99 +#: src/dird/ua_label.c:100 msgid "Range start is not an integer.\n" msgstr "" -#: src/dird/ua_label.c:105 +#: src/dird/ua_label.c:106 msgid "Range end not bigger than start.\n" msgstr "" -#: src/dird/ua_label.c:111 +#: src/dird/ua_label.c:112 msgid "Input value is not an integer.\n" msgstr "" -#: src/dird/ua_label.c:117 +#: src/dird/ua_label.c:118 msgid "Values must be be greater than zero.\n" msgstr "" -#: src/dird/ua_label.c:121 +#: src/dird/ua_label.c:122 msgid "Slot too large.\n" msgstr "" -#: src/dird/ua_label.c:176 src/dird/ua_label.c:463 +#: src/dird/ua_label.c:176 src/dird/ua_label.c:473 msgid "No slots in changer to scan.\n" msgstr "" -#: src/dird/ua_label.c:188 src/dird/ua_label.c:474 +#: src/dird/ua_label.c:188 src/dird/ua_label.c:484 msgid "No Volumes found to label, or no barcodes.\n" msgstr "" -#: src/dird/ua_label.c:195 +#: src/dird/ua_label.c:198 #, c-format -msgid "Slot %d larger than max %d ignored.\n" +msgid "Slot %d greater than max %d ignored.\n" msgstr "" -#: src/dird/ua_label.c:224 +#: src/dird/ua_label.c:227 #, c-format -msgid "No VolName for Slot=%d set InChanger to zero.\n" +msgid "No VolName for Slot=%d InChanger set to zero.\n" msgstr "" -#: src/dird/ua_label.c:239 +#: src/dird/ua_label.c:242 #, c-format msgid "Catalog record for Volume \"%s\" updated to reference slot %d.\n" msgstr "" -#: src/dird/ua_label.c:243 +#: src/dird/ua_label.c:246 #, c-format msgid "Catalog record for Volume \"%s\" is up to date.\n" msgstr "" -#: src/dird/ua_label.c:249 +#: src/dird/ua_label.c:252 #, c-format -msgid "Record for Volume \"%s\" not found in catalog.\n" +msgid "Volume \"%s\" not found in catalog. Slot=%d InChanger set to zero.\n" msgstr "" -#: src/dird/ua_label.c:334 +#: src/dird/ua_label.c:344 #, c-format msgid "" "Volume \"%s\" has VolStatus %s. It must be Purged or Recycled before " "relabeling.\n" msgstr "" -#: src/dird/ua_label.c:350 +#: src/dird/ua_label.c:360 msgid "Enter new Volume name: " msgstr "" -#: src/dird/ua_label.c:363 +#: src/dird/ua_label.c:373 #, c-format msgid "Media record for new Volume \"%s\" already exists.\n" msgstr "" -#: src/dird/ua_label.c:378 +#: src/dird/ua_label.c:388 msgid "Enter slot (0 or Enter for none): " msgstr "" -#: src/dird/ua_label.c:403 +#: src/dird/ua_label.c:413 #, c-format msgid "Delete of Volume \"%s\" failed. ERR=%s" msgstr "" -#: src/dird/ua_label.c:406 +#: src/dird/ua_label.c:416 #, c-format msgid "Old volume \"%s\" deleted from catalog.\n" msgstr "" -#: src/dird/ua_label.c:417 +#: src/dird/ua_label.c:427 #, c-format msgid "Requesting to mount %s ...\n" msgstr "" -#: src/dird/ua_label.c:439 +#: src/dird/ua_label.c:449 msgid "Do not forget to mount the drive!!!\n" msgstr "" -#: src/dird/ua_label.c:479 +#: src/dird/ua_label.c:489 msgid "" "The following Volumes will be labeled:\n" "Slot Volume\n" "==============\n" msgstr "" -#: src/dird/ua_label.c:488 src/stored/btape.c:608 +#: src/dird/ua_label.c:498 src/stored/btape.c:606 msgid "Do you want to continue? (y/n): " msgstr "" -#: src/dird/ua_label.c:509 +#: src/dird/ua_label.c:519 #, c-format msgid "Media record for Slot %d Volume \"%s\" already exists.\n" msgstr "" -#: src/dird/ua_label.c:515 +#: src/dird/ua_label.c:525 #, c-format msgid "Error setting InChanger: ERR=%s" msgstr "" -#: src/dird/ua_label.c:540 +#: src/dird/ua_label.c:548 +#, c-format +msgid "Maximum pool Volumes=%d reached.\n" +msgstr "" + +#: src/dird/ua_label.c:555 #, c-format msgid "Catalog record for cleaning tape \"%s\" successfully created.\n" msgstr "" -#: src/dird/ua_label.c:547 +#: src/dird/ua_label.c:562 #, c-format msgid "Catalog error on cleaning tape: %s" msgstr "" -#: src/dird/ua_label.c:583 +#: src/dird/ua_label.c:598 #, c-format msgid "Illegal character \"%c\" in a volume name.\n" msgstr "" -#: src/dird/ua_label.c:628 +#: src/dird/ua_label.c:643 #, c-format msgid "Sending relabel command from \"%s\" to \"%s\" ...\n" msgstr "" -#: src/dird/ua_label.c:635 +#: src/dird/ua_label.c:650 #, c-format msgid "Sending label command for Volume \"%s\" Slot %d ...\n" msgstr "" -#: src/dird/ua_label.c:665 +#: src/dird/ua_label.c:682 #, c-format msgid "Catalog record for Volume \"%s\", Slot %d successfully created.\n" msgstr "" -#: src/dird/ua_label.c:678 +#: src/dird/ua_label.c:695 #, c-format msgid "Label command failed for Volume %s.\n" msgstr "" -#: src/dird/ua_label.c:688 +#: src/dird/ua_label.c:705 #, c-format msgid "Connecting to Storage daemon %s at %s:%d ...\n" msgstr "" -#: src/dird/ua_label.c:716 +#: src/dird/ua_label.c:733 msgid "Could not open SD socket.\n" msgstr "" -#: src/dird/ua_label.c:722 +#: src/dird/ua_label.c:739 #, c-format msgid "readlabel %s Slot=%d drive=%d\n" msgstr "" -#: src/dird/ua_label.c:764 +#: src/dird/ua_label.c:781 #, c-format msgid "autochanger list %s \n" msgstr "" -#: src/dird/ua_label.c:788 src/dird/ua_label.c:798 +#: src/dird/ua_label.c:805 src/dird/ua_label.c:815 #, c-format msgid "Invalid Slot number: %s\n" msgstr "" -#: src/dird/ua_label.c:807 +#: src/dird/ua_label.c:824 #, c-format msgid "Invalid Volume name: %s\n" msgstr "" -#: src/dird/ua_label.c:876 +#: src/dird/ua_label.c:893 #, c-format -msgid "autochanger slots %s \n" +msgid "autochanger slots %s\n" msgstr "" -#: src/dird/ua_label.c:886 +#: src/dird/ua_label.c:903 #, c-format msgid "Device \"%s\" has %d slots.\n" msgstr "" -#: src/dird/ua_label.c:902 +#: src/dird/ua_label.c:925 +#, c-format +msgid "autochanger drives %s\n" +msgstr "" + +#: src/dird/ua_label.c:952 #, c-format msgid "Pool \"%s\" resource not found!\n" msgstr "" -#: src/dird/ua_output.c:64 src/dird/ua_output.c:90 +#: src/dird/ua_output.c:64 src/dird/ua_output.c:88 msgid "ON or OFF keyword missing.\n" msgstr "" -#: src/dird/ua_output.c:178 +#: src/dird/ua_output.c:176 msgid "Keywords for the show command are:\n" msgstr "" -#: src/dird/ua_output.c:184 +#: src/dird/ua_output.c:182 #, c-format msgid "%s resource %s not found.\n" msgstr "" -#: src/dird/ua_output.c:187 +#: src/dird/ua_output.c:185 #, c-format msgid "Resource %s not found\n" msgstr "" -#: src/dird/ua_output.c:253 +#: src/dird/ua_output.c:251 msgid "Hey! DB is NULL\n" msgstr "" -#: src/dird/ua_output.c:353 +#: src/dird/ua_output.c:358 #, c-format msgid "Jobid %d used %d Volume(s): %s\n" msgstr "" -#: src/dird/ua_output.c:365 +#: src/dird/ua_output.c:376 msgid "No Pool specified.\n" msgstr "" -#: src/dird/ua_output.c:375 src/dird/ua_select.c:446 +#: src/dird/ua_output.c:387 src/dird/ua_select.c:458 #, c-format msgid "Error obtaining pool ids. ERR=%s\n" msgstr "" -#: src/dird/ua_output.c:385 +#: src/dird/ua_output.c:397 #, c-format msgid "Pool: %s\n" msgstr "" -#: src/dird/ua_output.c:396 -msgid "No Volume Name specified.\n" +#: src/dird/ua_output.c:413 src/dird/ua_status.c:452 +msgid "Ignoring illegal value for days.\n" msgstr "" -#: src/dird/ua_output.c:409 +#: src/dird/ua_output.c:422 #, c-format msgid "Unknown list keyword: %s\n" msgstr "" -#: src/dird/ua_output.c:434 +#: src/dird/ua_output.c:448 #, c-format msgid "%s is not a job name.\n" msgstr "" -#: src/dird/ua_output.c:450 src/dird/ua_output.c:462 -msgid "Could not find next Volume.\n" +#: src/dird/ua_output.c:469 +#, c-format +msgid "Could not find next Volume for Job %s (%s, %s).\n" +msgstr "" + +#: src/dird/ua_output.c:473 +#, c-format +msgid "The next Volume to be used by Job \"%s\" (%s, %s) will be %s\n" msgstr "" -#: src/dird/ua_output.c:452 +#: src/dird/ua_output.c:483 #, c-format -msgid "The next Volume to be used by Job \"%s\" will be %s\n" +msgid "Could not find next Volume for Job %s.\n" msgstr "" -#: src/dird/ua_output.c:671 +#: src/dird/ua_output.c:673 msgid "You have no messages.\n" msgstr "" @@ -3279,32 +3323,32 @@ msgstr "" msgid "End query mode.\n" msgstr "" -#: src/dird/ua_restore.c:151 +#: src/dird/ua_restore.c:115 msgid "" "No Restore Job Resource found in bacula-dir.conf.\n" "You must create at least one before running this command.\n" msgstr "" -#: src/dird/ua_restore.c:167 +#: src/dird/ua_restore.c:131 msgid "Restore not done.\n" msgstr "" -#: src/dird/ua_restore.c:178 +#: src/dird/ua_restore.c:142 msgid "Unable to construct a valid BSR. Cannot continue.\n" msgstr "" -#: src/dird/ua_restore.c:182 src/dird/ua_restore.c:196 +#: src/dird/ua_restore.c:146 src/dird/ua_restore.c:160 msgid "No files selected to be restored.\n" msgstr "" -#: src/dird/ua_restore.c:190 +#: src/dird/ua_restore.c:154 msgid "" "\n" "1 file selected to be restored.\n" "\n" msgstr "" -#: src/dird/ua_restore.c:193 +#: src/dird/ua_restore.c:157 #, c-format msgid "" "\n" @@ -3312,80 +3356,85 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_restore.c:211 +#: src/dird/ua_restore.c:175 msgid "No Restore Job resource found!\n" msgstr "" -#: src/dird/ua_restore.c:309 +#: src/dird/ua_restore.c:237 +#, c-format +msgid "Missing value for keyword: %s\n" +msgstr "" + +#: src/dird/ua_restore.c:286 msgid "List last 20 Jobs run" msgstr "" -#: src/dird/ua_restore.c:310 +#: src/dird/ua_restore.c:287 msgid "List Jobs where a given File is saved" msgstr "" -#: src/dird/ua_restore.c:311 +#: src/dird/ua_restore.c:288 msgid "Enter list of comma separated JobIds to select" msgstr "" -#: src/dird/ua_restore.c:312 +#: src/dird/ua_restore.c:289 msgid "Enter SQL list command" msgstr "" -#: src/dird/ua_restore.c:313 +#: src/dird/ua_restore.c:290 msgid "Select the most recent backup for a client" msgstr "" -#: src/dird/ua_restore.c:314 +#: src/dird/ua_restore.c:291 msgid "Select backup for a client before a specified time" msgstr "" -#: src/dird/ua_restore.c:315 +#: src/dird/ua_restore.c:292 msgid "Enter a list of files to restore" msgstr "" -#: src/dird/ua_restore.c:316 +#: src/dird/ua_restore.c:293 msgid "Enter a list of files to restore before a specified time" msgstr "" -#: src/dird/ua_restore.c:317 +#: src/dird/ua_restore.c:294 msgid "Find the JobIds of the most recent backup for a client" msgstr "" -#: src/dird/ua_restore.c:318 +#: src/dird/ua_restore.c:295 msgid "Find the JobIds for a backup for a client before a specified time" msgstr "" -#: src/dird/ua_restore.c:319 +#: src/dird/ua_restore.c:296 msgid "Enter a list of directories to restore for found JobIds" msgstr "" -#: src/dird/ua_restore.c:320 src/dird/ua_status.c:702 src/filed/status.c:249 -#: src/stored/status.c:367 src/wx-console/wxbconfigpanel.cpp:191 +#: src/dird/ua_restore.c:297 src/dird/ua_status.c:713 src/filed/status.c:251 +#: src/stored/status.c:412 src/wx-console/wxbconfigpanel.cpp:191 msgid "Cancel" msgstr "" -#: src/dird/ua_restore.c:356 +#: src/dird/ua_restore.c:333 #, c-format msgid "Unknown keyword: %s\n" msgstr "" -#: src/dird/ua_restore.c:374 +#: src/dird/ua_restore.c:357 #, c-format msgid "Improper date format: %s\n" msgstr "" -#: src/dird/ua_restore.c:408 src/dird/ua_select.c:576 +#: src/dird/ua_restore.c:397 src/dird/ua_select.c:590 #, c-format msgid "Error: Pool resource \"%s\" does not exist.\n" msgstr "" -#: src/dird/ua_restore.c:413 +#: src/dird/ua_restore.c:402 #, c-format msgid "Error: Pool resource \"%s\" access not allowed.\n" msgstr "" -#: src/dird/ua_restore.c:432 +#: src/dird/ua_restore.c:421 msgid "" "\n" "First you select one or more JobIds that contain files\n" @@ -3395,217 +3444,226 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_restore.c:444 +#: src/dird/ua_restore.c:433 msgid "To select the JobIds, you have the following choices:\n" msgstr "" -#: src/dird/ua_restore.c:449 +#: src/dird/ua_restore.c:438 msgid "Select item: " msgstr "" -#: src/dird/ua_restore.c:463 +#: src/dird/ua_restore.c:452 msgid "Enter Filename (no path):" msgstr "" -#: src/dird/ua_restore.c:478 src/dird/ua_restore.c:578 +#: src/dird/ua_restore.c:467 src/dird/ua_restore.c:567 msgid "Enter JobId(s), comma separated, to restore: " msgstr "" -#: src/dird/ua_restore.c:484 +#: src/dird/ua_restore.c:473 msgid "Enter SQL list command: " msgstr "" -#: src/dird/ua_restore.c:512 src/dird/ua_restore.c:537 +#: src/dird/ua_restore.c:501 src/dird/ua_restore.c:526 msgid "" "Enter file names with paths, or < to enter a filename\n" "containg a list of file names with paths, and terminate\n" "them with a blank line.\n" msgstr "" -#: src/dird/ua_restore.c:516 src/dird/ua_restore.c:541 +#: src/dird/ua_restore.c:505 src/dird/ua_restore.c:530 msgid "Enter full filename: " msgstr "" -#: src/dird/ua_restore.c:576 +#: src/dird/ua_restore.c:565 #, c-format msgid "You have already seleted the following JobIds: %s\n" msgstr "" -#: src/dird/ua_restore.c:591 +#: src/dird/ua_restore.c:580 msgid "" "Enter full directory names or start the name\n" "with a < to indicate it is a filename containg a list\n" "of directories and terminate them with a blank line.\n" msgstr "" -#: src/dird/ua_restore.c:595 +#: src/dird/ua_restore.c:584 msgid "Enter directory name: " msgstr "" -#: src/dird/ua_restore.c:620 +#: src/dird/ua_restore.c:609 msgid "No Jobs selected.\n" msgstr "" -#: src/dird/ua_restore.c:624 +#: src/dird/ua_restore.c:613 #, c-format msgid "You have selected the following JobIds: %s\n" msgstr "" -#: src/dird/ua_restore.c:627 +#: src/dird/ua_restore.c:616 #, c-format msgid "You have selected the following JobId: %s\n" msgstr "" -#: src/dird/ua_restore.c:636 +#: src/dird/ua_restore.c:624 msgid "Invalid JobId in list.\n" msgstr "" -#: src/dird/ua_restore.c:648 +#: src/dird/ua_restore.c:637 #, c-format msgid "Unable to get Job record for JobId=%s: ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:653 +#: src/dird/ua_restore.c:642 #, c-format msgid "No authorization. Job \"%s\" not selected.\n" msgstr "" -#: src/dird/ua_restore.c:667 +#: src/dird/ua_restore.c:656 msgid "" "The restored files will the most current backup\n" "BEFORE the date you specify below.\n" "\n" msgstr "" -#: src/dird/ua_restore.c:670 +#: src/dird/ua_restore.c:659 msgid "Enter date as YYYY-MM-DD HH:MM:SS :" msgstr "" -#: src/dird/ua_restore.c:676 +#: src/dird/ua_restore.c:665 msgid "Improper date format.\n" msgstr "" -#: src/dird/ua_restore.c:697 +#: src/dird/ua_restore.c:686 #, c-format msgid "Cannot open file %s: ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:705 src/dird/ua_restore.c:709 +#: src/dird/ua_restore.c:694 src/dird/ua_restore.c:698 #, c-format msgid "Error occurred on line %d of %s\n" msgstr "" -#: src/dird/ua_restore.c:751 src/dird/ua_restore.c:789 +#: src/dird/ua_restore.c:744 src/dird/ua_restore.c:782 #, c-format msgid "No database record found for: %s\n" msgstr "" -#: src/dird/ua_restore.c:776 +#: src/dird/ua_restore.c:769 msgid "No JobId specified cannot continue.\n" msgstr "" -#: src/dird/ua_restore.c:895 +#: src/dird/ua_restore.c:813 +#, c-format +msgid "No table found: %s\n" +msgstr "" + +#: src/dird/ua_restore.c:918 #, c-format msgid "" "\n" "Building directory tree for JobId %s ... " msgstr "" -#: src/dird/ua_restore.c:914 +#: src/dird/ua_restore.c:937 msgid "" "\n" "There were no files inserted into the tree, so file selection\n" "is not possible.Most likely your retention policy pruned the files\n" msgstr "" -#: src/dird/ua_restore.c:916 +#: src/dird/ua_restore.c:939 msgid "" "\n" "Do you want to restore all the files? (yes|no): " msgstr "" -#: src/dird/ua_restore.c:932 +#: src/dird/ua_restore.c:955 #, c-format msgid "" "\n" "1 Job, %s files inserted into the tree and marked for extraction.\n" msgstr "" -#: src/dird/ua_restore.c:936 +#: src/dird/ua_restore.c:959 #, c-format msgid "" "\n" "1 Job, %s files inserted into the tree.\n" msgstr "" -#: src/dird/ua_restore.c:942 +#: src/dird/ua_restore.c:965 #, c-format msgid "" "\n" "%d Jobs, %s files inserted into the tree and marked for extraction.\n" msgstr "" -#: src/dird/ua_restore.c:946 +#: src/dird/ua_restore.c:969 #, c-format msgid "" "\n" "%d Jobs, %s files inserted into the tree.\n" msgstr "" -#: src/dird/ua_restore.c:1023 +#: src/dird/ua_restore.c:1046 #, c-format msgid "Error getting FileSet \"%s\": ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:1031 src/dird/ua_select.c:165 +#: src/dird/ua_restore.c:1054 src/dird/ua_select.c:167 msgid "The defined FileSet resources are:\n" msgstr "" -#: src/dird/ua_restore.c:1035 src/dird/ua_select.c:173 +#: src/dird/ua_restore.c:1058 src/dird/ua_run.c:644 src/dird/ua_select.c:175 +msgid "FileSet" +msgstr "" + +#: src/dird/ua_restore.c:1058 src/dird/ua_select.c:175 msgid "Select FileSet resource" msgstr "" -#: src/dird/ua_restore.c:1042 +#: src/dird/ua_restore.c:1065 #, c-format msgid "Error getting FileSet record: %s\n" msgstr "" -#: src/dird/ua_restore.c:1043 +#: src/dird/ua_restore.c:1066 msgid "" "This probably means you modified the FileSet.\n" "Continuing anyway.\n" msgstr "" -#: src/dird/ua_restore.c:1058 +#: src/dird/ua_restore.c:1081 #, c-format msgid "Pool \"%s\" not found, using any pool.\n" msgstr "" -#: src/dird/ua_restore.c:1084 src/dird/ua_restore.c:1100 +#: src/dird/ua_restore.c:1107 src/dird/ua_restore.c:1123 #, c-format msgid "No Full backup before %s found.\n" msgstr "" -#: src/dird/ua_restore.c:1123 +#: src/dird/ua_restore.c:1146 msgid "No jobs found.\n" msgstr "" -#: src/dird/ua_restore.c:1289 +#: src/dird/ua_restore.c:1312 msgid "" "Warning, the JobIds that you selected refer to more than one MediaType.\n" "Restore is not possible. The MediaTypes used are:\n" msgstr "" -#: src/dird/ua_restore.c:1297 +#: src/dird/ua_restore.c:1320 msgid "No MediaType found for your JobIds.\n" msgstr "" -#: src/dird/ua_restore.c:1329 +#: src/dird/ua_restore.c:1352 #, c-format msgid "Warning default storage overridden by %s on command line.\n" msgstr "" -#: src/dird/ua_restore.c:1340 +#: src/dird/ua_restore.c:1363 #, c-format msgid "" "\n" @@ -3760,7 +3818,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:507 src/lib/util.c:301 +#: src/dird/ua_run.c:507 src/lib/util.c:295 msgid "Admin" msgstr "" @@ -3778,7 +3836,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:528 src/lib/util.c:292 +#: src/dird/ua_run.c:528 src/lib/util.c:286 msgid "Backup" msgstr "" @@ -3797,7 +3855,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:554 src/lib/util.c:295 +#: src/dird/ua_run.c:554 src/lib/util.c:289 msgid "Verify" msgstr "" @@ -3850,7 +3908,7 @@ msgstr "" msgid "mod" msgstr "" -#: src/dird/ua_run.c:640 src/dird/ua_update.c:415 +#: src/dird/ua_run.c:640 src/dird/ua_update.c:464 msgid "Parameters to modify:\n" msgstr "" @@ -3858,40 +3916,79 @@ msgstr "" msgid "Level" msgstr "" -#: src/dird/ua_run.c:646 src/wx-console/wxbrestorepanel.cpp:380 -#: src/wx-console/wxbrestorepanel.cpp:808 -#: src/wx-console/wxbrestorepanel.cpp:1833 +#: src/dird/ua_run.c:642 src/dird/ua_select.c:152 +#: src/wx-console/wxbrestorepanel.cpp:321 +#: src/wx-console/wxbrestorepanel.cpp:337 +#: src/wx-console/wxbrestorepanel.cpp:458 +#: src/wx-console/wxbrestorepanel.cpp:459 +#: src/wx-console/wxbrestorepanel.cpp:469 +#: src/wx-console/wxbrestorepanel.cpp:470 +#: src/wx-console/wxbrestorepanel.cpp:1133 +#: src/wx-console/wxbrestorepanel.cpp:1794 +#: src/wx-console/wxbrestorepanel.cpp:1865 +msgid "Storage" +msgstr "" + +#: src/dird/ua_run.c:645 src/dird/ua_select.c:282 src/dird/ua_select.c:391 +#: src/wx-console/wxbrestorepanel.cpp:318 +#: src/wx-console/wxbrestorepanel.cpp:336 +#: src/wx-console/wxbrestorepanel.cpp:410 +#: src/wx-console/wxbrestorepanel.cpp:411 +#: src/wx-console/wxbrestorepanel.cpp:421 +#: src/wx-console/wxbrestorepanel.cpp:422 +#: src/wx-console/wxbrestorepanel.cpp:669 +#: src/wx-console/wxbrestorepanel.cpp:1103 +#: src/wx-console/wxbrestorepanel.cpp:1190 +#: src/wx-console/wxbrestorepanel.cpp:1787 +#: src/wx-console/wxbrestorepanel.cpp:1789 +#: src/wx-console/wxbrestorepanel.cpp:1863 +#: src/wx-console/wxbrestorepanel.cpp:1918 +msgid "Client" +msgstr "" + +#: src/dird/ua_run.c:646 src/wx-console/wxbrestorepanel.cpp:338 +#: src/wx-console/wxbrestorepanel.cpp:823 +#: src/wx-console/wxbrestorepanel.cpp:1867 msgid "When" msgstr "" -#: src/dird/ua_run.c:647 src/wx-console/wxbrestorepanel.cpp:381 -#: src/wx-console/wxbrestorepanel.cpp:1079 -#: src/wx-console/wxbrestorepanel.cpp:1835 +#: src/dird/ua_run.c:647 src/wx-console/wxbrestorepanel.cpp:339 +#: src/wx-console/wxbrestorepanel.cpp:1096 +#: src/wx-console/wxbrestorepanel.cpp:1869 msgid "Priority" msgstr "" +#: src/dird/ua_run.c:650 src/dird/ua_select.c:476 src/dird/ua_select.c:566 +#: src/dird/ua_update.c:400 src/dird/ua_update.c:475 +#: src/wx-console/wxbrestorepanel.cpp:320 +#: src/wx-console/wxbrestorepanel.cpp:506 +#: src/wx-console/wxbrestorepanel.cpp:516 +#: src/wx-console/wxbrestorepanel.cpp:1783 +msgid "Pool" +msgstr "" + #: src/dird/ua_run.c:652 msgid "Verify Job" msgstr "" -#: src/dird/ua_run.c:655 src/wx-console/wxbrestorepanel.cpp:373 -#: src/wx-console/wxbrestorepanel.cpp:1814 +#: src/dird/ua_run.c:655 src/wx-console/wxbrestorepanel.cpp:331 +#: src/wx-console/wxbrestorepanel.cpp:1848 msgid "Bootstrap" msgstr "" -#: src/dird/ua_run.c:656 src/wx-console/wxbrestorepanel.cpp:374 -#: src/wx-console/wxbrestorepanel.cpp:1055 -#: src/wx-console/wxbrestorepanel.cpp:1816 +#: src/dird/ua_run.c:656 src/wx-console/wxbrestorepanel.cpp:332 +#: src/wx-console/wxbrestorepanel.cpp:1072 +#: src/wx-console/wxbrestorepanel.cpp:1850 msgid "Where" msgstr "" -#: src/dird/ua_run.c:657 src/wx-console/wxbrestorepanel.cpp:376 -#: src/wx-console/wxbrestorepanel.cpp:1063 -#: src/wx-console/wxbrestorepanel.cpp:1820 -#: src/wx-console/wxbrestorepanel.cpp:1821 -#: src/wx-console/wxbrestorepanel.cpp:1822 -#: src/wx-console/wxbrestorepanel.cpp:1823 -#: src/wx-console/wxbrestorepanel.cpp:1824 +#: src/dird/ua_run.c:657 src/wx-console/wxbrestorepanel.cpp:334 +#: src/wx-console/wxbrestorepanel.cpp:1080 +#: src/wx-console/wxbrestorepanel.cpp:1854 +#: src/wx-console/wxbrestorepanel.cpp:1855 +#: src/wx-console/wxbrestorepanel.cpp:1856 +#: src/wx-console/wxbrestorepanel.cpp:1857 +#: src/wx-console/wxbrestorepanel.cpp:1858 msgid "Replace" msgstr "" @@ -3899,7 +3996,7 @@ msgstr "" msgid "JobId" msgstr "" -#: src/dird/ua_run.c:660 src/dird/ua_update.c:430 +#: src/dird/ua_run.c:660 src/dird/ua_update.c:479 msgid "Select parameter to modify" msgstr "" @@ -3908,27 +4005,27 @@ msgid "Levels:\n" msgstr "" #: src/dird/ua_run.c:665 src/filed/status.c:368 src/lib/util.c:319 -#: src/stored/status.c:406 +#: src/stored/status.c:451 msgid "Base" msgstr "" -#: src/dird/ua_run.c:666 src/dird/ua_update.c:106 src/dird/ua_update.c:438 -#: src/filed/status.c:370 src/lib/util.c:321 src/stored/status.c:408 +#: src/dird/ua_run.c:666 src/filed/status.c:370 src/lib/util.c:321 +#: src/stored/status.c:453 msgid "Full" msgstr "" #: src/dird/ua_run.c:667 src/filed/status.c:373 src/lib/util.c:324 -#: src/stored/status.c:411 +#: src/stored/status.c:456 msgid "Incremental" msgstr "" #: src/dird/ua_run.c:668 src/filed/status.c:376 src/lib/util.c:327 -#: src/stored/status.c:414 +#: src/stored/status.c:459 msgid "Differential" msgstr "" #: src/dird/ua_run.c:669 src/filed/status.c:379 src/lib/util.c:330 -#: src/stored/status.c:417 +#: src/stored/status.c:462 msgid "Since" msgstr "" @@ -3941,7 +4038,7 @@ msgid "Initialize Catalog" msgstr "" #: src/dird/ua_run.c:693 src/filed/status.c:382 src/lib/util.c:333 -#: src/stored/status.c:420 +#: src/stored/status.c:465 msgid "Verify Catalog" msgstr "" @@ -4000,16 +4097,16 @@ msgid "" "You must set the bootstrap file to NULL to be able to specify a JobId.\n" msgstr "" -#: src/dird/ua_run.c:867 +#: src/dird/ua_run.c:869 msgid "Job failed.\n" msgstr "" -#: src/dird/ua_run.c:870 +#: src/dird/ua_run.c:872 #, c-format msgid "Job started. JobId=%s\n" msgstr "" -#: src/dird/ua_run.c:876 +#: src/dird/ua_run.c:878 msgid "Job not run.\n" msgstr "" @@ -4042,199 +4139,199 @@ msgstr "" msgid "Select Storage resource" msgstr "" -#: src/dird/ua_select.c:189 +#: src/dird/ua_select.c:193 msgid "catalog" msgstr "" -#: src/dird/ua_select.c:197 +#: src/dird/ua_select.c:201 msgid "The defined Catalog resources are:\n" msgstr "" -#: src/dird/ua_select.c:205 +#: src/dird/ua_select.c:209 msgid "Catalog" msgstr "" -#: src/dird/ua_select.c:205 +#: src/dird/ua_select.c:209 msgid "Select Catalog resource" msgstr "" -#: src/dird/ua_select.c:220 +#: src/dird/ua_select.c:226 msgid "The defined Job resources are:\n" msgstr "" -#: src/dird/ua_select.c:228 +#: src/dird/ua_select.c:234 msgid "Select Job resource" msgstr "" -#: src/dird/ua_select.c:241 +#: src/dird/ua_select.c:249 msgid "The defined Restore Job resources are:\n" msgstr "" -#: src/dird/ua_select.c:249 +#: src/dird/ua_select.c:257 msgid "Select Restore Job" msgstr "" -#: src/dird/ua_select.c:264 +#: src/dird/ua_select.c:274 msgid "The defined Client resources are:\n" msgstr "" -#: src/dird/ua_select.c:272 +#: src/dird/ua_select.c:282 msgid "Select Client (File daemon) resource" msgstr "" -#: src/dird/ua_select.c:297 +#: src/dird/ua_select.c:309 #, c-format msgid "Error: Client resource %s does not exist.\n" msgstr "" -#: src/dird/ua_select.c:322 +#: src/dird/ua_select.c:334 #, c-format msgid "Could not find Client %s: ERR=%s" msgstr "" -#: src/dird/ua_select.c:325 src/lib/bnet_server.c:285 -#: src/lib/bnet_server.c:379 +#: src/dird/ua_select.c:337 src/lib/bnet_server.c:284 +#: src/lib/bnet_server.c:378 msgid "client" msgstr "" -#: src/dird/ua_select.c:326 +#: src/dird/ua_select.c:338 msgid "fd" msgstr "" -#: src/dird/ua_select.c:332 src/dird/ua_select.c:386 +#: src/dird/ua_select.c:344 src/dird/ua_select.c:398 #, c-format msgid "Could not find Client \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:361 +#: src/dird/ua_select.c:373 #, c-format msgid "Error obtaining client ids. ERR=%s\n" msgstr "" -#: src/dird/ua_select.c:365 +#: src/dird/ua_select.c:377 msgid "No clients defined. You must run a job before using this command.\n" msgstr "" -#: src/dird/ua_select.c:369 +#: src/dird/ua_select.c:381 msgid "Defined Clients:\n" msgstr "" -#: src/dird/ua_select.c:379 +#: src/dird/ua_select.c:391 msgid "Select the Client" msgstr "" -#: src/dird/ua_select.c:412 src/dird/ua_select.c:435 src/dird/ua_select.c:471 +#: src/dird/ua_select.c:424 src/dird/ua_select.c:447 src/dird/ua_select.c:483 #, c-format msgid "Could not find Pool \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:450 +#: src/dird/ua_select.c:462 msgid "No pools defined. Use the \"create\" command to create one.\n" msgstr "" -#: src/dird/ua_select.c:454 +#: src/dird/ua_select.c:466 msgid "Defined Pools:\n" msgstr "" -#: src/dird/ua_select.c:464 +#: src/dird/ua_select.c:476 msgid "Select the Pool" msgstr "" -#: src/dird/ua_select.c:494 +#: src/dird/ua_select.c:506 #, c-format msgid "No access to Pool \"%s\"\n" msgstr "" -#: src/dird/ua_select.c:520 +#: src/dird/ua_select.c:532 msgid "Enter MediaId or Volume name: " msgstr "" -#: src/dird/ua_select.c:546 +#: src/dird/ua_select.c:558 msgid "The defined Pool resources are:\n" msgstr "" -#: src/dird/ua_select.c:554 +#: src/dird/ua_select.c:566 msgid "Select Pool resource" msgstr "" -#: src/dird/ua_select.c:587 +#: src/dird/ua_select.c:601 msgid "Enter the JobId to select: " msgstr "" -#: src/dird/ua_select.c:624 +#: src/dird/ua_select.c:638 #, c-format msgid "Could not find Job \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:687 +#: src/dird/ua_select.c:705 #, c-format msgid "Automatically selected %s: %s\n" msgstr "" -#: src/dird/ua_select.c:692 +#: src/dird/ua_select.c:710 #, c-format msgid "Cannot select %s in batch mode.\n" msgstr "" -#: src/dird/ua_select.c:708 +#: src/dird/ua_select.c:722 msgid "Selection is empty!\n" msgstr "" -#: src/dird/ua_select.c:714 +#: src/dird/ua_select.c:728 msgid "Item 1 selected automatically.\n" msgstr "" -#: src/dird/ua_select.c:725 +#: src/dird/ua_select.c:739 msgid "Selection aborted, nothing done.\n" msgstr "" -#: src/dird/ua_select.c:730 +#: src/dird/ua_select.c:744 #, c-format msgid "Please enter a number between 1 and %d\n" msgstr "" -#: src/dird/ua_select.c:778 +#: src/dird/ua_select.c:793 msgid "Storage name given twice.\n" msgstr "" -#: src/dird/ua_select.c:795 +#: src/dird/ua_select.c:810 #, c-format msgid "Expecting jobid=nn command, got: %s\n" msgstr "" -#: src/dird/ua_select.c:799 +#: src/dird/ua_select.c:814 #, c-format msgid "JobId %s is not running.\n" msgstr "" -#: src/dird/ua_select.c:808 +#: src/dird/ua_select.c:823 #, c-format msgid "Expecting job=xxx, got: %s.\n" msgstr "" -#: src/dird/ua_select.c:812 +#: src/dird/ua_select.c:827 #, c-format msgid "Job \"%s\" is not running.\n" msgstr "" -#: src/dird/ua_select.c:828 +#: src/dird/ua_select.c:843 #, c-format msgid "Storage resource \"%s\": not found\n" msgstr "" -#: src/dird/ua_select.c:850 +#: src/dird/ua_select.c:875 msgid "Enter autochanger drive[0]: " msgstr "" -#: src/dird/ua_select.c:879 +#: src/dird/ua_select.c:905 msgid "Media Types defined in conf file:\n" msgstr "" -#: src/dird/ua_select.c:885 +#: src/dird/ua_select.c:911 msgid "Media Type" msgstr "" -#: src/dird/ua_select.c:885 +#: src/dird/ua_select.c:911 msgid "Select the Media Type" msgstr "" @@ -4260,24 +4357,24 @@ msgstr "" msgid "%s Version: %s (%s) %s %s %s\n" msgstr "" -#: src/dird/ua_status.c:249 src/stored/status.c:70 +#: src/dird/ua_status.c:249 src/stored/status.c:71 #, c-format msgid "Daemon started %s, 1 Job run since started.\n" msgstr "" -#: src/dird/ua_status.c:252 src/stored/status.c:73 +#: src/dird/ua_status.c:252 src/stored/status.c:74 #, c-format msgid "Daemon started %s, %d Jobs run since started.\n" msgstr "" -#: src/dird/ua_status.c:257 src/filed/status.c:119 src/stored/status.c:77 +#: src/dird/ua_status.c:257 src/filed/status.c:121 src/stored/status.c:78 #, c-format msgid " Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n" msgstr "" -#: src/dird/ua_status.c:277 src/dird/ua_status.c:482 src/dird/ua_status.c:644 -#: src/filed/status.c:196 src/filed/status.c:275 src/stored/status.c:317 -#: src/stored/status.c:393 +#: src/dird/ua_status.c:277 src/dird/ua_status.c:493 src/dird/ua_status.c:655 +#: src/filed/status.c:198 src/filed/status.c:277 src/stored/status.c:345 +#: src/stored/status.c:361 src/stored/status.c:438 msgid "====\n" msgstr "" @@ -4320,244 +4417,244 @@ msgstr "" msgid "%-14s %-8s %3d %-18s %-18s %s\n" msgstr "" -#: src/dird/ua_status.c:480 +#: src/dird/ua_status.c:491 msgid "No Scheduled Jobs.\n" msgstr "" -#: src/dird/ua_status.c:497 src/stored/status.c:269 +#: src/dird/ua_status.c:508 src/stored/status.c:277 msgid "" "\n" "Running Jobs:\n" msgstr "" -#: src/dird/ua_status.c:506 +#: src/dird/ua_status.c:516 #, c-format msgid "Console connected at %s\n" msgstr "" -#: src/dird/ua_status.c:514 +#: src/dird/ua_status.c:526 msgid "" "No Jobs running.\n" "====\n" msgstr "" -#: src/dird/ua_status.c:519 +#: src/dird/ua_status.c:531 msgid " JobId Level Name Status\n" msgstr "" -#: src/dird/ua_status.c:520 src/filed/status.c:219 src/stored/status.c:337 +#: src/dird/ua_status.c:532 src/filed/status.c:221 src/stored/status.c:382 msgid "======================================================================\n" msgstr "" -#: src/dird/ua_status.c:529 +#: src/dird/ua_status.c:540 msgid "is waiting execution" msgstr "" -#: src/dird/ua_status.c:532 +#: src/dird/ua_status.c:543 msgid "is running" msgstr "" -#: src/dird/ua_status.c:535 +#: src/dird/ua_status.c:546 msgid "is blocked" msgstr "" -#: src/dird/ua_status.c:538 +#: src/dird/ua_status.c:549 msgid "has terminated" msgstr "" -#: src/dird/ua_status.c:541 +#: src/dird/ua_status.c:552 msgid "has erred" msgstr "" -#: src/dird/ua_status.c:544 +#: src/dird/ua_status.c:555 msgid "has errors" msgstr "" -#: src/dird/ua_status.c:547 +#: src/dird/ua_status.c:558 msgid "has a fatal error" msgstr "" -#: src/dird/ua_status.c:550 +#: src/dird/ua_status.c:561 msgid "has verify differences" msgstr "" -#: src/dird/ua_status.c:553 +#: src/dird/ua_status.c:564 msgid "has been canceled" msgstr "" -#: src/dird/ua_status.c:557 +#: src/dird/ua_status.c:568 #, c-format msgid "is waiting on Client %s" msgstr "" -#: src/dird/ua_status.c:563 +#: src/dird/ua_status.c:574 #, c-format msgid "is waiting on Storage %s" msgstr "" -#: src/dird/ua_status.c:568 +#: src/dird/ua_status.c:579 msgid "is waiting on max Storage jobs" msgstr "" -#: src/dird/ua_status.c:571 +#: src/dird/ua_status.c:582 msgid "is waiting on max Client jobs" msgstr "" -#: src/dird/ua_status.c:574 +#: src/dird/ua_status.c:585 msgid "is waiting on max Job jobs" msgstr "" -#: src/dird/ua_status.c:577 +#: src/dird/ua_status.c:588 msgid "is waiting on max total jobs" msgstr "" -#: src/dird/ua_status.c:580 +#: src/dird/ua_status.c:591 msgid "is waiting for its start time" msgstr "" -#: src/dird/ua_status.c:583 +#: src/dird/ua_status.c:594 msgid "is waiting for higher priority jobs to finish" msgstr "" -#: src/dird/ua_status.c:588 +#: src/dird/ua_status.c:599 #, c-format msgid "is in unknown state %c" msgstr "" -#: src/dird/ua_status.c:602 +#: src/dird/ua_status.c:613 msgid "is waiting for a mount request" msgstr "" -#: src/dird/ua_status.c:609 +#: src/dird/ua_status.c:620 msgid "is waiting for an appendable Volume" msgstr "" -#: src/dird/ua_status.c:616 +#: src/dird/ua_status.c:627 #, c-format msgid "is waiting for Client %s to connect to Storage %s" msgstr "" -#: src/dird/ua_status.c:632 +#: src/dird/ua_status.c:643 #, c-format msgid "%6d %-6s %-20s %s\n" msgstr "" -#: src/dird/ua_status.c:654 src/filed/status.c:209 src/stored/status.c:328 +#: src/dird/ua_status.c:665 src/filed/status.c:211 src/stored/status.c:373 msgid "No Terminated Jobs.\n" msgstr "" -#: src/dird/ua_status.c:659 src/stored/status.c:333 +#: src/dird/ua_status.c:670 src/stored/status.c:378 msgid "" "\n" "Terminated Jobs:\n" msgstr "" -#: src/dird/ua_status.c:660 +#: src/dird/ua_status.c:671 msgid " JobId Level Files Bytes Status Finished Name \n" msgstr "" -#: src/dird/ua_status.c:661 +#: src/dird/ua_status.c:672 msgid "========================================================================\n" msgstr "" -#: src/dird/ua_status.c:692 src/filed/status.c:239 src/lib/util.c:184 -#: src/stored/status.c:357 +#: src/dird/ua_status.c:703 src/filed/status.c:241 src/lib/util.c:178 +#: src/stored/status.c:402 msgid "Created" msgstr "" -#: src/dird/ua_status.c:696 src/filed/status.c:243 src/lib/util.c:197 -#: src/lib/util.c:264 src/stored/status.c:361 +#: src/dird/ua_status.c:707 src/filed/status.c:245 src/lib/util.c:191 +#: src/lib/util.c:258 src/stored/status.c:406 msgid "Error" msgstr "" -#: src/dird/ua_status.c:699 src/filed/status.c:246 src/stored/status.c:364 +#: src/dird/ua_status.c:710 src/filed/status.c:248 src/stored/status.c:409 msgid "Diffs" msgstr "" -#: src/dird/ua_status.c:705 src/filed/status.c:252 src/lib/util.c:193 -#: src/lib/util.c:260 src/stored/btape.c:1160 src/stored/status.c:370 +#: src/dird/ua_status.c:716 src/filed/status.c:254 src/lib/util.c:187 +#: src/lib/util.c:254 src/stored/btape.c:1158 src/stored/status.c:415 #: src/wx-console/wxbconfigpanel.cpp:180 msgid "OK" msgstr "" -#: src/dird/ua_status.c:708 src/filed/status.c:255 src/stored/status.c:373 +#: src/dird/ua_status.c:719 src/filed/status.c:257 src/stored/status.c:418 msgid "Other" msgstr "" -#: src/dird/ua_status.c:711 src/filed/status.c:266 src/stored/status.c:384 +#: src/dird/ua_status.c:722 src/filed/status.c:268 src/stored/status.c:429 #, c-format msgid "%6d %-6s %8s %14s %-7s %-8s %s\n" msgstr "" -#: src/dird/ua_status.c:719 src/stored/btape.c:180 +#: src/dird/ua_status.c:730 src/stored/btape.c:180 msgid "\n" msgstr "" -#: src/dird/ua_tree.c:57 +#: src/dird/ua_tree.c:58 msgid "change current directory" msgstr "" -#: src/dird/ua_tree.c:58 +#: src/dird/ua_tree.c:59 msgid "count marked files in and below the cd" msgstr "" -#: src/dird/ua_tree.c:59 +#: src/dird/ua_tree.c:60 src/dird/ua_tree.c:61 msgid "long list current directory, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:60 +#: src/dird/ua_tree.c:62 msgid "leave file selection mode" msgstr "" -#: src/dird/ua_tree.c:61 +#: src/dird/ua_tree.c:63 msgid "estimate restore size" msgstr "" -#: src/dird/ua_tree.c:62 +#: src/dird/ua_tree.c:64 msgid "same as done command" msgstr "" -#: src/dird/ua_tree.c:63 +#: src/dird/ua_tree.c:65 msgid "find files, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:64 src/dird/ua_tree.c:73 +#: src/dird/ua_tree.c:66 src/dird/ua_tree.c:75 msgid "print help" msgstr "" -#: src/dird/ua_tree.c:65 +#: src/dird/ua_tree.c:67 msgid "list current directory, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:66 +#: src/dird/ua_tree.c:68 msgid "list the marked files in and below the cd" msgstr "" -#: src/dird/ua_tree.c:67 -msgid "mark dir/file to be restored recursively in dirs" +#: src/dird/ua_tree.c:69 +msgid "mark dir/file to be restored recursively, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:68 +#: src/dird/ua_tree.c:70 msgid "mark directory name to be restored (no files)" msgstr "" -#: src/dird/ua_tree.c:69 +#: src/dird/ua_tree.c:71 msgid "print current working directory" msgstr "" -#: src/dird/ua_tree.c:70 +#: src/dird/ua_tree.c:72 msgid "unmark dir/file to be restored recursively in dir" msgstr "" -#: src/dird/ua_tree.c:71 +#: src/dird/ua_tree.c:73 msgid "unmark directory name only no recursion" msgstr "" -#: src/dird/ua_tree.c:72 +#: src/dird/ua_tree.c:74 msgid "quit and do not do restore" msgstr "" -#: src/dird/ua_tree.c:92 +#: src/dird/ua_tree.c:94 msgid "" "\n" "You are now entering file selection mode where you add (mark) and\n" @@ -4567,286 +4664,90 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_tree.c:102 src/dird/ua_tree.c:633 src/dird/ua_tree.c:641 +#: src/dird/ua_tree.c:104 src/dird/ua_tree.c:664 src/dird/ua_tree.c:672 #, c-format msgid "cwd is: %s\n" msgstr "" -#: src/dird/ua_tree.c:123 +#: src/dird/ua_tree.c:125 msgid "Illegal command. Enter \"done\" to exit.\n" msgstr "" -#: src/dird/ua_tree.c:296 src/dird/ua_tree.c:307 src/dird/ua_tree.c:324 +#: src/dird/ua_tree.c:298 src/dird/ua_tree.c:309 src/dird/ua_tree.c:326 msgid "No files marked.\n" msgstr "" -#: src/dird/ua_tree.c:309 +#: src/dird/ua_tree.c:311 msgid "1 file marked.\n" msgstr "" -#: src/dird/ua_tree.c:311 +#: src/dird/ua_tree.c:313 #, c-format msgid "%s files marked.\n" msgstr "" -#: src/dird/ua_tree.c:338 +#: src/dird/ua_tree.c:340 msgid "No directories marked.\n" msgstr "" -#: src/dird/ua_tree.c:340 +#: src/dird/ua_tree.c:342 msgid "1 directory marked.\n" msgstr "" -#: src/dird/ua_tree.c:342 +#: src/dird/ua_tree.c:344 #, c-format msgid "%s directories marked.\n" msgstr "" -#: src/dird/ua_tree.c:363 +#: src/dird/ua_tree.c:365 #, c-format msgid "%s total files/dirs. %s marked to be restored.\n" msgstr "" -#: src/dird/ua_tree.c:374 +#: src/dird/ua_tree.c:376 msgid "No file specification given.\n" msgstr "" -#: src/dird/ua_tree.c:502 +#: src/dird/ua_tree.c:520 #, c-format msgid "Node %s has no children.\n" msgstr "" -#: src/dird/ua_tree.c:583 +#: src/dird/ua_tree.c:611 #, c-format msgid "%d total files; %d marked to be restored; %s bytes.\n" msgstr "" -#: src/dird/ua_tree.c:625 +#: src/dird/ua_tree.c:656 msgid "Invalid path given.\n" msgstr "" -#: src/dird/ua_tree.c:652 src/dird/ua_tree.c:663 +#: src/dird/ua_tree.c:683 src/dird/ua_tree.c:694 msgid "No files unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:665 +#: src/dird/ua_tree.c:696 msgid "1 file unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:667 +#: src/dird/ua_tree.c:698 #, c-format msgid "%d files unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:678 src/dird/ua_tree.c:694 +#: src/dird/ua_tree.c:709 src/dird/ua_tree.c:725 msgid "No directories unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:696 +#: src/dird/ua_tree.c:727 msgid "1 directory unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:698 +#: src/dird/ua_tree.c:729 #, c-format msgid "%d directories unmarked.\n" msgstr "" -#: src/dird/verify.c:87 -msgid "" -"Unable to find JobId of previous InitCatalog Job.\n" -"Please run a Verify with Level=InitCatalog before\n" -"running the current Job.\n" -msgstr "" - -#: src/dird/verify.c:108 -#, c-format -msgid "Could not get job record for previous Job. ERR=%s" -msgstr "" - -#: src/dird/verify.c:113 -#, c-format -msgid "Last Job %d did not terminate normally. JobStatus=%c\n" -msgstr "" - -#: src/dird/verify.c:117 -#, c-format -msgid "Verifying against JobId=%d Job=%s\n" -msgstr "" - -#: src/dird/verify.c:183 -#, c-format -msgid "Start Verify JobId=%d Level=%s Job=%s\n" -msgstr "" - -#: src/dird/verify.c:262 -msgid "Deprecated feature ... use bootstrap.\n" -msgstr "" - -#: src/dird/verify.c:275 -#, c-format -msgid "Unimplemented Verify level %d(%c)\n" -msgstr "" - -#: src/dird/verify.c:327 -#, c-format -msgid "Unimplemented verify level %d\n" -msgstr "" - -#: src/dird/verify.c:382 -msgid "Verify OK" -msgstr "" - -#: src/dird/verify.c:386 -msgid "*** Verify Error ***" -msgstr "" - -#: src/dird/verify.c:390 -msgid "Verify warnings" -msgstr "" - -#: src/dird/verify.c:393 -msgid "Verify Canceled" -msgstr "" - -#: src/dird/verify.c:396 -msgid "Verify Differences" -msgstr "" - -#: src/dird/verify.c:401 -#, c-format -msgid "Inappropriate term code: %d %c\n" -msgstr "" - -#: src/dird/verify.c:415 -#, c-format -msgid "" -"Bacula %s (%s): %s\n" -" JobId: %d\n" -" Job: %s\n" -" FileSet: %s\n" -" Verify Level: %s\n" -" Client: %s\n" -" Verify JobId: %d\n" -" Verify Job: %s\n" -" Start time: %s\n" -" End time: %s\n" -" Files Expected: %s\n" -" Files Examined: %s\n" -" Non-fatal FD errors: %d\n" -" FD termination status: %s\n" -" SD termination status: %s\n" -" Termination: %s\n" -"\n" -msgstr "" - -#: src/dird/verify.c:450 -#, c-format -msgid "" -"Bacula %s (%s): %s\n" -" JobId: %d\n" -" Job: %s\n" -" FileSet: %s\n" -" Verify Level: %s\n" -" Client: %s\n" -" Verify JobId: %d\n" -" Verify Job: %s\n" -" Start time: %s\n" -" End time: %s\n" -" Files Examined: %s\n" -" Non-fatal FD errors: %d\n" -" FD termination status: %s\n" -" Termination: %s\n" -"\n" -msgstr "" - -#: src/dird/verify.c:526 -#, c-format -msgid "" -"birdqnext->qprev != qp called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:185 +#: src/lib/smartall.c:180 #, c-format msgid "qp->qprev->qnext != qp called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:194 +#: src/lib/smartall.c:189 #, c-format msgid "Buffer overrun called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:265 +#: src/lib/smartall.c:260 #, c-format msgid "sm_realloc size: %d\n" msgstr "" -#: src/lib/smartall.c:306 +#: src/lib/smartall.c:301 #, c-format msgid "sm_realloc %d at %x from %s:%d\n" msgstr "" -#: src/lib/smartall.c:368 +#: src/lib/smartall.c:363 #, c-format msgid "" "\n" @@ -7894,125 +8081,133 @@ msgid "" " Buffer address with bad links: %lx\n" msgstr "" -#: src/lib/smartall.c:379 +#: src/lib/smartall.c:374 #, c-format msgid "Orphaned buffer: %6u bytes allocated at line %d of %s %s\n" msgstr "" -#: src/lib/smartall.c:415 +#: src/lib/smartall.c:410 #, c-format msgid "Damaged buffer found. Called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:445 +#: src/lib/smartall.c:440 #, c-format msgid "" "\n" "Damaged buffers found at %s:%d\n" msgstr "" -#: src/lib/smartall.c:448 +#: src/lib/smartall.c:443 #, c-format msgid " discovery of bad prev link.\n" msgstr "" -#: src/lib/smartall.c:451 +#: src/lib/smartall.c:446 #, c-format msgid " discovery of bad next link.\n" msgstr "" -#: src/lib/smartall.c:454 +#: src/lib/smartall.c:449 #, c-format msgid " discovery of data overrun.\n" msgstr "" -#: src/lib/smartall.c:457 +#: src/lib/smartall.c:452 #, c-format msgid " Buffer address: %lx\n" msgstr "" -#: src/lib/smartall.c:464 +#: src/lib/smartall.c:459 #, c-format msgid "Damaged buffer: %6u bytes allocated at line %d of %s %s\n" msgstr "" -#: src/lib/util.c:187 +#: src/lib/util.c:181 msgid "Running" msgstr "" -#: src/lib/util.c:190 +#: src/lib/util.c:184 msgid "Blocked" msgstr "" -#: src/lib/util.c:200 +#: src/lib/util.c:194 msgid "Non-fatal error" msgstr "" -#: src/lib/util.c:203 src/lib/util.c:270 +#: src/lib/util.c:197 src/lib/util.c:264 msgid "Canceled" msgstr "" -#: src/lib/util.c:206 +#: src/lib/util.c:200 msgid "Verify differences" msgstr "" -#: src/lib/util.c:209 +#: src/lib/util.c:203 msgid "Waiting on FD" msgstr "" -#: src/lib/util.c:212 +#: src/lib/util.c:206 msgid "Wait on SD" msgstr "" -#: src/lib/util.c:215 +#: src/lib/util.c:209 msgid "Wait for new Volume" msgstr "" -#: src/lib/util.c:218 +#: src/lib/util.c:212 msgid "Waiting for mount" msgstr "" -#: src/lib/util.c:221 +#: src/lib/util.c:215 msgid "Waiting for Storage resource" msgstr "" -#: src/lib/util.c:224 +#: src/lib/util.c:218 msgid "Waiting for Job resource" msgstr "" -#: src/lib/util.c:227 +#: src/lib/util.c:221 msgid "Waiting for Client resource" msgstr "" -#: src/lib/util.c:230 +#: src/lib/util.c:224 msgid "Waiting on Max Jobs" msgstr "" -#: src/lib/util.c:233 +#: src/lib/util.c:227 msgid "Waiting for Start Time" msgstr "" -#: src/lib/util.c:236 +#: src/lib/util.c:230 msgid "Waiting on Priority" msgstr "" -#: src/lib/util.c:243 +#: src/lib/util.c:237 #, c-format msgid "Unknown Job termination status=%d" msgstr "" -#: src/lib/util.c:267 +#: src/lib/util.c:261 msgid "Fatal Error" msgstr "" -#: src/lib/util.c:273 +#: src/lib/util.c:267 msgid "Differences" msgstr "" -#: src/lib/util.c:276 +#: src/lib/util.c:270 msgid "Unknown term code" msgstr "" +#: src/lib/util.c:298 +msgid "Migrate" +msgstr "" + +#: src/lib/util.c:301 +msgid "Copy" +msgstr "" + #: src/lib/util.c:304 msgid "Unknown Type" msgstr "" @@ -8260,278 +8455,214 @@ msgstr "" msgid "rwl_writeunlock failure. ERR=%s\n" msgstr "" -#: src/lib/pythonlib.c:108 -msgid "Could not initialize Python\n" -msgstr "" - -#: src/lib/pythonlib.c:113 +#: src/stored/acquire.c:96 #, c-format -msgid "Could not Run Python string %s\n" -msgstr "" - -#: src/lib/pythonlib.c:125 -msgid "Could not initialize Python Job type.\n" +msgid "Hey! num_writers=%d!!!!\n" msgstr "" -#: src/lib/pythonlib.c:130 +#: src/stored/acquire.c:146 #, c-format -msgid "Could not import Python script %s/%s. Python disabled.\n" +msgid "Num_writers=%d not zero. Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:230 -msgid "Could not create Python Job Object.\n" +#: src/stored/acquire.c:154 +#, c-format +msgid "No volumes specified. Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:243 src/lib/pythonlib.c:267 +#: src/stored/acquire.c:182 src/stored/mount.c:73 #, c-format -msgid "Python function \"%s\" not found.\n" +msgid "Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:282 +#: src/stored/acquire.c:193 #, c-format -msgid "Unknown Python daemon event %s\n" +msgid "Open device %s Volume \"%s\" failed (EIO): ERR=%s\n" msgstr "" -#: src/lib/res.c:66 +#: src/stored/acquire.c:198 #, c-format -msgid "rwl_writelock failure at %s:%d: ERR=%s\n" +msgid "Open device %s Volume \"%s\" failed: ERR=%s\n" msgstr "" -#: src/lib/res.c:76 +#: src/stored/acquire.c:263 src/stored/mount.c:67 #, c-format -msgid "rwl_writeunlock failure at %s:%d:. ERR=%s\n" +msgid "Too many errors trying to mount device %s.\n" msgstr "" -#: src/lib/tls.c:108 +#: src/stored/acquire.c:272 #, c-format -msgid "" -"Error with certificate at depth: %d, issuer = %s, subject = %s, ERR=%d:%s\n" +msgid "Ready to read from volume \"%s\" on device %s.\n" msgstr "" -#: src/lib/tls.c:155 -msgid "Error initializing SSL context" +#: src/stored/acquire.c:311 +#, c-format +msgid "Device %s is busy reading.\n" msgstr "" -#: src/lib/tls.c:176 -msgid "Error loading certificate verification stores" +#: src/stored/acquire.c:341 +#, c-format +msgid "Wanted Volume \"%s\", but device %s is busy writing on \"%s\" .\n" msgstr "" -#: src/lib/tls.c:181 +#: src/stored/acquire.c:360 +#, c-format msgid "" -"Either a certificate file or a directory must be specified as a verification " -"store\n" +"Cannot recycle volume \"%s\" on device %s because it is in use by another " +"job.\n" msgstr "" -#: src/lib/tls.c:192 -msgid "Error loading certificate file" +#: src/stored/acquire.c:382 +#, c-format +msgid "Could not ready device %s for append.\n" msgstr "" -#: src/lib/tls.c:200 -msgid "Error loading private key" +#: src/stored/acquire.c:459 src/stored/block.c:354 src/stored/block.c:677 +#: src/stored/block.c:746 +#, c-format +msgid "Could not create JobMedia record for Volume=\"%s\" Job=%s\n" msgstr "" -#: src/lib/tls.c:208 -msgid "Unable to open DH parameters file" +#: src/stored/acquire.c:501 +#, c-format +msgid "Alert: %s" msgstr "" -#: src/lib/tls.c:214 -msgid "Unable to load DH parameters from specified file" +#: src/stored/acquire.c:509 +#, c-format +msgid "3997 Bad alert command: %s: ERR=%s.\n" msgstr "" -#: src/lib/tls.c:218 -msgid "Failed to set TLS Diffie-Hellman parameters" +#: src/stored/ansi_label.c:83 +#, c-format +msgid "Read error on device %s in ANSI label. ERR=%s\n" msgstr "" -#: src/lib/tls.c:227 -msgid "Error setting cipher list, no valid ciphers available\n" +#: src/stored/ansi_label.c:93 +msgid "Insane! End of tape while reading ANSI label.\n" msgstr "" -#: src/lib/tls.c:275 -msgid "Peer failed to present a TLS certificate\n" +#: src/stored/ansi_label.c:117 +msgid "No VOL1 label while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:317 +#: src/stored/ansi_label.c:137 #, c-format -msgid "Peer %s failed to present a TLS certificate\n" +msgid "Wanted ANSI Volume \"%s\" got \"%s\"\n" msgstr "" -#: src/lib/tls.c:416 -msgid "Error creating file descriptor-based BIO" +#: src/stored/ansi_label.c:148 +msgid "No HDR1 label while reading ANSI label.\n" msgstr "" -#: src/lib/tls.c:427 -msgid "Error creating new SSL object" +#: src/stored/ansi_label.c:154 +#, c-format +msgid "ANSI/IBM Volume \"%s\" does not belong to Bacula.\n" msgstr "" -#: src/lib/tls.c:493 src/lib/tls.c:510 -msgid "Connect failure" +#: src/stored/ansi_label.c:165 +msgid "No HDR2 label while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:587 src/lib/tls.c:591 -msgid "TLS shutdown failure." +#: src/stored/ansi_label.c:179 +msgid "Unknown or bad ANSI/IBM label record.\n" msgstr "" -#: src/lib/tls.c:642 src/lib/tls.c:658 -msgid "TLS read/write failure." +#: src/stored/ansi_label.c:186 +msgid "Too many records in while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:716 src/lib/tls.c:773 src/stored/dev.c:212 -#: src/stored/dev.c:230 src/stored/dev.c:236 src/stored/stored_conf.c:550 +#: src/stored/ansi_label.c:285 #, c-format -msgid "Unable to init mutex: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:736 src/lib/tls.c:805 -#, c-format -msgid "Unable to destroy mutex: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:870 -#, c-format -msgid "Unable to init OpenSSL threading: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:880 -msgid "Failed to seed OpenSSL PRNG\n" -msgstr "" - -#: src/lib/tls.c:906 -msgid "Failed to save OpenSSL PRNG\n" -msgstr "" - -#: src/stored/acquire.c:98 -#, c-format -msgid "Hey! num_writers=%d!!!!\n" -msgstr "" - -#: src/stored/acquire.c:146 -#, c-format -msgid "Num_writers=%d not zero. Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:154 -#, c-format -msgid "No volumes specified. Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:182 src/stored/mount.c:72 -#, c-format -msgid "Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:193 -#, c-format -msgid "Open device %s Volume \"%s\" failed (EIO): ERR=%s\n" -msgstr "" - -#: src/stored/acquire.c:208 -#, c-format -msgid "Open device %s Volume \"%s\" failed: ERR=%s\n" -msgstr "" - -#: src/stored/acquire.c:273 src/stored/mount.c:66 -#, c-format -msgid "Too many errors trying to mount device %s.\n" -msgstr "" - -#: src/stored/acquire.c:282 -#, c-format -msgid "Ready to read from volume \"%s\" on device %s.\n" +msgid "ANSI Volume label name \"%s\" longer than 6 chars.\n" msgstr "" -#: src/stored/acquire.c:328 src/stored/reserve.c:664 +#: src/stored/ansi_label.c:302 #, c-format -msgid "Device %s is busy reading.\n" +msgid "Could not write ANSI VOL1 label. ERR=%s\n" msgstr "" -#: src/stored/acquire.c:358 +#: src/stored/ansi_label.c:340 src/stored/ansi_label.c:369 #, c-format -msgid "Wanted Volume \"%s\", but device %s is busy writing on \"%s\" .\n" +msgid "Could not write ANSI HDR1 label. ERR=%s\n" msgstr "" -#: src/stored/acquire.c:377 -#, c-format -msgid "" -"Cannot recycle volume \"%s\" on device %s because it is in use by another " -"job.\n" +#: src/stored/ansi_label.c:345 src/stored/ansi_label.c:376 +msgid "Could not write ANSI HDR1 label.\n" msgstr "" -#: src/stored/acquire.c:399 +#: src/stored/ansi_label.c:381 #, c-format -msgid "Could not ready device %s for append.\n" +msgid "Error writing EOF to tape. ERR=%s" msgstr "" -#: src/stored/acquire.c:464 src/stored/block.c:353 src/stored/block.c:676 -#: src/stored/block.c:744 -#, c-format -msgid "Could not create JobMedia record for Volume=\"%s\" Job=%s\n" +#: src/stored/ansi_label.c:386 +msgid "write_ansi_ibm_label called for non-ANSI/IBM type\n" msgstr "" -#: src/stored/acquire.c:506 -#, c-format -msgid "Alert: %s" +#: src/stored/append.c:49 +msgid "DCR is NULL!!!\n" msgstr "" -#: src/stored/acquire.c:514 -#, c-format -msgid "3997 Bad alert command: %s: ERR=%s.\n" +#: src/stored/append.c:54 +msgid "DEVICE is NULL!!!\n" msgstr "" -#: src/stored/append.c:60 +#: src/stored/append.c:66 msgid "Unable to set network buffer size.\n" msgstr "" -#: src/stored/append.c:73 src/stored/append.c:82 src/stored/append.c:94 -#: src/stored/append.c:249 src/stored/append.c:264 src/stored/append.c:276 -#: src/stored/askdir.c:284 src/stored/askdir.c:285 +#: src/stored/append.c:79 src/stored/append.c:88 src/stored/append.c:100 +#: src/stored/append.c:256 src/stored/append.c:271 src/stored/append.c:283 +#: src/stored/askdir.c:294 src/stored/askdir.c:295 msgid "NULL Volume name. This shouldn't happen!!!\n" msgstr "" -#: src/stored/append.c:88 src/stored/btape.c:1853 +#: src/stored/append.c:94 src/stored/btape.c:1854 #, c-format msgid "Write session label failed. ERR=%s\n" msgstr "" -#: src/stored/append.c:100 +#: src/stored/append.c:106 #, c-format msgid "Network send error to FD. ERR=%s\n" msgstr "" -#: src/stored/append.c:137 +#: src/stored/append.c:143 #, c-format msgid "Error reading data header from FD. ERR=%s\n" msgstr "" -#: src/stored/append.c:159 +#: src/stored/append.c:165 #, c-format msgid "Malformed data header from FD: %s\n" msgstr "" -#: src/stored/append.c:169 +#: src/stored/append.c:175 msgid "File index from FD not positive or sequential\n" msgstr "" -#: src/stored/append.c:199 src/stored/append.c:269 src/stored/spool.c:247 +#: src/stored/append.c:206 src/stored/append.c:276 src/stored/spool.c:248 #, c-format msgid "Fatal append error on device %s: ERR=%s\n" msgstr "" -#: src/stored/append.c:224 +#: src/stored/append.c:231 #, c-format msgid "Error updating file attributes. ERR=%s\n" msgstr "" -#: src/stored/append.c:237 +#: src/stored/append.c:244 #, c-format msgid "Network error on data channel. ERR=%s\n" msgstr "" -#: src/stored/append.c:258 src/stored/btape.c:1969 +#: src/stored/append.c:265 src/stored/btape.c:1976 #, c-format msgid "Error writting end session label. ERR=%s\n" msgstr "" -#: src/stored/append.c:271 +#: src/stored/append.c:278 msgid "Set ok=FALSE after write_block_to_device.\n" msgstr "" @@ -8541,41 +8672,34 @@ msgstr "" #: src/stored/askdir.c:178 #, c-format -msgid "Error getting Volume info: %s\n" +msgid "Error getting Volume info: %s" msgstr "" -#: src/stored/askdir.c:289 src/stored/askdir.c:290 +#: src/stored/askdir.c:299 src/stored/askdir.c:300 msgid "Attempt to update_volume_info in read mode!!!\n" msgstr "" -#: src/stored/askdir.c:318 +#: src/stored/askdir.c:328 #, c-format msgid "Didn't get vol info vol=%s: ERR=%s" msgstr "" -#: src/stored/askdir.c:349 +#: src/stored/askdir.c:359 #, c-format msgid "Error creating JobMedia record: ERR=%s\n" msgstr "" -#: src/stored/askdir.c:356 +#: src/stored/askdir.c:366 #, c-format msgid "Error creating JobMedia record: %s\n" msgstr "" -#: src/stored/askdir.c:424 +#: src/stored/askdir.c:432 #, c-format msgid "Job %s canceled while waiting for mount on Storage Device \"%s\".\n" msgstr "" -#: src/stored/askdir.c:452 -#, c-format -msgid "" -"Please mount Volume \"%s\" on Storage Device %s for Job %s\n" -"Use \"mount\" command to release Job.\n" -msgstr "" - -#: src/stored/askdir.c:462 +#: src/stored/askdir.c:445 #, c-format msgid "" "Job %s waiting. Cannot find any appendable volumes.\n" @@ -8585,45 +8709,31 @@ msgid "" " Pool: %s\n" msgstr "" -#: src/stored/askdir.c:486 src/stored/askdir.c:588 +#: src/stored/askdir.c:469 src/stored/askdir.c:551 #, c-format msgid "Max time exceeded waiting to mount Storage Device %s for Job %s\n" msgstr "" -#: src/stored/askdir.c:496 src/stored/askdir.c:503 -#, c-format -msgid "pthread error in mount_next_volume stat=%d ERR=%s\n" -msgstr "" - -#: src/stored/askdir.c:514 -#, c-format -msgid "" -"Someone woke me up, but I cannot find any appendable\n" -"volumes for Job=%s.\n" +#: src/stored/askdir.c:479 +msgid "pthread error in mount_next_volume.\n" msgstr "" -#: src/stored/askdir.c:558 +#: src/stored/askdir.c:511 msgid "Cannot request another volume: no volume name given.\n" msgstr "" -#: src/stored/askdir.c:564 +#: src/stored/askdir.c:517 #, c-format msgid "Job %s canceled while waiting for mount on Storage Device %s.\n" msgstr "" -#: src/stored/askdir.c:570 +#: src/stored/askdir.c:532 #, c-format msgid "Please mount Volume \"%s\" on Storage Device %s for Job %s\n" msgstr "" -#: src/stored/askdir.c:598 -#, c-format -msgid "pthread error in mount_volume stat=%d ERR=%s\n" -msgstr "" - -#: src/stored/askdir.c:605 -#, c-format -msgid "pthread error in mount_next_volume stat=%d: ERR=%s\n" +#: src/stored/askdir.c:561 +msgid "pthread error in mount_volume\n" msgstr "" #: src/stored/authenticate.c:53 @@ -8651,71 +8761,91 @@ msgid "" "help.\n" msgstr "" -#: src/stored/autochanger.c:95 +#: src/stored/autochanger.c:53 +#, c-format +msgid "No Changer Name given for device %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:59 +#, c-format +msgid "No Changer Command given for device %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:72 +#, c-format +msgid "" +"Media Type not the same for all devices in changer %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:152 #, c-format msgid "3304 Issuing autochanger \"load slot %d, drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:102 +#: src/stored/autochanger.c:161 #, c-format msgid "3305 Autochanger \"load slot %d, drive %d\", status is OK.\n" msgstr "" -#: src/stored/autochanger.c:108 +#: src/stored/autochanger.c:167 #, c-format msgid "3992 Bad autochanger \"load slot %d, drive %d\": ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:153 +#: src/stored/autochanger.c:208 +msgid "3992 Missing Changer command.\n" +msgstr "" + +#: src/stored/autochanger.c:218 #, c-format msgid "3301 Issuing autochanger \"loaded drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:162 +#: src/stored/autochanger.c:227 #, c-format msgid "3302 Autochanger \"loaded drive %d\", result is Slot %d.\n" msgstr "" -#: src/stored/autochanger.c:166 +#: src/stored/autochanger.c:231 #, c-format msgid "3302 Autochanger \"loaded drive %d\", result: nothing loaded.\n" msgstr "" -#: src/stored/autochanger.c:173 +#: src/stored/autochanger.c:238 #, c-format msgid "3991 Bad autochanger \"loaded drive %d\" command: ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:234 src/stored/autochanger.c:304 +#: src/stored/autochanger.c:297 src/stored/autochanger.c:380 #, c-format msgid "3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:247 src/stored/autochanger.c:325 +#: src/stored/autochanger.c:310 src/stored/autochanger.c:401 #, c-format msgid "3995 Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:290 +#: src/stored/autochanger.c:369 #, c-format msgid "Volume %s is in use by device %s\n" msgstr "" -#: src/stored/autochanger.c:358 +#: src/stored/autochanger.c:439 #, c-format msgid "3993 Device %s not an autochanger device.\n" msgstr "" -#: src/stored/autochanger.c:372 +#: src/stored/autochanger.c:464 #, c-format msgid "3306 Issuing autochanger \"%s\" command.\n" msgstr "" -#: src/stored/autochanger.c:377 +#: src/stored/autochanger.c:467 msgid "3996 Open bpipe failed.\n" msgstr "" -#: src/stored/autochanger.c:401 +#: src/stored/autochanger.c:494 #, c-format msgid "Autochanger error: ERR=%s\n" msgstr "" @@ -8744,7 +8874,7 @@ msgstr "" msgid "Wrong number of arguments: \n" msgstr "" -#: src/stored/bcopy.c:172 src/stored/btape.c:334 src/stored/device.c:273 +#: src/stored/bcopy.c:172 src/stored/btape.c:333 src/stored/device.c:266 #, c-format msgid "dev open failed: %s\n" msgstr "" @@ -8758,7 +8888,7 @@ msgstr "" msgid "%u Jobs copied. %u records copied.\n" msgstr "" -#: src/stored/bcopy.c:205 src/stored/bscan.c:389 +#: src/stored/bcopy.c:205 src/stored/bscan.c:390 #, c-format msgid "Record: SessId=%u SessTim=%u FileIndex=%d Stream=%d len=%u\n" msgstr "" @@ -8772,7 +8902,7 @@ msgid "Volume label not copied.\n" msgstr "" #: src/stored/bcopy.c:235 src/stored/bcopy.c:242 src/stored/bcopy.c:265 -#: src/stored/btape.c:2335 +#: src/stored/btape.c:2342 #, c-format msgid "Cannot fixup device error. %s\n" msgstr "" @@ -8785,8 +8915,8 @@ msgstr "" msgid "EOT label not copied.\n" msgstr "" -#: src/stored/bcopy.c:290 src/stored/bextract.c:473 src/stored/bls.c:444 -#: src/stored/bscan.c:1227 src/stored/btape.c:2683 +#: src/stored/bcopy.c:290 src/stored/bextract.c:479 src/stored/bls.c:443 +#: src/stored/bscan.c:1234 src/stored/btape.c:2690 #, c-format msgid "Mount Volume \"%s\" on device %s and press return when ready: " msgstr "" @@ -8812,12 +8942,12 @@ msgid "" "\n" msgstr "" -#: src/stored/bextract.c:127 src/stored/bls.c:129 +#: src/stored/bextract.c:127 src/stored/bls.c:128 #, c-format msgid "Could not open exclude file: %s, ERR=%s\n" msgstr "" -#: src/stored/bextract.c:142 src/stored/bls.c:143 +#: src/stored/bextract.c:142 src/stored/bls.c:142 #, c-format msgid "Could not open include file: %s, ERR=%s\n" msgstr "" @@ -8847,11 +8977,11 @@ msgstr "" msgid "%u files restored.\n" msgstr "" -#: src/stored/bextract.c:278 src/stored/bextract.c:444 +#: src/stored/bextract.c:278 src/stored/bextract.c:450 msgid "Logic error output file should be open but is not.\n" msgstr "" -#: src/stored/bextract.c:285 src/stored/bls.c:365 src/stored/bscan.c:645 +#: src/stored/bextract.c:285 src/stored/bls.c:364 src/stored/bscan.c:647 msgid "Cannot continue.\n" msgstr "" @@ -8869,176 +8999,176 @@ msgstr "" msgid "===Write error===\n" msgstr "" -#: src/stored/bextract.c:435 +#: src/stored/bextract.c:441 msgid "Got Program Name or Data Stream. Ignored.\n" msgstr "" -#: src/stored/block.c:78 +#: src/stored/block.c:79 #, c-format msgid "" "Dump block %s %x: size=%d BlkNum=%d\n" " Hdrcksum=%x cksum=%x\n" msgstr "" -#: src/stored/block.c:91 +#: src/stored/block.c:92 #, c-format msgid " Rec: VId=%u VT=%u FI=%s Strm=%s len=%d p=%x\n" msgstr "" -#: src/stored/block.c:147 +#: src/stored/block.c:148 #, c-format msgid "%d block read errors not printed.\n" msgstr "" -#: src/stored/block.c:235 src/stored/block.c:251 src/stored/block.c:261 +#: src/stored/block.c:236 src/stored/block.c:252 src/stored/block.c:262 #, c-format msgid "" "Volume data error at %u:%u! Wanted ID: \"%s\", got \"%s\". Buffer " "discarded.\n" msgstr "" -#: src/stored/block.c:275 +#: src/stored/block.c:276 #, c-format msgid "" "Volume data error at %u:%u! Block length %u is insane (too large), probably " "due to a bad archive.\n" msgstr "" -#: src/stored/block.c:301 +#: src/stored/block.c:302 #, c-format msgid "" "Volume data error at %u:%u!\n" "Block checksum mismatch in block=%u len=%d: calc=%x blk=%x\n" msgstr "" -#: src/stored/block.c:409 +#: src/stored/block.c:410 msgid "Cannot write block. Device at EOM.\n" msgstr "" -#: src/stored/block.c:414 +#: src/stored/block.c:415 msgid "Attempt to write on read-only Volume.\n" msgstr "" -#: src/stored/block.c:466 +#: src/stored/block.c:467 #, c-format msgid "User defined maximum volume capacity %s exceeded on device %s.\n" msgstr "" -#: src/stored/block.c:481 +#: src/stored/block.c:482 #, c-format msgid "Unable to write EOF. ERR=%s\n" msgstr "" -#: src/stored/block.c:507 src/stored/block.c:518 +#: src/stored/block.c:508 src/stored/block.c:519 msgid "Write block header zeroed.\n" msgstr "" -#: src/stored/block.c:536 +#: src/stored/block.c:537 #, c-format msgid "Write error at %u:%u on device %s. ERR=%s.\n" msgstr "" -#: src/stored/block.c:543 +#: src/stored/block.c:544 #, c-format msgid "End of Volume \"%s\" at %u:%u on device %s. Write of %u bytes got %d.\n" msgstr "" -#: src/stored/block.c:618 src/stored/block.c:624 +#: src/stored/block.c:619 src/stored/block.c:625 #, c-format msgid "Backspace file at EOT failed. ERR=%s\n" msgstr "" -#: src/stored/block.c:631 +#: src/stored/block.c:632 #, c-format msgid "Backspace record at EOT failed. ERR=%s\n" msgstr "" -#: src/stored/block.c:648 +#: src/stored/block.c:649 #, c-format msgid "Re-read last block at EOT failed. ERR=%s" msgstr "" -#: src/stored/block.c:652 +#: src/stored/block.c:653 msgid "Re-read of last block succeeded.\n" msgstr "" -#: src/stored/block.c:655 +#: src/stored/block.c:656 #, c-format msgid "Re-read of last block failed. Last block=%u Current block=%u.\n" msgstr "" -#: src/stored/block.c:684 +#: src/stored/block.c:685 #, c-format msgid "" -"Error writing final EOF to tape. This tape may not be readable.\n" +"Error writing final EOF to tape. This Volume may not be readable.\n" "%s" msgstr "" -#: src/stored/block.c:790 src/stored/dvd.c:622 +#: src/stored/block.c:795 src/stored/dvd.c:689 #, c-format msgid "" "Error while writing, current part number is less than the total number of " "parts (%d/%d, device=%s)\n" msgstr "" -#: src/stored/block.c:798 src/stored/block.c:908 +#: src/stored/block.c:803 src/stored/block.c:913 #, c-format msgid "Unable to open device next part %s: ERR=%s\n" msgstr "" -#: src/stored/block.c:816 +#: src/stored/block.c:821 #, c-format msgid "" "End of Volume \"%s\" at %u:%u on device %s (part_size=%s, free_space=%s, " "free_space_errno=%d, errmsg=%s).\n" msgstr "" -#: src/stored/block.c:829 +#: src/stored/block.c:834 #, c-format msgid "" "End of Volume \"%s\" at %u:%u on device %s (part_size=%s, free_space=%s, " "free_space_errno=%d).\n" msgstr "" -#: src/stored/block.c:883 +#: src/stored/block.c:888 #, c-format msgid "Block buffer size looping problem on device %s\n" msgstr "" -#: src/stored/block.c:934 +#: src/stored/block.c:939 #, c-format msgid "Read error at file:blk %u:%u on device %s. ERR=%s.\n" msgstr "" -#: src/stored/block.c:947 +#: src/stored/block.c:952 #, c-format msgid "Read zero bytes at %u:%u on device %s.\n" msgstr "" -#: src/stored/block.c:960 +#: src/stored/block.c:965 #, c-format msgid "" "Volume data error at %u:%u! Very short block of %d bytes on device %s " "discarded.\n" msgstr "" -#: src/stored/block.c:985 +#: src/stored/block.c:990 #, c-format msgid "Block length %u is greater than buffer %u. Attempting recovery.\n" msgstr "" -#: src/stored/block.c:1004 +#: src/stored/block.c:1009 #, c-format msgid "Setting block buffer size to %u bytes.\n" msgstr "" -#: src/stored/block.c:1019 +#: src/stored/block.c:1024 #, c-format msgid "" "Volume data error at %u:%u! Short block of %d bytes on device %s discarded.\n" msgstr "" -#: src/stored/bls.c:69 +#: src/stored/bls.c:68 #, c-format msgid "" "Copyright (C) 2000-2005 Kern Sibbald.\n" @@ -9062,74 +9192,74 @@ msgid "" "\n" msgstr "" -#: src/stored/bls.c:190 +#: src/stored/bls.c:189 msgid "No archive name specified\n" msgstr "" -#: src/stored/bls.c:226 +#: src/stored/bls.c:224 #, c-format msgid "" "\n" "Warning, this Volume is a continuation of Volume %s\n" msgstr "" -#: src/stored/bls.c:268 +#: src/stored/bls.c:267 #, c-format msgid "Got EOM at file %u on device %s, Volume \"%s\"\n" msgstr "" -#: src/stored/bls.c:279 +#: src/stored/bls.c:278 #, c-format msgid "Mounted Volume \"%s\".\n" msgstr "" -#: src/stored/bls.c:281 +#: src/stored/bls.c:280 #, c-format msgid "Got EOF at file %u on device %s, Volume \"%s\"\n" msgstr "" -#: src/stored/bls.c:305 +#: src/stored/bls.c:304 #, c-format msgid "" "File:blk=%u:%u blk_num=%u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%" "s rlen=%d\n" msgstr "" -#: src/stored/bls.c:314 +#: src/stored/bls.c:313 #, c-format msgid "Block: %d size=%d\n" msgstr "" -#: src/stored/bls.c:381 +#: src/stored/bls.c:380 #, c-format msgid "FileIndex=%d VolSessionId=%d VolSessionTime=%d Stream=%d DataLen=%d\n" msgstr "" -#: src/stored/bls.c:398 src/stored/read_record.c:321 +#: src/stored/bls.c:397 src/stored/read_record.c:322 msgid "Fresh Volume Label" msgstr "" -#: src/stored/bls.c:401 src/stored/read_record.c:324 +#: src/stored/bls.c:400 src/stored/read_record.c:325 msgid "Volume Label" msgstr "" -#: src/stored/bls.c:405 src/stored/label.c:959 +#: src/stored/bls.c:404 src/stored/label.c:969 msgid "Begin Job Session" msgstr "" -#: src/stored/bls.c:409 src/stored/label.c:962 +#: src/stored/bls.c:408 src/stored/label.c:972 msgid "End Job Session" msgstr "" -#: src/stored/bls.c:412 +#: src/stored/bls.c:411 msgid "End of Medium" msgstr "" -#: src/stored/bls.c:415 src/stored/label.c:971 +#: src/stored/bls.c:414 src/stored/label.c:981 msgid "Unknown" msgstr "" -#: src/stored/bls.c:421 src/stored/read_record.c:342 +#: src/stored/bls.c:420 src/stored/read_record.c:343 #, c-format msgid "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n" msgstr "" @@ -9161,12 +9291,12 @@ msgid "" "\n" msgstr "" -#: src/stored/bscan.c:234 src/stored/stored.c:266 +#: src/stored/bscan.c:234 src/stored/stored.c:265 #, c-format msgid "No Storage resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/bscan.c:242 src/stored/stored.c:297 +#: src/stored/bscan.c:242 src/stored/stored.c:296 #, c-format msgid "No Working Directory defined in %s. Cannot continue.\n" msgstr "" @@ -9181,7 +9311,7 @@ msgstr "" msgid "Working Directory: %s is not a directory. Cannot continue.\n" msgstr "" -#: src/stored/bscan.c:268 src/stored/bscan.c:340 +#: src/stored/bscan.c:268 src/stored/bscan.c:341 #, c-format msgid "First Volume Size = %sn" msgstr "" @@ -9200,235 +9330,235 @@ msgstr "" msgid "Create JobMedia for Job %s\n" msgstr "" -#: src/stored/bscan.c:325 +#: src/stored/bscan.c:326 #, c-format msgid "Could not create JobMedia record for Volume=%s Job=%s\n" msgstr "" -#: src/stored/bscan.c:381 +#: src/stored/bscan.c:382 #, c-format msgid "done: %d%%\n" msgstr "" -#: src/stored/bscan.c:405 +#: src/stored/bscan.c:406 msgid "Volume is prelabeled. This tape cannot be scanned.\n" msgstr "" -#: src/stored/bscan.c:417 +#: src/stored/bscan.c:418 #, c-format msgid "Pool record for %s found in DB.\n" msgstr "" -#: src/stored/bscan.c:421 +#: src/stored/bscan.c:422 #, c-format msgid "VOL_LABEL: Pool record not found for Pool: %s\n" msgstr "" -#: src/stored/bscan.c:427 +#: src/stored/bscan.c:428 #, c-format msgid "VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n" msgstr "" -#: src/stored/bscan.c:431 +#: src/stored/bscan.c:432 #, c-format msgid "Pool type \"%s\" is OK.\n" msgstr "" -#: src/stored/bscan.c:441 +#: src/stored/bscan.c:442 #, c-format msgid "Media record for %s found in DB.\n" msgstr "" -#: src/stored/bscan.c:448 +#: src/stored/bscan.c:449 #, c-format msgid "VOL_LABEL: Media record not found for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:455 +#: src/stored/bscan.c:456 #, c-format msgid "VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n" msgstr "" -#: src/stored/bscan.c:459 +#: src/stored/bscan.c:460 #, c-format msgid "Media type \"%s\" is OK.\n" msgstr "" -#: src/stored/bscan.c:468 +#: src/stored/bscan.c:469 #, c-format msgid "VOL_LABEL: OK for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:475 +#: src/stored/bscan.c:476 #, c-format msgid "%d \"errors\" ignored before first Start of Session record.\n" msgstr "" -#: src/stored/bscan.c:486 +#: src/stored/bscan.c:487 #, c-format msgid "SOS_LABEL: Found Job record for JobId: %d\n" msgstr "" -#: src/stored/bscan.c:491 +#: src/stored/bscan.c:492 #, c-format msgid "SOS_LABEL: Job record not found for JobId: %d\n" msgstr "" -#: src/stored/bscan.c:531 +#: src/stored/bscan.c:532 #, c-format msgid "SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:537 +#: src/stored/bscan.c:538 #, c-format msgid "SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:543 +#: src/stored/bscan.c:544 #, c-format msgid "SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:561 src/stored/bscan.c:1007 +#: src/stored/bscan.c:562 src/stored/bscan.c:1013 #, c-format msgid "Could not find SessId=%d SessTime=%d for EOS record.\n" msgstr "" -#: src/stored/bscan.c:604 +#: src/stored/bscan.c:606 #, c-format msgid "Could not update job record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:615 +#: src/stored/bscan.c:617 #, c-format msgid "End of all Volumes. VolFiles=%u VolBlocks=%u VolBytes=%s\n" msgstr "" -#: src/stored/bscan.c:627 +#: src/stored/bscan.c:629 #, c-format msgid "Could not find Job for SessId=%d SessTime=%d record.\n" msgstr "" -#: src/stored/bscan.c:663 +#: src/stored/bscan.c:665 #, c-format msgid "%s file records. At file:blk=%s:%s bytes=%s\n" msgstr "" -#: src/stored/bscan.c:706 +#: src/stored/bscan.c:708 #, c-format msgid "Got MD5 record: %s\n" msgstr "" -#: src/stored/bscan.c:715 +#: src/stored/bscan.c:717 #, c-format msgid "Got SHA1 record: %s\n" msgstr "" -#: src/stored/bscan.c:723 +#: src/stored/bscan.c:725 #, c-format msgid "Got Prog Names Stream: %s\n" msgstr "" -#: src/stored/bscan.c:729 +#: src/stored/bscan.c:731 msgid "Got Prog Data Stream record.\n" msgstr "" -#: src/stored/bscan.c:733 +#: src/stored/bscan.c:735 #, c-format msgid "Unknown stream type!!! stream=%d data=%s\n" msgstr "" -#: src/stored/bscan.c:793 +#: src/stored/bscan.c:799 #, c-format msgid "Could not create File Attributes record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:799 +#: src/stored/bscan.c:805 #, c-format msgid "Created File record: %s\n" msgstr "" -#: src/stored/bscan.c:836 +#: src/stored/bscan.c:842 #, c-format msgid "Could not create media record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:840 src/stored/bscan.c:861 +#: src/stored/bscan.c:846 src/stored/bscan.c:867 #, c-format msgid "Could not update media record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:844 +#: src/stored/bscan.c:850 #, c-format msgid "Created Media record for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:865 +#: src/stored/bscan.c:871 #, c-format msgid "Updated Media record at end of Volume: %s\n" msgstr "" -#: src/stored/bscan.c:882 +#: src/stored/bscan.c:888 #, c-format msgid "Could not create pool record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:886 +#: src/stored/bscan.c:892 #, c-format msgid "Created Pool record for Pool: %s\n" msgstr "" -#: src/stored/bscan.c:906 +#: src/stored/bscan.c:912 #, c-format msgid "Created Client record for Client: %s\n" msgstr "" -#: src/stored/bscan.c:923 +#: src/stored/bscan.c:929 #, c-format msgid "Fileset \"%s\" already exists.\n" msgstr "" -#: src/stored/bscan.c:927 +#: src/stored/bscan.c:933 #, c-format msgid "Could not create FileSet record \"%s\". ERR=%s\n" msgstr "" -#: src/stored/bscan.c:932 +#: src/stored/bscan.c:938 #, c-format msgid "Created FileSet record \"%s\"\n" msgstr "" -#: src/stored/bscan.c:979 +#: src/stored/bscan.c:985 #, c-format msgid "Could not create JobId record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:985 +#: src/stored/bscan.c:991 #, c-format msgid "Could not update job start record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:988 +#: src/stored/bscan.c:994 #, c-format msgid "Created new JobId=%u record for original JobId=%u\n" msgstr "" -#: src/stored/bscan.c:1038 +#: src/stored/bscan.c:1044 #, c-format msgid "Could not update JobId=%u record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1043 +#: src/stored/bscan.c:1049 #, c-format msgid "Updated Job termination record for JobId=%u TermStat=%c\n" msgstr "" -#: src/stored/bscan.c:1065 +#: src/stored/bscan.c:1071 #, c-format msgid "Job Termination code: %d" msgstr "" -#: src/stored/bscan.c:1070 +#: src/stored/bscan.c:1076 #, c-format msgid "" "%s\n" @@ -9448,27 +9578,27 @@ msgid "" "\n" msgstr "" -#: src/stored/bscan.c:1134 +#: src/stored/bscan.c:1140 #, c-format msgid "Could not create JobMedia record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1138 +#: src/stored/bscan.c:1144 #, c-format msgid "Created JobMedia record JobId %d, MediaId %d\n" msgstr "" -#: src/stored/bscan.c:1154 +#: src/stored/bscan.c:1160 #, c-format msgid "Could not find SessId=%d SessTime=%d for MD5/SHA1 record.\n" msgstr "" -#: src/stored/bscan.c:1168 +#: src/stored/bscan.c:1174 #, c-format msgid "Could not add MD5/SHA1 to File record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1173 +#: src/stored/bscan.c:1179 msgid "Updated MD5/SHA1 record\n" msgstr "" @@ -9519,140 +9649,140 @@ msgstr "" msgid "Improper number of arguments specified.\n" msgstr "" -#: src/stored/btape.c:340 +#: src/stored/btape.c:338 #, c-format msgid "open device %s: OK\n" msgstr "" -#: src/stored/btape.c:361 +#: src/stored/btape.c:359 msgid "Enter Volume Name: " msgstr "" -#: src/stored/btape.c:368 +#: src/stored/btape.c:366 #, c-format msgid "Device open failed. ERR=%s\n" msgstr "" -#: src/stored/btape.c:373 +#: src/stored/btape.c:371 #, c-format msgid "Wrote Volume label for volume \"%s\".\n" msgstr "" -#: src/stored/btape.c:387 +#: src/stored/btape.c:385 msgid "Volume has no label.\n" msgstr "" -#: src/stored/btape.c:390 +#: src/stored/btape.c:388 msgid "Volume label read correctly.\n" msgstr "" -#: src/stored/btape.c:393 +#: src/stored/btape.c:391 #, c-format msgid "I/O error on device: ERR=%s" msgstr "" -#: src/stored/btape.c:396 +#: src/stored/btape.c:394 msgid "Volume name error\n" msgstr "" -#: src/stored/btape.c:399 +#: src/stored/btape.c:397 #, c-format msgid "Error creating label. ERR=%s" msgstr "" -#: src/stored/btape.c:402 +#: src/stored/btape.c:400 msgid "Volume version error.\n" msgstr "" -#: src/stored/btape.c:405 +#: src/stored/btape.c:403 msgid "Bad Volume label type.\n" msgstr "" -#: src/stored/btape.c:408 +#: src/stored/btape.c:406 msgid "Unknown error.\n" msgstr "" -#: src/stored/btape.c:426 +#: src/stored/btape.c:424 #, c-format msgid "Bad status from load. ERR=%s\n" msgstr "" -#: src/stored/btape.c:428 +#: src/stored/btape.c:426 #, c-format msgid "Loaded %s\n" msgstr "" -#: src/stored/btape.c:437 src/stored/btape.c:777 src/stored/btape.c:819 -#: src/stored/btape.c:889 src/stored/btape.c:931 src/stored/btape.c:1200 +#: src/stored/btape.c:435 src/stored/btape.c:775 src/stored/btape.c:817 +#: src/stored/btape.c:887 src/stored/btape.c:929 src/stored/btape.c:1198 #, c-format msgid "Bad status from rewind. ERR=%s\n" msgstr "" -#: src/stored/btape.c:440 src/stored/btape.c:1208 +#: src/stored/btape.c:438 src/stored/btape.c:1206 #, c-format msgid "Rewound %s\n" msgstr "" -#: src/stored/btape.c:467 src/stored/btape.c:1212 +#: src/stored/btape.c:465 src/stored/btape.c:1210 #, c-format msgid "Bad status from weof %d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:471 +#: src/stored/btape.c:469 #, c-format msgid "Wrote 1 EOF to %s\n" msgstr "" -#: src/stored/btape.c:474 +#: src/stored/btape.c:472 #, c-format msgid "Wrote %d EOFs to %s\n" msgstr "" -#: src/stored/btape.c:492 +#: src/stored/btape.c:490 msgid "Moved to end of medium.\n" msgstr "" -#: src/stored/btape.c:519 +#: src/stored/btape.c:517 #, c-format msgid "Bad status from bsf. ERR=%s\n" msgstr "" -#: src/stored/btape.c:521 +#: src/stored/btape.c:519 #, c-format msgid "Backspaced %d file%s.\n" msgstr "" -#: src/stored/btape.c:538 +#: src/stored/btape.c:536 #, c-format msgid "Bad status from bsr. ERR=%s\n" msgstr "" -#: src/stored/btape.c:540 +#: src/stored/btape.c:538 #, c-format msgid "Backspaced %d record%s.\n" msgstr "" -#: src/stored/btape.c:550 src/stored/status.c:220 +#: src/stored/btape.c:548 src/stored/status.c:227 #, c-format msgid "Configured device capabilities:\n" msgstr "" -#: src/stored/btape.c:568 +#: src/stored/btape.c:566 #, c-format msgid "Device status:\n" msgstr "" -#: src/stored/btape.c:582 src/stored/status.c:252 +#: src/stored/btape.c:580 src/stored/status.c:259 #, c-format msgid "Device parameters:\n" msgstr "" -#: src/stored/btape.c:587 +#: src/stored/btape.c:585 #, c-format msgid "Status:\n" msgstr "" -#: src/stored/btape.c:602 +#: src/stored/btape.c:600 msgid "" "Test writting larger and larger records.\n" "This is a torture test for records.\n" @@ -9661,20 +9791,20 @@ msgid "" "plus the header exceeds the block size (by default about 64K)\n" msgstr "" -#: src/stored/btape.c:610 src/stored/btape.c:1814 +#: src/stored/btape.c:608 src/stored/btape.c:1815 msgid "Command aborted.\n" msgstr "" -#: src/stored/btape.c:626 +#: src/stored/btape.c:624 #, c-format msgid "Block %d i=%d\n" msgstr "" -#: src/stored/btape.c:652 +#: src/stored/btape.c:650 msgid "Skipping read backwards test because BSR turned off.\n" msgstr "" -#: src/stored/btape.c:656 +#: src/stored/btape.c:654 msgid "" "\n" "=== Write, backup, and re-read test ===\n" @@ -9688,73 +9818,73 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:669 src/stored/btape.c:680 src/stored/btape.c:691 -#: src/stored/btape.c:789 src/stored/btape.c:805 src/stored/btape.c:901 -#: src/stored/btape.c:917 src/stored/btape.c:1526 src/stored/btape.c:2400 +#: src/stored/btape.c:667 src/stored/btape.c:678 src/stored/btape.c:689 +#: src/stored/btape.c:787 src/stored/btape.c:803 src/stored/btape.c:899 +#: src/stored/btape.c:915 src/stored/btape.c:1524 src/stored/btape.c:2407 msgid "Error writing record to block.\n" msgstr "" -#: src/stored/btape.c:673 src/stored/btape.c:684 src/stored/btape.c:695 -#: src/stored/btape.c:793 src/stored/btape.c:809 src/stored/btape.c:905 -#: src/stored/btape.c:921 src/stored/btape.c:1530 src/stored/btape.c:2404 +#: src/stored/btape.c:671 src/stored/btape.c:682 src/stored/btape.c:693 +#: src/stored/btape.c:791 src/stored/btape.c:807 src/stored/btape.c:903 +#: src/stored/btape.c:919 src/stored/btape.c:1528 src/stored/btape.c:2411 msgid "Error writing block to device.\n" msgstr "" -#: src/stored/btape.c:676 +#: src/stored/btape.c:674 #, c-format msgid "Wrote first record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:687 +#: src/stored/btape.c:685 #, c-format msgid "Wrote second record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:698 +#: src/stored/btape.c:696 #, c-format msgid "Wrote third record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:705 src/stored/btape.c:710 +#: src/stored/btape.c:703 src/stored/btape.c:708 #, c-format msgid "Backspace file failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:714 +#: src/stored/btape.c:712 msgid "Backspaced over EOF OK.\n" msgstr "" -#: src/stored/btape.c:716 +#: src/stored/btape.c:714 #, c-format msgid "Backspace record failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:719 +#: src/stored/btape.c:717 msgid "Backspace record OK.\n" msgstr "" -#: src/stored/btape.c:722 src/stored/btape.c:728 +#: src/stored/btape.c:720 src/stored/btape.c:726 #, c-format msgid "Read block failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:733 +#: src/stored/btape.c:731 msgid "Bad data in record. Test failed!\n" msgstr "" -#: src/stored/btape.c:737 +#: src/stored/btape.c:735 msgid "" "\n" "Block re-read correct. Test succeeded!\n" msgstr "" -#: src/stored/btape.c:738 +#: src/stored/btape.c:736 msgid "" "=== End Write, backup, and re-read test ===\n" "\n" msgstr "" -#: src/stored/btape.c:745 +#: src/stored/btape.c:743 msgid "" "This is not terribly serious since Bacula only uses\n" "this function to verify the last block written to the\n" @@ -9766,7 +9896,7 @@ msgid "" "to your Storage daemon's Device resource definition.\n" msgstr "" -#: src/stored/btape.c:769 +#: src/stored/btape.c:767 msgid "" "\n" "=== Write, rewind, and re-read test ===\n" @@ -9779,46 +9909,46 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:797 src/stored/btape.c:813 src/stored/btape.c:909 -#: src/stored/btape.c:925 +#: src/stored/btape.c:795 src/stored/btape.c:811 src/stored/btape.c:907 +#: src/stored/btape.c:923 #, c-format msgid "Wrote 1000 blocks of %d bytes.\n" msgstr "" -#: src/stored/btape.c:822 src/stored/btape.c:934 +#: src/stored/btape.c:820 src/stored/btape.c:932 msgid "Rewind OK.\n" msgstr "" -#: src/stored/btape.c:829 src/stored/btape.c:983 +#: src/stored/btape.c:827 src/stored/btape.c:981 msgid "Got EOF on tape.\n" msgstr "" -#: src/stored/btape.c:834 +#: src/stored/btape.c:832 #, c-format msgid "Read block %d failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:840 +#: src/stored/btape.c:838 #, c-format msgid "Read record failed. Block %d! ERR=%s\n" msgstr "" -#: src/stored/btape.c:846 src/stored/btape.c:1013 +#: src/stored/btape.c:844 src/stored/btape.c:1011 #, c-format msgid "Bad data in record. Expected %d, got %d at byte %d. Test failed!\n" msgstr "" -#: src/stored/btape.c:853 +#: src/stored/btape.c:851 msgid "1000 blocks re-read correctly.\n" msgstr "" -#: src/stored/btape.c:856 src/stored/btape.c:1020 +#: src/stored/btape.c:854 src/stored/btape.c:1018 msgid "" "=== Test Succeeded. End Write, rewind, and re-read test ===\n" "\n" msgstr "" -#: src/stored/btape.c:881 +#: src/stored/btape.c:879 msgid "" "\n" "=== Write, rewind, and position test ===\n" @@ -9831,23 +9961,23 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:974 +#: src/stored/btape.c:972 #, c-format msgid "Reposition to file:block %d:%d\n" msgstr "" -#: src/stored/btape.c:976 +#: src/stored/btape.c:974 msgid "Reposition error.\n" msgstr "" -#: src/stored/btape.c:989 +#: src/stored/btape.c:987 #, c-format msgid "" "Read block %d failed! file=%d blk=%d. ERR=%s\n" "\n" msgstr "" -#: src/stored/btape.c:991 +#: src/stored/btape.c:989 msgid "" "This may be because the tape drive block size is not\n" " set to variable blocking as normally used by Bacula.\n" @@ -9861,17 +9991,17 @@ msgid "" " in your Device resource.\n" msgstr "" -#: src/stored/btape.c:1007 +#: src/stored/btape.c:1005 #, c-format msgid "Read record failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:1018 +#: src/stored/btape.c:1016 #, c-format msgid "Block %d re-read correctly.\n" msgstr "" -#: src/stored/btape.c:1039 +#: src/stored/btape.c:1037 msgid "" "\n" "\n" @@ -9885,58 +10015,58 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1063 +#: src/stored/btape.c:1061 msgid "Now moving to end of medium.\n" msgstr "" -#: src/stored/btape.c:1065 src/stored/btape.c:1295 +#: src/stored/btape.c:1063 src/stored/btape.c:1293 #, c-format msgid "We should be in file 3. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1066 src/stored/btape.c:1084 src/stored/btape.c:1284 -#: src/stored/btape.c:1296 src/stored/btape.c:1309 src/stored/btape.c:1326 +#: src/stored/btape.c:1064 src/stored/btape.c:1082 src/stored/btape.c:1282 +#: src/stored/btape.c:1294 src/stored/btape.c:1307 src/stored/btape.c:1324 msgid "This is correct!" msgstr "" -#: src/stored/btape.c:1066 src/stored/btape.c:1084 src/stored/btape.c:1284 -#: src/stored/btape.c:1296 src/stored/btape.c:1309 src/stored/btape.c:1326 +#: src/stored/btape.c:1064 src/stored/btape.c:1082 src/stored/btape.c:1282 +#: src/stored/btape.c:1294 src/stored/btape.c:1307 src/stored/btape.c:1324 msgid "This is NOT correct!!!!" msgstr "" -#: src/stored/btape.c:1072 +#: src/stored/btape.c:1070 msgid "" "\n" "Now the important part, I am going to attempt to append to the tape.\n" "\n" msgstr "" -#: src/stored/btape.c:1079 +#: src/stored/btape.c:1077 msgid "" "Done appending, there should be no I/O errors\n" "\n" msgstr "" -#: src/stored/btape.c:1080 +#: src/stored/btape.c:1078 msgid "Doing Bacula scan of blocks:\n" msgstr "" -#: src/stored/btape.c:1082 +#: src/stored/btape.c:1080 msgid "End scanning the tape.\n" msgstr "" -#: src/stored/btape.c:1083 src/stored/btape.c:1308 +#: src/stored/btape.c:1081 src/stored/btape.c:1306 #, c-format msgid "We should be in file 4. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1108 +#: src/stored/btape.c:1106 msgid "" "\n" "Autochanger enabled, but no name or no command device specified.\n" msgstr "" -#: src/stored/btape.c:1112 +#: src/stored/btape.c:1110 msgid "" "\n" "Ah, I see you have an autochanger configured.\n" @@ -9944,13 +10074,13 @@ msgid "" " that I can write on in Slot 1.\n" msgstr "" -#: src/stored/btape.c:1115 +#: src/stored/btape.c:1113 msgid "" "\n" "Do you wish to continue with the Autochanger test? (y/n): " msgstr "" -#: src/stored/btape.c:1122 +#: src/stored/btape.c:1120 msgid "" "\n" "\n" @@ -9958,74 +10088,74 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1131 +#: src/stored/btape.c:1129 msgid "3301 Issuing autochanger \"loaded\" command.\n" msgstr "" -#: src/stored/btape.c:1140 +#: src/stored/btape.c:1138 #, c-format msgid "3991 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1141 +#: src/stored/btape.c:1139 #, c-format msgid "3991 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1145 +#: src/stored/btape.c:1143 #, c-format msgid "Slot %d loaded. I am going to unload it.\n" msgstr "" -#: src/stored/btape.c:1147 +#: src/stored/btape.c:1145 msgid "Nothing loaded in the drive. OK.\n" msgstr "" -#: src/stored/btape.c:1155 +#: src/stored/btape.c:1153 #, c-format msgid "3302 Issuing autochanger \"unload %d %d\" command.\n" msgstr "" -#: src/stored/btape.c:1160 +#: src/stored/btape.c:1158 #, c-format msgid "unload status=%s %d\n" msgstr "" -#: src/stored/btape.c:1160 +#: src/stored/btape.c:1158 msgid "Bad" msgstr "" -#: src/stored/btape.c:1163 +#: src/stored/btape.c:1161 #, c-format msgid "3992 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1164 +#: src/stored/btape.c:1162 #, c-format msgid "3992 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1174 +#: src/stored/btape.c:1172 #, c-format msgid "3303 Issuing autochanger \"load %d %d\" command.\n" msgstr "" -#: src/stored/btape.c:1182 +#: src/stored/btape.c:1180 #, c-format msgid "3303 Autochanger \"load %d %d\" status is OK.\n" msgstr "" -#: src/stored/btape.c:1186 +#: src/stored/btape.c:1184 #, c-format msgid "3993 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1187 +#: src/stored/btape.c:1185 #, c-format msgid "3993 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1202 +#: src/stored/btape.c:1200 msgid "" "\n" "The test failed, probably because you need to put\n" @@ -10033,12 +10163,12 @@ msgid "" "Adding a 30 second sleep and trying again ...\n" msgstr "" -#: src/stored/btape.c:1215 +#: src/stored/btape.c:1213 #, c-format msgid "Wrote EOF to %s\n" msgstr "" -#: src/stored/btape.c:1219 +#: src/stored/btape.c:1217 #, c-format msgid "" "\n" @@ -10050,18 +10180,18 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1224 +#: src/stored/btape.c:1222 msgid "" "\n" "The test autochanger worked!!\n" "\n" msgstr "" -#: src/stored/btape.c:1235 +#: src/stored/btape.c:1233 msgid "You must correct this error or the Autochanger will not work.\n" msgstr "" -#: src/stored/btape.c:1253 +#: src/stored/btape.c:1251 msgid "" "\n" "\n" @@ -10073,30 +10203,30 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1278 +#: src/stored/btape.c:1276 msgid "Now forward spacing 1 file.\n" msgstr "" -#: src/stored/btape.c:1280 src/stored/btape.c:1292 src/stored/btape.c:1305 -#: src/stored/btape.c:1323 src/stored/btape.c:1492 +#: src/stored/btape.c:1278 src/stored/btape.c:1290 src/stored/btape.c:1303 +#: src/stored/btape.c:1321 src/stored/btape.c:1490 #, c-format msgid "Bad status from fsr. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1283 +#: src/stored/btape.c:1281 #, c-format msgid "We should be in file 1. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1290 +#: src/stored/btape.c:1288 msgid "Now forward spacing 2 files.\n" msgstr "" -#: src/stored/btape.c:1303 +#: src/stored/btape.c:1301 msgid "Now forward spacing 4 files.\n" msgstr "" -#: src/stored/btape.c:1315 +#: src/stored/btape.c:1313 msgid "" "The test worked this time. Please add:\n" "\n" @@ -10105,35 +10235,35 @@ msgid "" "to your Device resource for this drive.\n" msgstr "" -#: src/stored/btape.c:1321 +#: src/stored/btape.c:1319 msgid "Now forward spacing 1 more file.\n" msgstr "" -#: src/stored/btape.c:1325 +#: src/stored/btape.c:1323 #, c-format msgid "We should be in file 5. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1330 +#: src/stored/btape.c:1328 msgid "" "\n" "=== End Forward space files test ===\n" "\n" msgstr "" -#: src/stored/btape.c:1334 +#: src/stored/btape.c:1332 msgid "" "\n" "The forward space file test failed.\n" msgstr "" -#: src/stored/btape.c:1336 +#: src/stored/btape.c:1334 msgid "" "You have Fast Forward Space File enabled.\n" "I am turning it off then retrying the test.\n" msgstr "" -#: src/stored/btape.c:1342 +#: src/stored/btape.c:1340 msgid "" "You must correct this error or Bacula will not work.\n" "Some systems, e.g. OpenBSD, require you to set\n" @@ -10141,7 +10271,7 @@ msgid "" "in your device resource. Use with caution.\n" msgstr "" -#: src/stored/btape.c:1374 +#: src/stored/btape.c:1372 msgid "" "\n" "Append test failed. Attempting again.\n" @@ -10151,7 +10281,7 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1382 +#: src/stored/btape.c:1380 msgid "" "\n" "\n" @@ -10163,14 +10293,14 @@ msgid "" "to your Device resource in the Storage conf file.\n" msgstr "" -#: src/stored/btape.c:1389 +#: src/stored/btape.c:1387 msgid "" "\n" "\n" "That appears *NOT* to have corrected the problem.\n" msgstr "" -#: src/stored/btape.c:1394 +#: src/stored/btape.c:1392 msgid "" "\n" "\n" @@ -10178,7 +10308,7 @@ msgid "" "Setting \"BSF at EOM = yes\" and retrying append test.\n" msgstr "" -#: src/stored/btape.c:1399 +#: src/stored/btape.c:1397 msgid "" "\n" "\n" @@ -10191,7 +10321,7 @@ msgid "" "to your Device resource in the Storage conf file.\n" msgstr "" -#: src/stored/btape.c:1410 +#: src/stored/btape.c:1408 msgid "" "\n" "Append test failed.\n" @@ -10218,7 +10348,7 @@ msgid "" "in your device resource. Use with caution.\n" msgstr "" -#: src/stored/btape.c:1431 +#: src/stored/btape.c:1429 msgid "" "\n" "The above Bacula scan should have output identical to what follows.\n" @@ -10242,116 +10372,116 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1470 +#: src/stored/btape.c:1468 #, c-format msgid "Bad status from fsf. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1474 +#: src/stored/btape.c:1472 msgid "Forward spaced 1 file.\n" msgstr "" -#: src/stored/btape.c:1477 +#: src/stored/btape.c:1475 #, c-format msgid "Forward spaced %d files.\n" msgstr "" -#: src/stored/btape.c:1496 +#: src/stored/btape.c:1494 msgid "Forward spaced 1 record.\n" msgstr "" -#: src/stored/btape.c:1499 +#: src/stored/btape.c:1497 #, c-format msgid "Forward spaced %d records.\n" msgstr "" -#: src/stored/btape.c:1533 +#: src/stored/btape.c:1531 #, c-format msgid "Wrote one record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:1535 +#: src/stored/btape.c:1533 msgid "Wrote block to device.\n" msgstr "" -#: src/stored/btape.c:1550 +#: src/stored/btape.c:1548 msgid "Enter length to read: " msgstr "" -#: src/stored/btape.c:1555 +#: src/stored/btape.c:1553 msgid "Bad length entered, using default of 1024 bytes.\n" msgstr "" -#: src/stored/btape.c:1564 +#: src/stored/btape.c:1562 #, c-format msgid "Read of %d bytes gives stat=%d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1587 src/stored/btape.c:1636 +#: src/stored/btape.c:1585 src/stored/btape.c:1634 #, c-format msgid "End of tape\n" msgstr "" -#: src/stored/btape.c:1592 +#: src/stored/btape.c:1590 #, c-format msgid "Starting scan at file %u\n" msgstr "" -#: src/stored/btape.c:1597 src/stored/dev.c:1238 +#: src/stored/btape.c:1595 src/stored/dev.c:1229 #, c-format msgid "read error on %s. ERR=%s.\n" msgstr "" -#: src/stored/btape.c:1599 +#: src/stored/btape.c:1597 #, c-format msgid "Bad status from read %d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1602 src/stored/btape.c:1616 src/stored/btape.c:1679 -#: src/stored/btape.c:1691 src/stored/btape.c:1704 src/stored/btape.c:1720 +#: src/stored/btape.c:1600 src/stored/btape.c:1614 src/stored/btape.c:1678 +#: src/stored/btape.c:1690 src/stored/btape.c:1703 src/stored/btape.c:1719 #, c-format msgid "1 block of %d bytes in file %d\n" msgstr "" -#: src/stored/btape.c:1605 src/stored/btape.c:1619 src/stored/btape.c:1682 -#: src/stored/btape.c:1694 src/stored/btape.c:1707 src/stored/btape.c:1723 +#: src/stored/btape.c:1603 src/stored/btape.c:1617 src/stored/btape.c:1681 +#: src/stored/btape.c:1693 src/stored/btape.c:1706 src/stored/btape.c:1722 #, c-format msgid "%d blocks of %d bytes in file %d\n" msgstr "" -#: src/stored/btape.c:1627 src/stored/btape.c:1698 +#: src/stored/btape.c:1625 src/stored/btape.c:1697 #, c-format msgid "End of File mark.\n" msgstr "" -#: src/stored/btape.c:1648 src/stored/btape.c:1751 +#: src/stored/btape.c:1646 src/stored/btape.c:1750 #, c-format msgid "Total files=%d, blocks=%d, bytes = %s\n" msgstr "" -#: src/stored/btape.c:1711 +#: src/stored/btape.c:1710 #, c-format msgid "Short block read.\n" msgstr "" -#: src/stored/btape.c:1714 +#: src/stored/btape.c:1713 #, c-format msgid "Error reading block. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1738 +#: src/stored/btape.c:1737 #, c-format msgid "" "Blk_block: %u dev_blk=%u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%" "s rlen=%d\n" msgstr "" -#: src/stored/btape.c:1760 +#: src/stored/btape.c:1759 #, c-format msgid "Device status: %u. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1788 +#: src/stored/btape.c:1789 msgid "" "\n" "This command simulates Bacula writing to a tape.\n" @@ -10376,95 +10506,98 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1805 +#: src/stored/btape.c:1806 msgid "" "Do you want to run the simplified test (s) with one tape\n" "or the complete multiple tape (m) test: (s/m) " msgstr "" -#: src/stored/btape.c:1808 +#: src/stored/btape.c:1809 msgid "Simple test (single tape) selected.\n" msgstr "" -#: src/stored/btape.c:1811 +#: src/stored/btape.c:1812 msgid "Multiple tape test selected.\n" msgstr "" -#: src/stored/btape.c:1827 +#: src/stored/btape.c:1828 msgid "Rewind failed.\n" msgstr "" -#: src/stored/btape.c:1830 +#: src/stored/btape.c:1831 msgid "Write EOF failed.\n" msgstr "" -#: src/stored/btape.c:1857 +#: src/stored/btape.c:1858 msgid "Wrote Start of Session label.\n" msgstr "" -#: src/stored/btape.c:1886 -msgid "Begin writing Bacula records to tape ...\n" +#: src/stored/btape.c:1889 +#, c-format +msgid "%s Begin writing Bacula records to tape ...\n" msgstr "" -#: src/stored/btape.c:1888 -msgid "Begin writing Bacula records to first tape ...\n" +#: src/stored/btape.c:1891 +#, c-format +msgid "%s Begin writing Bacula records to first tape ...\n" msgstr "" -#: src/stored/btape.c:1928 +#: src/stored/btape.c:1932 #, c-format msgid "Wrote blk_block=%u, dev_blk_num=%u VolBytes=%s rate=%.1f KB/s\n" msgstr "" -#: src/stored/btape.c:1935 -msgid "Flush block, write EOF\n" +#: src/stored/btape.c:1942 +#, c-format +msgid "%s Flush block, write EOF\n" msgstr "" -#: src/stored/btape.c:1946 +#: src/stored/btape.c:1953 msgid "Not OK\n" msgstr "" -#: src/stored/btape.c:1974 +#: src/stored/btape.c:1981 msgid "Set ok=false after write_block_to_device.\n" msgstr "" -#: src/stored/btape.c:1977 +#: src/stored/btape.c:1984 msgid "Wrote End of Session label.\n" msgstr "" -#: src/stored/btape.c:2001 +#: src/stored/btape.c:2008 #, c-format msgid "Wrote state file last_block_num1=%d last_block_num2=%d\n" msgstr "" -#: src/stored/btape.c:2005 +#: src/stored/btape.c:2012 #, c-format msgid "Could not create state file: %s ERR=%s\n" msgstr "" -#: src/stored/btape.c:2010 +#: src/stored/btape.c:2020 #, c-format msgid "" "\n" "\n" -"Done filling tape at %d:%d. Now beginning re-read of tape ...\n" +"%s Done filling tape at %d:%d. Now beginning re-read of tape ...\n" msgstr "" -#: src/stored/btape.c:2014 +#: src/stored/btape.c:2024 #, c-format msgid "" "\n" "\n" -"Done filling tapes at %d:%d. Now beginning re-read of first tape ...\n" +"%s Done filling tapes at %d:%d. Now beginning re-read of first tape ...\n" msgstr "" -#: src/stored/btape.c:2053 +#: src/stored/btape.c:2063 msgid "" "\n" "The state file level has changed. You must redo\n" "the fill command.\n" msgstr "" -#: src/stored/btape.c:2059 +#: src/stored/btape.c:2069 #, c-format msgid "" "\n" @@ -10472,95 +10605,95 @@ msgid "" "You must redo the fill command.\n" msgstr "" -#: src/stored/btape.c:2101 +#: src/stored/btape.c:2111 msgid "Mount first tape. Press enter when ready: " msgstr "" -#: src/stored/btape.c:2125 -msgid "Reading the first 10000 records.\n" +#: src/stored/btape.c:2131 +msgid "Rewinding.\n" msgstr "" -#: src/stored/btape.c:2128 src/stored/btape.c:2195 +#: src/stored/btape.c:2136 +#, c-format +msgid "Reading the first 10000 records from %u:%u.\n" +msgstr "" + +#: src/stored/btape.c:2140 src/stored/btape.c:2207 #, c-format msgid "Reposition from %u:%u to %u:%u\n" msgstr "" -#: src/stored/btape.c:2131 src/stored/btape.c:2182 src/stored/btape.c:2198 +#: src/stored/btape.c:2143 src/stored/btape.c:2194 src/stored/btape.c:2210 #, c-format msgid "Reposition error. ERR=%s\n" msgstr "" -#: src/stored/btape.c:2134 +#: src/stored/btape.c:2146 #, c-format msgid "Reading block %u.\n" msgstr "" -#: src/stored/btape.c:2136 src/stored/btape.c:2187 src/stored/btape.c:2203 +#: src/stored/btape.c:2148 src/stored/btape.c:2199 src/stored/btape.c:2215 #, c-format msgid "Error reading block: ERR=%s\n" msgstr "" -#: src/stored/btape.c:2141 +#: src/stored/btape.c:2153 msgid "" "\n" "The last block on the tape matches. Test succeeded.\n" "\n" msgstr "" -#: src/stored/btape.c:2143 +#: src/stored/btape.c:2155 msgid "" "\n" "The last block of the first tape matches.\n" "\n" msgstr "" -#: src/stored/btape.c:2168 +#: src/stored/btape.c:2180 msgid "Mount second tape. Press enter when ready: " msgstr "" -#: src/stored/btape.c:2180 +#: src/stored/btape.c:2192 #, c-format msgid "Reposition from %u:%u to 0:1\n" msgstr "" -#: src/stored/btape.c:2185 src/stored/btape.c:2201 +#: src/stored/btape.c:2197 src/stored/btape.c:2213 #, c-format msgid "Reading block %d.\n" msgstr "" -#: src/stored/btape.c:2191 +#: src/stored/btape.c:2203 msgid "" "\n" "The first block on the second tape matches.\n" "\n" msgstr "" -#: src/stored/btape.c:2207 +#: src/stored/btape.c:2219 msgid "" "\n" "The last block on the second tape matches. Test succeeded.\n" "\n" msgstr "" -#: src/stored/btape.c:2221 -#, c-format -msgid "ERROR! device at %d:%d count=%d\n" -msgstr "" - -#: src/stored/btape.c:2227 +#: src/stored/btape.c:2234 #, c-format -msgid "1000 records read now at %d:%d\n" +msgid "10000 records read now at %d:%d\n" msgstr "" -#: src/stored/btape.c:2250 src/stored/btape.c:2261 src/stored/btape.c:2309 +#: src/stored/btape.c:2257 src/stored/btape.c:2268 src/stored/btape.c:2316 msgid "Last block written" msgstr "" -#: src/stored/btape.c:2252 src/stored/btape.c:2262 +#: src/stored/btape.c:2259 src/stored/btape.c:2269 msgid "Block read back" msgstr "" -#: src/stored/btape.c:2253 +#: src/stored/btape.c:2260 #, c-format msgid "" "\n" @@ -10568,7 +10701,7 @@ msgid "" "The blocks differ at byte %u\n" msgstr "" -#: src/stored/btape.c:2254 +#: src/stored/btape.c:2261 msgid "" "\n" "\n" @@ -10578,177 +10711,177 @@ msgid "" "to write multi-tape Volumes.!!!!\n" msgstr "" -#: src/stored/btape.c:2293 +#: src/stored/btape.c:2300 #, c-format msgid "Last block at: %u:%u this_dev_block_num=%d\n" msgstr "" -#: src/stored/btape.c:2307 +#: src/stored/btape.c:2314 #, c-format msgid "Block not written: FileIndex=%u blk_block=%u Size=%u\n" msgstr "" -#: src/stored/btape.c:2311 +#: src/stored/btape.c:2318 msgid "Block not written" msgstr "" -#: src/stored/btape.c:2326 +#: src/stored/btape.c:2333 #, c-format msgid "End of tape %d:%d. VolumeCapacity=%s. Write rate = %.1f KB/s\n" msgstr "" -#: src/stored/btape.c:2376 +#: src/stored/btape.c:2383 msgid "Test writing blocks of 64512 bytes to tape.\n" msgstr "" -#: src/stored/btape.c:2378 +#: src/stored/btape.c:2385 msgid "How many blocks do you want to write? (1000): " msgstr "" -#: src/stored/btape.c:2393 +#: src/stored/btape.c:2400 #, c-format msgid "Begin writing %d Bacula blocks to tape ...\n" msgstr "" -#: src/stored/btape.c:2445 +#: src/stored/btape.c:2452 #, c-format msgid "Begin writing raw blocks of %u bytes.\n" msgstr "" -#: src/stored/btape.c:2465 +#: src/stored/btape.c:2472 #, c-format msgid "Write failed at block %u. stat=%d ERR=%s\n" msgstr "" -#: src/stored/btape.c:2495 +#: src/stored/btape.c:2502 #, c-format msgid "Begin writing Bacula blocks of %u bytes.\n" msgstr "" -#: src/stored/btape.c:2514 +#: src/stored/btape.c:2521 #, c-format msgid "Write failed at block %u.\n" msgstr "" -#: src/stored/btape.c:2521 +#: src/stored/btape.c:2528 msgid "test autochanger" msgstr "" -#: src/stored/btape.c:2522 +#: src/stored/btape.c:2529 msgid "backspace file" msgstr "" -#: src/stored/btape.c:2523 +#: src/stored/btape.c:2530 msgid "backspace record" msgstr "" -#: src/stored/btape.c:2524 +#: src/stored/btape.c:2531 msgid "fill tape using Bacula writes" msgstr "" -#: src/stored/btape.c:2525 +#: src/stored/btape.c:2532 msgid "list device capabilities" msgstr "" -#: src/stored/btape.c:2526 +#: src/stored/btape.c:2533 msgid "clear tape errors" msgstr "" -#: src/stored/btape.c:2527 +#: src/stored/btape.c:2534 msgid "go to end of Bacula data for append" msgstr "" -#: src/stored/btape.c:2528 +#: src/stored/btape.c:2535 msgid "go to the physical end of medium" msgstr "" -#: src/stored/btape.c:2529 +#: src/stored/btape.c:2536 msgid "fill tape, write onto second volume" msgstr "" -#: src/stored/btape.c:2530 +#: src/stored/btape.c:2537 msgid "read filled tape" msgstr "" -#: src/stored/btape.c:2531 +#: src/stored/btape.c:2538 msgid "forward space a file" msgstr "" -#: src/stored/btape.c:2532 +#: src/stored/btape.c:2539 msgid "forward space a record" msgstr "" -#: src/stored/btape.c:2534 +#: src/stored/btape.c:2541 msgid "write a Bacula label to the tape" msgstr "" -#: src/stored/btape.c:2535 +#: src/stored/btape.c:2542 msgid "load a tape" msgstr "" -#: src/stored/btape.c:2536 +#: src/stored/btape.c:2543 msgid "quit btape" msgstr "" -#: src/stored/btape.c:2537 +#: src/stored/btape.c:2544 msgid "use write() to fill tape" msgstr "" -#: src/stored/btape.c:2538 +#: src/stored/btape.c:2545 msgid "read and print the Bacula tape label" msgstr "" -#: src/stored/btape.c:2539 +#: src/stored/btape.c:2546 msgid "test record handling functions" msgstr "" -#: src/stored/btape.c:2540 +#: src/stored/btape.c:2547 msgid "rewind the tape" msgstr "" -#: src/stored/btape.c:2541 +#: src/stored/btape.c:2548 msgid "read() tape block by block to EOT and report" msgstr "" -#: src/stored/btape.c:2542 +#: src/stored/btape.c:2549 msgid "Bacula read block by block to EOT and report" msgstr "" -#: src/stored/btape.c:2543 +#: src/stored/btape.c:2550 msgid "print tape status" msgstr "" -#: src/stored/btape.c:2544 +#: src/stored/btape.c:2551 msgid "General test Bacula tape functions" msgstr "" -#: src/stored/btape.c:2545 +#: src/stored/btape.c:2552 msgid "write an EOF on the tape" msgstr "" -#: src/stored/btape.c:2546 +#: src/stored/btape.c:2553 msgid "write a single Bacula block" msgstr "" -#: src/stored/btape.c:2547 +#: src/stored/btape.c:2554 msgid "read a single record" msgstr "" -#: src/stored/btape.c:2548 +#: src/stored/btape.c:2555 msgid "quick fill command" msgstr "" -#: src/stored/btape.c:2569 +#: src/stored/btape.c:2576 #, c-format msgid "%s is an illegal command\n" msgstr "" -#: src/stored/btape.c:2579 +#: src/stored/btape.c:2586 #, c-format msgid "Interactive commands:\n" msgstr "" -#: src/stored/btape.c:2589 +#: src/stored/btape.c:2596 #, c-format msgid "" "Copyright (C) 2000-2005 Kern Sibbald.\n" @@ -10766,27 +10899,27 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:2680 +#: src/stored/btape.c:2687 #, c-format msgid "Mount second Volume on device %s and press return when ready: " msgstr "" -#: src/stored/btape.c:2707 +#: src/stored/btape.c:2714 #, c-format msgid "Mount blank Volume on device %s and press return when ready: " msgstr "" -#: src/stored/btape.c:2725 +#: src/stored/btape.c:2732 #, c-format msgid "End of Volume \"%s\"\n" msgstr "" -#: src/stored/btape.c:2737 +#: src/stored/btape.c:2744 #, c-format msgid "Read block=%u, VolBytes=%s rate=%.1f KB/s\n" msgstr "" -#: src/stored/btape.c:2752 src/stored/mount.c:493 +#: src/stored/btape.c:2759 src/stored/mount.c:500 #, c-format msgid "Cannot open Dev=%s, Vol=%s\n" msgstr "" @@ -10811,358 +10944,345 @@ msgstr "" msgid "cont," msgstr "" -#: src/stored/butil.c:128 +#: src/stored/butil.c:130 msgid "Volume name or names is too long. Please use a .bsr file.\n" msgstr "" -#: src/stored/butil.c:148 +#: src/stored/butil.c:150 #, c-format msgid "Cannot find device \"%s\" in config file %s.\n" msgstr "" -#: src/stored/butil.c:155 +#: src/stored/butil.c:157 #, c-format msgid "Cannot init device %s\n" msgstr "" -#: src/stored/butil.c:174 +#: src/stored/butil.c:178 #, c-format msgid "Cannot open %s\n" msgstr "" -#: src/stored/butil.c:253 +#: src/stored/butil.c:261 #, c-format msgid "Could not find device \"%s\" in config file %s.\n" msgstr "" -#: src/stored/butil.c:258 +#: src/stored/butil.c:266 #, c-format msgid "Using device: \"%s\" for reading.\n" msgstr "" -#: src/stored/butil.c:261 +#: src/stored/butil.c:269 #, c-format msgid "Using device: \"%s\" for writing.\n" msgstr "" -#: src/stored/butil.c:277 +#: src/stored/butil.c:285 msgid "Unexpected End of Data\n" msgstr "" -#: src/stored/butil.c:279 +#: src/stored/butil.c:287 msgid "Unexpected End of Tape\n" msgstr "" -#: src/stored/butil.c:281 +#: src/stored/butil.c:289 msgid "Unexpected End of File\n" msgstr "" -#: src/stored/butil.c:283 +#: src/stored/butil.c:291 msgid "Tape Door is Open\n" msgstr "" -#: src/stored/butil.c:285 +#: src/stored/butil.c:293 msgid "Unexpected Tape is Off-line\n" msgstr "" -#: src/stored/dev.c:110 +#: src/stored/dev.c:112 #, c-format msgid "Unable to stat device %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:125 +#: src/stored/dev.c:123 #, c-format msgid "" "%s is an unknown device type. Must be tape or directory\n" " or have RequiresMount=yes for DVD. st_mode=%x\n" msgstr "" -#: src/stored/dev.c:183 +#: src/stored/dev.c:179 #, c-format msgid "Unable to stat mount point %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:188 +#: src/stored/dev.c:186 msgid "" "Mount and unmount commands must defined for a device which requires mount.\n" msgstr "" -#: src/stored/dev.c:191 +#: src/stored/dev.c:189 msgid "Write part command must be defined for a device which requires mount.\n" msgstr "" -#: src/stored/dev.c:197 +#: src/stored/dev.c:194 #, c-format msgid "Block size %u on device %s is too large, using default %u\n" msgstr "" -#: src/stored/dev.c:202 +#: src/stored/dev.c:199 #, c-format msgid "Max block size %u not multiple of device %s block size.\n" msgstr "" -#: src/stored/dev.c:218 src/stored/dev.c:224 +#: src/stored/dev.c:215 src/stored/dev.c:221 #, c-format msgid "Unable to init cond variable: ERR=%s\n" msgstr "" -#: src/stored/dev.c:310 +#: src/stored/dev.c:312 msgid "Illegal mode given to open dev.\n" msgstr "" -#: src/stored/dev.c:376 src/stored/device.c:302 +#: src/stored/dev.c:355 src/stored/device.c:295 #, c-format msgid "Unable to open device %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:396 -#, c-format -msgid "fcntl error. ERR=%s\n" -msgstr "" - -#: src/stored/dev.c:434 src/stored/dev.c:493 +#: src/stored/dev.c:423 src/stored/dev.c:481 #, c-format msgid "Could not open file device %s. No Volume name given.\n" msgstr "" -#: src/stored/dev.c:459 src/stored/dev.c:573 +#: src/stored/dev.c:449 src/stored/dev.c:562 #, c-format msgid "Could not open: %s, ERR=%s\n" msgstr "" -#: src/stored/dev.c:518 +#: src/stored/dev.c:506 #, c-format msgid "" "The media in the device %s is not empty, please blank it before writing " "anything to it.\n" msgstr "" -#: src/stored/dev.c:534 +#: src/stored/dev.c:523 #, c-format msgid "There is no valid media in the device %s.\n" msgstr "" -#: src/stored/dev.c:541 +#: src/stored/dev.c:530 #, c-format msgid "Could not mount device %s.\n" msgstr "" -#: src/stored/dev.c:599 +#: src/stored/dev.c:588 #, c-format msgid "Could not fstat: %s, ERR=%s\n" msgstr "" -#: src/stored/dev.c:652 +#: src/stored/dev.c:631 #, c-format -msgid "Bad call to rewind_dev. Device %s not open\n" +msgid "Bad call to rewind. Device %s not open\n" msgstr "" -#: src/stored/dev.c:681 +#: src/stored/dev.c:677 #, c-format msgid "Rewind error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:691 src/stored/dev.c:804 src/stored/dev.c:941 -#: src/stored/dev.c:1466 +#: src/stored/dev.c:687 src/stored/dev.c:802 src/stored/dev.c:938 +#: src/stored/dev.c:1457 #, c-format msgid "lseek_dev error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:731 +#: src/stored/dev.c:727 msgid "unknown blocked code" msgstr "" -#: src/stored/dev.c:774 +#: src/stored/dev.c:772 #, c-format msgid "Bad call to eod_dev. Device %s not open\n" msgstr "" -#: src/stored/dev.c:840 +#: src/stored/dev.c:838 #, c-format msgid "ioctl MTEOM error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:848 src/stored/dev.c:981 +#: src/stored/dev.c:846 src/stored/dev.c:978 #, c-format msgid "ioctl MTIOCGET error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:927 +#: src/stored/dev.c:924 msgid "Bad device call. Device not open\n" msgstr "" -#: src/stored/dev.c:940 +#: src/stored/dev.c:937 #, c-format msgid "Seek error: ERR=%s\n" msgstr "" -#: src/stored/dev.c:976 +#: src/stored/dev.c:973 msgid " Bacula status:" msgstr "" -#: src/stored/dev.c:977 src/stored/dev.c:1026 src/stored/dev.c:1028 +#: src/stored/dev.c:974 src/stored/dev.c:1023 src/stored/dev.c:1025 #, c-format msgid " file=%d block=%d\n" msgstr "" -#: src/stored/dev.c:985 +#: src/stored/dev.c:982 msgid " Device status:" msgstr "" -#: src/stored/dev.c:1050 +#: src/stored/dev.c:1047 msgid "Bad call to load_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1061 src/stored/dev.c:1074 +#: src/stored/dev.c:1058 src/stored/dev.c:1071 #, c-format msgid "ioctl MTLOAD error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1093 -msgid "Bad call to offline_dev. Device not open\n" -msgstr "" - -#: src/stored/dev.c:1116 +#: src/stored/dev.c:1107 #, c-format msgid "ioctl MTOFFL error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1157 +#: src/stored/dev.c:1148 msgid "Bad call to fsf_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1167 src/stored/dev.c:1288 +#: src/stored/dev.c:1158 src/stored/dev.c:1279 #, c-format msgid "Device %s at End of Tape.\n" msgstr "" -#: src/stored/dev.c:1192 src/stored/dev.c:1268 +#: src/stored/dev.c:1183 src/stored/dev.c:1259 #, c-format msgid "ioctl MTFSF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1317 +#: src/stored/dev.c:1308 msgid "Bad call to bsf_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1323 +#: src/stored/dev.c:1314 #, c-format msgid "Device %s cannot BSF because it is not a tape.\n" msgstr "" -#: src/stored/dev.c:1338 +#: src/stored/dev.c:1329 #, c-format msgid "ioctl MTBSF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1358 +#: src/stored/dev.c:1349 msgid "Bad call to fsr. Device not open\n" msgstr "" -#: src/stored/dev.c:1367 +#: src/stored/dev.c:1358 #, c-format msgid "ioctl MTFSR not permitted on %s.\n" msgstr "" -#: src/stored/dev.c:1395 +#: src/stored/dev.c:1386 #, c-format msgid "ioctl MTFSR %d error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1415 +#: src/stored/dev.c:1406 msgid "Bad call to bsr_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1425 +#: src/stored/dev.c:1416 #, c-format msgid "ioctl MTBSR not permitted on %s.\n" msgstr "" -#: src/stored/dev.c:1438 +#: src/stored/dev.c:1429 #, c-format msgid "ioctl MTBSR error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1455 +#: src/stored/dev.c:1446 msgid "Bad call to reposition_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1523 +#: src/stored/dev.c:1514 msgid "Bad call to weof_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1533 +#: src/stored/dev.c:1524 msgid "Attempt to WEOF on non-appendable Volume\n" msgstr "" -#: src/stored/dev.c:1550 +#: src/stored/dev.c:1541 #, c-format msgid "ioctl MTWEOF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1592 +#: src/stored/dev.c:1583 msgid "Got ENOTTY on read/write!\n" msgstr "" -#: src/stored/dev.c:1639 +#: src/stored/dev.c:1630 #, c-format msgid "unknown func code %d" msgstr "" -#: src/stored/dev.c:1645 +#: src/stored/dev.c:1636 #, c-format msgid "I/O function \"%s\" not supported on this device.\n" msgstr "" -#: src/stored/dev.c:1783 src/stored/dvd.c:668 +#: src/stored/dev.c:1761 src/stored/dvd.c:734 #, c-format msgid "Unable to truncate device %s. ERR=%s\n" msgstr "" -#: src/stored/dev.c:1822 +#: src/stored/dev.c:1800 msgid "Bad call to term_dev. Device not open\n" msgstr "" -#: src/stored/device.c:105 +#: src/stored/device.c:100 #, c-format msgid "End of medium on Volume \"%s\" Bytes=%s Blocks=%s at %s.\n" msgstr "" -#: src/stored/device.c:119 +#: src/stored/device.c:114 #, c-format msgid "New volume \"%s\" mounted on device %s at %s.\n" msgstr "" -#: src/stored/device.c:131 +#: src/stored/device.c:126 #, c-format msgid "write_block_to_device Volume label failed. ERR=%s" msgstr "" -#: src/stored/device.c:168 +#: src/stored/device.c:162 #, c-format msgid "write_block_to_device overflow block failed. ERR=%s" msgstr "" -#: src/stored/device.c:304 +#: src/stored/device.c:297 #, c-format msgid "Unable to open archive %s: ERR=%s\n" msgstr "" -#: src/stored/device.c:328 -msgid "Bad call to force_close_dev. Device not open\n" -msgstr "" - -#: src/stored/device.c:346 +#: src/stored/device.c:332 #, c-format msgid "Device write lock failure. ERR=%s\n" msgstr "" -#: src/stored/device.c:354 +#: src/stored/device.c:340 #, c-format msgid "Device write unlock failure. ERR=%s\n" msgstr "" -#: src/stored/device.c:373 +#: src/stored/device.c:359 #, c-format msgid "pthread_cond_wait failure. ERR=%s\n" msgstr "" @@ -11183,72 +11303,72 @@ msgstr "" #: src/stored/dircmd.c:262 #, c-format -msgid "3902 Job %s not found.\n" +msgid "3904 Job %s not found.\n" msgstr "" -#: src/stored/dircmd.c:279 +#: src/stored/dircmd.c:283 #, c-format msgid "3000 Job %s marked to be canceled.\n" msgstr "" -#: src/stored/dircmd.c:283 +#: src/stored/dircmd.c:287 msgid "3903 Error scanning cancel command.\n" msgstr "" -#: src/stored/dircmd.c:356 src/stored/dircmd.c:655 src/stored/dircmd.c:720 -#: src/stored/dircmd.c:779 src/stored/dircmd.c:829 src/stored/dircmd.c:869 +#: src/stored/dircmd.c:364 src/stored/dircmd.c:680 src/stored/dircmd.c:756 +#: src/stored/dircmd.c:819 src/stored/dircmd.c:874 src/stored/dircmd.c:918 #, c-format -msgid "3999 Device \"%s\" not found\n" +msgid "3999 Device \"%s\" not found or could not be opened.\n" msgstr "" -#: src/stored/dircmd.c:361 +#: src/stored/dircmd.c:369 #, c-format msgid "3903 Error scanning label command: %s\n" msgstr "" -#: src/stored/dircmd.c:405 +#: src/stored/dircmd.c:412 #, c-format msgid "3920 Cannot label Volume because it is already labeled: \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:411 +#: src/stored/dircmd.c:419 msgid "3921 Wrong volume mounted.\n" msgstr "" -#: src/stored/dircmd.c:415 +#: src/stored/dircmd.c:423 msgid "3922 Cannot relabel an ANSI/IBM labeled Volume.\n" msgstr "" -#: src/stored/dircmd.c:423 src/stored/dircmd.c:432 +#: src/stored/dircmd.c:431 src/stored/dircmd.c:440 #, c-format msgid "3912 Failed to label Volume: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:435 +#: src/stored/dircmd.c:443 #, c-format msgid "3913 Cannot label Volume. Unknown status %d from read_volume_label()\n" msgstr "" -#: src/stored/dircmd.c:468 +#: src/stored/dircmd.c:476 #, c-format msgid "3001 Mounted Volume: %s\n" msgstr "" -#: src/stored/dircmd.c:472 src/stored/dircmd.c:905 +#: src/stored/dircmd.c:480 src/stored/dircmd.c:954 #, c-format msgid "" "3902 Cannot mount Volume on Storage Device %s because:\n" "%s" msgstr "" -#: src/stored/dircmd.c:495 src/stored/reserve.c:554 +#: src/stored/dircmd.c:508 src/stored/reserve.c:634 #, c-format msgid "" "\n" " Device \"%s\" requested by DIR could not be opened or does not exist.\n" msgstr "" -#: src/stored/dircmd.c:516 src/stored/reserve.c:550 +#: src/stored/dircmd.c:529 src/stored/reserve.c:630 #, c-format msgid "" "\n" @@ -11256,151 +11376,217 @@ msgid "" "does not exist.\n" msgstr "" -#: src/stored/dircmd.c:575 src/stored/dircmd.c:623 +#: src/stored/dircmd.c:593 src/stored/dircmd.c:646 #, c-format msgid "3901 open device failed: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:590 src/stored/dircmd.c:614 +#: src/stored/dircmd.c:613 src/stored/dircmd.c:637 #, c-format msgid "3001 Device %s is mounted with Volume \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:593 src/stored/dircmd.c:617 src/stored/dircmd.c:632 +#: src/stored/dircmd.c:616 src/stored/dircmd.c:640 src/stored/dircmd.c:655 #, c-format msgid "" "3905 Device %s open but no Bacula volume is mounted.\n" "If this is not a blank tape, try unmounting and remounting the Volume.\n" msgstr "" -#: src/stored/dircmd.c:602 +#: src/stored/dircmd.c:625 #, c-format msgid "3001 Device %s is doing acquire.\n" msgstr "" -#: src/stored/dircmd.c:607 src/stored/dircmd.c:698 +#: src/stored/dircmd.c:630 src/stored/dircmd.c:730 #, c-format msgid "3903 Device %s is being labeled.\n" msgstr "" -#: src/stored/dircmd.c:629 +#: src/stored/dircmd.c:652 #, c-format msgid "3001 Device %s is already mounted with Volume \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:638 +#: src/stored/dircmd.c:661 #, c-format msgid "3002 Device %s is mounted.\n" msgstr "" -#: src/stored/dircmd.c:641 +#: src/stored/dircmd.c:664 #, c-format msgid "3907 %s" msgstr "" -#: src/stored/dircmd.c:644 +#: src/stored/dircmd.c:667 #, c-format msgid "3906 File device %s is always mounted.\n" msgstr "" -#: src/stored/dircmd.c:650 +#: src/stored/dircmd.c:673 #, c-format msgid "3905 Bizarre wait state %d\n" msgstr "" -#: src/stored/dircmd.c:659 +#: src/stored/dircmd.c:684 #, c-format msgid "3909 Error scanning mount command: %s\n" msgstr "" -#: src/stored/dircmd.c:681 +#: src/stored/dircmd.c:711 #, c-format msgid "3901 Device %s is already unmounted.\n" msgstr "" -#: src/stored/dircmd.c:690 +#: src/stored/dircmd.c:722 #, c-format msgid "3001 Device %s unmounted.\n" msgstr "" -#: src/stored/dircmd.c:694 +#: src/stored/dircmd.c:726 #, c-format msgid "3902 Device %s is busy in acquire.\n" msgstr "" -#: src/stored/dircmd.c:715 +#: src/stored/dircmd.c:749 #, c-format msgid "3002 Device %s unmounted.\n" msgstr "" -#: src/stored/dircmd.c:725 +#: src/stored/dircmd.c:761 #, c-format msgid "3907 Error scanning unmount command: %s\n" msgstr "" -#: src/stored/dircmd.c:751 +#: src/stored/dircmd.c:789 #, c-format -msgid "3911 Device %s already released.\n" +msgid "3921 Device %s already released.\n" msgstr "" -#: src/stored/dircmd.c:758 +#: src/stored/dircmd.c:796 #, c-format -msgid "3912 Device %s waiting for mount.\n" +msgid "3922 Device %s waiting for mount.\n" msgstr "" -#: src/stored/dircmd.c:762 +#: src/stored/dircmd.c:800 #, c-format -msgid "3913 Device %s is busy in acquire.\n" +msgid "3923 Device %s is busy in acquire.\n" msgstr "" -#: src/stored/dircmd.c:766 +#: src/stored/dircmd.c:804 #, c-format msgid "3914 Device %s is being labeled.\n" msgstr "" -#: src/stored/dircmd.c:774 +#: src/stored/dircmd.c:812 #, c-format -msgid "3012 Device %s released.\n" +msgid "3022 Device %s released.\n" msgstr "" -#: src/stored/dircmd.c:784 +#: src/stored/dircmd.c:824 #, c-format -msgid "3917 Error scanning release command: %s\n" +msgid "3927 Error scanning release command: %s\n" msgstr "" -#: src/stored/dircmd.c:817 +#: src/stored/dircmd.c:860 #, c-format msgid "3995 Device %s is not an autochanger.\n" msgstr "" -#: src/stored/dircmd.c:833 +#: src/stored/dircmd.c:878 #, c-format -msgid "3908 Error scanning autocharger list/slots command: %s\n" +msgid "3908 Error scanning autocharger drives/list/slots command: %s\n" msgstr "" -#: src/stored/dircmd.c:873 +#: src/stored/dircmd.c:922 #, c-format msgid "3909 Error scanning readlabel command: %s\n" msgstr "" -#: src/stored/dircmd.c:901 +#: src/stored/dircmd.c:950 #, c-format msgid "3001 Volume=%s Slot=%d\n" msgstr "" -#: src/stored/dircmd.c:930 +#: src/stored/dircmd.c:979 #, c-format msgid "3910 Unable to open device %s: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:940 +#: src/stored/dircmd.c:991 +#, c-format +msgid "3931 Device %s is BLOCKED. user unmounted.\n" +msgstr "" + +#: src/stored/dircmd.c:995 +#, c-format +msgid "" +"3932 Device %s is BLOCKED. user unmounted during wait for media/mount.\n" +msgstr "" + +#: src/stored/dircmd.c:999 +#, c-format +msgid "3933 Device %s is BLOCKED waiting for media.\n" +msgstr "" + +#: src/stored/dircmd.c:1003 +#, c-format +msgid "3934 Device %s is being initialized.\n" +msgstr "" + +#: src/stored/dircmd.c:1007 +#, c-format +msgid "3935 Device %s is blocked labeling a Volume.\n" +msgstr "" + +#: src/stored/dircmd.c:1011 +#, c-format +msgid "3935 Device %s is blocked for unknown reason.\n" +msgstr "" + +#: src/stored/dircmd.c:1016 +#, c-format +msgid "3936 Device %s is busy reading.\n" +msgstr "" + +#: src/stored/dircmd.c:1019 +#, c-format +msgid "3937 Device %s is busy with %d writer(s).\n" +msgstr "" + +#: src/stored/dvd.c:153 +#, c-format +msgid "Device %s cannot be mounted. ERR=%s\n" +msgstr "" + +#: src/stored/dvd.c:271 +#, c-format +msgid "Cannot run free space command (%s)\n" +msgstr "" + +#: src/stored/dvd.c:374 +#, c-format +msgid "Error while writing current part to the DVD: %s" +msgstr "" + +#: src/stored/dvd.c:394 +#, c-format +msgid "Remaining free space %s on %s\n" +msgstr "" + +#: src/stored/dvd.c:464 +#, c-format +msgid "Next Volume part already exists on DVD. Cannot continue: %s\n" +msgstr "" + +#: src/stored/dvd.c:481 #, c-format -msgid "3911 Device %s is busy reading.\n" +msgid "open_next_part can't unlink existing part %s, ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:943 +#: src/stored/dvd.c:700 #, c-format -msgid "3912 Device %s is busy with %d writer(s).\n" +msgid "Unable to write part %s: ERR=%s\n" msgstr "" #: src/stored/fd_cmds.c:340 @@ -11484,52 +11670,52 @@ msgstr "" msgid "Cannot write Volume label to block for device %s\n" msgstr "" -#: src/stored/label.c:393 +#: src/stored/label.c:400 #, c-format msgid "Rewind error on device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:398 +#: src/stored/label.c:405 #, c-format msgid "Truncate error on device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:420 +#: src/stored/label.c:427 #, c-format msgid "Unable to write device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:448 +#: src/stored/label.c:455 #, c-format msgid "Recycled volume \"%s\" on device %s, all previous data lost.\n" msgstr "" -#: src/stored/label.c:451 +#: src/stored/label.c:458 #, c-format msgid "Wrote label to prelabeled Volume \"%s\" on device %s\n" msgstr "" -#: src/stored/label.c:648 +#: src/stored/label.c:657 #, c-format msgid "Bad session label = %d\n" msgstr "" -#: src/stored/label.c:666 src/stored/label.c:673 +#: src/stored/label.c:675 src/stored/label.c:682 #, c-format msgid "Error writing Session label to %s: %s\n" msgstr "" -#: src/stored/label.c:707 +#: src/stored/label.c:717 #, c-format msgid "Expecting Volume Label, got FI=%s Stream=%s len=%d\n" msgstr "" -#: src/stored/label.c:834 +#: src/stored/label.c:844 #, c-format msgid "Unknown %d" msgstr "" -#: src/stored/label.c:838 +#: src/stored/label.c:848 #, c-format msgid "" "\n" @@ -11546,17 +11732,17 @@ msgid "" "HostName : %s\n" msgstr "" -#: src/stored/label.c:860 +#: src/stored/label.c:870 #, c-format msgid "Date label written: %s\n" msgstr "" -#: src/stored/label.c:866 +#: src/stored/label.c:876 #, c-format msgid "Date label written: %04d-%02d-%02d at %02d:%02d\n" msgstr "" -#: src/stored/label.c:886 +#: src/stored/label.c:896 #, c-format msgid "" "\n" @@ -11569,7 +11755,7 @@ msgid "" "ClientName : %s\n" msgstr "" -#: src/stored/label.c:899 +#: src/stored/label.c:909 #, c-format msgid "" "Job (unique name) : %s\n" @@ -11578,7 +11764,7 @@ msgid "" "JobLevel : %c\n" msgstr "" -#: src/stored/label.c:908 +#: src/stored/label.c:918 #, c-format msgid "" "JobFiles : %s\n" @@ -11591,62 +11777,62 @@ msgid "" "JobStatus : %c\n" msgstr "" -#: src/stored/label.c:929 +#: src/stored/label.c:939 #, c-format msgid "Date written : %s\n" msgstr "" -#: src/stored/label.c:934 +#: src/stored/label.c:944 #, c-format msgid "Date written : %04d-%02d-%02d at %02d:%02d\n" msgstr "" -#: src/stored/label.c:953 +#: src/stored/label.c:963 msgid "Fresh Volume" msgstr "" -#: src/stored/label.c:956 +#: src/stored/label.c:966 msgid "Volume" msgstr "" -#: src/stored/label.c:965 src/stored/read_record.c:335 +#: src/stored/label.c:975 src/stored/read_record.c:336 msgid "End of Media" msgstr "" -#: src/stored/label.c:968 +#: src/stored/label.c:978 msgid "End of Tape" msgstr "" -#: src/stored/label.c:988 src/stored/label.c:996 src/stored/label.c:1029 +#: src/stored/label.c:998 src/stored/label.c:1006 src/stored/label.c:1039 #, c-format msgid "%s Record: File:blk=%u:%u SessId=%d SessTime=%d JobId=%d DataLen=%d\n" msgstr "" -#: src/stored/label.c:993 +#: src/stored/label.c:1003 msgid "End of physical tape.\n" msgstr "" -#: src/stored/label.c:1008 src/stored/label.c:1017 +#: src/stored/label.c:1018 src/stored/label.c:1027 #, c-format msgid "%s Record: File:blk=%u:%u SessId=%d SessTime=%d JobId=%d\n" msgstr "" -#: src/stored/label.c:1010 +#: src/stored/label.c:1020 #, c-format msgid " Job=%s Date=%s Level=%c Type=%c\n" msgstr "" -#: src/stored/label.c:1019 +#: src/stored/label.c:1029 #, c-format msgid " Date=%s Level=%c Type=%c Files=%s Bytes=%s Errors=%d Status=%c\n" msgstr "" -#: src/stored/mount.c:197 src/stored/mount.c:294 +#: src/stored/mount.c:198 src/stored/mount.c:295 #, c-format msgid "Volume \"%s\" not on device %s.\n" msgstr "" -#: src/stored/mount.c:230 +#: src/stored/mount.c:231 #, c-format msgid "" "Director wanted Volume \"%s\".\n" @@ -11654,51 +11840,65 @@ msgid "" " %s" msgstr "" -#: src/stored/mount.c:284 +#: src/stored/mount.c:285 #, c-format msgid "Labeled new Volume \"%s\" on device %s.\n" msgstr "" -#: src/stored/mount.c:289 +#: src/stored/mount.c:290 #, c-format msgid "Warning device %s not configured to autolabel Volumes.\n" msgstr "" -#: src/stored/mount.c:340 +#: src/stored/mount.c:342 #, c-format msgid "Volume \"%s\" previously written, moving to end of data.\n" msgstr "" -#: src/stored/mount.c:343 +#: src/stored/mount.c:345 #, c-format msgid "Unable to position to end of data on device %s: ERR=%s\n" msgstr "" -#: src/stored/mount.c:355 +#: src/stored/mount.c:357 #, c-format msgid "Ready to append to end of Volume \"%s\" at file=%d.\n" msgstr "" -#: src/stored/mount.c:358 +#: src/stored/mount.c:360 #, c-format msgid "" "I cannot write on Volume \"%s\" because:\n" "The number of files mismatch! Volume=%u Catalog=%u\n" msgstr "" -#: src/stored/mount.c:411 +#: src/stored/mount.c:388 +#, c-format +msgid "Ready to append to end of Volume \"%s\" at file address=%u.\n" +msgstr "" + +#: src/stored/mount.c:392 +#, c-format +msgid "" +"I cannot write on Volume \"%s\" because:\n" +"The EOD file address is wrong: Volume file address=%u != Catalog Endblock=%u" +"(+1)\n" +"You probably removed DVD last part in spool directory.\n" +msgstr "" + +#: src/stored/mount.c:418 #, c-format msgid "Marking Volume \"%s\" in Error in Catalog.\n" msgstr "" -#: src/stored/mount.c:427 +#: src/stored/mount.c:434 #, c-format msgid "" "Autochanger Volume \"%s\" not found in slot %d.\n" " Setting InChanger to zero in catalog.\n" msgstr "" -#: src/stored/mount.c:446 +#: src/stored/mount.c:453 msgid "Hey!!!!! WroteVol non-zero !!!!!\n" msgstr "" @@ -11832,13 +12032,26 @@ msgstr "" msgid "fast_reject : %d\n" msgstr "" -#: src/stored/read.c:55 -msgid "No Volume names found for restore.\n" +#: src/stored/pythonsd.c:202 +msgid "Error in ParseTuple\n" msgstr "" -#: src/stored/read.c:109 -#, c-format -msgid ">filed: Error Hdr=%s\n" +#: src/stored/pythonsd.c:218 +msgid "Parse tuple error in job_write\n" +msgstr "" + +#: src/stored/pythonsd.c:254 +#, c-format +msgid "Error in Python method %s\n" +msgstr "" + +#: src/stored/read.c:55 +msgid "No Volume names found for restore.\n" +msgstr "" + +#: src/stored/read.c:109 +#, c-format +msgid ">filed: Error Hdr=%s\n" msgstr "" #: src/stored/read.c:110 src/stored/read.c:125 @@ -11869,38 +12082,115 @@ msgstr "" msgid "Did fsr\n" msgstr "" -#: src/stored/read_record.c:275 +#: src/stored/read_record.c:276 #, c-format msgid "Reposition from (file:block) %u:%u to %u:%u\n" msgstr "" -#: src/stored/read_record.c:302 +#: src/stored/read_record.c:303 #, c-format msgid "Forward spacing to file:block %u:%u.\n" msgstr "" -#: src/stored/read_record.c:328 +#: src/stored/read_record.c:329 msgid "Begin Session" msgstr "" -#: src/stored/read_record.c:332 +#: src/stored/read_record.c:333 msgid "End Session" msgstr "" -#: src/stored/read_record.c:338 +#: src/stored/read_record.c:339 #, c-format msgid "Unknown code %d\n" msgstr "" -#: src/stored/record.c:61 +#: src/stored/record.c:60 #, c-format msgid "unknown: %d" msgstr "" -#: src/stored/record.c:332 +#: src/stored/record.c:343 msgid "Damaged buffer\n" msgstr "" +#: src/stored/reserve.c:467 src/stored/reserve.c:479 +#, c-format +msgid "Failed command: %s\n" +msgstr "" + +#: src/stored/reserve.c:469 +#, c-format +msgid "" +"\n" +" Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD " +"Device resources.\n" +msgstr "" + +#: src/stored/reserve.c:647 +#, c-format +msgid "3926 Could not get dcr for device: %s\n" +msgstr "" + +#: src/stored/reserve.c:709 +#, c-format +msgid "3601 JobId=%u device %s is BLOCKED due to user unmount.\n" +msgstr "" + +#: src/stored/reserve.c:718 +#, c-format +msgid "3602 JobId=%u device %s is busy (already reading/writing).\n" +msgstr "" + +#: src/stored/reserve.c:761 +#, c-format +msgid "3603 JobId=%u device %s is busy reading.\n" +msgstr "" + +#: src/stored/reserve.c:770 +#, c-format +msgid "3604 JobId=%u device %s is BLOCKED due to user unmount.\n" +msgstr "" + +#: src/stored/reserve.c:836 +#, c-format +msgid "3605 JobId=%u wants free drive but device %s is busy.\n" +msgstr "" + +#: src/stored/reserve.c:844 +#, c-format +msgid "3606 JobId=%u wants mounted, but drive %s has no Volume.\n" +msgstr "" + +#: src/stored/reserve.c:854 +#, c-format +msgid "3607 JobId=%u wants Vol=\"%s\" drive has Vol=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:890 +#, c-format +msgid "3608 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:933 +#, c-format +msgid "3609 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:941 src/stored/reserve.c:945 +msgid "Logic error!!!! Should not get here.\n" +msgstr "" + +#: src/stored/reserve.c:942 +#, c-format +msgid "3910 JobId=%u Logic error!!!! drive %s Should not get here.\n" +msgstr "" + +#: src/stored/reserve.c:948 +#, c-format +msgid "3911 JobId=%u failed reserve drive %s.\n" +msgstr "" + #: src/stored/spool.c:69 #, c-format msgid "" @@ -11928,256 +12218,272 @@ msgstr "" #: src/stored/spool.c:199 #, c-format -msgid "Committing spooled data to Volume. Despooling %s bytes ...\n" +msgid "Committing spooled data to Volume \"%s\". Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:203 +#: src/stored/spool.c:204 #, c-format msgid "Writing spooled data to Volume. Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:257 src/stored/spool.c:431 src/stored/spool.c:469 +#: src/stored/spool.c:258 src/stored/spool.c:432 src/stored/spool.c:470 #, c-format msgid "Ftruncate spool file failed: ERR=%s\n" msgstr "" -#: src/stored/spool.c:259 +#: src/stored/spool.c:260 #, c-format msgid "Bad return from ftruncate. ERR=%s\n" msgstr "" -#: src/stored/spool.c:308 +#: src/stored/spool.c:309 #, c-format msgid "Spool header read error. ERR=%s\n" msgstr "" -#: src/stored/spool.c:311 +#: src/stored/spool.c:312 #, c-format msgid "Spool read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:312 +#: src/stored/spool.c:313 #, c-format msgid "Spool header read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:318 src/stored/spool.c:319 +#: src/stored/spool.c:319 src/stored/spool.c:320 #, c-format msgid "Spool block too big. Max %u bytes, got %u\n" msgstr "" -#: src/stored/spool.c:324 src/stored/spool.c:325 +#: src/stored/spool.c:325 src/stored/spool.c:326 #, c-format msgid "Spool data read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:382 +#: src/stored/spool.c:383 msgid "User specified spool size reached.\n" msgstr "" -#: src/stored/spool.c:384 +#: src/stored/spool.c:385 msgid "Bad return from despool in write_block.\n" msgstr "" -#: src/stored/spool.c:392 +#: src/stored/spool.c:393 msgid "Spooling data again ...\n" msgstr "" -#: src/stored/spool.c:423 +#: src/stored/spool.c:424 #, c-format msgid "Error writing header to spool file. ERR=%s\n" msgstr "" -#: src/stored/spool.c:437 src/stored/spool.c:475 +#: src/stored/spool.c:438 src/stored/spool.c:476 msgid "Fatal despooling error." msgstr "" -#: src/stored/spool.c:444 +#: src/stored/spool.c:445 msgid "Retrying after header spooling error failed.\n" msgstr "" -#: src/stored/spool.c:458 +#: src/stored/spool.c:459 #, c-format msgid "Error writing data to spool file. ERR=%s\n" msgstr "" -#: src/stored/spool.c:485 +#: src/stored/spool.c:486 msgid "Retrying after data spooling error failed.\n" msgstr "" -#: src/stored/spool.c:540 src/stored/spool.c:547 +#: src/stored/spool.c:541 src/stored/spool.c:548 #, c-format msgid "Fseek on attributes file failed: ERR=%s\n" msgstr "" -#: src/stored/spool.c:557 +#: src/stored/spool.c:558 #, c-format msgid "Sending spooled attrs to the Director. Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:584 +#: src/stored/spool.c:585 #, c-format msgid "fopen attr spool file %s failed: ERR=%s\n" msgstr "" -#: src/stored/status.c:66 +#: src/stored/status.c:67 #, c-format msgid "" "\n" "%s Version: %s (%s) %s %s %s\n" msgstr "" -#: src/stored/status.c:97 +#: src/stored/status.c:103 msgid "" "\n" "Device status:\n" msgstr "" -#: src/stored/status.c:99 +#: src/stored/status.c:105 #, c-format msgid "Autochanger \"%s\" with devices:\n" msgstr "" -#: src/stored/status.c:113 +#: src/stored/status.c:119 #, c-format -msgid "Device %s is mounted with Volume \"%s\"\n" +msgid "Device %s is mounted with Volume=\"%s\" Pool=\"%s\"\n" msgstr "" -#: src/stored/status.c:116 +#: src/stored/status.c:123 #, c-format msgid "Device %s open but no Bacula volume is mounted.\n" msgstr "" -#: src/stored/status.c:126 +#: src/stored/status.c:133 #, c-format msgid " Total Bytes=%s Blocks=%s Bytes/block=%s\n" msgstr "" -#: src/stored/status.c:140 +#: src/stored/status.c:147 #, c-format msgid " Total Bytes Read=%s Blocks Read=%s Bytes/block=%s\n" msgstr "" -#: src/stored/status.c:145 +#: src/stored/status.c:152 #, c-format msgid " Positioned at File=%s Block=%s\n" msgstr "" -#: src/stored/status.c:151 +#: src/stored/status.c:158 #, c-format msgid "Device %s is not open or does not exist.\n" msgstr "" -#: src/stored/status.c:153 +#: src/stored/status.c:160 #, c-format msgid "Device \"%s\" is not open or does not exist.\n" msgstr "" -#: src/stored/status.c:158 src/stored/status.c:165 src/stored/status.c:168 +#: src/stored/status.c:165 src/stored/status.c:168 src/stored/status.c:172 +#: src/stored/status.c:174 msgid "" "====\n" "\n" msgstr "" -#: src/stored/status.c:159 -msgid "Volume status:\n" +#: src/stored/status.c:166 +msgid "In Use Volume status:\n" msgstr "" -#: src/stored/status.c:183 +#: src/stored/status.c:190 msgid "" "No DEVICE structure.\n" "\n" msgstr "" -#: src/stored/status.c:188 +#: src/stored/status.c:195 msgid " Device is BLOCKED. User unmounted.\n" msgstr "" -#: src/stored/status.c:191 +#: src/stored/status.c:198 msgid " Device is BLOCKED. User unmounted during wait for media/mount.\n" msgstr "" -#: src/stored/status.c:195 +#: src/stored/status.c:202 #, c-format msgid " Device is BLOCKED waiting for mount of volume \"%s\".\n" msgstr "" -#: src/stored/status.c:198 +#: src/stored/status.c:205 msgid " Device is BLOCKED waiting for media.\n" msgstr "" -#: src/stored/status.c:202 +#: src/stored/status.c:209 msgid " Device is being initialized.\n" msgstr "" -#: src/stored/status.c:205 +#: src/stored/status.c:212 msgid " Device is blocked labeling a Volume.\n" msgstr "" -#: src/stored/status.c:213 +#: src/stored/status.c:220 #, c-format msgid " Slot %d is loaded in drive %d.\n" msgstr "" -#: src/stored/status.c:216 +#: src/stored/status.c:223 #, c-format msgid " Drive %d is not loaded.\n" msgstr "" -#: src/stored/status.c:235 +#: src/stored/status.c:242 msgid "Device state:\n" msgstr "" -#: src/stored/status.c:249 +#: src/stored/status.c:256 #, c-format msgid "" "num_writers=%d JobStatus=%c block=%d\n" "\n" msgstr "" -#: src/stored/status.c:253 +#: src/stored/status.c:260 #, c-format msgid "Archive name: %s Device name: %s\n" msgstr "" -#: src/stored/status.c:255 +#: src/stored/status.c:262 #, c-format msgid "File=%u block=%u\n" msgstr "" -#: src/stored/status.c:256 +#: src/stored/status.c:263 #, c-format msgid "Min block=%u Max block=%u\n" msgstr "" -#: src/stored/status.c:272 +#: src/stored/status.c:280 #, c-format msgid "%s Job %s waiting for Client connection.\n" msgstr "" -#: src/stored/status.c:284 +#: src/stored/status.c:295 +#, c-format +msgid "" +"Reading: %s %s job %s JobId=%d Volume=\"%s\"\n" +" pool=\"%s\" device=\"%s\"\n" +msgstr "" + +#: src/stored/status.c:307 #, c-format -msgid "%s %s job %s JobId=%d Volume=\"%s\" device=\"%s\"\n" +msgid "" +"Writing: %s %s job %s JobId=%d Volume=\"%s\"\n" +" pool=\"%s\" device=\"%s\"\n" msgstr "" -#: src/stored/status.c:303 +#: src/stored/status.c:330 #, c-format msgid " FDReadSeqNo=%s in_msg=%u out_msg=%d fd=%d\n" msgstr "" -#: src/stored/status.c:308 +#: src/stored/status.c:335 msgid " FDSocket closed\n" msgstr "" -#: src/stored/status.c:335 +#: src/stored/status.c:352 +msgid "" +"\n" +"Jobs waiting to reserve a drive:\n" +msgstr "" + +#: src/stored/status.c:380 msgid " JobId Level Files Bytes Status Finished Name \n" msgstr "" -#: src/stored/status.c:469 +#: src/stored/status.c:514 msgid "3900 Bad .status command, missing argument.\n" msgstr "" -#: src/stored/status.c:494 +#: src/stored/status.c:537 msgid "3900 Bad .status command, wrong argument.\n" msgstr "" @@ -12211,37 +12517,37 @@ msgstr "" msgid "Unable to create thread. ERR=%s\n" msgstr "" -#: src/stored/stored.c:272 +#: src/stored/stored.c:271 #, c-format msgid "Only one Storage resource permitted in %s\n" msgstr "" -#: src/stored/stored.c:277 +#: src/stored/stored.c:276 #, c-format msgid "No Director resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:282 +#: src/stored/stored.c:281 #, c-format msgid "No Device resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:290 +#: src/stored/stored.c:289 #, c-format msgid "No Messages resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:317 +#: src/stored/stored.c:316 #, c-format msgid "\"TLS Certificate\" file not defined for Storage \"%s\" in %s.\n" msgstr "" -#: src/stored/stored.c:323 +#: src/stored/stored.c:322 #, c-format msgid "\"TLS Key\" file not defined for Storage \"%s\" in %s.\n" msgstr "" -#: src/stored/stored.c:329 +#: src/stored/stored.c:328 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " @@ -12249,235 +12555,72 @@ msgid "" "using \"TLS Verify Peer\".\n" msgstr "" -#: src/stored/stored.c:417 -#, c-format -msgid "No Changer Name given for device %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:423 -#, c-format -msgid "No Changer Command given for device %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:435 -#, c-format -msgid "" -"Media Type not the same for all devices in changer %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:496 +#: src/stored/stored.c:455 #, c-format msgid "Could not initialize %s\n" msgstr "" -#: src/stored/stored.c:509 +#: src/stored/stored.c:468 #, c-format msgid "Could not open device %s\n" msgstr "" -#: src/stored/stored.c:521 +#: src/stored/stored.c:481 #, c-format msgid "Could not mount device %s\n" msgstr "" -#: src/stored/stored_conf.c:188 +#: src/stored/stored_conf.c:216 +#, c-format +msgid "Expected a Device Type keyword, got: %s" +msgstr "" + +#: src/stored/stored_conf.c:231 #, c-format msgid "Warning: no \"%s\" resource (%d) defined.\n" msgstr "" -#: src/stored/stored_conf.c:191 +#: src/stored/stored_conf.c:234 #, c-format msgid "dump_resource type=%d\n" msgstr "" -#: src/stored/stored_conf.c:307 +#: src/stored/stored_conf.c:350 #, c-format msgid "Warning: unknown resource type %d\n" msgstr "" -#: src/stored/stored_conf.c:496 +#: src/stored/stored_conf.c:539 #, c-format msgid "\"%s\" item is required in \"%s\" resource, but not found.\n" msgstr "" -#: src/stored/stored_conf.c:502 +#: src/stored/stored_conf.c:545 #, c-format msgid "Too many items in \"%s\" resource\n" msgstr "" -#: src/stored/stored_conf.c:536 +#: src/stored/stored_conf.c:579 #, c-format msgid "Cannot find AutoChanger resource %s\n" msgstr "" -#: src/stored/stored_conf.c:607 +#: src/stored/stored_conf.c:650 #, c-format msgid "" "Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n" msgstr "" -#: src/stored/ansi_label.c:83 -#, c-format -msgid "Read error on device %s in ANSI label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:93 -msgid "Insane! End of tape while reading ANSI label.\n" -msgstr "" - -#: src/stored/ansi_label.c:117 -msgid "No VOL1 label while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:137 -#, c-format -msgid "Wanted ANSI Volume \"%s\" got \"%s\"\n" -msgstr "" - -#: src/stored/ansi_label.c:148 -msgid "No HDR1 label while reading ANSI label.\n" -msgstr "" - -#: src/stored/ansi_label.c:154 -#, c-format -msgid "ANSI/IBM Volume \"%s\" does not belong to Bacula.\n" -msgstr "" - -#: src/stored/ansi_label.c:165 -msgid "No HDR2 label while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:179 -msgid "Unknown or bad ANSI/IBM label record.\n" -msgstr "" - -#: src/stored/ansi_label.c:186 -msgid "Too many records in while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:285 -#, c-format -msgid "ANSI Volume label name \"%s\" longer than 6 chars.\n" -msgstr "" - -#: src/stored/ansi_label.c:302 -#, c-format -msgid "Could not write ANSI VOL1 label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:340 src/stored/ansi_label.c:369 -#, c-format -msgid "Could not write ANSI HDR1 label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:345 src/stored/ansi_label.c:376 -msgid "Could not write ANSI HDR1 label.\n" -msgstr "" - -#: src/stored/ansi_label.c:381 -#, c-format -msgid "Error writing EOF to tape. ERR=%s" -msgstr "" - -#: src/stored/ansi_label.c:386 -msgid "write_ansi_ibm_label called for non-ANSI/IBM type\n" -msgstr "" - -#: src/stored/dvd.c:153 -#, c-format -msgid "Device %s cannot be mounted. ERR=%s\n" -msgstr "" - -#: src/stored/dvd.c:261 -#, c-format -msgid "Cannot run free space command (%s)\n" -msgstr "" - -#: src/stored/dvd.c:322 -#, c-format -msgid "Error while writing current part to the DVD: %s" -msgstr "" - -#: src/stored/dvd.c:343 -#, c-format -msgid "Remaining free space %s on %s\n" -msgstr "" - -#: src/stored/dvd.c:412 -#, c-format -msgid "Next Volume part already exists on DVD. Cannot continue: %s\n" -msgstr "" - -#: src/stored/dvd.c:430 +#: src/stored/wait.c:114 #, c-format -msgid "open_next_part can't unlink existing part %s, ERR=%s\n" -msgstr "" - -#: src/stored/dvd.c:634 -#, c-format -msgid "Unable to write part %s: ERR=%s\n" +msgid "pthread timedwait error. ERR=%s\n" msgstr "" -#: src/stored/wait.c:178 src/stored/wait.c:236 +#: src/stored/wait.c:199 #, c-format msgid "Job %s waiting to reserve a device.\n" msgstr "" -#: src/stored/pythonsd.c:202 -msgid "Error in ParseTuple\n" -msgstr "" - -#: src/stored/pythonsd.c:218 -msgid "Parse tuple error in job_write\n" -msgstr "" - -#: src/stored/pythonsd.c:254 -#, c-format -msgid "Error in Python method %s\n" -msgstr "" - -#: src/stored/reserve.c:373 src/stored/reserve.c:390 -#, c-format -msgid "Failed command: %s\n" -msgstr "" - -#: src/stored/reserve.c:375 -#, c-format -msgid "" -"\n" -" Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD " -"Device resources.\n" -msgstr "" - -#: src/stored/reserve.c:564 -#, c-format -msgid "3926 Could not get dcr for device: %s\n" -msgstr "" - -#: src/stored/reserve.c:615 src/stored/reserve.c:670 -#, c-format -msgid "Device %s is BLOCKED due to user unmount.\n" -msgstr "" - -#: src/stored/reserve.c:623 -#, c-format -msgid "Device %s is busy.\n" -msgstr "" - -#: src/stored/reserve.c:678 -#, c-format -msgid "Device %s is busy writing on another Volume.\n" -msgstr "" - -#: src/stored/reserve.c:777 -#, c-format -msgid "Wanted Pool \"%s\", but device %s is using Pool \"%s\" .\n" -msgstr "" - -#: src/stored/reserve.c:784 src/stored/reserve.c:785 -msgid "Logic error!!!! Should not get here.\n" -msgstr "" - #: src/tools/bsmtp.c:85 #, c-format msgid "Fatal malformed reply from %s: %s\n" @@ -12889,24 +13032,43 @@ msgstr "" msgid "Found %d bad Path records.\n" msgstr "" -#: src/tools/testfind.c:49 +#: src/tools/fstype.c:34 #, c-format msgid "" "\n" -"Usage: testfind [-d debug_level] [-] [pattern1 ...]\n" -" -a print extended attributes (Win32 debug)\n" -" -dnn set debug level to nn\n" -" -e specify file of exclude patterns\n" -" -i specify file of include patterns\n" -" - read pattern(s) from stdin\n" -" -? print this message.\n" +"Usage: fstype [-d debug_level] path ...\n" "\n" -"Patterns are used for file inclusion -- normally directories.\n" -"Debug level >= 1 prints each file found.\n" -"Debug level >= 10 prints path/file for catalog.\n" -"Errors are always printed.\n" -"Files/paths truncated is the number of files/paths with len > 255.\n" -"Truncation is only in the catalog.\n" +" Print the file system type a given file/directory is on.\n" +" The following options are supported:\n" +"\n" +" -v print both path and file system type.\n" +" -? print this message.\n" +"\n" +msgstr "" + +#: src/tools/fstype.c:86 +#, c-format +msgid "%s: unknown\n" +msgstr "" + +#: src/tools/testfind.c:49 +#, c-format +msgid "" +"\n" +"Usage: testfind [-d debug_level] [-] [pattern1 ...]\n" +" -a print extended attributes (Win32 debug)\n" +" -dnn set debug level to nn\n" +" -e specify file of exclude patterns\n" +" -i specify file of include patterns\n" +" - read pattern(s) from stdin\n" +" -? print this message.\n" +"\n" +"Patterns are used for file inclusion -- normally directories.\n" +"Debug level >= 1 prints each file found.\n" +"Debug level >= 10 prints path/file for catalog.\n" +"Errors are always printed.\n" +"Files/paths truncated is the number of files/paths with len > 255.\n" +"Truncation is only in the catalog.\n" "\n" msgstr "" @@ -13034,25 +13196,6 @@ msgstr "" msgid "Skip: File system change prohibited. Directory not entered. %s\n" msgstr "" -#: src/tools/fstype.c:34 -#, c-format -msgid "" -"\n" -"Usage: fstype [-d debug_level] path ...\n" -"\n" -" Print the file system type a given file/directory is on.\n" -" The following options are supported:\n" -"\n" -" -v print both path and file system type.\n" -" -? print this message.\n" -"\n" -msgstr "" - -#: src/tools/fstype.c:86 -#, c-format -msgid "%s: unknown\n" -msgstr "" - #: src/tray-monitor/authenticate.c:78 msgid "" "Director authorization problem.\n" @@ -13179,24 +13322,11 @@ msgstr "" #: src/tray-monitor/tray-monitor.c:503 src/tray-monitor/tray-monitor.c:513 msgid "" -"Copyright (C) 2004 Kern Sibbald and John Walker\n" +"Copyright (C) 2004-2005 Kern Sibbald\n" "Written by Nicolas Boichat\n" msgstr "" -#: src/tray-monitor/tray-monitor.c:505 -msgid "Version" -msgstr "" - -#: src/tray-monitor/tray-monitor.c:509 -#, c-format -msgid "" -"%s\n" -"\n" -"%s\n" -"%s %s (%s) %s %s %s" -msgstr "" - -#: src/tray-monitor/tray-monitor.c:515 +#: src/tray-monitor/tray-monitor.c:505 src/tray-monitor/tray-monitor.c:515 msgid "Version:" msgstr "" @@ -13392,7 +13522,7 @@ msgstr "" msgid "<< Error: BNET_PROMPT signal received. >>\n" msgstr "" -#: src/tray-monitor/tray-monitor.c:953 src/wx-console/console_thread.cpp:445 +#: src/tray-monitor/tray-monitor.c:953 src/wx-console/console_thread.cpp:465 msgid "<< Heartbeat signal received, answered. >>\n" msgstr "" @@ -13437,94 +13567,271 @@ msgstr "" msgid "Storage: name=%s address=%s SDport=%d\n" msgstr "" -#: src/wx-console/authenticate.c:126 +#: src/wx-console/authenticate.c:129 msgid "Bad response to Hello command: ERR=" msgstr "" -#: src/baconfig.h:52 +#: src/baconfig.h:55 #, c-format msgid "Failed ASSERT: %s\n" msgstr "" -#: src/baconfig.h:59 +#: src/baconfig.h:62 msgid "*None*" msgstr "" -#: src/wx-console/console_thread.cpp:103 +#: src/filed/win32/winmain.cpp:228 src/filed/win32/winmain.cpp:236 +msgid "Bacula Usage" +msgstr "" + +#: src/filed/win32/winmain.cpp:233 +msgid "Bad Command Line Options" +msgstr "" + +#: src/filed/win32/winmain.cpp:326 +msgid "Another instance of Bacula is already running" +msgstr "" + +#: src/filed/win32/winservice.cpp:131 src/filed/win32/winservice.cpp:145 +msgid "No existing instance of Bacula could be contacted" +msgstr "" + +#: src/filed/win32/winservice.cpp:218 +msgid "KERNEL32.DLL not found: Bacula service not started" +msgstr "" + +#: src/filed/win32/winservice.cpp:228 +msgid "Registry service not found: Bacula service not started" +msgstr "" + +#: src/filed/win32/winservice.cpp:230 +msgid "Registry service not found" +msgstr "" + +#: src/filed/win32/winservice.cpp:260 +msgid "StartServiceCtrlDispatcher failed." +msgstr "" + +#: src/filed/win32/winservice.cpp:278 +msgid "RegisterServiceCtlHandler failed" +msgstr "" + +#: src/filed/win32/winservice.cpp:279 +msgid "Contact Register Service Handler failure" +msgstr "" + +#: src/filed/win32/winservice.cpp:295 +msgid "ReportStatus STOPPED failed 1" +msgstr "" + +#: src/filed/win32/winservice.cpp:318 +msgid "Report Service failure" +msgstr "" + +#: src/filed/win32/winservice.cpp:355 +msgid "Unable to install Bacula service" +msgstr "" + +#: src/filed/win32/winservice.cpp:373 +msgid "Service command length too long" +msgstr "" + +#: src/filed/win32/winservice.cpp:374 +msgid "Service command length too long. Service not registered." +msgstr "" + +#: src/filed/win32/winservice.cpp:389 +msgid "Cannot write System Registry" +msgstr "" + +#: src/filed/win32/winservice.cpp:390 +msgid "" +"The System Registry could not be updated - the Bacula service was not " +"installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:397 +msgid "Cannot add Bacula key to System Registry" +msgstr "" + +#: src/filed/win32/winservice.cpp:398 src/filed/win32/winservice.cpp:449 +msgid "The Bacula service could not be installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:406 +msgid "" +"The Bacula File service was successfully installed.\n" +"The service may be started by double clicking on the\n" +"Bacula \"Start\" icon and will be automatically\n" +"be run the next time this machine is rebooted. " +msgstr "" + +#: src/filed/win32/winservice.cpp:424 +msgid "" +"The Service Control Manager could not be contacted - the Bacula service was " +"not installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:455 +msgid "" +"Provides file backup and restore services. Bacula -- the network backup " +"solution." +msgstr "" + +#: src/filed/win32/winservice.cpp:462 +msgid "" +"The Bacula File service was successfully installed.\n" +"The service may be started from the Control Panel and will\n" +"automatically be run the next time this machine is rebooted." +msgstr "" + +#: src/filed/win32/winservice.cpp:471 +msgid "" +"Unknown Windows operating system.\n" +"Cannot install Bacula service.\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:496 +msgid "" +"Could not find registry entry.\n" +"Service probably not registerd - the Bacula service was not removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:501 +msgid "" +"Could not delete Registry key.\n" +"The Bacula service could not be removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:511 +msgid "Bacula could not be contacted, probably not running" +msgstr "" + +#: src/filed/win32/winservice.cpp:517 src/filed/win32/winservice.cpp:553 +msgid "The Bacula service has been removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:547 +msgid "The Bacula service could not be stopped" +msgstr "" + +#: src/filed/win32/winservice.cpp:555 +msgid "The Bacula service could not be removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:560 +msgid "The Bacula service could not be found" +msgstr "" + +#: src/filed/win32/winservice.cpp:565 +msgid "The SCM could not be contacted - the Bacula service was not removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:629 +msgid "SetServiceStatus failed" +msgstr "" + +#: src/filed/win32/winservice.cpp:657 +#, c-format +msgid "" +"\n" +"\n" +"%s error: %ld at %s:%d" +msgstr "" + +#: src/filed/win32/winservice.cpp:732 +#, c-format +msgid "Locked by: %s, duration: %ld seconds\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:736 +#, c-format +msgid "No longer locked\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:740 +msgid "Could not lock database" +msgstr "" + +#: src/wx-console/console_thread.cpp:101 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " "Director \"%s\" in config file.\n" -" At least one CA certificate store is required.\n" +"At least one CA certificate store is required.\n" msgstr "" -#: src/wx-console/console_thread.cpp:112 +#: src/wx-console/console_thread.cpp:108 msgid "" "No Director resource defined in config file.\n" "Without that I don't how to speak to the Director :-(\n" msgstr "" -#: src/wx-console/console_thread.cpp:132 +#: src/wx-console/console_thread.cpp:127 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " "Console \"%s\" in config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:154 +#: src/wx-console/console_thread.cpp:148 msgid "Error while initializing windows sockets...\n" msgstr "" -#: src/wx-console/console_thread.cpp:169 +#: src/wx-console/console_thread.cpp:163 msgid "Error while cleaning up windows sockets...\n" msgstr "" -#: src/wx-console/console_thread.cpp:207 +#: src/wx-console/console_thread.cpp:201 msgid "Error while initializing library." msgstr "" -#: src/wx-console/console_thread.cpp:237 +#: src/wx-console/console_thread.cpp:227 +msgid "Cryptographic library initialization failed.\n" +msgstr "" + +#: src/wx-console/console_thread.cpp:231 msgid "Please correct configuration file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:270 +#: src/wx-console/console_thread.cpp:273 msgid "Error : Library not initialized\n" msgstr "" -#: src/wx-console/console_thread.cpp:281 +#: src/wx-console/console_thread.cpp:284 msgid "Error : No configuration file loaded\n" msgstr "" -#: src/wx-console/console_thread.cpp:291 +#: src/wx-console/console_thread.cpp:294 msgid "Connecting...\n" msgstr "" -#: src/wx-console/console_thread.cpp:307 +#: src/wx-console/console_thread.cpp:310 msgid "Error : No director defined in config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:319 +#: src/wx-console/console_thread.cpp:322 msgid "Multiple directors found in your config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:328 +#: src/wx-console/console_thread.cpp:331 #, c-format msgid "Please choose a director (1-%d): " msgstr "" -#: src/wx-console/console_thread.cpp:400 +#: src/wx-console/console_thread.cpp:403 msgid "Failed to connect to the director\n" msgstr "" -#: src/wx-console/console_thread.cpp:410 +#: src/wx-console/console_thread.cpp:413 msgid "Connected\n" msgstr "" -#: src/wx-console/console_thread.cpp:448 +#: src/wx-console/console_thread.cpp:470 msgid "<< Unexpected signal received : " msgstr "" -#: src/wx-console/console_thread.cpp:466 +#: src/wx-console/console_thread.cpp:490 msgid "Connection terminated\n" msgstr "" @@ -13537,28 +13844,28 @@ msgstr "" msgid "Welcome to bacula wx-console %s (%s)!\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:41 +#: src/wx-console/wxbconfigfileeditor.cpp:44 msgid "Config file editor" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:57 -msgid "Save and close" +#: src/wx-console/wxbconfigfileeditor.cpp:54 +msgid "# Bacula wx-console Configuration File\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:58 -msgid "Close without saving" +#: src/wx-console/wxbconfigfileeditor.cpp:90 +msgid "Save and close" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:69 -msgid "# Bacula wx-console Configuration File\n" +#: src/wx-console/wxbconfigfileeditor.cpp:91 +msgid "Close without saving" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:100 +#: src/wx-console/wxbconfigfileeditor.cpp:118 #, c-format msgid "Unable to write to %s\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:101 +#: src/wx-console/wxbconfigfileeditor.cpp:119 msgid "Error while saving" msgstr "" @@ -13580,567 +13887,579 @@ msgstr "" msgid "Possible completions: " msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:258 -#: src/wx-console/wxbrestorepanel.cpp:1861 -#: src/wx-console/wxbrestorepanel.cpp:1890 -msgid "Enter restore mode" +#: src/wx-console/wxbmainframe.cpp:227 +msgid "&About...\tF1" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:261 -msgid "Cancel restore" +#: src/wx-console/wxbmainframe.cpp:227 +msgid "Show about dialog" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:287 -#: src/wx-console/wxbrestorepanel.cpp:341 -msgid "Add" +#: src/wx-console/wxbmainframe.cpp:229 src/wx-console/wxbmainframe.cpp:598 +msgid "Connect to the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:289 -#: src/wx-console/wxbrestorepanel.cpp:343 -msgid "Remove" +#: src/wx-console/wxbmainframe.cpp:230 +msgid "Disconnect" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:291 -#: src/wx-console/wxbrestorepanel.cpp:345 -msgid "Refresh" +#: src/wx-console/wxbmainframe.cpp:230 +msgid "Disconnect of the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:310 -msgid "M" +#: src/wx-console/wxbmainframe.cpp:232 +msgid "Change of configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:326 -msgid "Perm." +#: src/wx-console/wxbmainframe.cpp:232 +msgid "Change your default configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:359 -#: src/wx-console/wxbrestorepanel.cpp:372 -#: src/wx-console/wxbrestorepanel.cpp:524 -#: src/wx-console/wxbrestorepanel.cpp:534 -#: src/wx-console/wxbrestorepanel.cpp:537 -#: src/wx-console/wxbrestorepanel.cpp:1732 -#: src/wx-console/wxbrestorepanel.cpp:1812 -msgid "Job Name" +#: src/wx-console/wxbmainframe.cpp:233 +msgid "Edit your configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:361 -#: src/wx-console/wxbrestorepanel.cpp:377 -#: src/wx-console/wxbrestorepanel.cpp:476 -#: src/wx-console/wxbrestorepanel.cpp:477 -#: src/wx-console/wxbrestorepanel.cpp:487 -#: src/wx-console/wxbrestorepanel.cpp:488 -#: src/wx-console/wxbrestorepanel.cpp:1101 -#: src/wx-console/wxbrestorepanel.cpp:1768 -#: src/wx-console/wxbrestorepanel.cpp:1827 -msgid "Fileset" +#: src/wx-console/wxbmainframe.cpp:235 +msgid "E&xit\tAlt-X" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:364 -#: src/wx-console/wxbrestorepanel.cpp:1168 -#: src/wx-console/wxbrestorepanel.cpp:1183 -#: src/wx-console/wxbrestorepanel.cpp:1185 -#: src/wx-console/wxbrestorepanel.cpp:1193 -#: src/wx-console/wxbrestorepanel.cpp:1195 -#: src/wx-console/wxbrestorepanel.cpp:1212 -#: src/wx-console/wxbrestorepanel.cpp:1219 -#: src/wx-console/wxbrestorepanel.cpp:1759 -#: src/wx-console/wxbrestorepanel.cpp:1885 -msgid "Before" +#: src/wx-console/wxbmainframe.cpp:235 +msgid "Quit this program" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:366 -msgid "Please configure parameters concerning files to restore :" +#: src/wx-console/wxbmainframe.cpp:239 +msgid "&File" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -#: src/wx-console/wxbrestorepanel.cpp:1820 -msgid "always" +#: src/wx-console/wxbmainframe.cpp:240 +msgid "&Help" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -msgid "if newer" +#: src/wx-console/wxbmainframe.cpp:257 +msgid "Console" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -msgid "if older" +#: src/wx-console/wxbmainframe.cpp:264 +msgid "" +"Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -#: src/wx-console/wxbrestorepanel.cpp:1823 -msgid "never" +#: src/wx-console/wxbmainframe.cpp:268 +msgid "" +"Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode " +"support when handling non-ASCII filenames: Every non-ASCII character in such " +"filenames will be replaced by an interrogation mark.\n" +"If this behaviour disturbs you, please build wx-console against a Unicode " +"version of wxWidgets for GTK+ 2.0.\n" +"---\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:383 -msgid "Please configure parameters concerning files restoration :" +#: src/wx-console/wxbmainframe.cpp:279 +msgid "Send" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:448 -msgid "Getting parameters list." +#: src/wx-console/wxbmainframe.cpp:356 src/wx-console/wxbmainframe.cpp:368 +msgid "Error while parsing command line arguments, using defaults.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:456 -msgid "Error : no clients returned by the director." +#: src/wx-console/wxbmainframe.cpp:357 src/wx-console/wxbmainframe.cpp:369 +msgid "Usage: wx-console [-c configfile] [-w tmp]\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:480 -msgid "Error : no filesets returned by the director." +#: src/wx-console/wxbmainframe.cpp:397 +#, c-format +msgid "" +"It seems that it is the first time you run wx-console.\n" +"This file (%s) has been choosen as default configuration file.\n" +"Do you want to edit it? (if you click No you will have to select another " +"file)" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:504 -msgid "Error : no storage returned by the director." +#: src/wx-console/wxbmainframe.cpp:399 +msgid "First run" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:527 -#: src/wx-console/wxbrestorepanel.cpp:551 -msgid "Error : no jobs returned by the director." +#: src/wx-console/wxbmainframe.cpp:416 +#, c-format +msgid "" +"Unable to read %s\n" +"Error: %s\n" +"Do you want to choose another one? (Press no to edit this file)" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:537 -msgid "RestoreFiles" +#: src/wx-console/wxbmainframe.cpp:418 +msgid "Unable to read configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:572 -msgid "Please configure your restore parameters." +#: src/wx-console/wxbmainframe.cpp:430 +msgid "Please choose a configuration file to use" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:583 -msgid "Building restore tree..." +#: src/wx-console/wxbmainframe.cpp:443 +msgid "This configuration file has been successfully read, use it as default?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:622 -msgid "Error while starting restore: " +#: src/wx-console/wxbmainframe.cpp:444 +msgid "Configuration file read successfully" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:712 -msgid "" -"Right click on a file or on a directory, or double-click on its mark to add " -"it to the restore list." +#: src/wx-console/wxbmainframe.cpp:454 +#, c-format +msgid "Using this configuration file: %s\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:729 -msgid " files selected to be restored." +#: src/wx-console/wxbmainframe.cpp:459 +msgid "Connecting to the director..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:734 -msgid " file selected to be restored." +#: src/wx-console/wxbmainframe.cpp:474 +msgid "Failed to unregister a data parser !" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:741 -#, c-format -msgid "Please configure your restore (%ld files selected to be restored)..." +#: src/wx-console/wxbmainframe.cpp:482 +msgid "Quitting.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:751 -msgid "Restore failed : no file selected.\n" +#: src/wx-console/wxbmainframe.cpp:497 +msgid "" +"Welcome to Bacula wx-console.\n" +"Written by Nicolas Boichat \n" +"(C) 2005 Kern Sibbald\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:752 -msgid "Restore failed : no file selected." +#: src/wx-console/wxbmainframe.cpp:499 +msgid "About Bacula wx-console" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:762 -msgid "Restoring, please wait..." +#: src/wx-console/wxbmainframe.cpp:505 +msgid "Please choose your default configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:775 -msgid "Job started. JobId=" +#: src/wx-console/wxbmainframe.cpp:509 +msgid "Use this configuration file as default?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:777 -msgid "Restore started, jobid=" +#: src/wx-console/wxbmainframe.cpp:510 +msgid "Configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:781 -msgid "Job failed." +#: src/wx-console/wxbmainframe.cpp:581 +msgid "Console thread terminated." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:782 -msgid "Restore failed, please look at messages.\n" +#: src/wx-console/wxbmainframe.cpp:589 +msgid "Connection to the director lost. Quit program?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:783 -msgid "Restore failed, please look at messages in console." +#: src/wx-console/wxbmainframe.cpp:590 +msgid "Connection lost" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:789 -#: src/wx-console/wxbrestorepanel.cpp:790 -msgid "Failed to retrieve jobid.\n" +#: src/wx-console/wxbmainframe.cpp:606 +msgid "Connected to the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:816 -msgid "" -"Restore is scheduled in more than two minutes, wx-console will not wait for " -"its completion.\n" +#: src/wx-console/wxbmainframe.cpp:629 +msgid "Reconnect" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:817 -msgid "" -"Restore is scheduled in more than two minutes, wx-console will not wait for " -"its completion." +#: src/wx-console/wxbmainframe.cpp:630 +msgid "Reconnect to the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:841 -msgid "Restore job created, but not yet running." +#: src/wx-console/wxbmainframe.cpp:644 +msgid "Disconnected of the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:846 -#, c-format -msgid "Restore job running, please wait (%ld of %ld files restored)..." +#: src/wx-console/wxbmainframe.cpp:663 src/wx-console/wxbrestorepanel.cpp:689 +msgid "Unexpected question has been received.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:850 -msgid "Restore job terminated successfully." +#: src/wx-console/wxbmainframe.cpp:686 src/wx-console/wxbmainframe.cpp:703 +msgid "wx-console: unexpected director's question." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:851 -msgid "Restore job terminated successfully.\n" +#: src/wx-console/wxbrestorepanel.cpp:216 +#: src/wx-console/wxbrestorepanel.cpp:1895 +#: src/wx-console/wxbrestorepanel.cpp:1924 +msgid "Enter restore mode" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:856 -msgid "Restore job terminated in error, see messages in console." +#: src/wx-console/wxbrestorepanel.cpp:219 +msgid "Cancel restore" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:857 -msgid "Restore job terminated in error, see messages.\n" +#: src/wx-console/wxbrestorepanel.cpp:245 +#: src/wx-console/wxbrestorepanel.cpp:299 +msgid "Add" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:862 -msgid "Restore job reported a non-fatal error." +#: src/wx-console/wxbrestorepanel.cpp:247 +#: src/wx-console/wxbrestorepanel.cpp:301 +msgid "Remove" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:866 -msgid "Restore job reported a fatal error." +#: src/wx-console/wxbrestorepanel.cpp:249 +#: src/wx-console/wxbrestorepanel.cpp:303 +msgid "Refresh" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:871 -msgid "Restore job cancelled by user." +#: src/wx-console/wxbrestorepanel.cpp:268 +msgid "M" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:872 -msgid "Restore job cancelled by user.\n" +#: src/wx-console/wxbrestorepanel.cpp:272 +msgid "Filename" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:877 -msgid "Restore job is waiting on File daemon." +#: src/wx-console/wxbrestorepanel.cpp:284 +msgid "Perm." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:881 -msgid "Restore job is waiting for new media." +#: src/wx-console/wxbrestorepanel.cpp:317 +#: src/wx-console/wxbrestorepanel.cpp:330 +#: src/wx-console/wxbrestorepanel.cpp:482 +#: src/wx-console/wxbrestorepanel.cpp:492 +#: src/wx-console/wxbrestorepanel.cpp:495 +#: src/wx-console/wxbrestorepanel.cpp:1760 +#: src/wx-console/wxbrestorepanel.cpp:1846 +msgid "Job Name" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:885 -msgid "Restore job is waiting for storage resource." +#: src/wx-console/wxbrestorepanel.cpp:319 +#: src/wx-console/wxbrestorepanel.cpp:335 +#: src/wx-console/wxbrestorepanel.cpp:434 +#: src/wx-console/wxbrestorepanel.cpp:435 +#: src/wx-console/wxbrestorepanel.cpp:445 +#: src/wx-console/wxbrestorepanel.cpp:446 +#: src/wx-console/wxbrestorepanel.cpp:1118 +#: src/wx-console/wxbrestorepanel.cpp:1191 +#: src/wx-console/wxbrestorepanel.cpp:1798 +#: src/wx-console/wxbrestorepanel.cpp:1800 +#: src/wx-console/wxbrestorepanel.cpp:1861 +msgid "Fileset" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:889 -msgid "Restore job is waiting for job resource." +#: src/wx-console/wxbrestorepanel.cpp:322 +#: src/wx-console/wxbrestorepanel.cpp:1185 +#: src/wx-console/wxbrestorepanel.cpp:1201 +#: src/wx-console/wxbrestorepanel.cpp:1203 +#: src/wx-console/wxbrestorepanel.cpp:1211 +#: src/wx-console/wxbrestorepanel.cpp:1213 +#: src/wx-console/wxbrestorepanel.cpp:1232 +#: src/wx-console/wxbrestorepanel.cpp:1239 +#: src/wx-console/wxbrestorepanel.cpp:1788 +#: src/wx-console/wxbrestorepanel.cpp:1799 +#: src/wx-console/wxbrestorepanel.cpp:1919 +msgid "Before" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:893 -msgid "Restore job is waiting for Client resource." +#: src/wx-console/wxbrestorepanel.cpp:324 +msgid "Please configure parameters concerning files to restore :" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:897 -msgid "Restore job is waiting for maximum jobs." +#: src/wx-console/wxbrestorepanel.cpp:333 +#: src/wx-console/wxbrestorepanel.cpp:1854 +msgid "always" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:901 -msgid "Restore job is waiting for start time." +#: src/wx-console/wxbrestorepanel.cpp:333 +msgid "if newer" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:905 -msgid "Restore job is waiting for higher priority jobs to finish." +#: src/wx-console/wxbrestorepanel.cpp:333 +msgid "if older" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:954 -msgid "" -"The restore job has not been started within one minute, wx-console will not " -"wait for its completion anymore.\n" +#: src/wx-console/wxbrestorepanel.cpp:333 +#: src/wx-console/wxbrestorepanel.cpp:1857 +msgid "never" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:955 -msgid "" -"The restore job has not been started within one minute, wx-console will not " -"wait for its completion anymore." +#: src/wx-console/wxbrestorepanel.cpp:341 +msgid "Please configure parameters concerning files restoration :" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:965 -msgid "Restore done successfully.\n" +#: src/wx-console/wxbrestorepanel.cpp:406 +msgid "Getting parameters list." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:966 -msgid "Restore done successfully." +#: src/wx-console/wxbrestorepanel.cpp:414 +msgid "Error : no clients returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1037 -msgid "Applying restore configuration changes..." +#: src/wx-console/wxbrestorepanel.cpp:438 +msgid "Error : no filesets returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1088 -msgid "Failed to find the selected client." +#: src/wx-console/wxbrestorepanel.cpp:462 +msgid "Error : no storage returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1103 -msgid "Failed to find the selected fileset." +#: src/wx-console/wxbrestorepanel.cpp:485 +#: src/wx-console/wxbrestorepanel.cpp:509 +msgid "Error : no jobs returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1118 -msgid "Failed to find the selected storage." +#: src/wx-console/wxbrestorepanel.cpp:495 +msgid "RestoreFiles" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1135 -#: src/wx-console/wxbrestorepanel.cpp:1801 -msgid "Run Restore job" +#: src/wx-console/wxbrestorepanel.cpp:530 +msgid "Please configure your restore parameters." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1151 -msgid "Restore configuration changes were applied." +#: src/wx-console/wxbrestorepanel.cpp:541 +msgid "Building restore tree..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1160 -msgid "Restore cancelled.\n" +#: src/wx-console/wxbrestorepanel.cpp:584 +msgid "Error while starting restore: " msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1161 -msgid "Restore cancelled." +#: src/wx-console/wxbrestorepanel.cpp:674 +msgid "" +"Right click on a file or on a directory, or double-click on its mark to add " +"it to the restore list." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1182 -msgid "No results to list." +#: src/wx-console/wxbrestorepanel.cpp:711 +#: src/wx-console/wxbrestorepanel.cpp:733 +msgid "wx-console: unexpected restore question." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1184 -msgid "No backup found for this client." +#: src/wx-console/wxbrestorepanel.cpp:744 +msgid " files selected to be restored." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1191 -msgid "ERROR" +#: src/wx-console/wxbrestorepanel.cpp:749 +msgid " file selected to be restored." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1192 -msgid "Query failed" +#: src/wx-console/wxbrestorepanel.cpp:756 +#, c-format +msgid "Please configure your restore (%ld files selected to be restored)..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1194 -msgid "Cannot get previous backups list, see console." +#: src/wx-console/wxbrestorepanel.cpp:766 +msgid "Restore failed : no file selected.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1811 -msgid "JobName:" +#: src/wx-console/wxbrestorepanel.cpp:767 +msgid "Restore failed : no file selected." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1815 -msgid "Where:" +#: src/wx-console/wxbrestorepanel.cpp:777 +msgid "Restoring, please wait..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1818 -msgid "Replace:" +#: src/wx-console/wxbrestorepanel.cpp:790 +msgid "Job started. JobId=" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1821 -msgid "ifnewer" +#: src/wx-console/wxbrestorepanel.cpp:792 +msgid "Restore started, jobid=" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1822 -msgid "ifolder" +#: src/wx-console/wxbrestorepanel.cpp:796 +msgid "Job failed." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1826 -msgid "FileSet:" +#: src/wx-console/wxbrestorepanel.cpp:797 +msgid "Restore failed, please look at messages.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1942 -msgid "Restoring..." +#: src/wx-console/wxbrestorepanel.cpp:798 +msgid "Restore failed, please look at messages in console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:227 -msgid "&About...\tF1" +#: src/wx-console/wxbrestorepanel.cpp:804 +#: src/wx-console/wxbrestorepanel.cpp:805 +msgid "Failed to retrieve jobid.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:227 -msgid "Show about dialog" +#: src/wx-console/wxbrestorepanel.cpp:831 +msgid "" +"Restore is scheduled in more than two minutes, wx-console will not wait for " +"its completion.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:229 src/wx-console/wxbmainframe.cpp:591 -msgid "Connect to the director" +#: src/wx-console/wxbrestorepanel.cpp:832 +msgid "" +"Restore is scheduled in more than two minutes, wx-console will not wait for " +"its completion." msgstr "" -#: src/wx-console/wxbmainframe.cpp:230 -msgid "Disconnect" +#: src/wx-console/wxbrestorepanel.cpp:858 +msgid "Restore job created, but not yet running." msgstr "" -#: src/wx-console/wxbmainframe.cpp:230 -msgid "Disconnect of the director" +#: src/wx-console/wxbrestorepanel.cpp:863 +#, c-format +msgid "Restore job running, please wait (%ld of %ld files restored)..." msgstr "" -#: src/wx-console/wxbmainframe.cpp:232 -msgid "Change of configuration file" +#: src/wx-console/wxbrestorepanel.cpp:867 +msgid "Restore job terminated successfully." msgstr "" -#: src/wx-console/wxbmainframe.cpp:232 -msgid "Change your default configuration file" +#: src/wx-console/wxbrestorepanel.cpp:868 +msgid "Restore job terminated successfully.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:233 -msgid "Edit your configuration file" +#: src/wx-console/wxbrestorepanel.cpp:873 +msgid "Restore job terminated in error, see messages in console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:235 -msgid "E&xit\tAlt-X" +#: src/wx-console/wxbrestorepanel.cpp:874 +msgid "Restore job terminated in error, see messages.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:235 -msgid "Quit this program" +#: src/wx-console/wxbrestorepanel.cpp:879 +msgid "Restore job reported a non-fatal error." msgstr "" -#: src/wx-console/wxbmainframe.cpp:239 -msgid "&File" +#: src/wx-console/wxbrestorepanel.cpp:883 +msgid "Restore job reported a fatal error." msgstr "" -#: src/wx-console/wxbmainframe.cpp:240 -msgid "&Help" +#: src/wx-console/wxbrestorepanel.cpp:888 +msgid "Restore job cancelled by user." msgstr "" -#: src/wx-console/wxbmainframe.cpp:257 -msgid "Console" +#: src/wx-console/wxbrestorepanel.cpp:889 +msgid "Restore job cancelled by user.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:264 -msgid "" -"Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n" +#: src/wx-console/wxbrestorepanel.cpp:894 +msgid "Restore job is waiting on File daemon." msgstr "" -#: src/wx-console/wxbmainframe.cpp:268 -msgid "" -"Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode " -"support when handling non-ASCII filenames: Every non-ASCII character in such " -"filenames will be replaced by an interrogation mark.\n" -"If this behaviour disturbs you, please build wx-console against a Unicode " -"version of wxWidgets for GTK+ 2.0.\n" -"---\n" +#: src/wx-console/wxbrestorepanel.cpp:898 +msgid "Restore job is waiting for new media." msgstr "" -#: src/wx-console/wxbmainframe.cpp:279 -msgid "Send" +#: src/wx-console/wxbrestorepanel.cpp:902 +msgid "Restore job is waiting for storage resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:356 src/wx-console/wxbmainframe.cpp:368 -msgid "Error while parsing command line arguments, using defaults.\n" +#: src/wx-console/wxbrestorepanel.cpp:906 +msgid "Restore job is waiting for job resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:357 src/wx-console/wxbmainframe.cpp:369 -msgid "Usage: wx-console [-c configfile] [-w tmp]\n" +#: src/wx-console/wxbrestorepanel.cpp:910 +msgid "Restore job is waiting for Client resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:397 -#, c-format -msgid "" -"It seems that it is the first time you run wx-console.\n" -"This file (%s) has been choosen as default configuration file.\n" -"Do you want to edit it? (if you click No you will have to select another " -"file)" +#: src/wx-console/wxbrestorepanel.cpp:914 +msgid "Restore job is waiting for maximum jobs." msgstr "" -#: src/wx-console/wxbmainframe.cpp:401 -msgid "First run" +#: src/wx-console/wxbrestorepanel.cpp:918 +msgid "Restore job is waiting for start time." msgstr "" -#: src/wx-console/wxbmainframe.cpp:418 -#, c-format +#: src/wx-console/wxbrestorepanel.cpp:922 +msgid "Restore job is waiting for higher priority jobs to finish." +msgstr "" + +#: src/wx-console/wxbrestorepanel.cpp:971 msgid "" -"Unable to read %s\n" -"Error: %s\n" -"Do you want to choose another one? (Press no to edit this file)" +"The restore job has not been started within one minute, wx-console will not " +"wait for its completion anymore.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:422 -msgid "Unable to read configuration file" +#: src/wx-console/wxbrestorepanel.cpp:972 +msgid "" +"The restore job has not been started within one minute, wx-console will not " +"wait for its completion anymore." msgstr "" -#: src/wx-console/wxbmainframe.cpp:434 -msgid "Please choose a configuration file to use" +#: src/wx-console/wxbrestorepanel.cpp:982 +msgid "Restore done successfully.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:447 -msgid "This configuration file has been successfully read, use it as default?" +#: src/wx-console/wxbrestorepanel.cpp:983 +msgid "Restore done successfully." msgstr "" -#: src/wx-console/wxbmainframe.cpp:448 -msgid "Configuration file read successfully" +#: src/wx-console/wxbrestorepanel.cpp:1054 +msgid "Applying restore configuration changes..." msgstr "" -#: src/wx-console/wxbmainframe.cpp:458 -#, c-format -msgid "Using this configuration file: %s\n" +#: src/wx-console/wxbrestorepanel.cpp:1105 +msgid "Failed to find the selected client." msgstr "" -#: src/wx-console/wxbmainframe.cpp:463 -msgid "Connecting to the director..." +#: src/wx-console/wxbrestorepanel.cpp:1120 +msgid "Failed to find the selected fileset." msgstr "" -#: src/wx-console/wxbmainframe.cpp:478 -msgid "Failed to unregister a data parser !" +#: src/wx-console/wxbrestorepanel.cpp:1135 +msgid "Failed to find the selected storage." msgstr "" -#: src/wx-console/wxbmainframe.cpp:486 -msgid "Quitting.\n" +#: src/wx-console/wxbrestorepanel.cpp:1152 +#: src/wx-console/wxbrestorepanel.cpp:1835 +msgid "Run Restore job" msgstr "" -#: src/wx-console/wxbmainframe.cpp:501 -msgid "" -"Welcome to Bacula wx-console.\n" -"Written by Nicolas Boichat \n" -"(C) 2005 Kern Sibbald\n" +#: src/wx-console/wxbrestorepanel.cpp:1168 +msgid "Restore configuration changes were applied." msgstr "" -#: src/wx-console/wxbmainframe.cpp:503 -msgid "About Bacula wx-console" +#: src/wx-console/wxbrestorepanel.cpp:1177 +msgid "Restore cancelled.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:509 -msgid "Please choose your default configuration file" +#: src/wx-console/wxbrestorepanel.cpp:1178 +msgid "Restore cancelled." msgstr "" -#: src/wx-console/wxbmainframe.cpp:513 -msgid "Use this configuration file as default?" +#: src/wx-console/wxbrestorepanel.cpp:1200 +msgid "No results to list." msgstr "" -#: src/wx-console/wxbmainframe.cpp:514 -msgid "Configuration file" +#: src/wx-console/wxbrestorepanel.cpp:1202 +msgid "No backup found for this client." msgstr "" -#: src/wx-console/wxbmainframe.cpp:578 -msgid "Console thread terminated." +#: src/wx-console/wxbrestorepanel.cpp:1209 +msgid "ERROR" msgstr "" -#: src/wx-console/wxbmainframe.cpp:582 -msgid "Connection to the director lost. Quit program?" +#: src/wx-console/wxbrestorepanel.cpp:1210 +msgid "Query failed" msgstr "" -#: src/wx-console/wxbmainframe.cpp:583 -msgid "Connection lost" +#: src/wx-console/wxbrestorepanel.cpp:1212 +msgid "Cannot get previous backups list, see console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:599 -msgid "Connected to the director." +#: src/wx-console/wxbrestorepanel.cpp:1845 +msgid "JobName:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:613 -msgid "Reconnect" +#: src/wx-console/wxbrestorepanel.cpp:1849 +msgid "Where:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:614 -msgid "Reconnect to the director" +#: src/wx-console/wxbrestorepanel.cpp:1852 +msgid "Replace:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:624 -msgid "Disconnected of the director." +#: src/wx-console/wxbrestorepanel.cpp:1855 +msgid "ifnewer" msgstr "" -#: src/wx-console/wxbmainframe.cpp:643 -msgid "Unexpected question has been received.\n" +#: src/wx-console/wxbrestorepanel.cpp:1856 +msgid "ifolder" msgstr "" -#: src/wx-console/wxbmainframe.cpp:666 src/wx-console/wxbmainframe.cpp:681 -msgid "wx-console: unexpected director's question." +#: src/wx-console/wxbrestorepanel.cpp:1860 +msgid "FileSet:" +msgstr "" + +#: src/wx-console/wxbrestorepanel.cpp:1976 +msgid "Restoring..." msgstr "" diff --git a/bacula/po/fr.gmo b/bacula/po/fr.gmo index d0617c7083..f365a43973 100644 Binary files a/bacula/po/fr.gmo and b/bacula/po/fr.gmo differ diff --git a/bacula/po/fr.po b/bacula/po/fr.po index d9f43ae659..4db0815dab 100644 --- a/bacula/po/fr.po +++ b/bacula/po/fr.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Bacula 1.38\n" "Report-Msgid-Bugs-To: bacula-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2005-08-19 11:20+0200\n" +"POT-Creation-Date: 2006-02-26 13:10+0100\n" "PO-Revision-Date: 2005-08-10 16:45+0100\n" "Last-Translator: Nicolas Boichat \n" "Language-Team: French \n" @@ -16,35 +16,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: src/cats/bdb.c:135 +#: src/cats/bdb.c:128 msgid "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" msgstr "" -#: src/cats/bdb.c:136 +#: src/cats/bdb.c:129 msgid "WARNING!!!! The Internal Database is NOT OPERATIONAL!\n" msgstr "" -#: src/cats/bdb.c:137 +#: src/cats/bdb.c:130 msgid "You should use SQLite, PostgreSQL, or MySQL\n" msgstr "" -#: src/cats/bdb.c:159 src/cats/mysql.c:130 src/cats/postgresql.c:128 +#: src/cats/bdb.c:152 src/cats/mysql.c:124 src/cats/postgresql.c:128 #: src/cats/sqlite.c:122 #, c-format msgid "Unable to initialize DB lock. ERR=%s\n" msgstr "" -#: src/cats/bdb.c:169 +#: src/cats/bdb.c:162 #, c-format msgid "Unable to open Catalog DB control file %s: ERR=%s\n" msgstr "" -#: src/cats/bdb.c:224 +#: src/cats/bdb.c:217 #, c-format msgid "Error reading catalog DB control file. ERR=%s\n" msgstr "" -#: src/cats/bdb.c:227 +#: src/cats/bdb.c:220 #, c-format msgid "" "Error, catalog DB control file wrong version. Wanted %d, got %d\n" @@ -61,11 +61,11 @@ msgstr "" msgid "Error updating DB Media file. ERR=%s\n" msgstr "" -#: src/cats/mysql.c:66 +#: src/cats/mysql.c:60 msgid "A user name for MySQL must be supplied.\n" msgstr "" -#: src/cats/mysql.c:167 +#: src/cats/mysql.c:161 #, c-format msgid "" "Unable to connect to MySQL server. \n" @@ -73,7 +73,7 @@ msgid "" "It is probably not running or your password is incorrect.\n" msgstr "" -#: src/cats/mysql.c:326 src/cats/postgresql.c:264 src/cats/sqlite.c:323 +#: src/cats/mysql.c:320 src/cats/postgresql.c:264 src/cats/sqlite.c:323 #, c-format msgid "Query failed: %s: ERR=%s\n" msgstr "" @@ -133,15 +133,15 @@ msgid "" "%s\n" msgstr "" -#: src/cats/sql.c:209 src/cats/sql.c:216 src/cats/sql_create.c:772 -#: src/cats/sql_get.c:180 src/cats/sql_get.c:231 src/cats/sql_get.c:563 -#: src/cats/sql_get.c:638 src/cats/sql_get.c:865 +#: src/cats/sql.c:209 src/cats/sql.c:216 src/cats/sql_create.c:773 +#: src/cats/sql_get.c:180 src/cats/sql_get.c:231 src/cats/sql_get.c:564 +#: src/cats/sql_get.c:639 src/cats/sql_get.c:866 #, c-format msgid "error fetching row: %s\n" msgstr "" -#: src/cats/sql.c:326 src/dird/catreq.c:360 src/dird/catreq.c:392 -#: src/dird/catreq.c:417 +#: src/cats/sql.c:326 src/dird/catreq.c:369 src/dird/catreq.c:401 +#: src/dird/catreq.c:426 #, c-format msgid "Attribute create error. %s" msgstr "" @@ -160,215 +160,141 @@ msgstr "" msgid "Create DB Job record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:91 src/dird/dird_conf.c:532 src/dird/ua_cmds.c:422 -#: src/dird/ua_prune.c:454 src/dird/ua_run.c:643 src/dird/ua_select.c:228 -#: src/dird/ua_select.c:249 -msgid "Job" -msgstr "" - -#: src/cats/sql_create.c:131 +#: src/cats/sql_create.c:132 #, c-format msgid "Create JobMedia record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:140 +#: src/cats/sql_create.c:141 #, c-format msgid "Update Media record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:170 +#: src/cats/sql_create.c:171 #, c-format msgid "pool record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:196 +#: src/cats/sql_create.c:197 #, c-format msgid "Create db Pool record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:201 src/dird/ua_run.c:650 src/dird/ua_select.c:464 -#: src/dird/ua_select.c:554 src/dird/ua_update.c:356 src/dird/ua_update.c:426 -#: src/wx-console/wxbrestorepanel.cpp:362 -#: src/wx-console/wxbrestorepanel.cpp:548 -#: src/wx-console/wxbrestorepanel.cpp:558 -#: src/wx-console/wxbrestorepanel.cpp:1754 -msgid "Pool" -msgstr "" - -#: src/cats/sql_create.c:227 +#: src/cats/sql_create.c:228 #, c-format msgid "Device record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:243 +#: src/cats/sql_create.c:244 #, c-format msgid "Create db Device record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:248 -msgid "Device" -msgstr "" - -#: src/cats/sql_create.c:276 +#: src/cats/sql_create.c:277 #, c-format msgid "More than one Storage record!: %d\n" msgstr "" -#: src/cats/sql_create.c:281 +#: src/cats/sql_create.c:282 #, c-format msgid "error fetching Storage row: %s\n" msgstr "" -#: src/cats/sql_create.c:301 +#: src/cats/sql_create.c:302 #, c-format msgid "Create DB Storage record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:306 src/dird/ua_run.c:642 src/dird/ua_select.c:152 -#: src/wx-console/wxbrestorepanel.cpp:363 -#: src/wx-console/wxbrestorepanel.cpp:379 -#: src/wx-console/wxbrestorepanel.cpp:500 -#: src/wx-console/wxbrestorepanel.cpp:501 -#: src/wx-console/wxbrestorepanel.cpp:511 -#: src/wx-console/wxbrestorepanel.cpp:512 -#: src/wx-console/wxbrestorepanel.cpp:1116 -#: src/wx-console/wxbrestorepanel.cpp:1765 -#: src/wx-console/wxbrestorepanel.cpp:1831 -msgid "Storage" -msgstr "" - -#: src/cats/sql_create.c:333 +#: src/cats/sql_create.c:334 #, c-format msgid "mediatype record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:349 +#: src/cats/sql_create.c:350 #, c-format msgid "Create db mediatype record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:354 -msgid "MediaType" -msgstr "" - -#: src/cats/sql_create.c:383 +#: src/cats/sql_create.c:384 #, c-format msgid "Volume \"%s\" already exists.\n" msgstr "" -#: src/cats/sql_create.c:421 +#: src/cats/sql_create.c:422 #, c-format msgid "Create DB Media record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:425 -msgid "Media" -msgstr "" - -#: src/cats/sql_create.c:469 +#: src/cats/sql_create.c:470 #, c-format msgid "More than one Client!: %d\n" msgstr "" -#: src/cats/sql_create.c:474 +#: src/cats/sql_create.c:475 #, c-format msgid "error fetching Client row: %s\n" msgstr "" -#: src/cats/sql_create.c:501 +#: src/cats/sql_create.c:502 #, c-format msgid "Create DB Client record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:507 src/dird/ua_run.c:645 src/dird/ua_select.c:272 -#: src/dird/ua_select.c:379 src/wx-console/wxbrestorepanel.cpp:360 -#: src/wx-console/wxbrestorepanel.cpp:378 -#: src/wx-console/wxbrestorepanel.cpp:452 -#: src/wx-console/wxbrestorepanel.cpp:453 -#: src/wx-console/wxbrestorepanel.cpp:463 -#: src/wx-console/wxbrestorepanel.cpp:464 -#: src/wx-console/wxbrestorepanel.cpp:707 -#: src/wx-console/wxbrestorepanel.cpp:1086 -#: src/wx-console/wxbrestorepanel.cpp:1173 -#: src/wx-console/wxbrestorepanel.cpp:1758 -#: src/wx-console/wxbrestorepanel.cpp:1760 -#: src/wx-console/wxbrestorepanel.cpp:1829 -#: src/wx-console/wxbrestorepanel.cpp:1884 -msgid "Client" -msgstr "" - -#: src/cats/sql_create.c:544 +#: src/cats/sql_create.c:545 #, c-format msgid "Create DB Counters record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:577 +#: src/cats/sql_create.c:578 #, c-format msgid "More than one FileSet!: %d\n" msgstr "" -#: src/cats/sql_create.c:582 +#: src/cats/sql_create.c:583 #, c-format msgid "error fetching FileSet row: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:612 +#: src/cats/sql_create.c:613 #, c-format msgid "Create DB FileSet record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:618 src/dird/ua_restore.c:1035 src/dird/ua_run.c:644 -#: src/dird/ua_select.c:173 -msgid "FileSet" -msgstr "" - -#: src/cats/sql_create.c:669 +#: src/cats/sql_create.c:670 #, c-format msgid "Attempt to put non-attributes into catalog. Stream=%d\n" msgstr "" -#: src/cats/sql_create.c:732 +#: src/cats/sql_create.c:733 #, c-format msgid "Create db File record %s failed. ERR=%s" msgstr "" -#: src/cats/sql_create.c:738 src/gnome2-console/restore.c:121 -msgid "File" -msgstr "" - -#: src/cats/sql_create.c:765 src/cats/sql_get.c:224 +#: src/cats/sql_create.c:766 src/cats/sql_get.c:224 #, c-format msgid "More than one Path!: %s for path: %s\n" msgstr "" -#: src/cats/sql_create.c:796 +#: src/cats/sql_create.c:797 #, c-format msgid "Create db Path record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:802 -msgid "Path" -msgstr "" - -#: src/cats/sql_create.c:829 +#: src/cats/sql_create.c:830 #, c-format msgid "More than one Filename! %s for file: %s\n" msgstr "" -#: src/cats/sql_create.c:835 +#: src/cats/sql_create.c:836 #, c-format msgid "Error fetching row for file=%s: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:851 +#: src/cats/sql_create.c:852 #, c-format msgid "Create db Filename record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:856 src/wx-console/wxbrestorepanel.cpp:314 -msgid "Filename" -msgstr "" - #: src/cats/sql_delete.c:79 #, c-format msgid "No pool record %s exists\n" @@ -407,27 +333,27 @@ msgid "" "CMD=%s\n" msgstr "" -#: src/cats/sql_find.c:222 +#: src/cats/sql_find.c:224 #, c-format -msgid "Unknown Job level=%c\n" +msgid "Unknown Job level=%d\n" msgstr "" -#: src/cats/sql_find.c:232 +#: src/cats/sql_find.c:234 #, c-format msgid "No Job found for: %s.\n" msgstr "" -#: src/cats/sql_find.c:243 +#: src/cats/sql_find.c:245 #, c-format msgid "No Job found for: %s\n" msgstr "" -#: src/cats/sql_find.c:312 +#: src/cats/sql_find.c:317 #, c-format msgid "Request for Volume item %d greater than max %d\n" msgstr "" -#: src/cats/sql_find.c:324 +#: src/cats/sql_find.c:329 #, c-format msgid "No Volume record found for item %d.\n" msgstr "" @@ -491,104 +417,104 @@ msgstr "" msgid "No Job found for JobId %s\n" msgstr "" -#: src/cats/sql_get.c:343 src/cats/sql_get.c:398 +#: src/cats/sql_get.c:344 src/cats/sql_get.c:399 #, c-format msgid "No volumes found for JobId=%d\n" msgstr "" -#: src/cats/sql_get.c:349 src/cats/sql_get.c:407 +#: src/cats/sql_get.c:350 src/cats/sql_get.c:408 #, c-format msgid "Error fetching row %d: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:363 +#: src/cats/sql_get.c:364 #, c-format msgid "No Volume for JobId %d found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:479 +#: src/cats/sql_get.c:480 #, c-format msgid "Pool id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:516 +#: src/cats/sql_get.c:517 #, c-format msgid "Client id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:558 +#: src/cats/sql_get.c:559 #, c-format msgid "More than one Pool!: %s\n" msgstr "" -#: src/cats/sql_get.c:599 +#: src/cats/sql_get.c:600 msgid "Pool record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:633 +#: src/cats/sql_get.c:634 #, c-format msgid "More than one Client!: %s\n" msgstr "" -#: src/cats/sql_get.c:650 src/cats/sql_get.c:654 +#: src/cats/sql_get.c:651 src/cats/sql_get.c:655 msgid "Client record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:679 +#: src/cats/sql_get.c:680 #, c-format msgid "More than one Counter!: %d\n" msgstr "" -#: src/cats/sql_get.c:684 +#: src/cats/sql_get.c:685 #, c-format msgid "error fetching Counter row: %s\n" msgstr "" -#: src/cats/sql_get.c:704 +#: src/cats/sql_get.c:705 #, c-format msgid "Counter record: %s not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:740 +#: src/cats/sql_get.c:741 #, c-format msgid "Error got %s FileSets but expected only one!\n" msgstr "" -#: src/cats/sql_get.c:745 +#: src/cats/sql_get.c:746 #, c-format msgid "FileSet record \"%s\" not found.\n" msgstr "" -#: src/cats/sql_get.c:755 +#: src/cats/sql_get.c:756 msgid "FileSet record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:812 +#: src/cats/sql_get.c:813 #, c-format msgid "Media id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:860 +#: src/cats/sql_get.c:861 #, c-format msgid "More than one Volume!: %s\n" msgstr "" -#: src/cats/sql_get.c:905 +#: src/cats/sql_get.c:906 #, c-format msgid "Media record MediaId=%s not found.\n" msgstr "" -#: src/cats/sql_get.c:908 +#: src/cats/sql_get.c:909 #, c-format msgid "Media record for Volume \"%s\" not found.\n" msgstr "" -#: src/cats/sql_get.c:915 +#: src/cats/sql_get.c:916 #, c-format msgid "Media record for MediaId=%u not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:918 +#: src/cats/sql_get.c:919 #, c-format msgid "Media record for Vol=%s not found in Catalog.\n" msgstr "" @@ -608,7 +534,7 @@ msgstr "" msgid "Unable to open Database=%s. ERR=%s\n" msgstr "" -#: src/cats/sqlite.c:162 src/lib/bnet_server.c:372 +#: src/cats/sqlite.c:162 src/lib/bnet_server.c:371 msgid "unknown" msgstr "" @@ -627,38 +553,38 @@ msgstr "" msgid "next_index update error: ERR=%s\n" msgstr "" -#: src/console/authenticate.c:104 src/dird/authenticate.c:106 -#: src/dird/authenticate.c:206 src/filed/authenticate.c:124 -#: src/filed/authenticate.c:220 src/stored/authenticate.c:128 -#: src/stored/authenticate.c:232 src/wx-console/authenticate.c:101 +#: src/console/authenticate.c:100 src/dird/authenticate.c:106 +#: src/dird/authenticate.c:206 src/filed/authenticate.c:119 +#: src/filed/authenticate.c:215 src/stored/authenticate.c:128 +#: src/stored/authenticate.c:232 src/wx-console/authenticate.c:106 msgid "" "Authorization problem: Remote server did not advertise required TLS " "support.\n" msgstr "" -#: src/console/authenticate.c:111 src/dird/authenticate.c:113 -#: src/dird/authenticate.c:213 src/filed/authenticate.c:132 -#: src/filed/authenticate.c:228 src/stored/authenticate.c:136 -#: src/stored/authenticate.c:240 src/wx-console/authenticate.c:108 +#: src/console/authenticate.c:107 src/dird/authenticate.c:113 +#: src/dird/authenticate.c:213 src/filed/authenticate.c:127 +#: src/filed/authenticate.c:223 src/stored/authenticate.c:136 +#: src/stored/authenticate.c:240 src/wx-console/authenticate.c:112 msgid "Authorization problem: Remote server requires TLS.\n" msgstr "" -#: src/console/authenticate.c:121 src/wx-console/authenticate.c:118 +#: src/console/authenticate.c:117 src/wx-console/authenticate.c:121 msgid "TLS negotiation failed\n" msgstr "" -#: src/console/authenticate.c:133 src/gnome2-console/authenticate.c:85 +#: src/console/authenticate.c:129 src/gnome2-console/authenticate.c:85 #: src/tray-monitor/authenticate.c:87 #, c-format msgid "Bad response to Hello command: ERR=%s\n" msgstr "" -#: src/console/authenticate.c:140 src/gnome2-console/authenticate.c:95 -#: src/tray-monitor/authenticate.c:94 src/wx-console/authenticate.c:133 +#: src/console/authenticate.c:136 src/gnome2-console/authenticate.c:95 +#: src/tray-monitor/authenticate.c:94 src/wx-console/authenticate.c:136 msgid "Director rejected Hello command\n" msgstr "" -#: src/console/authenticate.c:150 src/wx-console/authenticate.c:143 +#: src/console/authenticate.c:146 src/wx-console/authenticate.c:146 msgid "" "Director authorization problem.\n" "Most likely the passwords do not agree.\n" @@ -703,7 +629,7 @@ msgstr "" msgid "output to file" msgstr "" -#: src/console/console.c:152 src/dird/ua_cmds.c:106 +#: src/console/console.c:152 src/dird/ua_cmds.c:110 msgid "quit" msgstr "" @@ -715,7 +641,7 @@ msgstr "" msgid "sleep specified time" msgstr "" -#: src/console/console.c:155 src/dird/ua_cmds.c:118 +#: src/console/console.c:155 src/dird/ua_cmds.c:122 msgid "print current time" msgstr "" @@ -723,7 +649,7 @@ msgstr "" msgid "print Console's version" msgstr "" -#: src/console/console.c:157 src/dird/ua_cmds.c:95 +#: src/console/console.c:157 src/dird/ua_cmds.c:99 msgid "exit = quit" msgstr "" @@ -731,13 +657,12 @@ msgstr "" msgid "zed_keys = use zed keys instead of bash keys" msgstr "" -#: src/console/console.c:191 src/dird/ua_dotcmds.c:106 +#: src/console/console.c:191 src/dird/ua_dotcmds.c:108 msgid ": is an illegal command\n" msgstr "" -#: src/console/console.c:400 src/dird/dird.c:196 src/filed/filed.c:183 -#: src/gnome2-console/console.c:271 src/stored/stored.c:189 -#: src/wx-console/console_thread.cpp:233 +#: src/console/console.c:400 src/filed/filed.c:183 +#: src/gnome2-console/console.c:271 msgid "TLS library initialization failed.\n" msgstr "" @@ -771,14 +696,14 @@ msgstr "" msgid "Connecting to Director %s:%d\n" msgstr "Connection au Director %s:%d\n" -#: src/console/console.c:471 src/gnome2-console/console.c:508 -#: src/wx-console/console_thread.cpp:367 +#: src/console/console.c:471 src/gnome2-console/console.c:504 +#: src/wx-console/console_thread.cpp:370 #, c-format msgid "Failed to initialize TLS context for Console \"%s\".\n" msgstr "" -#: src/console/console.c:492 src/gnome2-console/console.c:530 -#: src/wx-console/console_thread.cpp:388 +#: src/console/console.c:492 src/gnome2-console/console.c:526 +#: src/wx-console/console_thread.cpp:391 #, c-format msgid "Failed to initialize TLS context for Director \"%s\".\n" msgstr "" @@ -791,8 +716,8 @@ msgstr "" #: src/dird/dird.c:711 src/dird/dird.c:777 src/dird/dird.c:829 #: src/filed/filed.c:302 src/filed/filed.c:348 #: src/gnome2-console/console.c:140 src/gnome2-console/console.c:169 -#: src/stored/stored.c:310 src/wx-console/console_thread.cpp:96 -#: src/wx-console/console_thread.cpp:125 +#: src/stored/stored.c:309 src/wx-console/console_thread.cpp:94 +#: src/wx-console/console_thread.cpp:120 msgid "TLS required but not configured in Bacula.\n" msgstr "" @@ -840,18 +765,18 @@ msgid "Cannot open file %s for output. ERR=%s\n" msgstr "" #: src/console/console_conf.c:123 src/gnome2-console/console_conf.c:122 -#: src/wx-console/console_conf.c:124 +#: src/wx-console/console_conf.c:128 #, c-format msgid "No record for %d %s\n" msgstr "" -#: src/console/console_conf.c:132 src/wx-console/console_conf.c:133 +#: src/console/console_conf.c:132 src/wx-console/console_conf.c:137 #, c-format msgid "Console: name=%s rcfile=%s histfile=%s\n" msgstr "" #: src/console/console_conf.c:136 src/gnome2-console/console_conf.c:131 -#: src/wx-console/console_conf.c:137 +#: src/wx-console/console_conf.c:141 #, c-format msgid "Director: name=%s address=%s DIRport=%d\n" msgstr "" @@ -861,25 +786,25 @@ msgstr "" #: src/filed/filed_conf.c:268 src/filed/filed_conf.c:327 #: src/filed/filed_conf.c:357 src/gnome2-console/console_conf.c:142 #: src/gnome2-console/console_conf.c:220 src/gnome2-console/console_conf.c:268 -#: src/gnome2-console/console_conf.c:298 src/stored/stored_conf.c:467 -#: src/stored/stored_conf.c:555 src/stored/stored_conf.c:590 -#: src/wx-console/console_conf.c:141 src/wx-console/console_conf.c:216 -#: src/wx-console/console_conf.c:261 src/wx-console/console_conf.c:288 +#: src/gnome2-console/console_conf.c:298 src/stored/stored_conf.c:510 +#: src/stored/stored_conf.c:598 src/stored/stored_conf.c:633 +#: src/wx-console/console_conf.c:145 src/wx-console/console_conf.c:220 +#: src/wx-console/console_conf.c:265 src/wx-console/console_conf.c:292 #, c-format msgid "Unknown resource type %d\n" msgstr "" -#: src/console/console_conf.c:242 src/dird/dird_conf.c:1109 -#: src/dird/dird_conf.c:1124 src/filed/filed_conf.c:296 +#: src/console/console_conf.c:242 src/dird/dird_conf.c:1112 +#: src/dird/dird_conf.c:1127 src/filed/filed_conf.c:296 #: src/gnome2-console/console_conf.c:246 src/tray-monitor/tray_conf.c:262 -#: src/wx-console/console_conf.c:242 +#: src/wx-console/console_conf.c:246 #, c-format msgid "%s item is required in %s resource, but not found.\n" msgstr "" -#: src/console/console_conf.c:304 src/dird/dird_conf.c:1296 +#: src/console/console_conf.c:304 src/dird/dird_conf.c:1299 #: src/filed/filed_conf.c:374 src/gnome2-console/console_conf.c:314 -#: src/tray-monitor/tray_conf.c:341 src/wx-console/console_conf.c:304 +#: src/tray-monitor/tray_conf.c:341 src/wx-console/console_conf.c:308 #, c-format msgid "Attempt to define second %s resource named \"%s\" is not permitted.\n" msgstr "" @@ -889,7 +814,7 @@ msgstr "" msgid "Start Admin JobId %d, Job=%s\n" msgstr "" -#: src/dird/admin.c:82 src/dird/backup.c:339 src/dird/mac.c:228 +#: src/dird/admin.c:82 src/dird/backup.c:343 src/dird/mac.c:287 #, c-format msgid "Error getting job record for stats: %s" msgstr "" @@ -906,8 +831,8 @@ msgstr "" msgid "Admin Canceled" msgstr "" -#: src/dird/admin.c:102 src/dird/backup.c:451 src/dird/mac.c:330 -#: src/dird/restore.c:258 +#: src/dird/admin.c:102 src/dird/backup.c:455 src/dird/mac.c:389 +#: src/dird/restore.c:246 #, c-format msgid "Inappropriate term code: %c\n" msgstr "" @@ -940,7 +865,7 @@ msgstr "" #: src/dird/authenticate.c:95 msgid "" -"Unable to authenticate with Storage daemon. Possible causes:\n" +"Director unable to authenticate with Storage daemon. Possible causes:\n" "Passwords or names not the same or\n" "Maximum Concurrent Jobs exceeded on the SD or\n" "SD networking messed up (restart daemon).\n" @@ -949,8 +874,8 @@ msgid "" msgstr "" #: src/dird/authenticate.c:123 src/dird/authenticate.c:223 -#: src/dird/authenticate.c:356 src/filed/authenticate.c:141 -#: src/filed/authenticate.c:237 src/stored/authenticate.c:145 +#: src/dird/authenticate.c:356 src/filed/authenticate.c:136 +#: src/filed/authenticate.c:232 src/stored/authenticate.c:145 #: src/stored/authenticate.c:249 msgid "TLS negotiation failed.\n" msgstr "" @@ -1039,84 +964,84 @@ msgid "" "\n" msgstr "" -#: src/dird/backup.c:88 src/dird/backup.c:94 src/dird/mac.c:92 -#: src/dird/ua_output.c:609 +#: src/dird/backup.c:88 src/dird/backup.c:94 src/dird/mac.c:124 +#: src/dird/ua_output.c:611 #, c-format msgid "Pool %s not in database. %s" msgstr "" -#: src/dird/backup.c:92 src/dird/mac.c:96 src/dird/ua_output.c:617 +#: src/dird/backup.c:92 src/dird/mac.c:128 src/dird/ua_output.c:619 #, c-format msgid "Pool %s created in database.\n" msgstr "" -#: src/dird/backup.c:117 +#: src/dird/backup.c:120 msgid "Could not start clone job.\n" msgstr "" -#: src/dird/backup.c:119 +#: src/dird/backup.c:122 #, c-format msgid "Clone JobId %d started.\n" msgstr "" -#: src/dird/backup.c:144 +#: src/dird/backup.c:148 #, c-format -msgid "Start Backup JobId %u, Job=%s\n" +msgid "Start Backup JobId %s, Job=%s\n" msgstr "" -#: src/dird/backup.c:272 +#: src/dird/backup.c:276 #, c-format msgid "Unexpected Client Job message: %s\n" msgstr "" -#: src/dird/backup.c:280 +#: src/dird/backup.c:284 #, c-format msgid "Network error with FD during %s: ERR=%s\n" msgstr "" -#: src/dird/backup.c:296 +#: src/dird/backup.c:300 msgid "No Job status returned from FD.\n" msgstr "" -#: src/dird/backup.c:346 +#: src/dird/backup.c:350 #, c-format msgid "Error getting client record for stats: %s" msgstr "" -#: src/dird/backup.c:352 src/dird/mac.c:235 +#: src/dird/backup.c:356 src/dird/mac.c:294 #, c-format msgid "Error getting Media record for Volume \"%s\": ERR=%s" msgstr "" -#: src/dird/backup.c:380 src/dird/mac.c:263 +#: src/dird/backup.c:384 src/dird/mac.c:322 #, c-format msgid "Could not get Job Volume Parameters to update Bootstrap file. ERR=%s\n" msgstr "" -#: src/dird/backup.c:414 src/dird/mac.c:293 +#: src/dird/backup.c:418 src/dird/mac.c:352 #, c-format msgid "" "Could not open WriteBootstrap file:\n" "%s: ERR=%s\n" msgstr "" -#: src/dird/backup.c:424 src/dird/mac.c:303 +#: src/dird/backup.c:428 src/dird/mac.c:362 msgid "Backup OK -- with warnings" msgstr "" -#: src/dird/backup.c:426 src/dird/mac.c:305 src/stored/bscan.c:1054 +#: src/dird/backup.c:430 src/dird/mac.c:364 src/stored/bscan.c:1060 msgid "Backup OK" msgstr "" -#: src/dird/backup.c:431 src/dird/mac.c:310 src/stored/bscan.c:1058 +#: src/dird/backup.c:435 src/dird/mac.c:369 src/stored/bscan.c:1064 msgid "*** Backup Error ***" msgstr "" -#: src/dird/backup.c:441 src/dird/mac.c:320 src/stored/bscan.c:1061 +#: src/dird/backup.c:445 src/dird/mac.c:379 src/stored/bscan.c:1067 msgid "Backup Canceled" msgstr "" -#: src/dird/backup.c:491 +#: src/dird/backup.c:495 #, c-format msgid "" "Bacula %s (%s): %s\n" @@ -1159,29 +1084,29 @@ msgstr "" msgid "Unable to get Job Volume Parameters. ERR=%s\n" msgstr "" -#: src/dird/bsr.c:201 +#: src/dird/bsr.c:203 #, c-format msgid "Unable to create bootstrap file %s. ERR=%s\n" msgstr "" -#: src/dird/bsr.c:210 +#: src/dird/bsr.c:212 msgid "Error writing bsr file.\n" msgstr "" -#: src/dird/bsr.c:216 +#: src/dird/bsr.c:218 #, c-format msgid "Bootstrap records written to %s\n" msgstr "" -#: src/dird/bsr.c:220 +#: src/dird/bsr.c:222 msgid "The job will require the following Volumes:\n" msgstr "" -#: src/dird/bsr.c:235 +#: src/dird/bsr.c:254 msgid "No Volumes found to restore.\n" msgstr "" -#: src/dird/catreq.c:109 src/dird/catreq.c:298 +#: src/dird/catreq.c:109 src/dird/catreq.c:297 #, c-format msgid "1990 Invalid Catalog Request: %s" msgstr "" @@ -1191,72 +1116,87 @@ msgstr "" msgid "Invalid Catalog request; DB not open: %s" msgstr "" -#: src/dird/catreq.c:131 +#: src/dird/catreq.c:135 msgid "1901 No Media.\n" msgstr "" -#: src/dird/catreq.c:159 +#: src/dird/catreq.c:163 msgid "not in Pool" msgstr "" -#: src/dird/catreq.c:161 +#: src/dird/catreq.c:165 msgid "not correct MediaType" msgstr "" -#: src/dird/catreq.c:187 +#: src/dird/catreq.c:181 #, c-format msgid "1998 Volume \"%s\" status is %s, %s.\n" msgstr "" -#: src/dird/catreq.c:192 +#: src/dird/catreq.c:186 #, c-format msgid "1997 Volume \"%s\" not in catalog.\n" msgstr "" -#: src/dird/catreq.c:213 +#: src/dird/catreq.c:207 #, c-format msgid "Unable to get Media record for Volume %s: ERR=%s\n" msgstr "" -#: src/dird/catreq.c:215 +#: src/dird/catreq.c:209 #, c-format msgid "1991 Catalog Request for vol=%s failed: %s" msgstr "" -#: src/dird/catreq.c:235 +#: src/dird/catreq.c:229 #, c-format msgid "" "Volume Files at %u being set to %u for Volume \"%s\". This is incorrect.\n" msgstr "" -#: src/dird/catreq.c:238 src/dird/catreq.c:270 -msgid "1992 Update Media error\n" +#: src/dird/catreq.c:232 +#, c-format +msgid "1992 Update Media error. VolFiles=%u, CatFiles=%u\n" msgstr "" -#: src/dird/catreq.c:268 +#: src/dird/catreq.c:264 #, c-format msgid "Catalog error updating Media record. %s" msgstr "" -#: src/dird/catreq.c:287 +#: src/dird/catreq.c:266 +msgid "1993 Update Media error\n" +msgstr "" + +#: src/dird/catreq.c:286 #, c-format msgid "Catalog error creating JobMedia record. %s" msgstr "" -#: src/dird/catreq.c:289 +#: src/dird/catreq.c:288 msgid "1991 Update JobMedia error\n" msgstr "" -#: src/dird/catreq.c:299 +#: src/dird/catreq.c:298 #, c-format msgid "Invalid Catalog request: %s" msgstr "" -#: src/dird/catreq.c:398 +#: src/dird/catreq.c:332 +#, c-format +msgid "1991 Invalid Catalog Update: %s" +msgstr "" + +#: src/dird/catreq.c:333 +#, c-format +msgid "Invalid Catalog Update; DB not open: %s" +msgstr "" + +#: src/dird/catreq.c:407 msgid "Got MD5/SHA1 but not same File as attributes\n" msgstr "" -#: src/dird/catreq.c:422 +#: src/dird/catreq.c:431 #, c-format msgid "Catalog error updating MD5/SHA1. %s" msgstr "" @@ -1282,6 +1222,10 @@ msgid "" "\n" msgstr "" +#: src/dird/dird.c:196 src/stored/stored.c:189 +msgid "Cryptography library initialization failed.\n" +msgstr "" + #: src/dird/dird.c:396 msgid "Too many open reload requests. Request ignored.\n" msgstr "" @@ -1311,17 +1255,17 @@ msgstr "" msgid "Only one Director resource permitted in %s\n" msgstr "" -#: src/dird/dird.c:502 src/filed/filed.c:357 src/stored/stored.c:362 +#: src/dird/dird.c:502 src/filed/filed.c:357 src/stored/stored.c:361 #, c-format msgid "\"TLS Certificate\" file not defined for Director \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:508 src/filed/filed.c:363 src/stored/stored.c:368 +#: src/dird/dird.c:508 src/filed/filed.c:363 src/stored/stored.c:367 #, c-format msgid "\"TLS Key\" file not defined for Director \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:514 src/filed/filed.c:369 src/stored/stored.c:374 +#: src/dird/dird.c:514 src/filed/filed.c:369 src/stored/stored.c:373 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " @@ -1329,7 +1273,7 @@ msgid "" "using \"TLS Verify Peer\".\n" msgstr "" -#: src/dird/dird.c:533 src/filed/filed.c:388 src/stored/stored.c:393 +#: src/dird/dird.c:533 src/filed/filed.c:388 src/stored/stored.c:392 #, c-format msgid "Failed to initialize TLS context for Director \"%s\" in %s.\n" msgstr "" @@ -1353,8 +1297,8 @@ msgstr "" msgid "Too many items in Job resource\n" msgstr "" -#: src/dird/dird.c:672 src/dird/job.c:101 src/dird/ua_cmds.c:1425 -#: src/dird/ua_output.c:598 +#: src/dird/dird.c:672 src/dird/job.c:101 src/dird/ua_cmds.c:1480 +#: src/dird/ua_output.c:600 #, c-format msgid "Could not open database \"%s\".\n" msgstr "" @@ -1371,7 +1315,7 @@ msgid "" "Storage \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:733 src/stored/stored.c:348 +#: src/dird/dird.c:733 src/stored/stored.c:347 #, c-format msgid "Failed to initialize TLS context for Storage \"%s\" in %s.\n" msgstr "" @@ -1406,55 +1350,55 @@ msgid "" "File daemon \"%s\" in %s.\n" msgstr "" -#: src/dird/dird_conf.c:441 src/tray-monitor/tray_conf.c:152 +#: src/dird/dird_conf.c:443 src/tray-monitor/tray_conf.c:152 #, c-format msgid "No %s resource defined\n" msgstr "" -#: src/dird/dird_conf.c:450 +#: src/dird/dird_conf.c:452 #, c-format msgid "Director: name=%s MaxJobs=%d FDtimeout=%s SDtimeout=%s\n" msgstr "" -#: src/dird/dird_conf.c:455 +#: src/dird/dird_conf.c:457 #, c-format msgid " query_file=%s\n" msgstr "" -#: src/dird/dird_conf.c:458 src/dird/dird_conf.c:483 src/dird/dird_conf.c:497 -#: src/dird/dird_conf.c:541 src/dird/dird_conf.c:545 src/dird/dird_conf.c:549 -#: src/dird/dird_conf.c:573 src/dird/dird_conf.c:578 src/dird/dird_conf.c:582 -#: src/dird/dird_conf.c:586 src/dird/dird_conf.c:590 src/dird/dird_conf.c:594 -#: src/dird/dird_conf.c:604 +#: src/dird/dird_conf.c:460 src/dird/dird_conf.c:485 src/dird/dird_conf.c:499 +#: src/dird/dird_conf.c:544 src/dird/dird_conf.c:548 src/dird/dird_conf.c:552 +#: src/dird/dird_conf.c:576 src/dird/dird_conf.c:581 src/dird/dird_conf.c:585 +#: src/dird/dird_conf.c:589 src/dird/dird_conf.c:593 src/dird/dird_conf.c:597 +#: src/dird/dird_conf.c:607 msgid " --> " msgstr "" -#: src/dird/dird_conf.c:464 src/dird/dird_conf.c:467 +#: src/dird/dird_conf.c:466 src/dird/dird_conf.c:469 #, c-format msgid "Console: name=%s SSL=%d\n" msgstr "" -#: src/dird/dird_conf.c:473 +#: src/dird/dird_conf.c:475 #, c-format msgid "Counter: name=%s min=%d max=%d cur=%d wrapcntr=%s\n" msgstr "" -#: src/dird/dird_conf.c:478 +#: src/dird/dird_conf.c:480 #, c-format msgid "Counter: name=%s min=%d max=%d\n" msgstr "" -#: src/dird/dird_conf.c:489 +#: src/dird/dird_conf.c:491 #, c-format msgid "Client: name=%s address=%s FDport=%d MaxJobs=%u\n" msgstr "" -#: src/dird/dird_conf.c:492 +#: src/dird/dird_conf.c:494 #, c-format msgid " JobRetention=%s FileRetention=%s AutoPrune=%d\n" msgstr "" -#: src/dird/dird_conf.c:504 +#: src/dird/dird_conf.c:506 #, c-format msgid "" "Device: name=%s ok=%d num_writers=%d max_writers=%d\n" @@ -1463,245 +1407,252 @@ msgid "" " poolid=%s volname=%s MediaType=%s\n" msgstr "" -#: src/dird/dird_conf.c:514 +#: src/dird/dird_conf.c:516 #, c-format msgid "" "Storage: name=%s address=%s SDport=%d MaxJobs=%u\n" " DeviceName=%s MediaType=%s StorageId=%s\n" msgstr "" -#: src/dird/dird_conf.c:523 +#: src/dird/dird_conf.c:525 #, c-format msgid "" "Catalog: name=%s address=%s DBport=%d db_name=%s\n" " db_user=%s MutliDBConn=%d\n" msgstr "" -#: src/dird/dird_conf.c:531 +#: src/dird/dird_conf.c:533 #, c-format -msgid "%s: name=%s JobType=%d level=%s Priority=%d MaxJobs=%u\n" +msgid "%s: name=%s JobType=%d level=%s Priority=%d Enabled=%d\n" +msgstr "" + +#: src/dird/dird_conf.c:534 src/dird/ua_cmds.c:430 src/dird/ua_prune.c:454 +#: src/dird/ua_run.c:643 src/dird/ua_select.c:234 src/dird/ua_select.c:257 +msgid "Job" msgstr "" -#: src/dird/dird_conf.c:532 +#: src/dird/dird_conf.c:534 msgid "JobDefs" msgstr "" -#: src/dird/dird_conf.c:536 +#: src/dird/dird_conf.c:538 #, c-format -msgid " Resched=%d Times=%d Interval=%s Spool=%d WritePartAfterJob=%d\n" +msgid "" +" MaxJobs=%u Resched=%d Times=%d Interval=%s Spool=%d WritePartAfterJob=%" +"d\n" msgstr "" -#: src/dird/dird_conf.c:553 +#: src/dird/dird_conf.c:556 #, c-format msgid " --> Where=%s\n" msgstr "" -#: src/dird/dird_conf.c:556 +#: src/dird/dird_conf.c:559 #, c-format msgid " --> Bootstrap=%s\n" msgstr "" -#: src/dird/dird_conf.c:559 +#: src/dird/dird_conf.c:562 #, c-format msgid " --> RunBefore=%s\n" msgstr "" -#: src/dird/dird_conf.c:562 +#: src/dird/dird_conf.c:565 #, c-format msgid " --> RunAfter=%s\n" msgstr "" -#: src/dird/dird_conf.c:565 +#: src/dird/dird_conf.c:568 #, c-format msgid " --> RunAfterFailed=%s\n" msgstr "" -#: src/dird/dird_conf.c:568 +#: src/dird/dird_conf.c:571 #, c-format msgid " --> WriteBootstrap=%s\n" msgstr "" -#: src/dird/dird_conf.c:600 +#: src/dird/dird_conf.c:603 #, c-format msgid " --> Run=%s\n" msgstr "" -#: src/dird/dird_conf.c:611 +#: src/dird/dird_conf.c:614 #, c-format msgid "FileSet: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:673 src/dird/dird_conf.c:752 +#: src/dird/dird_conf.c:676 src/dird/dird_conf.c:755 #, c-format msgid "Schedule: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:678 +#: src/dird/dird_conf.c:681 #, c-format msgid " --> Run Level=%s\n" msgstr "" -#: src/dird/dird_conf.c:679 +#: src/dird/dird_conf.c:682 msgid " hour=" msgstr "" -#: src/dird/dird_conf.c:688 +#: src/dird/dird_conf.c:691 msgid " mday=" msgstr "" -#: src/dird/dird_conf.c:697 +#: src/dird/dird_conf.c:700 msgid " month=" msgstr "" -#: src/dird/dird_conf.c:706 +#: src/dird/dird_conf.c:709 msgid " wday=" msgstr "" -#: src/dird/dird_conf.c:715 +#: src/dird/dird_conf.c:718 msgid " wom=" msgstr "" -#: src/dird/dird_conf.c:724 +#: src/dird/dird_conf.c:727 msgid " woy=" msgstr "" -#: src/dird/dird_conf.c:733 +#: src/dird/dird_conf.c:736 #, c-format msgid " mins=%d\n" msgstr "" -#: src/dird/dird_conf.c:735 src/dird/dird_conf.c:739 src/dird/dird_conf.c:743 +#: src/dird/dird_conf.c:738 src/dird/dird_conf.c:742 src/dird/dird_conf.c:746 msgid " --> " msgstr "" -#: src/dird/dird_conf.c:756 +#: src/dird/dird_conf.c:759 #, c-format msgid "Pool: name=%s PoolType=%s\n" msgstr "" -#: src/dird/dird_conf.c:758 +#: src/dird/dird_conf.c:761 #, c-format msgid " use_cat=%d use_once=%d acpt_any=%d cat_files=%d\n" msgstr "" -#: src/dird/dird_conf.c:761 +#: src/dird/dird_conf.c:764 #, c-format msgid " max_vols=%d auto_prune=%d VolRetention=%s\n" msgstr "" -#: src/dird/dird_conf.c:764 +#: src/dird/dird_conf.c:767 #, c-format msgid " VolUse=%s recycle=%d LabelFormat=%s\n" msgstr "" -#: src/dird/dird_conf.c:768 +#: src/dird/dird_conf.c:771 #, c-format msgid " CleaningPrefix=%s LabelType=%d\n" msgstr "" -#: src/dird/dird_conf.c:770 +#: src/dird/dird_conf.c:773 #, c-format msgid " RecyleOldest=%d PurgeOldest=%d MaxVolJobs=%d MaxVolFiles=%d\n" msgstr "" -#: src/dird/dird_conf.c:776 +#: src/dird/dird_conf.c:779 #, c-format msgid "Messages: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:778 +#: src/dird/dird_conf.c:781 #, c-format msgid " mailcmd=%s\n" msgstr "" -#: src/dird/dird_conf.c:780 +#: src/dird/dird_conf.c:783 #, c-format msgid " opcmd=%s\n" msgstr "" -#: src/dird/dird_conf.c:783 src/tray-monitor/tray_conf.c:179 +#: src/dird/dird_conf.c:786 src/tray-monitor/tray_conf.c:179 #, c-format msgid "Unknown resource type %d in dump_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1077 src/tray-monitor/tray_conf.c:232 +#: src/dird/dird_conf.c:1080 src/tray-monitor/tray_conf.c:232 #, c-format msgid "Unknown resource type %d in free_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1115 src/lib/parse_conf.c:211 +#: src/dird/dird_conf.c:1118 src/lib/parse_conf.c:211 #: src/tray-monitor/tray_conf.c:268 #, c-format msgid "Too many items in %s resource\n" msgstr "" -#: src/dird/dird_conf.c:1149 +#: src/dird/dird_conf.c:1152 #, c-format msgid "Cannot find Console resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1155 src/filed/filed_conf.c:316 -#: src/stored/stored_conf.c:523 +#: src/dird/dird_conf.c:1158 src/filed/filed_conf.c:316 +#: src/stored/stored_conf.c:566 #, c-format msgid "Cannot find Director resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1162 src/stored/stored_conf.c:529 +#: src/dird/dird_conf.c:1165 src/stored/stored_conf.c:572 #, c-format msgid "Cannot find Storage resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1171 +#: src/dird/dird_conf.c:1174 #, c-format msgid "Cannot find Job resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1189 +#: src/dird/dird_conf.c:1192 #, c-format msgid "Cannot find Counter resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1197 src/filed/filed_conf.c:322 +#: src/dird/dird_conf.c:1200 src/filed/filed_conf.c:322 #, c-format msgid "Cannot find Client resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1209 +#: src/dird/dird_conf.c:1212 #, c-format msgid "Cannot find Schedule resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1214 src/tray-monitor/tray_conf.c:287 +#: src/dird/dird_conf.c:1217 src/tray-monitor/tray_conf.c:287 #, c-format msgid "Unknown resource type %d in save_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1274 src/tray-monitor/tray_conf.c:322 +#: src/dird/dird_conf.c:1277 src/tray-monitor/tray_conf.c:322 #, c-format msgid "Unknown resource type %d in save_resrouce.\n" msgstr "" -#: src/dird/dird_conf.c:1289 +#: src/dird/dird_conf.c:1292 #, c-format msgid "Name item is required in %s resource, but not found.\n" msgstr "" -#: src/dird/dird_conf.c:1301 +#: src/dird/dird_conf.c:1304 #, c-format msgid "Inserting %s res: %s index=%d pass=%d\n" msgstr "" -#: src/dird/dird_conf.c:1374 +#: src/dird/dird_conf.c:1377 #, c-format msgid "Expected a Job Type keyword, got: %s" msgstr "" -#: src/dird/dird_conf.c:1398 +#: src/dird/dird_conf.c:1401 #, c-format msgid "Expected a Job Level keyword, got: %s" msgstr "" -#: src/dird/dird_conf.c:1418 +#: src/dird/dird_conf.c:1421 #, c-format msgid "Expected a Restore replacement option, got: %s" msgstr "" @@ -1787,7 +1738,7 @@ msgstr "" msgid "Unimplemented backup level %d %c\n" msgstr "" -#: src/dird/fd_cmds.c:320 src/filed/job.c:565 +#: src/dird/fd_cmds.c:320 src/filed/job.c:566 #, c-format msgid "Cannot run program: %s. ERR=%s\n" msgstr "" @@ -1806,7 +1757,7 @@ msgstr "" msgid "Cannot open included file: %s. ERR=%s\n" msgstr "" -#: src/dird/fd_cmds.c:441 src/filed/job.c:1617 +#: src/dird/fd_cmds.c:441 src/filed/job.c:1622 #, c-format msgid "Could not open bootstrap file %s: ERR=%s\n" msgstr "" @@ -1818,7 +1769,7 @@ msgid "" "msglen=%d msg=%s\n" msgstr "" -#: src/dird/fd_cmds.c:571 src/dird/verify.c:696 +#: src/dird/fd_cmds.c:571 src/dird/verify.c:700 #, c-format msgid "MD5/SHA1 index %d not same as attributes %d\n" msgstr "" @@ -1828,28 +1779,28 @@ msgstr "" msgid " | ] -- cancel a job" msgstr "" -#: src/dird/ua_cmds.c:92 +#: src/dird/ua_cmds.c:94 msgid "create DB Pool from resource" msgstr "" -#: src/dird/ua_cmds.c:93 +#: src/dird/ua_cmds.c:95 msgid "delete [pool= | media volume=]" msgstr "" -#: src/dird/ua_cmds.c:94 +#: src/dird/ua_cmds.c:96 +msgid "disable -- disable a job" +msgstr "" + +#: src/dird/ua_cmds.c:97 +msgid "enable -- enable a job" +msgstr "" + +#: src/dird/ua_cmds.c:98 msgid "performs FileSet estimate, listing gives full listing" msgstr "" -#: src/dird/ua_cmds.c:96 +#: src/dird/ua_cmds.c:100 msgid "gui [on|off] -- non-interactive gui mode" msgstr "" -#: src/dird/ua_cmds.c:97 src/stored/btape.c:2533 +#: src/dird/ua_cmds.c:101 src/stored/btape.c:2540 msgid "print this command" msgstr "" -#: src/dird/ua_cmds.c:98 +#: src/dird/ua_cmds.c:102 msgid "" "list [pools | jobs | jobtotals | media | files ]; " "from catalog" msgstr "" -#: src/dird/ua_cmds.c:99 +#: src/dird/ua_cmds.c:103 msgid "label a tape" msgstr "" -#: src/dird/ua_cmds.c:100 +#: src/dird/ua_cmds.c:104 msgid "full or long list like list command" msgstr "" -#: src/dird/ua_cmds.c:101 +#: src/dird/ua_cmds.c:105 msgid "messages" msgstr "" -#: src/dird/ua_cmds.c:102 +#: src/dird/ua_cmds.c:106 msgid "mount " msgstr "" -#: src/dird/ua_cmds.c:103 +#: src/dird/ua_cmds.c:107 msgid "prune expired records from catalog" msgstr "" -#: src/dird/ua_cmds.c:104 +#: src/dird/ua_cmds.c:108 msgid "purge records from catalog" msgstr "" -#: src/dird/ua_cmds.c:105 +#: src/dird/ua_cmds.c:109 msgid "python control commands" msgstr "" -#: src/dird/ua_cmds.c:107 +#: src/dird/ua_cmds.c:111 msgid "query catalog" msgstr "" -#: src/dird/ua_cmds.c:108 +#: src/dird/ua_cmds.c:112 msgid "restore files" msgstr "" -#: src/dird/ua_cmds.c:109 +#: src/dird/ua_cmds.c:113 msgid "relabel a tape" msgstr "" -#: src/dird/ua_cmds.c:110 +#: src/dird/ua_cmds.c:114 msgid "release " msgstr "" -#: src/dird/ua_cmds.c:111 +#: src/dird/ua_cmds.c:115 msgid "reload conf file" msgstr "" -#: src/dird/ua_cmds.c:112 +#: src/dird/ua_cmds.c:116 msgid "run " msgstr "" -#: src/dird/ua_cmds.c:113 +#: src/dird/ua_cmds.c:117 msgid "status [storage | client]=" msgstr "" -#: src/dird/ua_cmds.c:114 +#: src/dird/ua_cmds.c:118 msgid "sets debug level" msgstr "" -#: src/dird/ua_cmds.c:115 +#: src/dird/ua_cmds.c:119 msgid "sets new client address -- if authorized" msgstr "" -#: src/dird/ua_cmds.c:116 +#: src/dird/ua_cmds.c:120 msgid "show (resource records) [jobs | pools | ... | all]" msgstr "" -#: src/dird/ua_cmds.c:117 +#: src/dird/ua_cmds.c:121 msgid "use SQL to query catalog" msgstr "" -#: src/dird/ua_cmds.c:119 +#: src/dird/ua_cmds.c:123 msgid "turn on/off trace to file" msgstr "" -#: src/dird/ua_cmds.c:120 +#: src/dird/ua_cmds.c:124 msgid "unmount " msgstr "" -#: src/dird/ua_cmds.c:121 +#: src/dird/ua_cmds.c:125 msgid "umount for old-time Unix guys" msgstr "" -#: src/dird/ua_cmds.c:122 +#: src/dird/ua_cmds.c:126 msgid "update Volume, Pool or slots" msgstr "" -#: src/dird/ua_cmds.c:123 +#: src/dird/ua_cmds.c:127 msgid "use catalog xxx" msgstr "" -#: src/dird/ua_cmds.c:124 +#: src/dird/ua_cmds.c:128 msgid "does variable expansion" msgstr "" -#: src/dird/ua_cmds.c:125 +#: src/dird/ua_cmds.c:129 msgid "print Director version" msgstr "" -#: src/dird/ua_cmds.c:126 +#: src/dird/ua_cmds.c:130 msgid "wait until no jobs are running" msgstr "" -#: src/dird/ua_cmds.c:158 +#: src/dird/ua_cmds.c:168 #, c-format msgid "%s: is an illegal command.\n" msgstr "" -#: src/dird/ua_cmds.c:196 +#: src/dird/ua_cmds.c:206 msgid "" "You probably don't want to be using this command since it\n" "creates database records without labeling the Volumes.\n" @@ -2552,220 +2565,230 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_cmds.c:215 +#: src/dird/ua_cmds.c:225 #, c-format msgid "Pool already has maximum volumes = %d\n" msgstr "" -#: src/dird/ua_cmds.c:217 +#: src/dird/ua_cmds.c:227 msgid "Enter new maximum (zero for unlimited): " msgstr "" -#: src/dird/ua_cmds.c:238 +#: src/dird/ua_cmds.c:248 #, c-format msgid "Enter number of Volumes to create. 0=>fixed name. Max=%d: " msgstr "" -#: src/dird/ua_cmds.c:244 +#: src/dird/ua_cmds.c:254 #, c-format msgid "The number must be between 0 and %d\n" msgstr "" -#: src/dird/ua_cmds.c:251 +#: src/dird/ua_cmds.c:261 msgid "Enter Volume name: " msgstr "" -#: src/dird/ua_cmds.c:255 +#: src/dird/ua_cmds.c:265 msgid "Enter base volume name: " msgstr "" -#: src/dird/ua_cmds.c:264 src/dird/ua_label.c:590 +#: src/dird/ua_cmds.c:274 src/dird/ua_label.c:605 msgid "Volume name too long.\n" msgstr "" -#: src/dird/ua_cmds.c:268 src/dird/ua_label.c:596 src/lib/edit.c:413 +#: src/dird/ua_cmds.c:278 src/dird/ua_label.c:611 src/lib/edit.c:413 msgid "Volume name must be at least one character long.\n" msgstr "" -#: src/dird/ua_cmds.c:277 +#: src/dird/ua_cmds.c:287 msgid "Enter the starting number: " msgstr "" -#: src/dird/ua_cmds.c:282 +#: src/dird/ua_cmds.c:292 msgid "Start number must be greater than zero.\n" msgstr "" -#: src/dird/ua_cmds.c:293 +#: src/dird/ua_cmds.c:303 msgid "Enter slot (0 for none): " msgstr "" -#: src/dird/ua_cmds.c:297 +#: src/dird/ua_cmds.c:307 msgid "InChanger? yes/no: " msgstr "" -#: src/dird/ua_cmds.c:324 +#: src/dird/ua_cmds.c:334 #, c-format msgid "%d Volumes created in pool %s\n" msgstr "" -#: src/dird/ua_cmds.c:340 src/dird/ua_cmds.c:866 +#: src/dird/ua_cmds.c:350 src/dird/ua_cmds.c:917 msgid "Turn on or off? " msgstr "" -#: src/dird/ua_cmds.c:348 src/dird/ua_cmds.c:874 +#: src/dird/ua_cmds.c:358 src/dird/ua_cmds.c:925 msgid "off" msgstr "" -#: src/dird/ua_cmds.c:368 +#: src/dird/ua_cmds.c:378 msgid "jobid" msgstr "" -#: src/dird/ua_cmds.c:375 +#: src/dird/ua_cmds.c:385 #, c-format msgid "JobId %s is not running. Use Job name to cancel inactive jobs.\n" msgstr "" -#: src/dird/ua_cmds.c:379 +#: src/dird/ua_cmds.c:389 msgid "job" msgstr "" -#: src/dird/ua_cmds.c:384 +#: src/dird/ua_cmds.c:394 #, c-format msgid "Warning Job %s is not running. Continuing anyway ...\n" msgstr "" -#: src/dird/ua_cmds.c:407 src/filed/status.c:193 src/stored/status.c:315 +#: src/dird/ua_cmds.c:416 src/filed/status.c:195 src/stored/status.c:343 msgid "No Jobs running.\n" msgstr "" -#: src/dird/ua_cmds.c:410 +#: src/dird/ua_cmds.c:419 msgid "Select Job:\n" msgstr "" -#: src/dird/ua_cmds.c:417 +#: src/dird/ua_cmds.c:425 #, c-format msgid "JobId=%s Job=%s" msgstr "" -#: src/dird/ua_cmds.c:422 +#: src/dird/ua_cmds.c:430 msgid "Choose Job to cancel" msgstr "" -#: src/dird/ua_cmds.c:426 +#: src/dird/ua_cmds.c:434 msgid "Confirm cancel (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:434 +#: src/dird/ua_cmds.c:442 #, c-format msgid "Job %s not found.\n" msgstr "" -#: src/dird/ua_cmds.c:539 +#: src/dird/ua_cmds.c:547 #, c-format msgid "" "Error: Pool %s already exists.\n" "Use update to change it.\n" msgstr "" -#: src/dird/ua_cmds.c:550 +#: src/dird/ua_cmds.c:558 #, c-format msgid "Pool %s created.\n" msgstr "" -#: src/dird/ua_cmds.c:563 +#: src/dird/ua_cmds.c:571 msgid "restart" msgstr "" -#: src/dird/ua_cmds.c:567 +#: src/dird/ua_cmds.c:575 msgid "Python interpreter restarted.\n" msgstr "" -#: src/dird/ua_cmds.c:569 src/dird/ua_cmds.c:1094 +#: src/dird/ua_cmds.c:577 src/dird/ua_cmds.c:1145 msgid "Nothing done.\n" msgstr "" -#: src/dird/ua_cmds.c:585 +#: src/dird/ua_cmds.c:593 src/dird/ua_cmds.c:639 msgid "Illegal command from this console.\n" msgstr "" -#: src/dird/ua_cmds.c:592 src/dird/ua_run.c:353 +#: src/dird/ua_cmds.c:600 src/dird/ua_run.c:353 #, c-format msgid "Client \"%s\" not found.\n" msgstr "" -#: src/dird/ua_cmds.c:601 +#: src/dird/ua_cmds.c:609 #, c-format msgid "Client \"%s\" address set to %s\n" msgstr "" -#: src/dird/ua_cmds.c:616 src/dird/ua_status.c:286 +#: src/dird/ua_cmds.c:634 +#, c-format +msgid "Job \"%s\" not found.\n" +msgstr "" + +#: src/dird/ua_cmds.c:643 +#, c-format +msgid "Job \"%s\" %sabled\n" +msgstr "" + +#: src/dird/ua_cmds.c:667 src/dird/ua_status.c:286 #, c-format msgid "Connecting to Storage daemon %s at %s:%d\n" msgstr "" -#: src/dird/ua_cmds.c:622 src/dird/ua_status.c:297 +#: src/dird/ua_cmds.c:673 src/dird/ua_status.c:297 msgid "Connected to storage daemon\n" msgstr "" -#: src/dird/ua_cmds.c:642 src/dird/ua_cmds.c:981 src/dird/ua_status.c:324 +#: src/dird/ua_cmds.c:693 src/dird/ua_cmds.c:1032 src/dird/ua_status.c:324 #, c-format msgid "Connecting to Client %s at %s:%d\n" msgstr "" -#: src/dird/ua_cmds.c:645 src/dird/ua_cmds.c:984 +#: src/dird/ua_cmds.c:696 src/dird/ua_cmds.c:1035 msgid "Failed to connect to Client.\n" msgstr "" -#: src/dird/ua_cmds.c:761 +#: src/dird/ua_cmds.c:812 msgid "Enter new debug level: " msgstr "" -#: src/dird/ua_cmds.c:827 +#: src/dird/ua_cmds.c:878 msgid "Available daemons are: \n" msgstr "" -#: src/dird/ua_cmds.c:832 +#: src/dird/ua_cmds.c:883 msgid "Select daemon type to set debug level" msgstr "" -#: src/dird/ua_cmds.c:936 src/dird/ua_run.c:478 +#: src/dird/ua_cmds.c:987 src/dird/ua_run.c:478 #, c-format msgid "Level %s not valid.\n" msgstr "" -#: src/dird/ua_cmds.c:949 +#: src/dird/ua_cmds.c:1000 msgid "No job specified.\n" msgstr "" -#: src/dird/ua_cmds.c:989 +#: src/dird/ua_cmds.c:1040 msgid "Error sending include list.\n" msgstr "" -#: src/dird/ua_cmds.c:994 +#: src/dird/ua_cmds.c:1045 msgid "Error sending exclude list.\n" msgstr "" -#: src/dird/ua_cmds.c:1080 +#: src/dird/ua_cmds.c:1131 msgid "" "In general it is not a good idea to delete either a\n" "Pool or a Volume since they may contain data.\n" "\n" msgstr "" -#: src/dird/ua_cmds.c:1083 +#: src/dird/ua_cmds.c:1134 msgid "Choose catalog item to delete" msgstr "" -#: src/dird/ua_cmds.c:1151 +#: src/dird/ua_cmds.c:1202 msgid "Enter JobId to delete: " msgstr "" -#: src/dird/ua_cmds.c:1194 +#: src/dird/ua_cmds.c:1245 #, c-format msgid "Job %s and associated records deleted from the catalog.\n" msgstr "" -#: src/dird/ua_cmds.c:1207 +#: src/dird/ua_cmds.c:1258 #, c-format msgid "" "\n" @@ -2773,58 +2796,62 @@ msgid "" "and all Jobs saved on that volume from the Catalog\n" msgstr "" -#: src/dird/ua_cmds.c:1211 +#: src/dird/ua_cmds.c:1262 msgid "Are you sure you want to delete this Volume? (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:1232 +#: src/dird/ua_cmds.c:1283 msgid "Are you sure you want to delete this Pool? (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:1329 +#: src/dird/ua_cmds.c:1380 #, c-format msgid "Using Catalog name=%s DB=%s\n" msgstr "" -#: src/dird/ua_cmds.c:1370 src/dird/ua_tree.c:594 src/stored/btape.c:2580 +#: src/dird/ua_cmds.c:1421 src/dird/ua_tree.c:622 src/stored/btape.c:2587 #, c-format msgid "" " Command Description\n" " ======= ===========\n" msgstr "" -#: src/dird/ua_cmds.c:1372 +#: src/dird/ua_cmds.c:1423 #, c-format msgid " %-10s %s\n" msgstr "" -#: src/dird/ua_cmds.c:1374 +#: src/dird/ua_cmds.c:1425 msgid "" "\n" "When at a prompt, entering a period cancels the command.\n" "\n" msgstr "" -#: src/dird/ua_cmds.c:1390 +#: src/dird/ua_cmds.c:1441 #, c-format msgid "%s Version: %s (%s)\n" msgstr "" -#: src/dird/ua_cmds.c:1409 +#: src/dird/ua_cmds.c:1460 msgid "Could not find a Catalog resource\n" msgstr "" -#: src/dird/ua_cmds.c:1412 +#: src/dird/ua_cmds.c:1463 +msgid "You must specify a \"use \" command before continuing.\n" +msgstr "" + +#: src/dird/ua_cmds.c:1467 #, c-format msgid "Using default Catalog name=%s DB=%s\n" msgstr "" -#: src/dird/ua_dotcmds.c:121 +#: src/dird/ua_dotcmds.c:131 msgid "The Director will segment fault.\n" msgstr "" -#: src/dird/ua_dotcmds.c:221 src/dird/ua_restore.c:747 -#: src/dird/ua_restore.c:785 +#: src/dird/ua_dotcmds.c:231 src/dird/ua_restore.c:740 +#: src/dird/ua_restore.c:778 src/dird/ua_restore.c:809 #, c-format msgid "Query failed: %s. ERR=%s\n" msgstr "" @@ -2838,15 +2865,16 @@ msgstr "" msgid "Expected a positive integer, got: %s\n" msgstr "" -#: src/dird/ua_input.c:120 src/dird/ua_run.c:860 src/dird/ua_select.c:54 -#: src/dird/ua_update.c:232 src/dird/ua_update.c:247 src/dird/ua_update.c:495 +#: src/dird/ua_input.c:120 src/dird/ua_run.c:862 src/dird/ua_select.c:54 +#: src/dird/ua_update.c:223 src/dird/ua_update.c:237 src/dird/ua_update.c:247 +#: src/dird/ua_update.c:261 src/dird/ua_update.c:551 #: src/stored/parse_bsr.c:741 src/tools/dbcheck.c:1098 msgid "yes" msgstr "" -#: src/dird/ua_input.c:124 src/dird/ua_select.c:57 src/dird/ua_update.c:234 -#: src/dird/ua_update.c:247 src/dird/ua_update.c:495 -#: src/stored/parse_bsr.c:741 +#: src/dird/ua_input.c:124 src/dird/ua_select.c:57 src/dird/ua_update.c:225 +#: src/dird/ua_update.c:237 src/dird/ua_update.c:249 src/dird/ua_update.c:261 +#: src/dird/ua_update.c:551 src/stored/parse_bsr.c:741 msgid "no" msgstr "" @@ -2854,271 +2882,287 @@ msgstr "" msgid "Invalid response. You must answer yes or no.\n" msgstr "" -#: src/dird/ua_label.c:88 +#: src/dird/ua_label.c:89 msgid "Negative numbers not permitted\n" msgstr "" -#: src/dird/ua_label.c:94 +#: src/dird/ua_label.c:95 msgid "Range end is not integer.\n" msgstr "" -#: src/dird/ua_label.c:99 +#: src/dird/ua_label.c:100 msgid "Range start is not an integer.\n" msgstr "" -#: src/dird/ua_label.c:105 +#: src/dird/ua_label.c:106 msgid "Range end not bigger than start.\n" msgstr "" -#: src/dird/ua_label.c:111 +#: src/dird/ua_label.c:112 msgid "Input value is not an integer.\n" msgstr "" -#: src/dird/ua_label.c:117 +#: src/dird/ua_label.c:118 msgid "Values must be be greater than zero.\n" msgstr "" -#: src/dird/ua_label.c:121 +#: src/dird/ua_label.c:122 msgid "Slot too large.\n" msgstr "" -#: src/dird/ua_label.c:176 src/dird/ua_label.c:463 +#: src/dird/ua_label.c:176 src/dird/ua_label.c:473 msgid "No slots in changer to scan.\n" msgstr "" -#: src/dird/ua_label.c:188 src/dird/ua_label.c:474 +#: src/dird/ua_label.c:188 src/dird/ua_label.c:484 msgid "No Volumes found to label, or no barcodes.\n" msgstr "" -#: src/dird/ua_label.c:195 +#: src/dird/ua_label.c:198 #, c-format -msgid "Slot %d larger than max %d ignored.\n" +msgid "Slot %d greater than max %d ignored.\n" msgstr "" -#: src/dird/ua_label.c:224 +#: src/dird/ua_label.c:227 #, c-format -msgid "No VolName for Slot=%d set InChanger to zero.\n" +msgid "No VolName for Slot=%d InChanger set to zero.\n" msgstr "" -#: src/dird/ua_label.c:239 +#: src/dird/ua_label.c:242 #, c-format msgid "Catalog record for Volume \"%s\" updated to reference slot %d.\n" msgstr "" -#: src/dird/ua_label.c:243 +#: src/dird/ua_label.c:246 #, c-format msgid "Catalog record for Volume \"%s\" is up to date.\n" msgstr "" -#: src/dird/ua_label.c:249 +#: src/dird/ua_label.c:252 #, c-format -msgid "Record for Volume \"%s\" not found in catalog.\n" +msgid "Volume \"%s\" not found in catalog. Slot=%d InChanger set to zero.\n" msgstr "" -#: src/dird/ua_label.c:334 +#: src/dird/ua_label.c:344 #, c-format msgid "" "Volume \"%s\" has VolStatus %s. It must be Purged or Recycled before " "relabeling.\n" msgstr "" -#: src/dird/ua_label.c:350 +#: src/dird/ua_label.c:360 msgid "Enter new Volume name: " msgstr "" -#: src/dird/ua_label.c:363 +#: src/dird/ua_label.c:373 #, c-format msgid "Media record for new Volume \"%s\" already exists.\n" msgstr "" -#: src/dird/ua_label.c:378 +#: src/dird/ua_label.c:388 msgid "Enter slot (0 or Enter for none): " msgstr "" -#: src/dird/ua_label.c:403 +#: src/dird/ua_label.c:413 #, c-format msgid "Delete of Volume \"%s\" failed. ERR=%s" msgstr "" -#: src/dird/ua_label.c:406 +#: src/dird/ua_label.c:416 #, c-format msgid "Old volume \"%s\" deleted from catalog.\n" msgstr "" -#: src/dird/ua_label.c:417 +#: src/dird/ua_label.c:427 #, c-format msgid "Requesting to mount %s ...\n" msgstr "" -#: src/dird/ua_label.c:439 +#: src/dird/ua_label.c:449 msgid "Do not forget to mount the drive!!!\n" msgstr "" -#: src/dird/ua_label.c:479 +#: src/dird/ua_label.c:489 msgid "" "The following Volumes will be labeled:\n" "Slot Volume\n" "==============\n" msgstr "" -#: src/dird/ua_label.c:488 src/stored/btape.c:608 +#: src/dird/ua_label.c:498 src/stored/btape.c:606 msgid "Do you want to continue? (y/n): " msgstr "" -#: src/dird/ua_label.c:509 +#: src/dird/ua_label.c:519 #, c-format msgid "Media record for Slot %d Volume \"%s\" already exists.\n" msgstr "" -#: src/dird/ua_label.c:515 +#: src/dird/ua_label.c:525 #, c-format msgid "Error setting InChanger: ERR=%s" msgstr "" -#: src/dird/ua_label.c:540 +#: src/dird/ua_label.c:548 +#, c-format +msgid "Maximum pool Volumes=%d reached.\n" +msgstr "" + +#: src/dird/ua_label.c:555 #, c-format msgid "Catalog record for cleaning tape \"%s\" successfully created.\n" msgstr "" -#: src/dird/ua_label.c:547 +#: src/dird/ua_label.c:562 #, c-format msgid "Catalog error on cleaning tape: %s" msgstr "" -#: src/dird/ua_label.c:583 +#: src/dird/ua_label.c:598 #, c-format msgid "Illegal character \"%c\" in a volume name.\n" msgstr "" -#: src/dird/ua_label.c:628 +#: src/dird/ua_label.c:643 #, c-format msgid "Sending relabel command from \"%s\" to \"%s\" ...\n" msgstr "" -#: src/dird/ua_label.c:635 +#: src/dird/ua_label.c:650 #, c-format msgid "Sending label command for Volume \"%s\" Slot %d ...\n" msgstr "" -#: src/dird/ua_label.c:665 +#: src/dird/ua_label.c:682 #, c-format msgid "Catalog record for Volume \"%s\", Slot %d successfully created.\n" msgstr "" -#: src/dird/ua_label.c:678 +#: src/dird/ua_label.c:695 #, c-format msgid "Label command failed for Volume %s.\n" msgstr "" -#: src/dird/ua_label.c:688 +#: src/dird/ua_label.c:705 #, c-format msgid "Connecting to Storage daemon %s at %s:%d ...\n" msgstr "" -#: src/dird/ua_label.c:716 +#: src/dird/ua_label.c:733 msgid "Could not open SD socket.\n" msgstr "" -#: src/dird/ua_label.c:722 +#: src/dird/ua_label.c:739 #, c-format msgid "readlabel %s Slot=%d drive=%d\n" msgstr "" -#: src/dird/ua_label.c:764 +#: src/dird/ua_label.c:781 #, c-format msgid "autochanger list %s \n" msgstr "" -#: src/dird/ua_label.c:788 src/dird/ua_label.c:798 +#: src/dird/ua_label.c:805 src/dird/ua_label.c:815 #, c-format msgid "Invalid Slot number: %s\n" msgstr "" -#: src/dird/ua_label.c:807 +#: src/dird/ua_label.c:824 #, c-format msgid "Invalid Volume name: %s\n" msgstr "" -#: src/dird/ua_label.c:876 +#: src/dird/ua_label.c:893 #, c-format -msgid "autochanger slots %s \n" +msgid "autochanger slots %s\n" msgstr "" -#: src/dird/ua_label.c:886 +#: src/dird/ua_label.c:903 #, c-format msgid "Device \"%s\" has %d slots.\n" msgstr "" -#: src/dird/ua_label.c:902 +#: src/dird/ua_label.c:925 +#, c-format +msgid "autochanger drives %s\n" +msgstr "" + +#: src/dird/ua_label.c:952 #, c-format msgid "Pool \"%s\" resource not found!\n" msgstr "" -#: src/dird/ua_output.c:64 src/dird/ua_output.c:90 +#: src/dird/ua_output.c:64 src/dird/ua_output.c:88 msgid "ON or OFF keyword missing.\n" msgstr "" -#: src/dird/ua_output.c:178 +#: src/dird/ua_output.c:176 msgid "Keywords for the show command are:\n" msgstr "" -#: src/dird/ua_output.c:184 +#: src/dird/ua_output.c:182 #, c-format msgid "%s resource %s not found.\n" msgstr "" -#: src/dird/ua_output.c:187 +#: src/dird/ua_output.c:185 #, c-format msgid "Resource %s not found\n" msgstr "" -#: src/dird/ua_output.c:253 +#: src/dird/ua_output.c:251 msgid "Hey! DB is NULL\n" msgstr "" -#: src/dird/ua_output.c:353 +#: src/dird/ua_output.c:358 #, c-format msgid "Jobid %d used %d Volume(s): %s\n" msgstr "" -#: src/dird/ua_output.c:365 +#: src/dird/ua_output.c:376 msgid "No Pool specified.\n" msgstr "" -#: src/dird/ua_output.c:375 src/dird/ua_select.c:446 +#: src/dird/ua_output.c:387 src/dird/ua_select.c:458 #, c-format msgid "Error obtaining pool ids. ERR=%s\n" msgstr "" -#: src/dird/ua_output.c:385 +#: src/dird/ua_output.c:397 #, c-format msgid "Pool: %s\n" msgstr "" -#: src/dird/ua_output.c:396 -msgid "No Volume Name specified.\n" +#: src/dird/ua_output.c:413 src/dird/ua_status.c:452 +msgid "Ignoring illegal value for days.\n" msgstr "" -#: src/dird/ua_output.c:409 +#: src/dird/ua_output.c:422 #, c-format msgid "Unknown list keyword: %s\n" msgstr "" -#: src/dird/ua_output.c:434 +#: src/dird/ua_output.c:448 #, c-format msgid "%s is not a job name.\n" msgstr "" -#: src/dird/ua_output.c:450 src/dird/ua_output.c:462 -msgid "Could not find next Volume.\n" +#: src/dird/ua_output.c:469 +#, c-format +msgid "Could not find next Volume for Job %s (%s, %s).\n" +msgstr "" + +#: src/dird/ua_output.c:473 +#, c-format +msgid "The next Volume to be used by Job \"%s\" (%s, %s) will be %s\n" msgstr "" -#: src/dird/ua_output.c:452 +#: src/dird/ua_output.c:483 #, c-format -msgid "The next Volume to be used by Job \"%s\" will be %s\n" +msgid "Could not find next Volume for Job %s.\n" msgstr "" -#: src/dird/ua_output.c:671 +#: src/dird/ua_output.c:673 msgid "You have no messages.\n" msgstr "" @@ -3278,32 +3322,32 @@ msgstr "" msgid "End query mode.\n" msgstr "" -#: src/dird/ua_restore.c:151 +#: src/dird/ua_restore.c:115 msgid "" "No Restore Job Resource found in bacula-dir.conf.\n" "You must create at least one before running this command.\n" msgstr "" -#: src/dird/ua_restore.c:167 +#: src/dird/ua_restore.c:131 msgid "Restore not done.\n" msgstr "" -#: src/dird/ua_restore.c:178 +#: src/dird/ua_restore.c:142 msgid "Unable to construct a valid BSR. Cannot continue.\n" msgstr "" -#: src/dird/ua_restore.c:182 src/dird/ua_restore.c:196 +#: src/dird/ua_restore.c:146 src/dird/ua_restore.c:160 msgid "No files selected to be restored.\n" msgstr "" -#: src/dird/ua_restore.c:190 +#: src/dird/ua_restore.c:154 msgid "" "\n" "1 file selected to be restored.\n" "\n" msgstr "" -#: src/dird/ua_restore.c:193 +#: src/dird/ua_restore.c:157 #, c-format msgid "" "\n" @@ -3311,80 +3355,85 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_restore.c:211 +#: src/dird/ua_restore.c:175 msgid "No Restore Job resource found!\n" msgstr "" -#: src/dird/ua_restore.c:309 +#: src/dird/ua_restore.c:237 +#, c-format +msgid "Missing value for keyword: %s\n" +msgstr "" + +#: src/dird/ua_restore.c:286 msgid "List last 20 Jobs run" msgstr "" -#: src/dird/ua_restore.c:310 +#: src/dird/ua_restore.c:287 msgid "List Jobs where a given File is saved" msgstr "" -#: src/dird/ua_restore.c:311 +#: src/dird/ua_restore.c:288 msgid "Enter list of comma separated JobIds to select" msgstr "" -#: src/dird/ua_restore.c:312 +#: src/dird/ua_restore.c:289 msgid "Enter SQL list command" msgstr "" -#: src/dird/ua_restore.c:313 +#: src/dird/ua_restore.c:290 msgid "Select the most recent backup for a client" msgstr "" -#: src/dird/ua_restore.c:314 +#: src/dird/ua_restore.c:291 msgid "Select backup for a client before a specified time" msgstr "" -#: src/dird/ua_restore.c:315 +#: src/dird/ua_restore.c:292 msgid "Enter a list of files to restore" msgstr "" -#: src/dird/ua_restore.c:316 +#: src/dird/ua_restore.c:293 msgid "Enter a list of files to restore before a specified time" msgstr "" -#: src/dird/ua_restore.c:317 +#: src/dird/ua_restore.c:294 msgid "Find the JobIds of the most recent backup for a client" msgstr "" -#: src/dird/ua_restore.c:318 +#: src/dird/ua_restore.c:295 msgid "Find the JobIds for a backup for a client before a specified time" msgstr "" -#: src/dird/ua_restore.c:319 +#: src/dird/ua_restore.c:296 msgid "Enter a list of directories to restore for found JobIds" msgstr "" -#: src/dird/ua_restore.c:320 src/dird/ua_status.c:702 src/filed/status.c:249 -#: src/stored/status.c:367 src/wx-console/wxbconfigpanel.cpp:191 +#: src/dird/ua_restore.c:297 src/dird/ua_status.c:713 src/filed/status.c:251 +#: src/stored/status.c:412 src/wx-console/wxbconfigpanel.cpp:191 msgid "Cancel" msgstr "" -#: src/dird/ua_restore.c:356 +#: src/dird/ua_restore.c:333 #, c-format msgid "Unknown keyword: %s\n" msgstr "" -#: src/dird/ua_restore.c:374 +#: src/dird/ua_restore.c:357 #, c-format msgid "Improper date format: %s\n" msgstr "" -#: src/dird/ua_restore.c:408 src/dird/ua_select.c:576 +#: src/dird/ua_restore.c:397 src/dird/ua_select.c:590 #, c-format msgid "Error: Pool resource \"%s\" does not exist.\n" msgstr "" -#: src/dird/ua_restore.c:413 +#: src/dird/ua_restore.c:402 #, c-format msgid "Error: Pool resource \"%s\" access not allowed.\n" msgstr "" -#: src/dird/ua_restore.c:432 +#: src/dird/ua_restore.c:421 msgid "" "\n" "First you select one or more JobIds that contain files\n" @@ -3394,217 +3443,226 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_restore.c:444 +#: src/dird/ua_restore.c:433 msgid "To select the JobIds, you have the following choices:\n" msgstr "" -#: src/dird/ua_restore.c:449 +#: src/dird/ua_restore.c:438 msgid "Select item: " msgstr "" -#: src/dird/ua_restore.c:463 +#: src/dird/ua_restore.c:452 msgid "Enter Filename (no path):" msgstr "" -#: src/dird/ua_restore.c:478 src/dird/ua_restore.c:578 +#: src/dird/ua_restore.c:467 src/dird/ua_restore.c:567 msgid "Enter JobId(s), comma separated, to restore: " msgstr "" -#: src/dird/ua_restore.c:484 +#: src/dird/ua_restore.c:473 msgid "Enter SQL list command: " msgstr "" -#: src/dird/ua_restore.c:512 src/dird/ua_restore.c:537 +#: src/dird/ua_restore.c:501 src/dird/ua_restore.c:526 msgid "" "Enter file names with paths, or < to enter a filename\n" "containg a list of file names with paths, and terminate\n" "them with a blank line.\n" msgstr "" -#: src/dird/ua_restore.c:516 src/dird/ua_restore.c:541 +#: src/dird/ua_restore.c:505 src/dird/ua_restore.c:530 msgid "Enter full filename: " msgstr "" -#: src/dird/ua_restore.c:576 +#: src/dird/ua_restore.c:565 #, c-format msgid "You have already seleted the following JobIds: %s\n" msgstr "" -#: src/dird/ua_restore.c:591 +#: src/dird/ua_restore.c:580 msgid "" "Enter full directory names or start the name\n" "with a < to indicate it is a filename containg a list\n" "of directories and terminate them with a blank line.\n" msgstr "" -#: src/dird/ua_restore.c:595 +#: src/dird/ua_restore.c:584 msgid "Enter directory name: " msgstr "" -#: src/dird/ua_restore.c:620 +#: src/dird/ua_restore.c:609 msgid "No Jobs selected.\n" msgstr "" -#: src/dird/ua_restore.c:624 +#: src/dird/ua_restore.c:613 #, c-format msgid "You have selected the following JobIds: %s\n" msgstr "" -#: src/dird/ua_restore.c:627 +#: src/dird/ua_restore.c:616 #, c-format msgid "You have selected the following JobId: %s\n" msgstr "" -#: src/dird/ua_restore.c:636 +#: src/dird/ua_restore.c:624 msgid "Invalid JobId in list.\n" msgstr "" -#: src/dird/ua_restore.c:648 +#: src/dird/ua_restore.c:637 #, c-format msgid "Unable to get Job record for JobId=%s: ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:653 +#: src/dird/ua_restore.c:642 #, c-format msgid "No authorization. Job \"%s\" not selected.\n" msgstr "" -#: src/dird/ua_restore.c:667 +#: src/dird/ua_restore.c:656 msgid "" "The restored files will the most current backup\n" "BEFORE the date you specify below.\n" "\n" msgstr "" -#: src/dird/ua_restore.c:670 +#: src/dird/ua_restore.c:659 msgid "Enter date as YYYY-MM-DD HH:MM:SS :" msgstr "" -#: src/dird/ua_restore.c:676 +#: src/dird/ua_restore.c:665 msgid "Improper date format.\n" msgstr "" -#: src/dird/ua_restore.c:697 +#: src/dird/ua_restore.c:686 #, c-format msgid "Cannot open file %s: ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:705 src/dird/ua_restore.c:709 +#: src/dird/ua_restore.c:694 src/dird/ua_restore.c:698 #, c-format msgid "Error occurred on line %d of %s\n" msgstr "" -#: src/dird/ua_restore.c:751 src/dird/ua_restore.c:789 +#: src/dird/ua_restore.c:744 src/dird/ua_restore.c:782 #, c-format msgid "No database record found for: %s\n" msgstr "" -#: src/dird/ua_restore.c:776 +#: src/dird/ua_restore.c:769 msgid "No JobId specified cannot continue.\n" msgstr "" -#: src/dird/ua_restore.c:895 +#: src/dird/ua_restore.c:813 +#, c-format +msgid "No table found: %s\n" +msgstr "" + +#: src/dird/ua_restore.c:918 #, c-format msgid "" "\n" "Building directory tree for JobId %s ... " msgstr "" -#: src/dird/ua_restore.c:914 +#: src/dird/ua_restore.c:937 msgid "" "\n" "There were no files inserted into the tree, so file selection\n" "is not possible.Most likely your retention policy pruned the files\n" msgstr "" -#: src/dird/ua_restore.c:916 +#: src/dird/ua_restore.c:939 msgid "" "\n" "Do you want to restore all the files? (yes|no): " msgstr "" -#: src/dird/ua_restore.c:932 +#: src/dird/ua_restore.c:955 #, c-format msgid "" "\n" "1 Job, %s files inserted into the tree and marked for extraction.\n" msgstr "" -#: src/dird/ua_restore.c:936 +#: src/dird/ua_restore.c:959 #, c-format msgid "" "\n" "1 Job, %s files inserted into the tree.\n" msgstr "" -#: src/dird/ua_restore.c:942 +#: src/dird/ua_restore.c:965 #, c-format msgid "" "\n" "%d Jobs, %s files inserted into the tree and marked for extraction.\n" msgstr "" -#: src/dird/ua_restore.c:946 +#: src/dird/ua_restore.c:969 #, c-format msgid "" "\n" "%d Jobs, %s files inserted into the tree.\n" msgstr "" -#: src/dird/ua_restore.c:1023 +#: src/dird/ua_restore.c:1046 #, c-format msgid "Error getting FileSet \"%s\": ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:1031 src/dird/ua_select.c:165 +#: src/dird/ua_restore.c:1054 src/dird/ua_select.c:167 msgid "The defined FileSet resources are:\n" msgstr "" -#: src/dird/ua_restore.c:1035 src/dird/ua_select.c:173 +#: src/dird/ua_restore.c:1058 src/dird/ua_run.c:644 src/dird/ua_select.c:175 +msgid "FileSet" +msgstr "" + +#: src/dird/ua_restore.c:1058 src/dird/ua_select.c:175 msgid "Select FileSet resource" msgstr "" -#: src/dird/ua_restore.c:1042 +#: src/dird/ua_restore.c:1065 #, c-format msgid "Error getting FileSet record: %s\n" msgstr "" -#: src/dird/ua_restore.c:1043 +#: src/dird/ua_restore.c:1066 msgid "" "This probably means you modified the FileSet.\n" "Continuing anyway.\n" msgstr "" -#: src/dird/ua_restore.c:1058 +#: src/dird/ua_restore.c:1081 #, c-format msgid "Pool \"%s\" not found, using any pool.\n" msgstr "" -#: src/dird/ua_restore.c:1084 src/dird/ua_restore.c:1100 +#: src/dird/ua_restore.c:1107 src/dird/ua_restore.c:1123 #, c-format msgid "No Full backup before %s found.\n" msgstr "" -#: src/dird/ua_restore.c:1123 +#: src/dird/ua_restore.c:1146 msgid "No jobs found.\n" msgstr "" -#: src/dird/ua_restore.c:1289 +#: src/dird/ua_restore.c:1312 msgid "" "Warning, the JobIds that you selected refer to more than one MediaType.\n" "Restore is not possible. The MediaTypes used are:\n" msgstr "" -#: src/dird/ua_restore.c:1297 +#: src/dird/ua_restore.c:1320 msgid "No MediaType found for your JobIds.\n" msgstr "" -#: src/dird/ua_restore.c:1329 +#: src/dird/ua_restore.c:1352 #, c-format msgid "Warning default storage overridden by %s on command line.\n" msgstr "" -#: src/dird/ua_restore.c:1340 +#: src/dird/ua_restore.c:1363 #, c-format msgid "" "\n" @@ -3759,7 +3817,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:507 src/lib/util.c:301 +#: src/dird/ua_run.c:507 src/lib/util.c:295 msgid "Admin" msgstr "" @@ -3777,7 +3835,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:528 src/lib/util.c:292 +#: src/dird/ua_run.c:528 src/lib/util.c:286 msgid "Backup" msgstr "" @@ -3796,7 +3854,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:554 src/lib/util.c:295 +#: src/dird/ua_run.c:554 src/lib/util.c:289 msgid "Verify" msgstr "" @@ -3849,7 +3907,7 @@ msgstr "" msgid "mod" msgstr "" -#: src/dird/ua_run.c:640 src/dird/ua_update.c:415 +#: src/dird/ua_run.c:640 src/dird/ua_update.c:464 msgid "Parameters to modify:\n" msgstr "" @@ -3857,40 +3915,79 @@ msgstr "" msgid "Level" msgstr "" -#: src/dird/ua_run.c:646 src/wx-console/wxbrestorepanel.cpp:380 -#: src/wx-console/wxbrestorepanel.cpp:808 -#: src/wx-console/wxbrestorepanel.cpp:1833 +#: src/dird/ua_run.c:642 src/dird/ua_select.c:152 +#: src/wx-console/wxbrestorepanel.cpp:321 +#: src/wx-console/wxbrestorepanel.cpp:337 +#: src/wx-console/wxbrestorepanel.cpp:458 +#: src/wx-console/wxbrestorepanel.cpp:459 +#: src/wx-console/wxbrestorepanel.cpp:469 +#: src/wx-console/wxbrestorepanel.cpp:470 +#: src/wx-console/wxbrestorepanel.cpp:1133 +#: src/wx-console/wxbrestorepanel.cpp:1794 +#: src/wx-console/wxbrestorepanel.cpp:1865 +msgid "Storage" +msgstr "" + +#: src/dird/ua_run.c:645 src/dird/ua_select.c:282 src/dird/ua_select.c:391 +#: src/wx-console/wxbrestorepanel.cpp:318 +#: src/wx-console/wxbrestorepanel.cpp:336 +#: src/wx-console/wxbrestorepanel.cpp:410 +#: src/wx-console/wxbrestorepanel.cpp:411 +#: src/wx-console/wxbrestorepanel.cpp:421 +#: src/wx-console/wxbrestorepanel.cpp:422 +#: src/wx-console/wxbrestorepanel.cpp:669 +#: src/wx-console/wxbrestorepanel.cpp:1103 +#: src/wx-console/wxbrestorepanel.cpp:1190 +#: src/wx-console/wxbrestorepanel.cpp:1787 +#: src/wx-console/wxbrestorepanel.cpp:1789 +#: src/wx-console/wxbrestorepanel.cpp:1863 +#: src/wx-console/wxbrestorepanel.cpp:1918 +msgid "Client" +msgstr "" + +#: src/dird/ua_run.c:646 src/wx-console/wxbrestorepanel.cpp:338 +#: src/wx-console/wxbrestorepanel.cpp:823 +#: src/wx-console/wxbrestorepanel.cpp:1867 msgid "When" msgstr "" -#: src/dird/ua_run.c:647 src/wx-console/wxbrestorepanel.cpp:381 -#: src/wx-console/wxbrestorepanel.cpp:1079 -#: src/wx-console/wxbrestorepanel.cpp:1835 +#: src/dird/ua_run.c:647 src/wx-console/wxbrestorepanel.cpp:339 +#: src/wx-console/wxbrestorepanel.cpp:1096 +#: src/wx-console/wxbrestorepanel.cpp:1869 msgid "Priority" msgstr "" +#: src/dird/ua_run.c:650 src/dird/ua_select.c:476 src/dird/ua_select.c:566 +#: src/dird/ua_update.c:400 src/dird/ua_update.c:475 +#: src/wx-console/wxbrestorepanel.cpp:320 +#: src/wx-console/wxbrestorepanel.cpp:506 +#: src/wx-console/wxbrestorepanel.cpp:516 +#: src/wx-console/wxbrestorepanel.cpp:1783 +msgid "Pool" +msgstr "" + #: src/dird/ua_run.c:652 msgid "Verify Job" msgstr "" -#: src/dird/ua_run.c:655 src/wx-console/wxbrestorepanel.cpp:373 -#: src/wx-console/wxbrestorepanel.cpp:1814 +#: src/dird/ua_run.c:655 src/wx-console/wxbrestorepanel.cpp:331 +#: src/wx-console/wxbrestorepanel.cpp:1848 msgid "Bootstrap" msgstr "" -#: src/dird/ua_run.c:656 src/wx-console/wxbrestorepanel.cpp:374 -#: src/wx-console/wxbrestorepanel.cpp:1055 -#: src/wx-console/wxbrestorepanel.cpp:1816 +#: src/dird/ua_run.c:656 src/wx-console/wxbrestorepanel.cpp:332 +#: src/wx-console/wxbrestorepanel.cpp:1072 +#: src/wx-console/wxbrestorepanel.cpp:1850 msgid "Where" msgstr "" -#: src/dird/ua_run.c:657 src/wx-console/wxbrestorepanel.cpp:376 -#: src/wx-console/wxbrestorepanel.cpp:1063 -#: src/wx-console/wxbrestorepanel.cpp:1820 -#: src/wx-console/wxbrestorepanel.cpp:1821 -#: src/wx-console/wxbrestorepanel.cpp:1822 -#: src/wx-console/wxbrestorepanel.cpp:1823 -#: src/wx-console/wxbrestorepanel.cpp:1824 +#: src/dird/ua_run.c:657 src/wx-console/wxbrestorepanel.cpp:334 +#: src/wx-console/wxbrestorepanel.cpp:1080 +#: src/wx-console/wxbrestorepanel.cpp:1854 +#: src/wx-console/wxbrestorepanel.cpp:1855 +#: src/wx-console/wxbrestorepanel.cpp:1856 +#: src/wx-console/wxbrestorepanel.cpp:1857 +#: src/wx-console/wxbrestorepanel.cpp:1858 msgid "Replace" msgstr "" @@ -3898,7 +3995,7 @@ msgstr "" msgid "JobId" msgstr "" -#: src/dird/ua_run.c:660 src/dird/ua_update.c:430 +#: src/dird/ua_run.c:660 src/dird/ua_update.c:479 msgid "Select parameter to modify" msgstr "" @@ -3907,27 +4004,27 @@ msgid "Levels:\n" msgstr "" #: src/dird/ua_run.c:665 src/filed/status.c:368 src/lib/util.c:319 -#: src/stored/status.c:406 +#: src/stored/status.c:451 msgid "Base" msgstr "" -#: src/dird/ua_run.c:666 src/dird/ua_update.c:106 src/dird/ua_update.c:438 -#: src/filed/status.c:370 src/lib/util.c:321 src/stored/status.c:408 +#: src/dird/ua_run.c:666 src/filed/status.c:370 src/lib/util.c:321 +#: src/stored/status.c:453 msgid "Full" msgstr "" #: src/dird/ua_run.c:667 src/filed/status.c:373 src/lib/util.c:324 -#: src/stored/status.c:411 +#: src/stored/status.c:456 msgid "Incremental" msgstr "" #: src/dird/ua_run.c:668 src/filed/status.c:376 src/lib/util.c:327 -#: src/stored/status.c:414 +#: src/stored/status.c:459 msgid "Differential" msgstr "" #: src/dird/ua_run.c:669 src/filed/status.c:379 src/lib/util.c:330 -#: src/stored/status.c:417 +#: src/stored/status.c:462 msgid "Since" msgstr "" @@ -3940,7 +4037,7 @@ msgid "Initialize Catalog" msgstr "" #: src/dird/ua_run.c:693 src/filed/status.c:382 src/lib/util.c:333 -#: src/stored/status.c:420 +#: src/stored/status.c:465 msgid "Verify Catalog" msgstr "" @@ -3999,16 +4096,16 @@ msgid "" "You must set the bootstrap file to NULL to be able to specify a JobId.\n" msgstr "" -#: src/dird/ua_run.c:867 +#: src/dird/ua_run.c:869 msgid "Job failed.\n" msgstr "" -#: src/dird/ua_run.c:870 +#: src/dird/ua_run.c:872 #, c-format msgid "Job started. JobId=%s\n" msgstr "" -#: src/dird/ua_run.c:876 +#: src/dird/ua_run.c:878 msgid "Job not run.\n" msgstr "" @@ -4041,199 +4138,199 @@ msgstr "" msgid "Select Storage resource" msgstr "" -#: src/dird/ua_select.c:189 +#: src/dird/ua_select.c:193 msgid "catalog" msgstr "" -#: src/dird/ua_select.c:197 +#: src/dird/ua_select.c:201 msgid "The defined Catalog resources are:\n" msgstr "" -#: src/dird/ua_select.c:205 +#: src/dird/ua_select.c:209 msgid "Catalog" msgstr "" -#: src/dird/ua_select.c:205 +#: src/dird/ua_select.c:209 msgid "Select Catalog resource" msgstr "" -#: src/dird/ua_select.c:220 +#: src/dird/ua_select.c:226 msgid "The defined Job resources are:\n" msgstr "" -#: src/dird/ua_select.c:228 +#: src/dird/ua_select.c:234 msgid "Select Job resource" msgstr "" -#: src/dird/ua_select.c:241 +#: src/dird/ua_select.c:249 msgid "The defined Restore Job resources are:\n" msgstr "" -#: src/dird/ua_select.c:249 +#: src/dird/ua_select.c:257 msgid "Select Restore Job" msgstr "" -#: src/dird/ua_select.c:264 +#: src/dird/ua_select.c:274 msgid "The defined Client resources are:\n" msgstr "" -#: src/dird/ua_select.c:272 +#: src/dird/ua_select.c:282 msgid "Select Client (File daemon) resource" msgstr "" -#: src/dird/ua_select.c:297 +#: src/dird/ua_select.c:309 #, c-format msgid "Error: Client resource %s does not exist.\n" msgstr "" -#: src/dird/ua_select.c:322 +#: src/dird/ua_select.c:334 #, c-format msgid "Could not find Client %s: ERR=%s" msgstr "" -#: src/dird/ua_select.c:325 src/lib/bnet_server.c:285 -#: src/lib/bnet_server.c:379 +#: src/dird/ua_select.c:337 src/lib/bnet_server.c:284 +#: src/lib/bnet_server.c:378 msgid "client" msgstr "" -#: src/dird/ua_select.c:326 +#: src/dird/ua_select.c:338 msgid "fd" msgstr "" -#: src/dird/ua_select.c:332 src/dird/ua_select.c:386 +#: src/dird/ua_select.c:344 src/dird/ua_select.c:398 #, c-format msgid "Could not find Client \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:361 +#: src/dird/ua_select.c:373 #, c-format msgid "Error obtaining client ids. ERR=%s\n" msgstr "" -#: src/dird/ua_select.c:365 +#: src/dird/ua_select.c:377 msgid "No clients defined. You must run a job before using this command.\n" msgstr "" -#: src/dird/ua_select.c:369 +#: src/dird/ua_select.c:381 msgid "Defined Clients:\n" msgstr "" -#: src/dird/ua_select.c:379 +#: src/dird/ua_select.c:391 msgid "Select the Client" msgstr "" -#: src/dird/ua_select.c:412 src/dird/ua_select.c:435 src/dird/ua_select.c:471 +#: src/dird/ua_select.c:424 src/dird/ua_select.c:447 src/dird/ua_select.c:483 #, c-format msgid "Could not find Pool \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:450 +#: src/dird/ua_select.c:462 msgid "No pools defined. Use the \"create\" command to create one.\n" msgstr "" -#: src/dird/ua_select.c:454 +#: src/dird/ua_select.c:466 msgid "Defined Pools:\n" msgstr "" -#: src/dird/ua_select.c:464 +#: src/dird/ua_select.c:476 msgid "Select the Pool" msgstr "" -#: src/dird/ua_select.c:494 +#: src/dird/ua_select.c:506 #, c-format msgid "No access to Pool \"%s\"\n" msgstr "" -#: src/dird/ua_select.c:520 +#: src/dird/ua_select.c:532 msgid "Enter MediaId or Volume name: " msgstr "" -#: src/dird/ua_select.c:546 +#: src/dird/ua_select.c:558 msgid "The defined Pool resources are:\n" msgstr "" -#: src/dird/ua_select.c:554 +#: src/dird/ua_select.c:566 msgid "Select Pool resource" msgstr "" -#: src/dird/ua_select.c:587 +#: src/dird/ua_select.c:601 msgid "Enter the JobId to select: " msgstr "" -#: src/dird/ua_select.c:624 +#: src/dird/ua_select.c:638 #, c-format msgid "Could not find Job \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:687 +#: src/dird/ua_select.c:705 #, c-format msgid "Automatically selected %s: %s\n" msgstr "" -#: src/dird/ua_select.c:692 +#: src/dird/ua_select.c:710 #, c-format msgid "Cannot select %s in batch mode.\n" msgstr "" -#: src/dird/ua_select.c:708 +#: src/dird/ua_select.c:722 msgid "Selection is empty!\n" msgstr "" -#: src/dird/ua_select.c:714 +#: src/dird/ua_select.c:728 msgid "Item 1 selected automatically.\n" msgstr "" -#: src/dird/ua_select.c:725 +#: src/dird/ua_select.c:739 msgid "Selection aborted, nothing done.\n" msgstr "" -#: src/dird/ua_select.c:730 +#: src/dird/ua_select.c:744 #, c-format msgid "Please enter a number between 1 and %d\n" msgstr "" -#: src/dird/ua_select.c:778 +#: src/dird/ua_select.c:793 msgid "Storage name given twice.\n" msgstr "" -#: src/dird/ua_select.c:795 +#: src/dird/ua_select.c:810 #, c-format msgid "Expecting jobid=nn command, got: %s\n" msgstr "" -#: src/dird/ua_select.c:799 +#: src/dird/ua_select.c:814 #, c-format msgid "JobId %s is not running.\n" msgstr "" -#: src/dird/ua_select.c:808 +#: src/dird/ua_select.c:823 #, c-format msgid "Expecting job=xxx, got: %s.\n" msgstr "" -#: src/dird/ua_select.c:812 +#: src/dird/ua_select.c:827 #, c-format msgid "Job \"%s\" is not running.\n" msgstr "" -#: src/dird/ua_select.c:828 +#: src/dird/ua_select.c:843 #, c-format msgid "Storage resource \"%s\": not found\n" msgstr "" -#: src/dird/ua_select.c:850 +#: src/dird/ua_select.c:875 msgid "Enter autochanger drive[0]: " msgstr "" -#: src/dird/ua_select.c:879 +#: src/dird/ua_select.c:905 msgid "Media Types defined in conf file:\n" msgstr "" -#: src/dird/ua_select.c:885 +#: src/dird/ua_select.c:911 msgid "Media Type" msgstr "" -#: src/dird/ua_select.c:885 +#: src/dird/ua_select.c:911 msgid "Select the Media Type" msgstr "" @@ -4259,24 +4356,24 @@ msgstr "" msgid "%s Version: %s (%s) %s %s %s\n" msgstr "" -#: src/dird/ua_status.c:249 src/stored/status.c:70 +#: src/dird/ua_status.c:249 src/stored/status.c:71 #, c-format msgid "Daemon started %s, 1 Job run since started.\n" msgstr "" -#: src/dird/ua_status.c:252 src/stored/status.c:73 +#: src/dird/ua_status.c:252 src/stored/status.c:74 #, c-format msgid "Daemon started %s, %d Jobs run since started.\n" msgstr "" -#: src/dird/ua_status.c:257 src/filed/status.c:119 src/stored/status.c:77 +#: src/dird/ua_status.c:257 src/filed/status.c:121 src/stored/status.c:78 #, c-format msgid " Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n" msgstr "" -#: src/dird/ua_status.c:277 src/dird/ua_status.c:482 src/dird/ua_status.c:644 -#: src/filed/status.c:196 src/filed/status.c:275 src/stored/status.c:317 -#: src/stored/status.c:393 +#: src/dird/ua_status.c:277 src/dird/ua_status.c:493 src/dird/ua_status.c:655 +#: src/filed/status.c:198 src/filed/status.c:277 src/stored/status.c:345 +#: src/stored/status.c:361 src/stored/status.c:438 msgid "====\n" msgstr "" @@ -4319,244 +4416,244 @@ msgstr "" msgid "%-14s %-8s %3d %-18s %-18s %s\n" msgstr "" -#: src/dird/ua_status.c:480 +#: src/dird/ua_status.c:491 msgid "No Scheduled Jobs.\n" msgstr "" -#: src/dird/ua_status.c:497 src/stored/status.c:269 +#: src/dird/ua_status.c:508 src/stored/status.c:277 msgid "" "\n" "Running Jobs:\n" msgstr "" -#: src/dird/ua_status.c:506 +#: src/dird/ua_status.c:516 #, c-format msgid "Console connected at %s\n" msgstr "" -#: src/dird/ua_status.c:514 +#: src/dird/ua_status.c:526 msgid "" "No Jobs running.\n" "====\n" msgstr "" -#: src/dird/ua_status.c:519 +#: src/dird/ua_status.c:531 msgid " JobId Level Name Status\n" msgstr "" -#: src/dird/ua_status.c:520 src/filed/status.c:219 src/stored/status.c:337 +#: src/dird/ua_status.c:532 src/filed/status.c:221 src/stored/status.c:382 msgid "======================================================================\n" msgstr "" -#: src/dird/ua_status.c:529 +#: src/dird/ua_status.c:540 msgid "is waiting execution" msgstr "" -#: src/dird/ua_status.c:532 +#: src/dird/ua_status.c:543 msgid "is running" msgstr "" -#: src/dird/ua_status.c:535 +#: src/dird/ua_status.c:546 msgid "is blocked" msgstr "" -#: src/dird/ua_status.c:538 +#: src/dird/ua_status.c:549 msgid "has terminated" msgstr "" -#: src/dird/ua_status.c:541 +#: src/dird/ua_status.c:552 msgid "has erred" msgstr "" -#: src/dird/ua_status.c:544 +#: src/dird/ua_status.c:555 msgid "has errors" msgstr "" -#: src/dird/ua_status.c:547 +#: src/dird/ua_status.c:558 msgid "has a fatal error" msgstr "" -#: src/dird/ua_status.c:550 +#: src/dird/ua_status.c:561 msgid "has verify differences" msgstr "" -#: src/dird/ua_status.c:553 +#: src/dird/ua_status.c:564 msgid "has been canceled" msgstr "" -#: src/dird/ua_status.c:557 +#: src/dird/ua_status.c:568 #, c-format msgid "is waiting on Client %s" msgstr "" -#: src/dird/ua_status.c:563 +#: src/dird/ua_status.c:574 #, c-format msgid "is waiting on Storage %s" msgstr "" -#: src/dird/ua_status.c:568 +#: src/dird/ua_status.c:579 msgid "is waiting on max Storage jobs" msgstr "" -#: src/dird/ua_status.c:571 +#: src/dird/ua_status.c:582 msgid "is waiting on max Client jobs" msgstr "" -#: src/dird/ua_status.c:574 +#: src/dird/ua_status.c:585 msgid "is waiting on max Job jobs" msgstr "" -#: src/dird/ua_status.c:577 +#: src/dird/ua_status.c:588 msgid "is waiting on max total jobs" msgstr "" -#: src/dird/ua_status.c:580 +#: src/dird/ua_status.c:591 msgid "is waiting for its start time" msgstr "" -#: src/dird/ua_status.c:583 +#: src/dird/ua_status.c:594 msgid "is waiting for higher priority jobs to finish" msgstr "" -#: src/dird/ua_status.c:588 +#: src/dird/ua_status.c:599 #, c-format msgid "is in unknown state %c" msgstr "" -#: src/dird/ua_status.c:602 +#: src/dird/ua_status.c:613 msgid "is waiting for a mount request" msgstr "" -#: src/dird/ua_status.c:609 +#: src/dird/ua_status.c:620 msgid "is waiting for an appendable Volume" msgstr "" -#: src/dird/ua_status.c:616 +#: src/dird/ua_status.c:627 #, c-format msgid "is waiting for Client %s to connect to Storage %s" msgstr "" -#: src/dird/ua_status.c:632 +#: src/dird/ua_status.c:643 #, c-format msgid "%6d %-6s %-20s %s\n" msgstr "" -#: src/dird/ua_status.c:654 src/filed/status.c:209 src/stored/status.c:328 +#: src/dird/ua_status.c:665 src/filed/status.c:211 src/stored/status.c:373 msgid "No Terminated Jobs.\n" msgstr "" -#: src/dird/ua_status.c:659 src/stored/status.c:333 +#: src/dird/ua_status.c:670 src/stored/status.c:378 msgid "" "\n" "Terminated Jobs:\n" msgstr "" -#: src/dird/ua_status.c:660 +#: src/dird/ua_status.c:671 msgid " JobId Level Files Bytes Status Finished Name \n" msgstr "" -#: src/dird/ua_status.c:661 +#: src/dird/ua_status.c:672 msgid "========================================================================\n" msgstr "" -#: src/dird/ua_status.c:692 src/filed/status.c:239 src/lib/util.c:184 -#: src/stored/status.c:357 +#: src/dird/ua_status.c:703 src/filed/status.c:241 src/lib/util.c:178 +#: src/stored/status.c:402 msgid "Created" msgstr "" -#: src/dird/ua_status.c:696 src/filed/status.c:243 src/lib/util.c:197 -#: src/lib/util.c:264 src/stored/status.c:361 +#: src/dird/ua_status.c:707 src/filed/status.c:245 src/lib/util.c:191 +#: src/lib/util.c:258 src/stored/status.c:406 msgid "Error" msgstr "" -#: src/dird/ua_status.c:699 src/filed/status.c:246 src/stored/status.c:364 +#: src/dird/ua_status.c:710 src/filed/status.c:248 src/stored/status.c:409 msgid "Diffs" msgstr "" -#: src/dird/ua_status.c:705 src/filed/status.c:252 src/lib/util.c:193 -#: src/lib/util.c:260 src/stored/btape.c:1160 src/stored/status.c:370 +#: src/dird/ua_status.c:716 src/filed/status.c:254 src/lib/util.c:187 +#: src/lib/util.c:254 src/stored/btape.c:1158 src/stored/status.c:415 #: src/wx-console/wxbconfigpanel.cpp:180 msgid "OK" msgstr "" -#: src/dird/ua_status.c:708 src/filed/status.c:255 src/stored/status.c:373 +#: src/dird/ua_status.c:719 src/filed/status.c:257 src/stored/status.c:418 msgid "Other" msgstr "" -#: src/dird/ua_status.c:711 src/filed/status.c:266 src/stored/status.c:384 +#: src/dird/ua_status.c:722 src/filed/status.c:268 src/stored/status.c:429 #, c-format msgid "%6d %-6s %8s %14s %-7s %-8s %s\n" msgstr "" -#: src/dird/ua_status.c:719 src/stored/btape.c:180 +#: src/dird/ua_status.c:730 src/stored/btape.c:180 msgid "\n" msgstr "" -#: src/dird/ua_tree.c:57 +#: src/dird/ua_tree.c:58 msgid "change current directory" msgstr "" -#: src/dird/ua_tree.c:58 +#: src/dird/ua_tree.c:59 msgid "count marked files in and below the cd" msgstr "" -#: src/dird/ua_tree.c:59 +#: src/dird/ua_tree.c:60 src/dird/ua_tree.c:61 msgid "long list current directory, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:60 +#: src/dird/ua_tree.c:62 msgid "leave file selection mode" msgstr "" -#: src/dird/ua_tree.c:61 +#: src/dird/ua_tree.c:63 msgid "estimate restore size" msgstr "" -#: src/dird/ua_tree.c:62 +#: src/dird/ua_tree.c:64 msgid "same as done command" msgstr "" -#: src/dird/ua_tree.c:63 +#: src/dird/ua_tree.c:65 msgid "find files, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:64 src/dird/ua_tree.c:73 +#: src/dird/ua_tree.c:66 src/dird/ua_tree.c:75 msgid "print help" msgstr "" -#: src/dird/ua_tree.c:65 +#: src/dird/ua_tree.c:67 msgid "list current directory, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:66 +#: src/dird/ua_tree.c:68 msgid "list the marked files in and below the cd" msgstr "" -#: src/dird/ua_tree.c:67 -msgid "mark dir/file to be restored recursively in dirs" +#: src/dird/ua_tree.c:69 +msgid "mark dir/file to be restored recursively, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:68 +#: src/dird/ua_tree.c:70 msgid "mark directory name to be restored (no files)" msgstr "" -#: src/dird/ua_tree.c:69 +#: src/dird/ua_tree.c:71 msgid "print current working directory" msgstr "" -#: src/dird/ua_tree.c:70 +#: src/dird/ua_tree.c:72 msgid "unmark dir/file to be restored recursively in dir" msgstr "" -#: src/dird/ua_tree.c:71 +#: src/dird/ua_tree.c:73 msgid "unmark directory name only no recursion" msgstr "" -#: src/dird/ua_tree.c:72 +#: src/dird/ua_tree.c:74 msgid "quit and do not do restore" msgstr "" -#: src/dird/ua_tree.c:92 +#: src/dird/ua_tree.c:94 msgid "" "\n" "You are now entering file selection mode where you add (mark) and\n" @@ -4566,286 +4663,90 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_tree.c:102 src/dird/ua_tree.c:633 src/dird/ua_tree.c:641 +#: src/dird/ua_tree.c:104 src/dird/ua_tree.c:664 src/dird/ua_tree.c:672 #, c-format msgid "cwd is: %s\n" msgstr "" -#: src/dird/ua_tree.c:123 +#: src/dird/ua_tree.c:125 msgid "Illegal command. Enter \"done\" to exit.\n" msgstr "" -#: src/dird/ua_tree.c:296 src/dird/ua_tree.c:307 src/dird/ua_tree.c:324 +#: src/dird/ua_tree.c:298 src/dird/ua_tree.c:309 src/dird/ua_tree.c:326 msgid "No files marked.\n" msgstr "" -#: src/dird/ua_tree.c:309 +#: src/dird/ua_tree.c:311 msgid "1 file marked.\n" msgstr "" -#: src/dird/ua_tree.c:311 +#: src/dird/ua_tree.c:313 #, c-format msgid "%s files marked.\n" msgstr "" -#: src/dird/ua_tree.c:338 +#: src/dird/ua_tree.c:340 msgid "No directories marked.\n" msgstr "" -#: src/dird/ua_tree.c:340 +#: src/dird/ua_tree.c:342 msgid "1 directory marked.\n" msgstr "" -#: src/dird/ua_tree.c:342 +#: src/dird/ua_tree.c:344 #, c-format msgid "%s directories marked.\n" msgstr "" -#: src/dird/ua_tree.c:363 +#: src/dird/ua_tree.c:365 #, c-format msgid "%s total files/dirs. %s marked to be restored.\n" msgstr "" -#: src/dird/ua_tree.c:374 +#: src/dird/ua_tree.c:376 msgid "No file specification given.\n" msgstr "" -#: src/dird/ua_tree.c:502 +#: src/dird/ua_tree.c:520 #, c-format msgid "Node %s has no children.\n" msgstr "" -#: src/dird/ua_tree.c:583 +#: src/dird/ua_tree.c:611 #, c-format msgid "%d total files; %d marked to be restored; %s bytes.\n" msgstr "" -#: src/dird/ua_tree.c:625 +#: src/dird/ua_tree.c:656 msgid "Invalid path given.\n" msgstr "" -#: src/dird/ua_tree.c:652 src/dird/ua_tree.c:663 +#: src/dird/ua_tree.c:683 src/dird/ua_tree.c:694 msgid "No files unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:665 +#: src/dird/ua_tree.c:696 msgid "1 file unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:667 +#: src/dird/ua_tree.c:698 #, c-format msgid "%d files unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:678 src/dird/ua_tree.c:694 +#: src/dird/ua_tree.c:709 src/dird/ua_tree.c:725 msgid "No directories unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:696 +#: src/dird/ua_tree.c:727 msgid "1 directory unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:698 +#: src/dird/ua_tree.c:729 #, c-format msgid "%d directories unmarked.\n" msgstr "" -#: src/dird/verify.c:87 -msgid "" -"Unable to find JobId of previous InitCatalog Job.\n" -"Please run a Verify with Level=InitCatalog before\n" -"running the current Job.\n" -msgstr "" - -#: src/dird/verify.c:108 -#, c-format -msgid "Could not get job record for previous Job. ERR=%s" -msgstr "" - -#: src/dird/verify.c:113 -#, c-format -msgid "Last Job %d did not terminate normally. JobStatus=%c\n" -msgstr "" - -#: src/dird/verify.c:117 -#, c-format -msgid "Verifying against JobId=%d Job=%s\n" -msgstr "" - -#: src/dird/verify.c:183 -#, c-format -msgid "Start Verify JobId=%d Level=%s Job=%s\n" -msgstr "" - -#: src/dird/verify.c:262 -msgid "Deprecated feature ... use bootstrap.\n" -msgstr "" - -#: src/dird/verify.c:275 -#, c-format -msgid "Unimplemented Verify level %d(%c)\n" -msgstr "" - -#: src/dird/verify.c:327 -#, c-format -msgid "Unimplemented verify level %d\n" -msgstr "" - -#: src/dird/verify.c:382 -msgid "Verify OK" -msgstr "" - -#: src/dird/verify.c:386 -msgid "*** Verify Error ***" -msgstr "" - -#: src/dird/verify.c:390 -msgid "Verify warnings" -msgstr "" - -#: src/dird/verify.c:393 -msgid "Verify Canceled" -msgstr "" - -#: src/dird/verify.c:396 -msgid "Verify Differences" -msgstr "" - -#: src/dird/verify.c:401 -#, c-format -msgid "Inappropriate term code: %d %c\n" -msgstr "" - -#: src/dird/verify.c:415 -#, c-format -msgid "" -"Bacula %s (%s): %s\n" -" JobId: %d\n" -" Job: %s\n" -" FileSet: %s\n" -" Verify Level: %s\n" -" Client: %s\n" -" Verify JobId: %d\n" -" Verify Job: %s\n" -" Start time: %s\n" -" End time: %s\n" -" Files Expected: %s\n" -" Files Examined: %s\n" -" Non-fatal FD errors: %d\n" -" FD termination status: %s\n" -" SD termination status: %s\n" -" Termination: %s\n" -"\n" -msgstr "" - -#: src/dird/verify.c:450 -#, c-format -msgid "" -"Bacula %s (%s): %s\n" -" JobId: %d\n" -" Job: %s\n" -" FileSet: %s\n" -" Verify Level: %s\n" -" Client: %s\n" -" Verify JobId: %d\n" -" Verify Job: %s\n" -" Start time: %s\n" -" End time: %s\n" -" Files Examined: %s\n" -" Non-fatal FD errors: %d\n" -" FD termination status: %s\n" -" Termination: %s\n" -"\n" -msgstr "" - -#: src/dird/verify.c:526 -#, c-format -msgid "" -"birdqnext->qprev != qp called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:185 +#: src/lib/smartall.c:180 #, c-format msgid "qp->qprev->qnext != qp called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:194 +#: src/lib/smartall.c:189 #, c-format msgid "Buffer overrun called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:265 +#: src/lib/smartall.c:260 #, c-format msgid "sm_realloc size: %d\n" msgstr "" -#: src/lib/smartall.c:306 +#: src/lib/smartall.c:301 #, c-format msgid "sm_realloc %d at %x from %s:%d\n" msgstr "" -#: src/lib/smartall.c:368 +#: src/lib/smartall.c:363 #, c-format msgid "" "\n" @@ -7893,125 +8080,133 @@ msgid "" " Buffer address with bad links: %lx\n" msgstr "" -#: src/lib/smartall.c:379 +#: src/lib/smartall.c:374 #, c-format msgid "Orphaned buffer: %6u bytes allocated at line %d of %s %s\n" msgstr "" -#: src/lib/smartall.c:415 +#: src/lib/smartall.c:410 #, c-format msgid "Damaged buffer found. Called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:445 +#: src/lib/smartall.c:440 #, c-format msgid "" "\n" "Damaged buffers found at %s:%d\n" msgstr "" -#: src/lib/smartall.c:448 +#: src/lib/smartall.c:443 #, c-format msgid " discovery of bad prev link.\n" msgstr "" -#: src/lib/smartall.c:451 +#: src/lib/smartall.c:446 #, c-format msgid " discovery of bad next link.\n" msgstr "" -#: src/lib/smartall.c:454 +#: src/lib/smartall.c:449 #, c-format msgid " discovery of data overrun.\n" msgstr "" -#: src/lib/smartall.c:457 +#: src/lib/smartall.c:452 #, c-format msgid " Buffer address: %lx\n" msgstr "" -#: src/lib/smartall.c:464 +#: src/lib/smartall.c:459 #, c-format msgid "Damaged buffer: %6u bytes allocated at line %d of %s %s\n" msgstr "" -#: src/lib/util.c:187 +#: src/lib/util.c:181 msgid "Running" msgstr "" -#: src/lib/util.c:190 +#: src/lib/util.c:184 msgid "Blocked" msgstr "" -#: src/lib/util.c:200 +#: src/lib/util.c:194 msgid "Non-fatal error" msgstr "" -#: src/lib/util.c:203 src/lib/util.c:270 +#: src/lib/util.c:197 src/lib/util.c:264 msgid "Canceled" msgstr "" -#: src/lib/util.c:206 +#: src/lib/util.c:200 msgid "Verify differences" msgstr "" -#: src/lib/util.c:209 +#: src/lib/util.c:203 msgid "Waiting on FD" msgstr "" -#: src/lib/util.c:212 +#: src/lib/util.c:206 msgid "Wait on SD" msgstr "" -#: src/lib/util.c:215 +#: src/lib/util.c:209 msgid "Wait for new Volume" msgstr "" -#: src/lib/util.c:218 +#: src/lib/util.c:212 msgid "Waiting for mount" msgstr "" -#: src/lib/util.c:221 +#: src/lib/util.c:215 msgid "Waiting for Storage resource" msgstr "" -#: src/lib/util.c:224 +#: src/lib/util.c:218 msgid "Waiting for Job resource" msgstr "" -#: src/lib/util.c:227 +#: src/lib/util.c:221 msgid "Waiting for Client resource" msgstr "" -#: src/lib/util.c:230 +#: src/lib/util.c:224 msgid "Waiting on Max Jobs" msgstr "" -#: src/lib/util.c:233 +#: src/lib/util.c:227 msgid "Waiting for Start Time" msgstr "" -#: src/lib/util.c:236 +#: src/lib/util.c:230 msgid "Waiting on Priority" msgstr "" -#: src/lib/util.c:243 +#: src/lib/util.c:237 #, c-format msgid "Unknown Job termination status=%d" msgstr "" -#: src/lib/util.c:267 +#: src/lib/util.c:261 msgid "Fatal Error" msgstr "" -#: src/lib/util.c:273 +#: src/lib/util.c:267 msgid "Differences" msgstr "" -#: src/lib/util.c:276 +#: src/lib/util.c:270 msgid "Unknown term code" msgstr "" +#: src/lib/util.c:298 +msgid "Migrate" +msgstr "" + +#: src/lib/util.c:301 +msgid "Copy" +msgstr "" + #: src/lib/util.c:304 msgid "Unknown Type" msgstr "" @@ -8259,278 +8454,214 @@ msgstr "" msgid "rwl_writeunlock failure. ERR=%s\n" msgstr "" -#: src/lib/pythonlib.c:108 -msgid "Could not initialize Python\n" -msgstr "" - -#: src/lib/pythonlib.c:113 +#: src/stored/acquire.c:96 #, c-format -msgid "Could not Run Python string %s\n" -msgstr "" - -#: src/lib/pythonlib.c:125 -msgid "Could not initialize Python Job type.\n" +msgid "Hey! num_writers=%d!!!!\n" msgstr "" -#: src/lib/pythonlib.c:130 +#: src/stored/acquire.c:146 #, c-format -msgid "Could not import Python script %s/%s. Python disabled.\n" +msgid "Num_writers=%d not zero. Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:230 -msgid "Could not create Python Job Object.\n" +#: src/stored/acquire.c:154 +#, c-format +msgid "No volumes specified. Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:243 src/lib/pythonlib.c:267 +#: src/stored/acquire.c:182 src/stored/mount.c:73 #, c-format -msgid "Python function \"%s\" not found.\n" +msgid "Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:282 +#: src/stored/acquire.c:193 #, c-format -msgid "Unknown Python daemon event %s\n" +msgid "Open device %s Volume \"%s\" failed (EIO): ERR=%s\n" msgstr "" -#: src/lib/res.c:66 +#: src/stored/acquire.c:198 #, c-format -msgid "rwl_writelock failure at %s:%d: ERR=%s\n" +msgid "Open device %s Volume \"%s\" failed: ERR=%s\n" msgstr "" -#: src/lib/res.c:76 +#: src/stored/acquire.c:263 src/stored/mount.c:67 #, c-format -msgid "rwl_writeunlock failure at %s:%d:. ERR=%s\n" +msgid "Too many errors trying to mount device %s.\n" msgstr "" -#: src/lib/tls.c:108 +#: src/stored/acquire.c:272 #, c-format -msgid "" -"Error with certificate at depth: %d, issuer = %s, subject = %s, ERR=%d:%s\n" +msgid "Ready to read from volume \"%s\" on device %s.\n" msgstr "" -#: src/lib/tls.c:155 -msgid "Error initializing SSL context" +#: src/stored/acquire.c:311 +#, c-format +msgid "Device %s is busy reading.\n" msgstr "" -#: src/lib/tls.c:176 -msgid "Error loading certificate verification stores" +#: src/stored/acquire.c:341 +#, c-format +msgid "Wanted Volume \"%s\", but device %s is busy writing on \"%s\" .\n" msgstr "" -#: src/lib/tls.c:181 +#: src/stored/acquire.c:360 +#, c-format msgid "" -"Either a certificate file or a directory must be specified as a verification " -"store\n" +"Cannot recycle volume \"%s\" on device %s because it is in use by another " +"job.\n" msgstr "" -#: src/lib/tls.c:192 -msgid "Error loading certificate file" +#: src/stored/acquire.c:382 +#, c-format +msgid "Could not ready device %s for append.\n" msgstr "" -#: src/lib/tls.c:200 -msgid "Error loading private key" +#: src/stored/acquire.c:459 src/stored/block.c:354 src/stored/block.c:677 +#: src/stored/block.c:746 +#, c-format +msgid "Could not create JobMedia record for Volume=\"%s\" Job=%s\n" msgstr "" -#: src/lib/tls.c:208 -msgid "Unable to open DH parameters file" +#: src/stored/acquire.c:501 +#, c-format +msgid "Alert: %s" msgstr "" -#: src/lib/tls.c:214 -msgid "Unable to load DH parameters from specified file" +#: src/stored/acquire.c:509 +#, c-format +msgid "3997 Bad alert command: %s: ERR=%s.\n" msgstr "" -#: src/lib/tls.c:218 -msgid "Failed to set TLS Diffie-Hellman parameters" +#: src/stored/ansi_label.c:83 +#, c-format +msgid "Read error on device %s in ANSI label. ERR=%s\n" msgstr "" -#: src/lib/tls.c:227 -msgid "Error setting cipher list, no valid ciphers available\n" +#: src/stored/ansi_label.c:93 +msgid "Insane! End of tape while reading ANSI label.\n" msgstr "" -#: src/lib/tls.c:275 -msgid "Peer failed to present a TLS certificate\n" +#: src/stored/ansi_label.c:117 +msgid "No VOL1 label while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:317 +#: src/stored/ansi_label.c:137 #, c-format -msgid "Peer %s failed to present a TLS certificate\n" +msgid "Wanted ANSI Volume \"%s\" got \"%s\"\n" msgstr "" -#: src/lib/tls.c:416 -msgid "Error creating file descriptor-based BIO" +#: src/stored/ansi_label.c:148 +msgid "No HDR1 label while reading ANSI label.\n" msgstr "" -#: src/lib/tls.c:427 -msgid "Error creating new SSL object" +#: src/stored/ansi_label.c:154 +#, c-format +msgid "ANSI/IBM Volume \"%s\" does not belong to Bacula.\n" msgstr "" -#: src/lib/tls.c:493 src/lib/tls.c:510 -msgid "Connect failure" +#: src/stored/ansi_label.c:165 +msgid "No HDR2 label while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:587 src/lib/tls.c:591 -msgid "TLS shutdown failure." +#: src/stored/ansi_label.c:179 +msgid "Unknown or bad ANSI/IBM label record.\n" msgstr "" -#: src/lib/tls.c:642 src/lib/tls.c:658 -msgid "TLS read/write failure." +#: src/stored/ansi_label.c:186 +msgid "Too many records in while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:716 src/lib/tls.c:773 src/stored/dev.c:212 -#: src/stored/dev.c:230 src/stored/dev.c:236 src/stored/stored_conf.c:550 +#: src/stored/ansi_label.c:285 #, c-format -msgid "Unable to init mutex: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:736 src/lib/tls.c:805 -#, c-format -msgid "Unable to destroy mutex: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:870 -#, c-format -msgid "Unable to init OpenSSL threading: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:880 -msgid "Failed to seed OpenSSL PRNG\n" -msgstr "" - -#: src/lib/tls.c:906 -msgid "Failed to save OpenSSL PRNG\n" -msgstr "" - -#: src/stored/acquire.c:98 -#, c-format -msgid "Hey! num_writers=%d!!!!\n" -msgstr "" - -#: src/stored/acquire.c:146 -#, c-format -msgid "Num_writers=%d not zero. Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:154 -#, c-format -msgid "No volumes specified. Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:182 src/stored/mount.c:72 -#, c-format -msgid "Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:193 -#, c-format -msgid "Open device %s Volume \"%s\" failed (EIO): ERR=%s\n" -msgstr "" - -#: src/stored/acquire.c:208 -#, c-format -msgid "Open device %s Volume \"%s\" failed: ERR=%s\n" -msgstr "" - -#: src/stored/acquire.c:273 src/stored/mount.c:66 -#, c-format -msgid "Too many errors trying to mount device %s.\n" -msgstr "" - -#: src/stored/acquire.c:282 -#, c-format -msgid "Ready to read from volume \"%s\" on device %s.\n" +msgid "ANSI Volume label name \"%s\" longer than 6 chars.\n" msgstr "" -#: src/stored/acquire.c:328 src/stored/reserve.c:664 +#: src/stored/ansi_label.c:302 #, c-format -msgid "Device %s is busy reading.\n" +msgid "Could not write ANSI VOL1 label. ERR=%s\n" msgstr "" -#: src/stored/acquire.c:358 +#: src/stored/ansi_label.c:340 src/stored/ansi_label.c:369 #, c-format -msgid "Wanted Volume \"%s\", but device %s is busy writing on \"%s\" .\n" +msgid "Could not write ANSI HDR1 label. ERR=%s\n" msgstr "" -#: src/stored/acquire.c:377 -#, c-format -msgid "" -"Cannot recycle volume \"%s\" on device %s because it is in use by another " -"job.\n" +#: src/stored/ansi_label.c:345 src/stored/ansi_label.c:376 +msgid "Could not write ANSI HDR1 label.\n" msgstr "" -#: src/stored/acquire.c:399 +#: src/stored/ansi_label.c:381 #, c-format -msgid "Could not ready device %s for append.\n" +msgid "Error writing EOF to tape. ERR=%s" msgstr "" -#: src/stored/acquire.c:464 src/stored/block.c:353 src/stored/block.c:676 -#: src/stored/block.c:744 -#, c-format -msgid "Could not create JobMedia record for Volume=\"%s\" Job=%s\n" +#: src/stored/ansi_label.c:386 +msgid "write_ansi_ibm_label called for non-ANSI/IBM type\n" msgstr "" -#: src/stored/acquire.c:506 -#, c-format -msgid "Alert: %s" +#: src/stored/append.c:49 +msgid "DCR is NULL!!!\n" msgstr "" -#: src/stored/acquire.c:514 -#, c-format -msgid "3997 Bad alert command: %s: ERR=%s.\n" +#: src/stored/append.c:54 +msgid "DEVICE is NULL!!!\n" msgstr "" -#: src/stored/append.c:60 +#: src/stored/append.c:66 msgid "Unable to set network buffer size.\n" msgstr "" -#: src/stored/append.c:73 src/stored/append.c:82 src/stored/append.c:94 -#: src/stored/append.c:249 src/stored/append.c:264 src/stored/append.c:276 -#: src/stored/askdir.c:284 src/stored/askdir.c:285 +#: src/stored/append.c:79 src/stored/append.c:88 src/stored/append.c:100 +#: src/stored/append.c:256 src/stored/append.c:271 src/stored/append.c:283 +#: src/stored/askdir.c:294 src/stored/askdir.c:295 msgid "NULL Volume name. This shouldn't happen!!!\n" msgstr "" -#: src/stored/append.c:88 src/stored/btape.c:1853 +#: src/stored/append.c:94 src/stored/btape.c:1854 #, c-format msgid "Write session label failed. ERR=%s\n" msgstr "" -#: src/stored/append.c:100 +#: src/stored/append.c:106 #, c-format msgid "Network send error to FD. ERR=%s\n" msgstr "" -#: src/stored/append.c:137 +#: src/stored/append.c:143 #, c-format msgid "Error reading data header from FD. ERR=%s\n" msgstr "" -#: src/stored/append.c:159 +#: src/stored/append.c:165 #, c-format msgid "Malformed data header from FD: %s\n" msgstr "" -#: src/stored/append.c:169 +#: src/stored/append.c:175 msgid "File index from FD not positive or sequential\n" msgstr "" -#: src/stored/append.c:199 src/stored/append.c:269 src/stored/spool.c:247 +#: src/stored/append.c:206 src/stored/append.c:276 src/stored/spool.c:248 #, c-format msgid "Fatal append error on device %s: ERR=%s\n" msgstr "" -#: src/stored/append.c:224 +#: src/stored/append.c:231 #, c-format msgid "Error updating file attributes. ERR=%s\n" msgstr "" -#: src/stored/append.c:237 +#: src/stored/append.c:244 #, c-format msgid "Network error on data channel. ERR=%s\n" msgstr "" -#: src/stored/append.c:258 src/stored/btape.c:1969 +#: src/stored/append.c:265 src/stored/btape.c:1976 #, c-format msgid "Error writting end session label. ERR=%s\n" msgstr "" -#: src/stored/append.c:271 +#: src/stored/append.c:278 msgid "Set ok=FALSE after write_block_to_device.\n" msgstr "" @@ -8540,41 +8671,34 @@ msgstr "" #: src/stored/askdir.c:178 #, c-format -msgid "Error getting Volume info: %s\n" +msgid "Error getting Volume info: %s" msgstr "" -#: src/stored/askdir.c:289 src/stored/askdir.c:290 +#: src/stored/askdir.c:299 src/stored/askdir.c:300 msgid "Attempt to update_volume_info in read mode!!!\n" msgstr "" -#: src/stored/askdir.c:318 +#: src/stored/askdir.c:328 #, c-format msgid "Didn't get vol info vol=%s: ERR=%s" msgstr "" -#: src/stored/askdir.c:349 +#: src/stored/askdir.c:359 #, c-format msgid "Error creating JobMedia record: ERR=%s\n" msgstr "" -#: src/stored/askdir.c:356 +#: src/stored/askdir.c:366 #, c-format msgid "Error creating JobMedia record: %s\n" msgstr "" -#: src/stored/askdir.c:424 +#: src/stored/askdir.c:432 #, c-format msgid "Job %s canceled while waiting for mount on Storage Device \"%s\".\n" msgstr "" -#: src/stored/askdir.c:452 -#, c-format -msgid "" -"Please mount Volume \"%s\" on Storage Device %s for Job %s\n" -"Use \"mount\" command to release Job.\n" -msgstr "" - -#: src/stored/askdir.c:462 +#: src/stored/askdir.c:445 #, c-format msgid "" "Job %s waiting. Cannot find any appendable volumes.\n" @@ -8584,45 +8708,31 @@ msgid "" " Pool: %s\n" msgstr "" -#: src/stored/askdir.c:486 src/stored/askdir.c:588 +#: src/stored/askdir.c:469 src/stored/askdir.c:551 #, c-format msgid "Max time exceeded waiting to mount Storage Device %s for Job %s\n" msgstr "" -#: src/stored/askdir.c:496 src/stored/askdir.c:503 -#, c-format -msgid "pthread error in mount_next_volume stat=%d ERR=%s\n" -msgstr "" - -#: src/stored/askdir.c:514 -#, c-format -msgid "" -"Someone woke me up, but I cannot find any appendable\n" -"volumes for Job=%s.\n" +#: src/stored/askdir.c:479 +msgid "pthread error in mount_next_volume.\n" msgstr "" -#: src/stored/askdir.c:558 +#: src/stored/askdir.c:511 msgid "Cannot request another volume: no volume name given.\n" msgstr "" -#: src/stored/askdir.c:564 +#: src/stored/askdir.c:517 #, c-format msgid "Job %s canceled while waiting for mount on Storage Device %s.\n" msgstr "" -#: src/stored/askdir.c:570 +#: src/stored/askdir.c:532 #, c-format msgid "Please mount Volume \"%s\" on Storage Device %s for Job %s\n" msgstr "" -#: src/stored/askdir.c:598 -#, c-format -msgid "pthread error in mount_volume stat=%d ERR=%s\n" -msgstr "" - -#: src/stored/askdir.c:605 -#, c-format -msgid "pthread error in mount_next_volume stat=%d: ERR=%s\n" +#: src/stored/askdir.c:561 +msgid "pthread error in mount_volume\n" msgstr "" #: src/stored/authenticate.c:53 @@ -8650,71 +8760,91 @@ msgid "" "help.\n" msgstr "" -#: src/stored/autochanger.c:95 +#: src/stored/autochanger.c:53 +#, c-format +msgid "No Changer Name given for device %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:59 +#, c-format +msgid "No Changer Command given for device %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:72 +#, c-format +msgid "" +"Media Type not the same for all devices in changer %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:152 #, c-format msgid "3304 Issuing autochanger \"load slot %d, drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:102 +#: src/stored/autochanger.c:161 #, c-format msgid "3305 Autochanger \"load slot %d, drive %d\", status is OK.\n" msgstr "" -#: src/stored/autochanger.c:108 +#: src/stored/autochanger.c:167 #, c-format msgid "3992 Bad autochanger \"load slot %d, drive %d\": ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:153 +#: src/stored/autochanger.c:208 +msgid "3992 Missing Changer command.\n" +msgstr "" + +#: src/stored/autochanger.c:218 #, c-format msgid "3301 Issuing autochanger \"loaded drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:162 +#: src/stored/autochanger.c:227 #, c-format msgid "3302 Autochanger \"loaded drive %d\", result is Slot %d.\n" msgstr "" -#: src/stored/autochanger.c:166 +#: src/stored/autochanger.c:231 #, c-format msgid "3302 Autochanger \"loaded drive %d\", result: nothing loaded.\n" msgstr "" -#: src/stored/autochanger.c:173 +#: src/stored/autochanger.c:238 #, c-format msgid "3991 Bad autochanger \"loaded drive %d\" command: ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:234 src/stored/autochanger.c:304 +#: src/stored/autochanger.c:297 src/stored/autochanger.c:380 #, c-format msgid "3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:247 src/stored/autochanger.c:325 +#: src/stored/autochanger.c:310 src/stored/autochanger.c:401 #, c-format msgid "3995 Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:290 +#: src/stored/autochanger.c:369 #, c-format msgid "Volume %s is in use by device %s\n" msgstr "" -#: src/stored/autochanger.c:358 +#: src/stored/autochanger.c:439 #, c-format msgid "3993 Device %s not an autochanger device.\n" msgstr "" -#: src/stored/autochanger.c:372 +#: src/stored/autochanger.c:464 #, c-format msgid "3306 Issuing autochanger \"%s\" command.\n" msgstr "" -#: src/stored/autochanger.c:377 +#: src/stored/autochanger.c:467 msgid "3996 Open bpipe failed.\n" msgstr "" -#: src/stored/autochanger.c:401 +#: src/stored/autochanger.c:494 #, c-format msgid "Autochanger error: ERR=%s\n" msgstr "" @@ -8743,7 +8873,7 @@ msgstr "" msgid "Wrong number of arguments: \n" msgstr "" -#: src/stored/bcopy.c:172 src/stored/btape.c:334 src/stored/device.c:273 +#: src/stored/bcopy.c:172 src/stored/btape.c:333 src/stored/device.c:266 #, c-format msgid "dev open failed: %s\n" msgstr "" @@ -8757,7 +8887,7 @@ msgstr "" msgid "%u Jobs copied. %u records copied.\n" msgstr "" -#: src/stored/bcopy.c:205 src/stored/bscan.c:389 +#: src/stored/bcopy.c:205 src/stored/bscan.c:390 #, c-format msgid "Record: SessId=%u SessTim=%u FileIndex=%d Stream=%d len=%u\n" msgstr "" @@ -8771,7 +8901,7 @@ msgid "Volume label not copied.\n" msgstr "" #: src/stored/bcopy.c:235 src/stored/bcopy.c:242 src/stored/bcopy.c:265 -#: src/stored/btape.c:2335 +#: src/stored/btape.c:2342 #, c-format msgid "Cannot fixup device error. %s\n" msgstr "" @@ -8784,8 +8914,8 @@ msgstr "" msgid "EOT label not copied.\n" msgstr "" -#: src/stored/bcopy.c:290 src/stored/bextract.c:473 src/stored/bls.c:444 -#: src/stored/bscan.c:1227 src/stored/btape.c:2683 +#: src/stored/bcopy.c:290 src/stored/bextract.c:479 src/stored/bls.c:443 +#: src/stored/bscan.c:1234 src/stored/btape.c:2690 #, c-format msgid "Mount Volume \"%s\" on device %s and press return when ready: " msgstr "" @@ -8811,12 +8941,12 @@ msgid "" "\n" msgstr "" -#: src/stored/bextract.c:127 src/stored/bls.c:129 +#: src/stored/bextract.c:127 src/stored/bls.c:128 #, c-format msgid "Could not open exclude file: %s, ERR=%s\n" msgstr "" -#: src/stored/bextract.c:142 src/stored/bls.c:143 +#: src/stored/bextract.c:142 src/stored/bls.c:142 #, c-format msgid "Could not open include file: %s, ERR=%s\n" msgstr "" @@ -8846,11 +8976,11 @@ msgstr "" msgid "%u files restored.\n" msgstr "" -#: src/stored/bextract.c:278 src/stored/bextract.c:444 +#: src/stored/bextract.c:278 src/stored/bextract.c:450 msgid "Logic error output file should be open but is not.\n" msgstr "" -#: src/stored/bextract.c:285 src/stored/bls.c:365 src/stored/bscan.c:645 +#: src/stored/bextract.c:285 src/stored/bls.c:364 src/stored/bscan.c:647 msgid "Cannot continue.\n" msgstr "" @@ -8868,176 +8998,176 @@ msgstr "" msgid "===Write error===\n" msgstr "" -#: src/stored/bextract.c:435 +#: src/stored/bextract.c:441 msgid "Got Program Name or Data Stream. Ignored.\n" msgstr "" -#: src/stored/block.c:78 +#: src/stored/block.c:79 #, c-format msgid "" "Dump block %s %x: size=%d BlkNum=%d\n" " Hdrcksum=%x cksum=%x\n" msgstr "" -#: src/stored/block.c:91 +#: src/stored/block.c:92 #, c-format msgid " Rec: VId=%u VT=%u FI=%s Strm=%s len=%d p=%x\n" msgstr "" -#: src/stored/block.c:147 +#: src/stored/block.c:148 #, c-format msgid "%d block read errors not printed.\n" msgstr "" -#: src/stored/block.c:235 src/stored/block.c:251 src/stored/block.c:261 +#: src/stored/block.c:236 src/stored/block.c:252 src/stored/block.c:262 #, c-format msgid "" "Volume data error at %u:%u! Wanted ID: \"%s\", got \"%s\". Buffer " "discarded.\n" msgstr "" -#: src/stored/block.c:275 +#: src/stored/block.c:276 #, c-format msgid "" "Volume data error at %u:%u! Block length %u is insane (too large), probably " "due to a bad archive.\n" msgstr "" -#: src/stored/block.c:301 +#: src/stored/block.c:302 #, c-format msgid "" "Volume data error at %u:%u!\n" "Block checksum mismatch in block=%u len=%d: calc=%x blk=%x\n" msgstr "" -#: src/stored/block.c:409 +#: src/stored/block.c:410 msgid "Cannot write block. Device at EOM.\n" msgstr "" -#: src/stored/block.c:414 +#: src/stored/block.c:415 msgid "Attempt to write on read-only Volume.\n" msgstr "" -#: src/stored/block.c:466 +#: src/stored/block.c:467 #, c-format msgid "User defined maximum volume capacity %s exceeded on device %s.\n" msgstr "" -#: src/stored/block.c:481 +#: src/stored/block.c:482 #, c-format msgid "Unable to write EOF. ERR=%s\n" msgstr "" -#: src/stored/block.c:507 src/stored/block.c:518 +#: src/stored/block.c:508 src/stored/block.c:519 msgid "Write block header zeroed.\n" msgstr "" -#: src/stored/block.c:536 +#: src/stored/block.c:537 #, c-format msgid "Write error at %u:%u on device %s. ERR=%s.\n" msgstr "" -#: src/stored/block.c:543 +#: src/stored/block.c:544 #, c-format msgid "End of Volume \"%s\" at %u:%u on device %s. Write of %u bytes got %d.\n" msgstr "" -#: src/stored/block.c:618 src/stored/block.c:624 +#: src/stored/block.c:619 src/stored/block.c:625 #, c-format msgid "Backspace file at EOT failed. ERR=%s\n" msgstr "" -#: src/stored/block.c:631 +#: src/stored/block.c:632 #, c-format msgid "Backspace record at EOT failed. ERR=%s\n" msgstr "" -#: src/stored/block.c:648 +#: src/stored/block.c:649 #, c-format msgid "Re-read last block at EOT failed. ERR=%s" msgstr "" -#: src/stored/block.c:652 +#: src/stored/block.c:653 msgid "Re-read of last block succeeded.\n" msgstr "" -#: src/stored/block.c:655 +#: src/stored/block.c:656 #, c-format msgid "Re-read of last block failed. Last block=%u Current block=%u.\n" msgstr "" -#: src/stored/block.c:684 +#: src/stored/block.c:685 #, c-format msgid "" -"Error writing final EOF to tape. This tape may not be readable.\n" +"Error writing final EOF to tape. This Volume may not be readable.\n" "%s" msgstr "" -#: src/stored/block.c:790 src/stored/dvd.c:622 +#: src/stored/block.c:795 src/stored/dvd.c:689 #, c-format msgid "" "Error while writing, current part number is less than the total number of " "parts (%d/%d, device=%s)\n" msgstr "" -#: src/stored/block.c:798 src/stored/block.c:908 +#: src/stored/block.c:803 src/stored/block.c:913 #, c-format msgid "Unable to open device next part %s: ERR=%s\n" msgstr "" -#: src/stored/block.c:816 +#: src/stored/block.c:821 #, c-format msgid "" "End of Volume \"%s\" at %u:%u on device %s (part_size=%s, free_space=%s, " "free_space_errno=%d, errmsg=%s).\n" msgstr "" -#: src/stored/block.c:829 +#: src/stored/block.c:834 #, c-format msgid "" "End of Volume \"%s\" at %u:%u on device %s (part_size=%s, free_space=%s, " "free_space_errno=%d).\n" msgstr "" -#: src/stored/block.c:883 +#: src/stored/block.c:888 #, c-format msgid "Block buffer size looping problem on device %s\n" msgstr "" -#: src/stored/block.c:934 +#: src/stored/block.c:939 #, c-format msgid "Read error at file:blk %u:%u on device %s. ERR=%s.\n" msgstr "" -#: src/stored/block.c:947 +#: src/stored/block.c:952 #, c-format msgid "Read zero bytes at %u:%u on device %s.\n" msgstr "" -#: src/stored/block.c:960 +#: src/stored/block.c:965 #, c-format msgid "" "Volume data error at %u:%u! Very short block of %d bytes on device %s " "discarded.\n" msgstr "" -#: src/stored/block.c:985 +#: src/stored/block.c:990 #, c-format msgid "Block length %u is greater than buffer %u. Attempting recovery.\n" msgstr "" -#: src/stored/block.c:1004 +#: src/stored/block.c:1009 #, c-format msgid "Setting block buffer size to %u bytes.\n" msgstr "" -#: src/stored/block.c:1019 +#: src/stored/block.c:1024 #, c-format msgid "" "Volume data error at %u:%u! Short block of %d bytes on device %s discarded.\n" msgstr "" -#: src/stored/bls.c:69 +#: src/stored/bls.c:68 #, c-format msgid "" "Copyright (C) 2000-2005 Kern Sibbald.\n" @@ -9061,74 +9191,74 @@ msgid "" "\n" msgstr "" -#: src/stored/bls.c:190 +#: src/stored/bls.c:189 msgid "No archive name specified\n" msgstr "" -#: src/stored/bls.c:226 +#: src/stored/bls.c:224 #, c-format msgid "" "\n" "Warning, this Volume is a continuation of Volume %s\n" msgstr "" -#: src/stored/bls.c:268 +#: src/stored/bls.c:267 #, c-format msgid "Got EOM at file %u on device %s, Volume \"%s\"\n" msgstr "" -#: src/stored/bls.c:279 +#: src/stored/bls.c:278 #, c-format msgid "Mounted Volume \"%s\".\n" msgstr "" -#: src/stored/bls.c:281 +#: src/stored/bls.c:280 #, c-format msgid "Got EOF at file %u on device %s, Volume \"%s\"\n" msgstr "" -#: src/stored/bls.c:305 +#: src/stored/bls.c:304 #, c-format msgid "" "File:blk=%u:%u blk_num=%u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%" "s rlen=%d\n" msgstr "" -#: src/stored/bls.c:314 +#: src/stored/bls.c:313 #, c-format msgid "Block: %d size=%d\n" msgstr "" -#: src/stored/bls.c:381 +#: src/stored/bls.c:380 #, c-format msgid "FileIndex=%d VolSessionId=%d VolSessionTime=%d Stream=%d DataLen=%d\n" msgstr "" -#: src/stored/bls.c:398 src/stored/read_record.c:321 +#: src/stored/bls.c:397 src/stored/read_record.c:322 msgid "Fresh Volume Label" msgstr "" -#: src/stored/bls.c:401 src/stored/read_record.c:324 +#: src/stored/bls.c:400 src/stored/read_record.c:325 msgid "Volume Label" msgstr "" -#: src/stored/bls.c:405 src/stored/label.c:959 +#: src/stored/bls.c:404 src/stored/label.c:969 msgid "Begin Job Session" msgstr "" -#: src/stored/bls.c:409 src/stored/label.c:962 +#: src/stored/bls.c:408 src/stored/label.c:972 msgid "End Job Session" msgstr "" -#: src/stored/bls.c:412 +#: src/stored/bls.c:411 msgid "End of Medium" msgstr "" -#: src/stored/bls.c:415 src/stored/label.c:971 +#: src/stored/bls.c:414 src/stored/label.c:981 msgid "Unknown" msgstr "" -#: src/stored/bls.c:421 src/stored/read_record.c:342 +#: src/stored/bls.c:420 src/stored/read_record.c:343 #, c-format msgid "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n" msgstr "" @@ -9160,12 +9290,12 @@ msgid "" "\n" msgstr "" -#: src/stored/bscan.c:234 src/stored/stored.c:266 +#: src/stored/bscan.c:234 src/stored/stored.c:265 #, c-format msgid "No Storage resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/bscan.c:242 src/stored/stored.c:297 +#: src/stored/bscan.c:242 src/stored/stored.c:296 #, c-format msgid "No Working Directory defined in %s. Cannot continue.\n" msgstr "" @@ -9180,7 +9310,7 @@ msgstr "" msgid "Working Directory: %s is not a directory. Cannot continue.\n" msgstr "" -#: src/stored/bscan.c:268 src/stored/bscan.c:340 +#: src/stored/bscan.c:268 src/stored/bscan.c:341 #, c-format msgid "First Volume Size = %sn" msgstr "" @@ -9199,235 +9329,235 @@ msgstr "" msgid "Create JobMedia for Job %s\n" msgstr "" -#: src/stored/bscan.c:325 +#: src/stored/bscan.c:326 #, c-format msgid "Could not create JobMedia record for Volume=%s Job=%s\n" msgstr "" -#: src/stored/bscan.c:381 +#: src/stored/bscan.c:382 #, c-format msgid "done: %d%%\n" msgstr "" -#: src/stored/bscan.c:405 +#: src/stored/bscan.c:406 msgid "Volume is prelabeled. This tape cannot be scanned.\n" msgstr "" -#: src/stored/bscan.c:417 +#: src/stored/bscan.c:418 #, c-format msgid "Pool record for %s found in DB.\n" msgstr "" -#: src/stored/bscan.c:421 +#: src/stored/bscan.c:422 #, c-format msgid "VOL_LABEL: Pool record not found for Pool: %s\n" msgstr "" -#: src/stored/bscan.c:427 +#: src/stored/bscan.c:428 #, c-format msgid "VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n" msgstr "" -#: src/stored/bscan.c:431 +#: src/stored/bscan.c:432 #, c-format msgid "Pool type \"%s\" is OK.\n" msgstr "" -#: src/stored/bscan.c:441 +#: src/stored/bscan.c:442 #, c-format msgid "Media record for %s found in DB.\n" msgstr "" -#: src/stored/bscan.c:448 +#: src/stored/bscan.c:449 #, c-format msgid "VOL_LABEL: Media record not found for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:455 +#: src/stored/bscan.c:456 #, c-format msgid "VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n" msgstr "" -#: src/stored/bscan.c:459 +#: src/stored/bscan.c:460 #, c-format msgid "Media type \"%s\" is OK.\n" msgstr "" -#: src/stored/bscan.c:468 +#: src/stored/bscan.c:469 #, c-format msgid "VOL_LABEL: OK for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:475 +#: src/stored/bscan.c:476 #, c-format msgid "%d \"errors\" ignored before first Start of Session record.\n" msgstr "" -#: src/stored/bscan.c:486 +#: src/stored/bscan.c:487 #, c-format msgid "SOS_LABEL: Found Job record for JobId: %d\n" msgstr "" -#: src/stored/bscan.c:491 +#: src/stored/bscan.c:492 #, c-format msgid "SOS_LABEL: Job record not found for JobId: %d\n" msgstr "" -#: src/stored/bscan.c:531 +#: src/stored/bscan.c:532 #, c-format msgid "SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:537 +#: src/stored/bscan.c:538 #, c-format msgid "SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:543 +#: src/stored/bscan.c:544 #, c-format msgid "SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:561 src/stored/bscan.c:1007 +#: src/stored/bscan.c:562 src/stored/bscan.c:1013 #, c-format msgid "Could not find SessId=%d SessTime=%d for EOS record.\n" msgstr "" -#: src/stored/bscan.c:604 +#: src/stored/bscan.c:606 #, c-format msgid "Could not update job record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:615 +#: src/stored/bscan.c:617 #, c-format msgid "End of all Volumes. VolFiles=%u VolBlocks=%u VolBytes=%s\n" msgstr "" -#: src/stored/bscan.c:627 +#: src/stored/bscan.c:629 #, c-format msgid "Could not find Job for SessId=%d SessTime=%d record.\n" msgstr "" -#: src/stored/bscan.c:663 +#: src/stored/bscan.c:665 #, c-format msgid "%s file records. At file:blk=%s:%s bytes=%s\n" msgstr "" -#: src/stored/bscan.c:706 +#: src/stored/bscan.c:708 #, c-format msgid "Got MD5 record: %s\n" msgstr "" -#: src/stored/bscan.c:715 +#: src/stored/bscan.c:717 #, c-format msgid "Got SHA1 record: %s\n" msgstr "" -#: src/stored/bscan.c:723 +#: src/stored/bscan.c:725 #, c-format msgid "Got Prog Names Stream: %s\n" msgstr "" -#: src/stored/bscan.c:729 +#: src/stored/bscan.c:731 msgid "Got Prog Data Stream record.\n" msgstr "" -#: src/stored/bscan.c:733 +#: src/stored/bscan.c:735 #, c-format msgid "Unknown stream type!!! stream=%d data=%s\n" msgstr "" -#: src/stored/bscan.c:793 +#: src/stored/bscan.c:799 #, c-format msgid "Could not create File Attributes record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:799 +#: src/stored/bscan.c:805 #, c-format msgid "Created File record: %s\n" msgstr "" -#: src/stored/bscan.c:836 +#: src/stored/bscan.c:842 #, c-format msgid "Could not create media record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:840 src/stored/bscan.c:861 +#: src/stored/bscan.c:846 src/stored/bscan.c:867 #, c-format msgid "Could not update media record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:844 +#: src/stored/bscan.c:850 #, c-format msgid "Created Media record for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:865 +#: src/stored/bscan.c:871 #, c-format msgid "Updated Media record at end of Volume: %s\n" msgstr "" -#: src/stored/bscan.c:882 +#: src/stored/bscan.c:888 #, c-format msgid "Could not create pool record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:886 +#: src/stored/bscan.c:892 #, c-format msgid "Created Pool record for Pool: %s\n" msgstr "" -#: src/stored/bscan.c:906 +#: src/stored/bscan.c:912 #, c-format msgid "Created Client record for Client: %s\n" msgstr "" -#: src/stored/bscan.c:923 +#: src/stored/bscan.c:929 #, c-format msgid "Fileset \"%s\" already exists.\n" msgstr "" -#: src/stored/bscan.c:927 +#: src/stored/bscan.c:933 #, c-format msgid "Could not create FileSet record \"%s\". ERR=%s\n" msgstr "" -#: src/stored/bscan.c:932 +#: src/stored/bscan.c:938 #, c-format msgid "Created FileSet record \"%s\"\n" msgstr "" -#: src/stored/bscan.c:979 +#: src/stored/bscan.c:985 #, c-format msgid "Could not create JobId record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:985 +#: src/stored/bscan.c:991 #, c-format msgid "Could not update job start record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:988 +#: src/stored/bscan.c:994 #, c-format msgid "Created new JobId=%u record for original JobId=%u\n" msgstr "" -#: src/stored/bscan.c:1038 +#: src/stored/bscan.c:1044 #, c-format msgid "Could not update JobId=%u record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1043 +#: src/stored/bscan.c:1049 #, c-format msgid "Updated Job termination record for JobId=%u TermStat=%c\n" msgstr "" -#: src/stored/bscan.c:1065 +#: src/stored/bscan.c:1071 #, c-format msgid "Job Termination code: %d" msgstr "" -#: src/stored/bscan.c:1070 +#: src/stored/bscan.c:1076 #, c-format msgid "" "%s\n" @@ -9447,27 +9577,27 @@ msgid "" "\n" msgstr "" -#: src/stored/bscan.c:1134 +#: src/stored/bscan.c:1140 #, c-format msgid "Could not create JobMedia record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1138 +#: src/stored/bscan.c:1144 #, c-format msgid "Created JobMedia record JobId %d, MediaId %d\n" msgstr "" -#: src/stored/bscan.c:1154 +#: src/stored/bscan.c:1160 #, c-format msgid "Could not find SessId=%d SessTime=%d for MD5/SHA1 record.\n" msgstr "" -#: src/stored/bscan.c:1168 +#: src/stored/bscan.c:1174 #, c-format msgid "Could not add MD5/SHA1 to File record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1173 +#: src/stored/bscan.c:1179 msgid "Updated MD5/SHA1 record\n" msgstr "" @@ -9518,140 +9648,140 @@ msgstr "" msgid "Improper number of arguments specified.\n" msgstr "" -#: src/stored/btape.c:340 +#: src/stored/btape.c:338 #, c-format msgid "open device %s: OK\n" msgstr "" -#: src/stored/btape.c:361 +#: src/stored/btape.c:359 msgid "Enter Volume Name: " msgstr "" -#: src/stored/btape.c:368 +#: src/stored/btape.c:366 #, c-format msgid "Device open failed. ERR=%s\n" msgstr "" -#: src/stored/btape.c:373 +#: src/stored/btape.c:371 #, c-format msgid "Wrote Volume label for volume \"%s\".\n" msgstr "" -#: src/stored/btape.c:387 +#: src/stored/btape.c:385 msgid "Volume has no label.\n" msgstr "" -#: src/stored/btape.c:390 +#: src/stored/btape.c:388 msgid "Volume label read correctly.\n" msgstr "" -#: src/stored/btape.c:393 +#: src/stored/btape.c:391 #, c-format msgid "I/O error on device: ERR=%s" msgstr "" -#: src/stored/btape.c:396 +#: src/stored/btape.c:394 msgid "Volume name error\n" msgstr "" -#: src/stored/btape.c:399 +#: src/stored/btape.c:397 #, c-format msgid "Error creating label. ERR=%s" msgstr "" -#: src/stored/btape.c:402 +#: src/stored/btape.c:400 msgid "Volume version error.\n" msgstr "" -#: src/stored/btape.c:405 +#: src/stored/btape.c:403 msgid "Bad Volume label type.\n" msgstr "" -#: src/stored/btape.c:408 +#: src/stored/btape.c:406 msgid "Unknown error.\n" msgstr "" -#: src/stored/btape.c:426 +#: src/stored/btape.c:424 #, c-format msgid "Bad status from load. ERR=%s\n" msgstr "" -#: src/stored/btape.c:428 +#: src/stored/btape.c:426 #, c-format msgid "Loaded %s\n" msgstr "" -#: src/stored/btape.c:437 src/stored/btape.c:777 src/stored/btape.c:819 -#: src/stored/btape.c:889 src/stored/btape.c:931 src/stored/btape.c:1200 +#: src/stored/btape.c:435 src/stored/btape.c:775 src/stored/btape.c:817 +#: src/stored/btape.c:887 src/stored/btape.c:929 src/stored/btape.c:1198 #, c-format msgid "Bad status from rewind. ERR=%s\n" msgstr "" -#: src/stored/btape.c:440 src/stored/btape.c:1208 +#: src/stored/btape.c:438 src/stored/btape.c:1206 #, c-format msgid "Rewound %s\n" msgstr "" -#: src/stored/btape.c:467 src/stored/btape.c:1212 +#: src/stored/btape.c:465 src/stored/btape.c:1210 #, c-format msgid "Bad status from weof %d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:471 +#: src/stored/btape.c:469 #, c-format msgid "Wrote 1 EOF to %s\n" msgstr "" -#: src/stored/btape.c:474 +#: src/stored/btape.c:472 #, c-format msgid "Wrote %d EOFs to %s\n" msgstr "" -#: src/stored/btape.c:492 +#: src/stored/btape.c:490 msgid "Moved to end of medium.\n" msgstr "" -#: src/stored/btape.c:519 +#: src/stored/btape.c:517 #, c-format msgid "Bad status from bsf. ERR=%s\n" msgstr "" -#: src/stored/btape.c:521 +#: src/stored/btape.c:519 #, c-format msgid "Backspaced %d file%s.\n" msgstr "" -#: src/stored/btape.c:538 +#: src/stored/btape.c:536 #, c-format msgid "Bad status from bsr. ERR=%s\n" msgstr "" -#: src/stored/btape.c:540 +#: src/stored/btape.c:538 #, c-format msgid "Backspaced %d record%s.\n" msgstr "" -#: src/stored/btape.c:550 src/stored/status.c:220 +#: src/stored/btape.c:548 src/stored/status.c:227 #, c-format msgid "Configured device capabilities:\n" msgstr "" -#: src/stored/btape.c:568 +#: src/stored/btape.c:566 #, c-format msgid "Device status:\n" msgstr "" -#: src/stored/btape.c:582 src/stored/status.c:252 +#: src/stored/btape.c:580 src/stored/status.c:259 #, c-format msgid "Device parameters:\n" msgstr "" -#: src/stored/btape.c:587 +#: src/stored/btape.c:585 #, c-format msgid "Status:\n" msgstr "" -#: src/stored/btape.c:602 +#: src/stored/btape.c:600 msgid "" "Test writting larger and larger records.\n" "This is a torture test for records.\n" @@ -9660,20 +9790,20 @@ msgid "" "plus the header exceeds the block size (by default about 64K)\n" msgstr "" -#: src/stored/btape.c:610 src/stored/btape.c:1814 +#: src/stored/btape.c:608 src/stored/btape.c:1815 msgid "Command aborted.\n" msgstr "" -#: src/stored/btape.c:626 +#: src/stored/btape.c:624 #, c-format msgid "Block %d i=%d\n" msgstr "" -#: src/stored/btape.c:652 +#: src/stored/btape.c:650 msgid "Skipping read backwards test because BSR turned off.\n" msgstr "" -#: src/stored/btape.c:656 +#: src/stored/btape.c:654 msgid "" "\n" "=== Write, backup, and re-read test ===\n" @@ -9687,73 +9817,73 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:669 src/stored/btape.c:680 src/stored/btape.c:691 -#: src/stored/btape.c:789 src/stored/btape.c:805 src/stored/btape.c:901 -#: src/stored/btape.c:917 src/stored/btape.c:1526 src/stored/btape.c:2400 +#: src/stored/btape.c:667 src/stored/btape.c:678 src/stored/btape.c:689 +#: src/stored/btape.c:787 src/stored/btape.c:803 src/stored/btape.c:899 +#: src/stored/btape.c:915 src/stored/btape.c:1524 src/stored/btape.c:2407 msgid "Error writing record to block.\n" msgstr "" -#: src/stored/btape.c:673 src/stored/btape.c:684 src/stored/btape.c:695 -#: src/stored/btape.c:793 src/stored/btape.c:809 src/stored/btape.c:905 -#: src/stored/btape.c:921 src/stored/btape.c:1530 src/stored/btape.c:2404 +#: src/stored/btape.c:671 src/stored/btape.c:682 src/stored/btape.c:693 +#: src/stored/btape.c:791 src/stored/btape.c:807 src/stored/btape.c:903 +#: src/stored/btape.c:919 src/stored/btape.c:1528 src/stored/btape.c:2411 msgid "Error writing block to device.\n" msgstr "" -#: src/stored/btape.c:676 +#: src/stored/btape.c:674 #, c-format msgid "Wrote first record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:687 +#: src/stored/btape.c:685 #, c-format msgid "Wrote second record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:698 +#: src/stored/btape.c:696 #, c-format msgid "Wrote third record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:705 src/stored/btape.c:710 +#: src/stored/btape.c:703 src/stored/btape.c:708 #, c-format msgid "Backspace file failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:714 +#: src/stored/btape.c:712 msgid "Backspaced over EOF OK.\n" msgstr "" -#: src/stored/btape.c:716 +#: src/stored/btape.c:714 #, c-format msgid "Backspace record failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:719 +#: src/stored/btape.c:717 msgid "Backspace record OK.\n" msgstr "" -#: src/stored/btape.c:722 src/stored/btape.c:728 +#: src/stored/btape.c:720 src/stored/btape.c:726 #, c-format msgid "Read block failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:733 +#: src/stored/btape.c:731 msgid "Bad data in record. Test failed!\n" msgstr "" -#: src/stored/btape.c:737 +#: src/stored/btape.c:735 msgid "" "\n" "Block re-read correct. Test succeeded!\n" msgstr "" -#: src/stored/btape.c:738 +#: src/stored/btape.c:736 msgid "" "=== End Write, backup, and re-read test ===\n" "\n" msgstr "" -#: src/stored/btape.c:745 +#: src/stored/btape.c:743 msgid "" "This is not terribly serious since Bacula only uses\n" "this function to verify the last block written to the\n" @@ -9765,7 +9895,7 @@ msgid "" "to your Storage daemon's Device resource definition.\n" msgstr "" -#: src/stored/btape.c:769 +#: src/stored/btape.c:767 msgid "" "\n" "=== Write, rewind, and re-read test ===\n" @@ -9778,46 +9908,46 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:797 src/stored/btape.c:813 src/stored/btape.c:909 -#: src/stored/btape.c:925 +#: src/stored/btape.c:795 src/stored/btape.c:811 src/stored/btape.c:907 +#: src/stored/btape.c:923 #, c-format msgid "Wrote 1000 blocks of %d bytes.\n" msgstr "" -#: src/stored/btape.c:822 src/stored/btape.c:934 +#: src/stored/btape.c:820 src/stored/btape.c:932 msgid "Rewind OK.\n" msgstr "" -#: src/stored/btape.c:829 src/stored/btape.c:983 +#: src/stored/btape.c:827 src/stored/btape.c:981 msgid "Got EOF on tape.\n" msgstr "" -#: src/stored/btape.c:834 +#: src/stored/btape.c:832 #, c-format msgid "Read block %d failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:840 +#: src/stored/btape.c:838 #, c-format msgid "Read record failed. Block %d! ERR=%s\n" msgstr "" -#: src/stored/btape.c:846 src/stored/btape.c:1013 +#: src/stored/btape.c:844 src/stored/btape.c:1011 #, c-format msgid "Bad data in record. Expected %d, got %d at byte %d. Test failed!\n" msgstr "" -#: src/stored/btape.c:853 +#: src/stored/btape.c:851 msgid "1000 blocks re-read correctly.\n" msgstr "" -#: src/stored/btape.c:856 src/stored/btape.c:1020 +#: src/stored/btape.c:854 src/stored/btape.c:1018 msgid "" "=== Test Succeeded. End Write, rewind, and re-read test ===\n" "\n" msgstr "" -#: src/stored/btape.c:881 +#: src/stored/btape.c:879 msgid "" "\n" "=== Write, rewind, and position test ===\n" @@ -9830,23 +9960,23 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:974 +#: src/stored/btape.c:972 #, c-format msgid "Reposition to file:block %d:%d\n" msgstr "" -#: src/stored/btape.c:976 +#: src/stored/btape.c:974 msgid "Reposition error.\n" msgstr "" -#: src/stored/btape.c:989 +#: src/stored/btape.c:987 #, c-format msgid "" "Read block %d failed! file=%d blk=%d. ERR=%s\n" "\n" msgstr "" -#: src/stored/btape.c:991 +#: src/stored/btape.c:989 msgid "" "This may be because the tape drive block size is not\n" " set to variable blocking as normally used by Bacula.\n" @@ -9860,17 +9990,17 @@ msgid "" " in your Device resource.\n" msgstr "" -#: src/stored/btape.c:1007 +#: src/stored/btape.c:1005 #, c-format msgid "Read record failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:1018 +#: src/stored/btape.c:1016 #, c-format msgid "Block %d re-read correctly.\n" msgstr "" -#: src/stored/btape.c:1039 +#: src/stored/btape.c:1037 msgid "" "\n" "\n" @@ -9884,58 +10014,58 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1063 +#: src/stored/btape.c:1061 msgid "Now moving to end of medium.\n" msgstr "" -#: src/stored/btape.c:1065 src/stored/btape.c:1295 +#: src/stored/btape.c:1063 src/stored/btape.c:1293 #, c-format msgid "We should be in file 3. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1066 src/stored/btape.c:1084 src/stored/btape.c:1284 -#: src/stored/btape.c:1296 src/stored/btape.c:1309 src/stored/btape.c:1326 +#: src/stored/btape.c:1064 src/stored/btape.c:1082 src/stored/btape.c:1282 +#: src/stored/btape.c:1294 src/stored/btape.c:1307 src/stored/btape.c:1324 msgid "This is correct!" msgstr "" -#: src/stored/btape.c:1066 src/stored/btape.c:1084 src/stored/btape.c:1284 -#: src/stored/btape.c:1296 src/stored/btape.c:1309 src/stored/btape.c:1326 +#: src/stored/btape.c:1064 src/stored/btape.c:1082 src/stored/btape.c:1282 +#: src/stored/btape.c:1294 src/stored/btape.c:1307 src/stored/btape.c:1324 msgid "This is NOT correct!!!!" msgstr "" -#: src/stored/btape.c:1072 +#: src/stored/btape.c:1070 msgid "" "\n" "Now the important part, I am going to attempt to append to the tape.\n" "\n" msgstr "" -#: src/stored/btape.c:1079 +#: src/stored/btape.c:1077 msgid "" "Done appending, there should be no I/O errors\n" "\n" msgstr "" -#: src/stored/btape.c:1080 +#: src/stored/btape.c:1078 msgid "Doing Bacula scan of blocks:\n" msgstr "" -#: src/stored/btape.c:1082 +#: src/stored/btape.c:1080 msgid "End scanning the tape.\n" msgstr "" -#: src/stored/btape.c:1083 src/stored/btape.c:1308 +#: src/stored/btape.c:1081 src/stored/btape.c:1306 #, c-format msgid "We should be in file 4. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1108 +#: src/stored/btape.c:1106 msgid "" "\n" "Autochanger enabled, but no name or no command device specified.\n" msgstr "" -#: src/stored/btape.c:1112 +#: src/stored/btape.c:1110 msgid "" "\n" "Ah, I see you have an autochanger configured.\n" @@ -9943,13 +10073,13 @@ msgid "" " that I can write on in Slot 1.\n" msgstr "" -#: src/stored/btape.c:1115 +#: src/stored/btape.c:1113 msgid "" "\n" "Do you wish to continue with the Autochanger test? (y/n): " msgstr "" -#: src/stored/btape.c:1122 +#: src/stored/btape.c:1120 msgid "" "\n" "\n" @@ -9957,74 +10087,74 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1131 +#: src/stored/btape.c:1129 msgid "3301 Issuing autochanger \"loaded\" command.\n" msgstr "" -#: src/stored/btape.c:1140 +#: src/stored/btape.c:1138 #, c-format msgid "3991 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1141 +#: src/stored/btape.c:1139 #, c-format msgid "3991 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1145 +#: src/stored/btape.c:1143 #, c-format msgid "Slot %d loaded. I am going to unload it.\n" msgstr "" -#: src/stored/btape.c:1147 +#: src/stored/btape.c:1145 msgid "Nothing loaded in the drive. OK.\n" msgstr "" -#: src/stored/btape.c:1155 +#: src/stored/btape.c:1153 #, c-format msgid "3302 Issuing autochanger \"unload %d %d\" command.\n" msgstr "" -#: src/stored/btape.c:1160 +#: src/stored/btape.c:1158 #, c-format msgid "unload status=%s %d\n" msgstr "" -#: src/stored/btape.c:1160 +#: src/stored/btape.c:1158 msgid "Bad" msgstr "" -#: src/stored/btape.c:1163 +#: src/stored/btape.c:1161 #, c-format msgid "3992 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1164 +#: src/stored/btape.c:1162 #, c-format msgid "3992 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1174 +#: src/stored/btape.c:1172 #, c-format msgid "3303 Issuing autochanger \"load %d %d\" command.\n" msgstr "" -#: src/stored/btape.c:1182 +#: src/stored/btape.c:1180 #, c-format msgid "3303 Autochanger \"load %d %d\" status is OK.\n" msgstr "" -#: src/stored/btape.c:1186 +#: src/stored/btape.c:1184 #, c-format msgid "3993 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1187 +#: src/stored/btape.c:1185 #, c-format msgid "3993 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1202 +#: src/stored/btape.c:1200 msgid "" "\n" "The test failed, probably because you need to put\n" @@ -10032,12 +10162,12 @@ msgid "" "Adding a 30 second sleep and trying again ...\n" msgstr "" -#: src/stored/btape.c:1215 +#: src/stored/btape.c:1213 #, c-format msgid "Wrote EOF to %s\n" msgstr "" -#: src/stored/btape.c:1219 +#: src/stored/btape.c:1217 #, c-format msgid "" "\n" @@ -10049,18 +10179,18 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1224 +#: src/stored/btape.c:1222 msgid "" "\n" "The test autochanger worked!!\n" "\n" msgstr "" -#: src/stored/btape.c:1235 +#: src/stored/btape.c:1233 msgid "You must correct this error or the Autochanger will not work.\n" msgstr "" -#: src/stored/btape.c:1253 +#: src/stored/btape.c:1251 msgid "" "\n" "\n" @@ -10072,30 +10202,30 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1278 +#: src/stored/btape.c:1276 msgid "Now forward spacing 1 file.\n" msgstr "" -#: src/stored/btape.c:1280 src/stored/btape.c:1292 src/stored/btape.c:1305 -#: src/stored/btape.c:1323 src/stored/btape.c:1492 +#: src/stored/btape.c:1278 src/stored/btape.c:1290 src/stored/btape.c:1303 +#: src/stored/btape.c:1321 src/stored/btape.c:1490 #, c-format msgid "Bad status from fsr. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1283 +#: src/stored/btape.c:1281 #, c-format msgid "We should be in file 1. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1290 +#: src/stored/btape.c:1288 msgid "Now forward spacing 2 files.\n" msgstr "" -#: src/stored/btape.c:1303 +#: src/stored/btape.c:1301 msgid "Now forward spacing 4 files.\n" msgstr "" -#: src/stored/btape.c:1315 +#: src/stored/btape.c:1313 msgid "" "The test worked this time. Please add:\n" "\n" @@ -10104,35 +10234,35 @@ msgid "" "to your Device resource for this drive.\n" msgstr "" -#: src/stored/btape.c:1321 +#: src/stored/btape.c:1319 msgid "Now forward spacing 1 more file.\n" msgstr "" -#: src/stored/btape.c:1325 +#: src/stored/btape.c:1323 #, c-format msgid "We should be in file 5. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1330 +#: src/stored/btape.c:1328 msgid "" "\n" "=== End Forward space files test ===\n" "\n" msgstr "" -#: src/stored/btape.c:1334 +#: src/stored/btape.c:1332 msgid "" "\n" "The forward space file test failed.\n" msgstr "" -#: src/stored/btape.c:1336 +#: src/stored/btape.c:1334 msgid "" "You have Fast Forward Space File enabled.\n" "I am turning it off then retrying the test.\n" msgstr "" -#: src/stored/btape.c:1342 +#: src/stored/btape.c:1340 msgid "" "You must correct this error or Bacula will not work.\n" "Some systems, e.g. OpenBSD, require you to set\n" @@ -10140,7 +10270,7 @@ msgid "" "in your device resource. Use with caution.\n" msgstr "" -#: src/stored/btape.c:1374 +#: src/stored/btape.c:1372 msgid "" "\n" "Append test failed. Attempting again.\n" @@ -10150,7 +10280,7 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1382 +#: src/stored/btape.c:1380 msgid "" "\n" "\n" @@ -10162,14 +10292,14 @@ msgid "" "to your Device resource in the Storage conf file.\n" msgstr "" -#: src/stored/btape.c:1389 +#: src/stored/btape.c:1387 msgid "" "\n" "\n" "That appears *NOT* to have corrected the problem.\n" msgstr "" -#: src/stored/btape.c:1394 +#: src/stored/btape.c:1392 msgid "" "\n" "\n" @@ -10177,7 +10307,7 @@ msgid "" "Setting \"BSF at EOM = yes\" and retrying append test.\n" msgstr "" -#: src/stored/btape.c:1399 +#: src/stored/btape.c:1397 msgid "" "\n" "\n" @@ -10190,7 +10320,7 @@ msgid "" "to your Device resource in the Storage conf file.\n" msgstr "" -#: src/stored/btape.c:1410 +#: src/stored/btape.c:1408 msgid "" "\n" "Append test failed.\n" @@ -10217,7 +10347,7 @@ msgid "" "in your device resource. Use with caution.\n" msgstr "" -#: src/stored/btape.c:1431 +#: src/stored/btape.c:1429 msgid "" "\n" "The above Bacula scan should have output identical to what follows.\n" @@ -10241,116 +10371,116 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1470 +#: src/stored/btape.c:1468 #, c-format msgid "Bad status from fsf. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1474 +#: src/stored/btape.c:1472 msgid "Forward spaced 1 file.\n" msgstr "" -#: src/stored/btape.c:1477 +#: src/stored/btape.c:1475 #, c-format msgid "Forward spaced %d files.\n" msgstr "" -#: src/stored/btape.c:1496 +#: src/stored/btape.c:1494 msgid "Forward spaced 1 record.\n" msgstr "" -#: src/stored/btape.c:1499 +#: src/stored/btape.c:1497 #, c-format msgid "Forward spaced %d records.\n" msgstr "" -#: src/stored/btape.c:1533 +#: src/stored/btape.c:1531 #, c-format msgid "Wrote one record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:1535 +#: src/stored/btape.c:1533 msgid "Wrote block to device.\n" msgstr "" -#: src/stored/btape.c:1550 +#: src/stored/btape.c:1548 msgid "Enter length to read: " msgstr "" -#: src/stored/btape.c:1555 +#: src/stored/btape.c:1553 msgid "Bad length entered, using default of 1024 bytes.\n" msgstr "" -#: src/stored/btape.c:1564 +#: src/stored/btape.c:1562 #, c-format msgid "Read of %d bytes gives stat=%d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1587 src/stored/btape.c:1636 +#: src/stored/btape.c:1585 src/stored/btape.c:1634 #, c-format msgid "End of tape\n" msgstr "" -#: src/stored/btape.c:1592 +#: src/stored/btape.c:1590 #, c-format msgid "Starting scan at file %u\n" msgstr "" -#: src/stored/btape.c:1597 src/stored/dev.c:1238 +#: src/stored/btape.c:1595 src/stored/dev.c:1229 #, c-format msgid "read error on %s. ERR=%s.\n" msgstr "" -#: src/stored/btape.c:1599 +#: src/stored/btape.c:1597 #, c-format msgid "Bad status from read %d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1602 src/stored/btape.c:1616 src/stored/btape.c:1679 -#: src/stored/btape.c:1691 src/stored/btape.c:1704 src/stored/btape.c:1720 +#: src/stored/btape.c:1600 src/stored/btape.c:1614 src/stored/btape.c:1678 +#: src/stored/btape.c:1690 src/stored/btape.c:1703 src/stored/btape.c:1719 #, c-format msgid "1 block of %d bytes in file %d\n" msgstr "" -#: src/stored/btape.c:1605 src/stored/btape.c:1619 src/stored/btape.c:1682 -#: src/stored/btape.c:1694 src/stored/btape.c:1707 src/stored/btape.c:1723 +#: src/stored/btape.c:1603 src/stored/btape.c:1617 src/stored/btape.c:1681 +#: src/stored/btape.c:1693 src/stored/btape.c:1706 src/stored/btape.c:1722 #, c-format msgid "%d blocks of %d bytes in file %d\n" msgstr "" -#: src/stored/btape.c:1627 src/stored/btape.c:1698 +#: src/stored/btape.c:1625 src/stored/btape.c:1697 #, c-format msgid "End of File mark.\n" msgstr "" -#: src/stored/btape.c:1648 src/stored/btape.c:1751 +#: src/stored/btape.c:1646 src/stored/btape.c:1750 #, c-format msgid "Total files=%d, blocks=%d, bytes = %s\n" msgstr "" -#: src/stored/btape.c:1711 +#: src/stored/btape.c:1710 #, c-format msgid "Short block read.\n" msgstr "" -#: src/stored/btape.c:1714 +#: src/stored/btape.c:1713 #, c-format msgid "Error reading block. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1738 +#: src/stored/btape.c:1737 #, c-format msgid "" "Blk_block: %u dev_blk=%u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%" "s rlen=%d\n" msgstr "" -#: src/stored/btape.c:1760 +#: src/stored/btape.c:1759 #, c-format msgid "Device status: %u. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1788 +#: src/stored/btape.c:1789 msgid "" "\n" "This command simulates Bacula writing to a tape.\n" @@ -10375,95 +10505,98 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1805 +#: src/stored/btape.c:1806 msgid "" "Do you want to run the simplified test (s) with one tape\n" "or the complete multiple tape (m) test: (s/m) " msgstr "" -#: src/stored/btape.c:1808 +#: src/stored/btape.c:1809 msgid "Simple test (single tape) selected.\n" msgstr "" -#: src/stored/btape.c:1811 +#: src/stored/btape.c:1812 msgid "Multiple tape test selected.\n" msgstr "" -#: src/stored/btape.c:1827 +#: src/stored/btape.c:1828 msgid "Rewind failed.\n" msgstr "" -#: src/stored/btape.c:1830 +#: src/stored/btape.c:1831 msgid "Write EOF failed.\n" msgstr "" -#: src/stored/btape.c:1857 +#: src/stored/btape.c:1858 msgid "Wrote Start of Session label.\n" msgstr "" -#: src/stored/btape.c:1886 -msgid "Begin writing Bacula records to tape ...\n" +#: src/stored/btape.c:1889 +#, c-format +msgid "%s Begin writing Bacula records to tape ...\n" msgstr "" -#: src/stored/btape.c:1888 -msgid "Begin writing Bacula records to first tape ...\n" +#: src/stored/btape.c:1891 +#, c-format +msgid "%s Begin writing Bacula records to first tape ...\n" msgstr "" -#: src/stored/btape.c:1928 +#: src/stored/btape.c:1932 #, c-format msgid "Wrote blk_block=%u, dev_blk_num=%u VolBytes=%s rate=%.1f KB/s\n" msgstr "" -#: src/stored/btape.c:1935 -msgid "Flush block, write EOF\n" +#: src/stored/btape.c:1942 +#, c-format +msgid "%s Flush block, write EOF\n" msgstr "" -#: src/stored/btape.c:1946 +#: src/stored/btape.c:1953 msgid "Not OK\n" msgstr "" -#: src/stored/btape.c:1974 +#: src/stored/btape.c:1981 msgid "Set ok=false after write_block_to_device.\n" msgstr "" -#: src/stored/btape.c:1977 +#: src/stored/btape.c:1984 msgid "Wrote End of Session label.\n" msgstr "" -#: src/stored/btape.c:2001 +#: src/stored/btape.c:2008 #, c-format msgid "Wrote state file last_block_num1=%d last_block_num2=%d\n" msgstr "" -#: src/stored/btape.c:2005 +#: src/stored/btape.c:2012 #, c-format msgid "Could not create state file: %s ERR=%s\n" msgstr "" -#: src/stored/btape.c:2010 +#: src/stored/btape.c:2020 #, c-format msgid "" "\n" "\n" -"Done filling tape at %d:%d. Now beginning re-read of tape ...\n" +"%s Done filling tape at %d:%d. Now beginning re-read of tape ...\n" msgstr "" -#: src/stored/btape.c:2014 +#: src/stored/btape.c:2024 #, c-format msgid "" "\n" "\n" -"Done filling tapes at %d:%d. Now beginning re-read of first tape ...\n" +"%s Done filling tapes at %d:%d. Now beginning re-read of first tape ...\n" msgstr "" -#: src/stored/btape.c:2053 +#: src/stored/btape.c:2063 msgid "" "\n" "The state file level has changed. You must redo\n" "the fill command.\n" msgstr "" -#: src/stored/btape.c:2059 +#: src/stored/btape.c:2069 #, c-format msgid "" "\n" @@ -10471,95 +10604,95 @@ msgid "" "You must redo the fill command.\n" msgstr "" -#: src/stored/btape.c:2101 +#: src/stored/btape.c:2111 msgid "Mount first tape. Press enter when ready: " msgstr "" -#: src/stored/btape.c:2125 -msgid "Reading the first 10000 records.\n" +#: src/stored/btape.c:2131 +msgid "Rewinding.\n" msgstr "" -#: src/stored/btape.c:2128 src/stored/btape.c:2195 +#: src/stored/btape.c:2136 +#, c-format +msgid "Reading the first 10000 records from %u:%u.\n" +msgstr "" + +#: src/stored/btape.c:2140 src/stored/btape.c:2207 #, c-format msgid "Reposition from %u:%u to %u:%u\n" msgstr "" -#: src/stored/btape.c:2131 src/stored/btape.c:2182 src/stored/btape.c:2198 +#: src/stored/btape.c:2143 src/stored/btape.c:2194 src/stored/btape.c:2210 #, c-format msgid "Reposition error. ERR=%s\n" msgstr "" -#: src/stored/btape.c:2134 +#: src/stored/btape.c:2146 #, c-format msgid "Reading block %u.\n" msgstr "" -#: src/stored/btape.c:2136 src/stored/btape.c:2187 src/stored/btape.c:2203 +#: src/stored/btape.c:2148 src/stored/btape.c:2199 src/stored/btape.c:2215 #, c-format msgid "Error reading block: ERR=%s\n" msgstr "" -#: src/stored/btape.c:2141 +#: src/stored/btape.c:2153 msgid "" "\n" "The last block on the tape matches. Test succeeded.\n" "\n" msgstr "" -#: src/stored/btape.c:2143 +#: src/stored/btape.c:2155 msgid "" "\n" "The last block of the first tape matches.\n" "\n" msgstr "" -#: src/stored/btape.c:2168 +#: src/stored/btape.c:2180 msgid "Mount second tape. Press enter when ready: " msgstr "" -#: src/stored/btape.c:2180 +#: src/stored/btape.c:2192 #, c-format msgid "Reposition from %u:%u to 0:1\n" msgstr "" -#: src/stored/btape.c:2185 src/stored/btape.c:2201 +#: src/stored/btape.c:2197 src/stored/btape.c:2213 #, c-format msgid "Reading block %d.\n" msgstr "" -#: src/stored/btape.c:2191 +#: src/stored/btape.c:2203 msgid "" "\n" "The first block on the second tape matches.\n" "\n" msgstr "" -#: src/stored/btape.c:2207 +#: src/stored/btape.c:2219 msgid "" "\n" "The last block on the second tape matches. Test succeeded.\n" "\n" msgstr "" -#: src/stored/btape.c:2221 -#, c-format -msgid "ERROR! device at %d:%d count=%d\n" -msgstr "" - -#: src/stored/btape.c:2227 +#: src/stored/btape.c:2234 #, c-format -msgid "1000 records read now at %d:%d\n" +msgid "10000 records read now at %d:%d\n" msgstr "" -#: src/stored/btape.c:2250 src/stored/btape.c:2261 src/stored/btape.c:2309 +#: src/stored/btape.c:2257 src/stored/btape.c:2268 src/stored/btape.c:2316 msgid "Last block written" msgstr "" -#: src/stored/btape.c:2252 src/stored/btape.c:2262 +#: src/stored/btape.c:2259 src/stored/btape.c:2269 msgid "Block read back" msgstr "" -#: src/stored/btape.c:2253 +#: src/stored/btape.c:2260 #, c-format msgid "" "\n" @@ -10567,7 +10700,7 @@ msgid "" "The blocks differ at byte %u\n" msgstr "" -#: src/stored/btape.c:2254 +#: src/stored/btape.c:2261 msgid "" "\n" "\n" @@ -10577,177 +10710,177 @@ msgid "" "to write multi-tape Volumes.!!!!\n" msgstr "" -#: src/stored/btape.c:2293 +#: src/stored/btape.c:2300 #, c-format msgid "Last block at: %u:%u this_dev_block_num=%d\n" msgstr "" -#: src/stored/btape.c:2307 +#: src/stored/btape.c:2314 #, c-format msgid "Block not written: FileIndex=%u blk_block=%u Size=%u\n" msgstr "" -#: src/stored/btape.c:2311 +#: src/stored/btape.c:2318 msgid "Block not written" msgstr "" -#: src/stored/btape.c:2326 +#: src/stored/btape.c:2333 #, c-format msgid "End of tape %d:%d. VolumeCapacity=%s. Write rate = %.1f KB/s\n" msgstr "" -#: src/stored/btape.c:2376 +#: src/stored/btape.c:2383 msgid "Test writing blocks of 64512 bytes to tape.\n" msgstr "" -#: src/stored/btape.c:2378 +#: src/stored/btape.c:2385 msgid "How many blocks do you want to write? (1000): " msgstr "" -#: src/stored/btape.c:2393 +#: src/stored/btape.c:2400 #, c-format msgid "Begin writing %d Bacula blocks to tape ...\n" msgstr "" -#: src/stored/btape.c:2445 +#: src/stored/btape.c:2452 #, c-format msgid "Begin writing raw blocks of %u bytes.\n" msgstr "" -#: src/stored/btape.c:2465 +#: src/stored/btape.c:2472 #, c-format msgid "Write failed at block %u. stat=%d ERR=%s\n" msgstr "" -#: src/stored/btape.c:2495 +#: src/stored/btape.c:2502 #, c-format msgid "Begin writing Bacula blocks of %u bytes.\n" msgstr "" -#: src/stored/btape.c:2514 +#: src/stored/btape.c:2521 #, c-format msgid "Write failed at block %u.\n" msgstr "" -#: src/stored/btape.c:2521 +#: src/stored/btape.c:2528 msgid "test autochanger" msgstr "" -#: src/stored/btape.c:2522 +#: src/stored/btape.c:2529 msgid "backspace file" msgstr "" -#: src/stored/btape.c:2523 +#: src/stored/btape.c:2530 msgid "backspace record" msgstr "" -#: src/stored/btape.c:2524 +#: src/stored/btape.c:2531 msgid "fill tape using Bacula writes" msgstr "" -#: src/stored/btape.c:2525 +#: src/stored/btape.c:2532 msgid "list device capabilities" msgstr "" -#: src/stored/btape.c:2526 +#: src/stored/btape.c:2533 msgid "clear tape errors" msgstr "" -#: src/stored/btape.c:2527 +#: src/stored/btape.c:2534 msgid "go to end of Bacula data for append" msgstr "" -#: src/stored/btape.c:2528 +#: src/stored/btape.c:2535 msgid "go to the physical end of medium" msgstr "" -#: src/stored/btape.c:2529 +#: src/stored/btape.c:2536 msgid "fill tape, write onto second volume" msgstr "" -#: src/stored/btape.c:2530 +#: src/stored/btape.c:2537 msgid "read filled tape" msgstr "" -#: src/stored/btape.c:2531 +#: src/stored/btape.c:2538 msgid "forward space a file" msgstr "" -#: src/stored/btape.c:2532 +#: src/stored/btape.c:2539 msgid "forward space a record" msgstr "" -#: src/stored/btape.c:2534 +#: src/stored/btape.c:2541 msgid "write a Bacula label to the tape" msgstr "" -#: src/stored/btape.c:2535 +#: src/stored/btape.c:2542 msgid "load a tape" msgstr "" -#: src/stored/btape.c:2536 +#: src/stored/btape.c:2543 msgid "quit btape" msgstr "" -#: src/stored/btape.c:2537 +#: src/stored/btape.c:2544 msgid "use write() to fill tape" msgstr "" -#: src/stored/btape.c:2538 +#: src/stored/btape.c:2545 msgid "read and print the Bacula tape label" msgstr "" -#: src/stored/btape.c:2539 +#: src/stored/btape.c:2546 msgid "test record handling functions" msgstr "" -#: src/stored/btape.c:2540 +#: src/stored/btape.c:2547 msgid "rewind the tape" msgstr "" -#: src/stored/btape.c:2541 +#: src/stored/btape.c:2548 msgid "read() tape block by block to EOT and report" msgstr "" -#: src/stored/btape.c:2542 +#: src/stored/btape.c:2549 msgid "Bacula read block by block to EOT and report" msgstr "" -#: src/stored/btape.c:2543 +#: src/stored/btape.c:2550 msgid "print tape status" msgstr "" -#: src/stored/btape.c:2544 +#: src/stored/btape.c:2551 msgid "General test Bacula tape functions" msgstr "" -#: src/stored/btape.c:2545 +#: src/stored/btape.c:2552 msgid "write an EOF on the tape" msgstr "" -#: src/stored/btape.c:2546 +#: src/stored/btape.c:2553 msgid "write a single Bacula block" msgstr "" -#: src/stored/btape.c:2547 +#: src/stored/btape.c:2554 msgid "read a single record" msgstr "" -#: src/stored/btape.c:2548 +#: src/stored/btape.c:2555 msgid "quick fill command" msgstr "" -#: src/stored/btape.c:2569 +#: src/stored/btape.c:2576 #, c-format msgid "%s is an illegal command\n" msgstr "" -#: src/stored/btape.c:2579 +#: src/stored/btape.c:2586 #, c-format msgid "Interactive commands:\n" msgstr "" -#: src/stored/btape.c:2589 +#: src/stored/btape.c:2596 #, c-format msgid "" "Copyright (C) 2000-2005 Kern Sibbald.\n" @@ -10765,27 +10898,27 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:2680 +#: src/stored/btape.c:2687 #, c-format msgid "Mount second Volume on device %s and press return when ready: " msgstr "" -#: src/stored/btape.c:2707 +#: src/stored/btape.c:2714 #, c-format msgid "Mount blank Volume on device %s and press return when ready: " msgstr "" -#: src/stored/btape.c:2725 +#: src/stored/btape.c:2732 #, c-format msgid "End of Volume \"%s\"\n" msgstr "" -#: src/stored/btape.c:2737 +#: src/stored/btape.c:2744 #, c-format msgid "Read block=%u, VolBytes=%s rate=%.1f KB/s\n" msgstr "" -#: src/stored/btape.c:2752 src/stored/mount.c:493 +#: src/stored/btape.c:2759 src/stored/mount.c:500 #, c-format msgid "Cannot open Dev=%s, Vol=%s\n" msgstr "" @@ -10810,358 +10943,345 @@ msgstr "" msgid "cont," msgstr "" -#: src/stored/butil.c:128 +#: src/stored/butil.c:130 msgid "Volume name or names is too long. Please use a .bsr file.\n" msgstr "" -#: src/stored/butil.c:148 +#: src/stored/butil.c:150 #, c-format msgid "Cannot find device \"%s\" in config file %s.\n" msgstr "" -#: src/stored/butil.c:155 +#: src/stored/butil.c:157 #, c-format msgid "Cannot init device %s\n" msgstr "" -#: src/stored/butil.c:174 +#: src/stored/butil.c:178 #, c-format msgid "Cannot open %s\n" msgstr "" -#: src/stored/butil.c:253 +#: src/stored/butil.c:261 #, c-format msgid "Could not find device \"%s\" in config file %s.\n" msgstr "" -#: src/stored/butil.c:258 +#: src/stored/butil.c:266 #, c-format msgid "Using device: \"%s\" for reading.\n" msgstr "" -#: src/stored/butil.c:261 +#: src/stored/butil.c:269 #, c-format msgid "Using device: \"%s\" for writing.\n" msgstr "" -#: src/stored/butil.c:277 +#: src/stored/butil.c:285 msgid "Unexpected End of Data\n" msgstr "" -#: src/stored/butil.c:279 +#: src/stored/butil.c:287 msgid "Unexpected End of Tape\n" msgstr "" -#: src/stored/butil.c:281 +#: src/stored/butil.c:289 msgid "Unexpected End of File\n" msgstr "" -#: src/stored/butil.c:283 +#: src/stored/butil.c:291 msgid "Tape Door is Open\n" msgstr "" -#: src/stored/butil.c:285 +#: src/stored/butil.c:293 msgid "Unexpected Tape is Off-line\n" msgstr "" -#: src/stored/dev.c:110 +#: src/stored/dev.c:112 #, c-format msgid "Unable to stat device %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:125 +#: src/stored/dev.c:123 #, c-format msgid "" "%s is an unknown device type. Must be tape or directory\n" " or have RequiresMount=yes for DVD. st_mode=%x\n" msgstr "" -#: src/stored/dev.c:183 +#: src/stored/dev.c:179 #, c-format msgid "Unable to stat mount point %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:188 +#: src/stored/dev.c:186 msgid "" "Mount and unmount commands must defined for a device which requires mount.\n" msgstr "" -#: src/stored/dev.c:191 +#: src/stored/dev.c:189 msgid "Write part command must be defined for a device which requires mount.\n" msgstr "" -#: src/stored/dev.c:197 +#: src/stored/dev.c:194 #, c-format msgid "Block size %u on device %s is too large, using default %u\n" msgstr "" -#: src/stored/dev.c:202 +#: src/stored/dev.c:199 #, c-format msgid "Max block size %u not multiple of device %s block size.\n" msgstr "" -#: src/stored/dev.c:218 src/stored/dev.c:224 +#: src/stored/dev.c:215 src/stored/dev.c:221 #, c-format msgid "Unable to init cond variable: ERR=%s\n" msgstr "" -#: src/stored/dev.c:310 +#: src/stored/dev.c:312 msgid "Illegal mode given to open dev.\n" msgstr "" -#: src/stored/dev.c:376 src/stored/device.c:302 +#: src/stored/dev.c:355 src/stored/device.c:295 #, c-format msgid "Unable to open device %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:396 -#, c-format -msgid "fcntl error. ERR=%s\n" -msgstr "" - -#: src/stored/dev.c:434 src/stored/dev.c:493 +#: src/stored/dev.c:423 src/stored/dev.c:481 #, c-format msgid "Could not open file device %s. No Volume name given.\n" msgstr "" -#: src/stored/dev.c:459 src/stored/dev.c:573 +#: src/stored/dev.c:449 src/stored/dev.c:562 #, c-format msgid "Could not open: %s, ERR=%s\n" msgstr "" -#: src/stored/dev.c:518 +#: src/stored/dev.c:506 #, c-format msgid "" "The media in the device %s is not empty, please blank it before writing " "anything to it.\n" msgstr "" -#: src/stored/dev.c:534 +#: src/stored/dev.c:523 #, c-format msgid "There is no valid media in the device %s.\n" msgstr "" -#: src/stored/dev.c:541 +#: src/stored/dev.c:530 #, c-format msgid "Could not mount device %s.\n" msgstr "" -#: src/stored/dev.c:599 +#: src/stored/dev.c:588 #, c-format msgid "Could not fstat: %s, ERR=%s\n" msgstr "" -#: src/stored/dev.c:652 +#: src/stored/dev.c:631 #, c-format -msgid "Bad call to rewind_dev. Device %s not open\n" +msgid "Bad call to rewind. Device %s not open\n" msgstr "" -#: src/stored/dev.c:681 +#: src/stored/dev.c:677 #, c-format msgid "Rewind error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:691 src/stored/dev.c:804 src/stored/dev.c:941 -#: src/stored/dev.c:1466 +#: src/stored/dev.c:687 src/stored/dev.c:802 src/stored/dev.c:938 +#: src/stored/dev.c:1457 #, c-format msgid "lseek_dev error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:731 +#: src/stored/dev.c:727 msgid "unknown blocked code" msgstr "" -#: src/stored/dev.c:774 +#: src/stored/dev.c:772 #, c-format msgid "Bad call to eod_dev. Device %s not open\n" msgstr "" -#: src/stored/dev.c:840 +#: src/stored/dev.c:838 #, c-format msgid "ioctl MTEOM error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:848 src/stored/dev.c:981 +#: src/stored/dev.c:846 src/stored/dev.c:978 #, c-format msgid "ioctl MTIOCGET error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:927 +#: src/stored/dev.c:924 msgid "Bad device call. Device not open\n" msgstr "" -#: src/stored/dev.c:940 +#: src/stored/dev.c:937 #, c-format msgid "Seek error: ERR=%s\n" msgstr "" -#: src/stored/dev.c:976 +#: src/stored/dev.c:973 msgid " Bacula status:" msgstr "" -#: src/stored/dev.c:977 src/stored/dev.c:1026 src/stored/dev.c:1028 +#: src/stored/dev.c:974 src/stored/dev.c:1023 src/stored/dev.c:1025 #, c-format msgid " file=%d block=%d\n" msgstr "" -#: src/stored/dev.c:985 +#: src/stored/dev.c:982 msgid " Device status:" msgstr "" -#: src/stored/dev.c:1050 +#: src/stored/dev.c:1047 msgid "Bad call to load_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1061 src/stored/dev.c:1074 +#: src/stored/dev.c:1058 src/stored/dev.c:1071 #, c-format msgid "ioctl MTLOAD error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1093 -msgid "Bad call to offline_dev. Device not open\n" -msgstr "" - -#: src/stored/dev.c:1116 +#: src/stored/dev.c:1107 #, c-format msgid "ioctl MTOFFL error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1157 +#: src/stored/dev.c:1148 msgid "Bad call to fsf_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1167 src/stored/dev.c:1288 +#: src/stored/dev.c:1158 src/stored/dev.c:1279 #, c-format msgid "Device %s at End of Tape.\n" msgstr "" -#: src/stored/dev.c:1192 src/stored/dev.c:1268 +#: src/stored/dev.c:1183 src/stored/dev.c:1259 #, c-format msgid "ioctl MTFSF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1317 +#: src/stored/dev.c:1308 msgid "Bad call to bsf_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1323 +#: src/stored/dev.c:1314 #, c-format msgid "Device %s cannot BSF because it is not a tape.\n" msgstr "" -#: src/stored/dev.c:1338 +#: src/stored/dev.c:1329 #, c-format msgid "ioctl MTBSF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1358 +#: src/stored/dev.c:1349 msgid "Bad call to fsr. Device not open\n" msgstr "" -#: src/stored/dev.c:1367 +#: src/stored/dev.c:1358 #, c-format msgid "ioctl MTFSR not permitted on %s.\n" msgstr "" -#: src/stored/dev.c:1395 +#: src/stored/dev.c:1386 #, c-format msgid "ioctl MTFSR %d error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1415 +#: src/stored/dev.c:1406 msgid "Bad call to bsr_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1425 +#: src/stored/dev.c:1416 #, c-format msgid "ioctl MTBSR not permitted on %s.\n" msgstr "" -#: src/stored/dev.c:1438 +#: src/stored/dev.c:1429 #, c-format msgid "ioctl MTBSR error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1455 +#: src/stored/dev.c:1446 msgid "Bad call to reposition_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1523 +#: src/stored/dev.c:1514 msgid "Bad call to weof_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1533 +#: src/stored/dev.c:1524 msgid "Attempt to WEOF on non-appendable Volume\n" msgstr "" -#: src/stored/dev.c:1550 +#: src/stored/dev.c:1541 #, c-format msgid "ioctl MTWEOF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1592 +#: src/stored/dev.c:1583 msgid "Got ENOTTY on read/write!\n" msgstr "" -#: src/stored/dev.c:1639 +#: src/stored/dev.c:1630 #, c-format msgid "unknown func code %d" msgstr "" -#: src/stored/dev.c:1645 +#: src/stored/dev.c:1636 #, c-format msgid "I/O function \"%s\" not supported on this device.\n" msgstr "" -#: src/stored/dev.c:1783 src/stored/dvd.c:668 +#: src/stored/dev.c:1761 src/stored/dvd.c:734 #, c-format msgid "Unable to truncate device %s. ERR=%s\n" msgstr "" -#: src/stored/dev.c:1822 +#: src/stored/dev.c:1800 msgid "Bad call to term_dev. Device not open\n" msgstr "" -#: src/stored/device.c:105 +#: src/stored/device.c:100 #, c-format msgid "End of medium on Volume \"%s\" Bytes=%s Blocks=%s at %s.\n" msgstr "" -#: src/stored/device.c:119 +#: src/stored/device.c:114 #, c-format msgid "New volume \"%s\" mounted on device %s at %s.\n" msgstr "" -#: src/stored/device.c:131 +#: src/stored/device.c:126 #, c-format msgid "write_block_to_device Volume label failed. ERR=%s" msgstr "" -#: src/stored/device.c:168 +#: src/stored/device.c:162 #, c-format msgid "write_block_to_device overflow block failed. ERR=%s" msgstr "" -#: src/stored/device.c:304 +#: src/stored/device.c:297 #, c-format msgid "Unable to open archive %s: ERR=%s\n" msgstr "" -#: src/stored/device.c:328 -msgid "Bad call to force_close_dev. Device not open\n" -msgstr "" - -#: src/stored/device.c:346 +#: src/stored/device.c:332 #, c-format msgid "Device write lock failure. ERR=%s\n" msgstr "" -#: src/stored/device.c:354 +#: src/stored/device.c:340 #, c-format msgid "Device write unlock failure. ERR=%s\n" msgstr "" -#: src/stored/device.c:373 +#: src/stored/device.c:359 #, c-format msgid "pthread_cond_wait failure. ERR=%s\n" msgstr "" @@ -11182,72 +11302,72 @@ msgstr "" #: src/stored/dircmd.c:262 #, c-format -msgid "3902 Job %s not found.\n" +msgid "3904 Job %s not found.\n" msgstr "" -#: src/stored/dircmd.c:279 +#: src/stored/dircmd.c:283 #, c-format msgid "3000 Job %s marked to be canceled.\n" msgstr "" -#: src/stored/dircmd.c:283 +#: src/stored/dircmd.c:287 msgid "3903 Error scanning cancel command.\n" msgstr "" -#: src/stored/dircmd.c:356 src/stored/dircmd.c:655 src/stored/dircmd.c:720 -#: src/stored/dircmd.c:779 src/stored/dircmd.c:829 src/stored/dircmd.c:869 +#: src/stored/dircmd.c:364 src/stored/dircmd.c:680 src/stored/dircmd.c:756 +#: src/stored/dircmd.c:819 src/stored/dircmd.c:874 src/stored/dircmd.c:918 #, c-format -msgid "3999 Device \"%s\" not found\n" +msgid "3999 Device \"%s\" not found or could not be opened.\n" msgstr "" -#: src/stored/dircmd.c:361 +#: src/stored/dircmd.c:369 #, c-format msgid "3903 Error scanning label command: %s\n" msgstr "" -#: src/stored/dircmd.c:405 +#: src/stored/dircmd.c:412 #, c-format msgid "3920 Cannot label Volume because it is already labeled: \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:411 +#: src/stored/dircmd.c:419 msgid "3921 Wrong volume mounted.\n" msgstr "" -#: src/stored/dircmd.c:415 +#: src/stored/dircmd.c:423 msgid "3922 Cannot relabel an ANSI/IBM labeled Volume.\n" msgstr "" -#: src/stored/dircmd.c:423 src/stored/dircmd.c:432 +#: src/stored/dircmd.c:431 src/stored/dircmd.c:440 #, c-format msgid "3912 Failed to label Volume: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:435 +#: src/stored/dircmd.c:443 #, c-format msgid "3913 Cannot label Volume. Unknown status %d from read_volume_label()\n" msgstr "" -#: src/stored/dircmd.c:468 +#: src/stored/dircmd.c:476 #, c-format msgid "3001 Mounted Volume: %s\n" msgstr "" -#: src/stored/dircmd.c:472 src/stored/dircmd.c:905 +#: src/stored/dircmd.c:480 src/stored/dircmd.c:954 #, c-format msgid "" "3902 Cannot mount Volume on Storage Device %s because:\n" "%s" msgstr "" -#: src/stored/dircmd.c:495 src/stored/reserve.c:554 +#: src/stored/dircmd.c:508 src/stored/reserve.c:634 #, c-format msgid "" "\n" " Device \"%s\" requested by DIR could not be opened or does not exist.\n" msgstr "" -#: src/stored/dircmd.c:516 src/stored/reserve.c:550 +#: src/stored/dircmd.c:529 src/stored/reserve.c:630 #, c-format msgid "" "\n" @@ -11255,151 +11375,217 @@ msgid "" "does not exist.\n" msgstr "" -#: src/stored/dircmd.c:575 src/stored/dircmd.c:623 +#: src/stored/dircmd.c:593 src/stored/dircmd.c:646 #, c-format msgid "3901 open device failed: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:590 src/stored/dircmd.c:614 +#: src/stored/dircmd.c:613 src/stored/dircmd.c:637 #, c-format msgid "3001 Device %s is mounted with Volume \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:593 src/stored/dircmd.c:617 src/stored/dircmd.c:632 +#: src/stored/dircmd.c:616 src/stored/dircmd.c:640 src/stored/dircmd.c:655 #, c-format msgid "" "3905 Device %s open but no Bacula volume is mounted.\n" "If this is not a blank tape, try unmounting and remounting the Volume.\n" msgstr "" -#: src/stored/dircmd.c:602 +#: src/stored/dircmd.c:625 #, c-format msgid "3001 Device %s is doing acquire.\n" msgstr "" -#: src/stored/dircmd.c:607 src/stored/dircmd.c:698 +#: src/stored/dircmd.c:630 src/stored/dircmd.c:730 #, c-format msgid "3903 Device %s is being labeled.\n" msgstr "" -#: src/stored/dircmd.c:629 +#: src/stored/dircmd.c:652 #, c-format msgid "3001 Device %s is already mounted with Volume \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:638 +#: src/stored/dircmd.c:661 #, c-format msgid "3002 Device %s is mounted.\n" msgstr "" -#: src/stored/dircmd.c:641 +#: src/stored/dircmd.c:664 #, c-format msgid "3907 %s" msgstr "" -#: src/stored/dircmd.c:644 +#: src/stored/dircmd.c:667 #, c-format msgid "3906 File device %s is always mounted.\n" msgstr "" -#: src/stored/dircmd.c:650 +#: src/stored/dircmd.c:673 #, c-format msgid "3905 Bizarre wait state %d\n" msgstr "" -#: src/stored/dircmd.c:659 +#: src/stored/dircmd.c:684 #, c-format msgid "3909 Error scanning mount command: %s\n" msgstr "" -#: src/stored/dircmd.c:681 +#: src/stored/dircmd.c:711 #, c-format msgid "3901 Device %s is already unmounted.\n" msgstr "" -#: src/stored/dircmd.c:690 +#: src/stored/dircmd.c:722 #, c-format msgid "3001 Device %s unmounted.\n" msgstr "" -#: src/stored/dircmd.c:694 +#: src/stored/dircmd.c:726 #, c-format msgid "3902 Device %s is busy in acquire.\n" msgstr "" -#: src/stored/dircmd.c:715 +#: src/stored/dircmd.c:749 #, c-format msgid "3002 Device %s unmounted.\n" msgstr "" -#: src/stored/dircmd.c:725 +#: src/stored/dircmd.c:761 #, c-format msgid "3907 Error scanning unmount command: %s\n" msgstr "" -#: src/stored/dircmd.c:751 +#: src/stored/dircmd.c:789 #, c-format -msgid "3911 Device %s already released.\n" +msgid "3921 Device %s already released.\n" msgstr "" -#: src/stored/dircmd.c:758 +#: src/stored/dircmd.c:796 #, c-format -msgid "3912 Device %s waiting for mount.\n" +msgid "3922 Device %s waiting for mount.\n" msgstr "" -#: src/stored/dircmd.c:762 +#: src/stored/dircmd.c:800 #, c-format -msgid "3913 Device %s is busy in acquire.\n" +msgid "3923 Device %s is busy in acquire.\n" msgstr "" -#: src/stored/dircmd.c:766 +#: src/stored/dircmd.c:804 #, c-format msgid "3914 Device %s is being labeled.\n" msgstr "" -#: src/stored/dircmd.c:774 +#: src/stored/dircmd.c:812 #, c-format -msgid "3012 Device %s released.\n" +msgid "3022 Device %s released.\n" msgstr "" -#: src/stored/dircmd.c:784 +#: src/stored/dircmd.c:824 #, c-format -msgid "3917 Error scanning release command: %s\n" +msgid "3927 Error scanning release command: %s\n" msgstr "" -#: src/stored/dircmd.c:817 +#: src/stored/dircmd.c:860 #, c-format msgid "3995 Device %s is not an autochanger.\n" msgstr "" -#: src/stored/dircmd.c:833 +#: src/stored/dircmd.c:878 #, c-format -msgid "3908 Error scanning autocharger list/slots command: %s\n" +msgid "3908 Error scanning autocharger drives/list/slots command: %s\n" msgstr "" -#: src/stored/dircmd.c:873 +#: src/stored/dircmd.c:922 #, c-format msgid "3909 Error scanning readlabel command: %s\n" msgstr "" -#: src/stored/dircmd.c:901 +#: src/stored/dircmd.c:950 #, c-format msgid "3001 Volume=%s Slot=%d\n" msgstr "" -#: src/stored/dircmd.c:930 +#: src/stored/dircmd.c:979 #, c-format msgid "3910 Unable to open device %s: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:940 +#: src/stored/dircmd.c:991 +#, c-format +msgid "3931 Device %s is BLOCKED. user unmounted.\n" +msgstr "" + +#: src/stored/dircmd.c:995 +#, c-format +msgid "" +"3932 Device %s is BLOCKED. user unmounted during wait for media/mount.\n" +msgstr "" + +#: src/stored/dircmd.c:999 +#, c-format +msgid "3933 Device %s is BLOCKED waiting for media.\n" +msgstr "" + +#: src/stored/dircmd.c:1003 +#, c-format +msgid "3934 Device %s is being initialized.\n" +msgstr "" + +#: src/stored/dircmd.c:1007 +#, c-format +msgid "3935 Device %s is blocked labeling a Volume.\n" +msgstr "" + +#: src/stored/dircmd.c:1011 +#, c-format +msgid "3935 Device %s is blocked for unknown reason.\n" +msgstr "" + +#: src/stored/dircmd.c:1016 +#, c-format +msgid "3936 Device %s is busy reading.\n" +msgstr "" + +#: src/stored/dircmd.c:1019 +#, c-format +msgid "3937 Device %s is busy with %d writer(s).\n" +msgstr "" + +#: src/stored/dvd.c:153 +#, c-format +msgid "Device %s cannot be mounted. ERR=%s\n" +msgstr "" + +#: src/stored/dvd.c:271 +#, c-format +msgid "Cannot run free space command (%s)\n" +msgstr "" + +#: src/stored/dvd.c:374 +#, c-format +msgid "Error while writing current part to the DVD: %s" +msgstr "" + +#: src/stored/dvd.c:394 +#, c-format +msgid "Remaining free space %s on %s\n" +msgstr "" + +#: src/stored/dvd.c:464 +#, c-format +msgid "Next Volume part already exists on DVD. Cannot continue: %s\n" +msgstr "" + +#: src/stored/dvd.c:481 #, c-format -msgid "3911 Device %s is busy reading.\n" +msgid "open_next_part can't unlink existing part %s, ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:943 +#: src/stored/dvd.c:700 #, c-format -msgid "3912 Device %s is busy with %d writer(s).\n" +msgid "Unable to write part %s: ERR=%s\n" msgstr "" #: src/stored/fd_cmds.c:340 @@ -11483,52 +11669,52 @@ msgstr "" msgid "Cannot write Volume label to block for device %s\n" msgstr "" -#: src/stored/label.c:393 +#: src/stored/label.c:400 #, c-format msgid "Rewind error on device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:398 +#: src/stored/label.c:405 #, c-format msgid "Truncate error on device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:420 +#: src/stored/label.c:427 #, c-format msgid "Unable to write device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:448 +#: src/stored/label.c:455 #, c-format msgid "Recycled volume \"%s\" on device %s, all previous data lost.\n" msgstr "" -#: src/stored/label.c:451 +#: src/stored/label.c:458 #, c-format msgid "Wrote label to prelabeled Volume \"%s\" on device %s\n" msgstr "" -#: src/stored/label.c:648 +#: src/stored/label.c:657 #, c-format msgid "Bad session label = %d\n" msgstr "" -#: src/stored/label.c:666 src/stored/label.c:673 +#: src/stored/label.c:675 src/stored/label.c:682 #, c-format msgid "Error writing Session label to %s: %s\n" msgstr "" -#: src/stored/label.c:707 +#: src/stored/label.c:717 #, c-format msgid "Expecting Volume Label, got FI=%s Stream=%s len=%d\n" msgstr "" -#: src/stored/label.c:834 +#: src/stored/label.c:844 #, c-format msgid "Unknown %d" msgstr "" -#: src/stored/label.c:838 +#: src/stored/label.c:848 #, c-format msgid "" "\n" @@ -11545,17 +11731,17 @@ msgid "" "HostName : %s\n" msgstr "" -#: src/stored/label.c:860 +#: src/stored/label.c:870 #, c-format msgid "Date label written: %s\n" msgstr "" -#: src/stored/label.c:866 +#: src/stored/label.c:876 #, c-format msgid "Date label written: %04d-%02d-%02d at %02d:%02d\n" msgstr "" -#: src/stored/label.c:886 +#: src/stored/label.c:896 #, c-format msgid "" "\n" @@ -11568,7 +11754,7 @@ msgid "" "ClientName : %s\n" msgstr "" -#: src/stored/label.c:899 +#: src/stored/label.c:909 #, c-format msgid "" "Job (unique name) : %s\n" @@ -11577,7 +11763,7 @@ msgid "" "JobLevel : %c\n" msgstr "" -#: src/stored/label.c:908 +#: src/stored/label.c:918 #, c-format msgid "" "JobFiles : %s\n" @@ -11590,62 +11776,62 @@ msgid "" "JobStatus : %c\n" msgstr "" -#: src/stored/label.c:929 +#: src/stored/label.c:939 #, c-format msgid "Date written : %s\n" msgstr "" -#: src/stored/label.c:934 +#: src/stored/label.c:944 #, c-format msgid "Date written : %04d-%02d-%02d at %02d:%02d\n" msgstr "" -#: src/stored/label.c:953 +#: src/stored/label.c:963 msgid "Fresh Volume" msgstr "" -#: src/stored/label.c:956 +#: src/stored/label.c:966 msgid "Volume" msgstr "" -#: src/stored/label.c:965 src/stored/read_record.c:335 +#: src/stored/label.c:975 src/stored/read_record.c:336 msgid "End of Media" msgstr "" -#: src/stored/label.c:968 +#: src/stored/label.c:978 msgid "End of Tape" msgstr "" -#: src/stored/label.c:988 src/stored/label.c:996 src/stored/label.c:1029 +#: src/stored/label.c:998 src/stored/label.c:1006 src/stored/label.c:1039 #, c-format msgid "%s Record: File:blk=%u:%u SessId=%d SessTime=%d JobId=%d DataLen=%d\n" msgstr "" -#: src/stored/label.c:993 +#: src/stored/label.c:1003 msgid "End of physical tape.\n" msgstr "" -#: src/stored/label.c:1008 src/stored/label.c:1017 +#: src/stored/label.c:1018 src/stored/label.c:1027 #, c-format msgid "%s Record: File:blk=%u:%u SessId=%d SessTime=%d JobId=%d\n" msgstr "" -#: src/stored/label.c:1010 +#: src/stored/label.c:1020 #, c-format msgid " Job=%s Date=%s Level=%c Type=%c\n" msgstr "" -#: src/stored/label.c:1019 +#: src/stored/label.c:1029 #, c-format msgid " Date=%s Level=%c Type=%c Files=%s Bytes=%s Errors=%d Status=%c\n" msgstr "" -#: src/stored/mount.c:197 src/stored/mount.c:294 +#: src/stored/mount.c:198 src/stored/mount.c:295 #, c-format msgid "Volume \"%s\" not on device %s.\n" msgstr "" -#: src/stored/mount.c:230 +#: src/stored/mount.c:231 #, c-format msgid "" "Director wanted Volume \"%s\".\n" @@ -11653,51 +11839,65 @@ msgid "" " %s" msgstr "" -#: src/stored/mount.c:284 +#: src/stored/mount.c:285 #, c-format msgid "Labeled new Volume \"%s\" on device %s.\n" msgstr "" -#: src/stored/mount.c:289 +#: src/stored/mount.c:290 #, c-format msgid "Warning device %s not configured to autolabel Volumes.\n" msgstr "" -#: src/stored/mount.c:340 +#: src/stored/mount.c:342 #, c-format msgid "Volume \"%s\" previously written, moving to end of data.\n" msgstr "" -#: src/stored/mount.c:343 +#: src/stored/mount.c:345 #, c-format msgid "Unable to position to end of data on device %s: ERR=%s\n" msgstr "" -#: src/stored/mount.c:355 +#: src/stored/mount.c:357 #, c-format msgid "Ready to append to end of Volume \"%s\" at file=%d.\n" msgstr "" -#: src/stored/mount.c:358 +#: src/stored/mount.c:360 #, c-format msgid "" "I cannot write on Volume \"%s\" because:\n" "The number of files mismatch! Volume=%u Catalog=%u\n" msgstr "" -#: src/stored/mount.c:411 +#: src/stored/mount.c:388 +#, c-format +msgid "Ready to append to end of Volume \"%s\" at file address=%u.\n" +msgstr "" + +#: src/stored/mount.c:392 +#, c-format +msgid "" +"I cannot write on Volume \"%s\" because:\n" +"The EOD file address is wrong: Volume file address=%u != Catalog Endblock=%u" +"(+1)\n" +"You probably removed DVD last part in spool directory.\n" +msgstr "" + +#: src/stored/mount.c:418 #, c-format msgid "Marking Volume \"%s\" in Error in Catalog.\n" msgstr "" -#: src/stored/mount.c:427 +#: src/stored/mount.c:434 #, c-format msgid "" "Autochanger Volume \"%s\" not found in slot %d.\n" " Setting InChanger to zero in catalog.\n" msgstr "" -#: src/stored/mount.c:446 +#: src/stored/mount.c:453 msgid "Hey!!!!! WroteVol non-zero !!!!!\n" msgstr "" @@ -11831,13 +12031,26 @@ msgstr "" msgid "fast_reject : %d\n" msgstr "" -#: src/stored/read.c:55 -msgid "No Volume names found for restore.\n" +#: src/stored/pythonsd.c:202 +msgid "Error in ParseTuple\n" msgstr "" -#: src/stored/read.c:109 -#, c-format -msgid ">filed: Error Hdr=%s\n" +#: src/stored/pythonsd.c:218 +msgid "Parse tuple error in job_write\n" +msgstr "" + +#: src/stored/pythonsd.c:254 +#, c-format +msgid "Error in Python method %s\n" +msgstr "" + +#: src/stored/read.c:55 +msgid "No Volume names found for restore.\n" +msgstr "" + +#: src/stored/read.c:109 +#, c-format +msgid ">filed: Error Hdr=%s\n" msgstr "" #: src/stored/read.c:110 src/stored/read.c:125 @@ -11868,38 +12081,115 @@ msgstr "" msgid "Did fsr\n" msgstr "" -#: src/stored/read_record.c:275 +#: src/stored/read_record.c:276 #, c-format msgid "Reposition from (file:block) %u:%u to %u:%u\n" msgstr "" -#: src/stored/read_record.c:302 +#: src/stored/read_record.c:303 #, c-format msgid "Forward spacing to file:block %u:%u.\n" msgstr "" -#: src/stored/read_record.c:328 +#: src/stored/read_record.c:329 msgid "Begin Session" msgstr "" -#: src/stored/read_record.c:332 +#: src/stored/read_record.c:333 msgid "End Session" msgstr "" -#: src/stored/read_record.c:338 +#: src/stored/read_record.c:339 #, c-format msgid "Unknown code %d\n" msgstr "" -#: src/stored/record.c:61 +#: src/stored/record.c:60 #, c-format msgid "unknown: %d" msgstr "" -#: src/stored/record.c:332 +#: src/stored/record.c:343 msgid "Damaged buffer\n" msgstr "" +#: src/stored/reserve.c:467 src/stored/reserve.c:479 +#, c-format +msgid "Failed command: %s\n" +msgstr "" + +#: src/stored/reserve.c:469 +#, c-format +msgid "" +"\n" +" Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD " +"Device resources.\n" +msgstr "" + +#: src/stored/reserve.c:647 +#, c-format +msgid "3926 Could not get dcr for device: %s\n" +msgstr "" + +#: src/stored/reserve.c:709 +#, c-format +msgid "3601 JobId=%u device %s is BLOCKED due to user unmount.\n" +msgstr "" + +#: src/stored/reserve.c:718 +#, c-format +msgid "3602 JobId=%u device %s is busy (already reading/writing).\n" +msgstr "" + +#: src/stored/reserve.c:761 +#, c-format +msgid "3603 JobId=%u device %s is busy reading.\n" +msgstr "" + +#: src/stored/reserve.c:770 +#, c-format +msgid "3604 JobId=%u device %s is BLOCKED due to user unmount.\n" +msgstr "" + +#: src/stored/reserve.c:836 +#, c-format +msgid "3605 JobId=%u wants free drive but device %s is busy.\n" +msgstr "" + +#: src/stored/reserve.c:844 +#, c-format +msgid "3606 JobId=%u wants mounted, but drive %s has no Volume.\n" +msgstr "" + +#: src/stored/reserve.c:854 +#, c-format +msgid "3607 JobId=%u wants Vol=\"%s\" drive has Vol=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:890 +#, c-format +msgid "3608 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:933 +#, c-format +msgid "3609 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:941 src/stored/reserve.c:945 +msgid "Logic error!!!! Should not get here.\n" +msgstr "" + +#: src/stored/reserve.c:942 +#, c-format +msgid "3910 JobId=%u Logic error!!!! drive %s Should not get here.\n" +msgstr "" + +#: src/stored/reserve.c:948 +#, c-format +msgid "3911 JobId=%u failed reserve drive %s.\n" +msgstr "" + #: src/stored/spool.c:69 #, c-format msgid "" @@ -11927,256 +12217,272 @@ msgstr "" #: src/stored/spool.c:199 #, c-format -msgid "Committing spooled data to Volume. Despooling %s bytes ...\n" +msgid "Committing spooled data to Volume \"%s\". Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:203 +#: src/stored/spool.c:204 #, c-format msgid "Writing spooled data to Volume. Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:257 src/stored/spool.c:431 src/stored/spool.c:469 +#: src/stored/spool.c:258 src/stored/spool.c:432 src/stored/spool.c:470 #, c-format msgid "Ftruncate spool file failed: ERR=%s\n" msgstr "" -#: src/stored/spool.c:259 +#: src/stored/spool.c:260 #, c-format msgid "Bad return from ftruncate. ERR=%s\n" msgstr "" -#: src/stored/spool.c:308 +#: src/stored/spool.c:309 #, c-format msgid "Spool header read error. ERR=%s\n" msgstr "" -#: src/stored/spool.c:311 +#: src/stored/spool.c:312 #, c-format msgid "Spool read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:312 +#: src/stored/spool.c:313 #, c-format msgid "Spool header read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:318 src/stored/spool.c:319 +#: src/stored/spool.c:319 src/stored/spool.c:320 #, c-format msgid "Spool block too big. Max %u bytes, got %u\n" msgstr "" -#: src/stored/spool.c:324 src/stored/spool.c:325 +#: src/stored/spool.c:325 src/stored/spool.c:326 #, c-format msgid "Spool data read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:382 +#: src/stored/spool.c:383 msgid "User specified spool size reached.\n" msgstr "" -#: src/stored/spool.c:384 +#: src/stored/spool.c:385 msgid "Bad return from despool in write_block.\n" msgstr "" -#: src/stored/spool.c:392 +#: src/stored/spool.c:393 msgid "Spooling data again ...\n" msgstr "" -#: src/stored/spool.c:423 +#: src/stored/spool.c:424 #, c-format msgid "Error writing header to spool file. ERR=%s\n" msgstr "" -#: src/stored/spool.c:437 src/stored/spool.c:475 +#: src/stored/spool.c:438 src/stored/spool.c:476 msgid "Fatal despooling error." msgstr "" -#: src/stored/spool.c:444 +#: src/stored/spool.c:445 msgid "Retrying after header spooling error failed.\n" msgstr "" -#: src/stored/spool.c:458 +#: src/stored/spool.c:459 #, c-format msgid "Error writing data to spool file. ERR=%s\n" msgstr "" -#: src/stored/spool.c:485 +#: src/stored/spool.c:486 msgid "Retrying after data spooling error failed.\n" msgstr "" -#: src/stored/spool.c:540 src/stored/spool.c:547 +#: src/stored/spool.c:541 src/stored/spool.c:548 #, c-format msgid "Fseek on attributes file failed: ERR=%s\n" msgstr "" -#: src/stored/spool.c:557 +#: src/stored/spool.c:558 #, c-format msgid "Sending spooled attrs to the Director. Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:584 +#: src/stored/spool.c:585 #, c-format msgid "fopen attr spool file %s failed: ERR=%s\n" msgstr "" -#: src/stored/status.c:66 +#: src/stored/status.c:67 #, c-format msgid "" "\n" "%s Version: %s (%s) %s %s %s\n" msgstr "" -#: src/stored/status.c:97 +#: src/stored/status.c:103 msgid "" "\n" "Device status:\n" msgstr "" -#: src/stored/status.c:99 +#: src/stored/status.c:105 #, c-format msgid "Autochanger \"%s\" with devices:\n" msgstr "" -#: src/stored/status.c:113 +#: src/stored/status.c:119 #, c-format -msgid "Device %s is mounted with Volume \"%s\"\n" +msgid "Device %s is mounted with Volume=\"%s\" Pool=\"%s\"\n" msgstr "" -#: src/stored/status.c:116 +#: src/stored/status.c:123 #, c-format msgid "Device %s open but no Bacula volume is mounted.\n" msgstr "" -#: src/stored/status.c:126 +#: src/stored/status.c:133 #, c-format msgid " Total Bytes=%s Blocks=%s Bytes/block=%s\n" msgstr "" -#: src/stored/status.c:140 +#: src/stored/status.c:147 #, c-format msgid " Total Bytes Read=%s Blocks Read=%s Bytes/block=%s\n" msgstr "" -#: src/stored/status.c:145 +#: src/stored/status.c:152 #, c-format msgid " Positioned at File=%s Block=%s\n" msgstr "" -#: src/stored/status.c:151 +#: src/stored/status.c:158 #, c-format msgid "Device %s is not open or does not exist.\n" msgstr "" -#: src/stored/status.c:153 +#: src/stored/status.c:160 #, c-format msgid "Device \"%s\" is not open or does not exist.\n" msgstr "" -#: src/stored/status.c:158 src/stored/status.c:165 src/stored/status.c:168 +#: src/stored/status.c:165 src/stored/status.c:168 src/stored/status.c:172 +#: src/stored/status.c:174 msgid "" "====\n" "\n" msgstr "" -#: src/stored/status.c:159 -msgid "Volume status:\n" +#: src/stored/status.c:166 +msgid "In Use Volume status:\n" msgstr "" -#: src/stored/status.c:183 +#: src/stored/status.c:190 msgid "" "No DEVICE structure.\n" "\n" msgstr "" -#: src/stored/status.c:188 +#: src/stored/status.c:195 msgid " Device is BLOCKED. User unmounted.\n" msgstr "" -#: src/stored/status.c:191 +#: src/stored/status.c:198 msgid " Device is BLOCKED. User unmounted during wait for media/mount.\n" msgstr "" -#: src/stored/status.c:195 +#: src/stored/status.c:202 #, c-format msgid " Device is BLOCKED waiting for mount of volume \"%s\".\n" msgstr "" -#: src/stored/status.c:198 +#: src/stored/status.c:205 msgid " Device is BLOCKED waiting for media.\n" msgstr "" -#: src/stored/status.c:202 +#: src/stored/status.c:209 msgid " Device is being initialized.\n" msgstr "" -#: src/stored/status.c:205 +#: src/stored/status.c:212 msgid " Device is blocked labeling a Volume.\n" msgstr "" -#: src/stored/status.c:213 +#: src/stored/status.c:220 #, c-format msgid " Slot %d is loaded in drive %d.\n" msgstr "" -#: src/stored/status.c:216 +#: src/stored/status.c:223 #, c-format msgid " Drive %d is not loaded.\n" msgstr "" -#: src/stored/status.c:235 +#: src/stored/status.c:242 msgid "Device state:\n" msgstr "" -#: src/stored/status.c:249 +#: src/stored/status.c:256 #, c-format msgid "" "num_writers=%d JobStatus=%c block=%d\n" "\n" msgstr "" -#: src/stored/status.c:253 +#: src/stored/status.c:260 #, c-format msgid "Archive name: %s Device name: %s\n" msgstr "" -#: src/stored/status.c:255 +#: src/stored/status.c:262 #, c-format msgid "File=%u block=%u\n" msgstr "" -#: src/stored/status.c:256 +#: src/stored/status.c:263 #, c-format msgid "Min block=%u Max block=%u\n" msgstr "" -#: src/stored/status.c:272 +#: src/stored/status.c:280 #, c-format msgid "%s Job %s waiting for Client connection.\n" msgstr "" -#: src/stored/status.c:284 +#: src/stored/status.c:295 +#, c-format +msgid "" +"Reading: %s %s job %s JobId=%d Volume=\"%s\"\n" +" pool=\"%s\" device=\"%s\"\n" +msgstr "" + +#: src/stored/status.c:307 #, c-format -msgid "%s %s job %s JobId=%d Volume=\"%s\" device=\"%s\"\n" +msgid "" +"Writing: %s %s job %s JobId=%d Volume=\"%s\"\n" +" pool=\"%s\" device=\"%s\"\n" msgstr "" -#: src/stored/status.c:303 +#: src/stored/status.c:330 #, c-format msgid " FDReadSeqNo=%s in_msg=%u out_msg=%d fd=%d\n" msgstr "" -#: src/stored/status.c:308 +#: src/stored/status.c:335 msgid " FDSocket closed\n" msgstr "" -#: src/stored/status.c:335 +#: src/stored/status.c:352 +msgid "" +"\n" +"Jobs waiting to reserve a drive:\n" +msgstr "" + +#: src/stored/status.c:380 msgid " JobId Level Files Bytes Status Finished Name \n" msgstr "" -#: src/stored/status.c:469 +#: src/stored/status.c:514 msgid "3900 Bad .status command, missing argument.\n" msgstr "" -#: src/stored/status.c:494 +#: src/stored/status.c:537 msgid "3900 Bad .status command, wrong argument.\n" msgstr "" @@ -12210,37 +12516,37 @@ msgstr "" msgid "Unable to create thread. ERR=%s\n" msgstr "" -#: src/stored/stored.c:272 +#: src/stored/stored.c:271 #, c-format msgid "Only one Storage resource permitted in %s\n" msgstr "" -#: src/stored/stored.c:277 +#: src/stored/stored.c:276 #, c-format msgid "No Director resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:282 +#: src/stored/stored.c:281 #, c-format msgid "No Device resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:290 +#: src/stored/stored.c:289 #, c-format msgid "No Messages resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:317 +#: src/stored/stored.c:316 #, c-format msgid "\"TLS Certificate\" file not defined for Storage \"%s\" in %s.\n" msgstr "" -#: src/stored/stored.c:323 +#: src/stored/stored.c:322 #, c-format msgid "\"TLS Key\" file not defined for Storage \"%s\" in %s.\n" msgstr "" -#: src/stored/stored.c:329 +#: src/stored/stored.c:328 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " @@ -12248,235 +12554,72 @@ msgid "" "using \"TLS Verify Peer\".\n" msgstr "" -#: src/stored/stored.c:417 -#, c-format -msgid "No Changer Name given for device %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:423 -#, c-format -msgid "No Changer Command given for device %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:435 -#, c-format -msgid "" -"Media Type not the same for all devices in changer %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:496 +#: src/stored/stored.c:455 #, c-format msgid "Could not initialize %s\n" msgstr "" -#: src/stored/stored.c:509 +#: src/stored/stored.c:468 #, c-format msgid "Could not open device %s\n" msgstr "" -#: src/stored/stored.c:521 +#: src/stored/stored.c:481 #, c-format msgid "Could not mount device %s\n" msgstr "" -#: src/stored/stored_conf.c:188 +#: src/stored/stored_conf.c:216 +#, c-format +msgid "Expected a Device Type keyword, got: %s" +msgstr "" + +#: src/stored/stored_conf.c:231 #, c-format msgid "Warning: no \"%s\" resource (%d) defined.\n" msgstr "" -#: src/stored/stored_conf.c:191 +#: src/stored/stored_conf.c:234 #, c-format msgid "dump_resource type=%d\n" msgstr "" -#: src/stored/stored_conf.c:307 +#: src/stored/stored_conf.c:350 #, c-format msgid "Warning: unknown resource type %d\n" msgstr "" -#: src/stored/stored_conf.c:496 +#: src/stored/stored_conf.c:539 #, c-format msgid "\"%s\" item is required in \"%s\" resource, but not found.\n" msgstr "" -#: src/stored/stored_conf.c:502 +#: src/stored/stored_conf.c:545 #, c-format msgid "Too many items in \"%s\" resource\n" msgstr "" -#: src/stored/stored_conf.c:536 +#: src/stored/stored_conf.c:579 #, c-format msgid "Cannot find AutoChanger resource %s\n" msgstr "" -#: src/stored/stored_conf.c:607 +#: src/stored/stored_conf.c:650 #, c-format msgid "" "Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n" msgstr "" -#: src/stored/ansi_label.c:83 -#, c-format -msgid "Read error on device %s in ANSI label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:93 -msgid "Insane! End of tape while reading ANSI label.\n" -msgstr "" - -#: src/stored/ansi_label.c:117 -msgid "No VOL1 label while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:137 -#, c-format -msgid "Wanted ANSI Volume \"%s\" got \"%s\"\n" -msgstr "" - -#: src/stored/ansi_label.c:148 -msgid "No HDR1 label while reading ANSI label.\n" -msgstr "" - -#: src/stored/ansi_label.c:154 -#, c-format -msgid "ANSI/IBM Volume \"%s\" does not belong to Bacula.\n" -msgstr "" - -#: src/stored/ansi_label.c:165 -msgid "No HDR2 label while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:179 -msgid "Unknown or bad ANSI/IBM label record.\n" -msgstr "" - -#: src/stored/ansi_label.c:186 -msgid "Too many records in while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:285 -#, c-format -msgid "ANSI Volume label name \"%s\" longer than 6 chars.\n" -msgstr "" - -#: src/stored/ansi_label.c:302 -#, c-format -msgid "Could not write ANSI VOL1 label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:340 src/stored/ansi_label.c:369 -#, c-format -msgid "Could not write ANSI HDR1 label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:345 src/stored/ansi_label.c:376 -msgid "Could not write ANSI HDR1 label.\n" -msgstr "" - -#: src/stored/ansi_label.c:381 -#, c-format -msgid "Error writing EOF to tape. ERR=%s" -msgstr "" - -#: src/stored/ansi_label.c:386 -msgid "write_ansi_ibm_label called for non-ANSI/IBM type\n" -msgstr "" - -#: src/stored/dvd.c:153 -#, c-format -msgid "Device %s cannot be mounted. ERR=%s\n" -msgstr "" - -#: src/stored/dvd.c:261 -#, c-format -msgid "Cannot run free space command (%s)\n" -msgstr "" - -#: src/stored/dvd.c:322 -#, c-format -msgid "Error while writing current part to the DVD: %s" -msgstr "" - -#: src/stored/dvd.c:343 -#, c-format -msgid "Remaining free space %s on %s\n" -msgstr "" - -#: src/stored/dvd.c:412 -#, c-format -msgid "Next Volume part already exists on DVD. Cannot continue: %s\n" -msgstr "" - -#: src/stored/dvd.c:430 +#: src/stored/wait.c:114 #, c-format -msgid "open_next_part can't unlink existing part %s, ERR=%s\n" -msgstr "" - -#: src/stored/dvd.c:634 -#, c-format -msgid "Unable to write part %s: ERR=%s\n" +msgid "pthread timedwait error. ERR=%s\n" msgstr "" -#: src/stored/wait.c:178 src/stored/wait.c:236 +#: src/stored/wait.c:199 #, c-format msgid "Job %s waiting to reserve a device.\n" msgstr "" -#: src/stored/pythonsd.c:202 -msgid "Error in ParseTuple\n" -msgstr "" - -#: src/stored/pythonsd.c:218 -msgid "Parse tuple error in job_write\n" -msgstr "" - -#: src/stored/pythonsd.c:254 -#, c-format -msgid "Error in Python method %s\n" -msgstr "" - -#: src/stored/reserve.c:373 src/stored/reserve.c:390 -#, c-format -msgid "Failed command: %s\n" -msgstr "" - -#: src/stored/reserve.c:375 -#, c-format -msgid "" -"\n" -" Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD " -"Device resources.\n" -msgstr "" - -#: src/stored/reserve.c:564 -#, c-format -msgid "3926 Could not get dcr for device: %s\n" -msgstr "" - -#: src/stored/reserve.c:615 src/stored/reserve.c:670 -#, c-format -msgid "Device %s is BLOCKED due to user unmount.\n" -msgstr "" - -#: src/stored/reserve.c:623 -#, c-format -msgid "Device %s is busy.\n" -msgstr "" - -#: src/stored/reserve.c:678 -#, c-format -msgid "Device %s is busy writing on another Volume.\n" -msgstr "" - -#: src/stored/reserve.c:777 -#, c-format -msgid "Wanted Pool \"%s\", but device %s is using Pool \"%s\" .\n" -msgstr "" - -#: src/stored/reserve.c:784 src/stored/reserve.c:785 -msgid "Logic error!!!! Should not get here.\n" -msgstr "" - #: src/tools/bsmtp.c:85 #, c-format msgid "Fatal malformed reply from %s: %s\n" @@ -12888,24 +13031,43 @@ msgstr "" msgid "Found %d bad Path records.\n" msgstr "" -#: src/tools/testfind.c:49 +#: src/tools/fstype.c:34 #, c-format msgid "" "\n" -"Usage: testfind [-d debug_level] [-] [pattern1 ...]\n" -" -a print extended attributes (Win32 debug)\n" -" -dnn set debug level to nn\n" -" -e specify file of exclude patterns\n" -" -i specify file of include patterns\n" -" - read pattern(s) from stdin\n" -" -? print this message.\n" +"Usage: fstype [-d debug_level] path ...\n" "\n" -"Patterns are used for file inclusion -- normally directories.\n" -"Debug level >= 1 prints each file found.\n" -"Debug level >= 10 prints path/file for catalog.\n" -"Errors are always printed.\n" -"Files/paths truncated is the number of files/paths with len > 255.\n" -"Truncation is only in the catalog.\n" +" Print the file system type a given file/directory is on.\n" +" The following options are supported:\n" +"\n" +" -v print both path and file system type.\n" +" -? print this message.\n" +"\n" +msgstr "" + +#: src/tools/fstype.c:86 +#, c-format +msgid "%s: unknown\n" +msgstr "" + +#: src/tools/testfind.c:49 +#, c-format +msgid "" +"\n" +"Usage: testfind [-d debug_level] [-] [pattern1 ...]\n" +" -a print extended attributes (Win32 debug)\n" +" -dnn set debug level to nn\n" +" -e specify file of exclude patterns\n" +" -i specify file of include patterns\n" +" - read pattern(s) from stdin\n" +" -? print this message.\n" +"\n" +"Patterns are used for file inclusion -- normally directories.\n" +"Debug level >= 1 prints each file found.\n" +"Debug level >= 10 prints path/file for catalog.\n" +"Errors are always printed.\n" +"Files/paths truncated is the number of files/paths with len > 255.\n" +"Truncation is only in the catalog.\n" "\n" msgstr "" @@ -13033,25 +13195,6 @@ msgstr "" msgid "Skip: File system change prohibited. Directory not entered. %s\n" msgstr "" -#: src/tools/fstype.c:34 -#, c-format -msgid "" -"\n" -"Usage: fstype [-d debug_level] path ...\n" -"\n" -" Print the file system type a given file/directory is on.\n" -" The following options are supported:\n" -"\n" -" -v print both path and file system type.\n" -" -? print this message.\n" -"\n" -msgstr "" - -#: src/tools/fstype.c:86 -#, c-format -msgid "%s: unknown\n" -msgstr "" - #: src/tray-monitor/authenticate.c:78 msgid "" "Director authorization problem.\n" @@ -13178,24 +13321,11 @@ msgstr "" #: src/tray-monitor/tray-monitor.c:503 src/tray-monitor/tray-monitor.c:513 msgid "" -"Copyright (C) 2004 Kern Sibbald and John Walker\n" +"Copyright (C) 2004-2005 Kern Sibbald\n" "Written by Nicolas Boichat\n" msgstr "" -#: src/tray-monitor/tray-monitor.c:505 -msgid "Version" -msgstr "" - -#: src/tray-monitor/tray-monitor.c:509 -#, c-format -msgid "" -"%s\n" -"\n" -"%s\n" -"%s %s (%s) %s %s %s" -msgstr "" - -#: src/tray-monitor/tray-monitor.c:515 +#: src/tray-monitor/tray-monitor.c:505 src/tray-monitor/tray-monitor.c:515 msgid "Version:" msgstr "" @@ -13391,7 +13521,7 @@ msgstr "" msgid "<< Error: BNET_PROMPT signal received. >>\n" msgstr "" -#: src/tray-monitor/tray-monitor.c:953 src/wx-console/console_thread.cpp:445 +#: src/tray-monitor/tray-monitor.c:953 src/wx-console/console_thread.cpp:465 msgid "<< Heartbeat signal received, answered. >>\n" msgstr "" @@ -13436,94 +13566,271 @@ msgstr "" msgid "Storage: name=%s address=%s SDport=%d\n" msgstr "" -#: src/wx-console/authenticate.c:126 +#: src/wx-console/authenticate.c:129 msgid "Bad response to Hello command: ERR=" msgstr "" -#: src/baconfig.h:52 +#: src/baconfig.h:55 #, c-format msgid "Failed ASSERT: %s\n" msgstr "" -#: src/baconfig.h:59 +#: src/baconfig.h:62 msgid "*None*" msgstr "" -#: src/wx-console/console_thread.cpp:103 +#: src/filed/win32/winmain.cpp:228 src/filed/win32/winmain.cpp:236 +msgid "Bacula Usage" +msgstr "" + +#: src/filed/win32/winmain.cpp:233 +msgid "Bad Command Line Options" +msgstr "" + +#: src/filed/win32/winmain.cpp:326 +msgid "Another instance of Bacula is already running" +msgstr "" + +#: src/filed/win32/winservice.cpp:131 src/filed/win32/winservice.cpp:145 +msgid "No existing instance of Bacula could be contacted" +msgstr "" + +#: src/filed/win32/winservice.cpp:218 +msgid "KERNEL32.DLL not found: Bacula service not started" +msgstr "" + +#: src/filed/win32/winservice.cpp:228 +msgid "Registry service not found: Bacula service not started" +msgstr "" + +#: src/filed/win32/winservice.cpp:230 +msgid "Registry service not found" +msgstr "" + +#: src/filed/win32/winservice.cpp:260 +msgid "StartServiceCtrlDispatcher failed." +msgstr "" + +#: src/filed/win32/winservice.cpp:278 +msgid "RegisterServiceCtlHandler failed" +msgstr "" + +#: src/filed/win32/winservice.cpp:279 +msgid "Contact Register Service Handler failure" +msgstr "" + +#: src/filed/win32/winservice.cpp:295 +msgid "ReportStatus STOPPED failed 1" +msgstr "" + +#: src/filed/win32/winservice.cpp:318 +msgid "Report Service failure" +msgstr "" + +#: src/filed/win32/winservice.cpp:355 +msgid "Unable to install Bacula service" +msgstr "" + +#: src/filed/win32/winservice.cpp:373 +msgid "Service command length too long" +msgstr "" + +#: src/filed/win32/winservice.cpp:374 +msgid "Service command length too long. Service not registered." +msgstr "" + +#: src/filed/win32/winservice.cpp:389 +msgid "Cannot write System Registry" +msgstr "" + +#: src/filed/win32/winservice.cpp:390 +msgid "" +"The System Registry could not be updated - the Bacula service was not " +"installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:397 +msgid "Cannot add Bacula key to System Registry" +msgstr "" + +#: src/filed/win32/winservice.cpp:398 src/filed/win32/winservice.cpp:449 +msgid "The Bacula service could not be installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:406 +msgid "" +"The Bacula File service was successfully installed.\n" +"The service may be started by double clicking on the\n" +"Bacula \"Start\" icon and will be automatically\n" +"be run the next time this machine is rebooted. " +msgstr "" + +#: src/filed/win32/winservice.cpp:424 +msgid "" +"The Service Control Manager could not be contacted - the Bacula service was " +"not installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:455 +msgid "" +"Provides file backup and restore services. Bacula -- the network backup " +"solution." +msgstr "" + +#: src/filed/win32/winservice.cpp:462 +msgid "" +"The Bacula File service was successfully installed.\n" +"The service may be started from the Control Panel and will\n" +"automatically be run the next time this machine is rebooted." +msgstr "" + +#: src/filed/win32/winservice.cpp:471 +msgid "" +"Unknown Windows operating system.\n" +"Cannot install Bacula service.\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:496 +msgid "" +"Could not find registry entry.\n" +"Service probably not registerd - the Bacula service was not removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:501 +msgid "" +"Could not delete Registry key.\n" +"The Bacula service could not be removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:511 +msgid "Bacula could not be contacted, probably not running" +msgstr "" + +#: src/filed/win32/winservice.cpp:517 src/filed/win32/winservice.cpp:553 +msgid "The Bacula service has been removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:547 +msgid "The Bacula service could not be stopped" +msgstr "" + +#: src/filed/win32/winservice.cpp:555 +msgid "The Bacula service could not be removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:560 +msgid "The Bacula service could not be found" +msgstr "" + +#: src/filed/win32/winservice.cpp:565 +msgid "The SCM could not be contacted - the Bacula service was not removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:629 +msgid "SetServiceStatus failed" +msgstr "" + +#: src/filed/win32/winservice.cpp:657 +#, c-format +msgid "" +"\n" +"\n" +"%s error: %ld at %s:%d" +msgstr "" + +#: src/filed/win32/winservice.cpp:732 +#, c-format +msgid "Locked by: %s, duration: %ld seconds\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:736 +#, c-format +msgid "No longer locked\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:740 +msgid "Could not lock database" +msgstr "" + +#: src/wx-console/console_thread.cpp:101 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " "Director \"%s\" in config file.\n" -" At least one CA certificate store is required.\n" +"At least one CA certificate store is required.\n" msgstr "" -#: src/wx-console/console_thread.cpp:112 +#: src/wx-console/console_thread.cpp:108 msgid "" "No Director resource defined in config file.\n" "Without that I don't how to speak to the Director :-(\n" msgstr "" -#: src/wx-console/console_thread.cpp:132 +#: src/wx-console/console_thread.cpp:127 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " "Console \"%s\" in config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:154 +#: src/wx-console/console_thread.cpp:148 msgid "Error while initializing windows sockets...\n" msgstr "" -#: src/wx-console/console_thread.cpp:169 +#: src/wx-console/console_thread.cpp:163 msgid "Error while cleaning up windows sockets...\n" msgstr "" -#: src/wx-console/console_thread.cpp:207 +#: src/wx-console/console_thread.cpp:201 msgid "Error while initializing library." msgstr "" -#: src/wx-console/console_thread.cpp:237 +#: src/wx-console/console_thread.cpp:227 +msgid "Cryptographic library initialization failed.\n" +msgstr "" + +#: src/wx-console/console_thread.cpp:231 msgid "Please correct configuration file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:270 +#: src/wx-console/console_thread.cpp:273 msgid "Error : Library not initialized\n" msgstr "" -#: src/wx-console/console_thread.cpp:281 +#: src/wx-console/console_thread.cpp:284 msgid "Error : No configuration file loaded\n" msgstr "" -#: src/wx-console/console_thread.cpp:291 +#: src/wx-console/console_thread.cpp:294 msgid "Connecting...\n" msgstr "Connection...\n" -#: src/wx-console/console_thread.cpp:307 +#: src/wx-console/console_thread.cpp:310 msgid "Error : No director defined in config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:319 +#: src/wx-console/console_thread.cpp:322 msgid "Multiple directors found in your config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:328 +#: src/wx-console/console_thread.cpp:331 #, c-format msgid "Please choose a director (1-%d): " msgstr "" -#: src/wx-console/console_thread.cpp:400 +#: src/wx-console/console_thread.cpp:403 msgid "Failed to connect to the director\n" msgstr "Impossible de se connecter au Director\n" -#: src/wx-console/console_thread.cpp:410 +#: src/wx-console/console_thread.cpp:413 msgid "Connected\n" msgstr "" -#: src/wx-console/console_thread.cpp:448 +#: src/wx-console/console_thread.cpp:470 msgid "<< Unexpected signal received : " msgstr "" -#: src/wx-console/console_thread.cpp:466 +#: src/wx-console/console_thread.cpp:490 msgid "Connection terminated\n" msgstr "" @@ -13536,28 +13843,28 @@ msgstr "" msgid "Welcome to bacula wx-console %s (%s)!\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:41 +#: src/wx-console/wxbconfigfileeditor.cpp:44 msgid "Config file editor" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:57 -msgid "Save and close" +#: src/wx-console/wxbconfigfileeditor.cpp:54 +msgid "# Bacula wx-console Configuration File\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:58 -msgid "Close without saving" +#: src/wx-console/wxbconfigfileeditor.cpp:90 +msgid "Save and close" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:69 -msgid "# Bacula wx-console Configuration File\n" +#: src/wx-console/wxbconfigfileeditor.cpp:91 +msgid "Close without saving" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:100 +#: src/wx-console/wxbconfigfileeditor.cpp:118 #, c-format msgid "Unable to write to %s\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:101 +#: src/wx-console/wxbconfigfileeditor.cpp:119 msgid "Error while saving" msgstr "" @@ -13579,567 +13886,579 @@ msgstr "" msgid "Possible completions: " msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:258 -#: src/wx-console/wxbrestorepanel.cpp:1861 -#: src/wx-console/wxbrestorepanel.cpp:1890 -msgid "Enter restore mode" +#: src/wx-console/wxbmainframe.cpp:227 +msgid "&About...\tF1" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:261 -msgid "Cancel restore" +#: src/wx-console/wxbmainframe.cpp:227 +msgid "Show about dialog" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:287 -#: src/wx-console/wxbrestorepanel.cpp:341 -msgid "Add" +#: src/wx-console/wxbmainframe.cpp:229 src/wx-console/wxbmainframe.cpp:598 +msgid "Connect to the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:289 -#: src/wx-console/wxbrestorepanel.cpp:343 -msgid "Remove" +#: src/wx-console/wxbmainframe.cpp:230 +msgid "Disconnect" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:291 -#: src/wx-console/wxbrestorepanel.cpp:345 -msgid "Refresh" +#: src/wx-console/wxbmainframe.cpp:230 +msgid "Disconnect of the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:310 -msgid "M" +#: src/wx-console/wxbmainframe.cpp:232 +msgid "Change of configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:326 -msgid "Perm." +#: src/wx-console/wxbmainframe.cpp:232 +msgid "Change your default configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:359 -#: src/wx-console/wxbrestorepanel.cpp:372 -#: src/wx-console/wxbrestorepanel.cpp:524 -#: src/wx-console/wxbrestorepanel.cpp:534 -#: src/wx-console/wxbrestorepanel.cpp:537 -#: src/wx-console/wxbrestorepanel.cpp:1732 -#: src/wx-console/wxbrestorepanel.cpp:1812 -msgid "Job Name" +#: src/wx-console/wxbmainframe.cpp:233 +msgid "Edit your configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:361 -#: src/wx-console/wxbrestorepanel.cpp:377 -#: src/wx-console/wxbrestorepanel.cpp:476 -#: src/wx-console/wxbrestorepanel.cpp:477 -#: src/wx-console/wxbrestorepanel.cpp:487 -#: src/wx-console/wxbrestorepanel.cpp:488 -#: src/wx-console/wxbrestorepanel.cpp:1101 -#: src/wx-console/wxbrestorepanel.cpp:1768 -#: src/wx-console/wxbrestorepanel.cpp:1827 -msgid "Fileset" +#: src/wx-console/wxbmainframe.cpp:235 +msgid "E&xit\tAlt-X" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:364 -#: src/wx-console/wxbrestorepanel.cpp:1168 -#: src/wx-console/wxbrestorepanel.cpp:1183 -#: src/wx-console/wxbrestorepanel.cpp:1185 -#: src/wx-console/wxbrestorepanel.cpp:1193 -#: src/wx-console/wxbrestorepanel.cpp:1195 -#: src/wx-console/wxbrestorepanel.cpp:1212 -#: src/wx-console/wxbrestorepanel.cpp:1219 -#: src/wx-console/wxbrestorepanel.cpp:1759 -#: src/wx-console/wxbrestorepanel.cpp:1885 -msgid "Before" +#: src/wx-console/wxbmainframe.cpp:235 +msgid "Quit this program" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:366 -msgid "Please configure parameters concerning files to restore :" +#: src/wx-console/wxbmainframe.cpp:239 +msgid "&File" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -#: src/wx-console/wxbrestorepanel.cpp:1820 -msgid "always" +#: src/wx-console/wxbmainframe.cpp:240 +msgid "&Help" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -msgid "if newer" +#: src/wx-console/wxbmainframe.cpp:257 +msgid "Console" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -msgid "if older" +#: src/wx-console/wxbmainframe.cpp:264 +msgid "" +"Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -#: src/wx-console/wxbrestorepanel.cpp:1823 -msgid "never" +#: src/wx-console/wxbmainframe.cpp:268 +msgid "" +"Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode " +"support when handling non-ASCII filenames: Every non-ASCII character in such " +"filenames will be replaced by an interrogation mark.\n" +"If this behaviour disturbs you, please build wx-console against a Unicode " +"version of wxWidgets for GTK+ 2.0.\n" +"---\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:383 -msgid "Please configure parameters concerning files restoration :" +#: src/wx-console/wxbmainframe.cpp:279 +msgid "Send" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:448 -msgid "Getting parameters list." +#: src/wx-console/wxbmainframe.cpp:356 src/wx-console/wxbmainframe.cpp:368 +msgid "Error while parsing command line arguments, using defaults.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:456 -msgid "Error : no clients returned by the director." +#: src/wx-console/wxbmainframe.cpp:357 src/wx-console/wxbmainframe.cpp:369 +msgid "Usage: wx-console [-c configfile] [-w tmp]\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:480 -msgid "Error : no filesets returned by the director." +#: src/wx-console/wxbmainframe.cpp:397 +#, c-format +msgid "" +"It seems that it is the first time you run wx-console.\n" +"This file (%s) has been choosen as default configuration file.\n" +"Do you want to edit it? (if you click No you will have to select another " +"file)" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:504 -msgid "Error : no storage returned by the director." +#: src/wx-console/wxbmainframe.cpp:399 +msgid "First run" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:527 -#: src/wx-console/wxbrestorepanel.cpp:551 -msgid "Error : no jobs returned by the director." +#: src/wx-console/wxbmainframe.cpp:416 +#, c-format +msgid "" +"Unable to read %s\n" +"Error: %s\n" +"Do you want to choose another one? (Press no to edit this file)" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:537 -msgid "RestoreFiles" +#: src/wx-console/wxbmainframe.cpp:418 +msgid "Unable to read configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:572 -msgid "Please configure your restore parameters." +#: src/wx-console/wxbmainframe.cpp:430 +msgid "Please choose a configuration file to use" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:583 -msgid "Building restore tree..." +#: src/wx-console/wxbmainframe.cpp:443 +msgid "This configuration file has been successfully read, use it as default?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:622 -msgid "Error while starting restore: " +#: src/wx-console/wxbmainframe.cpp:444 +msgid "Configuration file read successfully" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:712 -msgid "" -"Right click on a file or on a directory, or double-click on its mark to add " -"it to the restore list." +#: src/wx-console/wxbmainframe.cpp:454 +#, c-format +msgid "Using this configuration file: %s\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:729 -msgid " files selected to be restored." +#: src/wx-console/wxbmainframe.cpp:459 +msgid "Connecting to the director..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:734 -msgid " file selected to be restored." +#: src/wx-console/wxbmainframe.cpp:474 +msgid "Failed to unregister a data parser !" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:741 -#, c-format -msgid "Please configure your restore (%ld files selected to be restored)..." +#: src/wx-console/wxbmainframe.cpp:482 +msgid "Quitting.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:751 -msgid "Restore failed : no file selected.\n" +#: src/wx-console/wxbmainframe.cpp:497 +msgid "" +"Welcome to Bacula wx-console.\n" +"Written by Nicolas Boichat \n" +"(C) 2005 Kern Sibbald\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:752 -msgid "Restore failed : no file selected." +#: src/wx-console/wxbmainframe.cpp:499 +msgid "About Bacula wx-console" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:762 -msgid "Restoring, please wait..." +#: src/wx-console/wxbmainframe.cpp:505 +msgid "Please choose your default configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:775 -msgid "Job started. JobId=" +#: src/wx-console/wxbmainframe.cpp:509 +msgid "Use this configuration file as default?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:777 -msgid "Restore started, jobid=" +#: src/wx-console/wxbmainframe.cpp:510 +msgid "Configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:781 -msgid "Job failed." +#: src/wx-console/wxbmainframe.cpp:581 +msgid "Console thread terminated." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:782 -msgid "Restore failed, please look at messages.\n" +#: src/wx-console/wxbmainframe.cpp:589 +msgid "Connection to the director lost. Quit program?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:783 -msgid "Restore failed, please look at messages in console." +#: src/wx-console/wxbmainframe.cpp:590 +msgid "Connection lost" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:789 -#: src/wx-console/wxbrestorepanel.cpp:790 -msgid "Failed to retrieve jobid.\n" +#: src/wx-console/wxbmainframe.cpp:606 +msgid "Connected to the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:816 -msgid "" -"Restore is scheduled in more than two minutes, wx-console will not wait for " -"its completion.\n" +#: src/wx-console/wxbmainframe.cpp:629 +msgid "Reconnect" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:817 -msgid "" -"Restore is scheduled in more than two minutes, wx-console will not wait for " -"its completion." +#: src/wx-console/wxbmainframe.cpp:630 +msgid "Reconnect to the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:841 -msgid "Restore job created, but not yet running." +#: src/wx-console/wxbmainframe.cpp:644 +msgid "Disconnected of the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:846 -#, c-format -msgid "Restore job running, please wait (%ld of %ld files restored)..." +#: src/wx-console/wxbmainframe.cpp:663 src/wx-console/wxbrestorepanel.cpp:689 +msgid "Unexpected question has been received.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:850 -msgid "Restore job terminated successfully." +#: src/wx-console/wxbmainframe.cpp:686 src/wx-console/wxbmainframe.cpp:703 +msgid "wx-console: unexpected director's question." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:851 -msgid "Restore job terminated successfully.\n" +#: src/wx-console/wxbrestorepanel.cpp:216 +#: src/wx-console/wxbrestorepanel.cpp:1895 +#: src/wx-console/wxbrestorepanel.cpp:1924 +msgid "Enter restore mode" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:856 -msgid "Restore job terminated in error, see messages in console." +#: src/wx-console/wxbrestorepanel.cpp:219 +msgid "Cancel restore" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:857 -msgid "Restore job terminated in error, see messages.\n" +#: src/wx-console/wxbrestorepanel.cpp:245 +#: src/wx-console/wxbrestorepanel.cpp:299 +msgid "Add" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:862 -msgid "Restore job reported a non-fatal error." +#: src/wx-console/wxbrestorepanel.cpp:247 +#: src/wx-console/wxbrestorepanel.cpp:301 +msgid "Remove" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:866 -msgid "Restore job reported a fatal error." +#: src/wx-console/wxbrestorepanel.cpp:249 +#: src/wx-console/wxbrestorepanel.cpp:303 +msgid "Refresh" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:871 -msgid "Restore job cancelled by user." +#: src/wx-console/wxbrestorepanel.cpp:268 +msgid "M" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:872 -msgid "Restore job cancelled by user.\n" +#: src/wx-console/wxbrestorepanel.cpp:272 +msgid "Filename" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:877 -msgid "Restore job is waiting on File daemon." +#: src/wx-console/wxbrestorepanel.cpp:284 +msgid "Perm." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:881 -msgid "Restore job is waiting for new media." +#: src/wx-console/wxbrestorepanel.cpp:317 +#: src/wx-console/wxbrestorepanel.cpp:330 +#: src/wx-console/wxbrestorepanel.cpp:482 +#: src/wx-console/wxbrestorepanel.cpp:492 +#: src/wx-console/wxbrestorepanel.cpp:495 +#: src/wx-console/wxbrestorepanel.cpp:1760 +#: src/wx-console/wxbrestorepanel.cpp:1846 +msgid "Job Name" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:885 -msgid "Restore job is waiting for storage resource." +#: src/wx-console/wxbrestorepanel.cpp:319 +#: src/wx-console/wxbrestorepanel.cpp:335 +#: src/wx-console/wxbrestorepanel.cpp:434 +#: src/wx-console/wxbrestorepanel.cpp:435 +#: src/wx-console/wxbrestorepanel.cpp:445 +#: src/wx-console/wxbrestorepanel.cpp:446 +#: src/wx-console/wxbrestorepanel.cpp:1118 +#: src/wx-console/wxbrestorepanel.cpp:1191 +#: src/wx-console/wxbrestorepanel.cpp:1798 +#: src/wx-console/wxbrestorepanel.cpp:1800 +#: src/wx-console/wxbrestorepanel.cpp:1861 +msgid "Fileset" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:889 -msgid "Restore job is waiting for job resource." +#: src/wx-console/wxbrestorepanel.cpp:322 +#: src/wx-console/wxbrestorepanel.cpp:1185 +#: src/wx-console/wxbrestorepanel.cpp:1201 +#: src/wx-console/wxbrestorepanel.cpp:1203 +#: src/wx-console/wxbrestorepanel.cpp:1211 +#: src/wx-console/wxbrestorepanel.cpp:1213 +#: src/wx-console/wxbrestorepanel.cpp:1232 +#: src/wx-console/wxbrestorepanel.cpp:1239 +#: src/wx-console/wxbrestorepanel.cpp:1788 +#: src/wx-console/wxbrestorepanel.cpp:1799 +#: src/wx-console/wxbrestorepanel.cpp:1919 +msgid "Before" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:893 -msgid "Restore job is waiting for Client resource." +#: src/wx-console/wxbrestorepanel.cpp:324 +msgid "Please configure parameters concerning files to restore :" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:897 -msgid "Restore job is waiting for maximum jobs." +#: src/wx-console/wxbrestorepanel.cpp:333 +#: src/wx-console/wxbrestorepanel.cpp:1854 +msgid "always" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:901 -msgid "Restore job is waiting for start time." +#: src/wx-console/wxbrestorepanel.cpp:333 +msgid "if newer" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:905 -msgid "Restore job is waiting for higher priority jobs to finish." +#: src/wx-console/wxbrestorepanel.cpp:333 +msgid "if older" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:954 -msgid "" -"The restore job has not been started within one minute, wx-console will not " -"wait for its completion anymore.\n" +#: src/wx-console/wxbrestorepanel.cpp:333 +#: src/wx-console/wxbrestorepanel.cpp:1857 +msgid "never" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:955 -msgid "" -"The restore job has not been started within one minute, wx-console will not " -"wait for its completion anymore." +#: src/wx-console/wxbrestorepanel.cpp:341 +msgid "Please configure parameters concerning files restoration :" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:965 -msgid "Restore done successfully.\n" +#: src/wx-console/wxbrestorepanel.cpp:406 +msgid "Getting parameters list." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:966 -msgid "Restore done successfully." +#: src/wx-console/wxbrestorepanel.cpp:414 +msgid "Error : no clients returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1037 -msgid "Applying restore configuration changes..." +#: src/wx-console/wxbrestorepanel.cpp:438 +msgid "Error : no filesets returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1088 -msgid "Failed to find the selected client." +#: src/wx-console/wxbrestorepanel.cpp:462 +msgid "Error : no storage returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1103 -msgid "Failed to find the selected fileset." +#: src/wx-console/wxbrestorepanel.cpp:485 +#: src/wx-console/wxbrestorepanel.cpp:509 +msgid "Error : no jobs returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1118 -msgid "Failed to find the selected storage." +#: src/wx-console/wxbrestorepanel.cpp:495 +msgid "RestoreFiles" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1135 -#: src/wx-console/wxbrestorepanel.cpp:1801 -msgid "Run Restore job" +#: src/wx-console/wxbrestorepanel.cpp:530 +msgid "Please configure your restore parameters." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1151 -msgid "Restore configuration changes were applied." +#: src/wx-console/wxbrestorepanel.cpp:541 +msgid "Building restore tree..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1160 -msgid "Restore cancelled.\n" +#: src/wx-console/wxbrestorepanel.cpp:584 +msgid "Error while starting restore: " msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1161 -msgid "Restore cancelled." +#: src/wx-console/wxbrestorepanel.cpp:674 +msgid "" +"Right click on a file or on a directory, or double-click on its mark to add " +"it to the restore list." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1182 -msgid "No results to list." +#: src/wx-console/wxbrestorepanel.cpp:711 +#: src/wx-console/wxbrestorepanel.cpp:733 +msgid "wx-console: unexpected restore question." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1184 -msgid "No backup found for this client." +#: src/wx-console/wxbrestorepanel.cpp:744 +msgid " files selected to be restored." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1191 -msgid "ERROR" +#: src/wx-console/wxbrestorepanel.cpp:749 +msgid " file selected to be restored." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1192 -msgid "Query failed" +#: src/wx-console/wxbrestorepanel.cpp:756 +#, c-format +msgid "Please configure your restore (%ld files selected to be restored)..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1194 -msgid "Cannot get previous backups list, see console." +#: src/wx-console/wxbrestorepanel.cpp:766 +msgid "Restore failed : no file selected.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1811 -msgid "JobName:" +#: src/wx-console/wxbrestorepanel.cpp:767 +msgid "Restore failed : no file selected." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1815 -msgid "Where:" +#: src/wx-console/wxbrestorepanel.cpp:777 +msgid "Restoring, please wait..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1818 -msgid "Replace:" +#: src/wx-console/wxbrestorepanel.cpp:790 +msgid "Job started. JobId=" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1821 -msgid "ifnewer" +#: src/wx-console/wxbrestorepanel.cpp:792 +msgid "Restore started, jobid=" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1822 -msgid "ifolder" +#: src/wx-console/wxbrestorepanel.cpp:796 +msgid "Job failed." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1826 -msgid "FileSet:" +#: src/wx-console/wxbrestorepanel.cpp:797 +msgid "Restore failed, please look at messages.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1942 -msgid "Restoring..." +#: src/wx-console/wxbrestorepanel.cpp:798 +msgid "Restore failed, please look at messages in console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:227 -msgid "&About...\tF1" +#: src/wx-console/wxbrestorepanel.cpp:804 +#: src/wx-console/wxbrestorepanel.cpp:805 +msgid "Failed to retrieve jobid.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:227 -msgid "Show about dialog" +#: src/wx-console/wxbrestorepanel.cpp:831 +msgid "" +"Restore is scheduled in more than two minutes, wx-console will not wait for " +"its completion.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:229 src/wx-console/wxbmainframe.cpp:591 -msgid "Connect to the director" +#: src/wx-console/wxbrestorepanel.cpp:832 +msgid "" +"Restore is scheduled in more than two minutes, wx-console will not wait for " +"its completion." msgstr "" -#: src/wx-console/wxbmainframe.cpp:230 -msgid "Disconnect" +#: src/wx-console/wxbrestorepanel.cpp:858 +msgid "Restore job created, but not yet running." msgstr "" -#: src/wx-console/wxbmainframe.cpp:230 -msgid "Disconnect of the director" +#: src/wx-console/wxbrestorepanel.cpp:863 +#, c-format +msgid "Restore job running, please wait (%ld of %ld files restored)..." msgstr "" -#: src/wx-console/wxbmainframe.cpp:232 -msgid "Change of configuration file" +#: src/wx-console/wxbrestorepanel.cpp:867 +msgid "Restore job terminated successfully." msgstr "" -#: src/wx-console/wxbmainframe.cpp:232 -msgid "Change your default configuration file" +#: src/wx-console/wxbrestorepanel.cpp:868 +msgid "Restore job terminated successfully.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:233 -msgid "Edit your configuration file" +#: src/wx-console/wxbrestorepanel.cpp:873 +msgid "Restore job terminated in error, see messages in console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:235 -msgid "E&xit\tAlt-X" +#: src/wx-console/wxbrestorepanel.cpp:874 +msgid "Restore job terminated in error, see messages.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:235 -msgid "Quit this program" +#: src/wx-console/wxbrestorepanel.cpp:879 +msgid "Restore job reported a non-fatal error." msgstr "" -#: src/wx-console/wxbmainframe.cpp:239 -msgid "&File" +#: src/wx-console/wxbrestorepanel.cpp:883 +msgid "Restore job reported a fatal error." msgstr "" -#: src/wx-console/wxbmainframe.cpp:240 -msgid "&Help" +#: src/wx-console/wxbrestorepanel.cpp:888 +msgid "Restore job cancelled by user." msgstr "" -#: src/wx-console/wxbmainframe.cpp:257 -msgid "Console" +#: src/wx-console/wxbrestorepanel.cpp:889 +msgid "Restore job cancelled by user.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:264 -msgid "" -"Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n" +#: src/wx-console/wxbrestorepanel.cpp:894 +msgid "Restore job is waiting on File daemon." msgstr "" -#: src/wx-console/wxbmainframe.cpp:268 -msgid "" -"Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode " -"support when handling non-ASCII filenames: Every non-ASCII character in such " -"filenames will be replaced by an interrogation mark.\n" -"If this behaviour disturbs you, please build wx-console against a Unicode " -"version of wxWidgets for GTK+ 2.0.\n" -"---\n" +#: src/wx-console/wxbrestorepanel.cpp:898 +msgid "Restore job is waiting for new media." msgstr "" -#: src/wx-console/wxbmainframe.cpp:279 -msgid "Send" +#: src/wx-console/wxbrestorepanel.cpp:902 +msgid "Restore job is waiting for storage resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:356 src/wx-console/wxbmainframe.cpp:368 -msgid "Error while parsing command line arguments, using defaults.\n" +#: src/wx-console/wxbrestorepanel.cpp:906 +msgid "Restore job is waiting for job resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:357 src/wx-console/wxbmainframe.cpp:369 -msgid "Usage: wx-console [-c configfile] [-w tmp]\n" +#: src/wx-console/wxbrestorepanel.cpp:910 +msgid "Restore job is waiting for Client resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:397 -#, c-format -msgid "" -"It seems that it is the first time you run wx-console.\n" -"This file (%s) has been choosen as default configuration file.\n" -"Do you want to edit it? (if you click No you will have to select another " -"file)" +#: src/wx-console/wxbrestorepanel.cpp:914 +msgid "Restore job is waiting for maximum jobs." msgstr "" -#: src/wx-console/wxbmainframe.cpp:401 -msgid "First run" +#: src/wx-console/wxbrestorepanel.cpp:918 +msgid "Restore job is waiting for start time." msgstr "" -#: src/wx-console/wxbmainframe.cpp:418 -#, c-format +#: src/wx-console/wxbrestorepanel.cpp:922 +msgid "Restore job is waiting for higher priority jobs to finish." +msgstr "" + +#: src/wx-console/wxbrestorepanel.cpp:971 msgid "" -"Unable to read %s\n" -"Error: %s\n" -"Do you want to choose another one? (Press no to edit this file)" +"The restore job has not been started within one minute, wx-console will not " +"wait for its completion anymore.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:422 -msgid "Unable to read configuration file" +#: src/wx-console/wxbrestorepanel.cpp:972 +msgid "" +"The restore job has not been started within one minute, wx-console will not " +"wait for its completion anymore." msgstr "" -#: src/wx-console/wxbmainframe.cpp:434 -msgid "Please choose a configuration file to use" +#: src/wx-console/wxbrestorepanel.cpp:982 +msgid "Restore done successfully.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:447 -msgid "This configuration file has been successfully read, use it as default?" +#: src/wx-console/wxbrestorepanel.cpp:983 +msgid "Restore done successfully." msgstr "" -#: src/wx-console/wxbmainframe.cpp:448 -msgid "Configuration file read successfully" +#: src/wx-console/wxbrestorepanel.cpp:1054 +msgid "Applying restore configuration changes..." msgstr "" -#: src/wx-console/wxbmainframe.cpp:458 -#, c-format -msgid "Using this configuration file: %s\n" +#: src/wx-console/wxbrestorepanel.cpp:1105 +msgid "Failed to find the selected client." msgstr "" -#: src/wx-console/wxbmainframe.cpp:463 -msgid "Connecting to the director..." +#: src/wx-console/wxbrestorepanel.cpp:1120 +msgid "Failed to find the selected fileset." msgstr "" -#: src/wx-console/wxbmainframe.cpp:478 -msgid "Failed to unregister a data parser !" +#: src/wx-console/wxbrestorepanel.cpp:1135 +msgid "Failed to find the selected storage." msgstr "" -#: src/wx-console/wxbmainframe.cpp:486 -msgid "Quitting.\n" +#: src/wx-console/wxbrestorepanel.cpp:1152 +#: src/wx-console/wxbrestorepanel.cpp:1835 +msgid "Run Restore job" msgstr "" -#: src/wx-console/wxbmainframe.cpp:501 -msgid "" -"Welcome to Bacula wx-console.\n" -"Written by Nicolas Boichat \n" -"(C) 2005 Kern Sibbald\n" +#: src/wx-console/wxbrestorepanel.cpp:1168 +msgid "Restore configuration changes were applied." msgstr "" -#: src/wx-console/wxbmainframe.cpp:503 -msgid "About Bacula wx-console" +#: src/wx-console/wxbrestorepanel.cpp:1177 +msgid "Restore cancelled.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:509 -msgid "Please choose your default configuration file" +#: src/wx-console/wxbrestorepanel.cpp:1178 +msgid "Restore cancelled." msgstr "" -#: src/wx-console/wxbmainframe.cpp:513 -msgid "Use this configuration file as default?" +#: src/wx-console/wxbrestorepanel.cpp:1200 +msgid "No results to list." msgstr "" -#: src/wx-console/wxbmainframe.cpp:514 -msgid "Configuration file" +#: src/wx-console/wxbrestorepanel.cpp:1202 +msgid "No backup found for this client." msgstr "" -#: src/wx-console/wxbmainframe.cpp:578 -msgid "Console thread terminated." +#: src/wx-console/wxbrestorepanel.cpp:1209 +msgid "ERROR" msgstr "" -#: src/wx-console/wxbmainframe.cpp:582 -msgid "Connection to the director lost. Quit program?" +#: src/wx-console/wxbrestorepanel.cpp:1210 +msgid "Query failed" msgstr "" -#: src/wx-console/wxbmainframe.cpp:583 -msgid "Connection lost" +#: src/wx-console/wxbrestorepanel.cpp:1212 +msgid "Cannot get previous backups list, see console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:599 -msgid "Connected to the director." +#: src/wx-console/wxbrestorepanel.cpp:1845 +msgid "JobName:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:613 -msgid "Reconnect" +#: src/wx-console/wxbrestorepanel.cpp:1849 +msgid "Where:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:614 -msgid "Reconnect to the director" +#: src/wx-console/wxbrestorepanel.cpp:1852 +msgid "Replace:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:624 -msgid "Disconnected of the director." +#: src/wx-console/wxbrestorepanel.cpp:1855 +msgid "ifnewer" msgstr "" -#: src/wx-console/wxbmainframe.cpp:643 -msgid "Unexpected question has been received.\n" +#: src/wx-console/wxbrestorepanel.cpp:1856 +msgid "ifolder" msgstr "" -#: src/wx-console/wxbmainframe.cpp:666 src/wx-console/wxbmainframe.cpp:681 -msgid "wx-console: unexpected director's question." +#: src/wx-console/wxbrestorepanel.cpp:1860 +msgid "FileSet:" +msgstr "" + +#: src/wx-console/wxbrestorepanel.cpp:1976 +msgid "Restoring..." msgstr "" diff --git a/bacula/po/it.gmo b/bacula/po/it.gmo index 75ad58929d..3de904db93 100644 Binary files a/bacula/po/it.gmo and b/bacula/po/it.gmo differ diff --git a/bacula/po/it.po b/bacula/po/it.po index 08d79e305f..cc9c25649d 100644 --- a/bacula/po/it.po +++ b/bacula/po/it.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: Bacula 1.38\n" "Report-Msgid-Bugs-To: bacula-devel@lists.sourceforge.net\n" -"POT-Creation-Date: 2005-08-19 11:20+0200\n" +"POT-Creation-Date: 2006-02-26 13:10+0100\n" "PO-Revision-Date: 2005-08-08 17:50+0200\n" "Last-Translator: \n" "Language-Team: Italian \n" @@ -16,35 +16,35 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: src/cats/bdb.c:135 +#: src/cats/bdb.c:128 msgid "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" msgstr "" -#: src/cats/bdb.c:136 +#: src/cats/bdb.c:129 msgid "WARNING!!!! The Internal Database is NOT OPERATIONAL!\n" msgstr "" -#: src/cats/bdb.c:137 +#: src/cats/bdb.c:130 msgid "You should use SQLite, PostgreSQL, or MySQL\n" msgstr "" -#: src/cats/bdb.c:159 src/cats/mysql.c:130 src/cats/postgresql.c:128 +#: src/cats/bdb.c:152 src/cats/mysql.c:124 src/cats/postgresql.c:128 #: src/cats/sqlite.c:122 #, c-format msgid "Unable to initialize DB lock. ERR=%s\n" msgstr "" -#: src/cats/bdb.c:169 +#: src/cats/bdb.c:162 #, c-format msgid "Unable to open Catalog DB control file %s: ERR=%s\n" msgstr "" -#: src/cats/bdb.c:224 +#: src/cats/bdb.c:217 #, c-format msgid "Error reading catalog DB control file. ERR=%s\n" msgstr "" -#: src/cats/bdb.c:227 +#: src/cats/bdb.c:220 #, c-format msgid "" "Error, catalog DB control file wrong version. Wanted %d, got %d\n" @@ -61,11 +61,11 @@ msgstr "" msgid "Error updating DB Media file. ERR=%s\n" msgstr "" -#: src/cats/mysql.c:66 +#: src/cats/mysql.c:60 msgid "A user name for MySQL must be supplied.\n" msgstr "" -#: src/cats/mysql.c:167 +#: src/cats/mysql.c:161 #, c-format msgid "" "Unable to connect to MySQL server. \n" @@ -73,7 +73,7 @@ msgid "" "It is probably not running or your password is incorrect.\n" msgstr "" -#: src/cats/mysql.c:326 src/cats/postgresql.c:264 src/cats/sqlite.c:323 +#: src/cats/mysql.c:320 src/cats/postgresql.c:264 src/cats/sqlite.c:323 #, c-format msgid "Query failed: %s: ERR=%s\n" msgstr "" @@ -133,15 +133,15 @@ msgid "" "%s\n" msgstr "" -#: src/cats/sql.c:209 src/cats/sql.c:216 src/cats/sql_create.c:772 -#: src/cats/sql_get.c:180 src/cats/sql_get.c:231 src/cats/sql_get.c:563 -#: src/cats/sql_get.c:638 src/cats/sql_get.c:865 +#: src/cats/sql.c:209 src/cats/sql.c:216 src/cats/sql_create.c:773 +#: src/cats/sql_get.c:180 src/cats/sql_get.c:231 src/cats/sql_get.c:564 +#: src/cats/sql_get.c:639 src/cats/sql_get.c:866 #, c-format msgid "error fetching row: %s\n" msgstr "" -#: src/cats/sql.c:326 src/dird/catreq.c:360 src/dird/catreq.c:392 -#: src/dird/catreq.c:417 +#: src/cats/sql.c:326 src/dird/catreq.c:369 src/dird/catreq.c:401 +#: src/dird/catreq.c:426 #, c-format msgid "Attribute create error. %s" msgstr "" @@ -160,215 +160,141 @@ msgstr "" msgid "Create DB Job record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:91 src/dird/dird_conf.c:532 src/dird/ua_cmds.c:422 -#: src/dird/ua_prune.c:454 src/dird/ua_run.c:643 src/dird/ua_select.c:228 -#: src/dird/ua_select.c:249 -msgid "Job" -msgstr "" - -#: src/cats/sql_create.c:131 +#: src/cats/sql_create.c:132 #, c-format msgid "Create JobMedia record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:140 +#: src/cats/sql_create.c:141 #, c-format msgid "Update Media record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:170 +#: src/cats/sql_create.c:171 #, c-format msgid "pool record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:196 +#: src/cats/sql_create.c:197 #, c-format msgid "Create db Pool record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:201 src/dird/ua_run.c:650 src/dird/ua_select.c:464 -#: src/dird/ua_select.c:554 src/dird/ua_update.c:356 src/dird/ua_update.c:426 -#: src/wx-console/wxbrestorepanel.cpp:362 -#: src/wx-console/wxbrestorepanel.cpp:548 -#: src/wx-console/wxbrestorepanel.cpp:558 -#: src/wx-console/wxbrestorepanel.cpp:1754 -msgid "Pool" -msgstr "" - -#: src/cats/sql_create.c:227 +#: src/cats/sql_create.c:228 #, c-format msgid "Device record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:243 +#: src/cats/sql_create.c:244 #, c-format msgid "Create db Device record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:248 -msgid "Device" -msgstr "" - -#: src/cats/sql_create.c:276 +#: src/cats/sql_create.c:277 #, c-format msgid "More than one Storage record!: %d\n" msgstr "" -#: src/cats/sql_create.c:281 +#: src/cats/sql_create.c:282 #, c-format msgid "error fetching Storage row: %s\n" msgstr "" -#: src/cats/sql_create.c:301 +#: src/cats/sql_create.c:302 #, c-format msgid "Create DB Storage record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:306 src/dird/ua_run.c:642 src/dird/ua_select.c:152 -#: src/wx-console/wxbrestorepanel.cpp:363 -#: src/wx-console/wxbrestorepanel.cpp:379 -#: src/wx-console/wxbrestorepanel.cpp:500 -#: src/wx-console/wxbrestorepanel.cpp:501 -#: src/wx-console/wxbrestorepanel.cpp:511 -#: src/wx-console/wxbrestorepanel.cpp:512 -#: src/wx-console/wxbrestorepanel.cpp:1116 -#: src/wx-console/wxbrestorepanel.cpp:1765 -#: src/wx-console/wxbrestorepanel.cpp:1831 -msgid "Storage" -msgstr "" - -#: src/cats/sql_create.c:333 +#: src/cats/sql_create.c:334 #, c-format msgid "mediatype record %s already exists\n" msgstr "" -#: src/cats/sql_create.c:349 +#: src/cats/sql_create.c:350 #, c-format msgid "Create db mediatype record %s failed: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:354 -msgid "MediaType" -msgstr "" - -#: src/cats/sql_create.c:383 +#: src/cats/sql_create.c:384 #, c-format msgid "Volume \"%s\" already exists.\n" msgstr "" -#: src/cats/sql_create.c:421 +#: src/cats/sql_create.c:422 #, c-format msgid "Create DB Media record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:425 -msgid "Media" -msgstr "" - -#: src/cats/sql_create.c:469 +#: src/cats/sql_create.c:470 #, c-format msgid "More than one Client!: %d\n" msgstr "" -#: src/cats/sql_create.c:474 +#: src/cats/sql_create.c:475 #, c-format msgid "error fetching Client row: %s\n" msgstr "" -#: src/cats/sql_create.c:501 +#: src/cats/sql_create.c:502 #, c-format msgid "Create DB Client record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:507 src/dird/ua_run.c:645 src/dird/ua_select.c:272 -#: src/dird/ua_select.c:379 src/wx-console/wxbrestorepanel.cpp:360 -#: src/wx-console/wxbrestorepanel.cpp:378 -#: src/wx-console/wxbrestorepanel.cpp:452 -#: src/wx-console/wxbrestorepanel.cpp:453 -#: src/wx-console/wxbrestorepanel.cpp:463 -#: src/wx-console/wxbrestorepanel.cpp:464 -#: src/wx-console/wxbrestorepanel.cpp:707 -#: src/wx-console/wxbrestorepanel.cpp:1086 -#: src/wx-console/wxbrestorepanel.cpp:1173 -#: src/wx-console/wxbrestorepanel.cpp:1758 -#: src/wx-console/wxbrestorepanel.cpp:1760 -#: src/wx-console/wxbrestorepanel.cpp:1829 -#: src/wx-console/wxbrestorepanel.cpp:1884 -msgid "Client" -msgstr "" - -#: src/cats/sql_create.c:544 +#: src/cats/sql_create.c:545 #, c-format msgid "Create DB Counters record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:577 +#: src/cats/sql_create.c:578 #, c-format msgid "More than one FileSet!: %d\n" msgstr "" -#: src/cats/sql_create.c:582 +#: src/cats/sql_create.c:583 #, c-format msgid "error fetching FileSet row: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:612 +#: src/cats/sql_create.c:613 #, c-format msgid "Create DB FileSet record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:618 src/dird/ua_restore.c:1035 src/dird/ua_run.c:644 -#: src/dird/ua_select.c:173 -msgid "FileSet" -msgstr "" - -#: src/cats/sql_create.c:669 +#: src/cats/sql_create.c:670 #, c-format msgid "Attempt to put non-attributes into catalog. Stream=%d\n" msgstr "" -#: src/cats/sql_create.c:732 +#: src/cats/sql_create.c:733 #, c-format msgid "Create db File record %s failed. ERR=%s" msgstr "" -#: src/cats/sql_create.c:738 src/gnome2-console/restore.c:121 -msgid "File" -msgstr "" - -#: src/cats/sql_create.c:765 src/cats/sql_get.c:224 +#: src/cats/sql_create.c:766 src/cats/sql_get.c:224 #, c-format msgid "More than one Path!: %s for path: %s\n" msgstr "" -#: src/cats/sql_create.c:796 +#: src/cats/sql_create.c:797 #, c-format msgid "Create db Path record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:802 -msgid "Path" -msgstr "" - -#: src/cats/sql_create.c:829 +#: src/cats/sql_create.c:830 #, c-format msgid "More than one Filename! %s for file: %s\n" msgstr "" -#: src/cats/sql_create.c:835 +#: src/cats/sql_create.c:836 #, c-format msgid "Error fetching row for file=%s: ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:851 +#: src/cats/sql_create.c:852 #, c-format msgid "Create db Filename record %s failed. ERR=%s\n" msgstr "" -#: src/cats/sql_create.c:856 src/wx-console/wxbrestorepanel.cpp:314 -msgid "Filename" -msgstr "" - #: src/cats/sql_delete.c:79 #, c-format msgid "No pool record %s exists\n" @@ -407,27 +333,27 @@ msgid "" "CMD=%s\n" msgstr "" -#: src/cats/sql_find.c:222 +#: src/cats/sql_find.c:224 #, c-format -msgid "Unknown Job level=%c\n" +msgid "Unknown Job level=%d\n" msgstr "" -#: src/cats/sql_find.c:232 +#: src/cats/sql_find.c:234 #, c-format msgid "No Job found for: %s.\n" msgstr "" -#: src/cats/sql_find.c:243 +#: src/cats/sql_find.c:245 #, c-format msgid "No Job found for: %s\n" msgstr "" -#: src/cats/sql_find.c:312 +#: src/cats/sql_find.c:317 #, c-format msgid "Request for Volume item %d greater than max %d\n" msgstr "" -#: src/cats/sql_find.c:324 +#: src/cats/sql_find.c:329 #, c-format msgid "No Volume record found for item %d.\n" msgstr "" @@ -491,104 +417,104 @@ msgstr "" msgid "No Job found for JobId %s\n" msgstr "" -#: src/cats/sql_get.c:343 src/cats/sql_get.c:398 +#: src/cats/sql_get.c:344 src/cats/sql_get.c:399 #, c-format msgid "No volumes found for JobId=%d\n" msgstr "" -#: src/cats/sql_get.c:349 src/cats/sql_get.c:407 +#: src/cats/sql_get.c:350 src/cats/sql_get.c:408 #, c-format msgid "Error fetching row %d: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:363 +#: src/cats/sql_get.c:364 #, c-format msgid "No Volume for JobId %d found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:479 +#: src/cats/sql_get.c:480 #, c-format msgid "Pool id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:516 +#: src/cats/sql_get.c:517 #, c-format msgid "Client id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:558 +#: src/cats/sql_get.c:559 #, c-format msgid "More than one Pool!: %s\n" msgstr "" -#: src/cats/sql_get.c:599 +#: src/cats/sql_get.c:600 msgid "Pool record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:633 +#: src/cats/sql_get.c:634 #, c-format msgid "More than one Client!: %s\n" msgstr "" -#: src/cats/sql_get.c:650 src/cats/sql_get.c:654 +#: src/cats/sql_get.c:651 src/cats/sql_get.c:655 msgid "Client record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:679 +#: src/cats/sql_get.c:680 #, c-format msgid "More than one Counter!: %d\n" msgstr "" -#: src/cats/sql_get.c:684 +#: src/cats/sql_get.c:685 #, c-format msgid "error fetching Counter row: %s\n" msgstr "" -#: src/cats/sql_get.c:704 +#: src/cats/sql_get.c:705 #, c-format msgid "Counter record: %s not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:740 +#: src/cats/sql_get.c:741 #, c-format msgid "Error got %s FileSets but expected only one!\n" msgstr "" -#: src/cats/sql_get.c:745 +#: src/cats/sql_get.c:746 #, c-format msgid "FileSet record \"%s\" not found.\n" msgstr "" -#: src/cats/sql_get.c:755 +#: src/cats/sql_get.c:756 msgid "FileSet record not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:812 +#: src/cats/sql_get.c:813 #, c-format msgid "Media id select failed: ERR=%s\n" msgstr "" -#: src/cats/sql_get.c:860 +#: src/cats/sql_get.c:861 #, c-format msgid "More than one Volume!: %s\n" msgstr "" -#: src/cats/sql_get.c:905 +#: src/cats/sql_get.c:906 #, c-format msgid "Media record MediaId=%s not found.\n" msgstr "" -#: src/cats/sql_get.c:908 +#: src/cats/sql_get.c:909 #, c-format msgid "Media record for Volume \"%s\" not found.\n" msgstr "" -#: src/cats/sql_get.c:915 +#: src/cats/sql_get.c:916 #, c-format msgid "Media record for MediaId=%u not found in Catalog.\n" msgstr "" -#: src/cats/sql_get.c:918 +#: src/cats/sql_get.c:919 #, c-format msgid "Media record for Vol=%s not found in Catalog.\n" msgstr "" @@ -608,7 +534,7 @@ msgstr "" msgid "Unable to open Database=%s. ERR=%s\n" msgstr "" -#: src/cats/sqlite.c:162 src/lib/bnet_server.c:372 +#: src/cats/sqlite.c:162 src/lib/bnet_server.c:371 msgid "unknown" msgstr "" @@ -627,38 +553,38 @@ msgstr "" msgid "next_index update error: ERR=%s\n" msgstr "" -#: src/console/authenticate.c:104 src/dird/authenticate.c:106 -#: src/dird/authenticate.c:206 src/filed/authenticate.c:124 -#: src/filed/authenticate.c:220 src/stored/authenticate.c:128 -#: src/stored/authenticate.c:232 src/wx-console/authenticate.c:101 +#: src/console/authenticate.c:100 src/dird/authenticate.c:106 +#: src/dird/authenticate.c:206 src/filed/authenticate.c:119 +#: src/filed/authenticate.c:215 src/stored/authenticate.c:128 +#: src/stored/authenticate.c:232 src/wx-console/authenticate.c:106 msgid "" "Authorization problem: Remote server did not advertise required TLS " "support.\n" msgstr "" -#: src/console/authenticate.c:111 src/dird/authenticate.c:113 -#: src/dird/authenticate.c:213 src/filed/authenticate.c:132 -#: src/filed/authenticate.c:228 src/stored/authenticate.c:136 -#: src/stored/authenticate.c:240 src/wx-console/authenticate.c:108 +#: src/console/authenticate.c:107 src/dird/authenticate.c:113 +#: src/dird/authenticate.c:213 src/filed/authenticate.c:127 +#: src/filed/authenticate.c:223 src/stored/authenticate.c:136 +#: src/stored/authenticate.c:240 src/wx-console/authenticate.c:112 msgid "Authorization problem: Remote server requires TLS.\n" msgstr "" -#: src/console/authenticate.c:121 src/wx-console/authenticate.c:118 +#: src/console/authenticate.c:117 src/wx-console/authenticate.c:121 msgid "TLS negotiation failed\n" msgstr "" -#: src/console/authenticate.c:133 src/gnome2-console/authenticate.c:85 +#: src/console/authenticate.c:129 src/gnome2-console/authenticate.c:85 #: src/tray-monitor/authenticate.c:87 #, c-format msgid "Bad response to Hello command: ERR=%s\n" msgstr "" -#: src/console/authenticate.c:140 src/gnome2-console/authenticate.c:95 -#: src/tray-monitor/authenticate.c:94 src/wx-console/authenticate.c:133 +#: src/console/authenticate.c:136 src/gnome2-console/authenticate.c:95 +#: src/tray-monitor/authenticate.c:94 src/wx-console/authenticate.c:136 msgid "Director rejected Hello command\n" msgstr "" -#: src/console/authenticate.c:150 src/wx-console/authenticate.c:143 +#: src/console/authenticate.c:146 src/wx-console/authenticate.c:146 msgid "" "Director authorization problem.\n" "Most likely the passwords do not agree.\n" @@ -703,7 +629,7 @@ msgstr "" msgid "output to file" msgstr "" -#: src/console/console.c:152 src/dird/ua_cmds.c:106 +#: src/console/console.c:152 src/dird/ua_cmds.c:110 msgid "quit" msgstr "" @@ -715,7 +641,7 @@ msgstr "" msgid "sleep specified time" msgstr "" -#: src/console/console.c:155 src/dird/ua_cmds.c:118 +#: src/console/console.c:155 src/dird/ua_cmds.c:122 msgid "print current time" msgstr "" @@ -723,7 +649,7 @@ msgstr "" msgid "print Console's version" msgstr "" -#: src/console/console.c:157 src/dird/ua_cmds.c:95 +#: src/console/console.c:157 src/dird/ua_cmds.c:99 msgid "exit = quit" msgstr "" @@ -731,13 +657,12 @@ msgstr "" msgid "zed_keys = use zed keys instead of bash keys" msgstr "" -#: src/console/console.c:191 src/dird/ua_dotcmds.c:106 +#: src/console/console.c:191 src/dird/ua_dotcmds.c:108 msgid ": is an illegal command\n" msgstr "" -#: src/console/console.c:400 src/dird/dird.c:196 src/filed/filed.c:183 -#: src/gnome2-console/console.c:271 src/stored/stored.c:189 -#: src/wx-console/console_thread.cpp:233 +#: src/console/console.c:400 src/filed/filed.c:183 +#: src/gnome2-console/console.c:271 msgid "TLS library initialization failed.\n" msgstr "" @@ -771,14 +696,14 @@ msgstr "" msgid "Connecting to Director %s:%d\n" msgstr "" -#: src/console/console.c:471 src/gnome2-console/console.c:508 -#: src/wx-console/console_thread.cpp:367 +#: src/console/console.c:471 src/gnome2-console/console.c:504 +#: src/wx-console/console_thread.cpp:370 #, c-format msgid "Failed to initialize TLS context for Console \"%s\".\n" msgstr "" -#: src/console/console.c:492 src/gnome2-console/console.c:530 -#: src/wx-console/console_thread.cpp:388 +#: src/console/console.c:492 src/gnome2-console/console.c:526 +#: src/wx-console/console_thread.cpp:391 #, c-format msgid "Failed to initialize TLS context for Director \"%s\".\n" msgstr "" @@ -791,8 +716,8 @@ msgstr "" #: src/dird/dird.c:711 src/dird/dird.c:777 src/dird/dird.c:829 #: src/filed/filed.c:302 src/filed/filed.c:348 #: src/gnome2-console/console.c:140 src/gnome2-console/console.c:169 -#: src/stored/stored.c:310 src/wx-console/console_thread.cpp:96 -#: src/wx-console/console_thread.cpp:125 +#: src/stored/stored.c:309 src/wx-console/console_thread.cpp:94 +#: src/wx-console/console_thread.cpp:120 msgid "TLS required but not configured in Bacula.\n" msgstr "" @@ -840,18 +765,18 @@ msgid "Cannot open file %s for output. ERR=%s\n" msgstr "" #: src/console/console_conf.c:123 src/gnome2-console/console_conf.c:122 -#: src/wx-console/console_conf.c:124 +#: src/wx-console/console_conf.c:128 #, c-format msgid "No record for %d %s\n" msgstr "" -#: src/console/console_conf.c:132 src/wx-console/console_conf.c:133 +#: src/console/console_conf.c:132 src/wx-console/console_conf.c:137 #, c-format msgid "Console: name=%s rcfile=%s histfile=%s\n" msgstr "" #: src/console/console_conf.c:136 src/gnome2-console/console_conf.c:131 -#: src/wx-console/console_conf.c:137 +#: src/wx-console/console_conf.c:141 #, c-format msgid "Director: name=%s address=%s DIRport=%d\n" msgstr "" @@ -861,25 +786,25 @@ msgstr "" #: src/filed/filed_conf.c:268 src/filed/filed_conf.c:327 #: src/filed/filed_conf.c:357 src/gnome2-console/console_conf.c:142 #: src/gnome2-console/console_conf.c:220 src/gnome2-console/console_conf.c:268 -#: src/gnome2-console/console_conf.c:298 src/stored/stored_conf.c:467 -#: src/stored/stored_conf.c:555 src/stored/stored_conf.c:590 -#: src/wx-console/console_conf.c:141 src/wx-console/console_conf.c:216 -#: src/wx-console/console_conf.c:261 src/wx-console/console_conf.c:288 +#: src/gnome2-console/console_conf.c:298 src/stored/stored_conf.c:510 +#: src/stored/stored_conf.c:598 src/stored/stored_conf.c:633 +#: src/wx-console/console_conf.c:145 src/wx-console/console_conf.c:220 +#: src/wx-console/console_conf.c:265 src/wx-console/console_conf.c:292 #, c-format msgid "Unknown resource type %d\n" msgstr "" -#: src/console/console_conf.c:242 src/dird/dird_conf.c:1109 -#: src/dird/dird_conf.c:1124 src/filed/filed_conf.c:296 +#: src/console/console_conf.c:242 src/dird/dird_conf.c:1112 +#: src/dird/dird_conf.c:1127 src/filed/filed_conf.c:296 #: src/gnome2-console/console_conf.c:246 src/tray-monitor/tray_conf.c:262 -#: src/wx-console/console_conf.c:242 +#: src/wx-console/console_conf.c:246 #, c-format msgid "%s item is required in %s resource, but not found.\n" msgstr "" -#: src/console/console_conf.c:304 src/dird/dird_conf.c:1296 +#: src/console/console_conf.c:304 src/dird/dird_conf.c:1299 #: src/filed/filed_conf.c:374 src/gnome2-console/console_conf.c:314 -#: src/tray-monitor/tray_conf.c:341 src/wx-console/console_conf.c:304 +#: src/tray-monitor/tray_conf.c:341 src/wx-console/console_conf.c:308 #, c-format msgid "Attempt to define second %s resource named \"%s\" is not permitted.\n" msgstr "" @@ -889,7 +814,7 @@ msgstr "" msgid "Start Admin JobId %d, Job=%s\n" msgstr "" -#: src/dird/admin.c:82 src/dird/backup.c:339 src/dird/mac.c:228 +#: src/dird/admin.c:82 src/dird/backup.c:343 src/dird/mac.c:287 #, c-format msgid "Error getting job record for stats: %s" msgstr "" @@ -906,8 +831,8 @@ msgstr "" msgid "Admin Canceled" msgstr "" -#: src/dird/admin.c:102 src/dird/backup.c:451 src/dird/mac.c:330 -#: src/dird/restore.c:258 +#: src/dird/admin.c:102 src/dird/backup.c:455 src/dird/mac.c:389 +#: src/dird/restore.c:246 #, c-format msgid "Inappropriate term code: %c\n" msgstr "" @@ -940,7 +865,7 @@ msgstr "" #: src/dird/authenticate.c:95 msgid "" -"Unable to authenticate with Storage daemon. Possible causes:\n" +"Director unable to authenticate with Storage daemon. Possible causes:\n" "Passwords or names not the same or\n" "Maximum Concurrent Jobs exceeded on the SD or\n" "SD networking messed up (restart daemon).\n" @@ -949,8 +874,8 @@ msgid "" msgstr "" #: src/dird/authenticate.c:123 src/dird/authenticate.c:223 -#: src/dird/authenticate.c:356 src/filed/authenticate.c:141 -#: src/filed/authenticate.c:237 src/stored/authenticate.c:145 +#: src/dird/authenticate.c:356 src/filed/authenticate.c:136 +#: src/filed/authenticate.c:232 src/stored/authenticate.c:145 #: src/stored/authenticate.c:249 msgid "TLS negotiation failed.\n" msgstr "" @@ -1039,84 +964,84 @@ msgid "" "\n" msgstr "" -#: src/dird/backup.c:88 src/dird/backup.c:94 src/dird/mac.c:92 -#: src/dird/ua_output.c:609 +#: src/dird/backup.c:88 src/dird/backup.c:94 src/dird/mac.c:124 +#: src/dird/ua_output.c:611 #, c-format msgid "Pool %s not in database. %s" msgstr "" -#: src/dird/backup.c:92 src/dird/mac.c:96 src/dird/ua_output.c:617 +#: src/dird/backup.c:92 src/dird/mac.c:128 src/dird/ua_output.c:619 #, c-format msgid "Pool %s created in database.\n" msgstr "" -#: src/dird/backup.c:117 +#: src/dird/backup.c:120 msgid "Could not start clone job.\n" msgstr "" -#: src/dird/backup.c:119 +#: src/dird/backup.c:122 #, c-format msgid "Clone JobId %d started.\n" msgstr "" -#: src/dird/backup.c:144 +#: src/dird/backup.c:148 #, c-format -msgid "Start Backup JobId %u, Job=%s\n" +msgid "Start Backup JobId %s, Job=%s\n" msgstr "" -#: src/dird/backup.c:272 +#: src/dird/backup.c:276 #, c-format msgid "Unexpected Client Job message: %s\n" msgstr "" -#: src/dird/backup.c:280 +#: src/dird/backup.c:284 #, c-format msgid "Network error with FD during %s: ERR=%s\n" msgstr "" -#: src/dird/backup.c:296 +#: src/dird/backup.c:300 msgid "No Job status returned from FD.\n" msgstr "" -#: src/dird/backup.c:346 +#: src/dird/backup.c:350 #, c-format msgid "Error getting client record for stats: %s" msgstr "" -#: src/dird/backup.c:352 src/dird/mac.c:235 +#: src/dird/backup.c:356 src/dird/mac.c:294 #, c-format msgid "Error getting Media record for Volume \"%s\": ERR=%s" msgstr "" -#: src/dird/backup.c:380 src/dird/mac.c:263 +#: src/dird/backup.c:384 src/dird/mac.c:322 #, c-format msgid "Could not get Job Volume Parameters to update Bootstrap file. ERR=%s\n" msgstr "" -#: src/dird/backup.c:414 src/dird/mac.c:293 +#: src/dird/backup.c:418 src/dird/mac.c:352 #, c-format msgid "" "Could not open WriteBootstrap file:\n" "%s: ERR=%s\n" msgstr "" -#: src/dird/backup.c:424 src/dird/mac.c:303 +#: src/dird/backup.c:428 src/dird/mac.c:362 msgid "Backup OK -- with warnings" msgstr "" -#: src/dird/backup.c:426 src/dird/mac.c:305 src/stored/bscan.c:1054 +#: src/dird/backup.c:430 src/dird/mac.c:364 src/stored/bscan.c:1060 msgid "Backup OK" msgstr "" -#: src/dird/backup.c:431 src/dird/mac.c:310 src/stored/bscan.c:1058 +#: src/dird/backup.c:435 src/dird/mac.c:369 src/stored/bscan.c:1064 msgid "*** Backup Error ***" msgstr "" -#: src/dird/backup.c:441 src/dird/mac.c:320 src/stored/bscan.c:1061 +#: src/dird/backup.c:445 src/dird/mac.c:379 src/stored/bscan.c:1067 msgid "Backup Canceled" msgstr "" -#: src/dird/backup.c:491 +#: src/dird/backup.c:495 #, c-format msgid "" "Bacula %s (%s): %s\n" @@ -1159,29 +1084,29 @@ msgstr "" msgid "Unable to get Job Volume Parameters. ERR=%s\n" msgstr "" -#: src/dird/bsr.c:201 +#: src/dird/bsr.c:203 #, c-format msgid "Unable to create bootstrap file %s. ERR=%s\n" msgstr "" -#: src/dird/bsr.c:210 +#: src/dird/bsr.c:212 msgid "Error writing bsr file.\n" msgstr "" -#: src/dird/bsr.c:216 +#: src/dird/bsr.c:218 #, c-format msgid "Bootstrap records written to %s\n" msgstr "" -#: src/dird/bsr.c:220 +#: src/dird/bsr.c:222 msgid "The job will require the following Volumes:\n" msgstr "" -#: src/dird/bsr.c:235 +#: src/dird/bsr.c:254 msgid "No Volumes found to restore.\n" msgstr "" -#: src/dird/catreq.c:109 src/dird/catreq.c:298 +#: src/dird/catreq.c:109 src/dird/catreq.c:297 #, c-format msgid "1990 Invalid Catalog Request: %s" msgstr "" @@ -1191,72 +1116,87 @@ msgstr "" msgid "Invalid Catalog request; DB not open: %s" msgstr "" -#: src/dird/catreq.c:131 +#: src/dird/catreq.c:135 msgid "1901 No Media.\n" msgstr "" -#: src/dird/catreq.c:159 +#: src/dird/catreq.c:163 msgid "not in Pool" msgstr "" -#: src/dird/catreq.c:161 +#: src/dird/catreq.c:165 msgid "not correct MediaType" msgstr "" -#: src/dird/catreq.c:187 +#: src/dird/catreq.c:181 #, c-format msgid "1998 Volume \"%s\" status is %s, %s.\n" msgstr "" -#: src/dird/catreq.c:192 +#: src/dird/catreq.c:186 #, c-format msgid "1997 Volume \"%s\" not in catalog.\n" msgstr "" -#: src/dird/catreq.c:213 +#: src/dird/catreq.c:207 #, c-format msgid "Unable to get Media record for Volume %s: ERR=%s\n" msgstr "" -#: src/dird/catreq.c:215 +#: src/dird/catreq.c:209 #, c-format msgid "1991 Catalog Request for vol=%s failed: %s" msgstr "" -#: src/dird/catreq.c:235 +#: src/dird/catreq.c:229 #, c-format msgid "" "Volume Files at %u being set to %u for Volume \"%s\". This is incorrect.\n" msgstr "" -#: src/dird/catreq.c:238 src/dird/catreq.c:270 -msgid "1992 Update Media error\n" +#: src/dird/catreq.c:232 +#, c-format +msgid "1992 Update Media error. VolFiles=%u, CatFiles=%u\n" msgstr "" -#: src/dird/catreq.c:268 +#: src/dird/catreq.c:264 #, c-format msgid "Catalog error updating Media record. %s" msgstr "" -#: src/dird/catreq.c:287 +#: src/dird/catreq.c:266 +msgid "1993 Update Media error\n" +msgstr "" + +#: src/dird/catreq.c:286 #, c-format msgid "Catalog error creating JobMedia record. %s" msgstr "" -#: src/dird/catreq.c:289 +#: src/dird/catreq.c:288 msgid "1991 Update JobMedia error\n" msgstr "" -#: src/dird/catreq.c:299 +#: src/dird/catreq.c:298 #, c-format msgid "Invalid Catalog request: %s" msgstr "" -#: src/dird/catreq.c:398 +#: src/dird/catreq.c:332 +#, c-format +msgid "1991 Invalid Catalog Update: %s" +msgstr "" + +#: src/dird/catreq.c:333 +#, c-format +msgid "Invalid Catalog Update; DB not open: %s" +msgstr "" + +#: src/dird/catreq.c:407 msgid "Got MD5/SHA1 but not same File as attributes\n" msgstr "" -#: src/dird/catreq.c:422 +#: src/dird/catreq.c:431 #, c-format msgid "Catalog error updating MD5/SHA1. %s" msgstr "" @@ -1282,6 +1222,10 @@ msgid "" "\n" msgstr "" +#: src/dird/dird.c:196 src/stored/stored.c:189 +msgid "Cryptography library initialization failed.\n" +msgstr "" + #: src/dird/dird.c:396 msgid "Too many open reload requests. Request ignored.\n" msgstr "" @@ -1311,17 +1255,17 @@ msgstr "" msgid "Only one Director resource permitted in %s\n" msgstr "" -#: src/dird/dird.c:502 src/filed/filed.c:357 src/stored/stored.c:362 +#: src/dird/dird.c:502 src/filed/filed.c:357 src/stored/stored.c:361 #, c-format msgid "\"TLS Certificate\" file not defined for Director \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:508 src/filed/filed.c:363 src/stored/stored.c:368 +#: src/dird/dird.c:508 src/filed/filed.c:363 src/stored/stored.c:367 #, c-format msgid "\"TLS Key\" file not defined for Director \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:514 src/filed/filed.c:369 src/stored/stored.c:374 +#: src/dird/dird.c:514 src/filed/filed.c:369 src/stored/stored.c:373 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " @@ -1329,7 +1273,7 @@ msgid "" "using \"TLS Verify Peer\".\n" msgstr "" -#: src/dird/dird.c:533 src/filed/filed.c:388 src/stored/stored.c:393 +#: src/dird/dird.c:533 src/filed/filed.c:388 src/stored/stored.c:392 #, c-format msgid "Failed to initialize TLS context for Director \"%s\" in %s.\n" msgstr "" @@ -1353,8 +1297,8 @@ msgstr "" msgid "Too many items in Job resource\n" msgstr "" -#: src/dird/dird.c:672 src/dird/job.c:101 src/dird/ua_cmds.c:1425 -#: src/dird/ua_output.c:598 +#: src/dird/dird.c:672 src/dird/job.c:101 src/dird/ua_cmds.c:1480 +#: src/dird/ua_output.c:600 #, c-format msgid "Could not open database \"%s\".\n" msgstr "" @@ -1371,7 +1315,7 @@ msgid "" "Storage \"%s\" in %s.\n" msgstr "" -#: src/dird/dird.c:733 src/stored/stored.c:348 +#: src/dird/dird.c:733 src/stored/stored.c:347 #, c-format msgid "Failed to initialize TLS context for Storage \"%s\" in %s.\n" msgstr "" @@ -1406,55 +1350,55 @@ msgid "" "File daemon \"%s\" in %s.\n" msgstr "" -#: src/dird/dird_conf.c:441 src/tray-monitor/tray_conf.c:152 +#: src/dird/dird_conf.c:443 src/tray-monitor/tray_conf.c:152 #, c-format msgid "No %s resource defined\n" msgstr "" -#: src/dird/dird_conf.c:450 +#: src/dird/dird_conf.c:452 #, c-format msgid "Director: name=%s MaxJobs=%d FDtimeout=%s SDtimeout=%s\n" msgstr "" -#: src/dird/dird_conf.c:455 +#: src/dird/dird_conf.c:457 #, c-format msgid " query_file=%s\n" msgstr "" -#: src/dird/dird_conf.c:458 src/dird/dird_conf.c:483 src/dird/dird_conf.c:497 -#: src/dird/dird_conf.c:541 src/dird/dird_conf.c:545 src/dird/dird_conf.c:549 -#: src/dird/dird_conf.c:573 src/dird/dird_conf.c:578 src/dird/dird_conf.c:582 -#: src/dird/dird_conf.c:586 src/dird/dird_conf.c:590 src/dird/dird_conf.c:594 -#: src/dird/dird_conf.c:604 +#: src/dird/dird_conf.c:460 src/dird/dird_conf.c:485 src/dird/dird_conf.c:499 +#: src/dird/dird_conf.c:544 src/dird/dird_conf.c:548 src/dird/dird_conf.c:552 +#: src/dird/dird_conf.c:576 src/dird/dird_conf.c:581 src/dird/dird_conf.c:585 +#: src/dird/dird_conf.c:589 src/dird/dird_conf.c:593 src/dird/dird_conf.c:597 +#: src/dird/dird_conf.c:607 msgid " --> " msgstr "" -#: src/dird/dird_conf.c:464 src/dird/dird_conf.c:467 +#: src/dird/dird_conf.c:466 src/dird/dird_conf.c:469 #, c-format msgid "Console: name=%s SSL=%d\n" msgstr "" -#: src/dird/dird_conf.c:473 +#: src/dird/dird_conf.c:475 #, c-format msgid "Counter: name=%s min=%d max=%d cur=%d wrapcntr=%s\n" msgstr "" -#: src/dird/dird_conf.c:478 +#: src/dird/dird_conf.c:480 #, c-format msgid "Counter: name=%s min=%d max=%d\n" msgstr "" -#: src/dird/dird_conf.c:489 +#: src/dird/dird_conf.c:491 #, c-format msgid "Client: name=%s address=%s FDport=%d MaxJobs=%u\n" msgstr "" -#: src/dird/dird_conf.c:492 +#: src/dird/dird_conf.c:494 #, c-format msgid " JobRetention=%s FileRetention=%s AutoPrune=%d\n" msgstr "" -#: src/dird/dird_conf.c:504 +#: src/dird/dird_conf.c:506 #, c-format msgid "" "Device: name=%s ok=%d num_writers=%d max_writers=%d\n" @@ -1463,245 +1407,252 @@ msgid "" " poolid=%s volname=%s MediaType=%s\n" msgstr "" -#: src/dird/dird_conf.c:514 +#: src/dird/dird_conf.c:516 #, c-format msgid "" "Storage: name=%s address=%s SDport=%d MaxJobs=%u\n" " DeviceName=%s MediaType=%s StorageId=%s\n" msgstr "" -#: src/dird/dird_conf.c:523 +#: src/dird/dird_conf.c:525 #, c-format msgid "" "Catalog: name=%s address=%s DBport=%d db_name=%s\n" " db_user=%s MutliDBConn=%d\n" msgstr "" -#: src/dird/dird_conf.c:531 +#: src/dird/dird_conf.c:533 #, c-format -msgid "%s: name=%s JobType=%d level=%s Priority=%d MaxJobs=%u\n" +msgid "%s: name=%s JobType=%d level=%s Priority=%d Enabled=%d\n" +msgstr "" + +#: src/dird/dird_conf.c:534 src/dird/ua_cmds.c:430 src/dird/ua_prune.c:454 +#: src/dird/ua_run.c:643 src/dird/ua_select.c:234 src/dird/ua_select.c:257 +msgid "Job" msgstr "" -#: src/dird/dird_conf.c:532 +#: src/dird/dird_conf.c:534 msgid "JobDefs" msgstr "" -#: src/dird/dird_conf.c:536 +#: src/dird/dird_conf.c:538 #, c-format -msgid " Resched=%d Times=%d Interval=%s Spool=%d WritePartAfterJob=%d\n" +msgid "" +" MaxJobs=%u Resched=%d Times=%d Interval=%s Spool=%d WritePartAfterJob=%" +"d\n" msgstr "" -#: src/dird/dird_conf.c:553 +#: src/dird/dird_conf.c:556 #, c-format msgid " --> Where=%s\n" msgstr "" -#: src/dird/dird_conf.c:556 +#: src/dird/dird_conf.c:559 #, c-format msgid " --> Bootstrap=%s\n" msgstr "" -#: src/dird/dird_conf.c:559 +#: src/dird/dird_conf.c:562 #, c-format msgid " --> RunBefore=%s\n" msgstr "" -#: src/dird/dird_conf.c:562 +#: src/dird/dird_conf.c:565 #, c-format msgid " --> RunAfter=%s\n" msgstr "" -#: src/dird/dird_conf.c:565 +#: src/dird/dird_conf.c:568 #, c-format msgid " --> RunAfterFailed=%s\n" msgstr "" -#: src/dird/dird_conf.c:568 +#: src/dird/dird_conf.c:571 #, c-format msgid " --> WriteBootstrap=%s\n" msgstr "" -#: src/dird/dird_conf.c:600 +#: src/dird/dird_conf.c:603 #, c-format msgid " --> Run=%s\n" msgstr "" -#: src/dird/dird_conf.c:611 +#: src/dird/dird_conf.c:614 #, c-format msgid "FileSet: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:673 src/dird/dird_conf.c:752 +#: src/dird/dird_conf.c:676 src/dird/dird_conf.c:755 #, c-format msgid "Schedule: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:678 +#: src/dird/dird_conf.c:681 #, c-format msgid " --> Run Level=%s\n" msgstr "" -#: src/dird/dird_conf.c:679 +#: src/dird/dird_conf.c:682 msgid " hour=" msgstr "" -#: src/dird/dird_conf.c:688 +#: src/dird/dird_conf.c:691 msgid " mday=" msgstr "" -#: src/dird/dird_conf.c:697 +#: src/dird/dird_conf.c:700 msgid " month=" msgstr "" -#: src/dird/dird_conf.c:706 +#: src/dird/dird_conf.c:709 msgid " wday=" msgstr "" -#: src/dird/dird_conf.c:715 +#: src/dird/dird_conf.c:718 msgid " wom=" msgstr "" -#: src/dird/dird_conf.c:724 +#: src/dird/dird_conf.c:727 msgid " woy=" msgstr "" -#: src/dird/dird_conf.c:733 +#: src/dird/dird_conf.c:736 #, c-format msgid " mins=%d\n" msgstr "" -#: src/dird/dird_conf.c:735 src/dird/dird_conf.c:739 src/dird/dird_conf.c:743 +#: src/dird/dird_conf.c:738 src/dird/dird_conf.c:742 src/dird/dird_conf.c:746 msgid " --> " msgstr "" -#: src/dird/dird_conf.c:756 +#: src/dird/dird_conf.c:759 #, c-format msgid "Pool: name=%s PoolType=%s\n" msgstr "" -#: src/dird/dird_conf.c:758 +#: src/dird/dird_conf.c:761 #, c-format msgid " use_cat=%d use_once=%d acpt_any=%d cat_files=%d\n" msgstr "" -#: src/dird/dird_conf.c:761 +#: src/dird/dird_conf.c:764 #, c-format msgid " max_vols=%d auto_prune=%d VolRetention=%s\n" msgstr "" -#: src/dird/dird_conf.c:764 +#: src/dird/dird_conf.c:767 #, c-format msgid " VolUse=%s recycle=%d LabelFormat=%s\n" msgstr "" -#: src/dird/dird_conf.c:768 +#: src/dird/dird_conf.c:771 #, c-format msgid " CleaningPrefix=%s LabelType=%d\n" msgstr "" -#: src/dird/dird_conf.c:770 +#: src/dird/dird_conf.c:773 #, c-format msgid " RecyleOldest=%d PurgeOldest=%d MaxVolJobs=%d MaxVolFiles=%d\n" msgstr "" -#: src/dird/dird_conf.c:776 +#: src/dird/dird_conf.c:779 #, c-format msgid "Messages: name=%s\n" msgstr "" -#: src/dird/dird_conf.c:778 +#: src/dird/dird_conf.c:781 #, c-format msgid " mailcmd=%s\n" msgstr "" -#: src/dird/dird_conf.c:780 +#: src/dird/dird_conf.c:783 #, c-format msgid " opcmd=%s\n" msgstr "" -#: src/dird/dird_conf.c:783 src/tray-monitor/tray_conf.c:179 +#: src/dird/dird_conf.c:786 src/tray-monitor/tray_conf.c:179 #, c-format msgid "Unknown resource type %d in dump_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1077 src/tray-monitor/tray_conf.c:232 +#: src/dird/dird_conf.c:1080 src/tray-monitor/tray_conf.c:232 #, c-format msgid "Unknown resource type %d in free_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1115 src/lib/parse_conf.c:211 +#: src/dird/dird_conf.c:1118 src/lib/parse_conf.c:211 #: src/tray-monitor/tray_conf.c:268 #, c-format msgid "Too many items in %s resource\n" msgstr "" -#: src/dird/dird_conf.c:1149 +#: src/dird/dird_conf.c:1152 #, c-format msgid "Cannot find Console resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1155 src/filed/filed_conf.c:316 -#: src/stored/stored_conf.c:523 +#: src/dird/dird_conf.c:1158 src/filed/filed_conf.c:316 +#: src/stored/stored_conf.c:566 #, c-format msgid "Cannot find Director resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1162 src/stored/stored_conf.c:529 +#: src/dird/dird_conf.c:1165 src/stored/stored_conf.c:572 #, c-format msgid "Cannot find Storage resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1171 +#: src/dird/dird_conf.c:1174 #, c-format msgid "Cannot find Job resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1189 +#: src/dird/dird_conf.c:1192 #, c-format msgid "Cannot find Counter resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1197 src/filed/filed_conf.c:322 +#: src/dird/dird_conf.c:1200 src/filed/filed_conf.c:322 #, c-format msgid "Cannot find Client resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1209 +#: src/dird/dird_conf.c:1212 #, c-format msgid "Cannot find Schedule resource %s\n" msgstr "" -#: src/dird/dird_conf.c:1214 src/tray-monitor/tray_conf.c:287 +#: src/dird/dird_conf.c:1217 src/tray-monitor/tray_conf.c:287 #, c-format msgid "Unknown resource type %d in save_resource.\n" msgstr "" -#: src/dird/dird_conf.c:1274 src/tray-monitor/tray_conf.c:322 +#: src/dird/dird_conf.c:1277 src/tray-monitor/tray_conf.c:322 #, c-format msgid "Unknown resource type %d in save_resrouce.\n" msgstr "" -#: src/dird/dird_conf.c:1289 +#: src/dird/dird_conf.c:1292 #, c-format msgid "Name item is required in %s resource, but not found.\n" msgstr "" -#: src/dird/dird_conf.c:1301 +#: src/dird/dird_conf.c:1304 #, c-format msgid "Inserting %s res: %s index=%d pass=%d\n" msgstr "" -#: src/dird/dird_conf.c:1374 +#: src/dird/dird_conf.c:1377 #, c-format msgid "Expected a Job Type keyword, got: %s" msgstr "" -#: src/dird/dird_conf.c:1398 +#: src/dird/dird_conf.c:1401 #, c-format msgid "Expected a Job Level keyword, got: %s" msgstr "" -#: src/dird/dird_conf.c:1418 +#: src/dird/dird_conf.c:1421 #, c-format msgid "Expected a Restore replacement option, got: %s" msgstr "" @@ -1787,7 +1738,7 @@ msgstr "" msgid "Unimplemented backup level %d %c\n" msgstr "" -#: src/dird/fd_cmds.c:320 src/filed/job.c:565 +#: src/dird/fd_cmds.c:320 src/filed/job.c:566 #, c-format msgid "Cannot run program: %s. ERR=%s\n" msgstr "" @@ -1806,7 +1757,7 @@ msgstr "" msgid "Cannot open included file: %s. ERR=%s\n" msgstr "" -#: src/dird/fd_cmds.c:441 src/filed/job.c:1617 +#: src/dird/fd_cmds.c:441 src/filed/job.c:1622 #, c-format msgid "Could not open bootstrap file %s: ERR=%s\n" msgstr "" @@ -1818,7 +1769,7 @@ msgid "" "msglen=%d msg=%s\n" msgstr "" -#: src/dird/fd_cmds.c:571 src/dird/verify.c:696 +#: src/dird/fd_cmds.c:571 src/dird/verify.c:700 #, c-format msgid "MD5/SHA1 index %d not same as attributes %d\n" msgstr "" @@ -1828,28 +1779,28 @@ msgstr "" msgid " | ] -- cancel a job" msgstr "" -#: src/dird/ua_cmds.c:92 +#: src/dird/ua_cmds.c:94 msgid "create DB Pool from resource" msgstr "" -#: src/dird/ua_cmds.c:93 +#: src/dird/ua_cmds.c:95 msgid "delete [pool= | media volume=]" msgstr "" -#: src/dird/ua_cmds.c:94 +#: src/dird/ua_cmds.c:96 +msgid "disable -- disable a job" +msgstr "" + +#: src/dird/ua_cmds.c:97 +msgid "enable -- enable a job" +msgstr "" + +#: src/dird/ua_cmds.c:98 msgid "performs FileSet estimate, listing gives full listing" msgstr "" -#: src/dird/ua_cmds.c:96 +#: src/dird/ua_cmds.c:100 msgid "gui [on|off] -- non-interactive gui mode" msgstr "" -#: src/dird/ua_cmds.c:97 src/stored/btape.c:2533 +#: src/dird/ua_cmds.c:101 src/stored/btape.c:2540 msgid "print this command" msgstr "" -#: src/dird/ua_cmds.c:98 +#: src/dird/ua_cmds.c:102 msgid "" "list [pools | jobs | jobtotals | media | files ]; " "from catalog" msgstr "" -#: src/dird/ua_cmds.c:99 +#: src/dird/ua_cmds.c:103 msgid "label a tape" msgstr "" -#: src/dird/ua_cmds.c:100 +#: src/dird/ua_cmds.c:104 msgid "full or long list like list command" msgstr "" -#: src/dird/ua_cmds.c:101 +#: src/dird/ua_cmds.c:105 msgid "messages" msgstr "" -#: src/dird/ua_cmds.c:102 +#: src/dird/ua_cmds.c:106 msgid "mount " msgstr "" -#: src/dird/ua_cmds.c:103 +#: src/dird/ua_cmds.c:107 msgid "prune expired records from catalog" msgstr "" -#: src/dird/ua_cmds.c:104 +#: src/dird/ua_cmds.c:108 msgid "purge records from catalog" msgstr "" -#: src/dird/ua_cmds.c:105 +#: src/dird/ua_cmds.c:109 msgid "python control commands" msgstr "" -#: src/dird/ua_cmds.c:107 +#: src/dird/ua_cmds.c:111 msgid "query catalog" msgstr "" -#: src/dird/ua_cmds.c:108 +#: src/dird/ua_cmds.c:112 msgid "restore files" msgstr "" -#: src/dird/ua_cmds.c:109 +#: src/dird/ua_cmds.c:113 msgid "relabel a tape" msgstr "" -#: src/dird/ua_cmds.c:110 +#: src/dird/ua_cmds.c:114 msgid "release " msgstr "" -#: src/dird/ua_cmds.c:111 +#: src/dird/ua_cmds.c:115 msgid "reload conf file" msgstr "" -#: src/dird/ua_cmds.c:112 +#: src/dird/ua_cmds.c:116 msgid "run " msgstr "" -#: src/dird/ua_cmds.c:113 +#: src/dird/ua_cmds.c:117 msgid "status [storage | client]=" msgstr "" -#: src/dird/ua_cmds.c:114 +#: src/dird/ua_cmds.c:118 msgid "sets debug level" msgstr "" -#: src/dird/ua_cmds.c:115 +#: src/dird/ua_cmds.c:119 msgid "sets new client address -- if authorized" msgstr "" -#: src/dird/ua_cmds.c:116 +#: src/dird/ua_cmds.c:120 msgid "show (resource records) [jobs | pools | ... | all]" msgstr "" -#: src/dird/ua_cmds.c:117 +#: src/dird/ua_cmds.c:121 msgid "use SQL to query catalog" msgstr "" -#: src/dird/ua_cmds.c:119 +#: src/dird/ua_cmds.c:123 msgid "turn on/off trace to file" msgstr "" -#: src/dird/ua_cmds.c:120 +#: src/dird/ua_cmds.c:124 msgid "unmount " msgstr "" -#: src/dird/ua_cmds.c:121 +#: src/dird/ua_cmds.c:125 msgid "umount for old-time Unix guys" msgstr "" -#: src/dird/ua_cmds.c:122 +#: src/dird/ua_cmds.c:126 msgid "update Volume, Pool or slots" msgstr "" -#: src/dird/ua_cmds.c:123 +#: src/dird/ua_cmds.c:127 msgid "use catalog xxx" msgstr "" -#: src/dird/ua_cmds.c:124 +#: src/dird/ua_cmds.c:128 msgid "does variable expansion" msgstr "" -#: src/dird/ua_cmds.c:125 +#: src/dird/ua_cmds.c:129 msgid "print Director version" msgstr "" -#: src/dird/ua_cmds.c:126 +#: src/dird/ua_cmds.c:130 msgid "wait until no jobs are running" msgstr "" -#: src/dird/ua_cmds.c:158 +#: src/dird/ua_cmds.c:168 #, c-format msgid "%s: is an illegal command.\n" msgstr "" -#: src/dird/ua_cmds.c:196 +#: src/dird/ua_cmds.c:206 msgid "" "You probably don't want to be using this command since it\n" "creates database records without labeling the Volumes.\n" @@ -2552,220 +2565,230 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_cmds.c:215 +#: src/dird/ua_cmds.c:225 #, c-format msgid "Pool already has maximum volumes = %d\n" msgstr "" -#: src/dird/ua_cmds.c:217 +#: src/dird/ua_cmds.c:227 msgid "Enter new maximum (zero for unlimited): " msgstr "" -#: src/dird/ua_cmds.c:238 +#: src/dird/ua_cmds.c:248 #, c-format msgid "Enter number of Volumes to create. 0=>fixed name. Max=%d: " msgstr "" -#: src/dird/ua_cmds.c:244 +#: src/dird/ua_cmds.c:254 #, c-format msgid "The number must be between 0 and %d\n" msgstr "" -#: src/dird/ua_cmds.c:251 +#: src/dird/ua_cmds.c:261 msgid "Enter Volume name: " msgstr "" -#: src/dird/ua_cmds.c:255 +#: src/dird/ua_cmds.c:265 msgid "Enter base volume name: " msgstr "" -#: src/dird/ua_cmds.c:264 src/dird/ua_label.c:590 +#: src/dird/ua_cmds.c:274 src/dird/ua_label.c:605 msgid "Volume name too long.\n" msgstr "" -#: src/dird/ua_cmds.c:268 src/dird/ua_label.c:596 src/lib/edit.c:413 +#: src/dird/ua_cmds.c:278 src/dird/ua_label.c:611 src/lib/edit.c:413 msgid "Volume name must be at least one character long.\n" msgstr "" -#: src/dird/ua_cmds.c:277 +#: src/dird/ua_cmds.c:287 msgid "Enter the starting number: " msgstr "" -#: src/dird/ua_cmds.c:282 +#: src/dird/ua_cmds.c:292 msgid "Start number must be greater than zero.\n" msgstr "" -#: src/dird/ua_cmds.c:293 +#: src/dird/ua_cmds.c:303 msgid "Enter slot (0 for none): " msgstr "" -#: src/dird/ua_cmds.c:297 +#: src/dird/ua_cmds.c:307 msgid "InChanger? yes/no: " msgstr "" -#: src/dird/ua_cmds.c:324 +#: src/dird/ua_cmds.c:334 #, c-format msgid "%d Volumes created in pool %s\n" msgstr "" -#: src/dird/ua_cmds.c:340 src/dird/ua_cmds.c:866 +#: src/dird/ua_cmds.c:350 src/dird/ua_cmds.c:917 msgid "Turn on or off? " msgstr "" -#: src/dird/ua_cmds.c:348 src/dird/ua_cmds.c:874 +#: src/dird/ua_cmds.c:358 src/dird/ua_cmds.c:925 msgid "off" msgstr "" -#: src/dird/ua_cmds.c:368 +#: src/dird/ua_cmds.c:378 msgid "jobid" msgstr "" -#: src/dird/ua_cmds.c:375 +#: src/dird/ua_cmds.c:385 #, c-format msgid "JobId %s is not running. Use Job name to cancel inactive jobs.\n" msgstr "" -#: src/dird/ua_cmds.c:379 +#: src/dird/ua_cmds.c:389 msgid "job" msgstr "" -#: src/dird/ua_cmds.c:384 +#: src/dird/ua_cmds.c:394 #, c-format msgid "Warning Job %s is not running. Continuing anyway ...\n" msgstr "" -#: src/dird/ua_cmds.c:407 src/filed/status.c:193 src/stored/status.c:315 +#: src/dird/ua_cmds.c:416 src/filed/status.c:195 src/stored/status.c:343 msgid "No Jobs running.\n" msgstr "" -#: src/dird/ua_cmds.c:410 +#: src/dird/ua_cmds.c:419 msgid "Select Job:\n" msgstr "" -#: src/dird/ua_cmds.c:417 +#: src/dird/ua_cmds.c:425 #, c-format msgid "JobId=%s Job=%s" msgstr "" -#: src/dird/ua_cmds.c:422 +#: src/dird/ua_cmds.c:430 msgid "Choose Job to cancel" msgstr "" -#: src/dird/ua_cmds.c:426 +#: src/dird/ua_cmds.c:434 msgid "Confirm cancel (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:434 +#: src/dird/ua_cmds.c:442 #, c-format msgid "Job %s not found.\n" msgstr "" -#: src/dird/ua_cmds.c:539 +#: src/dird/ua_cmds.c:547 #, c-format msgid "" "Error: Pool %s already exists.\n" "Use update to change it.\n" msgstr "" -#: src/dird/ua_cmds.c:550 +#: src/dird/ua_cmds.c:558 #, c-format msgid "Pool %s created.\n" msgstr "" -#: src/dird/ua_cmds.c:563 +#: src/dird/ua_cmds.c:571 msgid "restart" msgstr "" -#: src/dird/ua_cmds.c:567 +#: src/dird/ua_cmds.c:575 msgid "Python interpreter restarted.\n" msgstr "" -#: src/dird/ua_cmds.c:569 src/dird/ua_cmds.c:1094 +#: src/dird/ua_cmds.c:577 src/dird/ua_cmds.c:1145 msgid "Nothing done.\n" msgstr "" -#: src/dird/ua_cmds.c:585 +#: src/dird/ua_cmds.c:593 src/dird/ua_cmds.c:639 msgid "Illegal command from this console.\n" msgstr "" -#: src/dird/ua_cmds.c:592 src/dird/ua_run.c:353 +#: src/dird/ua_cmds.c:600 src/dird/ua_run.c:353 #, c-format msgid "Client \"%s\" not found.\n" msgstr "" -#: src/dird/ua_cmds.c:601 +#: src/dird/ua_cmds.c:609 #, c-format msgid "Client \"%s\" address set to %s\n" msgstr "" -#: src/dird/ua_cmds.c:616 src/dird/ua_status.c:286 +#: src/dird/ua_cmds.c:634 +#, c-format +msgid "Job \"%s\" not found.\n" +msgstr "" + +#: src/dird/ua_cmds.c:643 +#, c-format +msgid "Job \"%s\" %sabled\n" +msgstr "" + +#: src/dird/ua_cmds.c:667 src/dird/ua_status.c:286 #, c-format msgid "Connecting to Storage daemon %s at %s:%d\n" msgstr "" -#: src/dird/ua_cmds.c:622 src/dird/ua_status.c:297 +#: src/dird/ua_cmds.c:673 src/dird/ua_status.c:297 msgid "Connected to storage daemon\n" msgstr "" -#: src/dird/ua_cmds.c:642 src/dird/ua_cmds.c:981 src/dird/ua_status.c:324 +#: src/dird/ua_cmds.c:693 src/dird/ua_cmds.c:1032 src/dird/ua_status.c:324 #, c-format msgid "Connecting to Client %s at %s:%d\n" msgstr "" -#: src/dird/ua_cmds.c:645 src/dird/ua_cmds.c:984 +#: src/dird/ua_cmds.c:696 src/dird/ua_cmds.c:1035 msgid "Failed to connect to Client.\n" msgstr "" -#: src/dird/ua_cmds.c:761 +#: src/dird/ua_cmds.c:812 msgid "Enter new debug level: " msgstr "" -#: src/dird/ua_cmds.c:827 +#: src/dird/ua_cmds.c:878 msgid "Available daemons are: \n" msgstr "" -#: src/dird/ua_cmds.c:832 +#: src/dird/ua_cmds.c:883 msgid "Select daemon type to set debug level" msgstr "" -#: src/dird/ua_cmds.c:936 src/dird/ua_run.c:478 +#: src/dird/ua_cmds.c:987 src/dird/ua_run.c:478 #, c-format msgid "Level %s not valid.\n" msgstr "" -#: src/dird/ua_cmds.c:949 +#: src/dird/ua_cmds.c:1000 msgid "No job specified.\n" msgstr "" -#: src/dird/ua_cmds.c:989 +#: src/dird/ua_cmds.c:1040 msgid "Error sending include list.\n" msgstr "" -#: src/dird/ua_cmds.c:994 +#: src/dird/ua_cmds.c:1045 msgid "Error sending exclude list.\n" msgstr "" -#: src/dird/ua_cmds.c:1080 +#: src/dird/ua_cmds.c:1131 msgid "" "In general it is not a good idea to delete either a\n" "Pool or a Volume since they may contain data.\n" "\n" msgstr "" -#: src/dird/ua_cmds.c:1083 +#: src/dird/ua_cmds.c:1134 msgid "Choose catalog item to delete" msgstr "" -#: src/dird/ua_cmds.c:1151 +#: src/dird/ua_cmds.c:1202 msgid "Enter JobId to delete: " msgstr "" -#: src/dird/ua_cmds.c:1194 +#: src/dird/ua_cmds.c:1245 #, c-format msgid "Job %s and associated records deleted from the catalog.\n" msgstr "" -#: src/dird/ua_cmds.c:1207 +#: src/dird/ua_cmds.c:1258 #, c-format msgid "" "\n" @@ -2773,58 +2796,62 @@ msgid "" "and all Jobs saved on that volume from the Catalog\n" msgstr "" -#: src/dird/ua_cmds.c:1211 +#: src/dird/ua_cmds.c:1262 msgid "Are you sure you want to delete this Volume? (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:1232 +#: src/dird/ua_cmds.c:1283 msgid "Are you sure you want to delete this Pool? (yes/no): " msgstr "" -#: src/dird/ua_cmds.c:1329 +#: src/dird/ua_cmds.c:1380 #, c-format msgid "Using Catalog name=%s DB=%s\n" msgstr "" -#: src/dird/ua_cmds.c:1370 src/dird/ua_tree.c:594 src/stored/btape.c:2580 +#: src/dird/ua_cmds.c:1421 src/dird/ua_tree.c:622 src/stored/btape.c:2587 #, c-format msgid "" " Command Description\n" " ======= ===========\n" msgstr "" -#: src/dird/ua_cmds.c:1372 +#: src/dird/ua_cmds.c:1423 #, c-format msgid " %-10s %s\n" msgstr "" -#: src/dird/ua_cmds.c:1374 +#: src/dird/ua_cmds.c:1425 msgid "" "\n" "When at a prompt, entering a period cancels the command.\n" "\n" msgstr "" -#: src/dird/ua_cmds.c:1390 +#: src/dird/ua_cmds.c:1441 #, c-format msgid "%s Version: %s (%s)\n" msgstr "" -#: src/dird/ua_cmds.c:1409 +#: src/dird/ua_cmds.c:1460 msgid "Could not find a Catalog resource\n" msgstr "" -#: src/dird/ua_cmds.c:1412 +#: src/dird/ua_cmds.c:1463 +msgid "You must specify a \"use \" command before continuing.\n" +msgstr "" + +#: src/dird/ua_cmds.c:1467 #, c-format msgid "Using default Catalog name=%s DB=%s\n" msgstr "" -#: src/dird/ua_dotcmds.c:121 +#: src/dird/ua_dotcmds.c:131 msgid "The Director will segment fault.\n" msgstr "" -#: src/dird/ua_dotcmds.c:221 src/dird/ua_restore.c:747 -#: src/dird/ua_restore.c:785 +#: src/dird/ua_dotcmds.c:231 src/dird/ua_restore.c:740 +#: src/dird/ua_restore.c:778 src/dird/ua_restore.c:809 #, c-format msgid "Query failed: %s. ERR=%s\n" msgstr "" @@ -2838,15 +2865,16 @@ msgstr "" msgid "Expected a positive integer, got: %s\n" msgstr "" -#: src/dird/ua_input.c:120 src/dird/ua_run.c:860 src/dird/ua_select.c:54 -#: src/dird/ua_update.c:232 src/dird/ua_update.c:247 src/dird/ua_update.c:495 +#: src/dird/ua_input.c:120 src/dird/ua_run.c:862 src/dird/ua_select.c:54 +#: src/dird/ua_update.c:223 src/dird/ua_update.c:237 src/dird/ua_update.c:247 +#: src/dird/ua_update.c:261 src/dird/ua_update.c:551 #: src/stored/parse_bsr.c:741 src/tools/dbcheck.c:1098 msgid "yes" msgstr "" -#: src/dird/ua_input.c:124 src/dird/ua_select.c:57 src/dird/ua_update.c:234 -#: src/dird/ua_update.c:247 src/dird/ua_update.c:495 -#: src/stored/parse_bsr.c:741 +#: src/dird/ua_input.c:124 src/dird/ua_select.c:57 src/dird/ua_update.c:225 +#: src/dird/ua_update.c:237 src/dird/ua_update.c:249 src/dird/ua_update.c:261 +#: src/dird/ua_update.c:551 src/stored/parse_bsr.c:741 msgid "no" msgstr "" @@ -2854,271 +2882,287 @@ msgstr "" msgid "Invalid response. You must answer yes or no.\n" msgstr "" -#: src/dird/ua_label.c:88 +#: src/dird/ua_label.c:89 msgid "Negative numbers not permitted\n" msgstr "" -#: src/dird/ua_label.c:94 +#: src/dird/ua_label.c:95 msgid "Range end is not integer.\n" msgstr "" -#: src/dird/ua_label.c:99 +#: src/dird/ua_label.c:100 msgid "Range start is not an integer.\n" msgstr "" -#: src/dird/ua_label.c:105 +#: src/dird/ua_label.c:106 msgid "Range end not bigger than start.\n" msgstr "" -#: src/dird/ua_label.c:111 +#: src/dird/ua_label.c:112 msgid "Input value is not an integer.\n" msgstr "" -#: src/dird/ua_label.c:117 +#: src/dird/ua_label.c:118 msgid "Values must be be greater than zero.\n" msgstr "" -#: src/dird/ua_label.c:121 +#: src/dird/ua_label.c:122 msgid "Slot too large.\n" msgstr "" -#: src/dird/ua_label.c:176 src/dird/ua_label.c:463 +#: src/dird/ua_label.c:176 src/dird/ua_label.c:473 msgid "No slots in changer to scan.\n" msgstr "" -#: src/dird/ua_label.c:188 src/dird/ua_label.c:474 +#: src/dird/ua_label.c:188 src/dird/ua_label.c:484 msgid "No Volumes found to label, or no barcodes.\n" msgstr "" -#: src/dird/ua_label.c:195 +#: src/dird/ua_label.c:198 #, c-format -msgid "Slot %d larger than max %d ignored.\n" +msgid "Slot %d greater than max %d ignored.\n" msgstr "" -#: src/dird/ua_label.c:224 +#: src/dird/ua_label.c:227 #, c-format -msgid "No VolName for Slot=%d set InChanger to zero.\n" +msgid "No VolName for Slot=%d InChanger set to zero.\n" msgstr "" -#: src/dird/ua_label.c:239 +#: src/dird/ua_label.c:242 #, c-format msgid "Catalog record for Volume \"%s\" updated to reference slot %d.\n" msgstr "" -#: src/dird/ua_label.c:243 +#: src/dird/ua_label.c:246 #, c-format msgid "Catalog record for Volume \"%s\" is up to date.\n" msgstr "" -#: src/dird/ua_label.c:249 +#: src/dird/ua_label.c:252 #, c-format -msgid "Record for Volume \"%s\" not found in catalog.\n" +msgid "Volume \"%s\" not found in catalog. Slot=%d InChanger set to zero.\n" msgstr "" -#: src/dird/ua_label.c:334 +#: src/dird/ua_label.c:344 #, c-format msgid "" "Volume \"%s\" has VolStatus %s. It must be Purged or Recycled before " "relabeling.\n" msgstr "" -#: src/dird/ua_label.c:350 +#: src/dird/ua_label.c:360 msgid "Enter new Volume name: " msgstr "" -#: src/dird/ua_label.c:363 +#: src/dird/ua_label.c:373 #, c-format msgid "Media record for new Volume \"%s\" already exists.\n" msgstr "" -#: src/dird/ua_label.c:378 +#: src/dird/ua_label.c:388 msgid "Enter slot (0 or Enter for none): " msgstr "" -#: src/dird/ua_label.c:403 +#: src/dird/ua_label.c:413 #, c-format msgid "Delete of Volume \"%s\" failed. ERR=%s" msgstr "" -#: src/dird/ua_label.c:406 +#: src/dird/ua_label.c:416 #, c-format msgid "Old volume \"%s\" deleted from catalog.\n" msgstr "" -#: src/dird/ua_label.c:417 +#: src/dird/ua_label.c:427 #, c-format msgid "Requesting to mount %s ...\n" msgstr "" -#: src/dird/ua_label.c:439 +#: src/dird/ua_label.c:449 msgid "Do not forget to mount the drive!!!\n" msgstr "" -#: src/dird/ua_label.c:479 +#: src/dird/ua_label.c:489 msgid "" "The following Volumes will be labeled:\n" "Slot Volume\n" "==============\n" msgstr "" -#: src/dird/ua_label.c:488 src/stored/btape.c:608 +#: src/dird/ua_label.c:498 src/stored/btape.c:606 msgid "Do you want to continue? (y/n): " msgstr "" -#: src/dird/ua_label.c:509 +#: src/dird/ua_label.c:519 #, c-format msgid "Media record for Slot %d Volume \"%s\" already exists.\n" msgstr "" -#: src/dird/ua_label.c:515 +#: src/dird/ua_label.c:525 #, c-format msgid "Error setting InChanger: ERR=%s" msgstr "" -#: src/dird/ua_label.c:540 +#: src/dird/ua_label.c:548 +#, c-format +msgid "Maximum pool Volumes=%d reached.\n" +msgstr "" + +#: src/dird/ua_label.c:555 #, c-format msgid "Catalog record for cleaning tape \"%s\" successfully created.\n" msgstr "" -#: src/dird/ua_label.c:547 +#: src/dird/ua_label.c:562 #, c-format msgid "Catalog error on cleaning tape: %s" msgstr "" -#: src/dird/ua_label.c:583 +#: src/dird/ua_label.c:598 #, c-format msgid "Illegal character \"%c\" in a volume name.\n" msgstr "" -#: src/dird/ua_label.c:628 +#: src/dird/ua_label.c:643 #, c-format msgid "Sending relabel command from \"%s\" to \"%s\" ...\n" msgstr "" -#: src/dird/ua_label.c:635 +#: src/dird/ua_label.c:650 #, c-format msgid "Sending label command for Volume \"%s\" Slot %d ...\n" msgstr "" -#: src/dird/ua_label.c:665 +#: src/dird/ua_label.c:682 #, c-format msgid "Catalog record for Volume \"%s\", Slot %d successfully created.\n" msgstr "" -#: src/dird/ua_label.c:678 +#: src/dird/ua_label.c:695 #, c-format msgid "Label command failed for Volume %s.\n" msgstr "" -#: src/dird/ua_label.c:688 +#: src/dird/ua_label.c:705 #, c-format msgid "Connecting to Storage daemon %s at %s:%d ...\n" msgstr "" -#: src/dird/ua_label.c:716 +#: src/dird/ua_label.c:733 msgid "Could not open SD socket.\n" msgstr "" -#: src/dird/ua_label.c:722 +#: src/dird/ua_label.c:739 #, c-format msgid "readlabel %s Slot=%d drive=%d\n" msgstr "" -#: src/dird/ua_label.c:764 +#: src/dird/ua_label.c:781 #, c-format msgid "autochanger list %s \n" msgstr "" -#: src/dird/ua_label.c:788 src/dird/ua_label.c:798 +#: src/dird/ua_label.c:805 src/dird/ua_label.c:815 #, c-format msgid "Invalid Slot number: %s\n" msgstr "" -#: src/dird/ua_label.c:807 +#: src/dird/ua_label.c:824 #, c-format msgid "Invalid Volume name: %s\n" msgstr "" -#: src/dird/ua_label.c:876 +#: src/dird/ua_label.c:893 #, c-format -msgid "autochanger slots %s \n" +msgid "autochanger slots %s\n" msgstr "" -#: src/dird/ua_label.c:886 +#: src/dird/ua_label.c:903 #, c-format msgid "Device \"%s\" has %d slots.\n" msgstr "" -#: src/dird/ua_label.c:902 +#: src/dird/ua_label.c:925 +#, c-format +msgid "autochanger drives %s\n" +msgstr "" + +#: src/dird/ua_label.c:952 #, c-format msgid "Pool \"%s\" resource not found!\n" msgstr "" -#: src/dird/ua_output.c:64 src/dird/ua_output.c:90 +#: src/dird/ua_output.c:64 src/dird/ua_output.c:88 msgid "ON or OFF keyword missing.\n" msgstr "" -#: src/dird/ua_output.c:178 +#: src/dird/ua_output.c:176 msgid "Keywords for the show command are:\n" msgstr "" -#: src/dird/ua_output.c:184 +#: src/dird/ua_output.c:182 #, c-format msgid "%s resource %s not found.\n" msgstr "" -#: src/dird/ua_output.c:187 +#: src/dird/ua_output.c:185 #, c-format msgid "Resource %s not found\n" msgstr "" -#: src/dird/ua_output.c:253 +#: src/dird/ua_output.c:251 msgid "Hey! DB is NULL\n" msgstr "" -#: src/dird/ua_output.c:353 +#: src/dird/ua_output.c:358 #, c-format msgid "Jobid %d used %d Volume(s): %s\n" msgstr "" -#: src/dird/ua_output.c:365 +#: src/dird/ua_output.c:376 msgid "No Pool specified.\n" msgstr "" -#: src/dird/ua_output.c:375 src/dird/ua_select.c:446 +#: src/dird/ua_output.c:387 src/dird/ua_select.c:458 #, c-format msgid "Error obtaining pool ids. ERR=%s\n" msgstr "" -#: src/dird/ua_output.c:385 +#: src/dird/ua_output.c:397 #, c-format msgid "Pool: %s\n" msgstr "" -#: src/dird/ua_output.c:396 -msgid "No Volume Name specified.\n" +#: src/dird/ua_output.c:413 src/dird/ua_status.c:452 +msgid "Ignoring illegal value for days.\n" msgstr "" -#: src/dird/ua_output.c:409 +#: src/dird/ua_output.c:422 #, c-format msgid "Unknown list keyword: %s\n" msgstr "" -#: src/dird/ua_output.c:434 +#: src/dird/ua_output.c:448 #, c-format msgid "%s is not a job name.\n" msgstr "" -#: src/dird/ua_output.c:450 src/dird/ua_output.c:462 -msgid "Could not find next Volume.\n" +#: src/dird/ua_output.c:469 +#, c-format +msgid "Could not find next Volume for Job %s (%s, %s).\n" +msgstr "" + +#: src/dird/ua_output.c:473 +#, c-format +msgid "The next Volume to be used by Job \"%s\" (%s, %s) will be %s\n" msgstr "" -#: src/dird/ua_output.c:452 +#: src/dird/ua_output.c:483 #, c-format -msgid "The next Volume to be used by Job \"%s\" will be %s\n" +msgid "Could not find next Volume for Job %s.\n" msgstr "" -#: src/dird/ua_output.c:671 +#: src/dird/ua_output.c:673 msgid "You have no messages.\n" msgstr "" @@ -3278,32 +3322,32 @@ msgstr "" msgid "End query mode.\n" msgstr "" -#: src/dird/ua_restore.c:151 +#: src/dird/ua_restore.c:115 msgid "" "No Restore Job Resource found in bacula-dir.conf.\n" "You must create at least one before running this command.\n" msgstr "" -#: src/dird/ua_restore.c:167 +#: src/dird/ua_restore.c:131 msgid "Restore not done.\n" msgstr "" -#: src/dird/ua_restore.c:178 +#: src/dird/ua_restore.c:142 msgid "Unable to construct a valid BSR. Cannot continue.\n" msgstr "" -#: src/dird/ua_restore.c:182 src/dird/ua_restore.c:196 +#: src/dird/ua_restore.c:146 src/dird/ua_restore.c:160 msgid "No files selected to be restored.\n" msgstr "" -#: src/dird/ua_restore.c:190 +#: src/dird/ua_restore.c:154 msgid "" "\n" "1 file selected to be restored.\n" "\n" msgstr "" -#: src/dird/ua_restore.c:193 +#: src/dird/ua_restore.c:157 #, c-format msgid "" "\n" @@ -3311,80 +3355,85 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_restore.c:211 +#: src/dird/ua_restore.c:175 msgid "No Restore Job resource found!\n" msgstr "" -#: src/dird/ua_restore.c:309 +#: src/dird/ua_restore.c:237 +#, c-format +msgid "Missing value for keyword: %s\n" +msgstr "" + +#: src/dird/ua_restore.c:286 msgid "List last 20 Jobs run" msgstr "" -#: src/dird/ua_restore.c:310 +#: src/dird/ua_restore.c:287 msgid "List Jobs where a given File is saved" msgstr "" -#: src/dird/ua_restore.c:311 +#: src/dird/ua_restore.c:288 msgid "Enter list of comma separated JobIds to select" msgstr "" -#: src/dird/ua_restore.c:312 +#: src/dird/ua_restore.c:289 msgid "Enter SQL list command" msgstr "" -#: src/dird/ua_restore.c:313 +#: src/dird/ua_restore.c:290 msgid "Select the most recent backup for a client" msgstr "" -#: src/dird/ua_restore.c:314 +#: src/dird/ua_restore.c:291 msgid "Select backup for a client before a specified time" msgstr "" -#: src/dird/ua_restore.c:315 +#: src/dird/ua_restore.c:292 msgid "Enter a list of files to restore" msgstr "" -#: src/dird/ua_restore.c:316 +#: src/dird/ua_restore.c:293 msgid "Enter a list of files to restore before a specified time" msgstr "" -#: src/dird/ua_restore.c:317 +#: src/dird/ua_restore.c:294 msgid "Find the JobIds of the most recent backup for a client" msgstr "" -#: src/dird/ua_restore.c:318 +#: src/dird/ua_restore.c:295 msgid "Find the JobIds for a backup for a client before a specified time" msgstr "" -#: src/dird/ua_restore.c:319 +#: src/dird/ua_restore.c:296 msgid "Enter a list of directories to restore for found JobIds" msgstr "" -#: src/dird/ua_restore.c:320 src/dird/ua_status.c:702 src/filed/status.c:249 -#: src/stored/status.c:367 src/wx-console/wxbconfigpanel.cpp:191 +#: src/dird/ua_restore.c:297 src/dird/ua_status.c:713 src/filed/status.c:251 +#: src/stored/status.c:412 src/wx-console/wxbconfigpanel.cpp:191 msgid "Cancel" msgstr "" -#: src/dird/ua_restore.c:356 +#: src/dird/ua_restore.c:333 #, c-format msgid "Unknown keyword: %s\n" msgstr "" -#: src/dird/ua_restore.c:374 +#: src/dird/ua_restore.c:357 #, c-format msgid "Improper date format: %s\n" msgstr "" -#: src/dird/ua_restore.c:408 src/dird/ua_select.c:576 +#: src/dird/ua_restore.c:397 src/dird/ua_select.c:590 #, c-format msgid "Error: Pool resource \"%s\" does not exist.\n" msgstr "" -#: src/dird/ua_restore.c:413 +#: src/dird/ua_restore.c:402 #, c-format msgid "Error: Pool resource \"%s\" access not allowed.\n" msgstr "" -#: src/dird/ua_restore.c:432 +#: src/dird/ua_restore.c:421 msgid "" "\n" "First you select one or more JobIds that contain files\n" @@ -3394,217 +3443,226 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_restore.c:444 +#: src/dird/ua_restore.c:433 msgid "To select the JobIds, you have the following choices:\n" msgstr "" -#: src/dird/ua_restore.c:449 +#: src/dird/ua_restore.c:438 msgid "Select item: " msgstr "" -#: src/dird/ua_restore.c:463 +#: src/dird/ua_restore.c:452 msgid "Enter Filename (no path):" msgstr "" -#: src/dird/ua_restore.c:478 src/dird/ua_restore.c:578 +#: src/dird/ua_restore.c:467 src/dird/ua_restore.c:567 msgid "Enter JobId(s), comma separated, to restore: " msgstr "" -#: src/dird/ua_restore.c:484 +#: src/dird/ua_restore.c:473 msgid "Enter SQL list command: " msgstr "" -#: src/dird/ua_restore.c:512 src/dird/ua_restore.c:537 +#: src/dird/ua_restore.c:501 src/dird/ua_restore.c:526 msgid "" "Enter file names with paths, or < to enter a filename\n" "containg a list of file names with paths, and terminate\n" "them with a blank line.\n" msgstr "" -#: src/dird/ua_restore.c:516 src/dird/ua_restore.c:541 +#: src/dird/ua_restore.c:505 src/dird/ua_restore.c:530 msgid "Enter full filename: " msgstr "" -#: src/dird/ua_restore.c:576 +#: src/dird/ua_restore.c:565 #, c-format msgid "You have already seleted the following JobIds: %s\n" msgstr "" -#: src/dird/ua_restore.c:591 +#: src/dird/ua_restore.c:580 msgid "" "Enter full directory names or start the name\n" "with a < to indicate it is a filename containg a list\n" "of directories and terminate them with a blank line.\n" msgstr "" -#: src/dird/ua_restore.c:595 +#: src/dird/ua_restore.c:584 msgid "Enter directory name: " msgstr "" -#: src/dird/ua_restore.c:620 +#: src/dird/ua_restore.c:609 msgid "No Jobs selected.\n" msgstr "" -#: src/dird/ua_restore.c:624 +#: src/dird/ua_restore.c:613 #, c-format msgid "You have selected the following JobIds: %s\n" msgstr "" -#: src/dird/ua_restore.c:627 +#: src/dird/ua_restore.c:616 #, c-format msgid "You have selected the following JobId: %s\n" msgstr "" -#: src/dird/ua_restore.c:636 +#: src/dird/ua_restore.c:624 msgid "Invalid JobId in list.\n" msgstr "" -#: src/dird/ua_restore.c:648 +#: src/dird/ua_restore.c:637 #, c-format msgid "Unable to get Job record for JobId=%s: ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:653 +#: src/dird/ua_restore.c:642 #, c-format msgid "No authorization. Job \"%s\" not selected.\n" msgstr "" -#: src/dird/ua_restore.c:667 +#: src/dird/ua_restore.c:656 msgid "" "The restored files will the most current backup\n" "BEFORE the date you specify below.\n" "\n" msgstr "" -#: src/dird/ua_restore.c:670 +#: src/dird/ua_restore.c:659 msgid "Enter date as YYYY-MM-DD HH:MM:SS :" msgstr "" -#: src/dird/ua_restore.c:676 +#: src/dird/ua_restore.c:665 msgid "Improper date format.\n" msgstr "" -#: src/dird/ua_restore.c:697 +#: src/dird/ua_restore.c:686 #, c-format msgid "Cannot open file %s: ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:705 src/dird/ua_restore.c:709 +#: src/dird/ua_restore.c:694 src/dird/ua_restore.c:698 #, c-format msgid "Error occurred on line %d of %s\n" msgstr "" -#: src/dird/ua_restore.c:751 src/dird/ua_restore.c:789 +#: src/dird/ua_restore.c:744 src/dird/ua_restore.c:782 #, c-format msgid "No database record found for: %s\n" msgstr "" -#: src/dird/ua_restore.c:776 +#: src/dird/ua_restore.c:769 msgid "No JobId specified cannot continue.\n" msgstr "" -#: src/dird/ua_restore.c:895 +#: src/dird/ua_restore.c:813 +#, c-format +msgid "No table found: %s\n" +msgstr "" + +#: src/dird/ua_restore.c:918 #, c-format msgid "" "\n" "Building directory tree for JobId %s ... " msgstr "" -#: src/dird/ua_restore.c:914 +#: src/dird/ua_restore.c:937 msgid "" "\n" "There were no files inserted into the tree, so file selection\n" "is not possible.Most likely your retention policy pruned the files\n" msgstr "" -#: src/dird/ua_restore.c:916 +#: src/dird/ua_restore.c:939 msgid "" "\n" "Do you want to restore all the files? (yes|no): " msgstr "" -#: src/dird/ua_restore.c:932 +#: src/dird/ua_restore.c:955 #, c-format msgid "" "\n" "1 Job, %s files inserted into the tree and marked for extraction.\n" msgstr "" -#: src/dird/ua_restore.c:936 +#: src/dird/ua_restore.c:959 #, c-format msgid "" "\n" "1 Job, %s files inserted into the tree.\n" msgstr "" -#: src/dird/ua_restore.c:942 +#: src/dird/ua_restore.c:965 #, c-format msgid "" "\n" "%d Jobs, %s files inserted into the tree and marked for extraction.\n" msgstr "" -#: src/dird/ua_restore.c:946 +#: src/dird/ua_restore.c:969 #, c-format msgid "" "\n" "%d Jobs, %s files inserted into the tree.\n" msgstr "" -#: src/dird/ua_restore.c:1023 +#: src/dird/ua_restore.c:1046 #, c-format msgid "Error getting FileSet \"%s\": ERR=%s\n" msgstr "" -#: src/dird/ua_restore.c:1031 src/dird/ua_select.c:165 +#: src/dird/ua_restore.c:1054 src/dird/ua_select.c:167 msgid "The defined FileSet resources are:\n" msgstr "" -#: src/dird/ua_restore.c:1035 src/dird/ua_select.c:173 +#: src/dird/ua_restore.c:1058 src/dird/ua_run.c:644 src/dird/ua_select.c:175 +msgid "FileSet" +msgstr "" + +#: src/dird/ua_restore.c:1058 src/dird/ua_select.c:175 msgid "Select FileSet resource" msgstr "" -#: src/dird/ua_restore.c:1042 +#: src/dird/ua_restore.c:1065 #, c-format msgid "Error getting FileSet record: %s\n" msgstr "" -#: src/dird/ua_restore.c:1043 +#: src/dird/ua_restore.c:1066 msgid "" "This probably means you modified the FileSet.\n" "Continuing anyway.\n" msgstr "" -#: src/dird/ua_restore.c:1058 +#: src/dird/ua_restore.c:1081 #, c-format msgid "Pool \"%s\" not found, using any pool.\n" msgstr "" -#: src/dird/ua_restore.c:1084 src/dird/ua_restore.c:1100 +#: src/dird/ua_restore.c:1107 src/dird/ua_restore.c:1123 #, c-format msgid "No Full backup before %s found.\n" msgstr "" -#: src/dird/ua_restore.c:1123 +#: src/dird/ua_restore.c:1146 msgid "No jobs found.\n" msgstr "" -#: src/dird/ua_restore.c:1289 +#: src/dird/ua_restore.c:1312 msgid "" "Warning, the JobIds that you selected refer to more than one MediaType.\n" "Restore is not possible. The MediaTypes used are:\n" msgstr "" -#: src/dird/ua_restore.c:1297 +#: src/dird/ua_restore.c:1320 msgid "No MediaType found for your JobIds.\n" msgstr "" -#: src/dird/ua_restore.c:1329 +#: src/dird/ua_restore.c:1352 #, c-format msgid "Warning default storage overridden by %s on command line.\n" msgstr "" -#: src/dird/ua_restore.c:1340 +#: src/dird/ua_restore.c:1363 #, c-format msgid "" "\n" @@ -3759,7 +3817,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:507 src/lib/util.c:301 +#: src/dird/ua_run.c:507 src/lib/util.c:295 msgid "Admin" msgstr "" @@ -3777,7 +3835,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:528 src/lib/util.c:292 +#: src/dird/ua_run.c:528 src/lib/util.c:286 msgid "Backup" msgstr "" @@ -3796,7 +3854,7 @@ msgid "" "Priority: %d\n" msgstr "" -#: src/dird/ua_run.c:554 src/lib/util.c:295 +#: src/dird/ua_run.c:554 src/lib/util.c:289 msgid "Verify" msgstr "" @@ -3849,7 +3907,7 @@ msgstr "" msgid "mod" msgstr "" -#: src/dird/ua_run.c:640 src/dird/ua_update.c:415 +#: src/dird/ua_run.c:640 src/dird/ua_update.c:464 msgid "Parameters to modify:\n" msgstr "" @@ -3857,40 +3915,79 @@ msgstr "" msgid "Level" msgstr "" -#: src/dird/ua_run.c:646 src/wx-console/wxbrestorepanel.cpp:380 -#: src/wx-console/wxbrestorepanel.cpp:808 -#: src/wx-console/wxbrestorepanel.cpp:1833 +#: src/dird/ua_run.c:642 src/dird/ua_select.c:152 +#: src/wx-console/wxbrestorepanel.cpp:321 +#: src/wx-console/wxbrestorepanel.cpp:337 +#: src/wx-console/wxbrestorepanel.cpp:458 +#: src/wx-console/wxbrestorepanel.cpp:459 +#: src/wx-console/wxbrestorepanel.cpp:469 +#: src/wx-console/wxbrestorepanel.cpp:470 +#: src/wx-console/wxbrestorepanel.cpp:1133 +#: src/wx-console/wxbrestorepanel.cpp:1794 +#: src/wx-console/wxbrestorepanel.cpp:1865 +msgid "Storage" +msgstr "" + +#: src/dird/ua_run.c:645 src/dird/ua_select.c:282 src/dird/ua_select.c:391 +#: src/wx-console/wxbrestorepanel.cpp:318 +#: src/wx-console/wxbrestorepanel.cpp:336 +#: src/wx-console/wxbrestorepanel.cpp:410 +#: src/wx-console/wxbrestorepanel.cpp:411 +#: src/wx-console/wxbrestorepanel.cpp:421 +#: src/wx-console/wxbrestorepanel.cpp:422 +#: src/wx-console/wxbrestorepanel.cpp:669 +#: src/wx-console/wxbrestorepanel.cpp:1103 +#: src/wx-console/wxbrestorepanel.cpp:1190 +#: src/wx-console/wxbrestorepanel.cpp:1787 +#: src/wx-console/wxbrestorepanel.cpp:1789 +#: src/wx-console/wxbrestorepanel.cpp:1863 +#: src/wx-console/wxbrestorepanel.cpp:1918 +msgid "Client" +msgstr "" + +#: src/dird/ua_run.c:646 src/wx-console/wxbrestorepanel.cpp:338 +#: src/wx-console/wxbrestorepanel.cpp:823 +#: src/wx-console/wxbrestorepanel.cpp:1867 msgid "When" msgstr "" -#: src/dird/ua_run.c:647 src/wx-console/wxbrestorepanel.cpp:381 -#: src/wx-console/wxbrestorepanel.cpp:1079 -#: src/wx-console/wxbrestorepanel.cpp:1835 +#: src/dird/ua_run.c:647 src/wx-console/wxbrestorepanel.cpp:339 +#: src/wx-console/wxbrestorepanel.cpp:1096 +#: src/wx-console/wxbrestorepanel.cpp:1869 msgid "Priority" msgstr "" +#: src/dird/ua_run.c:650 src/dird/ua_select.c:476 src/dird/ua_select.c:566 +#: src/dird/ua_update.c:400 src/dird/ua_update.c:475 +#: src/wx-console/wxbrestorepanel.cpp:320 +#: src/wx-console/wxbrestorepanel.cpp:506 +#: src/wx-console/wxbrestorepanel.cpp:516 +#: src/wx-console/wxbrestorepanel.cpp:1783 +msgid "Pool" +msgstr "" + #: src/dird/ua_run.c:652 msgid "Verify Job" msgstr "" -#: src/dird/ua_run.c:655 src/wx-console/wxbrestorepanel.cpp:373 -#: src/wx-console/wxbrestorepanel.cpp:1814 +#: src/dird/ua_run.c:655 src/wx-console/wxbrestorepanel.cpp:331 +#: src/wx-console/wxbrestorepanel.cpp:1848 msgid "Bootstrap" msgstr "" -#: src/dird/ua_run.c:656 src/wx-console/wxbrestorepanel.cpp:374 -#: src/wx-console/wxbrestorepanel.cpp:1055 -#: src/wx-console/wxbrestorepanel.cpp:1816 +#: src/dird/ua_run.c:656 src/wx-console/wxbrestorepanel.cpp:332 +#: src/wx-console/wxbrestorepanel.cpp:1072 +#: src/wx-console/wxbrestorepanel.cpp:1850 msgid "Where" msgstr "" -#: src/dird/ua_run.c:657 src/wx-console/wxbrestorepanel.cpp:376 -#: src/wx-console/wxbrestorepanel.cpp:1063 -#: src/wx-console/wxbrestorepanel.cpp:1820 -#: src/wx-console/wxbrestorepanel.cpp:1821 -#: src/wx-console/wxbrestorepanel.cpp:1822 -#: src/wx-console/wxbrestorepanel.cpp:1823 -#: src/wx-console/wxbrestorepanel.cpp:1824 +#: src/dird/ua_run.c:657 src/wx-console/wxbrestorepanel.cpp:334 +#: src/wx-console/wxbrestorepanel.cpp:1080 +#: src/wx-console/wxbrestorepanel.cpp:1854 +#: src/wx-console/wxbrestorepanel.cpp:1855 +#: src/wx-console/wxbrestorepanel.cpp:1856 +#: src/wx-console/wxbrestorepanel.cpp:1857 +#: src/wx-console/wxbrestorepanel.cpp:1858 msgid "Replace" msgstr "" @@ -3898,7 +3995,7 @@ msgstr "" msgid "JobId" msgstr "" -#: src/dird/ua_run.c:660 src/dird/ua_update.c:430 +#: src/dird/ua_run.c:660 src/dird/ua_update.c:479 msgid "Select parameter to modify" msgstr "" @@ -3907,27 +4004,27 @@ msgid "Levels:\n" msgstr "" #: src/dird/ua_run.c:665 src/filed/status.c:368 src/lib/util.c:319 -#: src/stored/status.c:406 +#: src/stored/status.c:451 msgid "Base" msgstr "" -#: src/dird/ua_run.c:666 src/dird/ua_update.c:106 src/dird/ua_update.c:438 -#: src/filed/status.c:370 src/lib/util.c:321 src/stored/status.c:408 +#: src/dird/ua_run.c:666 src/filed/status.c:370 src/lib/util.c:321 +#: src/stored/status.c:453 msgid "Full" msgstr "" #: src/dird/ua_run.c:667 src/filed/status.c:373 src/lib/util.c:324 -#: src/stored/status.c:411 +#: src/stored/status.c:456 msgid "Incremental" msgstr "" #: src/dird/ua_run.c:668 src/filed/status.c:376 src/lib/util.c:327 -#: src/stored/status.c:414 +#: src/stored/status.c:459 msgid "Differential" msgstr "" #: src/dird/ua_run.c:669 src/filed/status.c:379 src/lib/util.c:330 -#: src/stored/status.c:417 +#: src/stored/status.c:462 msgid "Since" msgstr "" @@ -3940,7 +4037,7 @@ msgid "Initialize Catalog" msgstr "" #: src/dird/ua_run.c:693 src/filed/status.c:382 src/lib/util.c:333 -#: src/stored/status.c:420 +#: src/stored/status.c:465 msgid "Verify Catalog" msgstr "" @@ -3999,16 +4096,16 @@ msgid "" "You must set the bootstrap file to NULL to be able to specify a JobId.\n" msgstr "" -#: src/dird/ua_run.c:867 +#: src/dird/ua_run.c:869 msgid "Job failed.\n" msgstr "" -#: src/dird/ua_run.c:870 +#: src/dird/ua_run.c:872 #, c-format msgid "Job started. JobId=%s\n" msgstr "" -#: src/dird/ua_run.c:876 +#: src/dird/ua_run.c:878 msgid "Job not run.\n" msgstr "" @@ -4041,199 +4138,199 @@ msgstr "" msgid "Select Storage resource" msgstr "" -#: src/dird/ua_select.c:189 +#: src/dird/ua_select.c:193 msgid "catalog" msgstr "" -#: src/dird/ua_select.c:197 +#: src/dird/ua_select.c:201 msgid "The defined Catalog resources are:\n" msgstr "" -#: src/dird/ua_select.c:205 +#: src/dird/ua_select.c:209 msgid "Catalog" msgstr "" -#: src/dird/ua_select.c:205 +#: src/dird/ua_select.c:209 msgid "Select Catalog resource" msgstr "" -#: src/dird/ua_select.c:220 +#: src/dird/ua_select.c:226 msgid "The defined Job resources are:\n" msgstr "" -#: src/dird/ua_select.c:228 +#: src/dird/ua_select.c:234 msgid "Select Job resource" msgstr "" -#: src/dird/ua_select.c:241 +#: src/dird/ua_select.c:249 msgid "The defined Restore Job resources are:\n" msgstr "" -#: src/dird/ua_select.c:249 +#: src/dird/ua_select.c:257 msgid "Select Restore Job" msgstr "" -#: src/dird/ua_select.c:264 +#: src/dird/ua_select.c:274 msgid "The defined Client resources are:\n" msgstr "" -#: src/dird/ua_select.c:272 +#: src/dird/ua_select.c:282 msgid "Select Client (File daemon) resource" msgstr "" -#: src/dird/ua_select.c:297 +#: src/dird/ua_select.c:309 #, c-format msgid "Error: Client resource %s does not exist.\n" msgstr "" -#: src/dird/ua_select.c:322 +#: src/dird/ua_select.c:334 #, c-format msgid "Could not find Client %s: ERR=%s" msgstr "" -#: src/dird/ua_select.c:325 src/lib/bnet_server.c:285 -#: src/lib/bnet_server.c:379 +#: src/dird/ua_select.c:337 src/lib/bnet_server.c:284 +#: src/lib/bnet_server.c:378 msgid "client" msgstr "" -#: src/dird/ua_select.c:326 +#: src/dird/ua_select.c:338 msgid "fd" msgstr "" -#: src/dird/ua_select.c:332 src/dird/ua_select.c:386 +#: src/dird/ua_select.c:344 src/dird/ua_select.c:398 #, c-format msgid "Could not find Client \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:361 +#: src/dird/ua_select.c:373 #, c-format msgid "Error obtaining client ids. ERR=%s\n" msgstr "" -#: src/dird/ua_select.c:365 +#: src/dird/ua_select.c:377 msgid "No clients defined. You must run a job before using this command.\n" msgstr "" -#: src/dird/ua_select.c:369 +#: src/dird/ua_select.c:381 msgid "Defined Clients:\n" msgstr "" -#: src/dird/ua_select.c:379 +#: src/dird/ua_select.c:391 msgid "Select the Client" msgstr "" -#: src/dird/ua_select.c:412 src/dird/ua_select.c:435 src/dird/ua_select.c:471 +#: src/dird/ua_select.c:424 src/dird/ua_select.c:447 src/dird/ua_select.c:483 #, c-format msgid "Could not find Pool \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:450 +#: src/dird/ua_select.c:462 msgid "No pools defined. Use the \"create\" command to create one.\n" msgstr "" -#: src/dird/ua_select.c:454 +#: src/dird/ua_select.c:466 msgid "Defined Pools:\n" msgstr "" -#: src/dird/ua_select.c:464 +#: src/dird/ua_select.c:476 msgid "Select the Pool" msgstr "" -#: src/dird/ua_select.c:494 +#: src/dird/ua_select.c:506 #, c-format msgid "No access to Pool \"%s\"\n" msgstr "" -#: src/dird/ua_select.c:520 +#: src/dird/ua_select.c:532 msgid "Enter MediaId or Volume name: " msgstr "" -#: src/dird/ua_select.c:546 +#: src/dird/ua_select.c:558 msgid "The defined Pool resources are:\n" msgstr "" -#: src/dird/ua_select.c:554 +#: src/dird/ua_select.c:566 msgid "Select Pool resource" msgstr "" -#: src/dird/ua_select.c:587 +#: src/dird/ua_select.c:601 msgid "Enter the JobId to select: " msgstr "" -#: src/dird/ua_select.c:624 +#: src/dird/ua_select.c:638 #, c-format msgid "Could not find Job \"%s\": ERR=%s" msgstr "" -#: src/dird/ua_select.c:687 +#: src/dird/ua_select.c:705 #, c-format msgid "Automatically selected %s: %s\n" msgstr "" -#: src/dird/ua_select.c:692 +#: src/dird/ua_select.c:710 #, c-format msgid "Cannot select %s in batch mode.\n" msgstr "" -#: src/dird/ua_select.c:708 +#: src/dird/ua_select.c:722 msgid "Selection is empty!\n" msgstr "" -#: src/dird/ua_select.c:714 +#: src/dird/ua_select.c:728 msgid "Item 1 selected automatically.\n" msgstr "" -#: src/dird/ua_select.c:725 +#: src/dird/ua_select.c:739 msgid "Selection aborted, nothing done.\n" msgstr "" -#: src/dird/ua_select.c:730 +#: src/dird/ua_select.c:744 #, c-format msgid "Please enter a number between 1 and %d\n" msgstr "" -#: src/dird/ua_select.c:778 +#: src/dird/ua_select.c:793 msgid "Storage name given twice.\n" msgstr "" -#: src/dird/ua_select.c:795 +#: src/dird/ua_select.c:810 #, c-format msgid "Expecting jobid=nn command, got: %s\n" msgstr "" -#: src/dird/ua_select.c:799 +#: src/dird/ua_select.c:814 #, c-format msgid "JobId %s is not running.\n" msgstr "" -#: src/dird/ua_select.c:808 +#: src/dird/ua_select.c:823 #, c-format msgid "Expecting job=xxx, got: %s.\n" msgstr "" -#: src/dird/ua_select.c:812 +#: src/dird/ua_select.c:827 #, c-format msgid "Job \"%s\" is not running.\n" msgstr "" -#: src/dird/ua_select.c:828 +#: src/dird/ua_select.c:843 #, c-format msgid "Storage resource \"%s\": not found\n" msgstr "" -#: src/dird/ua_select.c:850 +#: src/dird/ua_select.c:875 msgid "Enter autochanger drive[0]: " msgstr "" -#: src/dird/ua_select.c:879 +#: src/dird/ua_select.c:905 msgid "Media Types defined in conf file:\n" msgstr "" -#: src/dird/ua_select.c:885 +#: src/dird/ua_select.c:911 msgid "Media Type" msgstr "" -#: src/dird/ua_select.c:885 +#: src/dird/ua_select.c:911 msgid "Select the Media Type" msgstr "" @@ -4259,24 +4356,24 @@ msgstr "" msgid "%s Version: %s (%s) %s %s %s\n" msgstr "" -#: src/dird/ua_status.c:249 src/stored/status.c:70 +#: src/dird/ua_status.c:249 src/stored/status.c:71 #, c-format msgid "Daemon started %s, 1 Job run since started.\n" msgstr "" -#: src/dird/ua_status.c:252 src/stored/status.c:73 +#: src/dird/ua_status.c:252 src/stored/status.c:74 #, c-format msgid "Daemon started %s, %d Jobs run since started.\n" msgstr "" -#: src/dird/ua_status.c:257 src/filed/status.c:119 src/stored/status.c:77 +#: src/dird/ua_status.c:257 src/filed/status.c:121 src/stored/status.c:78 #, c-format msgid " Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n" msgstr "" -#: src/dird/ua_status.c:277 src/dird/ua_status.c:482 src/dird/ua_status.c:644 -#: src/filed/status.c:196 src/filed/status.c:275 src/stored/status.c:317 -#: src/stored/status.c:393 +#: src/dird/ua_status.c:277 src/dird/ua_status.c:493 src/dird/ua_status.c:655 +#: src/filed/status.c:198 src/filed/status.c:277 src/stored/status.c:345 +#: src/stored/status.c:361 src/stored/status.c:438 msgid "====\n" msgstr "" @@ -4319,244 +4416,244 @@ msgstr "" msgid "%-14s %-8s %3d %-18s %-18s %s\n" msgstr "" -#: src/dird/ua_status.c:480 +#: src/dird/ua_status.c:491 msgid "No Scheduled Jobs.\n" msgstr "" -#: src/dird/ua_status.c:497 src/stored/status.c:269 +#: src/dird/ua_status.c:508 src/stored/status.c:277 msgid "" "\n" "Running Jobs:\n" msgstr "" -#: src/dird/ua_status.c:506 +#: src/dird/ua_status.c:516 #, c-format msgid "Console connected at %s\n" msgstr "" -#: src/dird/ua_status.c:514 +#: src/dird/ua_status.c:526 msgid "" "No Jobs running.\n" "====\n" msgstr "" -#: src/dird/ua_status.c:519 +#: src/dird/ua_status.c:531 msgid " JobId Level Name Status\n" msgstr "" -#: src/dird/ua_status.c:520 src/filed/status.c:219 src/stored/status.c:337 +#: src/dird/ua_status.c:532 src/filed/status.c:221 src/stored/status.c:382 msgid "======================================================================\n" msgstr "" -#: src/dird/ua_status.c:529 +#: src/dird/ua_status.c:540 msgid "is waiting execution" msgstr "" -#: src/dird/ua_status.c:532 +#: src/dird/ua_status.c:543 msgid "is running" msgstr "" -#: src/dird/ua_status.c:535 +#: src/dird/ua_status.c:546 msgid "is blocked" msgstr "" -#: src/dird/ua_status.c:538 +#: src/dird/ua_status.c:549 msgid "has terminated" msgstr "" -#: src/dird/ua_status.c:541 +#: src/dird/ua_status.c:552 msgid "has erred" msgstr "" -#: src/dird/ua_status.c:544 +#: src/dird/ua_status.c:555 msgid "has errors" msgstr "" -#: src/dird/ua_status.c:547 +#: src/dird/ua_status.c:558 msgid "has a fatal error" msgstr "" -#: src/dird/ua_status.c:550 +#: src/dird/ua_status.c:561 msgid "has verify differences" msgstr "" -#: src/dird/ua_status.c:553 +#: src/dird/ua_status.c:564 msgid "has been canceled" msgstr "" -#: src/dird/ua_status.c:557 +#: src/dird/ua_status.c:568 #, c-format msgid "is waiting on Client %s" msgstr "" -#: src/dird/ua_status.c:563 +#: src/dird/ua_status.c:574 #, c-format msgid "is waiting on Storage %s" msgstr "" -#: src/dird/ua_status.c:568 +#: src/dird/ua_status.c:579 msgid "is waiting on max Storage jobs" msgstr "" -#: src/dird/ua_status.c:571 +#: src/dird/ua_status.c:582 msgid "is waiting on max Client jobs" msgstr "" -#: src/dird/ua_status.c:574 +#: src/dird/ua_status.c:585 msgid "is waiting on max Job jobs" msgstr "" -#: src/dird/ua_status.c:577 +#: src/dird/ua_status.c:588 msgid "is waiting on max total jobs" msgstr "" -#: src/dird/ua_status.c:580 +#: src/dird/ua_status.c:591 msgid "is waiting for its start time" msgstr "" -#: src/dird/ua_status.c:583 +#: src/dird/ua_status.c:594 msgid "is waiting for higher priority jobs to finish" msgstr "" -#: src/dird/ua_status.c:588 +#: src/dird/ua_status.c:599 #, c-format msgid "is in unknown state %c" msgstr "" -#: src/dird/ua_status.c:602 +#: src/dird/ua_status.c:613 msgid "is waiting for a mount request" msgstr "" -#: src/dird/ua_status.c:609 +#: src/dird/ua_status.c:620 msgid "is waiting for an appendable Volume" msgstr "" -#: src/dird/ua_status.c:616 +#: src/dird/ua_status.c:627 #, c-format msgid "is waiting for Client %s to connect to Storage %s" msgstr "" -#: src/dird/ua_status.c:632 +#: src/dird/ua_status.c:643 #, c-format msgid "%6d %-6s %-20s %s\n" msgstr "" -#: src/dird/ua_status.c:654 src/filed/status.c:209 src/stored/status.c:328 +#: src/dird/ua_status.c:665 src/filed/status.c:211 src/stored/status.c:373 msgid "No Terminated Jobs.\n" msgstr "" -#: src/dird/ua_status.c:659 src/stored/status.c:333 +#: src/dird/ua_status.c:670 src/stored/status.c:378 msgid "" "\n" "Terminated Jobs:\n" msgstr "" -#: src/dird/ua_status.c:660 +#: src/dird/ua_status.c:671 msgid " JobId Level Files Bytes Status Finished Name \n" msgstr "" -#: src/dird/ua_status.c:661 +#: src/dird/ua_status.c:672 msgid "========================================================================\n" msgstr "" -#: src/dird/ua_status.c:692 src/filed/status.c:239 src/lib/util.c:184 -#: src/stored/status.c:357 +#: src/dird/ua_status.c:703 src/filed/status.c:241 src/lib/util.c:178 +#: src/stored/status.c:402 msgid "Created" msgstr "" -#: src/dird/ua_status.c:696 src/filed/status.c:243 src/lib/util.c:197 -#: src/lib/util.c:264 src/stored/status.c:361 +#: src/dird/ua_status.c:707 src/filed/status.c:245 src/lib/util.c:191 +#: src/lib/util.c:258 src/stored/status.c:406 msgid "Error" msgstr "" -#: src/dird/ua_status.c:699 src/filed/status.c:246 src/stored/status.c:364 +#: src/dird/ua_status.c:710 src/filed/status.c:248 src/stored/status.c:409 msgid "Diffs" msgstr "" -#: src/dird/ua_status.c:705 src/filed/status.c:252 src/lib/util.c:193 -#: src/lib/util.c:260 src/stored/btape.c:1160 src/stored/status.c:370 +#: src/dird/ua_status.c:716 src/filed/status.c:254 src/lib/util.c:187 +#: src/lib/util.c:254 src/stored/btape.c:1158 src/stored/status.c:415 #: src/wx-console/wxbconfigpanel.cpp:180 msgid "OK" msgstr "" -#: src/dird/ua_status.c:708 src/filed/status.c:255 src/stored/status.c:373 +#: src/dird/ua_status.c:719 src/filed/status.c:257 src/stored/status.c:418 msgid "Other" msgstr "" -#: src/dird/ua_status.c:711 src/filed/status.c:266 src/stored/status.c:384 +#: src/dird/ua_status.c:722 src/filed/status.c:268 src/stored/status.c:429 #, c-format msgid "%6d %-6s %8s %14s %-7s %-8s %s\n" msgstr "" -#: src/dird/ua_status.c:719 src/stored/btape.c:180 +#: src/dird/ua_status.c:730 src/stored/btape.c:180 msgid "\n" msgstr "" -#: src/dird/ua_tree.c:57 +#: src/dird/ua_tree.c:58 msgid "change current directory" msgstr "" -#: src/dird/ua_tree.c:58 +#: src/dird/ua_tree.c:59 msgid "count marked files in and below the cd" msgstr "" -#: src/dird/ua_tree.c:59 +#: src/dird/ua_tree.c:60 src/dird/ua_tree.c:61 msgid "long list current directory, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:60 +#: src/dird/ua_tree.c:62 msgid "leave file selection mode" msgstr "" -#: src/dird/ua_tree.c:61 +#: src/dird/ua_tree.c:63 msgid "estimate restore size" msgstr "" -#: src/dird/ua_tree.c:62 +#: src/dird/ua_tree.c:64 msgid "same as done command" msgstr "" -#: src/dird/ua_tree.c:63 +#: src/dird/ua_tree.c:65 msgid "find files, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:64 src/dird/ua_tree.c:73 +#: src/dird/ua_tree.c:66 src/dird/ua_tree.c:75 msgid "print help" msgstr "" -#: src/dird/ua_tree.c:65 +#: src/dird/ua_tree.c:67 msgid "list current directory, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:66 +#: src/dird/ua_tree.c:68 msgid "list the marked files in and below the cd" msgstr "" -#: src/dird/ua_tree.c:67 -msgid "mark dir/file to be restored recursively in dirs" +#: src/dird/ua_tree.c:69 +msgid "mark dir/file to be restored recursively, wildcards allowed" msgstr "" -#: src/dird/ua_tree.c:68 +#: src/dird/ua_tree.c:70 msgid "mark directory name to be restored (no files)" msgstr "" -#: src/dird/ua_tree.c:69 +#: src/dird/ua_tree.c:71 msgid "print current working directory" msgstr "" -#: src/dird/ua_tree.c:70 +#: src/dird/ua_tree.c:72 msgid "unmark dir/file to be restored recursively in dir" msgstr "" -#: src/dird/ua_tree.c:71 +#: src/dird/ua_tree.c:73 msgid "unmark directory name only no recursion" msgstr "" -#: src/dird/ua_tree.c:72 +#: src/dird/ua_tree.c:74 msgid "quit and do not do restore" msgstr "" -#: src/dird/ua_tree.c:92 +#: src/dird/ua_tree.c:94 msgid "" "\n" "You are now entering file selection mode where you add (mark) and\n" @@ -4566,286 +4663,90 @@ msgid "" "\n" msgstr "" -#: src/dird/ua_tree.c:102 src/dird/ua_tree.c:633 src/dird/ua_tree.c:641 +#: src/dird/ua_tree.c:104 src/dird/ua_tree.c:664 src/dird/ua_tree.c:672 #, c-format msgid "cwd is: %s\n" msgstr "" -#: src/dird/ua_tree.c:123 +#: src/dird/ua_tree.c:125 msgid "Illegal command. Enter \"done\" to exit.\n" msgstr "" -#: src/dird/ua_tree.c:296 src/dird/ua_tree.c:307 src/dird/ua_tree.c:324 +#: src/dird/ua_tree.c:298 src/dird/ua_tree.c:309 src/dird/ua_tree.c:326 msgid "No files marked.\n" msgstr "" -#: src/dird/ua_tree.c:309 +#: src/dird/ua_tree.c:311 msgid "1 file marked.\n" msgstr "" -#: src/dird/ua_tree.c:311 +#: src/dird/ua_tree.c:313 #, c-format msgid "%s files marked.\n" msgstr "" -#: src/dird/ua_tree.c:338 +#: src/dird/ua_tree.c:340 msgid "No directories marked.\n" msgstr "" -#: src/dird/ua_tree.c:340 +#: src/dird/ua_tree.c:342 msgid "1 directory marked.\n" msgstr "" -#: src/dird/ua_tree.c:342 +#: src/dird/ua_tree.c:344 #, c-format msgid "%s directories marked.\n" msgstr "" -#: src/dird/ua_tree.c:363 +#: src/dird/ua_tree.c:365 #, c-format msgid "%s total files/dirs. %s marked to be restored.\n" msgstr "" -#: src/dird/ua_tree.c:374 +#: src/dird/ua_tree.c:376 msgid "No file specification given.\n" msgstr "" -#: src/dird/ua_tree.c:502 +#: src/dird/ua_tree.c:520 #, c-format msgid "Node %s has no children.\n" msgstr "" -#: src/dird/ua_tree.c:583 +#: src/dird/ua_tree.c:611 #, c-format msgid "%d total files; %d marked to be restored; %s bytes.\n" msgstr "" -#: src/dird/ua_tree.c:625 +#: src/dird/ua_tree.c:656 msgid "Invalid path given.\n" msgstr "" -#: src/dird/ua_tree.c:652 src/dird/ua_tree.c:663 +#: src/dird/ua_tree.c:683 src/dird/ua_tree.c:694 msgid "No files unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:665 +#: src/dird/ua_tree.c:696 msgid "1 file unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:667 +#: src/dird/ua_tree.c:698 #, c-format msgid "%d files unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:678 src/dird/ua_tree.c:694 +#: src/dird/ua_tree.c:709 src/dird/ua_tree.c:725 msgid "No directories unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:696 +#: src/dird/ua_tree.c:727 msgid "1 directory unmarked.\n" msgstr "" -#: src/dird/ua_tree.c:698 +#: src/dird/ua_tree.c:729 #, c-format msgid "%d directories unmarked.\n" msgstr "" -#: src/dird/verify.c:87 -msgid "" -"Unable to find JobId of previous InitCatalog Job.\n" -"Please run a Verify with Level=InitCatalog before\n" -"running the current Job.\n" -msgstr "" - -#: src/dird/verify.c:108 -#, c-format -msgid "Could not get job record for previous Job. ERR=%s" -msgstr "" - -#: src/dird/verify.c:113 -#, c-format -msgid "Last Job %d did not terminate normally. JobStatus=%c\n" -msgstr "" - -#: src/dird/verify.c:117 -#, c-format -msgid "Verifying against JobId=%d Job=%s\n" -msgstr "" - -#: src/dird/verify.c:183 -#, c-format -msgid "Start Verify JobId=%d Level=%s Job=%s\n" -msgstr "" - -#: src/dird/verify.c:262 -msgid "Deprecated feature ... use bootstrap.\n" -msgstr "" - -#: src/dird/verify.c:275 -#, c-format -msgid "Unimplemented Verify level %d(%c)\n" -msgstr "" - -#: src/dird/verify.c:327 -#, c-format -msgid "Unimplemented verify level %d\n" -msgstr "" - -#: src/dird/verify.c:382 -msgid "Verify OK" -msgstr "" - -#: src/dird/verify.c:386 -msgid "*** Verify Error ***" -msgstr "" - -#: src/dird/verify.c:390 -msgid "Verify warnings" -msgstr "" - -#: src/dird/verify.c:393 -msgid "Verify Canceled" -msgstr "" - -#: src/dird/verify.c:396 -msgid "Verify Differences" -msgstr "" - -#: src/dird/verify.c:401 -#, c-format -msgid "Inappropriate term code: %d %c\n" -msgstr "" - -#: src/dird/verify.c:415 -#, c-format -msgid "" -"Bacula %s (%s): %s\n" -" JobId: %d\n" -" Job: %s\n" -" FileSet: %s\n" -" Verify Level: %s\n" -" Client: %s\n" -" Verify JobId: %d\n" -" Verify Job: %s\n" -" Start time: %s\n" -" End time: %s\n" -" Files Expected: %s\n" -" Files Examined: %s\n" -" Non-fatal FD errors: %d\n" -" FD termination status: %s\n" -" SD termination status: %s\n" -" Termination: %s\n" -"\n" -msgstr "" - -#: src/dird/verify.c:450 -#, c-format -msgid "" -"Bacula %s (%s): %s\n" -" JobId: %d\n" -" Job: %s\n" -" FileSet: %s\n" -" Verify Level: %s\n" -" Client: %s\n" -" Verify JobId: %d\n" -" Verify Job: %s\n" -" Start time: %s\n" -" End time: %s\n" -" Files Examined: %s\n" -" Non-fatal FD errors: %d\n" -" FD termination status: %s\n" -" Termination: %s\n" -"\n" -msgstr "" - -#: src/dird/verify.c:526 -#, c-format -msgid "" -"birdqnext->qprev != qp called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:185 +#: src/lib/smartall.c:180 #, c-format msgid "qp->qprev->qnext != qp called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:194 +#: src/lib/smartall.c:189 #, c-format msgid "Buffer overrun called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:265 +#: src/lib/smartall.c:260 #, c-format msgid "sm_realloc size: %d\n" msgstr "" -#: src/lib/smartall.c:306 +#: src/lib/smartall.c:301 #, c-format msgid "sm_realloc %d at %x from %s:%d\n" msgstr "" -#: src/lib/smartall.c:368 +#: src/lib/smartall.c:363 #, c-format msgid "" "\n" @@ -7893,125 +8080,133 @@ msgid "" " Buffer address with bad links: %lx\n" msgstr "" -#: src/lib/smartall.c:379 +#: src/lib/smartall.c:374 #, c-format msgid "Orphaned buffer: %6u bytes allocated at line %d of %s %s\n" msgstr "" -#: src/lib/smartall.c:415 +#: src/lib/smartall.c:410 #, c-format msgid "Damaged buffer found. Called from %s:%d\n" msgstr "" -#: src/lib/smartall.c:445 +#: src/lib/smartall.c:440 #, c-format msgid "" "\n" "Damaged buffers found at %s:%d\n" msgstr "" -#: src/lib/smartall.c:448 +#: src/lib/smartall.c:443 #, c-format msgid " discovery of bad prev link.\n" msgstr "" -#: src/lib/smartall.c:451 +#: src/lib/smartall.c:446 #, c-format msgid " discovery of bad next link.\n" msgstr "" -#: src/lib/smartall.c:454 +#: src/lib/smartall.c:449 #, c-format msgid " discovery of data overrun.\n" msgstr "" -#: src/lib/smartall.c:457 +#: src/lib/smartall.c:452 #, c-format msgid " Buffer address: %lx\n" msgstr "" -#: src/lib/smartall.c:464 +#: src/lib/smartall.c:459 #, c-format msgid "Damaged buffer: %6u bytes allocated at line %d of %s %s\n" msgstr "" -#: src/lib/util.c:187 +#: src/lib/util.c:181 msgid "Running" msgstr "" -#: src/lib/util.c:190 +#: src/lib/util.c:184 msgid "Blocked" msgstr "" -#: src/lib/util.c:200 +#: src/lib/util.c:194 msgid "Non-fatal error" msgstr "" -#: src/lib/util.c:203 src/lib/util.c:270 +#: src/lib/util.c:197 src/lib/util.c:264 msgid "Canceled" msgstr "" -#: src/lib/util.c:206 +#: src/lib/util.c:200 msgid "Verify differences" msgstr "" -#: src/lib/util.c:209 +#: src/lib/util.c:203 msgid "Waiting on FD" msgstr "" -#: src/lib/util.c:212 +#: src/lib/util.c:206 msgid "Wait on SD" msgstr "" -#: src/lib/util.c:215 +#: src/lib/util.c:209 msgid "Wait for new Volume" msgstr "" -#: src/lib/util.c:218 +#: src/lib/util.c:212 msgid "Waiting for mount" msgstr "" -#: src/lib/util.c:221 +#: src/lib/util.c:215 msgid "Waiting for Storage resource" msgstr "" -#: src/lib/util.c:224 +#: src/lib/util.c:218 msgid "Waiting for Job resource" msgstr "" -#: src/lib/util.c:227 +#: src/lib/util.c:221 msgid "Waiting for Client resource" msgstr "" -#: src/lib/util.c:230 +#: src/lib/util.c:224 msgid "Waiting on Max Jobs" msgstr "" -#: src/lib/util.c:233 +#: src/lib/util.c:227 msgid "Waiting for Start Time" msgstr "" -#: src/lib/util.c:236 +#: src/lib/util.c:230 msgid "Waiting on Priority" msgstr "" -#: src/lib/util.c:243 +#: src/lib/util.c:237 #, c-format msgid "Unknown Job termination status=%d" msgstr "" -#: src/lib/util.c:267 +#: src/lib/util.c:261 msgid "Fatal Error" msgstr "" -#: src/lib/util.c:273 +#: src/lib/util.c:267 msgid "Differences" msgstr "" -#: src/lib/util.c:276 +#: src/lib/util.c:270 msgid "Unknown term code" msgstr "" +#: src/lib/util.c:298 +msgid "Migrate" +msgstr "" + +#: src/lib/util.c:301 +msgid "Copy" +msgstr "" + #: src/lib/util.c:304 msgid "Unknown Type" msgstr "" @@ -8259,278 +8454,214 @@ msgstr "" msgid "rwl_writeunlock failure. ERR=%s\n" msgstr "" -#: src/lib/pythonlib.c:108 -msgid "Could not initialize Python\n" -msgstr "" - -#: src/lib/pythonlib.c:113 +#: src/stored/acquire.c:96 #, c-format -msgid "Could not Run Python string %s\n" -msgstr "" - -#: src/lib/pythonlib.c:125 -msgid "Could not initialize Python Job type.\n" +msgid "Hey! num_writers=%d!!!!\n" msgstr "" -#: src/lib/pythonlib.c:130 +#: src/stored/acquire.c:146 #, c-format -msgid "Could not import Python script %s/%s. Python disabled.\n" +msgid "Num_writers=%d not zero. Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:230 -msgid "Could not create Python Job Object.\n" +#: src/stored/acquire.c:154 +#, c-format +msgid "No volumes specified. Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:243 src/lib/pythonlib.c:267 +#: src/stored/acquire.c:182 src/stored/mount.c:73 #, c-format -msgid "Python function \"%s\" not found.\n" +msgid "Job %d canceled.\n" msgstr "" -#: src/lib/pythonlib.c:282 +#: src/stored/acquire.c:193 #, c-format -msgid "Unknown Python daemon event %s\n" +msgid "Open device %s Volume \"%s\" failed (EIO): ERR=%s\n" msgstr "" -#: src/lib/res.c:66 +#: src/stored/acquire.c:198 #, c-format -msgid "rwl_writelock failure at %s:%d: ERR=%s\n" +msgid "Open device %s Volume \"%s\" failed: ERR=%s\n" msgstr "" -#: src/lib/res.c:76 +#: src/stored/acquire.c:263 src/stored/mount.c:67 #, c-format -msgid "rwl_writeunlock failure at %s:%d:. ERR=%s\n" +msgid "Too many errors trying to mount device %s.\n" msgstr "" -#: src/lib/tls.c:108 +#: src/stored/acquire.c:272 #, c-format -msgid "" -"Error with certificate at depth: %d, issuer = %s, subject = %s, ERR=%d:%s\n" +msgid "Ready to read from volume \"%s\" on device %s.\n" msgstr "" -#: src/lib/tls.c:155 -msgid "Error initializing SSL context" +#: src/stored/acquire.c:311 +#, c-format +msgid "Device %s is busy reading.\n" msgstr "" -#: src/lib/tls.c:176 -msgid "Error loading certificate verification stores" +#: src/stored/acquire.c:341 +#, c-format +msgid "Wanted Volume \"%s\", but device %s is busy writing on \"%s\" .\n" msgstr "" -#: src/lib/tls.c:181 +#: src/stored/acquire.c:360 +#, c-format msgid "" -"Either a certificate file or a directory must be specified as a verification " -"store\n" +"Cannot recycle volume \"%s\" on device %s because it is in use by another " +"job.\n" msgstr "" -#: src/lib/tls.c:192 -msgid "Error loading certificate file" +#: src/stored/acquire.c:382 +#, c-format +msgid "Could not ready device %s for append.\n" msgstr "" -#: src/lib/tls.c:200 -msgid "Error loading private key" +#: src/stored/acquire.c:459 src/stored/block.c:354 src/stored/block.c:677 +#: src/stored/block.c:746 +#, c-format +msgid "Could not create JobMedia record for Volume=\"%s\" Job=%s\n" msgstr "" -#: src/lib/tls.c:208 -msgid "Unable to open DH parameters file" +#: src/stored/acquire.c:501 +#, c-format +msgid "Alert: %s" msgstr "" -#: src/lib/tls.c:214 -msgid "Unable to load DH parameters from specified file" +#: src/stored/acquire.c:509 +#, c-format +msgid "3997 Bad alert command: %s: ERR=%s.\n" msgstr "" -#: src/lib/tls.c:218 -msgid "Failed to set TLS Diffie-Hellman parameters" +#: src/stored/ansi_label.c:83 +#, c-format +msgid "Read error on device %s in ANSI label. ERR=%s\n" msgstr "" -#: src/lib/tls.c:227 -msgid "Error setting cipher list, no valid ciphers available\n" +#: src/stored/ansi_label.c:93 +msgid "Insane! End of tape while reading ANSI label.\n" msgstr "" -#: src/lib/tls.c:275 -msgid "Peer failed to present a TLS certificate\n" +#: src/stored/ansi_label.c:117 +msgid "No VOL1 label while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:317 +#: src/stored/ansi_label.c:137 #, c-format -msgid "Peer %s failed to present a TLS certificate\n" +msgid "Wanted ANSI Volume \"%s\" got \"%s\"\n" msgstr "" -#: src/lib/tls.c:416 -msgid "Error creating file descriptor-based BIO" +#: src/stored/ansi_label.c:148 +msgid "No HDR1 label while reading ANSI label.\n" msgstr "" -#: src/lib/tls.c:427 -msgid "Error creating new SSL object" +#: src/stored/ansi_label.c:154 +#, c-format +msgid "ANSI/IBM Volume \"%s\" does not belong to Bacula.\n" msgstr "" -#: src/lib/tls.c:493 src/lib/tls.c:510 -msgid "Connect failure" +#: src/stored/ansi_label.c:165 +msgid "No HDR2 label while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:587 src/lib/tls.c:591 -msgid "TLS shutdown failure." +#: src/stored/ansi_label.c:179 +msgid "Unknown or bad ANSI/IBM label record.\n" msgstr "" -#: src/lib/tls.c:642 src/lib/tls.c:658 -msgid "TLS read/write failure." +#: src/stored/ansi_label.c:186 +msgid "Too many records in while reading ANSI/IBM label.\n" msgstr "" -#: src/lib/tls.c:716 src/lib/tls.c:773 src/stored/dev.c:212 -#: src/stored/dev.c:230 src/stored/dev.c:236 src/stored/stored_conf.c:550 +#: src/stored/ansi_label.c:285 #, c-format -msgid "Unable to init mutex: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:736 src/lib/tls.c:805 -#, c-format -msgid "Unable to destroy mutex: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:870 -#, c-format -msgid "Unable to init OpenSSL threading: ERR=%s\n" -msgstr "" - -#: src/lib/tls.c:880 -msgid "Failed to seed OpenSSL PRNG\n" -msgstr "" - -#: src/lib/tls.c:906 -msgid "Failed to save OpenSSL PRNG\n" -msgstr "" - -#: src/stored/acquire.c:98 -#, c-format -msgid "Hey! num_writers=%d!!!!\n" -msgstr "" - -#: src/stored/acquire.c:146 -#, c-format -msgid "Num_writers=%d not zero. Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:154 -#, c-format -msgid "No volumes specified. Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:182 src/stored/mount.c:72 -#, c-format -msgid "Job %d canceled.\n" -msgstr "" - -#: src/stored/acquire.c:193 -#, c-format -msgid "Open device %s Volume \"%s\" failed (EIO): ERR=%s\n" -msgstr "" - -#: src/stored/acquire.c:208 -#, c-format -msgid "Open device %s Volume \"%s\" failed: ERR=%s\n" -msgstr "" - -#: src/stored/acquire.c:273 src/stored/mount.c:66 -#, c-format -msgid "Too many errors trying to mount device %s.\n" -msgstr "" - -#: src/stored/acquire.c:282 -#, c-format -msgid "Ready to read from volume \"%s\" on device %s.\n" +msgid "ANSI Volume label name \"%s\" longer than 6 chars.\n" msgstr "" -#: src/stored/acquire.c:328 src/stored/reserve.c:664 +#: src/stored/ansi_label.c:302 #, c-format -msgid "Device %s is busy reading.\n" +msgid "Could not write ANSI VOL1 label. ERR=%s\n" msgstr "" -#: src/stored/acquire.c:358 +#: src/stored/ansi_label.c:340 src/stored/ansi_label.c:369 #, c-format -msgid "Wanted Volume \"%s\", but device %s is busy writing on \"%s\" .\n" +msgid "Could not write ANSI HDR1 label. ERR=%s\n" msgstr "" -#: src/stored/acquire.c:377 -#, c-format -msgid "" -"Cannot recycle volume \"%s\" on device %s because it is in use by another " -"job.\n" +#: src/stored/ansi_label.c:345 src/stored/ansi_label.c:376 +msgid "Could not write ANSI HDR1 label.\n" msgstr "" -#: src/stored/acquire.c:399 +#: src/stored/ansi_label.c:381 #, c-format -msgid "Could not ready device %s for append.\n" +msgid "Error writing EOF to tape. ERR=%s" msgstr "" -#: src/stored/acquire.c:464 src/stored/block.c:353 src/stored/block.c:676 -#: src/stored/block.c:744 -#, c-format -msgid "Could not create JobMedia record for Volume=\"%s\" Job=%s\n" +#: src/stored/ansi_label.c:386 +msgid "write_ansi_ibm_label called for non-ANSI/IBM type\n" msgstr "" -#: src/stored/acquire.c:506 -#, c-format -msgid "Alert: %s" +#: src/stored/append.c:49 +msgid "DCR is NULL!!!\n" msgstr "" -#: src/stored/acquire.c:514 -#, c-format -msgid "3997 Bad alert command: %s: ERR=%s.\n" +#: src/stored/append.c:54 +msgid "DEVICE is NULL!!!\n" msgstr "" -#: src/stored/append.c:60 +#: src/stored/append.c:66 msgid "Unable to set network buffer size.\n" msgstr "" -#: src/stored/append.c:73 src/stored/append.c:82 src/stored/append.c:94 -#: src/stored/append.c:249 src/stored/append.c:264 src/stored/append.c:276 -#: src/stored/askdir.c:284 src/stored/askdir.c:285 +#: src/stored/append.c:79 src/stored/append.c:88 src/stored/append.c:100 +#: src/stored/append.c:256 src/stored/append.c:271 src/stored/append.c:283 +#: src/stored/askdir.c:294 src/stored/askdir.c:295 msgid "NULL Volume name. This shouldn't happen!!!\n" msgstr "" -#: src/stored/append.c:88 src/stored/btape.c:1853 +#: src/stored/append.c:94 src/stored/btape.c:1854 #, c-format msgid "Write session label failed. ERR=%s\n" msgstr "" -#: src/stored/append.c:100 +#: src/stored/append.c:106 #, c-format msgid "Network send error to FD. ERR=%s\n" msgstr "" -#: src/stored/append.c:137 +#: src/stored/append.c:143 #, c-format msgid "Error reading data header from FD. ERR=%s\n" msgstr "" -#: src/stored/append.c:159 +#: src/stored/append.c:165 #, c-format msgid "Malformed data header from FD: %s\n" msgstr "" -#: src/stored/append.c:169 +#: src/stored/append.c:175 msgid "File index from FD not positive or sequential\n" msgstr "" -#: src/stored/append.c:199 src/stored/append.c:269 src/stored/spool.c:247 +#: src/stored/append.c:206 src/stored/append.c:276 src/stored/spool.c:248 #, c-format msgid "Fatal append error on device %s: ERR=%s\n" msgstr "" -#: src/stored/append.c:224 +#: src/stored/append.c:231 #, c-format msgid "Error updating file attributes. ERR=%s\n" msgstr "" -#: src/stored/append.c:237 +#: src/stored/append.c:244 #, c-format msgid "Network error on data channel. ERR=%s\n" msgstr "" -#: src/stored/append.c:258 src/stored/btape.c:1969 +#: src/stored/append.c:265 src/stored/btape.c:1976 #, c-format msgid "Error writting end session label. ERR=%s\n" msgstr "" -#: src/stored/append.c:271 +#: src/stored/append.c:278 msgid "Set ok=FALSE after write_block_to_device.\n" msgstr "" @@ -8540,41 +8671,34 @@ msgstr "" #: src/stored/askdir.c:178 #, c-format -msgid "Error getting Volume info: %s\n" +msgid "Error getting Volume info: %s" msgstr "" -#: src/stored/askdir.c:289 src/stored/askdir.c:290 +#: src/stored/askdir.c:299 src/stored/askdir.c:300 msgid "Attempt to update_volume_info in read mode!!!\n" msgstr "" -#: src/stored/askdir.c:318 +#: src/stored/askdir.c:328 #, c-format msgid "Didn't get vol info vol=%s: ERR=%s" msgstr "" -#: src/stored/askdir.c:349 +#: src/stored/askdir.c:359 #, c-format msgid "Error creating JobMedia record: ERR=%s\n" msgstr "" -#: src/stored/askdir.c:356 +#: src/stored/askdir.c:366 #, c-format msgid "Error creating JobMedia record: %s\n" msgstr "" -#: src/stored/askdir.c:424 +#: src/stored/askdir.c:432 #, c-format msgid "Job %s canceled while waiting for mount on Storage Device \"%s\".\n" msgstr "" -#: src/stored/askdir.c:452 -#, c-format -msgid "" -"Please mount Volume \"%s\" on Storage Device %s for Job %s\n" -"Use \"mount\" command to release Job.\n" -msgstr "" - -#: src/stored/askdir.c:462 +#: src/stored/askdir.c:445 #, c-format msgid "" "Job %s waiting. Cannot find any appendable volumes.\n" @@ -8584,45 +8708,31 @@ msgid "" " Pool: %s\n" msgstr "" -#: src/stored/askdir.c:486 src/stored/askdir.c:588 +#: src/stored/askdir.c:469 src/stored/askdir.c:551 #, c-format msgid "Max time exceeded waiting to mount Storage Device %s for Job %s\n" msgstr "" -#: src/stored/askdir.c:496 src/stored/askdir.c:503 -#, c-format -msgid "pthread error in mount_next_volume stat=%d ERR=%s\n" -msgstr "" - -#: src/stored/askdir.c:514 -#, c-format -msgid "" -"Someone woke me up, but I cannot find any appendable\n" -"volumes for Job=%s.\n" +#: src/stored/askdir.c:479 +msgid "pthread error in mount_next_volume.\n" msgstr "" -#: src/stored/askdir.c:558 +#: src/stored/askdir.c:511 msgid "Cannot request another volume: no volume name given.\n" msgstr "" -#: src/stored/askdir.c:564 +#: src/stored/askdir.c:517 #, c-format msgid "Job %s canceled while waiting for mount on Storage Device %s.\n" msgstr "" -#: src/stored/askdir.c:570 +#: src/stored/askdir.c:532 #, c-format msgid "Please mount Volume \"%s\" on Storage Device %s for Job %s\n" msgstr "" -#: src/stored/askdir.c:598 -#, c-format -msgid "pthread error in mount_volume stat=%d ERR=%s\n" -msgstr "" - -#: src/stored/askdir.c:605 -#, c-format -msgid "pthread error in mount_next_volume stat=%d: ERR=%s\n" +#: src/stored/askdir.c:561 +msgid "pthread error in mount_volume\n" msgstr "" #: src/stored/authenticate.c:53 @@ -8650,71 +8760,91 @@ msgid "" "help.\n" msgstr "" -#: src/stored/autochanger.c:95 +#: src/stored/autochanger.c:53 +#, c-format +msgid "No Changer Name given for device %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:59 +#, c-format +msgid "No Changer Command given for device %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:72 +#, c-format +msgid "" +"Media Type not the same for all devices in changer %s. Cannot continue.\n" +msgstr "" + +#: src/stored/autochanger.c:152 #, c-format msgid "3304 Issuing autochanger \"load slot %d, drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:102 +#: src/stored/autochanger.c:161 #, c-format msgid "3305 Autochanger \"load slot %d, drive %d\", status is OK.\n" msgstr "" -#: src/stored/autochanger.c:108 +#: src/stored/autochanger.c:167 #, c-format msgid "3992 Bad autochanger \"load slot %d, drive %d\": ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:153 +#: src/stored/autochanger.c:208 +msgid "3992 Missing Changer command.\n" +msgstr "" + +#: src/stored/autochanger.c:218 #, c-format msgid "3301 Issuing autochanger \"loaded drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:162 +#: src/stored/autochanger.c:227 #, c-format msgid "3302 Autochanger \"loaded drive %d\", result is Slot %d.\n" msgstr "" -#: src/stored/autochanger.c:166 +#: src/stored/autochanger.c:231 #, c-format msgid "3302 Autochanger \"loaded drive %d\", result: nothing loaded.\n" msgstr "" -#: src/stored/autochanger.c:173 +#: src/stored/autochanger.c:238 #, c-format msgid "3991 Bad autochanger \"loaded drive %d\" command: ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:234 src/stored/autochanger.c:304 +#: src/stored/autochanger.c:297 src/stored/autochanger.c:380 #, c-format msgid "3307 Issuing autochanger \"unload slot %d, drive %d\" command.\n" msgstr "" -#: src/stored/autochanger.c:247 src/stored/autochanger.c:325 +#: src/stored/autochanger.c:310 src/stored/autochanger.c:401 #, c-format msgid "3995 Bad autochanger \"unload slot %d, drive %d\": ERR=%s.\n" msgstr "" -#: src/stored/autochanger.c:290 +#: src/stored/autochanger.c:369 #, c-format msgid "Volume %s is in use by device %s\n" msgstr "" -#: src/stored/autochanger.c:358 +#: src/stored/autochanger.c:439 #, c-format msgid "3993 Device %s not an autochanger device.\n" msgstr "" -#: src/stored/autochanger.c:372 +#: src/stored/autochanger.c:464 #, c-format msgid "3306 Issuing autochanger \"%s\" command.\n" msgstr "" -#: src/stored/autochanger.c:377 +#: src/stored/autochanger.c:467 msgid "3996 Open bpipe failed.\n" msgstr "" -#: src/stored/autochanger.c:401 +#: src/stored/autochanger.c:494 #, c-format msgid "Autochanger error: ERR=%s\n" msgstr "" @@ -8743,7 +8873,7 @@ msgstr "" msgid "Wrong number of arguments: \n" msgstr "" -#: src/stored/bcopy.c:172 src/stored/btape.c:334 src/stored/device.c:273 +#: src/stored/bcopy.c:172 src/stored/btape.c:333 src/stored/device.c:266 #, c-format msgid "dev open failed: %s\n" msgstr "" @@ -8757,7 +8887,7 @@ msgstr "" msgid "%u Jobs copied. %u records copied.\n" msgstr "" -#: src/stored/bcopy.c:205 src/stored/bscan.c:389 +#: src/stored/bcopy.c:205 src/stored/bscan.c:390 #, c-format msgid "Record: SessId=%u SessTim=%u FileIndex=%d Stream=%d len=%u\n" msgstr "" @@ -8771,7 +8901,7 @@ msgid "Volume label not copied.\n" msgstr "" #: src/stored/bcopy.c:235 src/stored/bcopy.c:242 src/stored/bcopy.c:265 -#: src/stored/btape.c:2335 +#: src/stored/btape.c:2342 #, c-format msgid "Cannot fixup device error. %s\n" msgstr "" @@ -8784,8 +8914,8 @@ msgstr "" msgid "EOT label not copied.\n" msgstr "" -#: src/stored/bcopy.c:290 src/stored/bextract.c:473 src/stored/bls.c:444 -#: src/stored/bscan.c:1227 src/stored/btape.c:2683 +#: src/stored/bcopy.c:290 src/stored/bextract.c:479 src/stored/bls.c:443 +#: src/stored/bscan.c:1234 src/stored/btape.c:2690 #, c-format msgid "Mount Volume \"%s\" on device %s and press return when ready: " msgstr "" @@ -8811,12 +8941,12 @@ msgid "" "\n" msgstr "" -#: src/stored/bextract.c:127 src/stored/bls.c:129 +#: src/stored/bextract.c:127 src/stored/bls.c:128 #, c-format msgid "Could not open exclude file: %s, ERR=%s\n" msgstr "" -#: src/stored/bextract.c:142 src/stored/bls.c:143 +#: src/stored/bextract.c:142 src/stored/bls.c:142 #, c-format msgid "Could not open include file: %s, ERR=%s\n" msgstr "" @@ -8846,11 +8976,11 @@ msgstr "" msgid "%u files restored.\n" msgstr "" -#: src/stored/bextract.c:278 src/stored/bextract.c:444 +#: src/stored/bextract.c:278 src/stored/bextract.c:450 msgid "Logic error output file should be open but is not.\n" msgstr "" -#: src/stored/bextract.c:285 src/stored/bls.c:365 src/stored/bscan.c:645 +#: src/stored/bextract.c:285 src/stored/bls.c:364 src/stored/bscan.c:647 msgid "Cannot continue.\n" msgstr "" @@ -8868,176 +8998,176 @@ msgstr "" msgid "===Write error===\n" msgstr "" -#: src/stored/bextract.c:435 +#: src/stored/bextract.c:441 msgid "Got Program Name or Data Stream. Ignored.\n" msgstr "" -#: src/stored/block.c:78 +#: src/stored/block.c:79 #, c-format msgid "" "Dump block %s %x: size=%d BlkNum=%d\n" " Hdrcksum=%x cksum=%x\n" msgstr "" -#: src/stored/block.c:91 +#: src/stored/block.c:92 #, c-format msgid " Rec: VId=%u VT=%u FI=%s Strm=%s len=%d p=%x\n" msgstr "" -#: src/stored/block.c:147 +#: src/stored/block.c:148 #, c-format msgid "%d block read errors not printed.\n" msgstr "" -#: src/stored/block.c:235 src/stored/block.c:251 src/stored/block.c:261 +#: src/stored/block.c:236 src/stored/block.c:252 src/stored/block.c:262 #, c-format msgid "" "Volume data error at %u:%u! Wanted ID: \"%s\", got \"%s\". Buffer " "discarded.\n" msgstr "" -#: src/stored/block.c:275 +#: src/stored/block.c:276 #, c-format msgid "" "Volume data error at %u:%u! Block length %u is insane (too large), probably " "due to a bad archive.\n" msgstr "" -#: src/stored/block.c:301 +#: src/stored/block.c:302 #, c-format msgid "" "Volume data error at %u:%u!\n" "Block checksum mismatch in block=%u len=%d: calc=%x blk=%x\n" msgstr "" -#: src/stored/block.c:409 +#: src/stored/block.c:410 msgid "Cannot write block. Device at EOM.\n" msgstr "" -#: src/stored/block.c:414 +#: src/stored/block.c:415 msgid "Attempt to write on read-only Volume.\n" msgstr "" -#: src/stored/block.c:466 +#: src/stored/block.c:467 #, c-format msgid "User defined maximum volume capacity %s exceeded on device %s.\n" msgstr "" -#: src/stored/block.c:481 +#: src/stored/block.c:482 #, c-format msgid "Unable to write EOF. ERR=%s\n" msgstr "" -#: src/stored/block.c:507 src/stored/block.c:518 +#: src/stored/block.c:508 src/stored/block.c:519 msgid "Write block header zeroed.\n" msgstr "" -#: src/stored/block.c:536 +#: src/stored/block.c:537 #, c-format msgid "Write error at %u:%u on device %s. ERR=%s.\n" msgstr "" -#: src/stored/block.c:543 +#: src/stored/block.c:544 #, c-format msgid "End of Volume \"%s\" at %u:%u on device %s. Write of %u bytes got %d.\n" msgstr "" -#: src/stored/block.c:618 src/stored/block.c:624 +#: src/stored/block.c:619 src/stored/block.c:625 #, c-format msgid "Backspace file at EOT failed. ERR=%s\n" msgstr "" -#: src/stored/block.c:631 +#: src/stored/block.c:632 #, c-format msgid "Backspace record at EOT failed. ERR=%s\n" msgstr "" -#: src/stored/block.c:648 +#: src/stored/block.c:649 #, c-format msgid "Re-read last block at EOT failed. ERR=%s" msgstr "" -#: src/stored/block.c:652 +#: src/stored/block.c:653 msgid "Re-read of last block succeeded.\n" msgstr "" -#: src/stored/block.c:655 +#: src/stored/block.c:656 #, c-format msgid "Re-read of last block failed. Last block=%u Current block=%u.\n" msgstr "" -#: src/stored/block.c:684 +#: src/stored/block.c:685 #, c-format msgid "" -"Error writing final EOF to tape. This tape may not be readable.\n" +"Error writing final EOF to tape. This Volume may not be readable.\n" "%s" msgstr "" -#: src/stored/block.c:790 src/stored/dvd.c:622 +#: src/stored/block.c:795 src/stored/dvd.c:689 #, c-format msgid "" "Error while writing, current part number is less than the total number of " "parts (%d/%d, device=%s)\n" msgstr "" -#: src/stored/block.c:798 src/stored/block.c:908 +#: src/stored/block.c:803 src/stored/block.c:913 #, c-format msgid "Unable to open device next part %s: ERR=%s\n" msgstr "" -#: src/stored/block.c:816 +#: src/stored/block.c:821 #, c-format msgid "" "End of Volume \"%s\" at %u:%u on device %s (part_size=%s, free_space=%s, " "free_space_errno=%d, errmsg=%s).\n" msgstr "" -#: src/stored/block.c:829 +#: src/stored/block.c:834 #, c-format msgid "" "End of Volume \"%s\" at %u:%u on device %s (part_size=%s, free_space=%s, " "free_space_errno=%d).\n" msgstr "" -#: src/stored/block.c:883 +#: src/stored/block.c:888 #, c-format msgid "Block buffer size looping problem on device %s\n" msgstr "" -#: src/stored/block.c:934 +#: src/stored/block.c:939 #, c-format msgid "Read error at file:blk %u:%u on device %s. ERR=%s.\n" msgstr "" -#: src/stored/block.c:947 +#: src/stored/block.c:952 #, c-format msgid "Read zero bytes at %u:%u on device %s.\n" msgstr "" -#: src/stored/block.c:960 +#: src/stored/block.c:965 #, c-format msgid "" "Volume data error at %u:%u! Very short block of %d bytes on device %s " "discarded.\n" msgstr "" -#: src/stored/block.c:985 +#: src/stored/block.c:990 #, c-format msgid "Block length %u is greater than buffer %u. Attempting recovery.\n" msgstr "" -#: src/stored/block.c:1004 +#: src/stored/block.c:1009 #, c-format msgid "Setting block buffer size to %u bytes.\n" msgstr "" -#: src/stored/block.c:1019 +#: src/stored/block.c:1024 #, c-format msgid "" "Volume data error at %u:%u! Short block of %d bytes on device %s discarded.\n" msgstr "" -#: src/stored/bls.c:69 +#: src/stored/bls.c:68 #, c-format msgid "" "Copyright (C) 2000-2005 Kern Sibbald.\n" @@ -9061,74 +9191,74 @@ msgid "" "\n" msgstr "" -#: src/stored/bls.c:190 +#: src/stored/bls.c:189 msgid "No archive name specified\n" msgstr "" -#: src/stored/bls.c:226 +#: src/stored/bls.c:224 #, c-format msgid "" "\n" "Warning, this Volume is a continuation of Volume %s\n" msgstr "" -#: src/stored/bls.c:268 +#: src/stored/bls.c:267 #, c-format msgid "Got EOM at file %u on device %s, Volume \"%s\"\n" msgstr "" -#: src/stored/bls.c:279 +#: src/stored/bls.c:278 #, c-format msgid "Mounted Volume \"%s\".\n" msgstr "" -#: src/stored/bls.c:281 +#: src/stored/bls.c:280 #, c-format msgid "Got EOF at file %u on device %s, Volume \"%s\"\n" msgstr "" -#: src/stored/bls.c:305 +#: src/stored/bls.c:304 #, c-format msgid "" "File:blk=%u:%u blk_num=%u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%" "s rlen=%d\n" msgstr "" -#: src/stored/bls.c:314 +#: src/stored/bls.c:313 #, c-format msgid "Block: %d size=%d\n" msgstr "" -#: src/stored/bls.c:381 +#: src/stored/bls.c:380 #, c-format msgid "FileIndex=%d VolSessionId=%d VolSessionTime=%d Stream=%d DataLen=%d\n" msgstr "" -#: src/stored/bls.c:398 src/stored/read_record.c:321 +#: src/stored/bls.c:397 src/stored/read_record.c:322 msgid "Fresh Volume Label" msgstr "" -#: src/stored/bls.c:401 src/stored/read_record.c:324 +#: src/stored/bls.c:400 src/stored/read_record.c:325 msgid "Volume Label" msgstr "" -#: src/stored/bls.c:405 src/stored/label.c:959 +#: src/stored/bls.c:404 src/stored/label.c:969 msgid "Begin Job Session" msgstr "" -#: src/stored/bls.c:409 src/stored/label.c:962 +#: src/stored/bls.c:408 src/stored/label.c:972 msgid "End Job Session" msgstr "" -#: src/stored/bls.c:412 +#: src/stored/bls.c:411 msgid "End of Medium" msgstr "" -#: src/stored/bls.c:415 src/stored/label.c:971 +#: src/stored/bls.c:414 src/stored/label.c:981 msgid "Unknown" msgstr "" -#: src/stored/bls.c:421 src/stored/read_record.c:342 +#: src/stored/bls.c:420 src/stored/read_record.c:343 #, c-format msgid "%s Record: VolSessionId=%d VolSessionTime=%d JobId=%d DataLen=%d\n" msgstr "" @@ -9160,12 +9290,12 @@ msgid "" "\n" msgstr "" -#: src/stored/bscan.c:234 src/stored/stored.c:266 +#: src/stored/bscan.c:234 src/stored/stored.c:265 #, c-format msgid "No Storage resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/bscan.c:242 src/stored/stored.c:297 +#: src/stored/bscan.c:242 src/stored/stored.c:296 #, c-format msgid "No Working Directory defined in %s. Cannot continue.\n" msgstr "" @@ -9180,7 +9310,7 @@ msgstr "" msgid "Working Directory: %s is not a directory. Cannot continue.\n" msgstr "" -#: src/stored/bscan.c:268 src/stored/bscan.c:340 +#: src/stored/bscan.c:268 src/stored/bscan.c:341 #, c-format msgid "First Volume Size = %sn" msgstr "" @@ -9199,235 +9329,235 @@ msgstr "" msgid "Create JobMedia for Job %s\n" msgstr "" -#: src/stored/bscan.c:325 +#: src/stored/bscan.c:326 #, c-format msgid "Could not create JobMedia record for Volume=%s Job=%s\n" msgstr "" -#: src/stored/bscan.c:381 +#: src/stored/bscan.c:382 #, c-format msgid "done: %d%%\n" msgstr "" -#: src/stored/bscan.c:405 +#: src/stored/bscan.c:406 msgid "Volume is prelabeled. This tape cannot be scanned.\n" msgstr "" -#: src/stored/bscan.c:417 +#: src/stored/bscan.c:418 #, c-format msgid "Pool record for %s found in DB.\n" msgstr "" -#: src/stored/bscan.c:421 +#: src/stored/bscan.c:422 #, c-format msgid "VOL_LABEL: Pool record not found for Pool: %s\n" msgstr "" -#: src/stored/bscan.c:427 +#: src/stored/bscan.c:428 #, c-format msgid "VOL_LABEL: PoolType mismatch. DB=%s Vol=%s\n" msgstr "" -#: src/stored/bscan.c:431 +#: src/stored/bscan.c:432 #, c-format msgid "Pool type \"%s\" is OK.\n" msgstr "" -#: src/stored/bscan.c:441 +#: src/stored/bscan.c:442 #, c-format msgid "Media record for %s found in DB.\n" msgstr "" -#: src/stored/bscan.c:448 +#: src/stored/bscan.c:449 #, c-format msgid "VOL_LABEL: Media record not found for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:455 +#: src/stored/bscan.c:456 #, c-format msgid "VOL_LABEL: MediaType mismatch. DB=%s Vol=%s\n" msgstr "" -#: src/stored/bscan.c:459 +#: src/stored/bscan.c:460 #, c-format msgid "Media type \"%s\" is OK.\n" msgstr "" -#: src/stored/bscan.c:468 +#: src/stored/bscan.c:469 #, c-format msgid "VOL_LABEL: OK for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:475 +#: src/stored/bscan.c:476 #, c-format msgid "%d \"errors\" ignored before first Start of Session record.\n" msgstr "" -#: src/stored/bscan.c:486 +#: src/stored/bscan.c:487 #, c-format msgid "SOS_LABEL: Found Job record for JobId: %d\n" msgstr "" -#: src/stored/bscan.c:491 +#: src/stored/bscan.c:492 #, c-format msgid "SOS_LABEL: Job record not found for JobId: %d\n" msgstr "" -#: src/stored/bscan.c:531 +#: src/stored/bscan.c:532 #, c-format msgid "SOS_LABEL: VolSessId mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:537 +#: src/stored/bscan.c:538 #, c-format msgid "SOS_LABEL: VolSessTime mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:543 +#: src/stored/bscan.c:544 #, c-format msgid "SOS_LABEL: PoolId mismatch for JobId=%u. DB=%d Vol=%d\n" msgstr "" -#: src/stored/bscan.c:561 src/stored/bscan.c:1007 +#: src/stored/bscan.c:562 src/stored/bscan.c:1013 #, c-format msgid "Could not find SessId=%d SessTime=%d for EOS record.\n" msgstr "" -#: src/stored/bscan.c:604 +#: src/stored/bscan.c:606 #, c-format msgid "Could not update job record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:615 +#: src/stored/bscan.c:617 #, c-format msgid "End of all Volumes. VolFiles=%u VolBlocks=%u VolBytes=%s\n" msgstr "" -#: src/stored/bscan.c:627 +#: src/stored/bscan.c:629 #, c-format msgid "Could not find Job for SessId=%d SessTime=%d record.\n" msgstr "" -#: src/stored/bscan.c:663 +#: src/stored/bscan.c:665 #, c-format msgid "%s file records. At file:blk=%s:%s bytes=%s\n" msgstr "" -#: src/stored/bscan.c:706 +#: src/stored/bscan.c:708 #, c-format msgid "Got MD5 record: %s\n" msgstr "" -#: src/stored/bscan.c:715 +#: src/stored/bscan.c:717 #, c-format msgid "Got SHA1 record: %s\n" msgstr "" -#: src/stored/bscan.c:723 +#: src/stored/bscan.c:725 #, c-format msgid "Got Prog Names Stream: %s\n" msgstr "" -#: src/stored/bscan.c:729 +#: src/stored/bscan.c:731 msgid "Got Prog Data Stream record.\n" msgstr "" -#: src/stored/bscan.c:733 +#: src/stored/bscan.c:735 #, c-format msgid "Unknown stream type!!! stream=%d data=%s\n" msgstr "" -#: src/stored/bscan.c:793 +#: src/stored/bscan.c:799 #, c-format msgid "Could not create File Attributes record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:799 +#: src/stored/bscan.c:805 #, c-format msgid "Created File record: %s\n" msgstr "" -#: src/stored/bscan.c:836 +#: src/stored/bscan.c:842 #, c-format msgid "Could not create media record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:840 src/stored/bscan.c:861 +#: src/stored/bscan.c:846 src/stored/bscan.c:867 #, c-format msgid "Could not update media record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:844 +#: src/stored/bscan.c:850 #, c-format msgid "Created Media record for Volume: %s\n" msgstr "" -#: src/stored/bscan.c:865 +#: src/stored/bscan.c:871 #, c-format msgid "Updated Media record at end of Volume: %s\n" msgstr "" -#: src/stored/bscan.c:882 +#: src/stored/bscan.c:888 #, c-format msgid "Could not create pool record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:886 +#: src/stored/bscan.c:892 #, c-format msgid "Created Pool record for Pool: %s\n" msgstr "" -#: src/stored/bscan.c:906 +#: src/stored/bscan.c:912 #, c-format msgid "Created Client record for Client: %s\n" msgstr "" -#: src/stored/bscan.c:923 +#: src/stored/bscan.c:929 #, c-format msgid "Fileset \"%s\" already exists.\n" msgstr "" -#: src/stored/bscan.c:927 +#: src/stored/bscan.c:933 #, c-format msgid "Could not create FileSet record \"%s\". ERR=%s\n" msgstr "" -#: src/stored/bscan.c:932 +#: src/stored/bscan.c:938 #, c-format msgid "Created FileSet record \"%s\"\n" msgstr "" -#: src/stored/bscan.c:979 +#: src/stored/bscan.c:985 #, c-format msgid "Could not create JobId record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:985 +#: src/stored/bscan.c:991 #, c-format msgid "Could not update job start record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:988 +#: src/stored/bscan.c:994 #, c-format msgid "Created new JobId=%u record for original JobId=%u\n" msgstr "" -#: src/stored/bscan.c:1038 +#: src/stored/bscan.c:1044 #, c-format msgid "Could not update JobId=%u record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1043 +#: src/stored/bscan.c:1049 #, c-format msgid "Updated Job termination record for JobId=%u TermStat=%c\n" msgstr "" -#: src/stored/bscan.c:1065 +#: src/stored/bscan.c:1071 #, c-format msgid "Job Termination code: %d" msgstr "" -#: src/stored/bscan.c:1070 +#: src/stored/bscan.c:1076 #, c-format msgid "" "%s\n" @@ -9447,27 +9577,27 @@ msgid "" "\n" msgstr "" -#: src/stored/bscan.c:1134 +#: src/stored/bscan.c:1140 #, c-format msgid "Could not create JobMedia record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1138 +#: src/stored/bscan.c:1144 #, c-format msgid "Created JobMedia record JobId %d, MediaId %d\n" msgstr "" -#: src/stored/bscan.c:1154 +#: src/stored/bscan.c:1160 #, c-format msgid "Could not find SessId=%d SessTime=%d for MD5/SHA1 record.\n" msgstr "" -#: src/stored/bscan.c:1168 +#: src/stored/bscan.c:1174 #, c-format msgid "Could not add MD5/SHA1 to File record. ERR=%s\n" msgstr "" -#: src/stored/bscan.c:1173 +#: src/stored/bscan.c:1179 msgid "Updated MD5/SHA1 record\n" msgstr "" @@ -9518,140 +9648,140 @@ msgstr "" msgid "Improper number of arguments specified.\n" msgstr "" -#: src/stored/btape.c:340 +#: src/stored/btape.c:338 #, c-format msgid "open device %s: OK\n" msgstr "" -#: src/stored/btape.c:361 +#: src/stored/btape.c:359 msgid "Enter Volume Name: " msgstr "" -#: src/stored/btape.c:368 +#: src/stored/btape.c:366 #, c-format msgid "Device open failed. ERR=%s\n" msgstr "" -#: src/stored/btape.c:373 +#: src/stored/btape.c:371 #, c-format msgid "Wrote Volume label for volume \"%s\".\n" msgstr "" -#: src/stored/btape.c:387 +#: src/stored/btape.c:385 msgid "Volume has no label.\n" msgstr "" -#: src/stored/btape.c:390 +#: src/stored/btape.c:388 msgid "Volume label read correctly.\n" msgstr "" -#: src/stored/btape.c:393 +#: src/stored/btape.c:391 #, c-format msgid "I/O error on device: ERR=%s" msgstr "" -#: src/stored/btape.c:396 +#: src/stored/btape.c:394 msgid "Volume name error\n" msgstr "" -#: src/stored/btape.c:399 +#: src/stored/btape.c:397 #, c-format msgid "Error creating label. ERR=%s" msgstr "" -#: src/stored/btape.c:402 +#: src/stored/btape.c:400 msgid "Volume version error.\n" msgstr "" -#: src/stored/btape.c:405 +#: src/stored/btape.c:403 msgid "Bad Volume label type.\n" msgstr "" -#: src/stored/btape.c:408 +#: src/stored/btape.c:406 msgid "Unknown error.\n" msgstr "" -#: src/stored/btape.c:426 +#: src/stored/btape.c:424 #, c-format msgid "Bad status from load. ERR=%s\n" msgstr "" -#: src/stored/btape.c:428 +#: src/stored/btape.c:426 #, c-format msgid "Loaded %s\n" msgstr "" -#: src/stored/btape.c:437 src/stored/btape.c:777 src/stored/btape.c:819 -#: src/stored/btape.c:889 src/stored/btape.c:931 src/stored/btape.c:1200 +#: src/stored/btape.c:435 src/stored/btape.c:775 src/stored/btape.c:817 +#: src/stored/btape.c:887 src/stored/btape.c:929 src/stored/btape.c:1198 #, c-format msgid "Bad status from rewind. ERR=%s\n" msgstr "" -#: src/stored/btape.c:440 src/stored/btape.c:1208 +#: src/stored/btape.c:438 src/stored/btape.c:1206 #, c-format msgid "Rewound %s\n" msgstr "" -#: src/stored/btape.c:467 src/stored/btape.c:1212 +#: src/stored/btape.c:465 src/stored/btape.c:1210 #, c-format msgid "Bad status from weof %d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:471 +#: src/stored/btape.c:469 #, c-format msgid "Wrote 1 EOF to %s\n" msgstr "" -#: src/stored/btape.c:474 +#: src/stored/btape.c:472 #, c-format msgid "Wrote %d EOFs to %s\n" msgstr "" -#: src/stored/btape.c:492 +#: src/stored/btape.c:490 msgid "Moved to end of medium.\n" msgstr "" -#: src/stored/btape.c:519 +#: src/stored/btape.c:517 #, c-format msgid "Bad status from bsf. ERR=%s\n" msgstr "" -#: src/stored/btape.c:521 +#: src/stored/btape.c:519 #, c-format msgid "Backspaced %d file%s.\n" msgstr "" -#: src/stored/btape.c:538 +#: src/stored/btape.c:536 #, c-format msgid "Bad status from bsr. ERR=%s\n" msgstr "" -#: src/stored/btape.c:540 +#: src/stored/btape.c:538 #, c-format msgid "Backspaced %d record%s.\n" msgstr "" -#: src/stored/btape.c:550 src/stored/status.c:220 +#: src/stored/btape.c:548 src/stored/status.c:227 #, c-format msgid "Configured device capabilities:\n" msgstr "" -#: src/stored/btape.c:568 +#: src/stored/btape.c:566 #, c-format msgid "Device status:\n" msgstr "" -#: src/stored/btape.c:582 src/stored/status.c:252 +#: src/stored/btape.c:580 src/stored/status.c:259 #, c-format msgid "Device parameters:\n" msgstr "" -#: src/stored/btape.c:587 +#: src/stored/btape.c:585 #, c-format msgid "Status:\n" msgstr "" -#: src/stored/btape.c:602 +#: src/stored/btape.c:600 msgid "" "Test writting larger and larger records.\n" "This is a torture test for records.\n" @@ -9660,20 +9790,20 @@ msgid "" "plus the header exceeds the block size (by default about 64K)\n" msgstr "" -#: src/stored/btape.c:610 src/stored/btape.c:1814 +#: src/stored/btape.c:608 src/stored/btape.c:1815 msgid "Command aborted.\n" msgstr "" -#: src/stored/btape.c:626 +#: src/stored/btape.c:624 #, c-format msgid "Block %d i=%d\n" msgstr "" -#: src/stored/btape.c:652 +#: src/stored/btape.c:650 msgid "Skipping read backwards test because BSR turned off.\n" msgstr "" -#: src/stored/btape.c:656 +#: src/stored/btape.c:654 msgid "" "\n" "=== Write, backup, and re-read test ===\n" @@ -9687,73 +9817,73 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:669 src/stored/btape.c:680 src/stored/btape.c:691 -#: src/stored/btape.c:789 src/stored/btape.c:805 src/stored/btape.c:901 -#: src/stored/btape.c:917 src/stored/btape.c:1526 src/stored/btape.c:2400 +#: src/stored/btape.c:667 src/stored/btape.c:678 src/stored/btape.c:689 +#: src/stored/btape.c:787 src/stored/btape.c:803 src/stored/btape.c:899 +#: src/stored/btape.c:915 src/stored/btape.c:1524 src/stored/btape.c:2407 msgid "Error writing record to block.\n" msgstr "" -#: src/stored/btape.c:673 src/stored/btape.c:684 src/stored/btape.c:695 -#: src/stored/btape.c:793 src/stored/btape.c:809 src/stored/btape.c:905 -#: src/stored/btape.c:921 src/stored/btape.c:1530 src/stored/btape.c:2404 +#: src/stored/btape.c:671 src/stored/btape.c:682 src/stored/btape.c:693 +#: src/stored/btape.c:791 src/stored/btape.c:807 src/stored/btape.c:903 +#: src/stored/btape.c:919 src/stored/btape.c:1528 src/stored/btape.c:2411 msgid "Error writing block to device.\n" msgstr "" -#: src/stored/btape.c:676 +#: src/stored/btape.c:674 #, c-format msgid "Wrote first record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:687 +#: src/stored/btape.c:685 #, c-format msgid "Wrote second record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:698 +#: src/stored/btape.c:696 #, c-format msgid "Wrote third record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:705 src/stored/btape.c:710 +#: src/stored/btape.c:703 src/stored/btape.c:708 #, c-format msgid "Backspace file failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:714 +#: src/stored/btape.c:712 msgid "Backspaced over EOF OK.\n" msgstr "" -#: src/stored/btape.c:716 +#: src/stored/btape.c:714 #, c-format msgid "Backspace record failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:719 +#: src/stored/btape.c:717 msgid "Backspace record OK.\n" msgstr "" -#: src/stored/btape.c:722 src/stored/btape.c:728 +#: src/stored/btape.c:720 src/stored/btape.c:726 #, c-format msgid "Read block failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:733 +#: src/stored/btape.c:731 msgid "Bad data in record. Test failed!\n" msgstr "" -#: src/stored/btape.c:737 +#: src/stored/btape.c:735 msgid "" "\n" "Block re-read correct. Test succeeded!\n" msgstr "" -#: src/stored/btape.c:738 +#: src/stored/btape.c:736 msgid "" "=== End Write, backup, and re-read test ===\n" "\n" msgstr "" -#: src/stored/btape.c:745 +#: src/stored/btape.c:743 msgid "" "This is not terribly serious since Bacula only uses\n" "this function to verify the last block written to the\n" @@ -9765,7 +9895,7 @@ msgid "" "to your Storage daemon's Device resource definition.\n" msgstr "" -#: src/stored/btape.c:769 +#: src/stored/btape.c:767 msgid "" "\n" "=== Write, rewind, and re-read test ===\n" @@ -9778,46 +9908,46 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:797 src/stored/btape.c:813 src/stored/btape.c:909 -#: src/stored/btape.c:925 +#: src/stored/btape.c:795 src/stored/btape.c:811 src/stored/btape.c:907 +#: src/stored/btape.c:923 #, c-format msgid "Wrote 1000 blocks of %d bytes.\n" msgstr "" -#: src/stored/btape.c:822 src/stored/btape.c:934 +#: src/stored/btape.c:820 src/stored/btape.c:932 msgid "Rewind OK.\n" msgstr "" -#: src/stored/btape.c:829 src/stored/btape.c:983 +#: src/stored/btape.c:827 src/stored/btape.c:981 msgid "Got EOF on tape.\n" msgstr "" -#: src/stored/btape.c:834 +#: src/stored/btape.c:832 #, c-format msgid "Read block %d failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:840 +#: src/stored/btape.c:838 #, c-format msgid "Read record failed. Block %d! ERR=%s\n" msgstr "" -#: src/stored/btape.c:846 src/stored/btape.c:1013 +#: src/stored/btape.c:844 src/stored/btape.c:1011 #, c-format msgid "Bad data in record. Expected %d, got %d at byte %d. Test failed!\n" msgstr "" -#: src/stored/btape.c:853 +#: src/stored/btape.c:851 msgid "1000 blocks re-read correctly.\n" msgstr "" -#: src/stored/btape.c:856 src/stored/btape.c:1020 +#: src/stored/btape.c:854 src/stored/btape.c:1018 msgid "" "=== Test Succeeded. End Write, rewind, and re-read test ===\n" "\n" msgstr "" -#: src/stored/btape.c:881 +#: src/stored/btape.c:879 msgid "" "\n" "=== Write, rewind, and position test ===\n" @@ -9830,23 +9960,23 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:974 +#: src/stored/btape.c:972 #, c-format msgid "Reposition to file:block %d:%d\n" msgstr "" -#: src/stored/btape.c:976 +#: src/stored/btape.c:974 msgid "Reposition error.\n" msgstr "" -#: src/stored/btape.c:989 +#: src/stored/btape.c:987 #, c-format msgid "" "Read block %d failed! file=%d blk=%d. ERR=%s\n" "\n" msgstr "" -#: src/stored/btape.c:991 +#: src/stored/btape.c:989 msgid "" "This may be because the tape drive block size is not\n" " set to variable blocking as normally used by Bacula.\n" @@ -9860,17 +9990,17 @@ msgid "" " in your Device resource.\n" msgstr "" -#: src/stored/btape.c:1007 +#: src/stored/btape.c:1005 #, c-format msgid "Read record failed! ERR=%s\n" msgstr "" -#: src/stored/btape.c:1018 +#: src/stored/btape.c:1016 #, c-format msgid "Block %d re-read correctly.\n" msgstr "" -#: src/stored/btape.c:1039 +#: src/stored/btape.c:1037 msgid "" "\n" "\n" @@ -9884,58 +10014,58 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1063 +#: src/stored/btape.c:1061 msgid "Now moving to end of medium.\n" msgstr "" -#: src/stored/btape.c:1065 src/stored/btape.c:1295 +#: src/stored/btape.c:1063 src/stored/btape.c:1293 #, c-format msgid "We should be in file 3. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1066 src/stored/btape.c:1084 src/stored/btape.c:1284 -#: src/stored/btape.c:1296 src/stored/btape.c:1309 src/stored/btape.c:1326 +#: src/stored/btape.c:1064 src/stored/btape.c:1082 src/stored/btape.c:1282 +#: src/stored/btape.c:1294 src/stored/btape.c:1307 src/stored/btape.c:1324 msgid "This is correct!" msgstr "" -#: src/stored/btape.c:1066 src/stored/btape.c:1084 src/stored/btape.c:1284 -#: src/stored/btape.c:1296 src/stored/btape.c:1309 src/stored/btape.c:1326 +#: src/stored/btape.c:1064 src/stored/btape.c:1082 src/stored/btape.c:1282 +#: src/stored/btape.c:1294 src/stored/btape.c:1307 src/stored/btape.c:1324 msgid "This is NOT correct!!!!" msgstr "" -#: src/stored/btape.c:1072 +#: src/stored/btape.c:1070 msgid "" "\n" "Now the important part, I am going to attempt to append to the tape.\n" "\n" msgstr "" -#: src/stored/btape.c:1079 +#: src/stored/btape.c:1077 msgid "" "Done appending, there should be no I/O errors\n" "\n" msgstr "" -#: src/stored/btape.c:1080 +#: src/stored/btape.c:1078 msgid "Doing Bacula scan of blocks:\n" msgstr "" -#: src/stored/btape.c:1082 +#: src/stored/btape.c:1080 msgid "End scanning the tape.\n" msgstr "" -#: src/stored/btape.c:1083 src/stored/btape.c:1308 +#: src/stored/btape.c:1081 src/stored/btape.c:1306 #, c-format msgid "We should be in file 4. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1108 +#: src/stored/btape.c:1106 msgid "" "\n" "Autochanger enabled, but no name or no command device specified.\n" msgstr "" -#: src/stored/btape.c:1112 +#: src/stored/btape.c:1110 msgid "" "\n" "Ah, I see you have an autochanger configured.\n" @@ -9943,13 +10073,13 @@ msgid "" " that I can write on in Slot 1.\n" msgstr "" -#: src/stored/btape.c:1115 +#: src/stored/btape.c:1113 msgid "" "\n" "Do you wish to continue with the Autochanger test? (y/n): " msgstr "" -#: src/stored/btape.c:1122 +#: src/stored/btape.c:1120 msgid "" "\n" "\n" @@ -9957,74 +10087,74 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1131 +#: src/stored/btape.c:1129 msgid "3301 Issuing autochanger \"loaded\" command.\n" msgstr "" -#: src/stored/btape.c:1140 +#: src/stored/btape.c:1138 #, c-format msgid "3991 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1141 +#: src/stored/btape.c:1139 #, c-format msgid "3991 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1145 +#: src/stored/btape.c:1143 #, c-format msgid "Slot %d loaded. I am going to unload it.\n" msgstr "" -#: src/stored/btape.c:1147 +#: src/stored/btape.c:1145 msgid "Nothing loaded in the drive. OK.\n" msgstr "" -#: src/stored/btape.c:1155 +#: src/stored/btape.c:1153 #, c-format msgid "3302 Issuing autochanger \"unload %d %d\" command.\n" msgstr "" -#: src/stored/btape.c:1160 +#: src/stored/btape.c:1158 #, c-format msgid "unload status=%s %d\n" msgstr "" -#: src/stored/btape.c:1160 +#: src/stored/btape.c:1158 msgid "Bad" msgstr "" -#: src/stored/btape.c:1163 +#: src/stored/btape.c:1161 #, c-format msgid "3992 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1164 +#: src/stored/btape.c:1162 #, c-format msgid "3992 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1174 +#: src/stored/btape.c:1172 #, c-format msgid "3303 Issuing autochanger \"load %d %d\" command.\n" msgstr "" -#: src/stored/btape.c:1182 +#: src/stored/btape.c:1180 #, c-format msgid "3303 Autochanger \"load %d %d\" status is OK.\n" msgstr "" -#: src/stored/btape.c:1186 +#: src/stored/btape.c:1184 #, c-format msgid "3993 Bad autochanger command: %s\n" msgstr "" -#: src/stored/btape.c:1187 +#: src/stored/btape.c:1185 #, c-format msgid "3993 result=\"%s\": ERR=%s\n" msgstr "" -#: src/stored/btape.c:1202 +#: src/stored/btape.c:1200 msgid "" "\n" "The test failed, probably because you need to put\n" @@ -10032,12 +10162,12 @@ msgid "" "Adding a 30 second sleep and trying again ...\n" msgstr "" -#: src/stored/btape.c:1215 +#: src/stored/btape.c:1213 #, c-format msgid "Wrote EOF to %s\n" msgstr "" -#: src/stored/btape.c:1219 +#: src/stored/btape.c:1217 #, c-format msgid "" "\n" @@ -10049,18 +10179,18 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1224 +#: src/stored/btape.c:1222 msgid "" "\n" "The test autochanger worked!!\n" "\n" msgstr "" -#: src/stored/btape.c:1235 +#: src/stored/btape.c:1233 msgid "You must correct this error or the Autochanger will not work.\n" msgstr "" -#: src/stored/btape.c:1253 +#: src/stored/btape.c:1251 msgid "" "\n" "\n" @@ -10072,30 +10202,30 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1278 +#: src/stored/btape.c:1276 msgid "Now forward spacing 1 file.\n" msgstr "" -#: src/stored/btape.c:1280 src/stored/btape.c:1292 src/stored/btape.c:1305 -#: src/stored/btape.c:1323 src/stored/btape.c:1492 +#: src/stored/btape.c:1278 src/stored/btape.c:1290 src/stored/btape.c:1303 +#: src/stored/btape.c:1321 src/stored/btape.c:1490 #, c-format msgid "Bad status from fsr. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1283 +#: src/stored/btape.c:1281 #, c-format msgid "We should be in file 1. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1290 +#: src/stored/btape.c:1288 msgid "Now forward spacing 2 files.\n" msgstr "" -#: src/stored/btape.c:1303 +#: src/stored/btape.c:1301 msgid "Now forward spacing 4 files.\n" msgstr "" -#: src/stored/btape.c:1315 +#: src/stored/btape.c:1313 msgid "" "The test worked this time. Please add:\n" "\n" @@ -10104,35 +10234,35 @@ msgid "" "to your Device resource for this drive.\n" msgstr "" -#: src/stored/btape.c:1321 +#: src/stored/btape.c:1319 msgid "Now forward spacing 1 more file.\n" msgstr "" -#: src/stored/btape.c:1325 +#: src/stored/btape.c:1323 #, c-format msgid "We should be in file 5. I am at file %d. %s\n" msgstr "" -#: src/stored/btape.c:1330 +#: src/stored/btape.c:1328 msgid "" "\n" "=== End Forward space files test ===\n" "\n" msgstr "" -#: src/stored/btape.c:1334 +#: src/stored/btape.c:1332 msgid "" "\n" "The forward space file test failed.\n" msgstr "" -#: src/stored/btape.c:1336 +#: src/stored/btape.c:1334 msgid "" "You have Fast Forward Space File enabled.\n" "I am turning it off then retrying the test.\n" msgstr "" -#: src/stored/btape.c:1342 +#: src/stored/btape.c:1340 msgid "" "You must correct this error or Bacula will not work.\n" "Some systems, e.g. OpenBSD, require you to set\n" @@ -10140,7 +10270,7 @@ msgid "" "in your device resource. Use with caution.\n" msgstr "" -#: src/stored/btape.c:1374 +#: src/stored/btape.c:1372 msgid "" "\n" "Append test failed. Attempting again.\n" @@ -10150,7 +10280,7 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1382 +#: src/stored/btape.c:1380 msgid "" "\n" "\n" @@ -10162,14 +10292,14 @@ msgid "" "to your Device resource in the Storage conf file.\n" msgstr "" -#: src/stored/btape.c:1389 +#: src/stored/btape.c:1387 msgid "" "\n" "\n" "That appears *NOT* to have corrected the problem.\n" msgstr "" -#: src/stored/btape.c:1394 +#: src/stored/btape.c:1392 msgid "" "\n" "\n" @@ -10177,7 +10307,7 @@ msgid "" "Setting \"BSF at EOM = yes\" and retrying append test.\n" msgstr "" -#: src/stored/btape.c:1399 +#: src/stored/btape.c:1397 msgid "" "\n" "\n" @@ -10190,7 +10320,7 @@ msgid "" "to your Device resource in the Storage conf file.\n" msgstr "" -#: src/stored/btape.c:1410 +#: src/stored/btape.c:1408 msgid "" "\n" "Append test failed.\n" @@ -10217,7 +10347,7 @@ msgid "" "in your device resource. Use with caution.\n" msgstr "" -#: src/stored/btape.c:1431 +#: src/stored/btape.c:1429 msgid "" "\n" "The above Bacula scan should have output identical to what follows.\n" @@ -10241,116 +10371,116 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1470 +#: src/stored/btape.c:1468 #, c-format msgid "Bad status from fsf. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1474 +#: src/stored/btape.c:1472 msgid "Forward spaced 1 file.\n" msgstr "" -#: src/stored/btape.c:1477 +#: src/stored/btape.c:1475 #, c-format msgid "Forward spaced %d files.\n" msgstr "" -#: src/stored/btape.c:1496 +#: src/stored/btape.c:1494 msgid "Forward spaced 1 record.\n" msgstr "" -#: src/stored/btape.c:1499 +#: src/stored/btape.c:1497 #, c-format msgid "Forward spaced %d records.\n" msgstr "" -#: src/stored/btape.c:1533 +#: src/stored/btape.c:1531 #, c-format msgid "Wrote one record of %d bytes.\n" msgstr "" -#: src/stored/btape.c:1535 +#: src/stored/btape.c:1533 msgid "Wrote block to device.\n" msgstr "" -#: src/stored/btape.c:1550 +#: src/stored/btape.c:1548 msgid "Enter length to read: " msgstr "" -#: src/stored/btape.c:1555 +#: src/stored/btape.c:1553 msgid "Bad length entered, using default of 1024 bytes.\n" msgstr "" -#: src/stored/btape.c:1564 +#: src/stored/btape.c:1562 #, c-format msgid "Read of %d bytes gives stat=%d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1587 src/stored/btape.c:1636 +#: src/stored/btape.c:1585 src/stored/btape.c:1634 #, c-format msgid "End of tape\n" msgstr "" -#: src/stored/btape.c:1592 +#: src/stored/btape.c:1590 #, c-format msgid "Starting scan at file %u\n" msgstr "" -#: src/stored/btape.c:1597 src/stored/dev.c:1238 +#: src/stored/btape.c:1595 src/stored/dev.c:1229 #, c-format msgid "read error on %s. ERR=%s.\n" msgstr "" -#: src/stored/btape.c:1599 +#: src/stored/btape.c:1597 #, c-format msgid "Bad status from read %d. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1602 src/stored/btape.c:1616 src/stored/btape.c:1679 -#: src/stored/btape.c:1691 src/stored/btape.c:1704 src/stored/btape.c:1720 +#: src/stored/btape.c:1600 src/stored/btape.c:1614 src/stored/btape.c:1678 +#: src/stored/btape.c:1690 src/stored/btape.c:1703 src/stored/btape.c:1719 #, c-format msgid "1 block of %d bytes in file %d\n" msgstr "" -#: src/stored/btape.c:1605 src/stored/btape.c:1619 src/stored/btape.c:1682 -#: src/stored/btape.c:1694 src/stored/btape.c:1707 src/stored/btape.c:1723 +#: src/stored/btape.c:1603 src/stored/btape.c:1617 src/stored/btape.c:1681 +#: src/stored/btape.c:1693 src/stored/btape.c:1706 src/stored/btape.c:1722 #, c-format msgid "%d blocks of %d bytes in file %d\n" msgstr "" -#: src/stored/btape.c:1627 src/stored/btape.c:1698 +#: src/stored/btape.c:1625 src/stored/btape.c:1697 #, c-format msgid "End of File mark.\n" msgstr "" -#: src/stored/btape.c:1648 src/stored/btape.c:1751 +#: src/stored/btape.c:1646 src/stored/btape.c:1750 #, c-format msgid "Total files=%d, blocks=%d, bytes = %s\n" msgstr "" -#: src/stored/btape.c:1711 +#: src/stored/btape.c:1710 #, c-format msgid "Short block read.\n" msgstr "" -#: src/stored/btape.c:1714 +#: src/stored/btape.c:1713 #, c-format msgid "Error reading block. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1738 +#: src/stored/btape.c:1737 #, c-format msgid "" "Blk_block: %u dev_blk=%u blen=%u First rec FI=%s SessId=%u SessTim=%u Strm=%" "s rlen=%d\n" msgstr "" -#: src/stored/btape.c:1760 +#: src/stored/btape.c:1759 #, c-format msgid "Device status: %u. ERR=%s\n" msgstr "" -#: src/stored/btape.c:1788 +#: src/stored/btape.c:1789 msgid "" "\n" "This command simulates Bacula writing to a tape.\n" @@ -10375,95 +10505,98 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:1805 +#: src/stored/btape.c:1806 msgid "" "Do you want to run the simplified test (s) with one tape\n" "or the complete multiple tape (m) test: (s/m) " msgstr "" -#: src/stored/btape.c:1808 +#: src/stored/btape.c:1809 msgid "Simple test (single tape) selected.\n" msgstr "" -#: src/stored/btape.c:1811 +#: src/stored/btape.c:1812 msgid "Multiple tape test selected.\n" msgstr "" -#: src/stored/btape.c:1827 +#: src/stored/btape.c:1828 msgid "Rewind failed.\n" msgstr "" -#: src/stored/btape.c:1830 +#: src/stored/btape.c:1831 msgid "Write EOF failed.\n" msgstr "" -#: src/stored/btape.c:1857 +#: src/stored/btape.c:1858 msgid "Wrote Start of Session label.\n" msgstr "" -#: src/stored/btape.c:1886 -msgid "Begin writing Bacula records to tape ...\n" +#: src/stored/btape.c:1889 +#, c-format +msgid "%s Begin writing Bacula records to tape ...\n" msgstr "" -#: src/stored/btape.c:1888 -msgid "Begin writing Bacula records to first tape ...\n" +#: src/stored/btape.c:1891 +#, c-format +msgid "%s Begin writing Bacula records to first tape ...\n" msgstr "" -#: src/stored/btape.c:1928 +#: src/stored/btape.c:1932 #, c-format msgid "Wrote blk_block=%u, dev_blk_num=%u VolBytes=%s rate=%.1f KB/s\n" msgstr "" -#: src/stored/btape.c:1935 -msgid "Flush block, write EOF\n" +#: src/stored/btape.c:1942 +#, c-format +msgid "%s Flush block, write EOF\n" msgstr "" -#: src/stored/btape.c:1946 +#: src/stored/btape.c:1953 msgid "Not OK\n" msgstr "" -#: src/stored/btape.c:1974 +#: src/stored/btape.c:1981 msgid "Set ok=false after write_block_to_device.\n" msgstr "" -#: src/stored/btape.c:1977 +#: src/stored/btape.c:1984 msgid "Wrote End of Session label.\n" msgstr "" -#: src/stored/btape.c:2001 +#: src/stored/btape.c:2008 #, c-format msgid "Wrote state file last_block_num1=%d last_block_num2=%d\n" msgstr "" -#: src/stored/btape.c:2005 +#: src/stored/btape.c:2012 #, c-format msgid "Could not create state file: %s ERR=%s\n" msgstr "" -#: src/stored/btape.c:2010 +#: src/stored/btape.c:2020 #, c-format msgid "" "\n" "\n" -"Done filling tape at %d:%d. Now beginning re-read of tape ...\n" +"%s Done filling tape at %d:%d. Now beginning re-read of tape ...\n" msgstr "" -#: src/stored/btape.c:2014 +#: src/stored/btape.c:2024 #, c-format msgid "" "\n" "\n" -"Done filling tapes at %d:%d. Now beginning re-read of first tape ...\n" +"%s Done filling tapes at %d:%d. Now beginning re-read of first tape ...\n" msgstr "" -#: src/stored/btape.c:2053 +#: src/stored/btape.c:2063 msgid "" "\n" "The state file level has changed. You must redo\n" "the fill command.\n" msgstr "" -#: src/stored/btape.c:2059 +#: src/stored/btape.c:2069 #, c-format msgid "" "\n" @@ -10471,95 +10604,95 @@ msgid "" "You must redo the fill command.\n" msgstr "" -#: src/stored/btape.c:2101 +#: src/stored/btape.c:2111 msgid "Mount first tape. Press enter when ready: " msgstr "" -#: src/stored/btape.c:2125 -msgid "Reading the first 10000 records.\n" +#: src/stored/btape.c:2131 +msgid "Rewinding.\n" msgstr "" -#: src/stored/btape.c:2128 src/stored/btape.c:2195 +#: src/stored/btape.c:2136 +#, c-format +msgid "Reading the first 10000 records from %u:%u.\n" +msgstr "" + +#: src/stored/btape.c:2140 src/stored/btape.c:2207 #, c-format msgid "Reposition from %u:%u to %u:%u\n" msgstr "" -#: src/stored/btape.c:2131 src/stored/btape.c:2182 src/stored/btape.c:2198 +#: src/stored/btape.c:2143 src/stored/btape.c:2194 src/stored/btape.c:2210 #, c-format msgid "Reposition error. ERR=%s\n" msgstr "" -#: src/stored/btape.c:2134 +#: src/stored/btape.c:2146 #, c-format msgid "Reading block %u.\n" msgstr "" -#: src/stored/btape.c:2136 src/stored/btape.c:2187 src/stored/btape.c:2203 +#: src/stored/btape.c:2148 src/stored/btape.c:2199 src/stored/btape.c:2215 #, c-format msgid "Error reading block: ERR=%s\n" msgstr "" -#: src/stored/btape.c:2141 +#: src/stored/btape.c:2153 msgid "" "\n" "The last block on the tape matches. Test succeeded.\n" "\n" msgstr "" -#: src/stored/btape.c:2143 +#: src/stored/btape.c:2155 msgid "" "\n" "The last block of the first tape matches.\n" "\n" msgstr "" -#: src/stored/btape.c:2168 +#: src/stored/btape.c:2180 msgid "Mount second tape. Press enter when ready: " msgstr "" -#: src/stored/btape.c:2180 +#: src/stored/btape.c:2192 #, c-format msgid "Reposition from %u:%u to 0:1\n" msgstr "" -#: src/stored/btape.c:2185 src/stored/btape.c:2201 +#: src/stored/btape.c:2197 src/stored/btape.c:2213 #, c-format msgid "Reading block %d.\n" msgstr "" -#: src/stored/btape.c:2191 +#: src/stored/btape.c:2203 msgid "" "\n" "The first block on the second tape matches.\n" "\n" msgstr "" -#: src/stored/btape.c:2207 +#: src/stored/btape.c:2219 msgid "" "\n" "The last block on the second tape matches. Test succeeded.\n" "\n" msgstr "" -#: src/stored/btape.c:2221 -#, c-format -msgid "ERROR! device at %d:%d count=%d\n" -msgstr "" - -#: src/stored/btape.c:2227 +#: src/stored/btape.c:2234 #, c-format -msgid "1000 records read now at %d:%d\n" +msgid "10000 records read now at %d:%d\n" msgstr "" -#: src/stored/btape.c:2250 src/stored/btape.c:2261 src/stored/btape.c:2309 +#: src/stored/btape.c:2257 src/stored/btape.c:2268 src/stored/btape.c:2316 msgid "Last block written" msgstr "" -#: src/stored/btape.c:2252 src/stored/btape.c:2262 +#: src/stored/btape.c:2259 src/stored/btape.c:2269 msgid "Block read back" msgstr "" -#: src/stored/btape.c:2253 +#: src/stored/btape.c:2260 #, c-format msgid "" "\n" @@ -10567,7 +10700,7 @@ msgid "" "The blocks differ at byte %u\n" msgstr "" -#: src/stored/btape.c:2254 +#: src/stored/btape.c:2261 msgid "" "\n" "\n" @@ -10577,177 +10710,177 @@ msgid "" "to write multi-tape Volumes.!!!!\n" msgstr "" -#: src/stored/btape.c:2293 +#: src/stored/btape.c:2300 #, c-format msgid "Last block at: %u:%u this_dev_block_num=%d\n" msgstr "" -#: src/stored/btape.c:2307 +#: src/stored/btape.c:2314 #, c-format msgid "Block not written: FileIndex=%u blk_block=%u Size=%u\n" msgstr "" -#: src/stored/btape.c:2311 +#: src/stored/btape.c:2318 msgid "Block not written" msgstr "" -#: src/stored/btape.c:2326 +#: src/stored/btape.c:2333 #, c-format msgid "End of tape %d:%d. VolumeCapacity=%s. Write rate = %.1f KB/s\n" msgstr "" -#: src/stored/btape.c:2376 +#: src/stored/btape.c:2383 msgid "Test writing blocks of 64512 bytes to tape.\n" msgstr "" -#: src/stored/btape.c:2378 +#: src/stored/btape.c:2385 msgid "How many blocks do you want to write? (1000): " msgstr "" -#: src/stored/btape.c:2393 +#: src/stored/btape.c:2400 #, c-format msgid "Begin writing %d Bacula blocks to tape ...\n" msgstr "" -#: src/stored/btape.c:2445 +#: src/stored/btape.c:2452 #, c-format msgid "Begin writing raw blocks of %u bytes.\n" msgstr "" -#: src/stored/btape.c:2465 +#: src/stored/btape.c:2472 #, c-format msgid "Write failed at block %u. stat=%d ERR=%s\n" msgstr "" -#: src/stored/btape.c:2495 +#: src/stored/btape.c:2502 #, c-format msgid "Begin writing Bacula blocks of %u bytes.\n" msgstr "" -#: src/stored/btape.c:2514 +#: src/stored/btape.c:2521 #, c-format msgid "Write failed at block %u.\n" msgstr "" -#: src/stored/btape.c:2521 +#: src/stored/btape.c:2528 msgid "test autochanger" msgstr "" -#: src/stored/btape.c:2522 +#: src/stored/btape.c:2529 msgid "backspace file" msgstr "" -#: src/stored/btape.c:2523 +#: src/stored/btape.c:2530 msgid "backspace record" msgstr "" -#: src/stored/btape.c:2524 +#: src/stored/btape.c:2531 msgid "fill tape using Bacula writes" msgstr "" -#: src/stored/btape.c:2525 +#: src/stored/btape.c:2532 msgid "list device capabilities" msgstr "" -#: src/stored/btape.c:2526 +#: src/stored/btape.c:2533 msgid "clear tape errors" msgstr "" -#: src/stored/btape.c:2527 +#: src/stored/btape.c:2534 msgid "go to end of Bacula data for append" msgstr "" -#: src/stored/btape.c:2528 +#: src/stored/btape.c:2535 msgid "go to the physical end of medium" msgstr "" -#: src/stored/btape.c:2529 +#: src/stored/btape.c:2536 msgid "fill tape, write onto second volume" msgstr "" -#: src/stored/btape.c:2530 +#: src/stored/btape.c:2537 msgid "read filled tape" msgstr "" -#: src/stored/btape.c:2531 +#: src/stored/btape.c:2538 msgid "forward space a file" msgstr "" -#: src/stored/btape.c:2532 +#: src/stored/btape.c:2539 msgid "forward space a record" msgstr "" -#: src/stored/btape.c:2534 +#: src/stored/btape.c:2541 msgid "write a Bacula label to the tape" msgstr "" -#: src/stored/btape.c:2535 +#: src/stored/btape.c:2542 msgid "load a tape" msgstr "" -#: src/stored/btape.c:2536 +#: src/stored/btape.c:2543 msgid "quit btape" msgstr "" -#: src/stored/btape.c:2537 +#: src/stored/btape.c:2544 msgid "use write() to fill tape" msgstr "" -#: src/stored/btape.c:2538 +#: src/stored/btape.c:2545 msgid "read and print the Bacula tape label" msgstr "" -#: src/stored/btape.c:2539 +#: src/stored/btape.c:2546 msgid "test record handling functions" msgstr "" -#: src/stored/btape.c:2540 +#: src/stored/btape.c:2547 msgid "rewind the tape" msgstr "" -#: src/stored/btape.c:2541 +#: src/stored/btape.c:2548 msgid "read() tape block by block to EOT and report" msgstr "" -#: src/stored/btape.c:2542 +#: src/stored/btape.c:2549 msgid "Bacula read block by block to EOT and report" msgstr "" -#: src/stored/btape.c:2543 +#: src/stored/btape.c:2550 msgid "print tape status" msgstr "" -#: src/stored/btape.c:2544 +#: src/stored/btape.c:2551 msgid "General test Bacula tape functions" msgstr "" -#: src/stored/btape.c:2545 +#: src/stored/btape.c:2552 msgid "write an EOF on the tape" msgstr "" -#: src/stored/btape.c:2546 +#: src/stored/btape.c:2553 msgid "write a single Bacula block" msgstr "" -#: src/stored/btape.c:2547 +#: src/stored/btape.c:2554 msgid "read a single record" msgstr "" -#: src/stored/btape.c:2548 +#: src/stored/btape.c:2555 msgid "quick fill command" msgstr "" -#: src/stored/btape.c:2569 +#: src/stored/btape.c:2576 #, c-format msgid "%s is an illegal command\n" msgstr "" -#: src/stored/btape.c:2579 +#: src/stored/btape.c:2586 #, c-format msgid "Interactive commands:\n" msgstr "" -#: src/stored/btape.c:2589 +#: src/stored/btape.c:2596 #, c-format msgid "" "Copyright (C) 2000-2005 Kern Sibbald.\n" @@ -10765,27 +10898,27 @@ msgid "" "\n" msgstr "" -#: src/stored/btape.c:2680 +#: src/stored/btape.c:2687 #, c-format msgid "Mount second Volume on device %s and press return when ready: " msgstr "" -#: src/stored/btape.c:2707 +#: src/stored/btape.c:2714 #, c-format msgid "Mount blank Volume on device %s and press return when ready: " msgstr "" -#: src/stored/btape.c:2725 +#: src/stored/btape.c:2732 #, c-format msgid "End of Volume \"%s\"\n" msgstr "" -#: src/stored/btape.c:2737 +#: src/stored/btape.c:2744 #, c-format msgid "Read block=%u, VolBytes=%s rate=%.1f KB/s\n" msgstr "" -#: src/stored/btape.c:2752 src/stored/mount.c:493 +#: src/stored/btape.c:2759 src/stored/mount.c:500 #, c-format msgid "Cannot open Dev=%s, Vol=%s\n" msgstr "" @@ -10810,358 +10943,345 @@ msgstr "" msgid "cont," msgstr "" -#: src/stored/butil.c:128 +#: src/stored/butil.c:130 msgid "Volume name or names is too long. Please use a .bsr file.\n" msgstr "" -#: src/stored/butil.c:148 +#: src/stored/butil.c:150 #, c-format msgid "Cannot find device \"%s\" in config file %s.\n" msgstr "" -#: src/stored/butil.c:155 +#: src/stored/butil.c:157 #, c-format msgid "Cannot init device %s\n" msgstr "" -#: src/stored/butil.c:174 +#: src/stored/butil.c:178 #, c-format msgid "Cannot open %s\n" msgstr "" -#: src/stored/butil.c:253 +#: src/stored/butil.c:261 #, c-format msgid "Could not find device \"%s\" in config file %s.\n" msgstr "" -#: src/stored/butil.c:258 +#: src/stored/butil.c:266 #, c-format msgid "Using device: \"%s\" for reading.\n" msgstr "" -#: src/stored/butil.c:261 +#: src/stored/butil.c:269 #, c-format msgid "Using device: \"%s\" for writing.\n" msgstr "" -#: src/stored/butil.c:277 +#: src/stored/butil.c:285 msgid "Unexpected End of Data\n" msgstr "" -#: src/stored/butil.c:279 +#: src/stored/butil.c:287 msgid "Unexpected End of Tape\n" msgstr "" -#: src/stored/butil.c:281 +#: src/stored/butil.c:289 msgid "Unexpected End of File\n" msgstr "" -#: src/stored/butil.c:283 +#: src/stored/butil.c:291 msgid "Tape Door is Open\n" msgstr "" -#: src/stored/butil.c:285 +#: src/stored/butil.c:293 msgid "Unexpected Tape is Off-line\n" msgstr "" -#: src/stored/dev.c:110 +#: src/stored/dev.c:112 #, c-format msgid "Unable to stat device %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:125 +#: src/stored/dev.c:123 #, c-format msgid "" "%s is an unknown device type. Must be tape or directory\n" " or have RequiresMount=yes for DVD. st_mode=%x\n" msgstr "" -#: src/stored/dev.c:183 +#: src/stored/dev.c:179 #, c-format msgid "Unable to stat mount point %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:188 +#: src/stored/dev.c:186 msgid "" "Mount and unmount commands must defined for a device which requires mount.\n" msgstr "" -#: src/stored/dev.c:191 +#: src/stored/dev.c:189 msgid "Write part command must be defined for a device which requires mount.\n" msgstr "" -#: src/stored/dev.c:197 +#: src/stored/dev.c:194 #, c-format msgid "Block size %u on device %s is too large, using default %u\n" msgstr "" -#: src/stored/dev.c:202 +#: src/stored/dev.c:199 #, c-format msgid "Max block size %u not multiple of device %s block size.\n" msgstr "" -#: src/stored/dev.c:218 src/stored/dev.c:224 +#: src/stored/dev.c:215 src/stored/dev.c:221 #, c-format msgid "Unable to init cond variable: ERR=%s\n" msgstr "" -#: src/stored/dev.c:310 +#: src/stored/dev.c:312 msgid "Illegal mode given to open dev.\n" msgstr "" -#: src/stored/dev.c:376 src/stored/device.c:302 +#: src/stored/dev.c:355 src/stored/device.c:295 #, c-format msgid "Unable to open device %s: ERR=%s\n" msgstr "" -#: src/stored/dev.c:396 -#, c-format -msgid "fcntl error. ERR=%s\n" -msgstr "" - -#: src/stored/dev.c:434 src/stored/dev.c:493 +#: src/stored/dev.c:423 src/stored/dev.c:481 #, c-format msgid "Could not open file device %s. No Volume name given.\n" msgstr "" -#: src/stored/dev.c:459 src/stored/dev.c:573 +#: src/stored/dev.c:449 src/stored/dev.c:562 #, c-format msgid "Could not open: %s, ERR=%s\n" msgstr "" -#: src/stored/dev.c:518 +#: src/stored/dev.c:506 #, c-format msgid "" "The media in the device %s is not empty, please blank it before writing " "anything to it.\n" msgstr "" -#: src/stored/dev.c:534 +#: src/stored/dev.c:523 #, c-format msgid "There is no valid media in the device %s.\n" msgstr "" -#: src/stored/dev.c:541 +#: src/stored/dev.c:530 #, c-format msgid "Could not mount device %s.\n" msgstr "" -#: src/stored/dev.c:599 +#: src/stored/dev.c:588 #, c-format msgid "Could not fstat: %s, ERR=%s\n" msgstr "" -#: src/stored/dev.c:652 +#: src/stored/dev.c:631 #, c-format -msgid "Bad call to rewind_dev. Device %s not open\n" +msgid "Bad call to rewind. Device %s not open\n" msgstr "" -#: src/stored/dev.c:681 +#: src/stored/dev.c:677 #, c-format msgid "Rewind error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:691 src/stored/dev.c:804 src/stored/dev.c:941 -#: src/stored/dev.c:1466 +#: src/stored/dev.c:687 src/stored/dev.c:802 src/stored/dev.c:938 +#: src/stored/dev.c:1457 #, c-format msgid "lseek_dev error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:731 +#: src/stored/dev.c:727 msgid "unknown blocked code" msgstr "" -#: src/stored/dev.c:774 +#: src/stored/dev.c:772 #, c-format msgid "Bad call to eod_dev. Device %s not open\n" msgstr "" -#: src/stored/dev.c:840 +#: src/stored/dev.c:838 #, c-format msgid "ioctl MTEOM error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:848 src/stored/dev.c:981 +#: src/stored/dev.c:846 src/stored/dev.c:978 #, c-format msgid "ioctl MTIOCGET error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:927 +#: src/stored/dev.c:924 msgid "Bad device call. Device not open\n" msgstr "" -#: src/stored/dev.c:940 +#: src/stored/dev.c:937 #, c-format msgid "Seek error: ERR=%s\n" msgstr "" -#: src/stored/dev.c:976 +#: src/stored/dev.c:973 msgid " Bacula status:" msgstr "" -#: src/stored/dev.c:977 src/stored/dev.c:1026 src/stored/dev.c:1028 +#: src/stored/dev.c:974 src/stored/dev.c:1023 src/stored/dev.c:1025 #, c-format msgid " file=%d block=%d\n" msgstr "" -#: src/stored/dev.c:985 +#: src/stored/dev.c:982 msgid " Device status:" msgstr "" -#: src/stored/dev.c:1050 +#: src/stored/dev.c:1047 msgid "Bad call to load_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1061 src/stored/dev.c:1074 +#: src/stored/dev.c:1058 src/stored/dev.c:1071 #, c-format msgid "ioctl MTLOAD error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1093 -msgid "Bad call to offline_dev. Device not open\n" -msgstr "" - -#: src/stored/dev.c:1116 +#: src/stored/dev.c:1107 #, c-format msgid "ioctl MTOFFL error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1157 +#: src/stored/dev.c:1148 msgid "Bad call to fsf_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1167 src/stored/dev.c:1288 +#: src/stored/dev.c:1158 src/stored/dev.c:1279 #, c-format msgid "Device %s at End of Tape.\n" msgstr "" -#: src/stored/dev.c:1192 src/stored/dev.c:1268 +#: src/stored/dev.c:1183 src/stored/dev.c:1259 #, c-format msgid "ioctl MTFSF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1317 +#: src/stored/dev.c:1308 msgid "Bad call to bsf_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1323 +#: src/stored/dev.c:1314 #, c-format msgid "Device %s cannot BSF because it is not a tape.\n" msgstr "" -#: src/stored/dev.c:1338 +#: src/stored/dev.c:1329 #, c-format msgid "ioctl MTBSF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1358 +#: src/stored/dev.c:1349 msgid "Bad call to fsr. Device not open\n" msgstr "" -#: src/stored/dev.c:1367 +#: src/stored/dev.c:1358 #, c-format msgid "ioctl MTFSR not permitted on %s.\n" msgstr "" -#: src/stored/dev.c:1395 +#: src/stored/dev.c:1386 #, c-format msgid "ioctl MTFSR %d error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1415 +#: src/stored/dev.c:1406 msgid "Bad call to bsr_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1425 +#: src/stored/dev.c:1416 #, c-format msgid "ioctl MTBSR not permitted on %s.\n" msgstr "" -#: src/stored/dev.c:1438 +#: src/stored/dev.c:1429 #, c-format msgid "ioctl MTBSR error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1455 +#: src/stored/dev.c:1446 msgid "Bad call to reposition_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1523 +#: src/stored/dev.c:1514 msgid "Bad call to weof_dev. Device not open\n" msgstr "" -#: src/stored/dev.c:1533 +#: src/stored/dev.c:1524 msgid "Attempt to WEOF on non-appendable Volume\n" msgstr "" -#: src/stored/dev.c:1550 +#: src/stored/dev.c:1541 #, c-format msgid "ioctl MTWEOF error on %s. ERR=%s.\n" msgstr "" -#: src/stored/dev.c:1592 +#: src/stored/dev.c:1583 msgid "Got ENOTTY on read/write!\n" msgstr "" -#: src/stored/dev.c:1639 +#: src/stored/dev.c:1630 #, c-format msgid "unknown func code %d" msgstr "" -#: src/stored/dev.c:1645 +#: src/stored/dev.c:1636 #, c-format msgid "I/O function \"%s\" not supported on this device.\n" msgstr "" -#: src/stored/dev.c:1783 src/stored/dvd.c:668 +#: src/stored/dev.c:1761 src/stored/dvd.c:734 #, c-format msgid "Unable to truncate device %s. ERR=%s\n" msgstr "" -#: src/stored/dev.c:1822 +#: src/stored/dev.c:1800 msgid "Bad call to term_dev. Device not open\n" msgstr "" -#: src/stored/device.c:105 +#: src/stored/device.c:100 #, c-format msgid "End of medium on Volume \"%s\" Bytes=%s Blocks=%s at %s.\n" msgstr "" -#: src/stored/device.c:119 +#: src/stored/device.c:114 #, c-format msgid "New volume \"%s\" mounted on device %s at %s.\n" msgstr "" -#: src/stored/device.c:131 +#: src/stored/device.c:126 #, c-format msgid "write_block_to_device Volume label failed. ERR=%s" msgstr "" -#: src/stored/device.c:168 +#: src/stored/device.c:162 #, c-format msgid "write_block_to_device overflow block failed. ERR=%s" msgstr "" -#: src/stored/device.c:304 +#: src/stored/device.c:297 #, c-format msgid "Unable to open archive %s: ERR=%s\n" msgstr "" -#: src/stored/device.c:328 -msgid "Bad call to force_close_dev. Device not open\n" -msgstr "" - -#: src/stored/device.c:346 +#: src/stored/device.c:332 #, c-format msgid "Device write lock failure. ERR=%s\n" msgstr "" -#: src/stored/device.c:354 +#: src/stored/device.c:340 #, c-format msgid "Device write unlock failure. ERR=%s\n" msgstr "" -#: src/stored/device.c:373 +#: src/stored/device.c:359 #, c-format msgid "pthread_cond_wait failure. ERR=%s\n" msgstr "" @@ -11182,72 +11302,72 @@ msgstr "" #: src/stored/dircmd.c:262 #, c-format -msgid "3902 Job %s not found.\n" +msgid "3904 Job %s not found.\n" msgstr "" -#: src/stored/dircmd.c:279 +#: src/stored/dircmd.c:283 #, c-format msgid "3000 Job %s marked to be canceled.\n" msgstr "" -#: src/stored/dircmd.c:283 +#: src/stored/dircmd.c:287 msgid "3903 Error scanning cancel command.\n" msgstr "" -#: src/stored/dircmd.c:356 src/stored/dircmd.c:655 src/stored/dircmd.c:720 -#: src/stored/dircmd.c:779 src/stored/dircmd.c:829 src/stored/dircmd.c:869 +#: src/stored/dircmd.c:364 src/stored/dircmd.c:680 src/stored/dircmd.c:756 +#: src/stored/dircmd.c:819 src/stored/dircmd.c:874 src/stored/dircmd.c:918 #, c-format -msgid "3999 Device \"%s\" not found\n" +msgid "3999 Device \"%s\" not found or could not be opened.\n" msgstr "" -#: src/stored/dircmd.c:361 +#: src/stored/dircmd.c:369 #, c-format msgid "3903 Error scanning label command: %s\n" msgstr "" -#: src/stored/dircmd.c:405 +#: src/stored/dircmd.c:412 #, c-format msgid "3920 Cannot label Volume because it is already labeled: \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:411 +#: src/stored/dircmd.c:419 msgid "3921 Wrong volume mounted.\n" msgstr "" -#: src/stored/dircmd.c:415 +#: src/stored/dircmd.c:423 msgid "3922 Cannot relabel an ANSI/IBM labeled Volume.\n" msgstr "" -#: src/stored/dircmd.c:423 src/stored/dircmd.c:432 +#: src/stored/dircmd.c:431 src/stored/dircmd.c:440 #, c-format msgid "3912 Failed to label Volume: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:435 +#: src/stored/dircmd.c:443 #, c-format msgid "3913 Cannot label Volume. Unknown status %d from read_volume_label()\n" msgstr "" -#: src/stored/dircmd.c:468 +#: src/stored/dircmd.c:476 #, c-format msgid "3001 Mounted Volume: %s\n" msgstr "" -#: src/stored/dircmd.c:472 src/stored/dircmd.c:905 +#: src/stored/dircmd.c:480 src/stored/dircmd.c:954 #, c-format msgid "" "3902 Cannot mount Volume on Storage Device %s because:\n" "%s" msgstr "" -#: src/stored/dircmd.c:495 src/stored/reserve.c:554 +#: src/stored/dircmd.c:508 src/stored/reserve.c:634 #, c-format msgid "" "\n" " Device \"%s\" requested by DIR could not be opened or does not exist.\n" msgstr "" -#: src/stored/dircmd.c:516 src/stored/reserve.c:550 +#: src/stored/dircmd.c:529 src/stored/reserve.c:630 #, c-format msgid "" "\n" @@ -11255,151 +11375,217 @@ msgid "" "does not exist.\n" msgstr "" -#: src/stored/dircmd.c:575 src/stored/dircmd.c:623 +#: src/stored/dircmd.c:593 src/stored/dircmd.c:646 #, c-format msgid "3901 open device failed: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:590 src/stored/dircmd.c:614 +#: src/stored/dircmd.c:613 src/stored/dircmd.c:637 #, c-format msgid "3001 Device %s is mounted with Volume \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:593 src/stored/dircmd.c:617 src/stored/dircmd.c:632 +#: src/stored/dircmd.c:616 src/stored/dircmd.c:640 src/stored/dircmd.c:655 #, c-format msgid "" "3905 Device %s open but no Bacula volume is mounted.\n" "If this is not a blank tape, try unmounting and remounting the Volume.\n" msgstr "" -#: src/stored/dircmd.c:602 +#: src/stored/dircmd.c:625 #, c-format msgid "3001 Device %s is doing acquire.\n" msgstr "" -#: src/stored/dircmd.c:607 src/stored/dircmd.c:698 +#: src/stored/dircmd.c:630 src/stored/dircmd.c:730 #, c-format msgid "3903 Device %s is being labeled.\n" msgstr "" -#: src/stored/dircmd.c:629 +#: src/stored/dircmd.c:652 #, c-format msgid "3001 Device %s is already mounted with Volume \"%s\"\n" msgstr "" -#: src/stored/dircmd.c:638 +#: src/stored/dircmd.c:661 #, c-format msgid "3002 Device %s is mounted.\n" msgstr "" -#: src/stored/dircmd.c:641 +#: src/stored/dircmd.c:664 #, c-format msgid "3907 %s" msgstr "" -#: src/stored/dircmd.c:644 +#: src/stored/dircmd.c:667 #, c-format msgid "3906 File device %s is always mounted.\n" msgstr "" -#: src/stored/dircmd.c:650 +#: src/stored/dircmd.c:673 #, c-format msgid "3905 Bizarre wait state %d\n" msgstr "" -#: src/stored/dircmd.c:659 +#: src/stored/dircmd.c:684 #, c-format msgid "3909 Error scanning mount command: %s\n" msgstr "" -#: src/stored/dircmd.c:681 +#: src/stored/dircmd.c:711 #, c-format msgid "3901 Device %s is already unmounted.\n" msgstr "" -#: src/stored/dircmd.c:690 +#: src/stored/dircmd.c:722 #, c-format msgid "3001 Device %s unmounted.\n" msgstr "" -#: src/stored/dircmd.c:694 +#: src/stored/dircmd.c:726 #, c-format msgid "3902 Device %s is busy in acquire.\n" msgstr "" -#: src/stored/dircmd.c:715 +#: src/stored/dircmd.c:749 #, c-format msgid "3002 Device %s unmounted.\n" msgstr "" -#: src/stored/dircmd.c:725 +#: src/stored/dircmd.c:761 #, c-format msgid "3907 Error scanning unmount command: %s\n" msgstr "" -#: src/stored/dircmd.c:751 +#: src/stored/dircmd.c:789 #, c-format -msgid "3911 Device %s already released.\n" +msgid "3921 Device %s already released.\n" msgstr "" -#: src/stored/dircmd.c:758 +#: src/stored/dircmd.c:796 #, c-format -msgid "3912 Device %s waiting for mount.\n" +msgid "3922 Device %s waiting for mount.\n" msgstr "" -#: src/stored/dircmd.c:762 +#: src/stored/dircmd.c:800 #, c-format -msgid "3913 Device %s is busy in acquire.\n" +msgid "3923 Device %s is busy in acquire.\n" msgstr "" -#: src/stored/dircmd.c:766 +#: src/stored/dircmd.c:804 #, c-format msgid "3914 Device %s is being labeled.\n" msgstr "" -#: src/stored/dircmd.c:774 +#: src/stored/dircmd.c:812 #, c-format -msgid "3012 Device %s released.\n" +msgid "3022 Device %s released.\n" msgstr "" -#: src/stored/dircmd.c:784 +#: src/stored/dircmd.c:824 #, c-format -msgid "3917 Error scanning release command: %s\n" +msgid "3927 Error scanning release command: %s\n" msgstr "" -#: src/stored/dircmd.c:817 +#: src/stored/dircmd.c:860 #, c-format msgid "3995 Device %s is not an autochanger.\n" msgstr "" -#: src/stored/dircmd.c:833 +#: src/stored/dircmd.c:878 #, c-format -msgid "3908 Error scanning autocharger list/slots command: %s\n" +msgid "3908 Error scanning autocharger drives/list/slots command: %s\n" msgstr "" -#: src/stored/dircmd.c:873 +#: src/stored/dircmd.c:922 #, c-format msgid "3909 Error scanning readlabel command: %s\n" msgstr "" -#: src/stored/dircmd.c:901 +#: src/stored/dircmd.c:950 #, c-format msgid "3001 Volume=%s Slot=%d\n" msgstr "" -#: src/stored/dircmd.c:930 +#: src/stored/dircmd.c:979 #, c-format msgid "3910 Unable to open device %s: ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:940 +#: src/stored/dircmd.c:991 +#, c-format +msgid "3931 Device %s is BLOCKED. user unmounted.\n" +msgstr "" + +#: src/stored/dircmd.c:995 +#, c-format +msgid "" +"3932 Device %s is BLOCKED. user unmounted during wait for media/mount.\n" +msgstr "" + +#: src/stored/dircmd.c:999 +#, c-format +msgid "3933 Device %s is BLOCKED waiting for media.\n" +msgstr "" + +#: src/stored/dircmd.c:1003 +#, c-format +msgid "3934 Device %s is being initialized.\n" +msgstr "" + +#: src/stored/dircmd.c:1007 +#, c-format +msgid "3935 Device %s is blocked labeling a Volume.\n" +msgstr "" + +#: src/stored/dircmd.c:1011 +#, c-format +msgid "3935 Device %s is blocked for unknown reason.\n" +msgstr "" + +#: src/stored/dircmd.c:1016 +#, c-format +msgid "3936 Device %s is busy reading.\n" +msgstr "" + +#: src/stored/dircmd.c:1019 +#, c-format +msgid "3937 Device %s is busy with %d writer(s).\n" +msgstr "" + +#: src/stored/dvd.c:153 +#, c-format +msgid "Device %s cannot be mounted. ERR=%s\n" +msgstr "" + +#: src/stored/dvd.c:271 +#, c-format +msgid "Cannot run free space command (%s)\n" +msgstr "" + +#: src/stored/dvd.c:374 +#, c-format +msgid "Error while writing current part to the DVD: %s" +msgstr "" + +#: src/stored/dvd.c:394 +#, c-format +msgid "Remaining free space %s on %s\n" +msgstr "" + +#: src/stored/dvd.c:464 +#, c-format +msgid "Next Volume part already exists on DVD. Cannot continue: %s\n" +msgstr "" + +#: src/stored/dvd.c:481 #, c-format -msgid "3911 Device %s is busy reading.\n" +msgid "open_next_part can't unlink existing part %s, ERR=%s\n" msgstr "" -#: src/stored/dircmd.c:943 +#: src/stored/dvd.c:700 #, c-format -msgid "3912 Device %s is busy with %d writer(s).\n" +msgid "Unable to write part %s: ERR=%s\n" msgstr "" #: src/stored/fd_cmds.c:340 @@ -11483,52 +11669,52 @@ msgstr "" msgid "Cannot write Volume label to block for device %s\n" msgstr "" -#: src/stored/label.c:393 +#: src/stored/label.c:400 #, c-format msgid "Rewind error on device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:398 +#: src/stored/label.c:405 #, c-format msgid "Truncate error on device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:420 +#: src/stored/label.c:427 #, c-format msgid "Unable to write device %s: ERR=%s\n" msgstr "" -#: src/stored/label.c:448 +#: src/stored/label.c:455 #, c-format msgid "Recycled volume \"%s\" on device %s, all previous data lost.\n" msgstr "" -#: src/stored/label.c:451 +#: src/stored/label.c:458 #, c-format msgid "Wrote label to prelabeled Volume \"%s\" on device %s\n" msgstr "" -#: src/stored/label.c:648 +#: src/stored/label.c:657 #, c-format msgid "Bad session label = %d\n" msgstr "" -#: src/stored/label.c:666 src/stored/label.c:673 +#: src/stored/label.c:675 src/stored/label.c:682 #, c-format msgid "Error writing Session label to %s: %s\n" msgstr "" -#: src/stored/label.c:707 +#: src/stored/label.c:717 #, c-format msgid "Expecting Volume Label, got FI=%s Stream=%s len=%d\n" msgstr "" -#: src/stored/label.c:834 +#: src/stored/label.c:844 #, c-format msgid "Unknown %d" msgstr "" -#: src/stored/label.c:838 +#: src/stored/label.c:848 #, c-format msgid "" "\n" @@ -11545,17 +11731,17 @@ msgid "" "HostName : %s\n" msgstr "" -#: src/stored/label.c:860 +#: src/stored/label.c:870 #, c-format msgid "Date label written: %s\n" msgstr "" -#: src/stored/label.c:866 +#: src/stored/label.c:876 #, c-format msgid "Date label written: %04d-%02d-%02d at %02d:%02d\n" msgstr "" -#: src/stored/label.c:886 +#: src/stored/label.c:896 #, c-format msgid "" "\n" @@ -11568,7 +11754,7 @@ msgid "" "ClientName : %s\n" msgstr "" -#: src/stored/label.c:899 +#: src/stored/label.c:909 #, c-format msgid "" "Job (unique name) : %s\n" @@ -11577,7 +11763,7 @@ msgid "" "JobLevel : %c\n" msgstr "" -#: src/stored/label.c:908 +#: src/stored/label.c:918 #, c-format msgid "" "JobFiles : %s\n" @@ -11590,62 +11776,62 @@ msgid "" "JobStatus : %c\n" msgstr "" -#: src/stored/label.c:929 +#: src/stored/label.c:939 #, c-format msgid "Date written : %s\n" msgstr "" -#: src/stored/label.c:934 +#: src/stored/label.c:944 #, c-format msgid "Date written : %04d-%02d-%02d at %02d:%02d\n" msgstr "" -#: src/stored/label.c:953 +#: src/stored/label.c:963 msgid "Fresh Volume" msgstr "" -#: src/stored/label.c:956 +#: src/stored/label.c:966 msgid "Volume" msgstr "" -#: src/stored/label.c:965 src/stored/read_record.c:335 +#: src/stored/label.c:975 src/stored/read_record.c:336 msgid "End of Media" msgstr "" -#: src/stored/label.c:968 +#: src/stored/label.c:978 msgid "End of Tape" msgstr "" -#: src/stored/label.c:988 src/stored/label.c:996 src/stored/label.c:1029 +#: src/stored/label.c:998 src/stored/label.c:1006 src/stored/label.c:1039 #, c-format msgid "%s Record: File:blk=%u:%u SessId=%d SessTime=%d JobId=%d DataLen=%d\n" msgstr "" -#: src/stored/label.c:993 +#: src/stored/label.c:1003 msgid "End of physical tape.\n" msgstr "" -#: src/stored/label.c:1008 src/stored/label.c:1017 +#: src/stored/label.c:1018 src/stored/label.c:1027 #, c-format msgid "%s Record: File:blk=%u:%u SessId=%d SessTime=%d JobId=%d\n" msgstr "" -#: src/stored/label.c:1010 +#: src/stored/label.c:1020 #, c-format msgid " Job=%s Date=%s Level=%c Type=%c\n" msgstr "" -#: src/stored/label.c:1019 +#: src/stored/label.c:1029 #, c-format msgid " Date=%s Level=%c Type=%c Files=%s Bytes=%s Errors=%d Status=%c\n" msgstr "" -#: src/stored/mount.c:197 src/stored/mount.c:294 +#: src/stored/mount.c:198 src/stored/mount.c:295 #, c-format msgid "Volume \"%s\" not on device %s.\n" msgstr "" -#: src/stored/mount.c:230 +#: src/stored/mount.c:231 #, c-format msgid "" "Director wanted Volume \"%s\".\n" @@ -11653,51 +11839,65 @@ msgid "" " %s" msgstr "" -#: src/stored/mount.c:284 +#: src/stored/mount.c:285 #, c-format msgid "Labeled new Volume \"%s\" on device %s.\n" msgstr "" -#: src/stored/mount.c:289 +#: src/stored/mount.c:290 #, c-format msgid "Warning device %s not configured to autolabel Volumes.\n" msgstr "" -#: src/stored/mount.c:340 +#: src/stored/mount.c:342 #, c-format msgid "Volume \"%s\" previously written, moving to end of data.\n" msgstr "" -#: src/stored/mount.c:343 +#: src/stored/mount.c:345 #, c-format msgid "Unable to position to end of data on device %s: ERR=%s\n" msgstr "" -#: src/stored/mount.c:355 +#: src/stored/mount.c:357 #, c-format msgid "Ready to append to end of Volume \"%s\" at file=%d.\n" msgstr "" -#: src/stored/mount.c:358 +#: src/stored/mount.c:360 #, c-format msgid "" "I cannot write on Volume \"%s\" because:\n" "The number of files mismatch! Volume=%u Catalog=%u\n" msgstr "" -#: src/stored/mount.c:411 +#: src/stored/mount.c:388 +#, c-format +msgid "Ready to append to end of Volume \"%s\" at file address=%u.\n" +msgstr "" + +#: src/stored/mount.c:392 +#, c-format +msgid "" +"I cannot write on Volume \"%s\" because:\n" +"The EOD file address is wrong: Volume file address=%u != Catalog Endblock=%u" +"(+1)\n" +"You probably removed DVD last part in spool directory.\n" +msgstr "" + +#: src/stored/mount.c:418 #, c-format msgid "Marking Volume \"%s\" in Error in Catalog.\n" msgstr "" -#: src/stored/mount.c:427 +#: src/stored/mount.c:434 #, c-format msgid "" "Autochanger Volume \"%s\" not found in slot %d.\n" " Setting InChanger to zero in catalog.\n" msgstr "" -#: src/stored/mount.c:446 +#: src/stored/mount.c:453 msgid "Hey!!!!! WroteVol non-zero !!!!!\n" msgstr "" @@ -11831,13 +12031,26 @@ msgstr "" msgid "fast_reject : %d\n" msgstr "" -#: src/stored/read.c:55 -msgid "No Volume names found for restore.\n" +#: src/stored/pythonsd.c:202 +msgid "Error in ParseTuple\n" msgstr "" -#: src/stored/read.c:109 -#, c-format -msgid ">filed: Error Hdr=%s\n" +#: src/stored/pythonsd.c:218 +msgid "Parse tuple error in job_write\n" +msgstr "" + +#: src/stored/pythonsd.c:254 +#, c-format +msgid "Error in Python method %s\n" +msgstr "" + +#: src/stored/read.c:55 +msgid "No Volume names found for restore.\n" +msgstr "" + +#: src/stored/read.c:109 +#, c-format +msgid ">filed: Error Hdr=%s\n" msgstr "" #: src/stored/read.c:110 src/stored/read.c:125 @@ -11868,38 +12081,115 @@ msgstr "" msgid "Did fsr\n" msgstr "" -#: src/stored/read_record.c:275 +#: src/stored/read_record.c:276 #, c-format msgid "Reposition from (file:block) %u:%u to %u:%u\n" msgstr "" -#: src/stored/read_record.c:302 +#: src/stored/read_record.c:303 #, c-format msgid "Forward spacing to file:block %u:%u.\n" msgstr "" -#: src/stored/read_record.c:328 +#: src/stored/read_record.c:329 msgid "Begin Session" msgstr "" -#: src/stored/read_record.c:332 +#: src/stored/read_record.c:333 msgid "End Session" msgstr "" -#: src/stored/read_record.c:338 +#: src/stored/read_record.c:339 #, c-format msgid "Unknown code %d\n" msgstr "" -#: src/stored/record.c:61 +#: src/stored/record.c:60 #, c-format msgid "unknown: %d" msgstr "" -#: src/stored/record.c:332 +#: src/stored/record.c:343 msgid "Damaged buffer\n" msgstr "" +#: src/stored/reserve.c:467 src/stored/reserve.c:479 +#, c-format +msgid "Failed command: %s\n" +msgstr "" + +#: src/stored/reserve.c:469 +#, c-format +msgid "" +"\n" +" Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD " +"Device resources.\n" +msgstr "" + +#: src/stored/reserve.c:647 +#, c-format +msgid "3926 Could not get dcr for device: %s\n" +msgstr "" + +#: src/stored/reserve.c:709 +#, c-format +msgid "3601 JobId=%u device %s is BLOCKED due to user unmount.\n" +msgstr "" + +#: src/stored/reserve.c:718 +#, c-format +msgid "3602 JobId=%u device %s is busy (already reading/writing).\n" +msgstr "" + +#: src/stored/reserve.c:761 +#, c-format +msgid "3603 JobId=%u device %s is busy reading.\n" +msgstr "" + +#: src/stored/reserve.c:770 +#, c-format +msgid "3604 JobId=%u device %s is BLOCKED due to user unmount.\n" +msgstr "" + +#: src/stored/reserve.c:836 +#, c-format +msgid "3605 JobId=%u wants free drive but device %s is busy.\n" +msgstr "" + +#: src/stored/reserve.c:844 +#, c-format +msgid "3606 JobId=%u wants mounted, but drive %s has no Volume.\n" +msgstr "" + +#: src/stored/reserve.c:854 +#, c-format +msgid "3607 JobId=%u wants Vol=\"%s\" drive has Vol=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:890 +#, c-format +msgid "3608 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:933 +#, c-format +msgid "3609 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n" +msgstr "" + +#: src/stored/reserve.c:941 src/stored/reserve.c:945 +msgid "Logic error!!!! Should not get here.\n" +msgstr "" + +#: src/stored/reserve.c:942 +#, c-format +msgid "3910 JobId=%u Logic error!!!! drive %s Should not get here.\n" +msgstr "" + +#: src/stored/reserve.c:948 +#, c-format +msgid "3911 JobId=%u failed reserve drive %s.\n" +msgstr "" + #: src/stored/spool.c:69 #, c-format msgid "" @@ -11927,256 +12217,272 @@ msgstr "" #: src/stored/spool.c:199 #, c-format -msgid "Committing spooled data to Volume. Despooling %s bytes ...\n" +msgid "Committing spooled data to Volume \"%s\". Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:203 +#: src/stored/spool.c:204 #, c-format msgid "Writing spooled data to Volume. Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:257 src/stored/spool.c:431 src/stored/spool.c:469 +#: src/stored/spool.c:258 src/stored/spool.c:432 src/stored/spool.c:470 #, c-format msgid "Ftruncate spool file failed: ERR=%s\n" msgstr "" -#: src/stored/spool.c:259 +#: src/stored/spool.c:260 #, c-format msgid "Bad return from ftruncate. ERR=%s\n" msgstr "" -#: src/stored/spool.c:308 +#: src/stored/spool.c:309 #, c-format msgid "Spool header read error. ERR=%s\n" msgstr "" -#: src/stored/spool.c:311 +#: src/stored/spool.c:312 #, c-format msgid "Spool read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:312 +#: src/stored/spool.c:313 #, c-format msgid "Spool header read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:318 src/stored/spool.c:319 +#: src/stored/spool.c:319 src/stored/spool.c:320 #, c-format msgid "Spool block too big. Max %u bytes, got %u\n" msgstr "" -#: src/stored/spool.c:324 src/stored/spool.c:325 +#: src/stored/spool.c:325 src/stored/spool.c:326 #, c-format msgid "Spool data read error. Wanted %u bytes, got %d\n" msgstr "" -#: src/stored/spool.c:382 +#: src/stored/spool.c:383 msgid "User specified spool size reached.\n" msgstr "" -#: src/stored/spool.c:384 +#: src/stored/spool.c:385 msgid "Bad return from despool in write_block.\n" msgstr "" -#: src/stored/spool.c:392 +#: src/stored/spool.c:393 msgid "Spooling data again ...\n" msgstr "" -#: src/stored/spool.c:423 +#: src/stored/spool.c:424 #, c-format msgid "Error writing header to spool file. ERR=%s\n" msgstr "" -#: src/stored/spool.c:437 src/stored/spool.c:475 +#: src/stored/spool.c:438 src/stored/spool.c:476 msgid "Fatal despooling error." msgstr "" -#: src/stored/spool.c:444 +#: src/stored/spool.c:445 msgid "Retrying after header spooling error failed.\n" msgstr "" -#: src/stored/spool.c:458 +#: src/stored/spool.c:459 #, c-format msgid "Error writing data to spool file. ERR=%s\n" msgstr "" -#: src/stored/spool.c:485 +#: src/stored/spool.c:486 msgid "Retrying after data spooling error failed.\n" msgstr "" -#: src/stored/spool.c:540 src/stored/spool.c:547 +#: src/stored/spool.c:541 src/stored/spool.c:548 #, c-format msgid "Fseek on attributes file failed: ERR=%s\n" msgstr "" -#: src/stored/spool.c:557 +#: src/stored/spool.c:558 #, c-format msgid "Sending spooled attrs to the Director. Despooling %s bytes ...\n" msgstr "" -#: src/stored/spool.c:584 +#: src/stored/spool.c:585 #, c-format msgid "fopen attr spool file %s failed: ERR=%s\n" msgstr "" -#: src/stored/status.c:66 +#: src/stored/status.c:67 #, c-format msgid "" "\n" "%s Version: %s (%s) %s %s %s\n" msgstr "" -#: src/stored/status.c:97 +#: src/stored/status.c:103 msgid "" "\n" "Device status:\n" msgstr "" -#: src/stored/status.c:99 +#: src/stored/status.c:105 #, c-format msgid "Autochanger \"%s\" with devices:\n" msgstr "" -#: src/stored/status.c:113 +#: src/stored/status.c:119 #, c-format -msgid "Device %s is mounted with Volume \"%s\"\n" +msgid "Device %s is mounted with Volume=\"%s\" Pool=\"%s\"\n" msgstr "" -#: src/stored/status.c:116 +#: src/stored/status.c:123 #, c-format msgid "Device %s open but no Bacula volume is mounted.\n" msgstr "" -#: src/stored/status.c:126 +#: src/stored/status.c:133 #, c-format msgid " Total Bytes=%s Blocks=%s Bytes/block=%s\n" msgstr "" -#: src/stored/status.c:140 +#: src/stored/status.c:147 #, c-format msgid " Total Bytes Read=%s Blocks Read=%s Bytes/block=%s\n" msgstr "" -#: src/stored/status.c:145 +#: src/stored/status.c:152 #, c-format msgid " Positioned at File=%s Block=%s\n" msgstr "" -#: src/stored/status.c:151 +#: src/stored/status.c:158 #, c-format msgid "Device %s is not open or does not exist.\n" msgstr "" -#: src/stored/status.c:153 +#: src/stored/status.c:160 #, c-format msgid "Device \"%s\" is not open or does not exist.\n" msgstr "" -#: src/stored/status.c:158 src/stored/status.c:165 src/stored/status.c:168 +#: src/stored/status.c:165 src/stored/status.c:168 src/stored/status.c:172 +#: src/stored/status.c:174 msgid "" "====\n" "\n" msgstr "" -#: src/stored/status.c:159 -msgid "Volume status:\n" +#: src/stored/status.c:166 +msgid "In Use Volume status:\n" msgstr "" -#: src/stored/status.c:183 +#: src/stored/status.c:190 msgid "" "No DEVICE structure.\n" "\n" msgstr "" -#: src/stored/status.c:188 +#: src/stored/status.c:195 msgid " Device is BLOCKED. User unmounted.\n" msgstr "" -#: src/stored/status.c:191 +#: src/stored/status.c:198 msgid " Device is BLOCKED. User unmounted during wait for media/mount.\n" msgstr "" -#: src/stored/status.c:195 +#: src/stored/status.c:202 #, c-format msgid " Device is BLOCKED waiting for mount of volume \"%s\".\n" msgstr "" -#: src/stored/status.c:198 +#: src/stored/status.c:205 msgid " Device is BLOCKED waiting for media.\n" msgstr "" -#: src/stored/status.c:202 +#: src/stored/status.c:209 msgid " Device is being initialized.\n" msgstr "" -#: src/stored/status.c:205 +#: src/stored/status.c:212 msgid " Device is blocked labeling a Volume.\n" msgstr "" -#: src/stored/status.c:213 +#: src/stored/status.c:220 #, c-format msgid " Slot %d is loaded in drive %d.\n" msgstr "" -#: src/stored/status.c:216 +#: src/stored/status.c:223 #, c-format msgid " Drive %d is not loaded.\n" msgstr "" -#: src/stored/status.c:235 +#: src/stored/status.c:242 msgid "Device state:\n" msgstr "" -#: src/stored/status.c:249 +#: src/stored/status.c:256 #, c-format msgid "" "num_writers=%d JobStatus=%c block=%d\n" "\n" msgstr "" -#: src/stored/status.c:253 +#: src/stored/status.c:260 #, c-format msgid "Archive name: %s Device name: %s\n" msgstr "" -#: src/stored/status.c:255 +#: src/stored/status.c:262 #, c-format msgid "File=%u block=%u\n" msgstr "" -#: src/stored/status.c:256 +#: src/stored/status.c:263 #, c-format msgid "Min block=%u Max block=%u\n" msgstr "" -#: src/stored/status.c:272 +#: src/stored/status.c:280 #, c-format msgid "%s Job %s waiting for Client connection.\n" msgstr "" -#: src/stored/status.c:284 +#: src/stored/status.c:295 +#, c-format +msgid "" +"Reading: %s %s job %s JobId=%d Volume=\"%s\"\n" +" pool=\"%s\" device=\"%s\"\n" +msgstr "" + +#: src/stored/status.c:307 #, c-format -msgid "%s %s job %s JobId=%d Volume=\"%s\" device=\"%s\"\n" +msgid "" +"Writing: %s %s job %s JobId=%d Volume=\"%s\"\n" +" pool=\"%s\" device=\"%s\"\n" msgstr "" -#: src/stored/status.c:303 +#: src/stored/status.c:330 #, c-format msgid " FDReadSeqNo=%s in_msg=%u out_msg=%d fd=%d\n" msgstr "" -#: src/stored/status.c:308 +#: src/stored/status.c:335 msgid " FDSocket closed\n" msgstr "" -#: src/stored/status.c:335 +#: src/stored/status.c:352 +msgid "" +"\n" +"Jobs waiting to reserve a drive:\n" +msgstr "" + +#: src/stored/status.c:380 msgid " JobId Level Files Bytes Status Finished Name \n" msgstr "" -#: src/stored/status.c:469 +#: src/stored/status.c:514 msgid "3900 Bad .status command, missing argument.\n" msgstr "" -#: src/stored/status.c:494 +#: src/stored/status.c:537 msgid "3900 Bad .status command, wrong argument.\n" msgstr "" @@ -12210,37 +12516,37 @@ msgstr "" msgid "Unable to create thread. ERR=%s\n" msgstr "" -#: src/stored/stored.c:272 +#: src/stored/stored.c:271 #, c-format msgid "Only one Storage resource permitted in %s\n" msgstr "" -#: src/stored/stored.c:277 +#: src/stored/stored.c:276 #, c-format msgid "No Director resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:282 +#: src/stored/stored.c:281 #, c-format msgid "No Device resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:290 +#: src/stored/stored.c:289 #, c-format msgid "No Messages resource defined in %s. Cannot continue.\n" msgstr "" -#: src/stored/stored.c:317 +#: src/stored/stored.c:316 #, c-format msgid "\"TLS Certificate\" file not defined for Storage \"%s\" in %s.\n" msgstr "" -#: src/stored/stored.c:323 +#: src/stored/stored.c:322 #, c-format msgid "\"TLS Key\" file not defined for Storage \"%s\" in %s.\n" msgstr "" -#: src/stored/stored.c:329 +#: src/stored/stored.c:328 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " @@ -12248,235 +12554,72 @@ msgid "" "using \"TLS Verify Peer\".\n" msgstr "" -#: src/stored/stored.c:417 -#, c-format -msgid "No Changer Name given for device %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:423 -#, c-format -msgid "No Changer Command given for device %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:435 -#, c-format -msgid "" -"Media Type not the same for all devices in changer %s. Cannot continue.\n" -msgstr "" - -#: src/stored/stored.c:496 +#: src/stored/stored.c:455 #, c-format msgid "Could not initialize %s\n" msgstr "" -#: src/stored/stored.c:509 +#: src/stored/stored.c:468 #, c-format msgid "Could not open device %s\n" msgstr "" -#: src/stored/stored.c:521 +#: src/stored/stored.c:481 #, c-format msgid "Could not mount device %s\n" msgstr "" -#: src/stored/stored_conf.c:188 +#: src/stored/stored_conf.c:216 +#, c-format +msgid "Expected a Device Type keyword, got: %s" +msgstr "" + +#: src/stored/stored_conf.c:231 #, c-format msgid "Warning: no \"%s\" resource (%d) defined.\n" msgstr "" -#: src/stored/stored_conf.c:191 +#: src/stored/stored_conf.c:234 #, c-format msgid "dump_resource type=%d\n" msgstr "" -#: src/stored/stored_conf.c:307 +#: src/stored/stored_conf.c:350 #, c-format msgid "Warning: unknown resource type %d\n" msgstr "" -#: src/stored/stored_conf.c:496 +#: src/stored/stored_conf.c:539 #, c-format msgid "\"%s\" item is required in \"%s\" resource, but not found.\n" msgstr "" -#: src/stored/stored_conf.c:502 +#: src/stored/stored_conf.c:545 #, c-format msgid "Too many items in \"%s\" resource\n" msgstr "" -#: src/stored/stored_conf.c:536 +#: src/stored/stored_conf.c:579 #, c-format msgid "Cannot find AutoChanger resource %s\n" msgstr "" -#: src/stored/stored_conf.c:607 +#: src/stored/stored_conf.c:650 #, c-format msgid "" "Attempt to define second \"%s\" resource named \"%s\" is not permitted.\n" msgstr "" -#: src/stored/ansi_label.c:83 -#, c-format -msgid "Read error on device %s in ANSI label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:93 -msgid "Insane! End of tape while reading ANSI label.\n" -msgstr "" - -#: src/stored/ansi_label.c:117 -msgid "No VOL1 label while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:137 -#, c-format -msgid "Wanted ANSI Volume \"%s\" got \"%s\"\n" -msgstr "" - -#: src/stored/ansi_label.c:148 -msgid "No HDR1 label while reading ANSI label.\n" -msgstr "" - -#: src/stored/ansi_label.c:154 -#, c-format -msgid "ANSI/IBM Volume \"%s\" does not belong to Bacula.\n" -msgstr "" - -#: src/stored/ansi_label.c:165 -msgid "No HDR2 label while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:179 -msgid "Unknown or bad ANSI/IBM label record.\n" -msgstr "" - -#: src/stored/ansi_label.c:186 -msgid "Too many records in while reading ANSI/IBM label.\n" -msgstr "" - -#: src/stored/ansi_label.c:285 -#, c-format -msgid "ANSI Volume label name \"%s\" longer than 6 chars.\n" -msgstr "" - -#: src/stored/ansi_label.c:302 -#, c-format -msgid "Could not write ANSI VOL1 label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:340 src/stored/ansi_label.c:369 -#, c-format -msgid "Could not write ANSI HDR1 label. ERR=%s\n" -msgstr "" - -#: src/stored/ansi_label.c:345 src/stored/ansi_label.c:376 -msgid "Could not write ANSI HDR1 label.\n" -msgstr "" - -#: src/stored/ansi_label.c:381 -#, c-format -msgid "Error writing EOF to tape. ERR=%s" -msgstr "" - -#: src/stored/ansi_label.c:386 -msgid "write_ansi_ibm_label called for non-ANSI/IBM type\n" -msgstr "" - -#: src/stored/dvd.c:153 -#, c-format -msgid "Device %s cannot be mounted. ERR=%s\n" -msgstr "" - -#: src/stored/dvd.c:261 -#, c-format -msgid "Cannot run free space command (%s)\n" -msgstr "" - -#: src/stored/dvd.c:322 -#, c-format -msgid "Error while writing current part to the DVD: %s" -msgstr "" - -#: src/stored/dvd.c:343 -#, c-format -msgid "Remaining free space %s on %s\n" -msgstr "" - -#: src/stored/dvd.c:412 -#, c-format -msgid "Next Volume part already exists on DVD. Cannot continue: %s\n" -msgstr "" - -#: src/stored/dvd.c:430 +#: src/stored/wait.c:114 #, c-format -msgid "open_next_part can't unlink existing part %s, ERR=%s\n" -msgstr "" - -#: src/stored/dvd.c:634 -#, c-format -msgid "Unable to write part %s: ERR=%s\n" +msgid "pthread timedwait error. ERR=%s\n" msgstr "" -#: src/stored/wait.c:178 src/stored/wait.c:236 +#: src/stored/wait.c:199 #, c-format msgid "Job %s waiting to reserve a device.\n" msgstr "" -#: src/stored/pythonsd.c:202 -msgid "Error in ParseTuple\n" -msgstr "" - -#: src/stored/pythonsd.c:218 -msgid "Parse tuple error in job_write\n" -msgstr "" - -#: src/stored/pythonsd.c:254 -#, c-format -msgid "Error in Python method %s\n" -msgstr "" - -#: src/stored/reserve.c:373 src/stored/reserve.c:390 -#, c-format -msgid "Failed command: %s\n" -msgstr "" - -#: src/stored/reserve.c:375 -#, c-format -msgid "" -"\n" -" Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD " -"Device resources.\n" -msgstr "" - -#: src/stored/reserve.c:564 -#, c-format -msgid "3926 Could not get dcr for device: %s\n" -msgstr "" - -#: src/stored/reserve.c:615 src/stored/reserve.c:670 -#, c-format -msgid "Device %s is BLOCKED due to user unmount.\n" -msgstr "" - -#: src/stored/reserve.c:623 -#, c-format -msgid "Device %s is busy.\n" -msgstr "" - -#: src/stored/reserve.c:678 -#, c-format -msgid "Device %s is busy writing on another Volume.\n" -msgstr "" - -#: src/stored/reserve.c:777 -#, c-format -msgid "Wanted Pool \"%s\", but device %s is using Pool \"%s\" .\n" -msgstr "" - -#: src/stored/reserve.c:784 src/stored/reserve.c:785 -msgid "Logic error!!!! Should not get here.\n" -msgstr "" - #: src/tools/bsmtp.c:85 #, c-format msgid "Fatal malformed reply from %s: %s\n" @@ -12888,24 +13031,43 @@ msgstr "" msgid "Found %d bad Path records.\n" msgstr "" -#: src/tools/testfind.c:49 +#: src/tools/fstype.c:34 #, c-format msgid "" "\n" -"Usage: testfind [-d debug_level] [-] [pattern1 ...]\n" -" -a print extended attributes (Win32 debug)\n" -" -dnn set debug level to nn\n" -" -e specify file of exclude patterns\n" -" -i specify file of include patterns\n" -" - read pattern(s) from stdin\n" -" -? print this message.\n" +"Usage: fstype [-d debug_level] path ...\n" "\n" -"Patterns are used for file inclusion -- normally directories.\n" -"Debug level >= 1 prints each file found.\n" -"Debug level >= 10 prints path/file for catalog.\n" -"Errors are always printed.\n" -"Files/paths truncated is the number of files/paths with len > 255.\n" -"Truncation is only in the catalog.\n" +" Print the file system type a given file/directory is on.\n" +" The following options are supported:\n" +"\n" +" -v print both path and file system type.\n" +" -? print this message.\n" +"\n" +msgstr "" + +#: src/tools/fstype.c:86 +#, c-format +msgid "%s: unknown\n" +msgstr "" + +#: src/tools/testfind.c:49 +#, c-format +msgid "" +"\n" +"Usage: testfind [-d debug_level] [-] [pattern1 ...]\n" +" -a print extended attributes (Win32 debug)\n" +" -dnn set debug level to nn\n" +" -e specify file of exclude patterns\n" +" -i specify file of include patterns\n" +" - read pattern(s) from stdin\n" +" -? print this message.\n" +"\n" +"Patterns are used for file inclusion -- normally directories.\n" +"Debug level >= 1 prints each file found.\n" +"Debug level >= 10 prints path/file for catalog.\n" +"Errors are always printed.\n" +"Files/paths truncated is the number of files/paths with len > 255.\n" +"Truncation is only in the catalog.\n" "\n" msgstr "" @@ -13033,25 +13195,6 @@ msgstr "" msgid "Skip: File system change prohibited. Directory not entered. %s\n" msgstr "" -#: src/tools/fstype.c:34 -#, c-format -msgid "" -"\n" -"Usage: fstype [-d debug_level] path ...\n" -"\n" -" Print the file system type a given file/directory is on.\n" -" The following options are supported:\n" -"\n" -" -v print both path and file system type.\n" -" -? print this message.\n" -"\n" -msgstr "" - -#: src/tools/fstype.c:86 -#, c-format -msgid "%s: unknown\n" -msgstr "" - #: src/tray-monitor/authenticate.c:78 msgid "" "Director authorization problem.\n" @@ -13178,24 +13321,11 @@ msgstr "" #: src/tray-monitor/tray-monitor.c:503 src/tray-monitor/tray-monitor.c:513 msgid "" -"Copyright (C) 2004 Kern Sibbald and John Walker\n" +"Copyright (C) 2004-2005 Kern Sibbald\n" "Written by Nicolas Boichat\n" msgstr "" -#: src/tray-monitor/tray-monitor.c:505 -msgid "Version" -msgstr "" - -#: src/tray-monitor/tray-monitor.c:509 -#, c-format -msgid "" -"%s\n" -"\n" -"%s\n" -"%s %s (%s) %s %s %s" -msgstr "" - -#: src/tray-monitor/tray-monitor.c:515 +#: src/tray-monitor/tray-monitor.c:505 src/tray-monitor/tray-monitor.c:515 msgid "Version:" msgstr "" @@ -13391,7 +13521,7 @@ msgstr "" msgid "<< Error: BNET_PROMPT signal received. >>\n" msgstr "" -#: src/tray-monitor/tray-monitor.c:953 src/wx-console/console_thread.cpp:445 +#: src/tray-monitor/tray-monitor.c:953 src/wx-console/console_thread.cpp:465 msgid "<< Heartbeat signal received, answered. >>\n" msgstr "" @@ -13436,94 +13566,271 @@ msgstr "" msgid "Storage: name=%s address=%s SDport=%d\n" msgstr "" -#: src/wx-console/authenticate.c:126 +#: src/wx-console/authenticate.c:129 msgid "Bad response to Hello command: ERR=" msgstr "" -#: src/baconfig.h:52 +#: src/baconfig.h:55 #, c-format msgid "Failed ASSERT: %s\n" msgstr "" -#: src/baconfig.h:59 +#: src/baconfig.h:62 msgid "*None*" msgstr "" -#: src/wx-console/console_thread.cpp:103 +#: src/filed/win32/winmain.cpp:228 src/filed/win32/winmain.cpp:236 +msgid "Bacula Usage" +msgstr "" + +#: src/filed/win32/winmain.cpp:233 +msgid "Bad Command Line Options" +msgstr "" + +#: src/filed/win32/winmain.cpp:326 +msgid "Another instance of Bacula is already running" +msgstr "" + +#: src/filed/win32/winservice.cpp:131 src/filed/win32/winservice.cpp:145 +msgid "No existing instance of Bacula could be contacted" +msgstr "" + +#: src/filed/win32/winservice.cpp:218 +msgid "KERNEL32.DLL not found: Bacula service not started" +msgstr "" + +#: src/filed/win32/winservice.cpp:228 +msgid "Registry service not found: Bacula service not started" +msgstr "" + +#: src/filed/win32/winservice.cpp:230 +msgid "Registry service not found" +msgstr "" + +#: src/filed/win32/winservice.cpp:260 +msgid "StartServiceCtrlDispatcher failed." +msgstr "" + +#: src/filed/win32/winservice.cpp:278 +msgid "RegisterServiceCtlHandler failed" +msgstr "" + +#: src/filed/win32/winservice.cpp:279 +msgid "Contact Register Service Handler failure" +msgstr "" + +#: src/filed/win32/winservice.cpp:295 +msgid "ReportStatus STOPPED failed 1" +msgstr "" + +#: src/filed/win32/winservice.cpp:318 +msgid "Report Service failure" +msgstr "" + +#: src/filed/win32/winservice.cpp:355 +msgid "Unable to install Bacula service" +msgstr "" + +#: src/filed/win32/winservice.cpp:373 +msgid "Service command length too long" +msgstr "" + +#: src/filed/win32/winservice.cpp:374 +msgid "Service command length too long. Service not registered." +msgstr "" + +#: src/filed/win32/winservice.cpp:389 +msgid "Cannot write System Registry" +msgstr "" + +#: src/filed/win32/winservice.cpp:390 +msgid "" +"The System Registry could not be updated - the Bacula service was not " +"installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:397 +msgid "Cannot add Bacula key to System Registry" +msgstr "" + +#: src/filed/win32/winservice.cpp:398 src/filed/win32/winservice.cpp:449 +msgid "The Bacula service could not be installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:406 +msgid "" +"The Bacula File service was successfully installed.\n" +"The service may be started by double clicking on the\n" +"Bacula \"Start\" icon and will be automatically\n" +"be run the next time this machine is rebooted. " +msgstr "" + +#: src/filed/win32/winservice.cpp:424 +msgid "" +"The Service Control Manager could not be contacted - the Bacula service was " +"not installed" +msgstr "" + +#: src/filed/win32/winservice.cpp:455 +msgid "" +"Provides file backup and restore services. Bacula -- the network backup " +"solution." +msgstr "" + +#: src/filed/win32/winservice.cpp:462 +msgid "" +"The Bacula File service was successfully installed.\n" +"The service may be started from the Control Panel and will\n" +"automatically be run the next time this machine is rebooted." +msgstr "" + +#: src/filed/win32/winservice.cpp:471 +msgid "" +"Unknown Windows operating system.\n" +"Cannot install Bacula service.\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:496 +msgid "" +"Could not find registry entry.\n" +"Service probably not registerd - the Bacula service was not removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:501 +msgid "" +"Could not delete Registry key.\n" +"The Bacula service could not be removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:511 +msgid "Bacula could not be contacted, probably not running" +msgstr "" + +#: src/filed/win32/winservice.cpp:517 src/filed/win32/winservice.cpp:553 +msgid "The Bacula service has been removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:547 +msgid "The Bacula service could not be stopped" +msgstr "" + +#: src/filed/win32/winservice.cpp:555 +msgid "The Bacula service could not be removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:560 +msgid "The Bacula service could not be found" +msgstr "" + +#: src/filed/win32/winservice.cpp:565 +msgid "The SCM could not be contacted - the Bacula service was not removed" +msgstr "" + +#: src/filed/win32/winservice.cpp:629 +msgid "SetServiceStatus failed" +msgstr "" + +#: src/filed/win32/winservice.cpp:657 +#, c-format +msgid "" +"\n" +"\n" +"%s error: %ld at %s:%d" +msgstr "" + +#: src/filed/win32/winservice.cpp:732 +#, c-format +msgid "Locked by: %s, duration: %ld seconds\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:736 +#, c-format +msgid "No longer locked\n" +msgstr "" + +#: src/filed/win32/winservice.cpp:740 +msgid "Could not lock database" +msgstr "" + +#: src/wx-console/console_thread.cpp:101 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " "Director \"%s\" in config file.\n" -" At least one CA certificate store is required.\n" +"At least one CA certificate store is required.\n" msgstr "" -#: src/wx-console/console_thread.cpp:112 +#: src/wx-console/console_thread.cpp:108 msgid "" "No Director resource defined in config file.\n" "Without that I don't how to speak to the Director :-(\n" msgstr "" -#: src/wx-console/console_thread.cpp:132 +#: src/wx-console/console_thread.cpp:127 #, c-format msgid "" "Neither \"TLS CA Certificate\" or \"TLS CA Certificate Dir\" are defined for " "Console \"%s\" in config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:154 +#: src/wx-console/console_thread.cpp:148 msgid "Error while initializing windows sockets...\n" msgstr "" -#: src/wx-console/console_thread.cpp:169 +#: src/wx-console/console_thread.cpp:163 msgid "Error while cleaning up windows sockets...\n" msgstr "" -#: src/wx-console/console_thread.cpp:207 +#: src/wx-console/console_thread.cpp:201 msgid "Error while initializing library." msgstr "" -#: src/wx-console/console_thread.cpp:237 +#: src/wx-console/console_thread.cpp:227 +msgid "Cryptographic library initialization failed.\n" +msgstr "" + +#: src/wx-console/console_thread.cpp:231 msgid "Please correct configuration file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:270 +#: src/wx-console/console_thread.cpp:273 msgid "Error : Library not initialized\n" msgstr "" -#: src/wx-console/console_thread.cpp:281 +#: src/wx-console/console_thread.cpp:284 msgid "Error : No configuration file loaded\n" msgstr "" -#: src/wx-console/console_thread.cpp:291 +#: src/wx-console/console_thread.cpp:294 msgid "Connecting...\n" msgstr "" -#: src/wx-console/console_thread.cpp:307 +#: src/wx-console/console_thread.cpp:310 msgid "Error : No director defined in config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:319 +#: src/wx-console/console_thread.cpp:322 msgid "Multiple directors found in your config file.\n" msgstr "" -#: src/wx-console/console_thread.cpp:328 +#: src/wx-console/console_thread.cpp:331 #, c-format msgid "Please choose a director (1-%d): " msgstr "" -#: src/wx-console/console_thread.cpp:400 +#: src/wx-console/console_thread.cpp:403 msgid "Failed to connect to the director\n" msgstr "" -#: src/wx-console/console_thread.cpp:410 +#: src/wx-console/console_thread.cpp:413 msgid "Connected\n" msgstr "" -#: src/wx-console/console_thread.cpp:448 +#: src/wx-console/console_thread.cpp:470 msgid "<< Unexpected signal received : " msgstr "" -#: src/wx-console/console_thread.cpp:466 +#: src/wx-console/console_thread.cpp:490 msgid "Connection terminated\n" msgstr "" @@ -13536,28 +13843,28 @@ msgstr "" msgid "Welcome to bacula wx-console %s (%s)!\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:41 +#: src/wx-console/wxbconfigfileeditor.cpp:44 msgid "Config file editor" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:57 -msgid "Save and close" +#: src/wx-console/wxbconfigfileeditor.cpp:54 +msgid "# Bacula wx-console Configuration File\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:58 -msgid "Close without saving" +#: src/wx-console/wxbconfigfileeditor.cpp:90 +msgid "Save and close" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:69 -msgid "# Bacula wx-console Configuration File\n" +#: src/wx-console/wxbconfigfileeditor.cpp:91 +msgid "Close without saving" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:100 +#: src/wx-console/wxbconfigfileeditor.cpp:118 #, c-format msgid "Unable to write to %s\n" msgstr "" -#: src/wx-console/wxbconfigfileeditor.cpp:101 +#: src/wx-console/wxbconfigfileeditor.cpp:119 msgid "Error while saving" msgstr "" @@ -13579,567 +13886,579 @@ msgstr "" msgid "Possible completions: " msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:258 -#: src/wx-console/wxbrestorepanel.cpp:1861 -#: src/wx-console/wxbrestorepanel.cpp:1890 -msgid "Enter restore mode" +#: src/wx-console/wxbmainframe.cpp:227 +msgid "&About...\tF1" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:261 -msgid "Cancel restore" +#: src/wx-console/wxbmainframe.cpp:227 +msgid "Show about dialog" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:287 -#: src/wx-console/wxbrestorepanel.cpp:341 -msgid "Add" +#: src/wx-console/wxbmainframe.cpp:229 src/wx-console/wxbmainframe.cpp:598 +msgid "Connect to the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:289 -#: src/wx-console/wxbrestorepanel.cpp:343 -msgid "Remove" +#: src/wx-console/wxbmainframe.cpp:230 +msgid "Disconnect" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:291 -#: src/wx-console/wxbrestorepanel.cpp:345 -msgid "Refresh" +#: src/wx-console/wxbmainframe.cpp:230 +msgid "Disconnect of the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:310 -msgid "M" +#: src/wx-console/wxbmainframe.cpp:232 +msgid "Change of configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:326 -msgid "Perm." +#: src/wx-console/wxbmainframe.cpp:232 +msgid "Change your default configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:359 -#: src/wx-console/wxbrestorepanel.cpp:372 -#: src/wx-console/wxbrestorepanel.cpp:524 -#: src/wx-console/wxbrestorepanel.cpp:534 -#: src/wx-console/wxbrestorepanel.cpp:537 -#: src/wx-console/wxbrestorepanel.cpp:1732 -#: src/wx-console/wxbrestorepanel.cpp:1812 -msgid "Job Name" +#: src/wx-console/wxbmainframe.cpp:233 +msgid "Edit your configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:361 -#: src/wx-console/wxbrestorepanel.cpp:377 -#: src/wx-console/wxbrestorepanel.cpp:476 -#: src/wx-console/wxbrestorepanel.cpp:477 -#: src/wx-console/wxbrestorepanel.cpp:487 -#: src/wx-console/wxbrestorepanel.cpp:488 -#: src/wx-console/wxbrestorepanel.cpp:1101 -#: src/wx-console/wxbrestorepanel.cpp:1768 -#: src/wx-console/wxbrestorepanel.cpp:1827 -msgid "Fileset" +#: src/wx-console/wxbmainframe.cpp:235 +msgid "E&xit\tAlt-X" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:364 -#: src/wx-console/wxbrestorepanel.cpp:1168 -#: src/wx-console/wxbrestorepanel.cpp:1183 -#: src/wx-console/wxbrestorepanel.cpp:1185 -#: src/wx-console/wxbrestorepanel.cpp:1193 -#: src/wx-console/wxbrestorepanel.cpp:1195 -#: src/wx-console/wxbrestorepanel.cpp:1212 -#: src/wx-console/wxbrestorepanel.cpp:1219 -#: src/wx-console/wxbrestorepanel.cpp:1759 -#: src/wx-console/wxbrestorepanel.cpp:1885 -msgid "Before" +#: src/wx-console/wxbmainframe.cpp:235 +msgid "Quit this program" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:366 -msgid "Please configure parameters concerning files to restore :" +#: src/wx-console/wxbmainframe.cpp:239 +msgid "&File" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -#: src/wx-console/wxbrestorepanel.cpp:1820 -msgid "always" +#: src/wx-console/wxbmainframe.cpp:240 +msgid "&Help" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -msgid "if newer" +#: src/wx-console/wxbmainframe.cpp:257 +msgid "Console" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -msgid "if older" +#: src/wx-console/wxbmainframe.cpp:264 +msgid "" +"Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:375 -#: src/wx-console/wxbrestorepanel.cpp:1823 -msgid "never" +#: src/wx-console/wxbmainframe.cpp:268 +msgid "" +"Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode " +"support when handling non-ASCII filenames: Every non-ASCII character in such " +"filenames will be replaced by an interrogation mark.\n" +"If this behaviour disturbs you, please build wx-console against a Unicode " +"version of wxWidgets for GTK+ 2.0.\n" +"---\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:383 -msgid "Please configure parameters concerning files restoration :" +#: src/wx-console/wxbmainframe.cpp:279 +msgid "Send" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:448 -msgid "Getting parameters list." +#: src/wx-console/wxbmainframe.cpp:356 src/wx-console/wxbmainframe.cpp:368 +msgid "Error while parsing command line arguments, using defaults.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:456 -msgid "Error : no clients returned by the director." +#: src/wx-console/wxbmainframe.cpp:357 src/wx-console/wxbmainframe.cpp:369 +msgid "Usage: wx-console [-c configfile] [-w tmp]\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:480 -msgid "Error : no filesets returned by the director." +#: src/wx-console/wxbmainframe.cpp:397 +#, c-format +msgid "" +"It seems that it is the first time you run wx-console.\n" +"This file (%s) has been choosen as default configuration file.\n" +"Do you want to edit it? (if you click No you will have to select another " +"file)" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:504 -msgid "Error : no storage returned by the director." +#: src/wx-console/wxbmainframe.cpp:399 +msgid "First run" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:527 -#: src/wx-console/wxbrestorepanel.cpp:551 -msgid "Error : no jobs returned by the director." +#: src/wx-console/wxbmainframe.cpp:416 +#, c-format +msgid "" +"Unable to read %s\n" +"Error: %s\n" +"Do you want to choose another one? (Press no to edit this file)" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:537 -msgid "RestoreFiles" +#: src/wx-console/wxbmainframe.cpp:418 +msgid "Unable to read configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:572 -msgid "Please configure your restore parameters." +#: src/wx-console/wxbmainframe.cpp:430 +msgid "Please choose a configuration file to use" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:583 -msgid "Building restore tree..." +#: src/wx-console/wxbmainframe.cpp:443 +msgid "This configuration file has been successfully read, use it as default?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:622 -msgid "Error while starting restore: " +#: src/wx-console/wxbmainframe.cpp:444 +msgid "Configuration file read successfully" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:712 -msgid "" -"Right click on a file or on a directory, or double-click on its mark to add " -"it to the restore list." +#: src/wx-console/wxbmainframe.cpp:454 +#, c-format +msgid "Using this configuration file: %s\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:729 -msgid " files selected to be restored." +#: src/wx-console/wxbmainframe.cpp:459 +msgid "Connecting to the director..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:734 -msgid " file selected to be restored." +#: src/wx-console/wxbmainframe.cpp:474 +msgid "Failed to unregister a data parser !" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:741 -#, c-format -msgid "Please configure your restore (%ld files selected to be restored)..." +#: src/wx-console/wxbmainframe.cpp:482 +msgid "Quitting.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:751 -msgid "Restore failed : no file selected.\n" +#: src/wx-console/wxbmainframe.cpp:497 +msgid "" +"Welcome to Bacula wx-console.\n" +"Written by Nicolas Boichat \n" +"(C) 2005 Kern Sibbald\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:752 -msgid "Restore failed : no file selected." +#: src/wx-console/wxbmainframe.cpp:499 +msgid "About Bacula wx-console" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:762 -msgid "Restoring, please wait..." +#: src/wx-console/wxbmainframe.cpp:505 +msgid "Please choose your default configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:775 -msgid "Job started. JobId=" +#: src/wx-console/wxbmainframe.cpp:509 +msgid "Use this configuration file as default?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:777 -msgid "Restore started, jobid=" +#: src/wx-console/wxbmainframe.cpp:510 +msgid "Configuration file" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:781 -msgid "Job failed." +#: src/wx-console/wxbmainframe.cpp:581 +msgid "Console thread terminated." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:782 -msgid "Restore failed, please look at messages.\n" +#: src/wx-console/wxbmainframe.cpp:589 +msgid "Connection to the director lost. Quit program?" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:783 -msgid "Restore failed, please look at messages in console." +#: src/wx-console/wxbmainframe.cpp:590 +msgid "Connection lost" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:789 -#: src/wx-console/wxbrestorepanel.cpp:790 -msgid "Failed to retrieve jobid.\n" +#: src/wx-console/wxbmainframe.cpp:606 +msgid "Connected to the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:816 -msgid "" -"Restore is scheduled in more than two minutes, wx-console will not wait for " -"its completion.\n" +#: src/wx-console/wxbmainframe.cpp:629 +msgid "Reconnect" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:817 -msgid "" -"Restore is scheduled in more than two minutes, wx-console will not wait for " -"its completion." +#: src/wx-console/wxbmainframe.cpp:630 +msgid "Reconnect to the director" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:841 -msgid "Restore job created, but not yet running." +#: src/wx-console/wxbmainframe.cpp:644 +msgid "Disconnected of the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:846 -#, c-format -msgid "Restore job running, please wait (%ld of %ld files restored)..." +#: src/wx-console/wxbmainframe.cpp:663 src/wx-console/wxbrestorepanel.cpp:689 +msgid "Unexpected question has been received.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:850 -msgid "Restore job terminated successfully." +#: src/wx-console/wxbmainframe.cpp:686 src/wx-console/wxbmainframe.cpp:703 +msgid "wx-console: unexpected director's question." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:851 -msgid "Restore job terminated successfully.\n" +#: src/wx-console/wxbrestorepanel.cpp:216 +#: src/wx-console/wxbrestorepanel.cpp:1895 +#: src/wx-console/wxbrestorepanel.cpp:1924 +msgid "Enter restore mode" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:856 -msgid "Restore job terminated in error, see messages in console." +#: src/wx-console/wxbrestorepanel.cpp:219 +msgid "Cancel restore" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:857 -msgid "Restore job terminated in error, see messages.\n" +#: src/wx-console/wxbrestorepanel.cpp:245 +#: src/wx-console/wxbrestorepanel.cpp:299 +msgid "Add" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:862 -msgid "Restore job reported a non-fatal error." +#: src/wx-console/wxbrestorepanel.cpp:247 +#: src/wx-console/wxbrestorepanel.cpp:301 +msgid "Remove" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:866 -msgid "Restore job reported a fatal error." +#: src/wx-console/wxbrestorepanel.cpp:249 +#: src/wx-console/wxbrestorepanel.cpp:303 +msgid "Refresh" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:871 -msgid "Restore job cancelled by user." +#: src/wx-console/wxbrestorepanel.cpp:268 +msgid "M" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:872 -msgid "Restore job cancelled by user.\n" +#: src/wx-console/wxbrestorepanel.cpp:272 +msgid "Filename" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:877 -msgid "Restore job is waiting on File daemon." +#: src/wx-console/wxbrestorepanel.cpp:284 +msgid "Perm." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:881 -msgid "Restore job is waiting for new media." +#: src/wx-console/wxbrestorepanel.cpp:317 +#: src/wx-console/wxbrestorepanel.cpp:330 +#: src/wx-console/wxbrestorepanel.cpp:482 +#: src/wx-console/wxbrestorepanel.cpp:492 +#: src/wx-console/wxbrestorepanel.cpp:495 +#: src/wx-console/wxbrestorepanel.cpp:1760 +#: src/wx-console/wxbrestorepanel.cpp:1846 +msgid "Job Name" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:885 -msgid "Restore job is waiting for storage resource." +#: src/wx-console/wxbrestorepanel.cpp:319 +#: src/wx-console/wxbrestorepanel.cpp:335 +#: src/wx-console/wxbrestorepanel.cpp:434 +#: src/wx-console/wxbrestorepanel.cpp:435 +#: src/wx-console/wxbrestorepanel.cpp:445 +#: src/wx-console/wxbrestorepanel.cpp:446 +#: src/wx-console/wxbrestorepanel.cpp:1118 +#: src/wx-console/wxbrestorepanel.cpp:1191 +#: src/wx-console/wxbrestorepanel.cpp:1798 +#: src/wx-console/wxbrestorepanel.cpp:1800 +#: src/wx-console/wxbrestorepanel.cpp:1861 +msgid "Fileset" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:889 -msgid "Restore job is waiting for job resource." +#: src/wx-console/wxbrestorepanel.cpp:322 +#: src/wx-console/wxbrestorepanel.cpp:1185 +#: src/wx-console/wxbrestorepanel.cpp:1201 +#: src/wx-console/wxbrestorepanel.cpp:1203 +#: src/wx-console/wxbrestorepanel.cpp:1211 +#: src/wx-console/wxbrestorepanel.cpp:1213 +#: src/wx-console/wxbrestorepanel.cpp:1232 +#: src/wx-console/wxbrestorepanel.cpp:1239 +#: src/wx-console/wxbrestorepanel.cpp:1788 +#: src/wx-console/wxbrestorepanel.cpp:1799 +#: src/wx-console/wxbrestorepanel.cpp:1919 +msgid "Before" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:893 -msgid "Restore job is waiting for Client resource." +#: src/wx-console/wxbrestorepanel.cpp:324 +msgid "Please configure parameters concerning files to restore :" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:897 -msgid "Restore job is waiting for maximum jobs." +#: src/wx-console/wxbrestorepanel.cpp:333 +#: src/wx-console/wxbrestorepanel.cpp:1854 +msgid "always" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:901 -msgid "Restore job is waiting for start time." +#: src/wx-console/wxbrestorepanel.cpp:333 +msgid "if newer" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:905 -msgid "Restore job is waiting for higher priority jobs to finish." +#: src/wx-console/wxbrestorepanel.cpp:333 +msgid "if older" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:954 -msgid "" -"The restore job has not been started within one minute, wx-console will not " -"wait for its completion anymore.\n" +#: src/wx-console/wxbrestorepanel.cpp:333 +#: src/wx-console/wxbrestorepanel.cpp:1857 +msgid "never" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:955 -msgid "" -"The restore job has not been started within one minute, wx-console will not " -"wait for its completion anymore." +#: src/wx-console/wxbrestorepanel.cpp:341 +msgid "Please configure parameters concerning files restoration :" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:965 -msgid "Restore done successfully.\n" +#: src/wx-console/wxbrestorepanel.cpp:406 +msgid "Getting parameters list." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:966 -msgid "Restore done successfully." +#: src/wx-console/wxbrestorepanel.cpp:414 +msgid "Error : no clients returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1037 -msgid "Applying restore configuration changes..." +#: src/wx-console/wxbrestorepanel.cpp:438 +msgid "Error : no filesets returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1088 -msgid "Failed to find the selected client." +#: src/wx-console/wxbrestorepanel.cpp:462 +msgid "Error : no storage returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1103 -msgid "Failed to find the selected fileset." +#: src/wx-console/wxbrestorepanel.cpp:485 +#: src/wx-console/wxbrestorepanel.cpp:509 +msgid "Error : no jobs returned by the director." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1118 -msgid "Failed to find the selected storage." +#: src/wx-console/wxbrestorepanel.cpp:495 +msgid "RestoreFiles" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1135 -#: src/wx-console/wxbrestorepanel.cpp:1801 -msgid "Run Restore job" +#: src/wx-console/wxbrestorepanel.cpp:530 +msgid "Please configure your restore parameters." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1151 -msgid "Restore configuration changes were applied." +#: src/wx-console/wxbrestorepanel.cpp:541 +msgid "Building restore tree..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1160 -msgid "Restore cancelled.\n" +#: src/wx-console/wxbrestorepanel.cpp:584 +msgid "Error while starting restore: " msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1161 -msgid "Restore cancelled." +#: src/wx-console/wxbrestorepanel.cpp:674 +msgid "" +"Right click on a file or on a directory, or double-click on its mark to add " +"it to the restore list." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1182 -msgid "No results to list." +#: src/wx-console/wxbrestorepanel.cpp:711 +#: src/wx-console/wxbrestorepanel.cpp:733 +msgid "wx-console: unexpected restore question." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1184 -msgid "No backup found for this client." +#: src/wx-console/wxbrestorepanel.cpp:744 +msgid " files selected to be restored." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1191 -msgid "ERROR" +#: src/wx-console/wxbrestorepanel.cpp:749 +msgid " file selected to be restored." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1192 -msgid "Query failed" +#: src/wx-console/wxbrestorepanel.cpp:756 +#, c-format +msgid "Please configure your restore (%ld files selected to be restored)..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1194 -msgid "Cannot get previous backups list, see console." +#: src/wx-console/wxbrestorepanel.cpp:766 +msgid "Restore failed : no file selected.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1811 -msgid "JobName:" +#: src/wx-console/wxbrestorepanel.cpp:767 +msgid "Restore failed : no file selected." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1815 -msgid "Where:" +#: src/wx-console/wxbrestorepanel.cpp:777 +msgid "Restoring, please wait..." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1818 -msgid "Replace:" +#: src/wx-console/wxbrestorepanel.cpp:790 +msgid "Job started. JobId=" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1821 -msgid "ifnewer" +#: src/wx-console/wxbrestorepanel.cpp:792 +msgid "Restore started, jobid=" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1822 -msgid "ifolder" +#: src/wx-console/wxbrestorepanel.cpp:796 +msgid "Job failed." msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1826 -msgid "FileSet:" +#: src/wx-console/wxbrestorepanel.cpp:797 +msgid "Restore failed, please look at messages.\n" msgstr "" -#: src/wx-console/wxbrestorepanel.cpp:1942 -msgid "Restoring..." +#: src/wx-console/wxbrestorepanel.cpp:798 +msgid "Restore failed, please look at messages in console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:227 -msgid "&About...\tF1" +#: src/wx-console/wxbrestorepanel.cpp:804 +#: src/wx-console/wxbrestorepanel.cpp:805 +msgid "Failed to retrieve jobid.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:227 -msgid "Show about dialog" +#: src/wx-console/wxbrestorepanel.cpp:831 +msgid "" +"Restore is scheduled in more than two minutes, wx-console will not wait for " +"its completion.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:229 src/wx-console/wxbmainframe.cpp:591 -msgid "Connect to the director" +#: src/wx-console/wxbrestorepanel.cpp:832 +msgid "" +"Restore is scheduled in more than two minutes, wx-console will not wait for " +"its completion." msgstr "" -#: src/wx-console/wxbmainframe.cpp:230 -msgid "Disconnect" +#: src/wx-console/wxbrestorepanel.cpp:858 +msgid "Restore job created, but not yet running." msgstr "" -#: src/wx-console/wxbmainframe.cpp:230 -msgid "Disconnect of the director" +#: src/wx-console/wxbrestorepanel.cpp:863 +#, c-format +msgid "Restore job running, please wait (%ld of %ld files restored)..." msgstr "" -#: src/wx-console/wxbmainframe.cpp:232 -msgid "Change of configuration file" +#: src/wx-console/wxbrestorepanel.cpp:867 +msgid "Restore job terminated successfully." msgstr "" -#: src/wx-console/wxbmainframe.cpp:232 -msgid "Change your default configuration file" +#: src/wx-console/wxbrestorepanel.cpp:868 +msgid "Restore job terminated successfully.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:233 -msgid "Edit your configuration file" +#: src/wx-console/wxbrestorepanel.cpp:873 +msgid "Restore job terminated in error, see messages in console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:235 -msgid "E&xit\tAlt-X" +#: src/wx-console/wxbrestorepanel.cpp:874 +msgid "Restore job terminated in error, see messages.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:235 -msgid "Quit this program" +#: src/wx-console/wxbrestorepanel.cpp:879 +msgid "Restore job reported a non-fatal error." msgstr "" -#: src/wx-console/wxbmainframe.cpp:239 -msgid "&File" +#: src/wx-console/wxbrestorepanel.cpp:883 +msgid "Restore job reported a fatal error." msgstr "" -#: src/wx-console/wxbmainframe.cpp:240 -msgid "&Help" +#: src/wx-console/wxbrestorepanel.cpp:888 +msgid "Restore job cancelled by user." msgstr "" -#: src/wx-console/wxbmainframe.cpp:257 -msgid "Console" +#: src/wx-console/wxbrestorepanel.cpp:889 +msgid "Restore job cancelled by user.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:264 -msgid "" -"Warning : Unicode is disabled because you are using wxWidgets for GTK+ 1.2.\n" +#: src/wx-console/wxbrestorepanel.cpp:894 +msgid "Restore job is waiting on File daemon." msgstr "" -#: src/wx-console/wxbmainframe.cpp:268 -msgid "" -"Warning : There is a problem with wxWidgets for GTK+ 2.0 without Unicode " -"support when handling non-ASCII filenames: Every non-ASCII character in such " -"filenames will be replaced by an interrogation mark.\n" -"If this behaviour disturbs you, please build wx-console against a Unicode " -"version of wxWidgets for GTK+ 2.0.\n" -"---\n" +#: src/wx-console/wxbrestorepanel.cpp:898 +msgid "Restore job is waiting for new media." msgstr "" -#: src/wx-console/wxbmainframe.cpp:279 -msgid "Send" +#: src/wx-console/wxbrestorepanel.cpp:902 +msgid "Restore job is waiting for storage resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:356 src/wx-console/wxbmainframe.cpp:368 -msgid "Error while parsing command line arguments, using defaults.\n" +#: src/wx-console/wxbrestorepanel.cpp:906 +msgid "Restore job is waiting for job resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:357 src/wx-console/wxbmainframe.cpp:369 -msgid "Usage: wx-console [-c configfile] [-w tmp]\n" +#: src/wx-console/wxbrestorepanel.cpp:910 +msgid "Restore job is waiting for Client resource." msgstr "" -#: src/wx-console/wxbmainframe.cpp:397 -#, c-format -msgid "" -"It seems that it is the first time you run wx-console.\n" -"This file (%s) has been choosen as default configuration file.\n" -"Do you want to edit it? (if you click No you will have to select another " -"file)" +#: src/wx-console/wxbrestorepanel.cpp:914 +msgid "Restore job is waiting for maximum jobs." msgstr "" -#: src/wx-console/wxbmainframe.cpp:401 -msgid "First run" +#: src/wx-console/wxbrestorepanel.cpp:918 +msgid "Restore job is waiting for start time." msgstr "" -#: src/wx-console/wxbmainframe.cpp:418 -#, c-format +#: src/wx-console/wxbrestorepanel.cpp:922 +msgid "Restore job is waiting for higher priority jobs to finish." +msgstr "" + +#: src/wx-console/wxbrestorepanel.cpp:971 msgid "" -"Unable to read %s\n" -"Error: %s\n" -"Do you want to choose another one? (Press no to edit this file)" +"The restore job has not been started within one minute, wx-console will not " +"wait for its completion anymore.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:422 -msgid "Unable to read configuration file" +#: src/wx-console/wxbrestorepanel.cpp:972 +msgid "" +"The restore job has not been started within one minute, wx-console will not " +"wait for its completion anymore." msgstr "" -#: src/wx-console/wxbmainframe.cpp:434 -msgid "Please choose a configuration file to use" +#: src/wx-console/wxbrestorepanel.cpp:982 +msgid "Restore done successfully.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:447 -msgid "This configuration file has been successfully read, use it as default?" +#: src/wx-console/wxbrestorepanel.cpp:983 +msgid "Restore done successfully." msgstr "" -#: src/wx-console/wxbmainframe.cpp:448 -msgid "Configuration file read successfully" +#: src/wx-console/wxbrestorepanel.cpp:1054 +msgid "Applying restore configuration changes..." msgstr "" -#: src/wx-console/wxbmainframe.cpp:458 -#, c-format -msgid "Using this configuration file: %s\n" +#: src/wx-console/wxbrestorepanel.cpp:1105 +msgid "Failed to find the selected client." msgstr "" -#: src/wx-console/wxbmainframe.cpp:463 -msgid "Connecting to the director..." +#: src/wx-console/wxbrestorepanel.cpp:1120 +msgid "Failed to find the selected fileset." msgstr "" -#: src/wx-console/wxbmainframe.cpp:478 -msgid "Failed to unregister a data parser !" +#: src/wx-console/wxbrestorepanel.cpp:1135 +msgid "Failed to find the selected storage." msgstr "" -#: src/wx-console/wxbmainframe.cpp:486 -msgid "Quitting.\n" +#: src/wx-console/wxbrestorepanel.cpp:1152 +#: src/wx-console/wxbrestorepanel.cpp:1835 +msgid "Run Restore job" msgstr "" -#: src/wx-console/wxbmainframe.cpp:501 -msgid "" -"Welcome to Bacula wx-console.\n" -"Written by Nicolas Boichat \n" -"(C) 2005 Kern Sibbald\n" +#: src/wx-console/wxbrestorepanel.cpp:1168 +msgid "Restore configuration changes were applied." msgstr "" -#: src/wx-console/wxbmainframe.cpp:503 -msgid "About Bacula wx-console" +#: src/wx-console/wxbrestorepanel.cpp:1177 +msgid "Restore cancelled.\n" msgstr "" -#: src/wx-console/wxbmainframe.cpp:509 -msgid "Please choose your default configuration file" +#: src/wx-console/wxbrestorepanel.cpp:1178 +msgid "Restore cancelled." msgstr "" -#: src/wx-console/wxbmainframe.cpp:513 -msgid "Use this configuration file as default?" +#: src/wx-console/wxbrestorepanel.cpp:1200 +msgid "No results to list." msgstr "" -#: src/wx-console/wxbmainframe.cpp:514 -msgid "Configuration file" +#: src/wx-console/wxbrestorepanel.cpp:1202 +msgid "No backup found for this client." msgstr "" -#: src/wx-console/wxbmainframe.cpp:578 -msgid "Console thread terminated." +#: src/wx-console/wxbrestorepanel.cpp:1209 +msgid "ERROR" msgstr "" -#: src/wx-console/wxbmainframe.cpp:582 -msgid "Connection to the director lost. Quit program?" +#: src/wx-console/wxbrestorepanel.cpp:1210 +msgid "Query failed" msgstr "" -#: src/wx-console/wxbmainframe.cpp:583 -msgid "Connection lost" +#: src/wx-console/wxbrestorepanel.cpp:1212 +msgid "Cannot get previous backups list, see console." msgstr "" -#: src/wx-console/wxbmainframe.cpp:599 -msgid "Connected to the director." +#: src/wx-console/wxbrestorepanel.cpp:1845 +msgid "JobName:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:613 -msgid "Reconnect" +#: src/wx-console/wxbrestorepanel.cpp:1849 +msgid "Where:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:614 -msgid "Reconnect to the director" +#: src/wx-console/wxbrestorepanel.cpp:1852 +msgid "Replace:" msgstr "" -#: src/wx-console/wxbmainframe.cpp:624 -msgid "Disconnected of the director." +#: src/wx-console/wxbrestorepanel.cpp:1855 +msgid "ifnewer" msgstr "" -#: src/wx-console/wxbmainframe.cpp:643 -msgid "Unexpected question has been received.\n" +#: src/wx-console/wxbrestorepanel.cpp:1856 +msgid "ifolder" msgstr "" -#: src/wx-console/wxbmainframe.cpp:666 src/wx-console/wxbmainframe.cpp:681 -msgid "wx-console: unexpected director's question." +#: src/wx-console/wxbrestorepanel.cpp:1860 +msgid "FileSet:" +msgstr "" + +#: src/wx-console/wxbrestorepanel.cpp:1976 +msgid "Restoring..." msgstr "" diff --git a/bacula/scripts/.cvsignore b/bacula/scripts/.cvsignore index e39d44a262..fc317cd451 100644 --- a/bacula/scripts/.cvsignore +++ b/bacula/scripts/.cvsignore @@ -24,3 +24,6 @@ bacula.desktop.gnome2.xsu bacula.desktop.gnome2.consolehelper bacula.desktop.gnome1.xsu bacula.desktop.gnome1.consolehelper +bacula-ctl-sd +bacula-ctl-fd +bacula-ctl-dir diff --git a/bacula/scripts/Makefile.in b/bacula/scripts/Makefile.in index 1bf17739fc..19aa7e3f96 100755 --- a/bacula/scripts/Makefile.in +++ b/bacula/scripts/Makefile.in @@ -38,6 +38,9 @@ install: installdirs $(INSTALL_SCRIPT) bconsole $(DESTDIR)$(scriptdir)/bconsole $(INSTALL_SCRIPT) gconsole $(DESTDIR)$(scriptdir)/gconsole $(INSTALL_SCRIPT) bacula $(DESTDIR)$(scriptdir)/bacula + $(INSTALL_SCRIPT) bacula-ctl-dir $(DESTDIR)$(scriptdir)/bacula-ctl-dir + $(INSTALL_SCRIPT) bacula-ctl-fd $(DESTDIR)$(scriptdir)/bacula-ctl-fd + $(INSTALL_SCRIPT) bacula-ctl-sd $(DESTDIR)$(scriptdir)/bacula-ctl-sd @if test -f ${DESTDIR}${scriptdir}/mtx-changer; then \ echo " ==> Saving existing mtx-changer to mtx-changer.old"; \ $(MV) -f ${DESTDIR}${scriptdir}/mtx-changer ${DESTDIR}${scriptdir}/mtx-changer.old; \ @@ -69,6 +72,9 @@ uninstall: (cd $(DESTDIR)$(scriptdir); $(RMF) bconsole) (cd $(DESTDIR)$(scriptdir); $(RMF) gconsole) (cd $(DESTDIR)$(scriptdir); $(RMF) bacula) + (cd $(DESTDIR)$(scriptdir); $(RMF) bacula-ctl-dir) + (cd $(DESTDIR)$(scriptdir); $(RMF) bacula-ctl-fd) + (cd $(DESTDIR)$(scriptdir); $(RMF) bacula-ctl-sd) (cd $(DESTDIR)$(scriptdir); $(RMF) fd) (cd $(DESTDIR)$(scriptdir); $(RMF) mtx-changer) (cd $(DESTDIR)$(scriptdir); $(RMF) disk-changer) @@ -82,11 +88,13 @@ Makefile: Makefile.in cd $(topdir) \ && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status chmod 755 startmysql stopmysql bacula startit stopit btraceback + chmod 755 bacula-ctl-dir bacula-ctl-fd bacula-ctl-sd chmod 755 disk-changer mtx-changer dvd-handler bconsole gconsole Makefiles: $(SHELL) config.status chmod 755 startmysql stopmysql bacula startit stopit btraceback + chmod 755 bacula-ctl-dir bacula-ctl-fd bacula-ctl-sd chmod 755 mtx-changer dvd-handler bconsole gconsole clean: @@ -95,6 +103,7 @@ clean: # clean for distribution distclean: clean @$(RMF) startmysql stopmysql bacula fd startit stopit btraceback + @$(RMF) bacula-ctl-dir bacula-ctl-fd bacula-ctl-sd @$(RMF) bconsole gconsole logrotate bacula.desktop @$(RMF) bacula.desktop.gnome1 bacula.desktop.gnome2 mtx-changer dvd-handler @$(RMF) gnome-console.console_apps bacula.desktop.gnome2.xsu diff --git a/bacula/scripts/bacula-ctl-dir.in b/bacula/scripts/bacula-ctl-dir.in new file mode 100644 index 0000000000..37d22aff86 --- /dev/null +++ b/bacula/scripts/bacula-ctl-dir.in @@ -0,0 +1,237 @@ +#! /bin/sh +# +# bacula-ctl-dir This shell script takes care of starting and stopping +# the bacula Director daemon +# +# This is pretty much watered down version of the RedHat script +# that works on Solaris as well as Linux, but it won't work everywhere. +# +# description: It comes by night and sucks the vital essence from your computers. +# + +PSCMD="@PSCMD@" +PS="ps" + +# +# On Solaris, you may need to use nawk, or alternatively, +# add the GNU binaries to your path, such as /usr/xpg4/bin +# +AWK=@AWK@ + +# All these are not *really* needed but it makes it +# easier to "steal" this code for the development +# environment where they are different. +# +BACDIRBIN=@sbindir@ +BACDIRCFG=@sysconfdir@ +PIDDIR=@piddir@ +SUBSYSDIR=@subsysdir@ + +DIR_PORT=@dir_port@ + +DIR_USER=@dir_user@ +DIR_GROUP=@dir_group@ + +PIDOF=@PIDOF@ + +# A function to stop a program. +killproc() { + RC=0 + # Test syntax. + if [ $# = 0 ]; then + echo "Usage: killproc {program} {port} [signal]" + return 1 + fi + + notset=0 + # check for third arg to be kill level + if [ "$3" != "" ] ; then + killlevel=$3 + else + notset=1 + killlevel="-9" + fi + + # Get base program name + base=`basename $1` + + # Find pid. + pid=`pidofproc $base $2` + + # Kill it. + if [ "$pid" != "" ] ; then + if [ "$notset" = "1" ] ; then + if ${PS} -p "$pid">/dev/null 2>&1; then + # TERM first, then KILL if not dead + kill -TERM $pid 2>/dev/null + sleep 1 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + sleep 1 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + sleep 3 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + kill -KILL $pid 2>/dev/null + fi + fi + fi + fi + ${PS} -p "$pid" >/dev/null 2>&1 + RC=$? + [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" + # RC=$((! $RC)) + # use specified level only + else + if ${PS} -p "$pid" >/dev/null 2>&1; then + kill $killlevel $pid 2>/dev/null + RC=$? + [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" + fi + fi + else + failure "$base shutdown" + fi + # Remove pid file if any. + if [ "$notset" = "1" ]; then + rm -f ${PIDDIR}/$base.$2.pid + fi + return $RC +} + +# A function to find the pid of a program. +pidofproc() { + pid="" + # Test syntax. + if [ $# = 0 ] ; then + echo "Usage: pidofproc {program}" + return 1 + fi + + # Get base program name + base=`basename $1` + + # First try PID file + if [ -f ${PIDDIR}/$base.$2.pid ] ; then + pid=`head -n 1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + fi + + # Next try "pidof" + if [ -x ${PIDOF} ] ; then + pid=`${PIDOF} $1` + fi + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + + # Finally try to extract it from ps + ${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' ' + return 0 +} + +status() { + pid="" + # Test syntax. + if [ $# = 0 ] ; then + echo "Usage: status {program} {port}" + return 1 + fi + + # Get base program name + base=`basename $1` + + # First try "pidof" + if [ -x ${PIDOF} ] ; then + pid=`${PIDOF} $1` + fi + if [ "$pid" != "" ] ; then + echo "$base (pid $pid) is running..." + return 0 + else + pid=`${PSCMD} | ${AWK} 'BEGIN { prog=ARGV[1]; ARGC=1 } + { if ((prog == $2) || (("(" prog ")") == $2) || + (("[" prog "]") == $2) || + ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` + if [ "$pid" != "" ] ; then + echo "$base (pid $pid) is running..." + return 0 + fi + fi + + # Next try the PID files + if [ -f ${PIDDIR}/$base.$2.pid ] ; then + pid=`head -n 1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo "$base dead but pid file exists" + return 1 + fi + fi + # See if the subsys lock exists + if [ -f ${SUBSYSDIR}/$base ] ; then + echo "$base dead but subsys locked" + return 2 + fi + echo "$base is stopped" + return 3 +} + +success() { + return 0 +} + +failure() { + rc=$? + return $rc +} + +OS=`uname -s` + +# if /lib/tls exists, force Bacula to use the glibc pthreads instead +if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then + export LD_ASSUME_KERNEL=2.4.19 +fi + +case "$1" in + start) + [ -x ${BACDIRBIN}/bacula-dir ] && { + sleep 2 + echo "Starting the Bacula Director daemon" + OPTIONS='' + if [ "${DIR_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${DIR_USER}" + fi + + if [ "${DIR_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${DIR_GROUP}" + fi + + ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf + } + ;; + + stop) + [ -x ${BACDIRBIN}/bacula-dir ] && { + echo "Stopping the Bacula Director daemon" + killproc ${BACDIRBIN}/bacula-dir ${DIR_PORT} + } + ;; + + restart) + $0 stop + sleep 5 + $0 start + ;; + + status) + [ -x ${BACDIRBIN}/bacula-dir ] && status ${BACDIRBIN}/bacula-dir ${DIR_PORT} + ;; + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac +exit 0 diff --git a/bacula/scripts/bacula-ctl-fd.in b/bacula/scripts/bacula-ctl-fd.in new file mode 100644 index 0000000000..f3552c32d1 --- /dev/null +++ b/bacula/scripts/bacula-ctl-fd.in @@ -0,0 +1,237 @@ +#! /bin/sh +# +# bacula-ctl-fd This shell script takes care of starting and stopping +# the bacula File daemon. +# +# This is pretty much watered down version of the RedHat script +# that works on Solaris as well as Linux, but it won't work everywhere. +# +# description: It comes by night and sucks the vital essence from your computers. +# + +PSCMD="@PSCMD@" +PS="ps" + +# +# On Solaris, you may need to use nawk, or alternatively, +# add the GNU binaries to your path, such as /usr/xpg4/bin +# +AWK=@AWK@ + +# All these are not *really* needed but it makes it +# easier to "steal" this code for the development +# environment where they are different. +# +BACFDBIN=@sbindir@ +BACFDCFG=@sysconfdir@ +PIDDIR=@piddir@ +SUBSYSDIR=@subsysdir@ + +FD_PORT=@fd_port@ + +FD_USER=@fd_user@ +FD_GROUP=@fd_group@ + +PIDOF=@PIDOF@ + +# A function to stop a program. +killproc() { + RC=0 + # Test syntax. + if [ $# = 0 ]; then + echo "Usage: killproc {program} {port} [signal]" + return 1 + fi + + notset=0 + # check for third arg to be kill level + if [ "$3" != "" ] ; then + killlevel=$3 + else + notset=1 + killlevel="-9" + fi + + # Get base program name + base=`basename $1` + + # Find pid. + pid=`pidofproc $base $2` + + # Kill it. + if [ "$pid" != "" ] ; then + if [ "$notset" = "1" ] ; then + if ${PS} -p "$pid">/dev/null 2>&1; then + # TERM first, then KILL if not dead + kill -TERM $pid 2>/dev/null + sleep 1 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + sleep 1 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + sleep 3 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + kill -KILL $pid 2>/dev/null + fi + fi + fi + fi + ${PS} -p "$pid" >/dev/null 2>&1 + RC=$? + [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" + # RC=$((! $RC)) + # use specified level only + else + if ${PS} -p "$pid" >/dev/null 2>&1; then + kill $killlevel $pid 2>/dev/null + RC=$? + [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" + fi + fi + else + failure "$base shutdown" + fi + # Remove pid file if any. + if [ "$notset" = "1" ]; then + rm -f ${PIDDIR}/$base.$2.pid + fi + return $RC +} + +# A function to find the pid of a program. +pidofproc() { + pid="" + # Test syntax. + if [ $# = 0 ] ; then + echo "Usage: pidofproc {program}" + return 1 + fi + + # Get base program name + base=`basename $1` + + # First try PID file + if [ -f ${PIDDIR}/$base.$2.pid ] ; then + pid=`head -n 1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + fi + + # Next try "pidof" + if [ -x ${PIDOF} ] ; then + pid=`${PIDOF} $1` + fi + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + + # Finally try to extract it from ps + ${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' ' + return 0 +} + +status() { + pid="" + # Test syntax. + if [ $# = 0 ] ; then + echo "Usage: status {program} {port}" + return 1 + fi + + # Get base program name + base=`basename $1` + + # First try "pidof" + if [ -x ${PIDOF} ] ; then + pid=`${PIDOF} $1` + fi + if [ "$pid" != "" ] ; then + echo "$base (pid $pid) is running..." + return 0 + else + pid=`${PSCMD} | ${AWK} 'BEGIN { prog=ARGV[1]; ARGC=1 } + { if ((prog == $2) || (("(" prog ")") == $2) || + (("[" prog "]") == $2) || + ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` + if [ "$pid" != "" ] ; then + echo "$base (pid $pid) is running..." + return 0 + fi + fi + + # Next try the PID files + if [ -f ${PIDDIR}/$base.$2.pid ] ; then + pid=`head -n 1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo "$base dead but pid file exists" + return 1 + fi + fi + # See if the subsys lock exists + if [ -f ${SUBSYSDIR}/$base ] ; then + echo "$base dead but subsys locked" + return 2 + fi + echo "$base is stopped" + return 3 +} + +success() { + return 0 +} + +failure() { + rc=$? + return $rc +} + +OS=`uname -s` + +# if /lib/tls exists, force Bacula to use the glibc pthreads instead +if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then + export LD_ASSUME_KERNEL=2.4.19 +fi + +case "$1" in + start) + [ -x ${BACFDBIN}/bacula-fd ] && { + echo "Starting the Bacula File daemon" + OPTIONS='' + if [ "${FD_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${FD_USER}" + fi + + if [ "${FD_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${FD_GROUP}" + fi + + ${BACFDBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf + } + ;; + + stop) + # Stop the FD first so that SD will fail jobs and update catalog + [ -x ${BACFDBIN}/bacula-fd ] && { + echo "Stopping the Bacula File daemon" + killproc ${BACFDBIN}/bacula-fd ${FD_PORT} + } + ;; + + restart) + $0 stop + sleep 5 + $0 start + ;; + + status) + [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT} + ;; + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac +exit 0 diff --git a/bacula/scripts/bacula-ctl-sd.in b/bacula/scripts/bacula-ctl-sd.in new file mode 100644 index 0000000000..9586bfc84c --- /dev/null +++ b/bacula/scripts/bacula-ctl-sd.in @@ -0,0 +1,237 @@ +#! /bin/sh +# +# bacula-ctl-sd This shell script takes care of starting and stopping +# the bacula Storage daemon +# +# This is pretty much watered down version of the RedHat script +# that works on Solaris as well as Linux, but it won't work everywhere. +# +# description: It comes by night and sucks the vital essence from your computers. +# + +PSCMD="@PSCMD@" +PS="ps" + +# +# On Solaris, you may need to use nawk, or alternatively, +# add the GNU binaries to your path, such as /usr/xpg4/bin +# +AWK=@AWK@ + +# All these are not *really* needed but it makes it +# easier to "steal" this code for the development +# environment where they are different. +# +BACSDBIN=@sbindir@ +BACSDCFG=@sysconfdir@ +PIDDIR=@piddir@ +SUBSYSDIR=@subsysdir@ + +SD_PORT=@sd_port@ + +SD_USER=@sd_user@ +SD_GROUP=@sd_group@ + +PIDOF=@PIDOF@ + +# A function to stop a program. +killproc() { + RC=0 + # Test syntax. + if [ $# = 0 ]; then + echo "Usage: killproc {program} {port} [signal]" + return 1 + fi + + notset=0 + # check for third arg to be kill level + if [ "$3" != "" ] ; then + killlevel=$3 + else + notset=1 + killlevel="-9" + fi + + # Get base program name + base=`basename $1` + + # Find pid. + pid=`pidofproc $base $2` + + # Kill it. + if [ "$pid" != "" ] ; then + if [ "$notset" = "1" ] ; then + if ${PS} -p "$pid">/dev/null 2>&1; then + # TERM first, then KILL if not dead + kill -TERM $pid 2>/dev/null + sleep 1 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + sleep 1 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + sleep 3 + if ${PS} -p "$pid" >/dev/null 2>&1 ; then + kill -KILL $pid 2>/dev/null + fi + fi + fi + fi + ${PS} -p "$pid" >/dev/null 2>&1 + RC=$? + [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" + # RC=$((! $RC)) + # use specified level only + else + if ${PS} -p "$pid" >/dev/null 2>&1; then + kill $killlevel $pid 2>/dev/null + RC=$? + [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" + fi + fi + else + failure "$base shutdown" + fi + # Remove pid file if any. + if [ "$notset" = "1" ]; then + rm -f ${PIDDIR}/$base.$2.pid + fi + return $RC +} + +# A function to find the pid of a program. +pidofproc() { + pid="" + # Test syntax. + if [ $# = 0 ] ; then + echo "Usage: pidofproc {program}" + return 1 + fi + + # Get base program name + base=`basename $1` + + # First try PID file + if [ -f ${PIDDIR}/$base.$2.pid ] ; then + pid=`head -n 1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + fi + + # Next try "pidof" + if [ -x ${PIDOF} ] ; then + pid=`${PIDOF} $1` + fi + if [ "$pid" != "" ] ; then + echo $pid + return 0 + fi + + # Finally try to extract it from ps + ${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' ' + return 0 +} + +status() { + pid="" + # Test syntax. + if [ $# = 0 ] ; then + echo "Usage: status {program} {port}" + return 1 + fi + + # Get base program name + base=`basename $1` + + # First try "pidof" + if [ -x ${PIDOF} ] ; then + pid=`${PIDOF} $1` + fi + if [ "$pid" != "" ] ; then + echo "$base (pid $pid) is running..." + return 0 + else + pid=`${PSCMD} | ${AWK} 'BEGIN { prog=ARGV[1]; ARGC=1 } + { if ((prog == $2) || (("(" prog ")") == $2) || + (("[" prog "]") == $2) || + ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` + if [ "$pid" != "" ] ; then + echo "$base (pid $pid) is running..." + return 0 + fi + fi + + # Next try the PID files + if [ -f ${PIDDIR}/$base.$2.pid ] ; then + pid=`head -n 1 ${PIDDIR}/$base.$2.pid` + if [ "$pid" != "" ] ; then + echo "$base dead but pid file exists" + return 1 + fi + fi + # See if the subsys lock exists + if [ -f ${SUBSYSDIR}/$base ] ; then + echo "$base dead but subsys locked" + return 2 + fi + echo "$base is stopped" + return 3 +} + +success() { + return 0 +} + +failure() { + rc=$? + return $rc +} + +OS=`uname -s` + +# if /lib/tls exists, force Bacula to use the glibc pthreads instead +if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then + export LD_ASSUME_KERNEL=2.4.19 +fi + +case "$1" in + start) + [ -x ${BACSDBIN}/bacula-sd ] && { + echo "Starting the Bacula Storage daemon" + OPTIONS='' + if [ "${SD_USER}" != '' ]; then + OPTIONS="${OPTIONS} -u ${SD_USER}" + fi + + if [ "${SD_GROUP}" != '' ]; then + OPTIONS="${OPTIONS} -g ${SD_GROUP}" + fi + + ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf + } + ;; + + + stop) + [ -x ${BACSDBIN}/bacula-sd ] && { + echo "Stopping the Bacula Storage daemon" + killproc ${BACSDBIN}/bacula-sd ${SD_PORT} + } + ;; + + restart) + $0 stop + sleep 5 + $0 start + ;; + + status) + [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT} + ;; + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac +exit 0 diff --git a/bacula/scripts/bacula.in b/bacula/scripts/bacula.in index 8aa6b5c5d8..0382ab8f20 100755 --- a/bacula/scripts/bacula.in +++ b/bacula/scripts/bacula.in @@ -9,276 +9,39 @@ # description: It comes by night and sucks the vital essence from your computers. # -PSCMD="@PSCMD@" -PS="ps" - -# -# On Solaris, you may need to use nawk, or alternatively, -# add the GNU binaries to your path, such as /usr/xpg4/bin -# -AWK=@AWK@ - # All these are not *really* needed but it makes it # easier to "steal" this code for the development # environment where they are different. # -BACFDBIN=@sbindir@ BACFDCFG=@sysconfdir@ -BACSDBIN=@sbindir@ BACSDCFG=@sysconfdir@ -BACDIRBIN=@sbindir@ BACDIRCFG=@sysconfdir@ -PIDDIR=@piddir@ -SUBSYSDIR=@subsysdir@ - -DIR_PORT=@dir_port@ -FD_PORT=@fd_port@ -SD_PORT=@sd_port@ - -DIR_USER=@dir_user@ -DIR_GROUP=@dir_group@ -FD_USER=@fd_user@ -FD_GROUP=@fd_group@ -SD_USER=@sd_user@ -SD_GROUP=@sd_group@ - -PIDOF=@PIDOF@ - -# A function to stop a program. -killproc() { - RC=0 - # Test syntax. - if [ $# = 0 ]; then - echo "Usage: killproc {program} {port} [signal]" - return 1 - fi - - notset=0 - # check for third arg to be kill level - if [ "$3" != "" ] ; then - killlevel=$3 - else - notset=1 - killlevel="-9" - fi - - # Get base program name - base=`basename $1` - - # Find pid. - pid=`pidofproc $base $2` - - # Kill it. - if [ "$pid" != "" ] ; then - if [ "$notset" = "1" ] ; then - if ${PS} -p $pid>/dev/null 2>&1; then - # TERM first, then KILL if not dead - kill -TERM $pid 2>/dev/null - sleep 1 - if ${PS} -p $pid >/dev/null 2>&1 ; then - sleep 1 - if ${PS} -p $pid >/dev/null 2>&1 ; then - sleep 3 - if ${PS} -p $pid >/dev/null 2>&1 ; then - kill -KILL $pid 2>/dev/null - fi - fi - fi - fi - ${PS} -p $pid >/dev/null 2>&1 - RC=$? - [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" - # RC=$((! $RC)) - # use specified level only - else - if ${PS} -p $pid >/dev/null 2>&1; then - kill $killlevel $pid 2>/dev/null - RC=$? - [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" - fi - fi - else - failure "$base shutdown" - fi - # Remove pid file if any. - if [ "$notset" = "1" ]; then - rm -f ${PIDDIR}/$base.$2.pid - fi - return $RC -} - -# A function to find the pid of a program. -pidofproc() { - pid="" - # Test syntax. - if [ $# = 0 ] ; then - echo "Usage: pidofproc {program}" - return 1 - fi - - # Get base program name - base=`basename $1` - - # First try PID file - if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -n 1 ${PIDDIR}/$base.$2.pid` - if [ "$pid" != "" ] ; then - echo $pid - return 0 - fi - fi - - # Next try "pidof" - if [ -x ${PIDOF} ] ; then - pid=`${PIDOF} $1` - fi - if [ "$pid" != "" ] ; then - echo $pid - return 0 - fi - - # Finally try to extract it from ps - ${PSCMD} | grep $1 | ${AWK} '{ print $1 }' | tr '\n' ' ' - return 0 -} - -status() { - pid="" - # Test syntax. - if [ $# = 0 ] ; then - echo "Usage: status {program} {port}" - return 1 - fi - - # Get base program name - base=`basename $1` - - # First try "pidof" - if [ -x ${PIDOF} ] ; then - pid=`${PIDOF} $1` - fi - if [ "$pid" != "" ] ; then - echo "$base (pid $pid) is running..." - return 0 - else - pid=`${PSCMD} | ${AWK} 'BEGIN { prog=ARGV[1]; ARGC=1 } - { if ((prog == $2) || (("(" prog ")") == $2) || - (("[" prog "]") == $2) || - ((prog ":") == $2)) { print $1 ; exit 0 } }' $1` - if [ "$pid" != "" ] ; then - echo "$base (pid $pid) is running..." - return 0 - fi - fi - - # Next try the PID files - if [ -f ${PIDDIR}/$base.$2.pid ] ; then - pid=`head -n 1 ${PIDDIR}/$base.$2.pid` - if [ "$pid" != "" ] ; then - echo "$base dead but pid file exists" - return 1 - fi - fi - # See if the subsys lock exists - if [ -f ${SUBSYSDIR}/$base ] ; then - echo "$base dead but subsys locked" - return 2 - fi - echo "$base is stopped" - return 3 -} - -success() { - return 0 -} - -failure() { - rc=$? - return $rc -} - -OS=`uname -s` - -# if /lib/tls exists, force Bacula to use the glibc pthreads instead -if [ -d "/lib/tls" -a $OS = "Linux" -a `uname -r | cut -c1-3` = "2.4" ] ; then - export LD_ASSUME_KERNEL=2.4.19 -fi case "$1" in start) - [ -x ${BACSDBIN}/bacula-sd ] && { - echo "Starting the Bacula Storage daemon" - OPTIONS='' - if [ "${SD_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${SD_USER}" - fi - - if [ "${SD_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${SD_GROUP}" - fi - - ${BACSDBIN}/bacula-sd $2 ${OPTIONS} -v -c ${BACSDCFG}/bacula-sd.conf - } - - [ -x ${BACFDBIN}/bacula-fd ] && { - echo "Starting the Bacula File daemon" - OPTIONS='' - if [ "${FD_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${FD_USER}" - fi - - if [ "${FD_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${FD_GROUP}" - fi - - ${BACFDBIN}/bacula-fd $2 ${OPTIONS} -v -c ${BACFDCFG}/bacula-fd.conf - } - - [ -x ${BACDIRBIN}/bacula-dir ] && { - sleep 2 - echo "Starting the Bacula Director daemon" - OPTIONS='' - if [ "${DIR_USER}" != '' ]; then - OPTIONS="${OPTIONS} -u ${DIR_USER}" - fi - - if [ "${DIR_GROUP}" != '' ]; then - OPTIONS="${OPTIONS} -g ${DIR_GROUP}" - fi - - ${BACDIRBIN}/bacula-dir $2 ${OPTIONS} -v -c ${BACDIRCFG}/bacula-dir.conf - } + [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2 + [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2 + [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2 ;; stop) # Stop the FD first so that SD will fail jobs and update catalog - [ -x ${BACFDBIN}/bacula-fd ] && { - echo "Stopping the Bacula File daemon" - killproc ${BACFDBIN}/bacula-fd ${FD_PORT} - } - - [ -x ${BACSDBIN}/bacula-sd ] && { - echo "Stopping the Bacula Storage daemon" - killproc ${BACSDBIN}/bacula-sd ${SD_PORT} - } - - [ -x ${BACDIRBIN}/bacula-dir ] && { - echo "Stopping the Bacula Director daemon" - killproc ${BACDIRBIN}/bacula-dir ${DIR_PORT} - } + [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd $1 $2 + [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd $1 $2 + [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir $1 $2 echo + sleep 6 ;; restart) $0 stop - sleep 5 $0 start ;; status) - [ -x ${BACSDBIN}/bacula-sd ] && status ${BACSDBIN}/bacula-sd ${SD_PORT} - [ -x ${BACFDBIN}/bacula-fd ] && status ${BACFDBIN}/bacula-fd ${FD_PORT} - [ -x ${BACDIRBIN}/bacula-dir ] && status ${BACDIRBIN}/bacula-dir ${DIR_PORT} + [ -x ${BACSDCFG}/bacula-ctl-sd ] && ${BACSDCFG}/bacula-ctl-sd status + [ -x ${BACFDCFG}/bacula-ctl-fd ] && ${BACFDCFG}/bacula-ctl-fd status + [ -x ${BACDIRCFG}/bacula-ctl-dir ] && ${BACDIRCFG}/bacula-ctl-dir status ;; *) diff --git a/bacula/src/baconfig.h b/bacula/src/baconfig.h index 0e1ce65627..1114e0e94d 100644 --- a/bacula/src/baconfig.h +++ b/bacula/src/baconfig.h @@ -30,18 +30,14 @@ #define TRUE 1 #define FALSE 0 -#ifndef MAX -#define MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif -#ifndef MIN -#define MIN(a, b) ((a) < (b) ? (a) : (b)) -#endif - #ifdef HAVE_TLS #define have_tls 1 #else #define have_tls 0 #endif +/* For compatibility with 1.39 */ +#define cleanup_crypto cleanup_tls +#define init_crypto init_tls #ifndef ETIME #define ETIME ETIMEDOUT @@ -151,7 +147,6 @@ * STREAM_SHA256_DIGEST * STREAM_SHA512_DIGEST */ -#define STREAM_NONE 0 /* Reserved Non-Stream */ #define STREAM_UNIX_ATTRIBUTES 1 /* Generic Unix attributes */ #define STREAM_FILE_DATA 2 /* Standard uncompressed data */ #define STREAM_MD5_SIGNATURE 3 /* deprecated */ @@ -173,15 +168,11 @@ #define STREAM_UNIX_ATTRIBUTES_ACCESS_ACL 15 /* Standard ACL attributes on UNIX */ #define STREAM_UNIX_ATTRIBUTES_DEFAULT_ACL 16 /* Default ACL attributes on UNIX */ /*** FIXME ***/ -#define STREAM_SHA256_DIGEST 17 /* SHA-256 digest for the file */ -#define STREAM_SHA512_DIGEST 18 /* SHA-512 digest for the file */ -#define STREAM_SIGNED_DIGEST 19 /* Signed File Digest, ASN.1, DER Encoded */ -#define STREAM_ENCRYPTED_FILE_DATA 20 /* Encrypted, uncompressed data */ -#define STREAM_ENCRYPTED_WIN32_DATA 21 /* Encrypted, uncompressed Win32 BackupRead data */ -#define STREAM_ENCRYPTED_SESSION_DATA 22 /* Encrypted Session Data, ASN.1, DER Encoded */ -#define STREAM_ENCRYPTED_FILE_GZIP_DATA 23 /* Encrypted, compressed data */ -#define STREAM_ENCRYPTED_WIN32_GZIP_DATA 24 /* Encrypted, compressed Win32 BackupRead data */ -#define STREAM_ENCRYPTED_MACOS_FORK_DATA 25 /* Encrypted, uncompressed Mac resource fork */ +#define STREAM_SHA256_DIGEST 17 /* SHA-256 digest for the file */ +#define STREAM_SHA512_DIGEST 18 /* SHA-512 digest for the file */ +#define STREAM_SIGNED_DIGEST 19 /* Signed File Digest, ASN.1 Encoded */ +#define STREAM_ENCRYPTED_FILE_DATA 20 /* Encrypted, uncompressed data */ +#define STREAM_ENCRYPTED_WIN32_DATA 21 /* Encrypted, uncompressed Win32 BackupRead data */ /* @@ -220,6 +211,13 @@ /* Definitions for upper part of type word (see above). */ #define AR_DATA_STREAM (1<<16) /* Data stream id present */ +/* + * Internal code for Signature types + */ +#define NO_SIG 0 +#define MD5_SIG 1 +#define SHA1_SIG 2 + /* * Tape label types -- stored in catalog */ diff --git a/bacula/src/bacula.h b/bacula/src/bacula.h index 6225d44e11..e820a93c0e 100644 --- a/bacula/src/bacula.h +++ b/bacula/src/bacula.h @@ -113,8 +113,6 @@ #include #include #include -#include -#include #undef STORE #endif diff --git a/bacula/src/cats/bdb_update.c b/bacula/src/cats/bdb_update.c index 7b1f054f8d..bea9cc8bec 100755 --- a/bacula/src/cats/bdb_update.c +++ b/bacula/src/cats/bdb_update.c @@ -197,7 +197,7 @@ int db_update_pool_record(JCR *jcr, B_DB *mdb, POOL_DBR *pr) return stat; } -int db_add_digest_to_file_record(JCR *jcr, B_DB *mdb, FileId_t FileId, char *digest, int type) +int db_add_SIG_to_file_record(JCR *jcr, B_DB *mdb, FileId_t FileId, char *SIG, int type) { return 1; } diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index 25d5b53ea4..00097ccaed 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -14,7 +14,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -546,8 +546,6 @@ struct JOB_DBR { uint32_t JobErrors; uint32_t JobMissingFiles; uint64_t JobBytes; - int PurgedFiles; - int HasBase; /* Note, FirstIndex, LastIndex, Start/End File and Block * are only used in the JobMedia record. @@ -567,33 +565,6 @@ struct JOB_DBR { faddr_t rec_addr; }; -/* - * Suplementary record for Migration, archive, copy jobs - */ -/* MAC record */ -struct MAC_DBR { - JobId_t JobId; /* Id of this job */ - JobId_t OriginalJobId; /* Id of job migrated, copied or archived */ - /* - * The following are the actual values for this job. This - * is needed because the values in the corresponding Job - * record were set to the values of the original backup job. - */ - int JobType; /* Actual job type */ - int JobLevel; /* Actual job level */ - time_t SchedTime; /* Actual time job scheduled */ - time_t StartTime; /* Actual Job start time */ - time_t EndTime; /* Actual Job termination time */ - utime_t JobTDate; /* Actual Backup time/date in seconds */ - - char cSchedTime[MAX_TIME_LENGTH]; - char cStartTime[MAX_TIME_LENGTH]; - char cEndTime[MAX_TIME_LENGTH]; - -}; - - - /* Job Media information used to create the media records * for each Volume used for the job. */ @@ -617,7 +588,6 @@ struct JOBMEDIA_DBR { struct VOL_PARAMS { char VolumeName[MAX_NAME_LENGTH]; /* Volume name */ char MediaType[MAX_NAME_LENGTH]; /* Media Type */ - char Storage[MAX_NAME_LENGTH]; /* Storage name */ uint32_t VolIndex; /* Volume seqence no. */ uint32_t FirstIndex; /* First index this Volume */ uint32_t LastIndex; /* Last index this Volume */ @@ -625,7 +595,6 @@ struct VOL_PARAMS { uint32_t EndFile; /* End file on Volume */ uint32_t StartBlock; /* start block on tape */ uint32_t EndBlock; /* last block */ - int32_t Slot; /* Slot */ // uint32_t Copy; /* identical copy */ // uint32_t Stripe; /* RAIT strip number */ }; @@ -646,8 +615,8 @@ struct ATTR_DBR { DBId_t PathId; DBId_t FilenameId; FileId_t FileId; - char *Digest; - int DigestType; + char *Sig; + int SigType; }; @@ -660,8 +629,8 @@ struct FILE_DBR { DBId_t PathId; JobId_t MarkId; char LStat[256]; - char Digest[BASE64_SIZE(CRYPTO_DIGEST_MAX_SIZE)]; - int DigestType; /* NO_SIG/MD5_SIG/SHA1_SIG */ + char SIG[50]; + int SigType; /* NO_SIG/MD5_SIG/SHA1_SIG */ }; /* Pool record -- same format as database */ diff --git a/bacula/src/cats/create_postgresql_database.in b/bacula/src/cats/create_postgresql_database.in index 1cbe61e9e6..8ee437d85f 100644 --- a/bacula/src/cats/create_postgresql_database.in +++ b/bacula/src/cats/create_postgresql_database.in @@ -5,8 +5,18 @@ bindir=@SQL_BINDIR@ +# use SQL_ASCII to be able to put any filename into +# the database even those created with unusual character sets +ENCODING="ENCODING 'SQL_ASCII'" +# use UTF8 if you are using standard Unix/Linux LANG specifications +# that use UTF8 -- this is normally the default and *should* be +# your standard. Bacula consoles work correctly *only* with UTF8. +#ENCODING="ENCODING 'UTF8'" + + if $bindir/psql -f - -d template1 $* <result = sql_use_result(mdb)) != NULL) { - int num_fields = sql_num_fields(mdb); + int num_fields = 0; + /* We *must* fetch all rows */ while ((row = sql_fetch_row(mdb)) != NULL) { - if (result_handler(ctx, num_fields, row)) - break; + if (send) { + /* the result handler returns 1 when it has + * seen all the data it wants. However, we + * loop to the end of the data. + */ + num_fields++; + if (result_handler(ctx, num_fields, row)) { + send = false; + } + } } sql_free_result(mdb); diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 43a43bd2fe..ddcd2cda32 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -8,7 +8,7 @@ * Version $Id$ */ /* - Copyright (C) 2003-2005 Kern Sibbald + Copyright (C) 2003-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -175,6 +175,8 @@ db_open_database(JCR *jcr, B_DB *mdb) return 0; } + sql_query(mdb, "SET datestyle TO 'ISO, YMD'"); + mdb->connected = true; V(mutex); return 1; diff --git a/bacula/src/cats/protos.h b/bacula/src/cats/protos.h index 464af82d1b..aae4d38cf1 100644 --- a/bacula/src/cats/protos.h +++ b/bacula/src/cats/protos.h @@ -6,17 +6,22 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ @@ -43,8 +48,7 @@ void db_end_transaction(JCR *jcr, B_DB *mdb); /* create.c */ int db_create_file_attributes_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar); -bool db_create_job_record(JCR *jcr, B_DB *db, JOB_DBR *jr); -bool db_create_mac_record(JCR *jcr, B_DB *db, MAC_DBR *mr); +int db_create_job_record(JCR *jcr, B_DB *db, JOB_DBR *jr); int db_create_media_record(JCR *jcr, B_DB *db, MEDIA_DBR *media_dbr); int db_create_client_record(JCR *jcr, B_DB *db, CLIENT_DBR *cr); bool db_create_fileset_record(JCR *jcr, B_DB *db, FILESET_DBR *fsr); @@ -68,8 +72,7 @@ bool db_find_failed_job_since(JCR *jcr, B_DB *mdb, JOB_DBR *jr, POOLMEM *stime, /* get.c */ bool db_get_pool_record(JCR *jcr, B_DB *db, POOL_DBR *pdbr); int db_get_client_record(JCR *jcr, B_DB *mdb, CLIENT_DBR *cr); -bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr); -bool db_get_mac_record(JCR *jcr, B_DB *mdb, MAC_DBR *mr); +int db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr); int db_get_job_volume_names(JCR *jcr, B_DB *mdb, JobId_t JobId, POOLMEM **VolumeNames); int db_get_file_attributes_record(JCR *jcr, B_DB *mdb, char *fname, JOB_DBR *jr, FILE_DBR *fdbr); int db_get_fileset_record(JCR *jcr, B_DB *mdb, FILESET_DBR *fsr); @@ -107,7 +110,7 @@ bool db_update_storage_record(JCR *jcr, B_DB *mdb, STORAGE_DBR *sr); int db_update_media_record(JCR *jcr, B_DB *db, MEDIA_DBR *mr); int db_update_media_defaults(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr); int db_update_counter_record(JCR *jcr, B_DB *mdb, COUNTER_DBR *cr); -int db_add_digest_to_file_record(JCR *jcr, B_DB *mdb, FileId_t FileId, char *digest, int type); +int db_add_SIG_to_file_record(JCR *jcr, B_DB *mdb, FileId_t FileId, char *SIG, int type); int db_mark_file_record(JCR *jcr, B_DB *mdb, FileId_t FileId, JobId_t JobId); void db_make_inchanger_unique(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr); diff --git a/bacula/src/cats/sql_create.c b/bacula/src/cats/sql_create.c index a3a877da10..fb46704122 100644 --- a/bacula/src/cats/sql_create.c +++ b/bacula/src/cats/sql_create.c @@ -53,16 +53,16 @@ extern void split_path_and_file(JCR *jcr, B_DB *mdb, const char *fname); /* Create a new record for the Job - * Returns: false on failure - * true on success + * Returns: 0 on failure + * 1 on success */ -bool +int db_create_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) { char dt[MAX_TIME_LENGTH]; time_t stime; struct tm tm; - bool ok; + int stat; utime_t JobTDate; char ed1[30]; @@ -86,65 +86,15 @@ db_create_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) Mmsg2(&mdb->errmsg, _("Create DB Job record %s failed. ERR=%s\n"), mdb->cmd, sql_strerror(mdb)); jr->JobId = 0; - ok = false; + stat = 0; } else { jr->JobId = sql_insert_id(mdb, N_("Job")); - ok = true; - } - db_unlock(mdb); - return ok; -} - -/* Create a new migration, archive, copy - * Returns: false on failure - * true on success - */ -bool -db_create_mac_record(JCR *jcr, B_DB *mdb, MAC_DBR *mr) -{ - char schedt[MAX_TIME_LENGTH], sdt[MAX_TIME_LENGTH], edt[MAX_TIME_LENGTH]; - time_t stime; - struct tm tm; - bool ok; - utime_t JobTDate; - char ed1[30], ed2[30]; - - db_lock(mdb); - - stime = mr->SchedTime; - ASSERT(stime != 0); - - localtime_r(&stime, &tm); - strftime(schedt, sizeof(schedt), "%Y-%m-%d %T", &tm); - JobTDate = (utime_t)stime; - localtime_r(&mr->StartTime, &tm); - strftime(sdt, sizeof(sdt), "%Y-%m-%d %T", &tm); - localtime_r(&mr->EndTime, &tm); - strftime(edt, sizeof(edt), "%Y-%m-%d %T", &tm); - - /* Must create it */ - Mmsg(mdb->cmd, -"INSERT INTO MAC (OriginaJobId,JobType,JobLevel,SchedTime," -"StartTime,EndTime,JobTDate) VALUES " -"('%s','%c','%c','%s','%s','%s',%s)", - edit_int64(mr->OriginalJobId, ed1), - (char)(mr->JobType), (char)(mr->JobLevel), - schedt, sdt, edt, edit_uint64(JobTDate, ed2)); - - if (!INSERT_DB(jcr, mdb, mdb->cmd)) { - Mmsg2(&mdb->errmsg, _("Create DB MAC record %s failed. ERR=%s\n"), - mdb->cmd, sql_strerror(mdb)); - mr->JobId = 0; - ok = false; - } else { - mr->JobId = sql_insert_id(mdb, N_("Job")); - ok = true; + stat = 1; } db_unlock(mdb); - return ok; + return stat; } - /* Create a JobMedia record for medium used this job * Returns: false on failure * true on success @@ -441,11 +391,11 @@ db_create_media_record(JCR *jcr, B_DB *mdb, MEDIA_DBR *mr) /* Must create it */ Mmsg(mdb->cmd, -"INSERT INTO Media (VolumeName,MediaType,MediaTypeId,PoolId,MaxVolBytes," -"VolCapacityBytes,Recycle,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles," +"INSERT INTO Media (VolumeName,MediaType,PoolId,MaxVolBytes,VolCapacityBytes," +"Recycle,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles," "VolStatus,Slot,VolBytes,InChanger,VolReadTime,VolWriteTime,VolParts," -"EndFile,EndBlock,LabelType,StorageId,DeviceId,LocationId) " -"VALUES ('%s','%s',0,%u,%s,%s,%d,%s,%s,%u,%u,'%s',%d,%s,%d,%s,%s,%d,0,0,%d,%s,0,0)", +"EndFile,EndBlock,LabelType,StorageId) " +"VALUES ('%s','%s',%u,%s,%s,%d,%s,%s,%u,%u,'%s',%d,%s,%d,%s,%s,%d,0,0,%d,%s)", mr->VolumeName, mr->MediaType, mr->PoolId, edit_uint64(mr->MaxVolBytes,ed1), @@ -759,17 +709,17 @@ bail_out: static int db_create_file_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) { int stat; - static char *no_digest = "0"; - char *digest; + static char *no_sig = "0"; + char *sig; ASSERT(ar->JobId); ASSERT(ar->PathId); ASSERT(ar->FilenameId); - if (ar->Digest == NULL) { - digest = no_digest; + if (ar->Sig == NULL) { + sig = no_sig; } else { - digest = ar->Digest; + sig = ar->Sig; } /* Must create it */ @@ -777,7 +727,7 @@ static int db_create_file_record(JCR *jcr, B_DB *mdb, ATTR_DBR *ar) "INSERT INTO File (FileIndex,JobId,PathId,FilenameId," "LStat,MD5) VALUES (%u,%u,%u,%u,'%s','%s')", ar->FileIndex, ar->JobId, ar->PathId, ar->FilenameId, - ar->attr, digest); + ar->attr, sig); if (!INSERT_DB(jcr, mdb, mdb->cmd)) { Mmsg2(&mdb->errmsg, _("Create db File record %s failed. ERR=%s"), diff --git a/bacula/src/cats/sql_find.c b/bacula/src/cats/sql_find.c index 641a1e7700..19c95eee71 100644 --- a/bacula/src/cats/sql_find.c +++ b/bacula/src/cats/sql_find.c @@ -10,7 +10,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -262,7 +262,7 @@ db_find_last_jobid(JCR *jcr, B_DB *mdb, const char *Name, JOB_DBR *jr) int db_find_next_volume(JCR *jcr, B_DB *mdb, int item, bool InChanger, MEDIA_DBR *mr) { - SQL_ROW row; + SQL_ROW row = NULL; int numrows; const char *order; @@ -313,23 +313,26 @@ db_find_next_volume(JCR *jcr, B_DB *mdb, int item, bool InChanger, MEDIA_DBR *mr } numrows = sql_num_rows(mdb); - if (item > numrows) { - Mmsg2(&mdb->errmsg, _("Request for Volume item %d greater than max %d\n"), + if (item > numrows || item < 1) { + Mmsg2(&mdb->errmsg, _("Request for Volume item %d greater than max %d or less than 1.\n"), item, numrows); db_unlock(mdb); return 0; } - /* Seek to desired item - * Note, we use base 1; SQL uses base 0 + /* Note, we previously seeked to the row using: + * sql_data_seek(mdb, item-1); + * but this failed on PostgreSQL, so now we loop + * over all the records. This should not be too horrible since + * the maximum Volumes we look at in any case is 20. */ - sql_data_seek(mdb, item-1); - - if ((row = sql_fetch_row(mdb)) == NULL) { - Mmsg1(&mdb->errmsg, _("No Volume record found for item %d.\n"), item); - sql_free_result(mdb); - db_unlock(mdb); - return 0; + while (item-- > 0) { + if ((row = sql_fetch_row(mdb)) == NULL) { + Mmsg1(&mdb->errmsg, _("No Volume record found for item %d.\n"), item); + sql_free_result(mdb); + db_unlock(mdb); + return 0; + } } /* Return fields in Media Record */ diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index f2bd3d9dd9..701332e2d5 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -10,7 +10,7 @@ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -136,7 +136,7 @@ int db_get_file_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr, FILE_DBR *fdbr) } else { fdbr->FileId = (FileId_t)str_to_int64(row[0]); bstrncpy(fdbr->LStat, row[1], sizeof(fdbr->LStat)); - bstrncpy(fdbr->Digest, row[2], sizeof(fdbr->Digest)); + bstrncpy(fdbr->SIG, row[2], sizeof(fdbr->SIG)); stat = 1; } } else { @@ -257,10 +257,10 @@ static int db_get_path_record(JCR *jcr, B_DB *mdb) /* * Get Job record for given JobId or Job name - * Returns: false on failure - * true on success + * Returns: 0 on failure + * 1 on success */ -bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) +int db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) { SQL_ROW row; char ed1[50]; @@ -281,13 +281,13 @@ bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) if (!QUERY_DB(jcr, mdb, mdb->cmd)) { db_unlock(mdb); - return false; /* failed */ + return 0; /* failed */ } if ((row = sql_fetch_row(mdb)) == NULL) { Mmsg1(mdb->errmsg, _("No Job found for JobId %s\n"), edit_int64(jr->JobId, ed1)); sql_free_result(mdb); db_unlock(mdb); - return false; /* failed */ + return 0; /* failed */ } jr->VolSessionId = str_to_uint64(row[0]); @@ -306,51 +306,10 @@ bool db_get_job_record(JCR *jcr, B_DB *mdb, JOB_DBR *jr) bstrncpy(jr->Name, row[13]!=NULL?row[13]:"", sizeof(jr->Name)); sql_free_result(mdb); - db_unlock(mdb); - return true; -} - -/* - * Get MAC record for given JobId - * Returns: false on failure - * true on success - */ -bool db_get_mac_record(JCR *jcr, B_DB *mdb, MAC_DBR *mr) -{ - SQL_ROW row; - char ed1[50]; - - db_lock(mdb); - Mmsg(mdb->cmd, "SELECT OriginalJobId,JobType,JobLevel," -"SchedTime,StartTime,EndTime,JobTDate" -"FROM MAC WHERE JobId=%s", - edit_int64(mr->JobId, ed1)); - - if (!QUERY_DB(jcr, mdb, mdb->cmd)) { - db_unlock(mdb); - return 0; /* failed */ - } - if ((row = sql_fetch_row(mdb)) == NULL) { - Mmsg1(mdb->errmsg, _("No MAC record found for JobId %s\n"), ed1); - sql_free_result(mdb); - db_unlock(mdb); - return false; /* failed */ - } - - mr->OriginalJobId = str_to_int64(row[0]); - mr->JobType = (int)*row[1]; - mr->JobLevel = (int)*row[2]; - bstrncpy(mr->cSchedTime, row[3]!=NULL?row[3]:"", sizeof(mr->cSchedTime)); - bstrncpy(mr->cStartTime, row[4]!=NULL?row[4]:"", sizeof(mr->cStartTime)); - bstrncpy(mr->cEndTime, row[5]!=NULL?row[5]:"", sizeof(mr->cEndTime)); - mr->JobTDate = str_to_int64(row[6]); - sql_free_result(mdb); - db_unlock(mdb); return 1; } - /* * Find VolumeNames for a given JobId * Returns: 0 on error or no Volumes found @@ -427,8 +386,7 @@ int db_get_job_volume_parameters(JCR *jcr, B_DB *mdb, JobId_t JobId, VOL_PARAMS db_lock(mdb); Mmsg(mdb->cmd, "SELECT VolumeName,MediaType,FirstIndex,LastIndex,StartFile," -"JobMedia.EndFile,StartBlock,JobMedia.EndBlock,Copy,Stripe," -"Slot,StorageId" +"JobMedia.EndFile,StartBlock,JobMedia.EndBlock,Copy,Stripe" " FROM JobMedia,Media WHERE JobMedia.JobId=%s" " AND JobMedia.MediaId=Media.MediaId ORDER BY VolIndex,JobMediaId", edit_int64(JobId, ed1)); @@ -436,16 +394,14 @@ int db_get_job_volume_parameters(JCR *jcr, B_DB *mdb, JobId_t JobId, VOL_PARAMS Dmsg1(130, "VolNam=%s\n", mdb->cmd); if (QUERY_DB(jcr, mdb, mdb->cmd)) { mdb->num_rows = sql_num_rows(mdb); - Dmsg1(200, "Num rows=%d\n", mdb->num_rows); + Dmsg1(130, "Num rows=%d\n", mdb->num_rows); if (mdb->num_rows <= 0) { Mmsg1(mdb->errmsg, _("No volumes found for JobId=%d\n"), JobId); stat = 0; } else { stat = mdb->num_rows; - DBId_t *SId; if (stat > 0) { *VolParams = Vols = (VOL_PARAMS *)malloc(stat * sizeof(VOL_PARAMS)); - SId = (DBId_t *)malloc(stat * sizeof(DBId_t)); } for (i=0; i < stat; i++) { if ((row = sql_fetch_row(mdb)) == NULL) { @@ -454,7 +410,6 @@ int db_get_job_volume_parameters(JCR *jcr, B_DB *mdb, JobId_t JobId, VOL_PARAMS stat = 0; break; } else { - DBId_t StorageId; bstrncpy(Vols[i].VolumeName, row[0], MAX_NAME_LENGTH); bstrncpy(Vols[i].MediaType, row[1], MAX_NAME_LENGTH); Vols[i].FirstIndex = str_to_uint64(row[2]); @@ -465,21 +420,6 @@ int db_get_job_volume_parameters(JCR *jcr, B_DB *mdb, JobId_t JobId, VOL_PARAMS Vols[i].EndBlock = str_to_uint64(row[7]); // Vols[i].Copy = str_to_uint64(row[8]); // Vols[i].Stripe = str_to_uint64(row[9]); - Vols[i].Slot = str_to_uint64(row[10]); - StorageId = str_to_uint64(row[11]); - Vols[i].Storage[0] = 0; - SId[i] = StorageId; - } - } - for (i=0; i < stat; i++) { - if (SId[i] != 0) { - Mmsg(mdb->cmd, "SELECT Name from Storage WHERE StorageId=%s", - edit_int64(SId[i], ed1)); - if (QUERY_DB(jcr, mdb, mdb->cmd)) { - if ((row = sql_fetch_row(mdb)) != NULL) { - bstrncpy(Vols[i].Storage, row[0], MAX_NAME_LENGTH); - } - } } } } diff --git a/bacula/src/cats/sql_list.c b/bacula/src/cats/sql_list.c index 8d180198dc..c1b451e319 100644 --- a/bacula/src/cats/sql_list.c +++ b/bacula/src/cats/sql_list.c @@ -6,7 +6,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -282,7 +282,7 @@ db_list_job_records(JCR *jcr, B_DB *mdb, JOB_DBR *jr, DB_LIST_HANDLER *sendit, Mmsg(mdb->cmd, "SELECT JobId,Name,StartTime,Type,Level,JobFiles,JobBytes,JobStatus " "FROM Job WHERE JobId=%s", edit_int64(jr->JobId, ed1)); - } else { /* single record */ + } else { /* all records */ Mmsg(mdb->cmd, "SELECT JobId,Name,StartTime,Type,Level,JobFiles,JobBytes,JobStatus " "FROM Job ORDER BY StartTime,JobId ASC%s", limit); diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index 7cd3dedf5b..1906261e30 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -49,7 +49,7 @@ extern int UpdateDB(const char *file, int line, JCR *jcr, B_DB *db, char *update */ /* Update the attributes record by adding the file digest */ int -db_add_digest_to_file_record(JCR *jcr, B_DB *mdb, FileId_t FileId, char *digest, +db_add_SIG_to_file_record(JCR *jcr, B_DB *mdb, FileId_t FileId, char *digest, int type) { int stat; diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in index bb3123f4a1..6fcafa766d 100755 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -1,9 +1,9 @@ #!/bin/sh # -# Shell script to update MySQL tables from version 1.38 to 1.39 +# Shell script to update MySQL tables from version 1.36 to 1.38 # echo " " -echo "This script will update a Bacula MySQL database from version 9 to 9" +echo "This script will update a Bacula MySQL database from version 8 to 9" echo "Depending on the size of your database," echo "this script may take several minutes to run." echo " " @@ -12,29 +12,80 @@ bindir=@SQL_BINDIR@ if $bindir/mysql $* -f < Makefile @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile - @$(CXX) -S -M $(CPPFLAGS) $(CONS_INC) -I$(srcdir) -I$(basedir) *.c >> Makefile + @$(CXX) -S -M $(CPPFLAGS) $(CONS_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) *.c >> Makefile @if test -f Makefile ; then \ $(RMF) Makefile.bak; \ else \ diff --git a/bacula/src/console/conio.c b/bacula/src/console/conio.c index 3a9dfe14aa..9fc5c4955b 100755 --- a/bacula/src/console/conio.c +++ b/bacula/src/console/conio.c @@ -9,7 +9,7 @@ */ /* - Copyright (C) 1981-2005 Kern Sibbald + Copyright (C) 1981-2006 Kern Sibbald Yes, that is 1981 no error. This program is free software; you can redistribute it and/or @@ -961,12 +961,8 @@ static void rawmode(FILE *input) /* Defaults, the main program can override these */ signal(SIGQUIT, SIG_IGN); signal(SIGHUP, SIG_IGN); -// signal(SIGSTOP, SIG_IGN); signal(SIGINT, sigintcatcher); signal(SIGWINCH, SIG_IGN); - signal(SIGQUIT, SIG_IGN); -// signal(SIGCHLD, SIG_IGN); -// signal(SIGTSTP, SIG_IGN); if (!termtype) { printf("Cannot get terminal type.\n"); diff --git a/bacula/src/console/console.c b/bacula/src/console/console.c index 7611e9008e..9bea604bd5 100644 --- a/bacula/src/console/console.c +++ b/bacula/src/console/console.c @@ -396,8 +396,8 @@ int main(int argc, char *argv[]) parse_config(configfile); - if (init_crypto() != 0) { - Emsg0(M_ERROR_TERM, 0, _("Cryptography library initialization failed.\n")); + if (init_tls() != 0) { + Emsg0(M_ERROR_TERM, 0, _("TLS library initialization failed.\n")); } if (!check_resources()) { @@ -549,7 +549,7 @@ static void terminate_console(int sig) exit(1); } already_here = true; - cleanup_crypto(); + cleanup_tls(); free_pool_memory(args); con_term(); (void)WSACleanup(); /* Cleanup Windows sockets */ diff --git a/bacula/src/console/console_conf.c b/bacula/src/console/console_conf.c index 10dae2d305..0ef206407a 100644 --- a/bacula/src/console/console_conf.c +++ b/bacula/src/console/console_conf.c @@ -76,8 +76,8 @@ static RES_ITEM cons_items[] = { {"rcfile", store_dir, ITEM(res_cons.rc_file), 0, 0, 0}, {"historyfile", store_dir, ITEM(res_cons.hist_file), 0, 0, 0}, {"password", store_password, ITEM(res_cons.password), 0, ITEM_REQUIRED, 0}, - {"tlsenable", store_bit, ITEM(res_cons.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_cons.tls_require), 1, 0, 0}, + {"tlsenable", store_yesno, ITEM(res_cons.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_cons.tls_require), 1, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(res_cons.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_cons.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_cons.tls_certfile), 0, 0, 0}, @@ -93,8 +93,8 @@ static RES_ITEM dir_items[] = { {"dirport", store_int, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101}, {"address", store_str, ITEM(res_dir.address), 0, 0, 0}, {"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0}, - {"tlsenable", store_bit, ITEM(res_dir.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_dir.tls_require), 1, 0, 0}, + {"tlsenable", store_yesno, ITEM(res_dir.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_dir.tls_require), 1, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(res_dir.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_dir.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_dir.tls_certfile), 0, 0, 0}, diff --git a/bacula/src/dird/autoprune.c b/bacula/src/dird/autoprune.c index e0214080d9..bf054db8eb 100644 --- a/bacula/src/dird/autoprune.c +++ b/bacula/src/dird/autoprune.c @@ -101,7 +101,7 @@ int prune_volumes(JCR *jcr) db_lock(jcr->db); /* Get the List of all media ids in the current Pool */ - if (!db_get_media_ids(jcr, jcr->db, jcr->jr.PoolId, &num_ids, &ids)) { + if (!db_get_media_ids(jcr, jcr->db, jcr->PoolId, &num_ids, &ids)) { Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db)); goto bail_out; } @@ -114,7 +114,7 @@ int prune_volumes(JCR *jcr) continue; } /* Prune only Volumes from current Pool */ - if (jcr->jr.PoolId != mr.PoolId) { + if (jcr->PoolId != mr.PoolId) { continue; } /* Prune only Volumes with status "Full", or "Used" */ diff --git a/bacula/src/dird/backup.c b/bacula/src/dird/backup.c index 496e14d6d8..8568c37388 100644 --- a/bacula/src/dird/backup.c +++ b/bacula/src/dird/backup.c @@ -97,18 +97,35 @@ bool do_backup_init(JCR *jcr) } } } + jcr->PoolId = pr.PoolId; jcr->jr.PoolId = pr.PoolId; - /* If pool storage specified, use it instead of job storage */ - copy_storage(jcr, jcr->pool->storage); - - if (!jcr->storage) { - Jmsg(jcr, M_FATAL, 0, _("No Storage specification found in Job or Pool.\n")); - return false; + /* + * Fire off any clone jobs (run directives) + */ + Dmsg2(900, "cloned=%d run_cmds=%p\n", jcr->cloned, jcr->job->run_cmds); + if (!jcr->cloned && jcr->job->run_cmds) { + char *runcmd; + JOB *job = jcr->job; + POOLMEM *cmd = get_pool_memory(PM_FNAME); + UAContext *ua = new_ua_context(jcr); + ua->batch = true; + foreach_alist(runcmd, job->run_cmds) { + cmd = edit_job_codes(jcr, cmd, runcmd, ""); + Mmsg(ua->cmd, "run %s cloned=yes", cmd); + Dmsg1(900, "=============== Clone cmd=%s\n", ua->cmd); + parse_ua_args(ua); /* parse command */ + int stat = run_cmd(ua, ua->cmd); + if (stat == 0) { + Jmsg(jcr, M_ERROR, 0, _("Could not start clone job.\n")); + } else { + Jmsg(jcr, M_INFO, 0, _("Clone JobId %d started.\n"), stat); + } + } + free_ua_context(ua); + free_pool_memory(cmd); } - create_clones(jcr); /* run any clone jobs */ - return true; } @@ -170,27 +187,27 @@ bool do_backup(JCR *jcr) Dmsg0(150, "Storage daemon connection OK\n"); if (!bnet_fsend(jcr->store_bsock, "run")) { - return false; + goto bail_out; } set_jcr_job_status(jcr, JS_WaitFD); if (!connect_to_file_daemon(jcr, 10, FDConnectTimeout, 1)) { - return false; + goto bail_out; } set_jcr_job_status(jcr, JS_Running); fd = jcr->file_bsock; if (!send_include_list(jcr)) { - return false; + goto bail_out; } if (!send_exclude_list(jcr)) { - return false; + goto bail_out; } if (!send_level_command(jcr)) { - return false; + goto bail_out; } /* @@ -210,20 +227,21 @@ bool do_backup(JCR *jcr) } } - bnet_fsend(fd, storaddr, store->address, store->SDDport, tls_need); + bnet_fsend(fd, storaddr, store->address, store->SDDport, + tls_need); if (!response(jcr, fd, OKstore, "Storage", DISPLAY_ERROR)) { - return false; + goto bail_out; } if (!send_run_before_and_after_commands(jcr)) { - return false; + goto bail_out; } /* Send backup command */ bnet_fsend(fd, backupcmd); if (!response(jcr, fd, OKbackup, "backup", DISPLAY_ERROR)) { - return false; + goto bail_out; } /* Pickup Job termination data */ @@ -233,6 +251,14 @@ bool do_backup(JCR *jcr) return true; } return false; + +/* Come here only after starting SD thread */ +bail_out: + set_jcr_job_status(jcr, JS_ErrorTerminated); + Dmsg1(400, "wait for sd. use=%d\n", jcr->use_count()); + wait_for_storage_daemon_termination(jcr); + Dmsg1(400, "after wait for sd. use=%d\n", jcr->use_count()); + return false; } @@ -309,7 +335,7 @@ void backup_cleanup(JCR *jcr, int TermCode) { char sdt[50], edt[50], schedt[50]; char ec1[30], ec2[30], ec3[30], ec4[30], ec5[30], compress[50]; - char ec6[30], ec7[30], elapsed[50]; + char ec6[30], ec7[30], ec8[30], elapsed[50]; char term_code[100], fd_term_msg[100], sd_term_msg[100]; const char *term_msg; int msg_type; @@ -347,7 +373,6 @@ void backup_cleanup(JCR *jcr, int TermCode) update_bootstrap_file(jcr); - msg_type = M_INFO; /* by default INFO message */ switch (jcr->JobStatus) { case JS_Terminated: @@ -441,7 +466,7 @@ void backup_cleanup(JCR *jcr, int TermCode) " Volume name(s): %s\n" " Volume Session Id: %d\n" " Volume Session Time: %d\n" -" Last Volume Bytes: %s\n" +" Last Volume Bytes: %s (%sB)\n" " Non-fatal FD errors: %d\n" " SD Errors: %d\n" " FD termination status: %s\n" @@ -474,6 +499,7 @@ void backup_cleanup(JCR *jcr, int TermCode) jcr->VolSessionId, jcr->VolSessionTime, edit_uint64_with_commas(mr.VolBytes, ec7), + edit_uint64_with_suffix(mr.VolBytes, ec8), jcr->Errors, jcr->SDErrors, fd_term_msg, diff --git a/bacula/src/dird/bsr.c b/bacula/src/dird/bsr.c index 2321580aa2..4d26e22c0c 100644 --- a/bacula/src/dird/bsr.c +++ b/bacula/src/dird/bsr.c @@ -11,7 +11,7 @@ */ /* - Copyright (C) 2002-2006 Kern Sibbald + Copyright (C) 2002-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -53,27 +53,6 @@ static void free_findex(RBSR_FINDEX *fi) } } -/* - * Get storage device name from Storage resource - */ -static bool get_storage_device(char *device, char *storage) -{ - STORE *store; - if (storage[0] == 0) { - return false; - } - store = (STORE *)GetResWithName(R_STORAGE, storage); - if (!store) { - return false; - } - DEVICE *dev = (DEVICE *)(store->device->first()); - if (!dev) { - return false; - } - bstrncpy(device, dev->hdr.name, MAX_NAME_LENGTH); - return true; -} - /* * Our data structures were not designed completely * correctly, so the file indexes cover the full @@ -191,6 +170,9 @@ bool complete_bsr(UAContext *ua, RBSR *bsr) return true; } +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; +static uint32_t uniq = 0; + void make_unique_restore_filename(UAContext *ua, POOLMEM **fname) { JCR *jcr = ua->jcr; @@ -199,10 +181,16 @@ void make_unique_restore_filename(UAContext *ua, POOLMEM **fname) Mmsg(fname, "%s", ua->argv[i]); jcr->unlink_bsr = false; } else { - Mmsg(fname, "%s/%s.restore.%s.bsr", working_directory, my_name, - jcr->Job); + P(mutex); + uniq++; + V(mutex); + Mmsg(fname, "%s/%s.%u.restore.bsr", working_directory, my_name, uniq); jcr->unlink_bsr = true; } + if (jcr->RestoreBootstrap) { + free(jcr->RestoreBootstrap); + } + jcr->RestoreBootstrap = bstrdup(*fname); } /* @@ -299,7 +287,6 @@ static uint32_t write_bsr(UAContext *ua, RESTORE_CTX &rx, FILE *fd) bool first = true; char *p; JobId_t JobId; - char device[MAX_NAME_LENGTH]; RBSR *bsr; if (*rx.JobIds == 0) { for (bsr=rx.bsr; bsr; bsr=bsr->next) { @@ -315,12 +302,6 @@ static uint32_t write_bsr(UAContext *ua, RESTORE_CTX &rx, FILE *fd) } fprintf(fd, "Volume=\"%s\"\n", bsr->VolParams[i].VolumeName); fprintf(fd, "MediaType=\"%s\"\n", bsr->VolParams[i].MediaType); - if (get_storage_device(device, bsr->VolParams[i].Storage)) { - fprintf(fd, "Device=\"%s\"\n", device); - } - if (bsr->VolParams[i].Slot > 0) { - fprintf(fd, "Slot=%d\n", bsr->VolParams[i].Slot); - } fprintf(fd, "VolSessionId=%u\n", bsr->VolSessionId); fprintf(fd, "VolSessionTime=%u\n", bsr->VolSessionTime); if (bsr->VolParams[i].StartFile == bsr->VolParams[i].EndFile) { @@ -374,12 +355,6 @@ static uint32_t write_bsr(UAContext *ua, RESTORE_CTX &rx, FILE *fd) } fprintf(fd, "Volume=\"%s\"\n", bsr->VolParams[i].VolumeName); fprintf(fd, "MediaType=\"%s\"\n", bsr->VolParams[i].MediaType); - if (get_storage_device(device, bsr->VolParams[i].Storage)) { - fprintf(fd, "Device=\"%s\"\n", device); - } - if (bsr->VolParams[i].Slot > 0) { - fprintf(fd, "Slot=%d\n", bsr->VolParams[i].Slot); - } fprintf(fd, "VolSessionId=%u\n", bsr->VolSessionId); fprintf(fd, "VolSessionTime=%u\n", bsr->VolSessionTime); if (bsr->VolParams[i].StartFile == bsr->VolParams[i].EndFile) { diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index e599bd95f2..7cfa64ba05 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -13,7 +13,7 @@ * Version $Id$ */ /* - Copyright (C) 2001-2006 Kern Sibbald + Copyright (C) 2001-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -29,7 +29,6 @@ #include "bacula.h" #include "dird.h" -#include "findlib/find.h" /* * Handle catalog request @@ -122,9 +121,7 @@ void catalog_request(JCR *jcr, BSOCK *bs) ok = db_get_pool_record(jcr, jcr->db, &pr); if (ok) { mr.PoolId = pr.PoolId; - if (jcr->store->StorageId) { - mr.StorageId = jcr->store->StorageId; - } + mr.StorageId = jcr->store->StorageId; ok = find_next_volume_for_append(jcr, &mr, index, true /*permit create new vol*/); } /* @@ -160,7 +157,7 @@ void catalog_request(JCR *jcr, BSOCK *bs) * Pool matches, and it is either Append or Recycle * and Media Type matches and Pool allows any volume. */ - if (mr.PoolId != jcr->jr.PoolId) { + if (mr.PoolId != jcr->PoolId) { reason = _("not in Pool"); } else if (strcmp(mr.MediaType, jcr->store->media_type) != 0) { reason = _("not correct MediaType"); @@ -279,13 +276,8 @@ void catalog_request(JCR *jcr, BSOCK *bs) &jm.FirstIndex, &jm.LastIndex, &jm.StartFile, &jm.EndFile, &jm.StartBlock, &jm.EndBlock, &jm.Copy, &jm.Stripe) == 9) { - if (jcr->target_jcr) { - jm.JobId = jcr->target_jcr->JobId; - jm.MediaId = jcr->MediaId; - } else { - jm.JobId = jcr->JobId; - jm.MediaId = jcr->MediaId; - } + jm.JobId = jcr->JobId; + jm.MediaId = jcr->MediaId; Dmsg6(400, "create_jobmedia JobId=%d MediaId=%d SF=%d EF=%d FI=%d LI=%d\n", jm.JobId, jm.MediaId, jm.StartFile, jm.EndFile, jm.FirstIndex, jm.LastIndex); if (!db_create_jobmedia_record(jcr, jcr->db, &jm)) { @@ -394,64 +386,47 @@ void catalog_update(JCR *jcr, BSOCK *bs) ar->FileIndex = FileIndex; ar->Stream = Stream; ar->link = NULL; - if (jcr->target_jcr) { - ar->JobId = jcr->target_jcr->JobId; - } else { - ar->JobId = jcr->JobId; - } - ar->Digest = NULL; - ar->DigestType = CRYPTO_DIGEST_NONE; + ar->JobId = jcr->JobId; + ar->Sig = NULL; + ar->SigType = 0; jcr->cached_attribute = true; Dmsg2(400, "dirddb, ar)) { + Jmsg1(jcr, M_FATAL, 0, _("Attribute create error. %s"), db_strerror(jcr->db)); + } +#endif + } else if (Stream == STREAM_MD5_SIGNATURE || Stream == STREAM_SHA1_SIGNATURE) { fname = p; if (ar->FileIndex != FileIndex) { - Jmsg(jcr, M_WARNING, 0, _("Got %s but not same File as attributes\n"), stream_to_ascii(Stream)); + Jmsg(jcr, M_WARNING, 0, _("Got MD5/SHA1 but not same File as attributes\n")); } else { - /* Update digest in catalog */ - char digestbuf[CRYPTO_DIGEST_MAX_SIZE]; - int len = 0; - int type = CRYPTO_DIGEST_NONE; - - switch(Stream) { - case STREAM_MD5_DIGEST: - len = CRYPTO_DIGEST_MD5_SIZE; - type = CRYPTO_DIGEST_MD5; - break; - case STREAM_SHA1_DIGEST: - len = CRYPTO_DIGEST_SHA1_SIZE; - type = CRYPTO_DIGEST_SHA1; - break; - case STREAM_SHA256_DIGEST: - len = CRYPTO_DIGEST_SHA256_SIZE; - type = CRYPTO_DIGEST_SHA256; - break; - case STREAM_SHA512_DIGEST: - len = CRYPTO_DIGEST_SHA512_SIZE; - type = CRYPTO_DIGEST_SHA512; - break; - default: - /* Never reached ... */ - Jmsg(jcr, M_ERROR, 0, _("Catalog error updating file digest. Unsupported digest stream type: %d"), - Stream); + /* Update signature in catalog */ + char SIGbuf[50]; /* 24 bytes should be enough */ + int len, type; + if (Stream == STREAM_MD5_SIGNATURE) { + len = 16; + type = MD5_SIG; + } else { + len = 20; + type = SHA1_SIG; } - - bin_to_base64(digestbuf, fname, len); - Dmsg3(400, "DigestLen=%d Digest=%s type=%d\n", strlen(digestbuf), digestbuf, Stream); + bin_to_base64(SIGbuf, fname, len); + Dmsg3(400, "SIGlen=%d SIG=%s type=%d\n", strlen(SIGbuf), SIGbuf, Stream); if (jcr->cached_attribute) { - ar->Digest = digestbuf; - ar->DigestType = type; - Dmsg2(400, "Cached attr with digest. Stream=%d fname=%s\n", ar->Stream, ar->fname); + ar->Sig = SIGbuf; + ar->SigType = type; + Dmsg2(400, "Cached attr with SIG. Stream=%d fname=%s\n", ar->Stream, ar->fname); if (!db_create_file_attributes_record(jcr, jcr->db, ar)) { Jmsg1(jcr, M_FATAL, 0, _("Attribute create error. %s"), db_strerror(jcr->db)); } jcr->cached_attribute = false; } else { - if (!db_add_digest_to_file_record(jcr, jcr->db, ar->FileId, digestbuf, type)) { - Jmsg(jcr, M_ERROR, 0, _("Catalog error updating file digest. %s"), + if (!db_add_SIG_to_file_record(jcr, jcr->db, ar->FileId, SIGbuf, type)) { + Jmsg(jcr, M_ERROR, 0, _("Catalog error updating MD5/SHA1. %s"), db_strerror(jcr->db)); } } diff --git a/bacula/src/dird/dird.c b/bacula/src/dird/dird.c index 617400c8a2..63a3b1ea8a 100644 --- a/bacula/src/dird/dird.c +++ b/bacula/src/dird/dird.c @@ -559,7 +559,6 @@ static int check_resources() for (i=0; job_items[i].name; i++) { char **def_svalue, **svalue; /* string value */ int *def_ivalue, *ivalue; /* integer value */ - bool *def_bvalue, *bvalue; /* bool value */ int64_t *def_lvalue, *lvalue; /* 64 bit values */ uint32_t offset; @@ -609,9 +608,9 @@ static int check_resources() } /* * Handle integer fields - * Note, our store_bit does not handle bitmaped fields + * Note, our store_yesno does not handle bitmaped fields */ - } else if (job_items[i].handler == store_bit || + } else if (job_items[i].handler == store_yesno || job_items[i].handler == store_pint || job_items[i].handler == store_jobtype || job_items[i].handler == store_level || @@ -635,16 +634,6 @@ static int check_resources() lvalue = (int64_t *)((char *)job + offset); *lvalue = *def_lvalue; set_bit(i, job->hdr.item_present); - /* - * Handle bool fields - */ - } else if (job_items[i].handler == store_bool) { - def_bvalue = (bool *)((char *)(job->jobdefs) + offset); - Dmsg5(400, "Job \"%s\", field \"%s\" def_bvalue=%d item %d offset=%u\n", - job->hdr.name, job_items[i].name, *def_bvalue, i, offset); - bvalue = (bool *)((char *)job + offset); - *bvalue = *def_bvalue; - set_bit(i, job->hdr.item_present); } } } diff --git a/bacula/src/dird/dird_conf.c b/bacula/src/dird/dird_conf.c index 0ebace8e60..59ad1cbfb1 100644 --- a/bacula/src/dird/dird_conf.c +++ b/bacula/src/dird/dird_conf.c @@ -97,9 +97,9 @@ static RES_ITEM dir_items[] = { {"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0}, {"fdconnecttimeout", store_time,ITEM(res_dir.FDConnectTimeout), 0, ITEM_DEFAULT, 60 * 30}, {"sdconnecttimeout", store_time,ITEM(res_dir.SDConnectTimeout), 0, ITEM_DEFAULT, 60 * 30}, - {"tlsenable", store_bool, ITEM(res_dir.tls_enable), 0, 0, 0}, - {"tlsrequire", store_bool, ITEM(res_dir.tls_require), 0, 0, 0}, - {"tlsverifypeer", store_bool, ITEM(res_dir.tls_verify_peer), 0, ITEM_DEFAULT, true}, + {"tlsenable", store_yesno, ITEM(res_dir.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_dir.tls_require), 1, 0, 0}, + {"tlsverifypeer", store_yesno, ITEM(res_dir.tls_verify_peer), 1, ITEM_DEFAULT, 1}, {"tlscacertificatefile", store_dir, ITEM(res_dir.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_dir.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_dir.tls_certfile), 0, 0, 0}, @@ -127,9 +127,9 @@ static RES_ITEM con_items[] = { {"commandacl", store_acl, ITEM(res_con.ACL_lists), Command_ACL, 0, 0}, {"filesetacl", store_acl, ITEM(res_con.ACL_lists), FileSet_ACL, 0, 0}, {"catalogacl", store_acl, ITEM(res_con.ACL_lists), Catalog_ACL, 0, 0}, - {"tlsenable", store_bool, ITEM(res_con.tls_enable), 0, 0, 0}, - {"tlsrequire", store_bool, ITEM(res_con.tls_require), 0, 0, 0}, - {"tlsverifypeer", store_bool, ITEM(res_con.tls_verify_peer), 0, ITEM_DEFAULT, true}, + {"tlsenable", store_yesno, ITEM(res_con.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_con.tls_require), 1, 0, 0}, + {"tlsverifypeer", store_yesno, ITEM(res_con.tls_verify_peer), 1, ITEM_DEFAULT, 1}, {"tlscacertificatefile", store_dir, ITEM(res_con.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_con.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_con.tls_certfile), 0, 0, 0}, @@ -157,10 +157,10 @@ static RES_ITEM cli_items[] = { {"catalog", store_res, ITEM(res_client.catalog), R_CATALOG, ITEM_REQUIRED, 0}, {"fileretention", store_time, ITEM(res_client.FileRetention), 0, ITEM_DEFAULT, 60*60*24*60}, {"jobretention", store_time, ITEM(res_client.JobRetention), 0, ITEM_DEFAULT, 60*60*24*180}, - {"autoprune", store_bool, ITEM(res_client.AutoPrune), 0, ITEM_DEFAULT, true}, + {"autoprune", store_yesno, ITEM(res_client.AutoPrune), 1, ITEM_DEFAULT, 1}, {"maximumconcurrentjobs", store_pint, ITEM(res_client.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1}, - {"tlsenable", store_bool, ITEM(res_client.tls_enable), 0, 0, 0}, - {"tlsrequire", store_bool, ITEM(res_client.tls_require), 0, 0, 0}, + {"tlsenable", store_yesno, ITEM(res_client.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_client.tls_require), 1, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(res_client.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_client.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_client.tls_certfile), 0, 0, 0}, @@ -182,12 +182,12 @@ static RES_ITEM store_items[] = { {"sdpassword", store_password, ITEM(res_store.password), 0, 0, 0}, {"device", store_device, ITEM(res_store.device), R_DEVICE, ITEM_REQUIRED, 0}, {"mediatype", store_strname, ITEM(res_store.media_type), 0, ITEM_REQUIRED, 0}, - {"autochanger", store_bool, ITEM(res_store.autochanger), 0, ITEM_DEFAULT, 0}, - {"enabled", store_bool, ITEM(res_store.enabled), 0, ITEM_DEFAULT, true}, + {"autochanger", store_yesno, ITEM(res_store.autochanger), 1, ITEM_DEFAULT, 0}, + {"enabled", store_yesno, ITEM(res_store.enabled), 1, ITEM_DEFAULT, 1}, {"maximumconcurrentjobs", store_pint, ITEM(res_store.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1}, {"sddport", store_pint, ITEM(res_store.SDDport), 0, 0, 0}, /* deprecated */ - {"tlsenable", store_bool, ITEM(res_store.tls_enable), 0, 0, 0}, - {"tlsrequire", store_bool, ITEM(res_store.tls_require), 0, 0, 0}, + {"tlsenable", store_yesno, ITEM(res_store.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_store.tls_require), 1, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(res_store.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_store.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_store.tls_certfile), 0, 0, 0}, @@ -213,7 +213,7 @@ static RES_ITEM cat_items[] = { {"dbname", store_str, ITEM(res_cat.db_name), 0, ITEM_REQUIRED, 0}, {"dbsocket", store_str, ITEM(res_cat.db_socket), 0, 0, 0}, /* Turned off for the moment */ - {"multipleconnections", store_bit, ITEM(res_cat.mult_db_connections), 0, 0, 0}, + {"multipleconnections", store_yesno, ITEM(res_cat.mult_db_connections), 0, 0, 0}, {NULL, NULL, NULL, 0, 0, 0} }; @@ -228,7 +228,7 @@ RES_ITEM job_items[] = { {"type", store_jobtype, ITEM(res_job.JobType), 0, ITEM_REQUIRED, 0}, {"level", store_level, ITEM(res_job.JobLevel), 0, 0, 0}, {"messages", store_res, ITEM(res_job.messages), R_MSGS, ITEM_REQUIRED, 0}, - {"storage", store_alist_res, ITEM(res_job.storage), R_STORAGE, 0, 0}, + {"storage", store_alist_res, ITEM(res_job.storage), R_STORAGE, ITEM_REQUIRED, 0}, {"pool", store_res, ITEM(res_job.pool), R_POOL, ITEM_REQUIRED, 0}, {"fullbackuppool", store_res, ITEM(res_job.full_pool), R_POOL, 0, 0}, {"incrementalbackuppool", store_res, ITEM(res_job.inc_pool), R_POOL, 0, 0}, @@ -237,16 +237,11 @@ RES_ITEM job_items[] = { {"fileset", store_res, ITEM(res_job.fileset), R_FILESET, ITEM_REQUIRED, 0}, {"schedule", store_res, ITEM(res_job.schedule), R_SCHEDULE, 0, 0}, {"verifyjob", store_res, ITEM(res_job.verify_job), R_JOB, 0, 0}, - {"migrationjob", store_res, ITEM(res_job.migration_job), R_JOB, 0, 0}, {"jobdefs", store_res, ITEM(res_job.jobdefs), R_JOBDEFS, 0, 0}, {"run", store_alist_str, ITEM(res_job.run_cmds), 0, 0, 0}, - /* Root of where to restore files */ {"where", store_dir, ITEM(res_job.RestoreWhere), 0, 0, 0}, - /* Where to find bootstrap during restore */ {"bootstrap",store_dir, ITEM(res_job.RestoreBootstrap), 0, 0, 0}, - /* Where to write bootstrap file during backup */ {"writebootstrap",store_dir, ITEM(res_job.WriteBootstrap), 0, 0, 0}, - {"writeverifylist",store_dir, ITEM(res_job.WriteVerifyList), 0, 0, 0}, {"replace", store_replace, ITEM(res_job.replace), 0, ITEM_DEFAULT, REPLACE_ALWAYS}, {"maxruntime", store_time, ITEM(res_job.MaxRunTime), 0, 0, 0}, {"fullmaxwaittime", store_time, ITEM(res_job.FullMaxWaitTime), 0, 0, 0}, @@ -255,26 +250,26 @@ RES_ITEM job_items[] = { {"maxwaittime", store_time, ITEM(res_job.MaxWaitTime), 0, 0, 0}, {"maxstartdelay",store_time, ITEM(res_job.MaxStartDelay), 0, 0, 0}, {"jobretention", store_time, ITEM(res_job.JobRetention), 0, 0, 0}, - {"prefixlinks", store_bool, ITEM(res_job.PrefixLinks), 0, ITEM_DEFAULT, false}, - {"prunejobs", store_bool, ITEM(res_job.PruneJobs), 0, ITEM_DEFAULT, false}, - {"prunefiles", store_bool, ITEM(res_job.PruneFiles), 0, ITEM_DEFAULT, false}, - {"prunevolumes",store_bool, ITEM(res_job.PruneVolumes), 0, ITEM_DEFAULT, false}, - {"enabled", store_bool, ITEM(res_job.enabled), 0, ITEM_DEFAULT, true}, - {"spoolattributes",store_bool, ITEM(res_job.SpoolAttributes), 0, ITEM_DEFAULT, false}, - {"spooldata", store_bit, ITEM(res_job.spool_data), 0, ITEM_DEFAULT, false}, - {"rerunfailedlevels", store_bool, ITEM(res_job.rerun_failed_levels), 0, ITEM_DEFAULT, false}, - {"prefermountedvolumes", store_bool, ITEM(res_job.PreferMountedVolumes), 0, ITEM_DEFAULT, true}, + {"prefixlinks", store_yesno, ITEM(res_job.PrefixLinks), 1, ITEM_DEFAULT, 0}, + {"prunejobs", store_yesno, ITEM(res_job.PruneJobs), 1, ITEM_DEFAULT, 0}, + {"prunefiles", store_yesno, ITEM(res_job.PruneFiles), 1, ITEM_DEFAULT, 0}, + {"prunevolumes",store_yesno, ITEM(res_job.PruneVolumes), 1, ITEM_DEFAULT, 0}, + {"enabled", store_yesno, ITEM(res_job.enabled), 1, ITEM_DEFAULT, 1}, + {"spoolattributes",store_yesno, ITEM(res_job.SpoolAttributes), 1, ITEM_DEFAULT, 0}, + {"spooldata", store_yesno, ITEM(res_job.spool_data), 1, ITEM_DEFAULT, 0}, + {"rerunfailedlevels", store_yesno, ITEM(res_job.rerun_failed_levels), 1, ITEM_DEFAULT, 0}, + {"prefermountedvolumes", store_yesno, ITEM(res_job.PreferMountedVolumes), 1, ITEM_DEFAULT, 1}, {"runbeforejob", store_str, ITEM(res_job.RunBeforeJob), 0, 0, 0}, {"runafterjob", store_str, ITEM(res_job.RunAfterJob), 0, 0, 0}, {"runafterfailedjob", store_str, ITEM(res_job.RunAfterFailedJob), 0, 0, 0}, {"clientrunbeforejob", store_str, ITEM(res_job.ClientRunBeforeJob), 0, 0, 0}, {"clientrunafterjob", store_str, ITEM(res_job.ClientRunAfterJob), 0, 0, 0}, {"maximumconcurrentjobs", store_pint, ITEM(res_job.MaxConcurrentJobs), 0, ITEM_DEFAULT, 1}, - {"rescheduleonerror", store_bool, ITEM(res_job.RescheduleOnError), 0, ITEM_DEFAULT, false}, + {"rescheduleonerror", store_yesno, ITEM(res_job.RescheduleOnError), 1, ITEM_DEFAULT, 0}, {"rescheduleinterval", store_time, ITEM(res_job.RescheduleInterval), 0, ITEM_DEFAULT, 60 * 30}, {"rescheduletimes", store_pint, ITEM(res_job.RescheduleTimes), 0, 0, 0}, {"priority", store_pint, ITEM(res_job.Priority), 0, ITEM_DEFAULT, 10}, - {"writepartafterjob", store_bool, ITEM(res_job.write_part_after_job), 0, ITEM_DEFAULT, false}, + {"writepartafterjob", store_yesno, ITEM(res_job.write_part_after_job), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; @@ -287,8 +282,8 @@ static RES_ITEM fs_items[] = { {"description", store_str, ITEM(res_fs.hdr.desc), 0, 0, 0}, {"include", store_inc, NULL, 0, ITEM_NO_EQUALS, 0}, {"exclude", store_inc, NULL, 1, ITEM_NO_EQUALS, 0}, - {"ignorefilesetchanges", store_bool, ITEM(res_fs.ignore_fs_changes), 0, ITEM_DEFAULT, false}, - {"enablevss", store_bool, ITEM(res_fs.enable_vss), 0, ITEM_DEFAULT, false}, + {"ignorefilesetchanges", store_yesno, ITEM(res_fs.ignore_fs_changes), 1, ITEM_DEFAULT, 0}, + {"enablevss", store_yesno, ITEM(res_fs.enable_vss), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; @@ -314,27 +309,22 @@ static RES_ITEM pool_items[] = { {"pooltype", store_strname, ITEM(res_pool.pool_type), 0, ITEM_REQUIRED, 0}, {"labelformat", store_strname, ITEM(res_pool.label_format), 0, 0, 0}, {"labeltype", store_label, ITEM(res_pool.LabelType), 0, 0, 0}, - {"cleaningprefix", store_strname, ITEM(res_pool.cleaning_prefix), 0, 0, 0}, - {"usecatalog", store_bool, ITEM(res_pool.use_catalog), 0, ITEM_DEFAULT, true}, - {"usevolumeonce", store_bool, ITEM(res_pool.use_volume_once), 0, 0, 0}, - {"purgeoldestvolume", store_bool, ITEM(res_pool.purge_oldest_volume), 0, 0, 0}, - {"recycleoldestvolume", store_bool, ITEM(res_pool.recycle_oldest_volume), 0, 0, 0}, - {"recyclecurrentvolume", store_bool, ITEM(res_pool.recycle_current_volume), 0, 0, 0}, + {"cleaningprefix", store_strname, ITEM(res_pool.cleaning_prefix), 0, 0, 0}, + {"usecatalog", store_yesno, ITEM(res_pool.use_catalog), 1, ITEM_DEFAULT, 1}, + {"usevolumeonce", store_yesno, ITEM(res_pool.use_volume_once),1, 0, 0}, + {"purgeoldestvolume", store_yesno, ITEM(res_pool.purge_oldest_volume), 1, 0, 0}, + {"recycleoldestvolume", store_yesno, ITEM(res_pool.recycle_oldest_volume), 1, 0, 0}, + {"recyclecurrentvolume", store_yesno, ITEM(res_pool.recycle_current_volume), 1, 0, 0}, {"maximumvolumes", store_pint, ITEM(res_pool.max_volumes), 0, 0, 0}, {"maximumvolumejobs", store_pint, ITEM(res_pool.MaxVolJobs), 0, 0, 0}, {"maximumvolumefiles", store_pint, ITEM(res_pool.MaxVolFiles), 0, 0, 0}, {"maximumvolumebytes", store_size, ITEM(res_pool.MaxVolBytes), 0, 0, 0}, - {"acceptanyvolume", store_bool, ITEM(res_pool.accept_any_volume), 0, ITEM_DEFAULT, true}, - {"catalogfiles", store_bool, ITEM(res_pool.catalog_files), 0, ITEM_DEFAULT, true}, + {"acceptanyvolume", store_yesno, ITEM(res_pool.accept_any_volume), 1, ITEM_DEFAULT, 1}, + {"catalogfiles", store_yesno, ITEM(res_pool.catalog_files), 1, ITEM_DEFAULT, 1}, {"volumeretention", store_time, ITEM(res_pool.VolRetention), 0, ITEM_DEFAULT, 60*60*24*365}, {"volumeuseduration", store_time, ITEM(res_pool.VolUseDuration), 0, 0, 0}, - {"migrationtime", store_time, ITEM(res_pool.MigrationTime), 0, 0, 0}, - {"migrationhighbytes", store_size, ITEM(res_pool.MigrationHighBytes), 0, 0, 0}, - {"migrationlowbytes", store_size, ITEM(res_pool.MigrationLowBytes), 0, 0, 0}, - {"nextpool", store_res, ITEM(res_pool.NextPool), R_POOL, 0, 0}, - {"storage", store_alist_res, ITEM(res_pool.storage), R_STORAGE, 0, 0}, - {"autoprune", store_bool, ITEM(res_pool.AutoPrune), 0, ITEM_DEFAULT, true}, - {"recycle", store_bool, ITEM(res_pool.Recycle), 0, ITEM_DEFAULT, true}, + {"autoprune", store_yesno, ITEM(res_pool.AutoPrune), 1, ITEM_DEFAULT, 1}, + {"recycle", store_yesno, ITEM(res_pool.Recycle), 1, ITEM_DEFAULT, 1}, {NULL, NULL, NULL, 0, 0, 0} }; @@ -412,8 +402,6 @@ struct s_jt jobtypes[] = { {"admin", JT_ADMIN}, {"verify", JT_VERIFY}, {"restore", JT_RESTORE}, - {"copy", JT_COPY}, - {"migrate", JT_MIGRATE}, {NULL, 0} }; @@ -448,7 +436,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm { URES *res = (URES *)reshdr; bool recurse = true; - char ed1[100], ed2[100], ed3[100]; + char ed1[100], ed2[100]; DEVICE *dev; if (res == NULL) { @@ -474,8 +462,13 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm } break; case R_CONSOLE: +#ifdef HAVE_TLS sendit(sock, _("Console: name=%s SSL=%d\n"), res->res_con.hdr.name, res->res_con.tls_enable); +#else + sendit(sock, _("Console: name=%s SSL=%d\n"), + res->res_con.hdr.name, BNET_TLS_NONE); +#endif break; case R_COUNTER: if (res->res_counter.WrapCounter) { @@ -781,21 +774,6 @@ next_run: res->res_pool.recycle_oldest_volume, res->res_pool.purge_oldest_volume, res->res_pool.MaxVolJobs, res->res_pool.MaxVolFiles); - sendit(sock, _(" MigTime=%s MigHiBytes=%s MigLoBytes=%s\n"), - edit_utime(res->res_pool.MigrationTime, ed1, sizeof(ed1)), - edit_uint64(res->res_pool.MigrationHighBytes, ed2), - edit_uint64(res->res_pool.MigrationLowBytes, ed3)); - if (res->res_pool.NextPool) { - sendit(sock, _(" --> ")); - dump_resource(-R_POOL, (RES *)res->res_pool.NextPool, sendit, sock); - } - if (res->res_pool.storage) { - STORE *store; - foreach_alist(store, res->res_pool.storage) { - sendit(sock, _(" --> ")); - dump_resource(-R_STORAGE, (RES *)store, sendit, sock); - } - } break; case R_MSGS: sendit(sock, _("Messages: name=%s\n"), res->res_msgs.hdr.name); @@ -1043,9 +1021,6 @@ void free_resource(RES *sres, int type) if (res->res_pool.cleaning_prefix) { free(res->res_pool.cleaning_prefix); } - if (res->res_pool.storage) { - delete res->res_pool.storage; - } break; case R_SCHEDULE: if (res->res_sch.run) { @@ -1165,27 +1140,13 @@ void save_resource(int type, RES_ITEM *items, int pass) switch (type) { /* Resources not containing a resource */ case R_CATALOG: + case R_POOL: case R_MSGS: case R_FILESET: case R_DEVICE: break; - /* - * Resources containing another resource or alist. First - * look up the resource which contains another resource. It - * was written during pass 1. Then stuff in the pointers to - * the resources it contains, which were inserted this pass. - * Finally, it will all be stored back. - */ - case R_POOL: - /* Find resource saved in pass 1 */ - if ((res = (URES *)GetResWithName(R_POOL, res_all.res_con.hdr.name)) == NULL) { - Emsg1(M_ERROR_TERM, 0, _("Cannot find Pool resource %s\n"), res_all.res_con.hdr.name); - } - /* Explicitly copy resource pointers from this pass (res_all) */ - res->res_pool.NextPool = res_all.res_pool.NextPool; - res->res_pool.storage = res_all.res_pool.storage; - break; + /* Resources containing another resource or alist */ case R_CONSOLE: if ((res = (URES *)GetResWithName(R_CONSOLE, res_all.res_con.hdr.name)) == NULL) { Emsg1(M_ERROR_TERM, 0, _("Cannot find Console resource %s\n"), res_all.res_con.hdr.name); diff --git a/bacula/src/dird/dird_conf.h b/bacula/src/dird/dird_conf.h index 6886983ee4..2204d70bfe 100644 --- a/bacula/src/dird/dird_conf.h +++ b/bacula/src/dird/dird_conf.h @@ -102,6 +102,9 @@ public: uint32_t MaxConcurrentJobs; /* Max concurrent jobs for whole director */ utime_t FDConnectTimeout; /* timeout for connect in seconds */ utime_t SDConnectTimeout; /* timeout in seconds */ + int tls_enable; /* Enable TLS */ + int tls_require; /* Require TLS */ + int tls_verify_peer; /* TLS Verify Client Certificate */ char *tls_ca_certfile; /* TLS CA Certificate File */ char *tls_ca_certdir; /* TLS CA Certificate Directory */ char *tls_certfile; /* TLS Server Certificate File */ @@ -109,9 +112,6 @@ public: char *tls_dhfile; /* TLS Diffie-Hellman Parameters */ alist *tls_allowed_cns; /* TLS Allowed Clients */ TLS_CONTEXT *tls_ctx; /* Shared TLS Context */ - bool tls_enable; /* Enable TLS */ - bool tls_require; /* Require TLS */ - bool tls_verify_peer; /* TLS Verify Client Certificate */ }; /* @@ -168,6 +168,9 @@ public: RES hdr; char *password; /* UA server password */ alist *ACL_lists[Num_ACL]; /* pointers to ACLs */ + int tls_enable; /* Enable TLS */ + int tls_require; /* Require TLS */ + int tls_verify_peer; /* TLS Verify Client Certificate */ char *tls_ca_certfile; /* TLS CA Certificate File */ char *tls_ca_certdir; /* TLS CA Certificate Directory */ char *tls_certfile; /* TLS Server Certificate File */ @@ -175,9 +178,6 @@ public: char *tls_dhfile; /* TLS Diffie-Hellman Parameters */ alist *tls_allowed_cns; /* TLS Allowed Clients */ TLS_CONTEXT *tls_ctx; /* Shared TLS Context */ - bool tls_enable; /* Enable TLS */ - bool tls_require; /* Require TLS */ - bool tls_verify_peer; /* TLS Verify Client Certificate */ }; @@ -189,7 +189,7 @@ class CAT { public: RES hdr; - int db_port; /* Port */ + int db_port; /* Port -- not yet implemented */ char *db_address; /* host name for remote access */ char *db_socket; /* Socket for local access */ char *db_password; @@ -208,6 +208,7 @@ public: RES hdr; int FDport; /* Where File daemon listens */ + int AutoPrune; /* Do automatic pruning? */ utime_t FileRetention; /* file retention period in seconds */ utime_t JobRetention; /* job retention period in seconds */ char *address; @@ -215,14 +216,13 @@ public: CAT *catalog; /* Catalog resource */ uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */ uint32_t NumConcurrentJobs; /* number of concurrent jobs running */ + int tls_enable; /* Enable TLS */ + int tls_require; /* Require TLS */ char *tls_ca_certfile; /* TLS CA Certificate File */ char *tls_ca_certdir; /* TLS CA Certificate Directory */ char *tls_certfile; /* TLS Client Certificate File */ char *tls_keyfile; /* TLS Client Key File */ TLS_CONTEXT *tls_ctx; /* Shared TLS Context */ - bool tls_enable; /* Enable TLS */ - bool tls_require; /* Require TLS */ - bool AutoPrune; /* Do automatic pruning? */ }; /* @@ -239,19 +239,19 @@ public: char *password; char *media_type; alist *device; /* Alternate devices for this Storage */ + int autochanger; /* set if autochanger */ + int drives; /* number of drives in autochanger */ uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */ uint32_t NumConcurrentJobs; /* number of concurrent jobs running */ + int tls_enable; /* Enable TLS */ + int tls_require; /* Require TLS */ char *tls_ca_certfile; /* TLS CA Certificate File */ char *tls_ca_certdir; /* TLS CA Certificate Directory */ char *tls_certfile; /* TLS Client Certificate File */ char *tls_keyfile; /* TLS Client Key File */ TLS_CONTEXT *tls_ctx; /* Shared TLS Context */ - bool tls_enable; /* Enable TLS */ - bool tls_require; /* Require TLS */ - bool enabled; /* Set if device is enabled */ - bool autochanger; /* set if autochanger */ int64_t StorageId; /* Set from Storage DB record */ - int drives; /* number of drives in autochanger */ + int enabled; /* Set if device is enabled */ /* Methods */ char *dev_name() const; @@ -285,10 +285,7 @@ public: char *RunAfterFailedJob; /* Run program after Job that errs */ char *ClientRunBeforeJob; /* Run client program before Job */ char *ClientRunAfterJob; /* Run client program after Job */ - union { - char *WriteBootstrap; /* Where to write bootstrap Job updates */ - char *WriteVerifyList; /* List of changed files */ - }; + char *WriteBootstrap; /* Where to write bootstrap Job updates */ int replace; /* How (overwrite, ..) */ utime_t MaxRunTime; /* max run time in seconds */ utime_t MaxWaitTime; /* max blocking time in seconds */ @@ -296,21 +293,21 @@ public: utime_t DiffMaxWaitTime; /* Max Differential job wait time */ utime_t IncMaxWaitTime; /* Max Incremental job wait time */ utime_t MaxStartDelay; /* max start delay in seconds */ - utime_t RescheduleInterval; /* Reschedule interval */ - utime_t JobRetention; /* job retention period in seconds */ + int PrefixLinks; /* prefix soft links with Where path */ + int PruneJobs; /* Force pruning of Jobs */ + int PruneFiles; /* Force pruning of Files */ + int PruneVolumes; /* Force pruning of Volumes */ + int SpoolAttributes; /* Set to spool attributes in SD */ + int spool_data; /* Set to spool data in SD */ + int rerun_failed_levels; /* Upgrade to rerun failed levels */ + int PreferMountedVolumes; /* Prefer vols mounted rather than new one */ uint32_t MaxConcurrentJobs; /* Maximume concurrent jobs */ + int RescheduleOnError; /* Set to reschedule on error */ int RescheduleTimes; /* Number of times to reschedule job */ - bool RescheduleOnError; /* Set to reschedule on error */ - bool PrefixLinks; /* prefix soft links with Where path */ - bool PruneJobs; /* Force pruning of Jobs */ - bool PruneFiles; /* Force pruning of Files */ - bool PruneVolumes; /* Force pruning of Volumes */ - bool SpoolAttributes; /* Set to spool attributes in SD */ - bool spool_data; /* Set to spool data in SD */ - bool rerun_failed_levels; /* Upgrade to rerun failed levels */ - bool PreferMountedVolumes; /* Prefer vols mounted rather than new one */ - bool write_part_after_job; /* Set to write part after job in SD */ - bool enabled; /* Set if job enabled */ + utime_t RescheduleInterval; /* Reschedule interval */ + utime_t JobRetention; /* job retention period in seconds */ + int write_part_after_job; /* Set to write part after job in SD */ + int enabled; /* Set if device is enabled */ MSGS *messages; /* How and where to send messages */ SCHED *schedule; /* When -- Automatic schedule */ @@ -373,8 +370,8 @@ public: bool have_MD5; /* set if MD5 initialized */ struct MD5Context md5c; /* MD5 of include/exclude */ char MD5[30]; /* base 64 representation of MD5 */ - bool ignore_fs_changes; /* Don't force Full if FS changed */ - bool enable_vss; /* Enable Volume Shadow Copy */ + int ignore_fs_changes; /* Don't force Full if FS changed */ + int enable_vss; /* Enable Volume Shadow Copy */ }; @@ -416,6 +413,13 @@ public: char *label_format; /* Label format string */ char *cleaning_prefix; /* Cleaning label prefix */ int LabelType; /* Bacula/ANSI/IBM label type */ + int use_catalog; /* maintain catalog for media */ + int catalog_files; /* maintain file entries in catalog */ + int use_volume_once; /* write on volume only once */ + int accept_any_volume; /* accept any volume */ + int purge_oldest_volume; /* purge oldest volume */ + int recycle_oldest_volume; /* attempt to recycle oldest volume */ + int recycle_current_volume; /* attempt recycle of current volume */ uint32_t max_volumes; /* max number of volumes */ utime_t VolRetention; /* volume retention period in seconds */ utime_t VolUseDuration; /* duration volume can be used */ @@ -426,16 +430,8 @@ public: uint32_t MigrationHighBytes; /* When migration starts */ uint32_t MigrationLowBytes; /* When migration stops */ POOL *NextPool; /* Next pool for migration */ - alist *storage; /* Where is device -- list of Storage to be used */ - bool use_catalog; /* maintain catalog for media */ - bool catalog_files; /* maintain file entries in catalog */ - bool use_volume_once; /* write on volume only once */ - bool accept_any_volume; /* accept any volume */ - bool purge_oldest_volume; /* purge oldest volume */ - bool recycle_oldest_volume; /* attempt to recycle oldest volume */ - bool recycle_current_volume; /* attempt recycle of current volume */ - bool AutoPrune; /* default for pool auto prune */ - bool Recycle; /* default for media recycle yes/no */ + int AutoPrune; /* default for pool auto prune */ + int Recycle; /* default for media recycle yes/no */ }; diff --git a/bacula/src/dird/fd_cmds.c b/bacula/src/dird/fd_cmds.c index dfc4cc11db..8733828561 100644 --- a/bacula/src/dird/fd_cmds.c +++ b/bacula/src/dird/fd_cmds.c @@ -13,7 +13,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -29,11 +29,10 @@ #include "bacula.h" #include "dird.h" -#include "findlib/find.h" /* Commands sent to File daemon */ static char filesetcmd[] = "fileset%s\n"; /* set full fileset */ -static char jobcmd[] = "JobId=%d Job=%s SDid=%u SDtime=%u Authorization=%s\n"; +static char jobcmd[] = "JobId=%s Job=%s SDid=%u SDtime=%u Authorization=%s\n"; /* Note, mtime_only is not used here -- implemented as file option */ static char levelcmd[] = "level = %s%s mtime_only=%d\n"; static char runbefore[] = "RunBeforeJob %s\n"; @@ -43,6 +42,7 @@ static char runafter[] = "RunAfterJob %s\n"; /* Responses received from File daemon */ static char OKinc[] = "2000 OK include\n"; static char OKjob[] = "2000 OK Job"; +static char OKbootstrap[] = "2000 OK bootstrap\n"; static char OKlevel[] = "2000 OK level\n"; static char OKRunBefore[] = "2000 OK RunBefore\n"; static char OKRunAfter[] = "2000 OK RunAfter\n"; @@ -67,6 +67,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time, int verbose) { BSOCK *fd; + char ed1[30]; if (!jcr->file_bsock) { fd = bnet_connect(jcr, retry_interval, max_retry_time, @@ -92,7 +93,7 @@ int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time, /* * Now send JobId and authorization key */ - bnet_fsend(fd, jobcmd, jcr->JobId, jcr->Job, jcr->VolSessionId, + bnet_fsend(fd, jobcmd, edit_int64(jcr->JobId, ed1), jcr->Job, jcr->VolSessionId, jcr->VolSessionTime, jcr->sd_auth_key); if (strcmp(jcr->sd_auth_key, "dummy") != 0) { memset(jcr->sd_auth_key, 0, strlen(jcr->sd_auth_key)); @@ -421,19 +422,19 @@ bool send_exclude_list(JCR *jcr) /* - * Send bootstrap file if any to the socket given (FD or SD). - * This is used for restore, verify VolumeToCatalog, and - * for migration. + * Send bootstrap file if any to the File daemon. + * This is used for restore and verify VolumeToCatalog */ -bool send_bootstrap_file(JCR *jcr, BSOCK *sock) +bool send_bootstrap_file(JCR *jcr) { FILE *bs; char buf[1000]; + BSOCK *fd = jcr->file_bsock; const char *bootstrap = "bootstrap\n"; Dmsg1(400, "send_bootstrap_file: %s\n", jcr->RestoreBootstrap); if (!jcr->RestoreBootstrap) { - return true; + return 1; } bs = fopen(jcr->RestoreBootstrap, "r"); if (!bs) { @@ -441,19 +442,23 @@ bool send_bootstrap_file(JCR *jcr, BSOCK *sock) Jmsg(jcr, M_FATAL, 0, _("Could not open bootstrap file %s: ERR=%s\n"), jcr->RestoreBootstrap, be.strerror()); set_jcr_job_status(jcr, JS_ErrorTerminated); - return false; + return 0; } - bnet_fsend(sock, bootstrap); + bnet_fsend(fd, bootstrap); while (fgets(buf, sizeof(buf), bs)) { - bnet_fsend(sock, "%s", buf); + bnet_fsend(fd, "%s", buf); } - bnet_sig(sock, BNET_EOD); + bnet_sig(fd, BNET_EOD); fclose(bs); if (jcr->unlink_bsr) { unlink(jcr->RestoreBootstrap); jcr->unlink_bsr = false; } - return true; + if (!response(jcr, fd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) { + set_jcr_job_status(jcr, JS_ErrorTerminated); + return 0; + } + return 1; } /* @@ -504,7 +509,7 @@ int get_attributes_and_put_in_catalog(JCR *jcr) jcr->FileIndex = 0; Dmsg0(120, "bdird: waiting to receive file attributes\n"); - /* Pickup file attributes and digest */ + /* Pickup file attributes and signature */ while (!fd->errors && (n = bget_dirmsg(fd)) > 0) { /*****FIXME****** improve error handling to stop only on @@ -514,11 +519,11 @@ int get_attributes_and_put_in_catalog(JCR *jcr) long file_index; int stream, len; char *attr, *p, *fn; - char Opts_Digest[MAXSTRING]; /* either Verify opts or MD5/SHA1 digest */ - char digest[CRYPTO_DIGEST_MAX_SIZE]; + char Opts_SIG[MAXSTRING]; /* either Verify opts or MD5/SHA1 signature */ + char SIG[MAXSTRING]; jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen); - if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Opts_Digest)) != 3) { + if ((len = sscanf(fd->msg, "%ld %d %s", &file_index, &stream, Opts_SIG)) != 3) { Jmsg(jcr, M_FATAL, 0, _("msglen, fd->msg); set_jcr_job_status(jcr, JS_ErrorTerminated); @@ -550,8 +555,8 @@ int get_attributes_and_put_in_catalog(JCR *jcr) ar.ClientId = jcr->ClientId; ar.PathId = 0; ar.FilenameId = 0; - ar.Digest = NULL; - ar.DigestType = CRYPTO_DIGEST_NONE; + ar.Sig = NULL; + ar.SigType = 0; Dmsg2(111, "dirdfname); Dmsg1(120, "dirdFileId = ar.FileId; - } else if (crypto_digest_stream_type(stream) != CRYPTO_DIGEST_NONE) { + } else if (stream == STREAM_MD5_SIGNATURE || stream == STREAM_SHA1_SIGNATURE) { if (jcr->FileIndex != (uint32_t)file_index) { - Jmsg3(jcr, M_ERROR, 0, _("%s index %d not same as attributes %d\n"), - stream_to_ascii(stream), file_index, jcr->FileIndex); + Jmsg2(jcr, M_ERROR, 0, _("MD5/SHA1 index %d not same as attributes %d\n"), + file_index, jcr->FileIndex); set_jcr_job_status(jcr, JS_Error); continue; } - db_escape_string(digest, Opts_Digest, strlen(Opts_Digest)); - Dmsg2(120, "DigestLen=%d Digest=%s\n", strlen(digest), digest); - if (!db_add_digest_to_file_record(jcr, jcr->db, jcr->FileId, digest, - crypto_digest_stream_type(stream))) { + db_escape_string(SIG, Opts_SIG, strlen(Opts_SIG)); + Dmsg2(120, "SIGlen=%d SIG=%s\n", strlen(SIG), SIG); + if (!db_add_SIG_to_file_record(jcr, jcr->db, jcr->FileId, SIG, + stream==STREAM_MD5_SIGNATURE?MD5_SIG:SHA1_SIG)) { Jmsg1(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db)); set_jcr_job_status(jcr, JS_Error); } diff --git a/bacula/src/dird/getmsg.c b/bacula/src/dird/getmsg.c index bd5dea6157..8150cb8972 100644 --- a/bacula/src/dird/getmsg.c +++ b/bacula/src/dird/getmsg.c @@ -21,7 +21,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -304,9 +304,11 @@ bool response(JCR *jcr, BSOCK *bs, char *resp, const char *cmd, e_prtmsg prtmsg) return false; } if ((n = bget_dirmsg(bs)) >= 0) { + Dmsg0(900, bs->msg); if (strcmp(bs->msg, resp) == 0) { return true; } + Dmsg1(900, "Bad response: ERR=%s", bs->msg); if (prtmsg == DISPLAY_ERROR) { Jmsg(jcr, M_FATAL, 0, _("Bad response to %s command: wanted %s, got %s\n"), cmd, resp, bs->msg); diff --git a/bacula/src/dird/inc_conf.c b/bacula/src/dird/inc_conf.c index 67ebde2ac8..0ca26731ab 100644 --- a/bacula/src/dird/inc_conf.c +++ b/bacula/src/dird/inc_conf.c @@ -103,7 +103,7 @@ static RES_ITEM options_items[] = { enum { INC_KW_NONE, INC_KW_COMPRESSION, - INC_KW_DIGEST, + INC_KW_SIGNATURE, INC_KW_ENCRYPTION, INC_KW_VERIFY, INC_KW_ONEFS, @@ -129,7 +129,7 @@ enum { */ static struct s_kw FS_option_kw[] = { {"compression", INC_KW_COMPRESSION}, - {"signature", INC_KW_DIGEST}, + {"signature", INC_KW_SIGNATURE}, {"encryption", INC_KW_ENCRYPTION}, {"verify", INC_KW_VERIFY}, {"onefs", INC_KW_ONEFS}, @@ -163,10 +163,8 @@ struct s_fs_opt { * included files. */ static struct s_fs_opt FS_options[] = { - {"md5", INC_KW_DIGEST, "M"}, - {"sha1", INC_KW_DIGEST, "S"}, - {"sha256", INC_KW_DIGEST, "S2"}, - {"sha512", INC_KW_DIGEST, "S3"}, + {"md5", INC_KW_SIGNATURE, "M"}, + {"sha1", INC_KW_SIGNATURE, "S"}, {"gzip", INC_KW_COMPRESSION, "Z6"}, {"gzip1", INC_KW_COMPRESSION, "Z1"}, {"gzip2", INC_KW_COMPRESSION, "Z2"}, diff --git a/bacula/src/dird/job.c b/bacula/src/dird/job.c index f23976861c..10716cd43d 100644 --- a/bacula/src/dird/job.c +++ b/bacula/src/dird/job.c @@ -73,24 +73,10 @@ void term_job_server() */ JobId_t run_job(JCR *jcr) { - int stat; - if (setup_job(jcr)) { - /* Queue the job to be run */ - if ((stat = jobq_add(&job_queue, jcr)) != 0) { - berrno be; - Jmsg(jcr, M_FATAL, 0, _("Could not add job queue: ERR=%s\n"), be.strerror(stat)); - return 0; - } - return jcr->JobId; - } - return 0; -} + int stat, errstat; + JobId_t JobId = 0; -bool setup_job(JCR *jcr) -{ - int errstat; - - P(jcr->mutex); + jcr->lock(); sm_check(__FILE__, __LINE__, true); init_msg(jcr, jcr->messages); @@ -102,6 +88,9 @@ bool setup_job(JCR *jcr) } jcr->term_wait_inited = true; + create_unique_job_name(jcr, jcr->job->hdr.name); + set_jcr_job_status(jcr, JS_Created); + jcr->unlock(); /* * Open database @@ -124,14 +113,12 @@ bool setup_job(JCR *jcr) /* * Create Job record */ - create_unique_job_name(jcr, jcr->job->hdr.name); - set_jcr_job_status(jcr, JS_Created); init_jcr_job_record(jcr); if (!db_create_job_record(jcr, jcr->db, &jcr->jr)) { Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(jcr->db)); goto bail_out; } - jcr->JobId = jcr->jr.JobId; + JobId = jcr->JobId = jcr->jr.JobId; Dmsg4(100, "Created job record JobId=%d Name=%s Type=%c Level=%c\n", jcr->JobId, jcr->Job, jcr->jr.JobType, jcr->jr.JobLevel); @@ -147,17 +134,23 @@ bool setup_job(JCR *jcr) Dmsg0(200, "Add jrc to work queue\n"); + /* Queue the job to be run */ + if ((stat = jobq_add(&job_queue, jcr)) != 0) { + berrno be; + Jmsg(jcr, M_FATAL, 0, _("Could not add job queue: ERR=%s\n"), be.strerror(stat)); + JobId = 0; + goto bail_out; + } + Dmsg0(100, "Done run_job()\n"); - V(jcr->mutex); - return true; + return JobId; bail_out: if (jcr->fname) { free_memory(jcr->fname); jcr->fname = NULL; } - V(jcr->mutex); - return false; + return JobId; } @@ -385,6 +378,7 @@ bool cancel_job(UAContext *ua, JCR *jcr) return true; default: + /* Cancel File daemon */ if (jcr->file_bsock) { ua->jcr->client = jcr->client; @@ -406,7 +400,7 @@ bool cancel_job(UAContext *ua, JCR *jcr) /* Cancel Storage daemon */ if (jcr->store_bsock) { if (!ua->jcr->storage) { - copy_storage(ua->jcr, jcr->storage); + copy_storage(ua->jcr, jcr); } else { set_storage(ua->jcr, jcr->store); } @@ -647,13 +641,13 @@ bool get_or_create_fileset_record(JCR *jcr) bstrncpy(fsr.FileSet, jcr->fileset->hdr.name, sizeof(fsr.FileSet)); if (jcr->fileset->have_MD5) { struct MD5Context md5c; - unsigned char digest[MD5HashSize]; + unsigned char signature[16]; memcpy(&md5c, &jcr->fileset->md5c, sizeof(md5c)); - MD5Final(digest, &md5c); - bin_to_base64(fsr.MD5, (char *)digest, MD5HashSize); + MD5Final(signature, &md5c); + bin_to_base64(fsr.MD5, (char *)signature, 16); /* encode 16 bytes */ bstrncpy(jcr->fileset->MD5, fsr.MD5, sizeof(jcr->fileset->MD5)); } else { - Jmsg(jcr, M_WARNING, 0, _("FileSet MD5 digest not found.\n")); + Jmsg(jcr, M_WARNING, 0, _("FileSet MD5 signature not found.\n")); } if (!jcr->fileset->ignore_fs_changes || !db_get_fileset_record(jcr, jcr->db, &fsr)) { @@ -828,6 +822,7 @@ void dird_free_jcr(JCR *jcr) */ void set_jcr_defaults(JCR *jcr, JOB *job) { + STORE *st; jcr->job = job; jcr->JobType = job->JobType; switch (jcr->JobType) { @@ -841,7 +836,18 @@ void set_jcr_defaults(JCR *jcr, JOB *job) } jcr->JobPriority = job->Priority; /* Copy storage definitions -- deleted in dir_free_jcr above */ - copy_storage(jcr, job->storage); + if (job->storage) { + if (jcr->storage) { + delete jcr->storage; + } + jcr->storage = New(alist(10, not_owned_by_alist)); + foreach_alist(st, job->storage) { + jcr->storage->append(st); + } + } + if (jcr->storage) { + jcr->store = (STORE *)jcr->storage->first(); + } jcr->client = job->client; if (!jcr->client_name) { jcr->client_name = get_pool_memory(PM_NAME); @@ -885,28 +891,28 @@ void set_jcr_defaults(JCR *jcr, JOB *job) } } - -/* - * Copy the storage definitions from an alist to the JCR +/* + * copy the storage definitions from an old JCR to a new one */ -void copy_storage(JCR *jcr, alist *storage) +void copy_storage(JCR *new_jcr, JCR *old_jcr) { - if (storage) { + if (old_jcr->storage) { STORE *st; - if (jcr->storage) { - delete jcr->storage; + if (new_jcr->storage) { + delete new_jcr->storage; } - jcr->storage = New(alist(10, not_owned_by_alist)); - foreach_alist(st, storage) { - jcr->storage->append(st); + new_jcr->storage = New(alist(10, not_owned_by_alist)); + foreach_alist(st, old_jcr->storage) { + new_jcr->storage->append(st); } - } - if (jcr->storage) { - jcr->store = (STORE *)jcr->storage->first(); + } + if (old_jcr->store) { + new_jcr->store = old_jcr->store; + } else if (new_jcr->storage) { + new_jcr->store = (STORE *)new_jcr->storage->first(); } } - /* Set storage override */ void set_storage(JCR *jcr, STORE *store) { @@ -921,64 +927,3 @@ void set_storage(JCR *jcr, STORE *store) /* Store not in list, so add it */ jcr->storage->prepend(store); } - -void create_clones(JCR *jcr) -{ - /* - * Fire off any clone jobs (run directives) - */ - Dmsg2(900, "cloned=%d run_cmds=%p\n", jcr->cloned, jcr->job->run_cmds); - if (!jcr->cloned && jcr->job->run_cmds) { - char *runcmd; - JOB *job = jcr->job; - POOLMEM *cmd = get_pool_memory(PM_FNAME); - UAContext *ua = new_ua_context(jcr); - ua->batch = true; - foreach_alist(runcmd, job->run_cmds) { - cmd = edit_job_codes(jcr, cmd, runcmd, ""); - Mmsg(ua->cmd, "run %s cloned=yes", cmd); - Dmsg1(900, "=============== Clone cmd=%s\n", ua->cmd); - parse_ua_args(ua); /* parse command */ - int stat = run_cmd(ua, ua->cmd); - if (stat == 0) { - Jmsg(jcr, M_ERROR, 0, _("Could not start clone job.\n")); - } else { - Jmsg(jcr, M_INFO, 0, _("Clone JobId %d started.\n"), stat); - } - } - free_ua_context(ua); - free_pool_memory(cmd); - } -} - -bool create_restore_bootstrap_file(JCR *jcr) -{ - RESTORE_CTX rx; - UAContext *ua; - memset(&rx, 0, sizeof(rx)); - rx.bsr = new_bsr(); - rx.JobIds = ""; - rx.bsr->JobId = jcr->target_jr.JobId; - ua = new_ua_context(jcr); - complete_bsr(ua, rx.bsr); - rx.bsr->fi = new_findex(); - rx.bsr->fi->findex = 1; - rx.bsr->fi->findex2 = jcr->target_jr.JobFiles; - jcr->ExpectedFiles = write_bsr_file(ua, rx); - if (jcr->ExpectedFiles == 0) { - free_ua_context(ua); - free_bsr(rx.bsr); - return false; - } - if (jcr->RestoreBootstrap) { - free(jcr->RestoreBootstrap); - } - POOLMEM *fname = get_pool_memory(PM_MESSAGE); - make_unique_restore_filename(ua, &fname); - jcr->RestoreBootstrap = bstrdup(fname); - free_ua_context(ua); - free_bsr(rx.bsr); - free_pool_memory(fname); - jcr->needs_sd = true; - return true; -} diff --git a/bacula/src/dird/jobq.c b/bacula/src/dird/jobq.c index 6ec9a5de51..b83098d862 100755 --- a/bacula/src/dird/jobq.c +++ b/bacula/src/dird/jobq.c @@ -18,22 +18,17 @@ * */ /* - Copyright (C) 2003-2005 Kern Sibbald + Copyright (C) 2003-2006 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ @@ -182,7 +177,8 @@ void *sched_wait(void *arg) } /* Check every 30 seconds if canceled */ while (wtime > 0) { - Dmsg2(2300, "Waiting on sched time, jobid=%d secs=%d\n", jcr->JobId, wtime); + Dmsg3(2300, "Waiting on sched time, jobid=%d secs=%d use=%d\n", + jcr->JobId, wtime, jcr->use_count()); if (wtime > 30) { wtime = 30; } @@ -192,9 +188,8 @@ void *sched_wait(void *arg) } wtime = jcr->sched_time - time(NULL); } - P(jcr->mutex); /* lock jcr */ + Dmsg1(200, "resched use=%d\n", jcr->use_count()); jobq_add(jq, jcr); - V(jcr->mutex); free_jcr(jcr); /* we are done with jcr */ Dmsg0(2300, "Exit sched_wait\n"); return NULL; @@ -203,9 +198,6 @@ void *sched_wait(void *arg) /* * Add a job to the queue * jq is a queue that was created with jobq_init - * - * On entry jcr->mutex must be locked. - * */ int jobq_add(jobq_t *jq, JCR *jcr) { @@ -216,14 +208,14 @@ int jobq_add(jobq_t *jq, JCR *jcr) pthread_t id; wait_pkt *sched_pkt; - Dmsg3(2300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count); + Dmsg3(2300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count()); if (jq->valid != JOBQ_VALID) { Jmsg0(jcr, M_ERROR, 0, "Jobq_add queue not initialized.\n"); return EINVAL; } - jcr->use_count++; /* mark jcr in use by us */ - Dmsg3(2300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count); + jcr->inc_use_count(); /* mark jcr in use by us */ + Dmsg3(2300, "jobq_add jobid=%d jcr=0x%x use_count=%d\n", jcr->JobId, jcr, jcr->use_count()); if (!job_canceled(jcr) && wtime > 0) { set_thread_concurrency(jq->max_workers + 2); sched_pkt = (wait_pkt *)malloc(sizeof(wait_pkt)); @@ -240,12 +232,12 @@ int jobq_add(jobq_t *jq, JCR *jcr) if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) { berrno be; Jmsg1(jcr, M_ERROR, 0, _("pthread_mutex_lock: ERR=%s\n"), be.strerror(stat)); - jcr->use_count--; /* release jcr */ + free_jcr(jcr); /* release jcr */ return stat; } if ((item = (jobq_item_t *)malloc(sizeof(jobq_item_t))) == NULL) { - jcr->use_count--; /* release jcr */ + free_jcr(jcr); /* release jcr */ return ENOMEM; } item->jcr = jcr; @@ -444,10 +436,12 @@ void *jobq_server(void *arg) V(jq->mutex); /* Call user's routine here */ - Dmsg1(2300, "Calling user engine for jobid=%d\n", jcr->JobId); + Dmsg2(2300, "Calling user engine for jobid=%d use=%d\n", jcr->JobId, + jcr->use_count()); jq->engine(je->jcr); - Dmsg1(2300, "Back from user engine jobid=%d.\n", jcr->JobId); + Dmsg2(2300, "Back from user engine jobid=%d use=%d.\n", jcr->JobId, + jcr->use_count()); /* Reacquire job queue lock */ P(jq->mutex); @@ -490,11 +484,12 @@ void *jobq_server(void *arg) jcr->JobStatus = JS_WaitStartTime; jcr->SDJobStatus = 0; if (jcr->JobBytes == 0) { - Dmsg1(2300, "Requeue job=%d\n", jcr->JobId); + Dmsg2(2300, "Requeue job=%d use=%d\n", jcr->JobId, jcr->use_count()); jcr->JobStatus = JS_WaitStartTime; V(jq->mutex); jobq_add(jq, jcr); /* queue the job to run again */ P(jq->mutex); + free_jcr(jcr); /* release jcr */ free(je); /* free the job entry */ continue; /* look for another job to run */ } @@ -509,7 +504,7 @@ void *jobq_server(void *arg) njcr->reschedule_count = jcr->reschedule_count; njcr->JobLevel = jcr->JobLevel; njcr->JobStatus = jcr->JobStatus; - copy_storage(njcr, jcr->storage); + copy_storage(njcr, jcr); njcr->messages = jcr->messages; Dmsg0(2300, "Call to run new job\n"); V(jq->mutex); @@ -523,7 +518,7 @@ void *jobq_server(void *arg) db_close_database(jcr, jcr->db); jcr->db = NULL; } - Dmsg2(2300, "====== Termination job=%d use_cnt=%d\n", jcr->JobId, jcr->use_count); + Dmsg2(2300, "====== Termination job=%d use_cnt=%d\n", jcr->JobId, jcr->use_count()); jcr->SDJobStatus = 0; V(jq->mutex); /* release internal lock */ free_jcr(jcr); diff --git a/bacula/src/dird/mac.c b/bacula/src/dird/mac.c index d042552377..163304779f 100644 --- a/bacula/src/dird/mac.c +++ b/bacula/src/dird/mac.c @@ -8,14 +8,14 @@ * Basic tasks done here: * Open DB and create records for this job. * Open Message Channel with Storage daemon to tell him a job will be starting. - * Open connection with Storage daemon and pass him commands + * Open connection with File daemon and pass him commands * to do the backup. - * When the Storage daemon finishes the job, update the DB. + * When the File daemon finishes the job, update the DB. * * Version $Id$ */ /* - Copyright (C) 2004-2006 Kern Sibbald + Copyright (C) 2004-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -33,8 +33,6 @@ #include "dird.h" #include "ua.h" -static char OKbootstrap[] = "3000 OK bootstrap\n"; - /* * Called here before the job is run to do the job * specific setup. @@ -42,7 +40,11 @@ static char OKbootstrap[] = "3000 OK bootstrap\n"; bool do_mac_init(JCR *jcr) { POOL_DBR pr; + JOB_DBR jr; + JobId_t input_jobid; char *Name; + RESTORE_CTX rx; + UAContext *ua; const char *Type; switch(jcr->JobType) { @@ -67,35 +69,36 @@ bool do_mac_init(JCR *jcr) /* * Find JobId of last job that ran. */ + memcpy(&jr, &jcr->jr, sizeof(jr)); Name = jcr->job->migration_job->hdr.name; Dmsg1(100, "find last jobid for: %s\n", NPRT(Name)); - jcr->target_jr.JobType = JT_BACKUP; - if (!db_find_last_jobid(jcr, jcr->db, Name, &jcr->target_jr)) { - Jmsg(jcr, M_FATAL, 0, - _("Previous job \"%s\" not found. ERR=%s\n"), Name, - db_strerror(jcr->db)); + if (!db_find_last_jobid(jcr, jcr->db, Name, &jr)) { + Jmsg(jcr, M_FATAL, 0, _( + _("Unable to find JobId of previous Job for this client.\n"))); return false; } - Dmsg1(100, "Last jobid=%d\n", jcr->target_jr.JobId); + input_jobid = jr.JobId; + Dmsg1(100, "Last jobid=%d\n", input_jobid); - if (!db_get_job_record(jcr, jcr->db, &jcr->target_jr)) { + jcr->previous_jr.JobId = input_jobid; + if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) { Jmsg(jcr, M_FATAL, 0, _("Could not get job record for previous Job. ERR=%s"), db_strerror(jcr->db)); return false; } - if (jcr->target_jr.JobStatus != 'T') { + if (jcr->previous_jr.JobStatus != 'T') { Jmsg(jcr, M_FATAL, 0, _("Last Job %d did not terminate normally. JobStatus=%c\n"), - jcr->target_jr.JobId, jcr->target_jr.JobStatus); + input_jobid, jcr->previous_jr.JobStatus); return false; } Jmsg(jcr, M_INFO, 0, _("%s using JobId=%d Job=%s\n"), - Type, jcr->target_jr.JobId, jcr->target_jr.Job); + Type, jcr->previous_jr.JobId, jcr->previous_jr.Job); /* * Get the Pool record -- first apply any level defined pools */ - switch (jcr->target_jr.JobLevel) { + switch (jcr->JobLevel) { case L_FULL: if (jcr->full_pool) { jcr->pool = jcr->full_pool; @@ -125,19 +128,28 @@ bool do_mac_init(JCR *jcr) Jmsg(jcr, M_INFO, 0, _("Pool %s created in database.\n"), pr.Name); } } + jcr->PoolId = pr.PoolId; /****FIXME**** this can go away */ jcr->jr.PoolId = pr.PoolId; - /* If pool storage specified, use it instead of job storage */ - copy_storage(jcr, jcr->pool->storage); - - if (!jcr->storage) { - Jmsg(jcr, M_FATAL, 0, _("No Storage specification found in Job or Pool.\n")); + memset(&rx, 0, sizeof(rx)); + rx.bsr = new_bsr(); + rx.JobIds = ""; + rx.bsr->JobId = jcr->previous_jr.JobId; + ua = new_ua_context(jcr); + complete_bsr(ua, rx.bsr); + rx.bsr->fi = new_findex(); + rx.bsr->fi->findex = 1; + rx.bsr->fi->findex2 = jcr->previous_jr.JobFiles; + jcr->ExpectedFiles = write_bsr_file(ua, rx); + if (jcr->ExpectedFiles == 0) { + free_ua_context(ua); + free_bsr(rx.bsr); return false; } + free_ua_context(ua); + free_bsr(rx.bsr); - if (!create_restore_bootstrap_file(jcr)) { - return false; - } + jcr->needs_sd = true; return true; } @@ -149,13 +161,9 @@ bool do_mac_init(JCR *jcr) */ bool do_mac(JCR *jcr) { - POOL_DBR pr; - POOL *pool; + int stat; const char *Type; char ed1[100]; - BSOCK *sd; - JOB *job, *tjob; - JCR *tjcr; switch(jcr->JobType) { case JT_MIGRATE: @@ -173,99 +181,10 @@ bool do_mac(JCR *jcr) } - Dmsg4(100, "Target: Name=%s JobId=%d Type=%c Level=%c\n", - jcr->target_jr.Name, jcr->target_jr.JobId, - jcr->target_jr.JobType, jcr->target_jr.JobLevel); - - Dmsg4(100, "Current: Name=%s JobId=%d Type=%c Level=%c\n", - jcr->jr.Name, jcr->jr.JobId, - jcr->jr.JobType, jcr->jr.JobLevel); - - LockRes(); - job = (JOB *)GetResWithName(R_JOB, jcr->jr.Name); - tjob = (JOB *)GetResWithName(R_JOB, jcr->target_jr.Name); - UnlockRes(); - if (!job || !tjob) { - return false; - } - - /* - * Target jcr is the new Job that corresponds to the original - * target job. It "runs" at the same time as the current - * migration job and becomes a new backup job that replaces - * the original backup job. Most operations on the current - * migration jcr are also done on the target jcr. - */ - tjcr = jcr->target_jcr = new_jcr(sizeof(JCR), dird_free_jcr); - memcpy(&tjcr->target_jr, &jcr->target_jr, sizeof(tjcr->target_jr)); - - /* Turn the tjcr into a "real" job */ - set_jcr_defaults(tjcr, tjob); - if (!setup_job(tjcr)) { - return false; - } - /* Set output PoolId and FileSetId. */ - tjcr->jr.PoolId = jcr->jr.PoolId; - tjcr->jr.FileSetId = jcr->jr.FileSetId; - - /* - * Get the PoolId used with the original job. Then - * find the pool name from the database record. - */ - memset(&pr, 0, sizeof(pr)); - pr.PoolId = tjcr->target_jr.PoolId; - if (!db_get_pool_record(jcr, jcr->db, &pr)) { - char ed1[50]; - Jmsg(jcr, M_FATAL, 0, _("Pool for JobId %s not in database. ERR=%s\n"), - edit_int64(pr.PoolId, ed1), db_strerror(jcr->db)); - return false; - } - /* Get the pool resource corresponding to the original job */ - pool = (POOL *)GetResWithName(R_POOL, pr.Name); - if (!pool) { - Jmsg(jcr, M_FATAL, 0, _("Pool resource \"%s\" not found.\n"), pr.Name); - return false; - } - - /* Check Migration time and High/Low water marks */ - /* ***FIXME*** */ - - /* If pool storage specified, use it for restore */ - copy_storage(tjcr, pool->storage); - - /* If the original backup pool has a NextPool, make sure a - * record exists in the database. - */ - if (pool->NextPool) { - memset(&pr, 0, sizeof(pr)); - bstrncpy(pr.Name, pool->NextPool->hdr.name, sizeof(pr.Name)); - - while (!db_get_pool_record(jcr, jcr->db, &pr)) { /* get by Name */ - /* Try to create the pool */ - if (create_pool(jcr, jcr->db, pool->NextPool, POOL_OP_CREATE) < 0) { - Jmsg(jcr, M_FATAL, 0, _("Pool \"%s\" not in database. %s"), pr.Name, - db_strerror(jcr->db)); - return false; - } else { - Jmsg(jcr, M_INFO, 0, _("Pool \"%s\" created in database.\n"), pr.Name); - } - } - /* - * put the "NextPool" resource pointer in our jcr so that we - * can pull the Storage reference from it. - */ - tjcr->pool = jcr->pool = pool->NextPool; - tjcr->jr.PoolId = jcr->jr.PoolId = pr.PoolId; - } - - /* If pool storage specified, use it instead of job storage for backup */ - copy_storage(jcr, jcr->pool->storage); - /* Print Job Start message */ Jmsg(jcr, M_INFO, 0, _("Start %s JobId %s, Job=%s\n"), Type, edit_uint64(jcr->JobId, ed1), jcr->Job); - set_jcr_job_status(jcr, JS_Running); set_jcr_job_status(jcr, JS_Running); Dmsg2(100, "JobId=%d JobLevel=%c\n", jcr->jr.JobId, jcr->jr.JobLevel); if (!db_update_job_start_record(jcr, jcr->db, &jcr->jr)) { @@ -273,12 +192,6 @@ bool do_mac(JCR *jcr) return false; } - if (!db_update_job_start_record(tjcr, tjcr->db, &tjcr->jr)) { - Jmsg(jcr, M_FATAL, 0, "%s", db_strerror(tjcr->db)); - return false; - } - - /* * Open a message channel connection with the Storage * daemon. This is to let him know that our client @@ -287,52 +200,39 @@ bool do_mac(JCR *jcr) */ Dmsg0(110, "Open connection with storage daemon\n"); set_jcr_job_status(jcr, JS_WaitSD); - set_jcr_job_status(tjcr, JS_WaitSD); /* * Start conversation with Storage daemon */ if (!connect_to_storage_daemon(jcr, 10, SDConnectTimeout, 1)) { return false; } - sd = jcr->store_bsock; /* * Now start a job with the Storage daemon */ - Dmsg2(000, "Read store=%s, write store=%s\n", - ((STORE *)tjcr->storage->first())->hdr.name, - ((STORE *)jcr->storage->first())->hdr.name); - if (!start_storage_daemon_job(jcr, tjcr->storage, jcr->storage)) { - return false; - } - Dmsg0(150, "Storage daemon connection OK\n"); - - if (!send_bootstrap_file(jcr, sd) || - !response(jcr, sd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) { + if (!start_storage_daemon_job(jcr, jcr->storage, jcr->storage)) { return false; } - - /* * Now start a Storage daemon message thread */ if (!start_storage_daemon_message_thread(jcr)) { return false; } + Dmsg0(150, "Storage daemon connection OK\n"); - if (!bnet_fsend(sd, "run")) { - return false; - } - + /* Pickup Job termination data */ set_jcr_job_status(jcr, JS_Running); - set_jcr_job_status(tjcr, JS_Running); - /* Pickup Job termination data */ /* Note, the SD stores in jcr->JobFiles/ReadBytes/JobBytes/Errors */ wait_for_storage_daemon_termination(jcr); - jcr->JobStatus = jcr->SDJobStatus; - if (jcr->JobStatus == JS_Terminated) { - mac_cleanup(jcr, jcr->JobStatus); + if (jcr->JobStatus != JS_Terminated) { + stat = jcr->JobStatus; + } else { + stat = jcr->SDJobStatus; + } + if (stat == JS_Terminated) { + mac_cleanup(jcr, stat); return true; } return false; @@ -344,17 +244,15 @@ bool do_mac(JCR *jcr) */ void mac_cleanup(JCR *jcr, int TermCode) { - char sdt[MAX_TIME_LENGTH], edt[MAX_TIME_LENGTH]; - char ec1[30], ec2[30], ec3[30], ec4[30], elapsed[50]; - char term_code[100], sd_term_msg[100]; + char sdt[50], edt[50]; + char ec1[30], ec2[30], ec3[30], ec4[30], ec5[30], compress[50]; + char term_code[100], fd_term_msg[100], sd_term_msg[100]; const char *term_msg; int msg_type; MEDIA_DBR mr; - double kbps; + double kbps, compression; utime_t RunTime; const char *Type; - JCR *tjcr = jcr->target_jcr; - POOL_MEM query(PM_MESSAGE); switch(jcr->JobType) { case JT_MIGRATE: @@ -371,31 +269,12 @@ void mac_cleanup(JCR *jcr, int TermCode) break; } - /* Ensure target is defined to avoid a lot of testing */ - if (!tjcr) { - tjcr = jcr; - } - tjcr->JobFiles = jcr->JobFiles = jcr->SDJobFiles; - tjcr->JobBytes = jcr->JobBytes = jcr->SDJobBytes; - tjcr->VolSessionId = jcr->VolSessionId; - tjcr->VolSessionTime = jcr->VolSessionTime; - Dmsg2(100, "Enter mac_cleanup %d %c\n", TermCode, TermCode); dequeue_messages(jcr); /* display any queued messages */ memset(&mr, 0, sizeof(mr)); set_jcr_job_status(jcr, TermCode); - set_jcr_job_status(tjcr, TermCode); - update_job_end_record(jcr); /* update database */ - update_job_end_record(tjcr); - - Mmsg(query, "UPDATE Job SET StartTime='%s',EndTime='%s'," - "JobTDate=%s WHERE JobId=%s", - jcr->target_jr.cStartTime, jcr->target_jr.cEndTime, - edit_uint64(jcr->target_jr.JobTDate, ec1), - edit_uint64(tjcr->jr.JobId, ec2)); - db_sql_query(tjcr->db, query.c_str(), NULL, NULL); if (!db_get_job_record(jcr, jcr->db, &jcr->jr)) { Jmsg(jcr, M_WARNING, 0, _("Error getting job record for stats: %s"), @@ -410,20 +289,77 @@ void mac_cleanup(JCR *jcr, int TermCode) set_jcr_job_status(jcr, JS_ErrorTerminated); } - update_bootstrap_file(tjcr); + /* Now update the bootstrap file if any */ + if (jcr->JobStatus == JS_Terminated && jcr->jr.JobBytes && + jcr->job->WriteBootstrap) { + FILE *fd; + BPIPE *bpipe = NULL; + int got_pipe = 0; + char *fname = jcr->job->WriteBootstrap; + VOL_PARAMS *VolParams = NULL; + int VolCount; + + if (*fname == '|') { + fname++; + got_pipe = 1; + bpipe = open_bpipe(fname, 0, "w"); + fd = bpipe ? bpipe->wfd : NULL; + } else { + /* ***FIXME*** handle BASE */ + fd = fopen(fname, jcr->JobLevel==L_FULL?"w+":"a+"); + } + if (fd) { + VolCount = db_get_job_volume_parameters(jcr, jcr->db, jcr->JobId, + &VolParams); + if (VolCount == 0) { + Jmsg(jcr, M_ERROR, 0, _("Could not get Job Volume Parameters to " + "update Bootstrap file. ERR=%s\n"), db_strerror(jcr->db)); + if (jcr->SDJobFiles != 0) { + set_jcr_job_status(jcr, JS_ErrorTerminated); + } + + } + for (int i=0; i < VolCount; i++) { + /* Write the record */ + fprintf(fd, "Volume=\"%s\"\n", VolParams[i].VolumeName); + fprintf(fd, "MediaType=\"%s\"\n", VolParams[i].MediaType); + fprintf(fd, "VolSessionId=%u\n", jcr->VolSessionId); + fprintf(fd, "VolSessionTime=%u\n", jcr->VolSessionTime); + fprintf(fd, "VolFile=%u-%u\n", VolParams[i].StartFile, + VolParams[i].EndFile); + fprintf(fd, "VolBlock=%u-%u\n", VolParams[i].StartBlock, + VolParams[i].EndBlock); + fprintf(fd, "FileIndex=%d-%d\n", VolParams[i].FirstIndex, + VolParams[i].LastIndex); + } + if (VolParams) { + free(VolParams); + } + if (got_pipe) { + close_bpipe(bpipe); + } else { + fclose(fd); + } + } else { + berrno be; + Jmsg(jcr, M_ERROR, 0, _("Could not open WriteBootstrap file:\n" + "%s: ERR=%s\n"), fname, be.strerror()); + set_jcr_job_status(jcr, JS_ErrorTerminated); + } + } msg_type = M_INFO; /* by default INFO message */ switch (jcr->JobStatus) { case JS_Terminated: if (jcr->Errors || jcr->SDErrors) { - term_msg = _("%s OK -- with warnings"); + term_msg = _("Backup OK -- with warnings"); } else { - term_msg = _("%s OK"); + term_msg = _("Backup OK"); } break; case JS_FatalError: case JS_ErrorTerminated: - term_msg = _("*** %s Error ***"); + term_msg = _("*** Backup Error ***"); msg_type = M_ERROR; /* Generate error message */ if (jcr->store_bsock) { bnet_sig(jcr->store_bsock, BNET_TERMINATE); @@ -433,7 +369,7 @@ void mac_cleanup(JCR *jcr, int TermCode) } break; case JS_Canceled: - term_msg = _("%s Canceled"); + term_msg = _("Backup Canceled"); if (jcr->store_bsock) { bnet_sig(jcr->store_bsock, BNET_TERMINATE); if (jcr->SD_msg_chan) { @@ -442,10 +378,10 @@ void mac_cleanup(JCR *jcr, int TermCode) } break; default: - term_msg = _("Inappropriate %s term code"); + term_msg = term_code; + sprintf(term_code, _("Inappropriate term code: %c\n"), jcr->JobStatus); break; } - bsnprintf(term_code, sizeof(term_code), term_msg, Type); bstrftimes(sdt, sizeof(sdt), jcr->jr.StartTime); bstrftimes(edt, sizeof(edt), jcr->jr.EndTime); RunTime = jcr->jr.EndTime - jcr->jr.StartTime; @@ -454,7 +390,7 @@ void mac_cleanup(JCR *jcr, int TermCode) } else { kbps = (double)jcr->jr.JobBytes / (1000 * RunTime); } - if (!db_get_job_volume_names(tjcr, tjcr->db, tjcr->jr.JobId, &tjcr->VolumeName)) { + if (!db_get_job_volume_names(jcr, jcr->db, jcr->jr.JobId, &jcr->VolumeName)) { /* * Note, if the job has erred, most likely it did not write any * tape, so suppress this "error" message since in that case @@ -462,19 +398,28 @@ void mac_cleanup(JCR *jcr, int TermCode) * normal exit should we complain about this error. */ if (jcr->JobStatus == JS_Terminated && jcr->jr.JobBytes) { - Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(tjcr->db)); + Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db)); } - tjcr->VolumeName[0] = 0; /* none */ + jcr->VolumeName[0] = 0; /* none */ } + if (jcr->ReadBytes == 0) { + bstrncpy(compress, "None", sizeof(compress)); + } else { + compression = (double)100 - 100.0 * ((double)jcr->JobBytes / (double)jcr->ReadBytes); + if (compression < 0.5) { + bstrncpy(compress, "None", sizeof(compress)); + } else { + bsnprintf(compress, sizeof(compress), "%.1f %%", (float)compression); + } + } + jobstatus_to_ascii(jcr->FDJobStatus, fd_term_msg, sizeof(fd_term_msg)); jobstatus_to_ascii(jcr->SDJobStatus, sd_term_msg, sizeof(sd_term_msg)); // bmicrosleep(15, 0); /* for debugging SIGHUP */ Jmsg(jcr, msg_type, 0, _("Bacula %s (%s): %s\n" -" Old Backup JobId: %u\n" -" New Backup JobId: %u\n" -" JobId: %u\n" +" JobId: %d\n" " Job: %s\n" " Backup Level: %s%s\n" " Client: %s\n" @@ -482,23 +427,24 @@ void mac_cleanup(JCR *jcr, int TermCode) " Pool: \"%s\"\n" " Start time: %s\n" " End time: %s\n" -" Elapsed time: %s\n" -" Priority: %d\n" +" FD Files Written: %s\n" " SD Files Written: %s\n" -" SD Bytes Written: %s (%sB)\n" +" FD Bytes Written: %s\n" +" SD Bytes Written: %s\n" " Rate: %.1f KB/s\n" +" Software Compression: %s\n" " Volume name(s): %s\n" " Volume Session Id: %d\n" " Volume Session Time: %d\n" " Last Volume Bytes: %s\n" +" Non-fatal FD errors: %d\n" " SD Errors: %d\n" +" FD termination status: %s\n" " SD termination status: %s\n" " Termination: %s\n\n"), VERSION, LSMDATE, - edt, - jcr->target_jr.JobId, - tjcr->jr.JobId, + edt, jcr->jr.JobId, jcr->jr.Job, level_to_str(jcr->JobLevel), jcr->since, @@ -507,22 +453,21 @@ void mac_cleanup(JCR *jcr, int TermCode) jcr->pool->hdr.name, sdt, edt, - edit_utime(RunTime, elapsed, sizeof(elapsed)), - jcr->JobPriority, - edit_uint64_with_commas(jcr->SDJobFiles, ec2), - edit_uint64_with_commas(jcr->SDJobBytes, ec3), - edit_uint64_with_suffix(jcr->jr.JobBytes, ec4), + edit_uint64_with_commas(jcr->jr.JobFiles, ec1), + edit_uint64_with_commas(jcr->SDJobFiles, ec4), + edit_uint64_with_commas(jcr->jr.JobBytes, ec2), + edit_uint64_with_commas(jcr->SDJobBytes, ec5), (float)kbps, - tjcr->VolumeName, + compress, + jcr->VolumeName, jcr->VolSessionId, jcr->VolSessionTime, - edit_uint64_with_commas(mr.VolBytes, ec1), + edit_uint64_with_commas(mr.VolBytes, ec3), + jcr->Errors, jcr->SDErrors, + fd_term_msg, sd_term_msg, - term_code); + term_msg); - Dmsg1(100, "Leave mac_cleanup() target_jcr=0x%x\n", jcr->target_jcr); - if (jcr->target_jcr) { - free_jcr(jcr->target_jcr); - } + Dmsg0(100, "Leave mac_cleanup()\n"); } diff --git a/bacula/src/dird/msgchan.c b/bacula/src/dird/msgchan.c index faaaceb3e7..3ed70c6777 100644 --- a/bacula/src/dird/msgchan.c +++ b/bacula/src/dird/msgchan.c @@ -33,8 +33,10 @@ #include "bacula.h" #include "dird.h" +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; + /* Commands sent to Storage daemon */ -static char jobcmd[] = "JobId=%d job=%s job_name=%s client_name=%s " +static char jobcmd[] = "JobId=%s job=%s job_name=%s client_name=%s " "type=%d level=%d FileSet=%s NoAttr=%d SpoolAttr=%d FileSetMD5=%s " "SpoolData=%d WritePartAfterJob=%d PreferMountedVols=%d\n"; static char use_storage[] = "use storage=%s media_type=%s pool_name=%s " @@ -49,7 +51,7 @@ static char OK_device[] = "3000 OK use device device=%s\n"; /* Storage Daemon requests */ static char Job_start[] = "3010 Job %127s start\n"; static char Job_end[] = - "3099 Job %127s end JobStatus=%d JobFiles=%d JobBytes=%lld\n"; + "3099 Job %127s end JobStatus=%d JobFiles=%d JobBytes=%" lld "\n"; /* Forward referenced functions */ extern "C" void *msg_thread(void *arg); @@ -126,28 +128,41 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore) BSOCK *sd; char auth_key[100]; POOL_MEM store_name, device_name, pool_name, pool_type, media_type; + POOL_MEM job_name, client_name, fileset_name; int copy = 0; int stripe = 0; + char ed1[30]; sd = jcr->store_bsock; /* * Now send JobId and permissions, and get back the authorization key. */ - bash_spaces(jcr->job->hdr.name); - bash_spaces(jcr->client->hdr.name); - bash_spaces(jcr->fileset->hdr.name); + pm_strcpy(job_name, jcr->job->hdr.name); + bash_spaces(job_name); + pm_strcpy(client_name, jcr->client->hdr.name); + bash_spaces(client_name); + pm_strcpy(fileset_name, jcr->fileset->hdr.name); + bash_spaces(fileset_name); if (jcr->fileset->MD5[0] == 0) { bstrncpy(jcr->fileset->MD5, "**Dummy**", sizeof(jcr->fileset->MD5)); } - bnet_fsend(sd, jobcmd, jcr->JobId, jcr->Job, jcr->job->hdr.name, - jcr->client->hdr.name, jcr->JobType, jcr->JobLevel, - jcr->fileset->hdr.name, !jcr->pool->catalog_files, + /* If rescheduling, cancel the previous incarnation of this job + * with the SD, which might be waiting on the FD connection. + * If we do not cancel it the SD will not accept a new connection + * for the same jobid. + */ + if (jcr->reschedule_count) { + bnet_fsend(sd, "cancel Job=%s\n", jcr->Job); + while (bnet_recv(sd) >= 0) + { } + } + bnet_fsend(sd, jobcmd, edit_int64(jcr->JobId, ed1), jcr->Job, + job_name.c_str(), client_name.c_str(), + jcr->JobType, jcr->JobLevel, + fileset_name.c_str(), !jcr->pool->catalog_files, jcr->job->SpoolAttributes, jcr->fileset->MD5, jcr->spool_data, jcr->write_part_after_job, jcr->job->PreferMountedVolumes); Dmsg1(100, ">stored: %s\n", sd->msg); - unbash_spaces(jcr->job->hdr.name); - unbash_spaces(jcr->client->hdr.name); - unbash_spaces(jcr->fileset->hdr.name); if (bget_dirmsg(sd) > 0) { Dmsg1(100, "msg); if (sscanf(sd->msg, OKjob, &jcr->VolSessionId, @@ -198,19 +213,15 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore) Dmsg1(100, ">stored: %s", sd->msg); } bnet_sig(sd, BNET_EOD); /* end of Devices */ - } - bnet_sig(sd, BNET_EOD); /* end of Storages */ - if (bget_dirmsg(sd) > 0) { - Dmsg1(100, "msg); - /* ****FIXME**** save actual device name */ - ok = sscanf(sd->msg, OK_device, device_name.c_str()) == 1; - } else { - POOL_MEM err_msg; - pm_strcpy(err_msg, sd->msg); /* save message */ - Jmsg(jcr, M_FATAL, 0, _("\n" - " Storage daemon didn't accept Device \"%s\" because:\n %s"), - device_name.c_str(), err_msg.c_str()/* sd->msg */); - ok = false; + bnet_sig(sd, BNET_EOD); /* end of Storages */ + if (bget_dirmsg(sd) > 0) { + Dmsg1(100, "msg); + /* ****FIXME**** save actual device name */ + ok = sscanf(sd->msg, OK_device, device_name.c_str()) == 1; + } else { + ok = false; + } + break; } } @@ -233,19 +244,28 @@ bool start_storage_daemon_job(JCR *jcr, alist *rstore, alist *wstore) Dmsg1(100, ">stored: %s", sd->msg); } bnet_sig(sd, BNET_EOD); /* end of Devices */ + bnet_sig(sd, BNET_EOD); /* end of Storages */ + if (bget_dirmsg(sd) > 0) { + Dmsg1(100, "msg); + /* ****FIXME**** save actual device name */ + ok = sscanf(sd->msg, OK_device, device_name.c_str()) == 1; + } else { + ok = false; + } + break; } - bnet_sig(sd, BNET_EOD); /* end of Storages */ - if (bget_dirmsg(sd) > 0) { - Dmsg1(100, "msg); - /* ****FIXME**** save actual device name */ - ok = sscanf(sd->msg, OK_device, device_name.c_str()) == 1; - } else { - POOL_MEM err_msg; + } + if (!ok) { + POOL_MEM err_msg; + if (sd->msg[0]) { pm_strcpy(err_msg, sd->msg); /* save message */ Jmsg(jcr, M_FATAL, 0, _("\n" - " Storage daemon didn't accept Device \"%s\" because:\n %s"), - device_name.c_str(), err_msg.c_str()/* sd->msg */); - ok = false; + " Storage daemon didn't accept Device \"%s\" because:\n %s"), + device_name.c_str(), err_msg.c_str()/* sd->msg */); + } else { + Jmsg(jcr, M_FATAL, 0, _("\n" + " Storage daemon didn't accept Device \"%s\" command.\n"), + device_name.c_str()); } } return ok; @@ -260,34 +280,30 @@ int start_storage_daemon_message_thread(JCR *jcr) int status; pthread_t thid; - P(jcr->mutex); - jcr->use_count++; /* mark in use by msg thread */ + jcr->inc_use_count(); /* mark in use by msg thread */ jcr->sd_msg_thread_done = false; jcr->SD_msg_chan = 0; - V(jcr->mutex); Dmsg0(100, "Start SD msg_thread.\n"); if ((status=pthread_create(&thid, NULL, msg_thread, (void *)jcr)) != 0) { berrno be; Jmsg1(jcr, M_ABORT, 0, _("Cannot create message thread: %s\n"), be.strerror(status)); } - Dmsg0(100, "SD msg_thread started.\n"); /* Wait for thread to start */ while (jcr->SD_msg_chan == 0) { bmicrosleep(0, 50); } + Dmsg1(100, "SD msg_thread started. use=%d\n", jcr->use_count()); return 1; } extern "C" void msg_thread_cleanup(void *arg) { JCR *jcr = (JCR *)arg; - Dmsg0(200, "End msg_thread\n"); db_end_transaction(jcr, jcr->db); /* terminate any open transaction */ - P(jcr->mutex); jcr->sd_msg_thread_done = true; - pthread_cond_broadcast(&jcr->term_wait); /* wakeup any waiting threads */ jcr->SD_msg_chan = 0; - V(jcr->mutex); + pthread_cond_broadcast(&jcr->term_wait); /* wakeup any waiting threads */ + Dmsg1(100, "=== End msg_thread. use=%d\n", jcr->use_count()); free_jcr(jcr); /* release jcr */ } @@ -314,9 +330,8 @@ extern "C" void *msg_thread(void *arg) /* Read the Storage daemon's output. */ Dmsg0(100, "Start msg_thread loop\n"); - while ((stat=bget_dirmsg(sd)) >= 0) { - int stat; - Dmsg1(3400, "msg); + while (!job_canceled(jcr) && bget_dirmsg(sd) >= 0) { + Dmsg1(400, "msg); if (sscanf(sd->msg, Job_start, Job) == 1) { continue; } @@ -327,6 +342,7 @@ extern "C" void *msg_thread(void *arg) jcr->SDJobBytes = JobBytes; break; } + Dmsg2(400, "end loop stat=%d use=%d\n", stat, jcr->use_count()); } if (is_bnet_error(sd)) { jcr->SDJobStatus = JS_ErrorTerminated; @@ -339,8 +355,6 @@ void wait_for_storage_daemon_termination(JCR *jcr) { int cancel_count = 0; /* Now wait for Storage daemon to terminate our message thread */ - set_jcr_job_status(jcr, JS_WaitSD); - P(jcr->mutex); while (!jcr->sd_msg_thread_done) { struct timeval tv; struct timezone tz; @@ -348,18 +362,25 @@ void wait_for_storage_daemon_termination(JCR *jcr) gettimeofday(&tv, &tz); timeout.tv_nsec = 0; - timeout.tv_sec = tv.tv_sec + 10; /* wait 10 seconds */ - Dmsg0(300, "I'm waiting for message thread termination.\n"); - pthread_cond_timedwait(&jcr->term_wait, &jcr->mutex, &timeout); + timeout.tv_sec = tv.tv_sec + 5; /* wait 5 seconds */ + Dmsg0(400, "I'm waiting for message thread termination.\n"); + P(mutex); + pthread_cond_timedwait(&jcr->term_wait, &mutex, &timeout); + V(mutex); if (job_canceled(jcr)) { + if (jcr->SD_msg_chan) { + jcr->store_bsock->timed_out = 1; + jcr->store_bsock->terminated = 1; + Dmsg2(400, "kill jobid=%d use=%d\n", (int)jcr->JobId, jcr->use_count()); + pthread_kill(jcr->SD_msg_chan, TIMEOUT_SIGNAL); + } cancel_count++; } /* Give SD 30 seconds to clean up after cancel */ - if (cancel_count == 3) { + if (cancel_count == 6) { break; } } - V(jcr->mutex); set_jcr_job_status(jcr, JS_Terminated); } @@ -377,7 +398,7 @@ extern "C" void *device_thread(void *arg) jcr = new_control_jcr("*DeviceInit*", JT_SYSTEM); for (i=0; i < MAX_TRIES; i++) { if (!connect_to_storage_daemon(jcr, 10, 30, 1)) { - Dmsg0(000, "Failed connecting to SD.\n"); + Dmsg0(900, "Failed connecting to SD.\n"); continue; } LockRes(); diff --git a/bacula/src/dird/newvol.c b/bacula/src/dird/newvol.c index 354c5ddec2..b10447272d 100644 --- a/bacula/src/dird/newvol.c +++ b/bacula/src/dird/newvol.c @@ -13,7 +13,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License diff --git a/bacula/src/dird/protos.h b/bacula/src/dird/protos.h index 15ce08bbbd..ea52e9b673 100644 --- a/bacula/src/dird/protos.h +++ b/bacula/src/dird/protos.h @@ -4,7 +4,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -72,7 +72,7 @@ extern int connect_to_file_daemon(JCR *jcr, int retry_interval, int max_retry_time, int verbose); extern bool send_include_list(JCR *jcr); extern bool send_exclude_list(JCR *jcr); -extern bool send_bootstrap_file(JCR *jcr, BSOCK *sock); +extern bool send_bootstrap_file(JCR *jcr); extern bool send_level_command(JCR *jcr); extern int get_attributes_and_put_in_catalog(JCR *jcr); extern int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId); @@ -97,11 +97,8 @@ extern bool get_or_create_fileset_record(JCR *jcr); extern JobId_t run_job(JCR *jcr); extern bool cancel_job(UAContext *ua, JCR *jcr); extern void init_jcr_job_record(JCR *jcr); -extern void copy_storage(JCR *jcr, alist *storage); +extern void copy_storage(JCR *new_jcr, JCR *old_jcr); extern void set_storage(JCR *jcr, STORE *store); -extern bool setup_job(JCR *jcr); -extern void create_clones(JCR *jcr); -extern bool create_restore_bootstrap_file(JCR *jcr); /* mac.c */ extern bool do_mac(JCR *jcr); @@ -146,7 +143,7 @@ bool acl_access_ok(UAContext *ua, int acl, char *item, int len); int do_a_command(UAContext *ua, const char *cmd); int do_a_dot_command(UAContext *ua, const char *cmd); int qmessagescmd(UAContext *ua, const char *cmd); -int open_db(UAContext *ua); +bool open_db(UAContext *ua); void close_db(UAContext *ua); enum e_pool_op { POOL_OP_UPDATE, diff --git a/bacula/src/dird/pythondir.c b/bacula/src/dird/pythondir.c index 17e2f58984..57557fbfaa 100644 --- a/bacula/src/dird/pythondir.c +++ b/bacula/src/dird/pythondir.c @@ -30,6 +30,7 @@ #include extern char *configfile; +extern struct s_jl joblevels[]; extern JCR *get_jcr_from_PyObject(PyObject *self); extern PyObject *find_method(PyObject *eventsObject, PyObject *method, const char *name); @@ -82,6 +83,7 @@ static struct s_vars setvars[] = { { "JobReport", "s"}, { "VolumeName", "s"}, { "Priority", "i"}, + { "JobLevel", "s"}, { NULL, NULL} }; @@ -235,7 +237,27 @@ int job_setattr(PyObject *self, char *attrname, PyObject *value) break; case 2: /* Priority */ Dmsg1(000, "Set priority=%d\n", intval); - return 0; + if (intval >= 1 && intval <= 100) { + jcr->JobPriority = intval; + } else { + PyErr_SetString(PyExc_ValueError, _("Priority must be 1-100")); + return -1; + } + case 3: /* Job Level */ + if (strcmp("JobInit", jcr->event) != 0) { + PyErr_SetString(PyExc_RuntimeError, _("Job Level can be set only during JobInit")); + return -1; + } + for (i=0; joblevels[i].level_name; i++) { + if (strcmp(strval, joblevels[i].level_name) == 0) { + if (joblevels[i].job_type == jcr->JobType) { + jcr->JobLevel = joblevels[i].level; + return 0; + } + } + } + PyErr_SetString(PyExc_ValueError, _("Bad JobLevel string")); + return -1; } bail_out: PyErr_SetString(PyExc_AttributeError, attrname); diff --git a/bacula/src/dird/restore.c b/bacula/src/dird/restore.c index ff7b18c99c..928f183b0d 100644 --- a/bacula/src/dird/restore.c +++ b/bacula/src/dird/restore.c @@ -43,7 +43,6 @@ static char storaddr[] = "storage address=%s port=%d ssl=0\n"; /* Responses received from File daemon */ static char OKrestore[] = "2000 OK restore\n"; static char OKstore[] = "2000 OK storage\n"; -static char OKbootstrap[] = "2000 OK bootstrap\n"; /* * Do a restore of the specified files @@ -142,8 +141,7 @@ bool do_restore(JCR *jcr) /* * Send the bootstrap file -- what Volumes/files to restore */ - if (!send_bootstrap_file(jcr, fd) || - !response(jcr, fd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) { + if (!send_bootstrap_file(jcr)) { restore_cleanup(jcr, JS_ErrorTerminated); return false; } diff --git a/bacula/src/dird/sql_cmds.c b/bacula/src/dird/sql_cmds.c index 065aeba85b..bb5f31ee57 100644 --- a/bacula/src/dird/sql_cmds.c +++ b/bacula/src/dird/sql_cmds.c @@ -68,7 +68,7 @@ const char *drop_deltabs[] = { /* List of SQL commands to create temp table and indicies */ const char *create_deltabs[] = { - "CREATE TABLE DelCandidates (" + "CREATE TEMPORARY TABLE DelCandidates (" #ifdef HAVE_MYSQL "JobId INTEGER UNSIGNED NOT NULL, " "PurgedFiles TINYINT, " @@ -211,7 +211,7 @@ const char *uar_del_temp = "DROP TABLE temp"; const char *uar_del_temp1 = "DROP TABLE temp1"; const char *uar_create_temp = - "CREATE TABLE temp (" + "CREATE TEMPORARY TABLE temp (" #ifdef HAVE_POSTGRESQL "JobId INTEGER NOT NULL," "JobTDate BIGINT," @@ -239,7 +239,7 @@ const char *uar_create_temp = #endif const char *uar_create_temp1 = - "CREATE TABLE temp1 (" + "CREATE TEMPORARY TABLE temp1 (" #ifdef HAVE_POSTGRESQL "JobId INTEGER NOT NULL," "JobTDate BIGINT)"; diff --git a/bacula/src/dird/ua_cmds.c b/bacula/src/dird/ua_cmds.c index 1edb832d95..7c5911ebd6 100644 --- a/bacula/src/dird/ua_cmds.c +++ b/bacula/src/dird/ua_cmds.c @@ -127,7 +127,7 @@ static struct cmdstruct commands[] = { { N_("use"), use_cmd, _("use catalog xxx")}, { N_("var"), var_cmd, _("does variable expansion")}, { N_("version"), version_cmd, _("print Director version")}, - { N_("wait"), wait_cmd, _("wait until no jobs are running")}, + { N_("wait"), wait_cmd, _("wait until no jobs are running [ | | ]")}, }; #define comsize (sizeof(commands)/sizeof(struct cmdstruct)) @@ -396,7 +396,18 @@ static int cancel_cmd(UAContext *ua, const char *cmd) bstrncpy(jcr->Job, ua->argv[i], sizeof(jcr->Job)); } break; + } else if (strcasecmp(ua->argk[i], _("ujobid")) == 0) { + if (!ua->argv[i]) { + break; + } + if (!(jcr=get_jcr_by_full_name(ua->argv[i]))) { + bsendmsg(ua, _("Warning Job %s is not running. Continuing anyway ...\n"), ua->argv[i]); + jcr = new_jcr(sizeof(JCR), dird_free_jcr); + bstrncpy(jcr->Job, ua->argv[i], sizeof(jcr->Job)); + } + break; } + } /* If we still do not have a jcr, * throw up a list and ask the user to select one. @@ -435,7 +446,6 @@ static int cancel_cmd(UAContext *ua, const char *cmd) return 1; } } - /* NOTE! This increments the ref_count */ sscanf(buf, "JobId=%d Job=%127s", &njobs, JobName); jcr = get_jcr_by_full_name(JobName); if (!jcr) { @@ -1237,8 +1247,6 @@ static void do_job_delete(UAContext *ua, JobId_t JobId) Mmsg(query, "DELETE FROM Job WHERE JobId=%s", edit_int64(JobId, ed1)); db_sql_query(ua->db, query, NULL, (void *)NULL); - Mmsg(query, "DELETE FROM MAC WHERE JobId=%s", ed1); - db_sql_query(ua->db, query, NULL, (void *)NULL); Mmsg(query, "DELETE FROM File WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); Mmsg(query, "DELETE FROM JobMedia WHERE JobId=%s", ed1); @@ -1391,27 +1399,158 @@ int quit_cmd(UAContext *ua, const char *cmd) return 1; } +/* Handler to get job status */ +static int status_handler(void *ctx, int num_fields, char **row) +{ + char *val = (char *)ctx; + + if (row[0]) { + *val = row[0][0]; + } else { + *val = '?'; /* Unknown by default */ + } + + return 0; +} + /* * Wait until no job is running */ int wait_cmd(UAContext *ua, const char *cmd) { JCR *jcr; + + /* no args + * Wait until no job is running + */ + if (ua->argc == 1) { + bmicrosleep(0, 200000); /* let job actually start */ + for (bool running=true; running; ) { + running = false; + foreach_jcr(jcr) { + if (jcr->JobId != 0) { + running = true; + break; + } + } + endeach_jcr(jcr); + + if (running) { + bmicrosleep(1, 0); + } + } + return 1; + } + + /* we have jobid, jobname or ujobid argument */ + + uint32_t jobid = 0 ; + + if (!open_db(ua)) { + bsendmsg(ua, _("ERR: Can't open db\n")) ; + return 1; + } + + for (int i=1; iargc; i++) { + if (strcasecmp(ua->argk[i], "jobid") == 0) { + if (!ua->argv[i]) { + break; + } + jobid = str_to_int64(ua->argv[i]); + break; + } else if (strcasecmp(ua->argk[i], "jobname") == 0 || + strcasecmp(ua->argk[i], "job") == 0) { + if (!ua->argv[i]) { + break; + } + jcr=get_jcr_by_partial_name(ua->argv[i]) ; + if (jcr) { + jobid = jcr->JobId ; + free_jcr(jcr); + } + break; + } else if (strcasecmp(ua->argk[i], "ujobid") == 0) { + if (!ua->argv[i]) { + break; + } + jcr=get_jcr_by_full_name(ua->argv[i]) ; + if (jcr) { + jobid = jcr->JobId ; + free_jcr(jcr); + } + break; + } + } + + if (jobid == 0) { + bsendmsg(ua, _("ERR: Job was not found\n")); + return 1 ; + } + + /* + * We wait the end of job + */ + bmicrosleep(0, 200000); /* let job actually start */ for (bool running=true; running; ) { running = false; - foreach_jcr(jcr) { - if (jcr->JobId != 0) { - running = true; - break; - } + + jcr=get_jcr_by_id(jobid) ; + + if (jcr) { + running = true ; + free_jcr(jcr); } - endeach_jcr(jcr); if (running) { bmicrosleep(1, 0); } } + + /* + * We have to get JobStatus + */ + + int status ; + char jobstatus = '?'; /* Unknown by default */ + char buf[256] ; + + bsnprintf(buf, sizeof(buf), + "SELECT JobStatus FROM Job WHERE JobId='%i'", jobid); + + + db_sql_query(ua->db, buf, + status_handler, (void *)&jobstatus); + + switch (jobstatus) { + case JS_Error: + status = 1 ; /* Warning */ + break; + + case JS_FatalError: + case JS_ErrorTerminated: + case JS_Canceled: + status = 2 ; /* Critical */ + break; + + case JS_Terminated: + status = 0 ; /* Ok */ + break; + + default: + status = 3 ; /* Unknown */ + break; + } + + bsendmsg(ua, "JobId=%i\n", jobid) ; + bsendmsg(ua, "JobStatus=%s (%c)\n", + job_status_to_str(jobstatus), + jobstatus) ; + + if (ua->gui) { + bsendmsg(ua, "ExitStatus=%i\n", status) ; + } + return 1; } @@ -1449,10 +1588,10 @@ static int version_cmd(UAContext *ua, const char *cmd) * a "use catalog xxx" command, we simply find the first * catalog resource and open it. */ -int open_db(UAContext *ua) +bool open_db(UAContext *ua) { if (ua->db) { - return 1; + return true; } if (!ua->catalog) { LockRes(); @@ -1460,7 +1599,11 @@ int open_db(UAContext *ua) UnlockRes(); if (!ua->catalog) { bsendmsg(ua, _("Could not find a Catalog resource\n")); - return 0; + return false; + } else if (!acl_access_ok(ua, Catalog_ACL, ua->catalog->hdr.name)) { + bsendmsg(ua, _("You must specify a \"use \" command before continuing.\n")); + ua->catalog = NULL; + return false; } else { bsendmsg(ua, _("Using default Catalog name=%s DB=%s\n"), ua->catalog->hdr.name, ua->catalog->db_name); @@ -1481,11 +1624,11 @@ int open_db(UAContext *ua) bsendmsg(ua, "%s", db_strerror(ua->db)); } close_db(ua); - return 0; + return false; } ua->jcr->db = ua->db; Dmsg1(150, "DB %s opened\n", ua->catalog->db_name); - return 1; + return true; } void close_db(UAContext *ua) diff --git a/bacula/src/dird/ua_dotcmds.c b/bacula/src/dird/ua_dotcmds.c index e426ed8969..60f9c62e09 100644 --- a/bacula/src/dird/ua_dotcmds.c +++ b/bacula/src/dird/ua_dotcmds.c @@ -37,7 +37,7 @@ extern const char *client_backups; extern int console_msg_pending; /* Imported functions */ -extern int do_messages(UAContext *ua, const char *cmd); +extern void do_messages(UAContext *ua, const char *cmd); extern int quit_cmd(UAContext *ua, const char *cmd); extern int qhelp_cmd(UAContext *ua, const char *cmd); extern int qstatus_cmd(UAContext *ua, const char *cmd); @@ -139,7 +139,9 @@ static int jobscmd(UAContext *ua, const char *cmd) JOB *job = NULL; LockRes(); while ( (job = (JOB *)GetNextRes(R_JOB, (RES *)job)) ) { - bsendmsg(ua, "%s\n", job->hdr.name); + if (acl_access_ok(ua, Job_ACL, job->hdr.name)) { + bsendmsg(ua, "%s\n", job->hdr.name); + } } UnlockRes(); return 1; @@ -150,7 +152,9 @@ static int filesetscmd(UAContext *ua, const char *cmd) FILESET *fs = NULL; LockRes(); while ( (fs = (FILESET *)GetNextRes(R_FILESET, (RES *)fs)) ) { - bsendmsg(ua, "%s\n", fs->hdr.name); + if (acl_access_ok(ua, FileSet_ACL, fs->hdr.name)) { + bsendmsg(ua, "%s\n", fs->hdr.name); + } } UnlockRes(); return 1; @@ -161,7 +165,9 @@ static int clientscmd(UAContext *ua, const char *cmd) CLIENT *client = NULL; LockRes(); while ( (client = (CLIENT *)GetNextRes(R_CLIENT, (RES *)client)) ) { - bsendmsg(ua, "%s\n", client->hdr.name); + if (acl_access_ok(ua, Client_ACL, client->hdr.name)) { + bsendmsg(ua, "%s\n", client->hdr.name); + } } UnlockRes(); return 1; @@ -183,7 +189,9 @@ static int poolscmd(UAContext *ua, const char *cmd) POOL *pool = NULL; LockRes(); while ( (pool = (POOL *)GetNextRes(R_POOL, (RES *)pool)) ) { - bsendmsg(ua, "%s\n", pool->hdr.name); + if (acl_access_ok(ua, Pool_ACL, pool->hdr.name)) { + bsendmsg(ua, "%s\n", pool->hdr.name); + } } UnlockRes(); return 1; @@ -194,7 +202,9 @@ static int storagecmd(UAContext *ua, const char *cmd) STORE *store = NULL; LockRes(); while ( (store = (STORE *)GetNextRes(R_STORAGE, (RES *)store)) ) { - bsendmsg(ua, "%s\n", store->hdr.name); + if (acl_access_ok(ua, Storage_ACL, store->hdr.name)) { + bsendmsg(ua, "%s\n", store->hdr.name); + } } UnlockRes(); return 1; @@ -226,6 +236,10 @@ static int backupscmd(UAContext *ua, const char *cmd) if (ua->argc != 3 || strcmp(ua->argk[1], "client") != 0 || strcmp(ua->argk[2], "fileset") != 0) { return 1; } + if (!acl_access_ok(ua, Client_ACL, ua->argv[1]) || + !acl_access_ok(ua, FileSet_ACL, ua->argv[2])) { + return 1; + } Mmsg(ua->cmd, client_backups, ua->argv[1], ua->argv[2]); if (!db_sql_query(ua->db, ua->cmd, client_backups_handler, (void *)ua)) { bsendmsg(ua, _("Query failed: %s. ERR=%s\n"), ua->cmd, db_strerror(ua->db)); @@ -246,8 +260,6 @@ static int levelscmd(UAContext *ua, const char *cmd) return 1; } - - /* * Return default values for a job */ @@ -264,6 +276,9 @@ static int defaultscmd(UAContext *ua, const char *cmd) /* Job defaults */ if (strcmp(ua->argk[1], "job") == 0) { + if (!acl_access_ok(ua, Job_ACL, ua->argv[1])) { + return 1; + } job = (JOB *)GetResWithName(R_JOB, ua->argv[1]); if (job) { STORE *store; @@ -282,6 +297,9 @@ static int defaultscmd(UAContext *ua, const char *cmd) } /* Client defaults */ else if (strcmp(ua->argk[1], "client") == 0) { + if (!acl_access_ok(ua, Client_ACL, ua->argv[1])) { + return 1; + } client = (CLIENT *)GetResWithName(R_CLIENT, ua->argv[1]); if (client) { bsendmsg(ua, "client=%s", client->hdr.name); @@ -294,6 +312,9 @@ static int defaultscmd(UAContext *ua, const char *cmd) } /* Storage defaults */ else if (strcmp(ua->argk[1], "storage") == 0) { + if (!acl_access_ok(ua, Storage_ACL, ua->argv[1])) { + return 1; + } storage = (STORE *)GetResWithName(R_STORAGE, ua->argv[1]); DEVICE *device; if (storage) { @@ -312,6 +333,9 @@ static int defaultscmd(UAContext *ua, const char *cmd) } /* Pool defaults */ else if (strcmp(ua->argk[1], "pool") == 0) { + if (!acl_access_ok(ua, Pool_ACL, ua->argv[1])) { + return 1; + } pool = (POOL *)GetResWithName(R_POOL, ua->argv[1]); if (pool) { bsendmsg(ua, "pool=%s", pool->hdr.name); diff --git a/bacula/src/dird/ua_output.c b/bacula/src/dird/ua_output.c index c3f1ac1883..e4a4c07bd2 100644 --- a/bacula/src/dird/ua_output.c +++ b/bacula/src/dird/ua_output.c @@ -202,7 +202,9 @@ bail_out: * * list jobs - lists all jobs run * list jobid=nnn - list job data for jobid - * list job=name - list job data for job + * list ujobid=uname - list job data for unique jobid + * list job=name - list all jobs with "name" + * list jobname=name - same as above * list jobmedia jobid= * list jobmedia job=name * list files jobid= - list files saved for job nn @@ -277,23 +279,23 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) } /* List JOB=xxx */ - } else if (strcasecmp(ua->argk[i], N_("job")) == 0 && ua->argv[i]) { - bstrncpy(jr.Job, ua->argv[i], MAX_NAME_LENGTH); + } else if ((strcasecmp(ua->argk[i], N_("job")) == 0 || + strcasecmp(ua->argk[i], N_("jobname")) == 0) && ua->argv[i]) { + bstrncpy(jr.Name, ua->argv[i], MAX_NAME_LENGTH); jr.JobId = 0; db_list_job_records(ua->jcr, ua->db, &jr, prtit, ua, llist); - /* List JOBNAME=xxx */ - } else if (strcasecmp(ua->argk[i], N_("job")) == 0 && ua->argv[i]) { - bstrncpy(jr.Name, ua->argv[i], MAX_NAME_LENGTH); + /* List UJOBID=xxx */ + } else if (strcasecmp(ua->argk[i], N_("ujobid")) == 0 && ua->argv[i]) { + bstrncpy(jr.Job, ua->argv[i], MAX_NAME_LENGTH); jr.JobId = 0; db_list_job_records(ua->jcr, ua->db, &jr, prtit, ua, llist); - /* List FILES */ } else if (strcasecmp(ua->argk[i], N_("files")) == 0) { for (j=i+1; jargc; j++) { - if (strcasecmp(ua->argk[j], N_("job")) == 0 && ua->argv[j]) { + if (strcasecmp(ua->argk[j], N_("ujobid")) == 0 && ua->argv[j]) { bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH); jr.JobId = 0; db_get_job_record(ua->jcr, ua->db, &jr); @@ -312,7 +314,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) } else if (strcasecmp(ua->argk[i], N_("jobmedia")) == 0) { int done = FALSE; for (j=i+1; jargc; j++) { - if (strcasecmp(ua->argk[j], N_("job")) == 0 && ua->argv[j]) { + if (strcasecmp(ua->argk[j], N_("ujobid")) == 0 && ua->argv[j]) { bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH); jr.JobId = 0; db_get_job_record(ua->jcr, ua->db, &jr); @@ -350,7 +352,7 @@ static int do_list_cmd(UAContext *ua, const char *cmd, e_list_type llist) strcasecmp(ua->argk[i], N_("volumes")) == 0) { bool done = false; for (j=i+1; jargc; j++) { - if (strcasecmp(ua->argk[j], N_("job")) == 0 && ua->argv[j]) { + if (strcasecmp(ua->argk[j], N_("ujobid")) == 0 && ua->argv[j]) { bstrncpy(jr.Job, ua->argv[j], MAX_NAME_LENGTH); jr.JobId = 0; db_get_job_record(ua->jcr, ua->db, &jr); @@ -463,15 +465,18 @@ static bool list_nextvol(UAContext *ua, int ndays) if (!complete_jcr_for_job(jcr, job, pool)) { return false; } - mr.PoolId = jcr->jr.PoolId; - if (run->storage) { - jcr->store = run->storage; - } memset(&pr, 0, sizeof(pr)); - pr.PoolId = jcr->jr.PoolId; + pr.PoolId = jcr->PoolId; if (! db_get_pool_record(ua->jcr, ua->db, &pr)) { strcpy(pr.Name, "*UnknownPool*"); } + mr.PoolId = jcr->PoolId; + if (run->storage) { + jcr->store = run->storage; + } else { + jcr->store = (STORE *)job->storage->first(); + } + mr.StorageId = jcr->store->StorageId; if (!find_next_volume_for_append(jcr, &mr, 1, false/*no create*/)) { bsendmsg(ua, _("Could not find next Volume for Job %s (%s, %s).\n"), job->hdr.name, pr.Name, level_to_str(run->level)); @@ -626,6 +631,7 @@ int complete_jcr_for_job(JCR *jcr, JOB *job, POOL *pool) Jmsg(jcr, M_INFO, 0, _("Pool %s created in database.\n"), pr.Name); } } + jcr->PoolId = pr.PoolId; jcr->jr.PoolId = pr.PoolId; return 1; } diff --git a/bacula/src/dird/ua_prune.c b/bacula/src/dird/ua_prune.c index 137462ddb0..f7a40c166b 100644 --- a/bacula/src/dird/ua_prune.c +++ b/bacula/src/dird/ua_prune.c @@ -163,7 +163,7 @@ int prunecmd(UAContext *ua, const char *cmd) NULL}; if (!open_db(ua)) { - return false; + return 0; } /* First search args */ @@ -177,32 +177,32 @@ int prunecmd(UAContext *ua, const char *cmd) case 0: /* prune files */ client = get_client_resource(ua); if (!client || !confirm_retention(ua, &client->FileRetention, "File")) { - return false; + return 0; } prune_files(ua, client); - return true; + return 1; case 1: /* prune jobs */ client = get_client_resource(ua); if (!client || !confirm_retention(ua, &client->JobRetention, "Job")) { - return false; + return 0; } /* ****FIXME**** allow user to select JobType */ prune_jobs(ua, client, JT_BACKUP); return 1; case 2: /* prune volume */ if (!select_pool_and_media_dbr(ua, &pr, &mr)) { - return false; + return 0; } if (!confirm_retention(ua, &mr.VolRetention, "Volume")) { - return false; + return 0; } prune_volume(ua, &mr); - return true; + return 1; default: break; } - return true; + return 1; } /* @@ -240,7 +240,7 @@ int prune_files(UAContext *ua, CLIENT *client) /* Select Jobs -- for counting */ Mmsg(query, select_job, edit_uint64(now - period, ed1), edit_int64(cr.ClientId, ed2)); - Dmsg3(050, "select now=%u period=%u sql=%s\n", (uint32_t)now, (uint32_t)period, query); + Dmsg1(050, "select sql=%s\n", query); if (!db_sql_query(ua->db, query, file_count_handler, (void *)&del)) { if (ua->verbose) { bsendmsg(ua, "%s", db_strerror(ua->db)); @@ -270,7 +270,7 @@ int prune_files(UAContext *ua, CLIENT *client) for (i=0; i < del.num_ids; i++) { Mmsg(query, del_File, edit_int64(del.JobId[i], ed1)); - Dmsg1(000, "Delete Files JobId=%s\n", ed1); + Dmsg1(050, "Delete JobId=%s\n", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); /* * Now mark Job as having files purged. This is necessary to @@ -280,7 +280,7 @@ int prune_files(UAContext *ua, CLIENT *client) */ Mmsg(query, upd_Purged, edit_int64(del.JobId[i], ed1)); db_sql_query(ua->db, query, NULL, (void *)NULL); - Dmsg1(000, "Update Purged sql=%s\n", query); + Dmsg1(050, "Del sql=%s\n", query); } edit_uint64_with_commas(del.num_ids, ed1); bsendmsg(ua, _("Pruned Files from %s Jobs for client %s from catalog.\n"), @@ -304,7 +304,7 @@ static void drop_temp_tables(UAContext *ua) } } -static bool create_temp_tables(UAContext *ua) +static int create_temp_tables(UAContext *ua) { int i; /* Create temp tables and indicies */ @@ -312,10 +312,10 @@ static bool create_temp_tables(UAContext *ua) if (!db_sql_query(ua->db, create_deltabs[i], NULL, (void *)NULL)) { bsendmsg(ua, "%s", db_strerror(ua->db)); Dmsg0(050, "create DelTables table failed\n"); - return false; + return 0; } } - return true; + return 1; } diff --git a/bacula/src/dird/ua_purge.c b/bacula/src/dird/ua_purge.c index 5661d1db72..fb1874695c 100644 --- a/bacula/src/dird/ua_purge.c +++ b/bacula/src/dird/ua_purge.c @@ -11,7 +11,7 @@ * Version $Id$ */ /* - Copyright (C) 2002-2006 Kern Sibbald + Copyright (C) 2002-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -267,7 +267,7 @@ int purgecmd(UAContext *ua, const char *cmd) static int purge_files_from_client(UAContext *ua, CLIENT *client) { struct s_file_del_ctx del; - POOLMEM *query = get_pool_memory(PM_MESSAGE); + char *query = (char *)get_pool_memory(PM_MESSAGE); int i; CLIENT_DBR cr; char ed1[50]; @@ -309,7 +309,7 @@ static int purge_files_from_client(UAContext *ua, CLIENT *client) for (i=0; i < del.num_ids; i++) { edit_int64(del.JobId[i], ed1); - Dmsg1(050, "Delete Files JobId=%s\n", ed1); + Dmsg1(050, "Delete JobId=%s\n", ed1); Mmsg(query, "DELETE FROM File WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); /* @@ -320,7 +320,7 @@ static int purge_files_from_client(UAContext *ua, CLIENT *client) */ Mmsg(query, "UPDATE Job Set PurgedFiles=1 WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); - Dmsg1(050, "Update Purged sql=%s\n", query); + Dmsg1(050, "Del sql=%s\n", query); } bsendmsg(ua, _("%d Files for client \"%s\" purged from %s catalog.\n"), del.num_ids, client->hdr.name, client->catalog->hdr.name); @@ -340,12 +340,13 @@ bail_out: * is older than the retention period, we unconditionally delete * it and all File records for that Job. This is simple enough that no * temporary tables are needed. We simply make an in memory list of - * the JobIds then delete the Job, Files, and JobMedia records in that list. + * the JobIds meeting the prune conditions, then delete the Job, + * Files, and JobMedia records in that list. */ static int purge_jobs_from_client(UAContext *ua, CLIENT *client) { struct s_job_del_ctx del; - POOLMEM *query = get_pool_memory(PM_MESSAGE); + char *query = (char *)get_pool_memory(PM_MESSAGE); int i; CLIENT_DBR cr; char ed1[50]; @@ -394,7 +395,7 @@ static int purge_jobs_from_client(UAContext *ua, CLIENT *client) */ for (i=0; i < del.num_ids; i++) { edit_int64(del.JobId[i], ed1); - Dmsg1(050, "Delete Files JobId=%s\n", ed1); + Dmsg1(050, "Delete JobId=%s\n", ed1); if (!del.PurgedFiles[i]) { Mmsg(query, "DELETE FROM File WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); @@ -403,15 +404,11 @@ static int purge_jobs_from_client(UAContext *ua, CLIENT *client) Mmsg(query, "DELETE FROM Job WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); - Dmsg1(050, "Delete Job sql=%s\n", query); - - Mmsg(query, "DELETE FROM MAC WHERE JobId=%s", ed1); - db_sql_query(ua->db, query, NULL, (void *)NULL); - Dmsg1(050, "Delete MAC sql=%s\n", query); + Dmsg1(050, "Del sql=%s\n", query); Mmsg(query, "DELETE FROM JobMedia WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); - Dmsg1(050, "Delete JobMedia sql=%s\n", query); + Dmsg1(050, "Del sql=%s\n", query); } bsendmsg(ua, _("%d Jobs for client %s purged from %s catalog.\n"), del.num_ids, client->hdr.name, client->catalog->hdr.name); @@ -429,10 +426,10 @@ bail_out: void purge_files_from_job(UAContext *ua, JOB_DBR *jr) { - POOLMEM *query = get_pool_memory(PM_MESSAGE); + char *query = (char *)get_pool_memory(PM_MESSAGE); char ed1[50]; - edit_int64(jr->JobId, ed1); + edit_int64(jr->JobId,ed1); Mmsg(query, "DELETE FROM File WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); @@ -451,7 +448,7 @@ void purge_files_from_volume(UAContext *ua, MEDIA_DBR *mr ) */ int purge_jobs_from_volume(UAContext *ua, MEDIA_DBR *mr) { - POOLMEM *query = get_pool_memory(PM_MESSAGE); + char *query = (char *)get_pool_memory(PM_MESSAGE); struct s_count_ctx cnt; struct s_file_del_ctx del; int i, stat = 0; @@ -527,8 +524,6 @@ int purge_jobs_from_volume(UAContext *ua, MEDIA_DBR *mr) db_sql_query(ua->db, query, NULL, (void *)NULL); Mmsg(query, "DELETE FROM Job WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); - Mmsg(query, "DELETE FROM MAC WHERE JobId=%s", ed1); - db_sql_query(ua->db, query, NULL, (void *)NULL); Mmsg(query, "DELETE FROM JobMedia WHERE JobId=%s", ed1); db_sql_query(ua->db, query, NULL, (void *)NULL); Dmsg1(050, "Del sql=%s\n", query); @@ -585,5 +580,5 @@ bool mark_media_purged(UAContext *ua, MEDIA_DBR *mr) } else { bsendmsg(ua, _("Cannot purge Volume with VolStatus=%s\n"), mr->VolStatus); } - return strcmp(mr->VolStatus, "Purged") == 0; + return strcpy(mr->VolStatus, "Purged") == 0; } diff --git a/bacula/src/dird/ua_restore.c b/bacula/src/dird/ua_restore.c index 9fd21a4e72..1ba9dab5e6 100644 --- a/bacula/src/dird/ua_restore.c +++ b/bacula/src/dird/ua_restore.c @@ -13,7 +13,7 @@ * Version $Id$ */ /* - Copyright (C) 2002-2005 Kern Sibbald + Copyright (C) 2002-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -81,7 +81,7 @@ int restore_cmd(UAContext *ua, const char *cmd) RESTORE_CTX rx; /* restore context */ JOB *job; int i; - POOLMEM *fname; + JCR *jcr = ua->jcr; memset(&rx, 0, sizeof(rx)); rx.path = get_pool_memory(PM_FNAME); @@ -177,22 +177,19 @@ int restore_cmd(UAContext *ua, const char *cmd) } /* Build run command */ - fname = get_pool_memory(PM_MESSAGE); - make_unique_restore_filename(ua, &fname); if (rx.where) { Mmsg(ua->cmd, "run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s\"" " where=\"%s\" files=%d catalog=\"%s\"", job->hdr.name, rx.ClientName, rx.store?rx.store->hdr.name:"", - fname, rx.where, rx.selected_files, ua->catalog->hdr.name); + jcr->RestoreBootstrap, rx.where, rx.selected_files, ua->catalog->hdr.name); } else { Mmsg(ua->cmd, "run job=\"%s\" client=\"%s\" storage=\"%s\" bootstrap=\"%s\"" " files=%d catalog=\"%s\"", job->hdr.name, rx.ClientName, rx.store?rx.store->hdr.name:"", - fname, rx.selected_files, ua->catalog->hdr.name); + jcr->RestoreBootstrap, rx.selected_files, ua->catalog->hdr.name); } - free_pool_memory(fname); if (find_arg(ua, N_("yes")) > 0) { pm_strcat(ua->cmd, " yes"); /* pass it on to the run command */ } @@ -1153,7 +1150,14 @@ bail_out: } -/* Return next JobId from comma separated list */ +/* + * Return next JobId from comma separated list + * + * Returns: + * 1 if next JobId returned + * 0 if no more JobIds are in list + * -1 there is an error + */ int get_next_jobid_from_list(char **p, JobId_t *JobId) { char jobid[30]; diff --git a/bacula/src/dird/ua_run.c b/bacula/src/dird/ua_run.c index 470cd5bd96..189bb48c34 100644 --- a/bacula/src/dird/ua_run.c +++ b/bacula/src/dird/ua_run.c @@ -34,7 +34,7 @@ extern struct s_kw ReplaceOptions[]; * run [job=] level= * * For Restore Jobs - * run + * run jobid=nn * * Returns: 0 on error * JobId if OK @@ -47,16 +47,13 @@ int run_cmd(UAContext *ua, const char *cmd) char *where, *fileset_name, *client_name, *bootstrap; const char *replace; char *when, *verify_job_name, *catalog_name; - char *migration_job_name; char *since = NULL; - char *verify_list; bool cloned = false; int Priority = 0; int i, j, opt, files = 0; bool kw_ok; JOB *job = NULL; JOB *verify_job = NULL; - JOB *migration_job = NULL; STORE *store = NULL; CLIENT *client = NULL; FILESET *fileset = NULL; @@ -82,8 +79,6 @@ int run_cmd(UAContext *ua, const char *cmd) "catalog", /* 17 override catalog */ "since", /* 18 since */ "cloned", /* 19 cloned */ - "verifylist", /* 20 verify output list */ - "migrationjob", /* 21 migration job name */ NULL}; #define YES_POS 14 @@ -104,9 +99,7 @@ int run_cmd(UAContext *ua, const char *cmd) bootstrap = NULL; replace = NULL; verify_job_name = NULL; - migration_job_name = NULL; catalog_name = NULL; - verify_list = NULL; for (i=1; iargc; i++) { Dmsg2(800, "Doing arg %d = %s\n", i, ua->argk[i]); @@ -254,20 +247,6 @@ int run_cmd(UAContext *ua, const char *cmd) kw_ok = true; break; - case 20: /* write verify list output */ - verify_list = ua->argv[i]; - kw_ok = true; - break; - case 21: /* Migration Job */ - if (migration_job_name) { - bsendmsg(ua, _("Migration Job specified twice.\n")); - return 0; - } - migration_job_name = ua->argv[i]; - kw_ok = true; - break; - - default: break; } @@ -414,17 +393,6 @@ int run_cmd(UAContext *ua, const char *cmd) verify_job = job->verify_job; } - if (migration_job_name) { - migration_job = (JOB *)GetResWithName(R_JOB, migration_job_name); - if (!migration_job) { - bsendmsg(ua, _("Migration Job \"%s\" not found.\n"), migration_job_name); - migration_job = select_job_resource(ua); - } - } else { - migration_job = job->verify_job; - } - - /* * Create JCR to run job. NOTE!!! after this point, free_jcr() * before returning. @@ -433,7 +401,6 @@ int run_cmd(UAContext *ua, const char *cmd) set_jcr_defaults(jcr, job); jcr->verify_job = verify_job; - jcr->migration_job = migration_job; set_storage(jcr, store); jcr->client = client; jcr->fileset = fileset; @@ -574,12 +541,6 @@ try_again: } else { Name = ""; } - if (!verify_list) { - verify_list = job->WriteVerifyList; - } - if (!verify_list) { - verify_list = ""; - } bsendmsg(ua, _("Run %s job\n" "JobName: %s\n" "FileSet: %s\n" @@ -588,7 +549,6 @@ try_again: "Storage: %s\n" "Pool: %s\n" "Verify Job: %s\n" -"Verify List: %s\n" "When: %s\n" "Priority: %d\n"), _("Verify"), @@ -599,7 +559,6 @@ try_again: jcr->store->hdr.name, NPRT(jcr->pool->hdr.name), Name, - verify_list, bstrutime(dt, sizeof(dt), jcr->sched_time), jcr->JobPriority); } @@ -663,37 +622,12 @@ try_again: jcr->JobPriority); } break; - case JT_MIGRATE: - jcr->JobLevel = L_FULL; /* default level */ - bsendmsg(ua, _("Run Restore job\n" - "JobName: %s\n" - "Bootstrap: %s\n" - "Where: %s\n" - "Replace: %s\n" - "FileSet: %s\n" - "Client: %s\n" - "Storage: %s\n" - "Migration Job: %s\n" - "When: %s\n" - "Catalog: %s\n" - "Priority: %d\n"), - job->hdr.name, - NPRT(jcr->RestoreBootstrap), - jcr->where?jcr->where:NPRT(job->RestoreWhere), - replace, - jcr->fileset->hdr.name, - jcr->client->hdr.name, - jcr->store->hdr.name, - jcr->migration_job->hdr.name, - bstrutime(dt, sizeof(dt), jcr->sched_time), - jcr->catalog->hdr.name, - jcr->JobPriority); - break; default: bsendmsg(ua, _("Unknown Job Type=%d\n"), jcr->JobType); goto bail_out; } + if (!get_cmd(ua, _("OK to run? (yes/mod/no): "))) { goto bail_out; } diff --git a/bacula/src/dird/ua_select.c b/bacula/src/dird/ua_select.c index 17f9e1de7f..451e9ec8c3 100644 --- a/bacula/src/dird/ua_select.c +++ b/bacula/src/dird/ua_select.c @@ -626,7 +626,7 @@ int get_job_dbr(UAContext *ua, JOB_DBR *jr) int i; for (i=1; iargc; i++) { - if (strcasecmp(ua->argk[i], N_("job")) == 0 && ua->argv[i]) { + if (strcasecmp(ua->argk[i], N_("ujobid")) == 0 && ua->argv[i]) { jr->JobId = 0; bstrncpy(jr->Job, ua->argv[i], sizeof(jr->Job)); } else if (strcasecmp(ua->argk[i], N_("jobid")) == 0 && ua->argv[i]) { @@ -648,7 +648,8 @@ int get_job_dbr(UAContext *ua, JOB_DBR *jr) jr->Job[0] = 0; for (i=1; iargc; i++) { - if (strcasecmp(ua->argk[i], N_("jobname")) == 0 && ua->argv[i]) { + if ((strcasecmp(ua->argk[i], N_("jobname")) == 0 || + strcasecmp(ua->argk[i], N_("job")) == 0) && ua->argv[i]) { jr->JobId = 0; bstrncpy(jr->Name, ua->argv[i], sizeof(jr->Name)); break; @@ -831,7 +832,8 @@ STORE *get_storage_resource(UAContext *ua, bool use_default) free_jcr(jcr); break; - } else if (strcasecmp(ua->argk[i], N_("job")) == 0) { + } else if (strcasecmp(ua->argk[i], N_("job")) == 0 || + strcasecmp(ua->argk[i], N_("jobname")) == 0) { if (!ua->argv[i]) { bsendmsg(ua, _("Expecting job=xxx, got: %s.\n"), ua->argk[i]); return NULL; @@ -843,6 +845,18 @@ STORE *get_storage_resource(UAContext *ua, bool use_default) store = jcr->store; free_jcr(jcr); break; + } else if (strcasecmp(ua->argk[i], N_("ujobid")) == 0) { + if (!ua->argv[i]) { + bsendmsg(ua, _("Expecting ujobid=xxx, got: %s.\n"), ua->argk[i]); + return NULL; + } + if (!(jcr=get_jcr_by_full_name(ua->argv[i]))) { + bsendmsg(ua, _("Job \"%s\" is not running.\n"), ua->argv[i]); + return NULL; + } + store = jcr->store; + free_jcr(jcr); + break; } } } diff --git a/bacula/src/dird/ua_status.c b/bacula/src/dird/ua_status.c index 84138f31b0..16b9581cf6 100644 --- a/bacula/src/dird/ua_status.c +++ b/bacula/src/dird/ua_status.c @@ -360,6 +360,7 @@ struct sched_pkt { int priority; time_t runtime; POOL *pool; + STORE *store; }; static void prt_runtime(UAContext *ua, sched_pkt *sp) @@ -379,7 +380,8 @@ static void prt_runtime(UAContext *ua, sched_pkt *sp) close_db = true; /* new db opened, remember to close it */ } if (ok) { - mr.PoolId = jcr->jr.PoolId; + mr.PoolId = jcr->PoolId; + mr.StorageId = sp->store->StorageId; ok = find_next_volume_for_append(jcr, &mr, 1, false/*no create*/); } if (!ok) { @@ -435,6 +437,7 @@ static void list_scheduled_jobs(UAContext *ua) time_t runtime; RUN *run; JOB *job; + STORE* store; int level, num_jobs = 0; int priority; bool hdr_printed = false; @@ -469,6 +472,11 @@ static void list_scheduled_jobs(UAContext *ua) if (run->Priority) { priority = run->Priority; } + if (run->storage) { + store = run->storage; + } else { + store = (STORE *)job->storage->first(); + } if (!hdr_printed) { prt_runhdr(ua); hdr_printed = true; @@ -479,6 +487,7 @@ static void list_scheduled_jobs(UAContext *ua) sp->priority = priority; sp->runtime = runtime; sp->pool = run->pool; + sp->store = store; sched.binary_insert_multiple(sp, my_compare); num_jobs++; } diff --git a/bacula/src/dird/verify.c b/bacula/src/dird/verify.c index 45b0246a58..7d2867343d 100644 --- a/bacula/src/dird/verify.c +++ b/bacula/src/dird/verify.c @@ -43,7 +43,6 @@ static char storaddr[] = "storage address=%s port=%d ssl=0\n"; /* Responses received from File daemon */ static char OKverify[] = "2000 OK verify\n"; static char OKstore[] = "2000 OK storage\n"; -static char OKbootstrap[] = "2000 OK bootstrap\n"; /* Forward referenced functions */ static void prt_fname(JCR *jcr); @@ -60,7 +59,7 @@ bool do_verify_init(JCR *jcr) JobId_t verify_jobid = 0; const char *Name; - memset(&jcr->target_jr, 0, sizeof(jcr->target_jr)); + memset(&jcr->previous_jr, 0, sizeof(jcr->previous_jr)); Dmsg1(9, "bdird: created client %s record\n", jcr->client->hdr.name); @@ -104,19 +103,19 @@ bool do_verify_init(JCR *jcr) if (jcr->JobLevel == L_VERIFY_CATALOG || jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG || jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG) { - jcr->target_jr.JobId = verify_jobid; - if (!db_get_job_record(jcr, jcr->db, &jcr->target_jr)) { + jcr->previous_jr.JobId = verify_jobid; + if (!db_get_job_record(jcr, jcr->db, &jcr->previous_jr)) { Jmsg(jcr, M_FATAL, 0, _("Could not get job record for previous Job. ERR=%s"), db_strerror(jcr->db)); return false; } - if (jcr->target_jr.JobStatus != 'T') { + if (jcr->previous_jr.JobStatus != 'T') { Jmsg(jcr, M_FATAL, 0, _("Last Job %d did not terminate normally. JobStatus=%c\n"), - verify_jobid, jcr->target_jr.JobStatus); + verify_jobid, jcr->previous_jr.JobStatus); return false; } Jmsg(jcr, M_INFO, 0, _("Verifying against JobId=%d Job=%s\n"), - jcr->target_jr.JobId, jcr->target_jr.Job); + jcr->previous_jr.JobId, jcr->previous_jr.Job); } /* @@ -126,9 +125,27 @@ bool do_verify_init(JCR *jcr) * File daemon but not used). */ if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG) { - if (!create_restore_bootstrap_file(jcr)) { + RESTORE_CTX rx; + UAContext *ua; + memset(&rx, 0, sizeof(rx)); + rx.bsr = new_bsr(); + rx.JobIds = ""; + rx.bsr->JobId = jcr->previous_jr.JobId; + ua = new_ua_context(jcr); + complete_bsr(ua, rx.bsr); + rx.bsr->fi = new_findex(); + rx.bsr->fi->findex = 1; + rx.bsr->fi->findex2 = jcr->previous_jr.JobFiles; + jcr->ExpectedFiles = write_bsr_file(ua, rx); + if (jcr->ExpectedFiles == 0) { + free_ua_context(ua); + free_bsr(rx.bsr); return false; } + free_ua_context(ua); + free_bsr(rx.bsr); + jcr->needs_sd = true; + } else { jcr->sd_auth_key = bstrdup("dummy"); /* dummy Storage daemon key */ } @@ -136,7 +153,7 @@ bool do_verify_init(JCR *jcr) if (jcr->JobLevel == L_VERIFY_DISK_TO_CATALOG && jcr->verify_job) { jcr->fileset = jcr->verify_job->fileset; } - Dmsg2(100, "ClientId=%u JobLevel=%c\n", jcr->target_jr.ClientId, jcr->JobLevel); + Dmsg2(100, "ClientId=%u JobLevel=%c\n", jcr->previous_jr.ClientId, jcr->JobLevel); return true; } @@ -238,8 +255,7 @@ bool do_verify(JCR *jcr) /* * Send the bootstrap file -- what Volumes/files to restore */ - if (!send_bootstrap_file(jcr, fd) || - !response(jcr, fd, OKbootstrap, "Bootstrap", DISPLAY_ERROR)) { + if (!send_bootstrap_file(jcr)) { return false; } @@ -285,19 +301,19 @@ bool do_verify(JCR *jcr) Dmsg0(10, "Verify level=catalog\n"); jcr->sd_msg_thread_done = true; /* no SD msg thread, so it is done */ jcr->SDJobStatus = JS_Terminated; - get_attributes_and_compare_to_catalog(jcr, jcr->target_jr.JobId); + get_attributes_and_compare_to_catalog(jcr, jcr->previous_jr.JobId); break; case L_VERIFY_VOLUME_TO_CATALOG: Dmsg0(10, "Verify level=volume\n"); - get_attributes_and_compare_to_catalog(jcr, jcr->target_jr.JobId); + get_attributes_and_compare_to_catalog(jcr, jcr->previous_jr.JobId); break; case L_VERIFY_DISK_TO_CATALOG: Dmsg0(10, "Verify level=disk_to_catalog\n"); jcr->sd_msg_thread_done = true; /* no SD msg thread, so it is done */ jcr->SDJobStatus = JS_Terminated; - get_attributes_and_compare_to_catalog(jcr, jcr->target_jr.JobId); + get_attributes_and_compare_to_catalog(jcr, jcr->previous_jr.JobId); break; case L_VERIFY_INIT: @@ -421,7 +437,7 @@ void verify_cleanup(JCR *jcr, int TermCode) jcr->fileset->hdr.name, level_to_str(jcr->JobLevel), jcr->client->hdr.name, - jcr->target_jr.JobId, + jcr->previous_jr.JobId, Name, sdt, edt, @@ -454,7 +470,7 @@ void verify_cleanup(JCR *jcr, int TermCode) jcr->fileset->hdr.name, level_to_str(jcr->JobLevel), jcr->client->hdr.name, - jcr->target_jr.JobId, + jcr->previous_jr.JobId, Name, sdt, edt, @@ -479,7 +495,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) int stat = JS_Terminated; char buf[MAXSTRING]; POOLMEM *fname = get_pool_memory(PM_MESSAGE); - int do_Digest = CRYPTO_DIGEST_NONE; + int do_SIG = NO_SIG; int32_t file_index = 0; memset(&fdbr, 0, sizeof(FILE_DBR)); @@ -493,7 +509,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) * We expect: * FileIndex * Stream - * Options or Digest (MD5/SHA1) + * Options or SIG (MD5/SHA1) * Filename * Attributes * Link name ??? @@ -501,11 +517,11 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) while ((n=bget_dirmsg(fd)) >= 0 && !job_canceled(jcr)) { int stream; char *attr, *p, *fn; - char Opts_Digest[MAXSTRING]; /* Verify Opts or MD5/SHA1 digest */ + char Opts_SIG[MAXSTRING]; /* Verify Opts or MD5/SHA1 signature */ fname = check_pool_memory_size(fname, fd->msglen); jcr->fname = check_pool_memory_size(jcr->fname, fd->msglen); - Dmsg1(200, "Atts+Digest=%s\n", fd->msg); + Dmsg1(200, "Atts+SIG=%s\n", fd->msg); if ((len = sscanf(fd->msg, "%ld %d %100s", &file_index, &stream, fname)) != 3) { Jmsg3(jcr, M_FATAL, 0, _("birdmsg; skip_nonspaces(&p); /* skip FileIndex */ skip_spaces(&p); skip_nonspaces(&p); /* skip Stream */ skip_spaces(&p); - skip_nonspaces(&p); /* skip Opts_Digest */ + skip_nonspaces(&p); /* skip Opts_SIG */ p++; /* skip space */ fn = fname; while (*p != 0) { @@ -539,7 +555,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) jcr->JobFiles++; jcr->FileIndex = file_index; /* remember attribute file_index */ decode_stat(attr, &statf, &LinkFIf); /* decode file stat packet */ - do_Digest = CRYPTO_DIGEST_NONE; + do_SIG = NO_SIG; jcr->fn_printed = false; pm_strcpy(jcr->fname, fname); /* move filename into JCR */ @@ -551,7 +567,7 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) */ fdbr.FileId = 0; if (!db_get_file_attributes_record(jcr, jcr->db, jcr->fname, - &jcr->target_jr, &fdbr)) { + &jcr->previous_jr, &fdbr)) { Jmsg(jcr, M_INFO, 0, _("New file: %s\n"), jcr->fname); Dmsg1(020, _("File not in catalog: %s\n"), jcr->fname); stat = JS_Differences; @@ -565,13 +581,13 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) } Dmsg3(400, "Found %s in catalog. inx=%d Opts=%s\n", jcr->fname, - file_index, Opts_Digest); + file_index, Opts_SIG); decode_stat(fdbr.LStat, &statc, &LinkFIc); /* decode catalog stat */ /* * Loop over options supplied by user and verify the * fields he requests. */ - for (p=Opts_Digest; *p; p++) { + for (p=Opts_SIG; *p; p++) { char ed1[30], ed2[30]; switch (*p) { case 'i': /* compare INODEs */ @@ -656,10 +672,10 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) break; case '5': /* compare MD5 */ Dmsg1(500, "set Do_MD5 for %s\n", jcr->fname); - do_Digest = CRYPTO_DIGEST_MD5; + do_SIG = MD5_SIG; break; case '1': /* compare SHA1 */ - do_Digest = CRYPTO_DIGEST_SHA1; + do_SIG = SHA1_SIG; break; case ':': case 'V': @@ -668,13 +684,13 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) } } /* - * Got Digest Signature from Storage daemon - * It came across in the Opts_Digest field. + * Got SIG Signature from Storage daemon + * It came across in the Opts_SIG field. */ - } else if (crypto_digest_stream_type(stream) != CRYPTO_DIGEST_NONE) { - Dmsg2(400, "stream=Digest inx=%d Digest=%s\n", file_index, Opts_Digest); + } else if (stream == STREAM_MD5_SIGNATURE || stream == STREAM_SHA1_SIGNATURE) { + Dmsg2(400, "stream=SIG inx=%d SIG=%s\n", file_index, Opts_SIG); /* - * When ever we get a digest is MUST have been + * When ever we get a signature is MUST have been * preceded by an attributes record, which sets attr_file_index */ if (jcr->FileIndex != (uint32_t)file_index) { @@ -682,20 +698,20 @@ int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId) file_index, jcr->FileIndex); return false; } - if (do_Digest != CRYPTO_DIGEST_NONE) { - db_escape_string(buf, Opts_Digest, strlen(Opts_Digest)); - if (strcmp(buf, fdbr.Digest) != 0) { + if (do_SIG) { + db_escape_string(buf, Opts_SIG, strlen(Opts_SIG)); + if (strcmp(buf, fdbr.SIG) != 0) { prt_fname(jcr); if (debug_level >= 10) { Jmsg(jcr, M_INFO, 0, _(" %s not same. File=%s Cat=%s\n"), - stream_to_ascii(stream), buf, fdbr.Digest); + stream==STREAM_MD5_SIGNATURE?"MD5":"SHA1", buf, fdbr.SIG); } else { Jmsg(jcr, M_INFO, 0, _(" %s differs.\n"), - stream_to_ascii(stream)); + stream==STREAM_MD5_SIGNATURE?"MD5":"SHA1"); } stat = JS_Differences; } - do_Digest = CRYPTO_DIGEST_NONE; + do_SIG = FALSE; } } jcr->JobFiles = file_index; diff --git a/bacula/src/filed/Makefile.in b/bacula/src/filed/Makefile.in index c0e86adb7f..ff1dde0cd8 100755 --- a/bacula/src/filed/Makefile.in +++ b/bacula/src/filed/Makefile.in @@ -31,10 +31,10 @@ first_rule: all dummy: # -SVRSRCS = filed.c authenticate.c acl.c backup.c estimate.c \ +SVRSRCS = filed.c authenticate.c acl.c backup.c chksum.c estimate.c \ filed_conf.c heartbeat.c job.c pythonfd.c \ restore.c status.c verify.c verify_vol.c -SVROBJS = filed.o authenticate.o acl.o backup.o estimate.o \ +SVROBJS = filed.o authenticate.o acl.o backup.o chksum.o estimate.o \ filed_conf.o heartbeat.o job.o pythonfd.o \ restore.o status.o verify.o verify_vol.o diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 3af54fcb8f..2174427d86 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -27,7 +27,7 @@ /* Forward referenced functions */ static int save_file(FF_PKT *ff_pkt, void *pkt, bool top_level); -static int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *signature_digest); +static int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, struct CHKSUM *chksum); static bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_stream); static bool read_and_send_acl(JCR *jcr, int acltype, int stream); @@ -47,8 +47,6 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr) { BSOCK *sd; bool ok = true; - // TODO landonf: Allow user to specify encryption algorithm - crypto_cipher_t cipher = CRYPTO_CIPHER_AES_128_CBC; sd = jcr->store_bsock; @@ -81,40 +79,6 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr) jcr->compress_buf_size = jcr->buf_size + ((jcr->buf_size+999) / 1000) + 30; jcr->compress_buf = get_memory(jcr->compress_buf_size); - /* Create encryption session data and a cached, DER-encoded session data - * structure. We use a single session key for each backup, so we'll encode - * the session data only once. */ - if (jcr->pki_encrypt) { - size_t size = 0; - - /* Create per-job session encryption context */ - jcr->pki_session = crypto_session_new(cipher, jcr->pki_recipients); - - /* Get the session data size */ - if (crypto_session_encode(jcr->pki_session, NULL, &size) == false) { - Jmsg(jcr, M_FATAL, 0, _("An error occured while encrypting the stream.\n")); - return 0; - } - - /* Allocate buffer */ - jcr->pki_session_encoded = malloc(size); - if (!jcr->pki_session_encoded) { - return 0; - } - - /* Encode session data */ - if (crypto_session_encode(jcr->pki_session, jcr->pki_session_encoded, &size) == false) { - Jmsg(jcr, M_FATAL, 0, _("An error occured while encrypting the stream.\n")); - return 0; - } - - /* ... and store the encoded size */ - jcr->pki_session_encoded_size = size; - - /* Allocate the encryption/decryption buffer */ - jcr->crypto_buf = get_memory(CRYPTO_CIPHER_MAX_BLOCK_SIZE); - } - Dmsg1(300, "set_find_options ff=%p\n", jcr->ff); set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime); Dmsg0(300, "start find files\n"); @@ -144,18 +108,6 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr) free_pool_memory(jcr->compress_buf); jcr->compress_buf = NULL; } - if (jcr->crypto_buf) { - free_pool_memory(jcr->crypto_buf); - jcr->crypto_buf = NULL; - } - - if (jcr->pki_session) { - crypto_session_free(jcr->pki_session); - } - if (jcr->pki_session_encoded) { - free(jcr->pki_session_encoded); - } - Dmsg1(100, "end blast_data ok=%d\n", ok); return ok; } @@ -173,15 +125,7 @@ bool blast_data_to_storage_daemon(JCR *jcr, char *addr) static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) { int stat, data_stream; - DIGEST *digest = NULL; - DIGEST *signing_digest = NULL; - int digest_stream = STREAM_NONE; - // TODO landonf: Allow the user to specify the digest algorithm -#ifdef HAVE_SHA2 - crypto_digest_t signing_algorithm = CRYPTO_DIGEST_SHA256; -#else - crypto_digest_t signing_algorithm = CRYPTO_DIGEST_SHA1; -#endif + struct CHKSUM chksum; BSOCK *sd; JCR *jcr = (JCR *)vjcr; @@ -280,55 +224,13 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) Dmsg1(130, "bfiled: sending %s to stored\n", ff_pkt->fname); - /* - * Setup for digest handling. If this fails, the digest will be set to NULL - * and not used. - */ - if (ff_pkt->flags & FO_MD5) { - digest = crypto_digest_new(CRYPTO_DIGEST_MD5); - digest_stream = STREAM_MD5_DIGEST; - - } else if (ff_pkt->flags & FO_SHA1) { - digest = crypto_digest_new(CRYPTO_DIGEST_SHA1); - digest_stream = STREAM_SHA1_DIGEST; - - } else if (ff_pkt->flags & FO_SHA256) { - digest = crypto_digest_new(CRYPTO_DIGEST_SHA256); - digest_stream = STREAM_SHA256_DIGEST; - - } else if (ff_pkt->flags & FO_SHA512) { - digest = crypto_digest_new(CRYPTO_DIGEST_SHA512); - digest_stream = STREAM_SHA512_DIGEST; - } - - /* Did digest initialization fail? */ - if (digest_stream != STREAM_NONE && digest == NULL) { - Jmsg(jcr, M_WARNING, 0, _("%s digest initialization failed\n"), - stream_to_ascii(digest_stream)); - } /* - * Set up signature digest handling. If this fails, the signature digest will be set to - * NULL and not used. + * Setup for signature handling. + * Then initialise the file descriptor we use for data and other streams. */ - // TODO landonf: We should really only calculate the digest once, for both verification and signing. - if (jcr->pki_sign) { - signing_digest = crypto_digest_new(signing_algorithm); - } - /* Full-stop if a failure occured initializing the signature digest */ - if (jcr->pki_sign && signing_digest == NULL) { - Jmsg(jcr, M_NOTSAVED, 0, _("%s signature digest initialization failed\n"), - stream_to_ascii(signing_algorithm)); - jcr->Errors++; - return 1; - } + chksum_init(&chksum, ff_pkt->flags); - /* Enable encryption */ - if (jcr->pki_encrypt) { - ff_pkt->flags |= FO_ENCRYPT; - } - - /* Initialise the file descriptor we use for data and other streams. */ binit(&ff_pkt->bfd); if (ff_pkt->flags & FO_PORTABLE) { set_portable_backup(&ff_pkt->bfd); /* disable Win32 BackupRead() */ @@ -341,7 +243,6 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) } } - /* Send attributes -- must be done after binit() */ if (!encode_and_send_attributes(jcr, ff_pkt, data_stream)) { return 0; } @@ -378,27 +279,7 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) stop_thread_timer(tid); tid = NULL; } - - /* Set up the encryption context, send the session data to the SD */ - if (jcr->pki_encrypt) { - /* Send our header */ - bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_ENCRYPTED_SESSION_DATA); - - /* Grow the bsock buffer to fit our message if necessary */ - if ((size_t) sizeof_pool_memory(sd->msg) < jcr->pki_session_encoded_size) { - sd->msg = realloc_pool_memory(sd->msg, jcr->pki_session_encoded_size); - } - - /* Copy our message over and send it */ - memcpy(sd->msg, jcr->pki_session_encoded, jcr->pki_session_encoded_size); - sd->msglen = jcr->pki_session_encoded_size; - jcr->JobBytes += sd->msglen; - - bnet_send(sd); - bnet_sig(sd, BNET_EOD); - } - - stat = send_data(jcr, data_stream, ff_pkt, digest, signing_digest); + stat = send_data(jcr, data_stream, ff_pkt, &chksum); bclose(&ff_pkt->bfd); if (!stat) { return 0; @@ -424,7 +305,7 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) } flags = ff_pkt->flags; ff_pkt->flags &= ~(FO_GZIP|FO_SPARSE); - stat = send_data(jcr, STREAM_MACOS_FORK_DATA, ff_pkt, digest, signing_digest); + stat = send_data(jcr, STREAM_MACOS_FORK_DATA, ff_pkt, &chksum); ff_pkt->flags = flags; bclose(&ff_pkt->bfd); if (!stat) { @@ -437,12 +318,7 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) Dmsg1(300, "bfiled>stored:header %s\n", sd->msg); memcpy(sd->msg, ff_pkt->hfsinfo.fndrinfo, 32); sd->msglen = 32; - if (digest) { - crypto_digest_update(digest, sd->msg, sd->msglen); - } - if (signing_digest) { - crypto_digest_update(signing_digest, sd->msg, sd->msglen); - } + chksum_update(&chksum, (unsigned char *)sd->msg, sd->msglen); bnet_send(sd); bnet_sig(sd, BNET_EOD); } @@ -461,78 +337,25 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) } } - /* Terminate the signing digest and send it to the Storage daemon */ - if (signing_digest) { - SIGNATURE *sig; - size_t size = 0; - void *buf; - - if ((sig = crypto_sign_new()) == NULL) { - Jmsg(jcr, M_FATAL, 0, _("Failed to allocate memory for stream signature.\n")); - return 0; - } - - if (crypto_sign_add_signer(sig, signing_digest, jcr->pki_keypair) == false) { - Jmsg(jcr, M_FATAL, 0, _("An error occured while signing the stream.\n")); - return 0; - } - - /* Get signature size */ - if (crypto_sign_encode(sig, NULL, &size) == false) { - Jmsg(jcr, M_FATAL, 0, _("An error occured while signing the stream.\n")); - return 0; - } - - /* Allocate signature data buffer */ - buf = malloc(size); - if (!buf) { - crypto_sign_free(sig); - return 0; - } - - /* Encode signature data */ - if (crypto_sign_encode(sig, buf, &size) == false) { - Jmsg(jcr, M_FATAL, 0, _("An error occured while signing the stream.\n")); - return 0; - } - - /* Send our header */ - bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, STREAM_SIGNED_DIGEST); - Dmsg1(300, "bfiled>stored:header %s\n", sd->msg); - - /* Grow the bsock buffer to fit our message if necessary */ - if ((size_t) sizeof_pool_memory(sd->msg) < size) { - sd->msg = realloc_pool_memory(sd->msg, size); + /* Terminate any signature and send it to Storage daemon and the Director */ + if (chksum.updated) { + int stream = 0; + chksum_final(&chksum); + if (chksum.type == CHKSUM_MD5) { + stream = STREAM_MD5_SIGNATURE; + } else if (chksum.type == CHKSUM_SHA1) { + stream = STREAM_SHA1_SIGNATURE; + } else { + Jmsg1(jcr, M_WARNING, 0, _("Unknown signature type %i.\n"), chksum.type); } - - /* Copy our message over and send it */ - memcpy(sd->msg, buf, size); - sd->msglen = size; - bnet_send(sd); - bnet_sig(sd, BNET_EOD); /* end of checksum */ - - crypto_digest_free(signing_digest); - crypto_sign_free(sig); - free(buf); - } - - /* Terminate any digest and send it to Storage daemon and the Director */ - if (digest) { - char md[CRYPTO_DIGEST_MAX_SIZE]; - size_t size; - - size = sizeof(md); - - if (crypto_digest_finalize(digest, &md, &size)) { - bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, digest_stream); + if (stream != 0) { + bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, stream); Dmsg1(300, "bfiled>stored:header %s\n", sd->msg); - memcpy(sd->msg, md, size); - sd->msglen = size; + memcpy(sd->msg, chksum.signature, chksum.length); + sd->msglen = chksum.length; bnet_send(sd); bnet_sig(sd, BNET_EOD); /* end of checksum */ } - - crypto_digest_free(digest); } return 1; @@ -548,18 +371,13 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr, bool top_level) * Currently this is not a problem as the only other stream, resource forks, * are not handled as sparse files. */ -int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *signing_digest) +static int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, struct CHKSUM *chksum) { BSOCK *sd = jcr->store_bsock; uint64_t fileAddr = 0; /* file address */ char *rbuf, *wbuf; int rsize = jcr->buf_size; /* read buffer size */ POOLMEM *msgsave; - CIPHER_CONTEXT *cipher_ctx = NULL; /* Quell bogus uninitialized warnings */ - const void *cipher_input; - size_t cipher_input_len; - size_t cipher_block_size; - size_t encrypted_len; #ifdef FD_NO_SEND_TEST return 1; #endif @@ -567,11 +385,11 @@ int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *sign msgsave = sd->msg; rbuf = sd->msg; /* read buffer */ wbuf = sd->msg; /* write buffer */ - cipher_input = rbuf; /* encrypt uncompressed data */ Dmsg1(300, "Saving data, type=%d\n", ff_pkt->type); + #ifdef HAVE_LIBZ uLong compress_len, max_compress_len = 0; const Bytef *cbuf = NULL; @@ -585,30 +403,9 @@ int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *sign max_compress_len = jcr->compress_buf_size; /* set max length */ } wbuf = jcr->compress_buf; /* compressed output here */ - cipher_input = jcr->compress_buf; /* encrypt compressed data */ } #endif - if (ff_pkt->flags & FO_ENCRYPT) { - /* Allocate the cipher context */ - if ((cipher_ctx = crypto_cipher_new(jcr->pki_session, true, &cipher_block_size)) == NULL) { - /* Shouldn't happen! */ - Jmsg0(jcr, M_FATAL, 0, _("Failed to initialize encryption context\n")); - goto err; - } - - /* - * Grow the crypto buffer, if necessary. - * crypto_cipher_update() will buffer up to (cipher_block_size - 1). - * We grow crypto_buf to the maximum number of blocks that - * could be returned for the given read buffer size. - * (Using the larger of either rsize or max_compress_len) - */ - jcr->crypto_buf = check_pool_memory_size(jcr->crypto_buf, (MAX((size_t) rsize, max_compress_len) + cipher_block_size - 1) / cipher_block_size * cipher_block_size); - - wbuf = jcr->crypto_buf; /* Encrypted, possibly compressed output here. */ - } - /* * Send Data header to Storage daemon * @@ -616,7 +413,7 @@ int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *sign if (!bnet_fsend(sd, "%ld %d 0", jcr->JobFiles, stream)) { Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd)); - goto err; + return 0; } Dmsg1(300, ">stored: datahdr %s\n", sd->msg); @@ -665,18 +462,8 @@ int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *sign jcr->ReadBytes += sd->msglen; /* count bytes read */ fileAddr += sd->msglen; - /* Uncompressed cipher input length */ - cipher_input_len = sd->msglen; - /* Update checksum if requested */ - if (digest) { - crypto_digest_update(digest, rbuf, sd->msglen); - } - - /* Update signing digest if requested */ - if (signing_digest) { - crypto_digest_update(signing_digest, rbuf, sd->msglen); - } + chksum_update(chksum, (unsigned char *)rbuf, sd->msglen); #ifdef HAVE_LIBZ /* Do compression if turned on */ @@ -690,34 +477,18 @@ int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *sign (const Bytef *)rbuf, (uLong)sd->msglen, ff_pkt->GZIP_level)) != Z_OK) { Jmsg(jcr, M_FATAL, 0, _("Compression error: %d\n"), zstat); + sd->msg = msgsave; + sd->msglen = 0; set_jcr_job_status(jcr, JS_ErrorTerminated); - goto err; + return 0; } Dmsg2(400, "compressed len=%d uncompressed len=%d\n", compress_len, sd->msglen); sd->msglen = compress_len; /* set compressed length */ - cipher_input_len = compress_len; } #endif - if (ff_pkt->flags & FO_ENCRYPT) { - /* Encrypt the input block */ - if (crypto_cipher_update(cipher_ctx, cipher_input, cipher_input_len, jcr->crypto_buf, &encrypted_len)) { - if (encrypted_len == 0) { - /* No full block of data available, read more data */ - continue; - } - Dmsg2(400, "encrypted len=%d unencrypted len=%d\n", - encrypted_len, sd->msglen); - sd->msglen = encrypted_len; /* set encrypted length */ - } else { - /* Encryption failed. Shouldn't happen. */ - Jmsg(jcr, M_FATAL, 0, _("Encryption error\n")); - goto err; - } - } - /* Send the buffer to the Storage daemon */ if (!sparseBlock) { if (ff_pkt->flags & FO_SPARSE) { @@ -727,42 +498,18 @@ int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *sign if (!bnet_send(sd)) { Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd)); - goto err; + sd->msg = msgsave; /* restore bnet buffer */ + sd->msglen = 0; + return 0; } } Dmsg1(130, "Send data to SD len=%d\n", sd->msglen); /* #endif */ - jcr->JobBytes += sd->msglen; /* count bytes saved possibly compressed/encrypted */ + jcr->JobBytes += sd->msglen; /* count bytes saved possibly compressed */ sd->msg = msgsave; /* restore read buffer */ } /* end while read file data */ - /* Send any remaining encrypted data + padding */ - if (ff_pkt->flags & FO_ENCRYPT) { - if (!crypto_cipher_finalize(cipher_ctx, jcr->crypto_buf, &encrypted_len)) { - /* Padding failed. Shouldn't happen. */ - Jmsg(jcr, M_FATAL, 0, _("Encryption padding error\n")); - goto err; - } - - if (encrypted_len > 0) { - sd->msglen = encrypted_len; /* set encrypted length */ - - /* Send remaining encrypted data to the SD */ - if (ff_pkt->flags & FO_SPARSE) { - sd->msglen += SPARSE_FADDR_SIZE; /* include fileAddr in size */ - } - sd->msg = wbuf; /* set correct write buffer */ - if (!bnet_send(sd)) { - Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), - bnet_strerror(sd)); - goto err; - } - Dmsg1(130, "Send data to SD len=%d\n", sd->msglen); - jcr->JobBytes += sd->msglen; /* count bytes saved possibly compressed/encrypted */ - sd->msg = msgsave; /* restore bnet buffer */ - } - } if (sd->msglen < 0) { berrno be; @@ -777,23 +524,10 @@ int send_data(JCR *jcr, int stream, FF_PKT *ff_pkt, DIGEST *digest, DIGEST *sign if (!bnet_sig(sd, BNET_EOD)) { /* indicate end of file data */ Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"), bnet_strerror(sd)); - goto err; - } - - /* Free the cipher context */ - if (cipher_ctx) { - crypto_cipher_free(cipher_ctx); + return 0; } return 1; - -err: - if (cipher_ctx) { - crypto_cipher_free(cipher_ctx); - } - sd->msg = msgsave; /* restore bnet buffer */ - sd->msglen = 0; - return 0; } /* @@ -863,11 +597,7 @@ static bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_strea #endif /* Find what data stream we will use, then encode the attributes */ - if ((data_stream = select_data_stream(ff_pkt)) == STREAM_NONE) { - /* This should not happen */ - Jmsg0(jcr, M_FATAL, 0, _("Invalid file flags, no supported data stream type.\n")); - return false; - } + data_stream = select_data_stream(ff_pkt); encode_stat(attribs, ff_pkt, data_stream); /* Now possibly extend the attributes */ @@ -875,11 +605,11 @@ static bool encode_and_send_attributes(JCR *jcr, FF_PKT *ff_pkt, int &data_strea Dmsg3(300, "File %s\nattribs=%s\nattribsEx=%s\n", ff_pkt->fname, attribs, attribsEx); - P(jcr->mutex); + jcr->lock(); jcr->JobFiles++; /* increment number of files sent */ ff_pkt->FileIndex = jcr->JobFiles; /* return FileIndex */ pm_strcpy(jcr->last_fname, ff_pkt->fname); - V(jcr->mutex); + jcr->unlock(); /* * Send Attributes header to Storage daemon diff --git a/bacula/src/filed/bacula-fd.conf.in b/bacula/src/filed/bacula-fd.conf.in index dd71f4c660..1ca546d4bb 100644 --- a/bacula/src/filed/bacula-fd.conf.in +++ b/bacula/src/filed/bacula-fd.conf.in @@ -39,5 +39,5 @@ FileDaemon { # this is me # Send all messages except skipped files back to Director Messages { Name = Standard - director = @hostname@-dir = all, !skipped + director = @hostname@-dir = all, !skipped, !restored } diff --git a/bacula/src/filed/chksum.c b/bacula/src/filed/chksum.c new file mode 100644 index 0000000000..721d7609da --- /dev/null +++ b/bacula/src/filed/chksum.c @@ -0,0 +1,84 @@ +/* + * General routines for handling the various checksum supported. + * + * Written by Preben 'Peppe' Guldberg, December MMIV + */ +/* + Copyright (C) 2004-2005 Kern Sibbald + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. + + */ + +#include "bacula.h" +#include "filed.h" + +/* return 0 on success, otherwise some handler specific error code. */ +int chksum_init(CHKSUM *chksum, int flags) +{ + int status = 0; + + chksum->type = CHKSUM_NONE; + bstrncpy(chksum->name, "NONE", sizeof(chksum->name)); + chksum->updated = false; + if (flags & CHKSUM_MD5) { + chksum->length = 16; + MD5Init(&chksum->context.md5); + chksum->type = CHKSUM_MD5; + bstrncpy(chksum->name, "MD5", sizeof(chksum->name)); + } else if (flags & CHKSUM_SHA1) { + chksum->length = 20; + status = SHA1Init(&chksum->context.sha1); + if (status == 0) { + chksum->type = CHKSUM_SHA1; + bstrncpy(chksum->name, "SHA1", sizeof(chksum->name)); + } + } + return status; +} + +/* return 0 on success, otherwise some handler specific error code. */ +int chksum_update(CHKSUM *chksum, void *buf, unsigned len) +{ + int status; + switch (chksum->type) { + case CHKSUM_NONE: + return 0; + case CHKSUM_MD5: + MD5Update(&chksum->context.md5, (unsigned char *)buf, len); + chksum->updated = true; + return 0; + case CHKSUM_SHA1: + status = SHA1Update(&chksum->context.sha1, (uint8_t *)buf, len); + if (status == 0) { + chksum->updated = true; + } + return status; + default: + return -1; + } +} + +/* return 0 on success, otherwise some handler specific error code. */ +int chksum_final(CHKSUM *chksum) +{ + switch (chksum->type) { + case CHKSUM_NONE: + return 0; + case CHKSUM_MD5: + MD5Final(chksum->signature, &chksum->context.md5); + return 0; + case CHKSUM_SHA1: + return SHA1Final(&chksum->context.sha1, chksum->signature); + default: + return -1; + } +} diff --git a/bacula/src/filed/chksum.h b/bacula/src/filed/chksum.h new file mode 100644 index 0000000000..7be26339d2 --- /dev/null +++ b/bacula/src/filed/chksum.h @@ -0,0 +1,52 @@ +/* + * General routines for handling the various checksum supported. + */ +/* + Copyright (C) 2000-2005 Kern Sibbald + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. + + */ + +#ifndef _CHKSUM_H_ +#define _CHKSUM_H_ + +#include "bacula.h" + +/* + * Link these to findlib options. Doing so allows for simpler handling of + * signatures in the callers. + * If multiple signatures are specified, the order in chksum_init() matters. + * Still, spell out our own names in case we want to change the approach. + */ +#define CHKSUM_NONE 0 +#define CHKSUM_MD5 FO_MD5 +#define CHKSUM_SHA1 FO_SHA1 + +union chksumContext { + MD5Context md5; + SHA1Context sha1; +}; + +struct CHKSUM { + int type; /* One of CHKSUM_* above */ + char name[5]; /* Big enough for NONE, MD5, SHA1, etc. */ + bool updated; /* True if updated by chksum_update() */ + chksumContext context; /* Context for the algorithm at hand */ + int length; /* Length of signature */ + unsigned char signature[30]; /* Large enough for either signature */ +}; + +int chksum_init(CHKSUM *chksum, int flags); +int chksum_update(CHKSUM *chksum, void *buf, unsigned len); +int chksum_final(CHKSUM *chksum); + +#endif diff --git a/bacula/src/filed/filed.c b/bacula/src/filed/filed.c index f274444fe6..f399706146 100644 --- a/bacula/src/filed/filed.c +++ b/bacula/src/filed/filed.c @@ -179,8 +179,8 @@ int main (int argc, char *argv[]) parse_config(configfile); - if (init_crypto() != 0) { - Emsg0(M_ERROR, 0, _("Cryptography library initialization failed.\n")); + if (init_tls() != 0) { + Emsg0(M_ERROR, 0, _("TLS library initialization failed.\n")); terminate_filed(1); } @@ -260,7 +260,7 @@ void terminate_filed(int sig) free_config_resources(); term_msg(); stop_watchdog(); - cleanup_crypto(); + cleanup_tls(); close_memory_pool(); /* release free memory in pool */ sm_dump(false); /* dump orphaned buffers */ exit(sig); @@ -328,128 +328,6 @@ static int check_resources() OK = false; } } - - if (me->pki_encrypt || me->pki_sign) { -#ifndef HAVE_CRYPTO - Jmsg(NULL, M_FATAL, 0, _("PKI encryption/signing enabled but not compiled into Bacula.\n")); - OK = false; -#endif - } - - /* pki_encrypt implies pki_sign */ - if (me->pki_encrypt) { - me->pki_sign = true; - } - - if ((me->pki_encrypt || me->pki_sign) && !me->pki_keypair_file) { - Emsg2(M_FATAL, 0, _("\"PKI Key Pair\" must be defined for File" - " daemon \"%s\" in %s if either \"PKI Sign\" or" - " \"PKI Encrypt\" are enabled.\n"), me->hdr.name, configfile); - OK = false; - } - - /* If everything is well, attempt to initialize our public/private keys */ - if (OK && (me->pki_encrypt || me->pki_sign)) { - char *filepath; - /* Load our keypair */ - me->pki_keypair = crypto_keypair_new(); - if (!me->pki_keypair) { - Emsg0(M_FATAL, 0, _("Failed to allocate a new keypair object.\n")); - OK = false; - } else { - if (!crypto_keypair_load_cert(me->pki_keypair, me->pki_keypair_file)) { - Emsg2(M_FATAL, 0, _("Failed to load public certificate for File" - " daemon \"%s\" in %s.\n"), me->hdr.name, configfile); - OK = false; - } - - if (!crypto_keypair_load_key(me->pki_keypair, me->pki_keypair_file, NULL, NULL)) { - Emsg2(M_FATAL, 0, _("Failed to load private key for File" - " daemon \"%s\" in %s.\n"), me->hdr.name, configfile); - OK = false; - } - } - - /* - * Trusted Signers. We're always trusted. - */ - me->pki_signers = New(alist(10, not_owned_by_alist)); - if (me->pki_keypair) { - me->pki_signers->append(crypto_keypair_dup(me->pki_keypair)); - } - - /* If additional signing public keys have been specified, load them up */ - if (me->pki_signing_key_files) { - foreach_alist(filepath, me->pki_signing_key_files) { - X509_KEYPAIR *keypair; - - keypair = crypto_keypair_new(); - if (!keypair) { - Emsg0(M_FATAL, 0, _("Failed to allocate a new keypair object.\n")); - OK = false; - } else { - if (crypto_keypair_load_cert(keypair, filepath)) { - me->pki_signers->append(keypair); - - /* Attempt to load a private key, if available */ - if (crypto_keypair_has_key(filepath)) { - if (!crypto_keypair_load_key(keypair, filepath, NULL, NULL)) { - Emsg3(M_FATAL, 0, _("Failed to load private key from file %s for File" - " daemon \"%s\" in %s.\n"), filepath, me->hdr.name, configfile); - OK = false; - } - } - - } else { - Emsg3(M_FATAL, 0, _("Failed to load trusted signer certificate" - " from file %s for File daemon \"%s\" in %s.\n"), filepath, me->hdr.name, configfile); - OK = false; - } - } - } - } - - /* - * Crypto recipients. We're always included as a recipient. - * The symmetric session key will be encrypted for each of these readers. - */ - me->pki_recipients = New(alist(10, not_owned_by_alist)); - if (me->pki_keypair) { - me->pki_recipients->append(crypto_keypair_dup(me->pki_keypair)); - } - - - /* If additional keys have been specified, load them up */ - if (me->pki_master_key_files) { - foreach_alist(filepath, me->pki_master_key_files) { - X509_KEYPAIR *keypair; - - keypair = crypto_keypair_new(); - if (!keypair) { - Emsg0(M_FATAL, 0, _("Failed to allocate a new keypair object.\n")); - OK = false; - } else { - if (crypto_keypair_load_cert(keypair, filepath)) { - me->pki_recipients->append(keypair); - - /* Attempt to load a private key, if available */ - if (crypto_keypair_has_key(filepath)) { - if (!crypto_keypair_load_key(keypair, filepath, NULL, NULL)) { - Emsg3(M_FATAL, 0, _("Failed to load private key from file %s for File" - " daemon \"%s\" in %s.\n"), filepath, me->hdr.name, configfile); - OK = false; - } - } - - } else { - Emsg3(M_FATAL, 0, _("Failed to load master key certificate" - " from file %s for File daemon \"%s\" in %s.\n"), filepath, me->hdr.name, configfile); - OK = false; - } - } - } - } - } } diff --git a/bacula/src/filed/filed.h b/bacula/src/filed/filed.h index 43a8e3fa92..4137317ee9 100644 --- a/bacula/src/filed/filed.h +++ b/bacula/src/filed/filed.h @@ -27,6 +27,7 @@ #define FILE_DAEMON 1 #include "filed_conf.h" +#include "chksum.h" #include "findlib/find.h" #include "jcr.h" #include "acl.h" diff --git a/bacula/src/filed/filed_conf.c b/bacula/src/filed/filed_conf.c index f01b862d24..1739ce7484 100644 --- a/bacula/src/filed/filed_conf.c +++ b/bacula/src/filed/filed_conf.c @@ -89,17 +89,12 @@ static RES_ITEM cli_items[] = { {"heartbeatinterval", store_time, ITEM(res_client.heartbeat_interval), 0, ITEM_DEFAULT, 0}, {"sdconnecttimeout", store_time,ITEM(res_client.SDConnectTimeout), 0, ITEM_DEFAULT, 60 * 30}, {"maximumnetworkbuffersize", store_pint, ITEM(res_client.max_network_buffer_size), 0, 0, 0}, - {"pkisignatures", store_bit, ITEM(res_client.pki_sign), 1, ITEM_DEFAULT, 0}, - {"pkiencryption", store_bit, ITEM(res_client.pki_encrypt), 1, ITEM_DEFAULT, 0}, - {"pkikeypair", store_dir, ITEM(res_client.pki_keypair_file), 0, 0, 0}, - {"pkisigner", store_alist_str, ITEM(res_client.pki_signing_key_files), 0, 0, 0}, - {"pkimasterkey", store_alist_str, ITEM(res_client.pki_master_key_files), 0, 0, 0}, - {"tlsenable", store_bit, ITEM(res_client.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_client.tls_require), 1, 0, 0}, - {"tlscacertificatefile", store_dir, ITEM(res_client.tls_ca_certfile), 0, 0, 0}, - {"tlscacertificatedir", store_dir, ITEM(res_client.tls_ca_certdir), 0, 0, 0}, - {"tlscertificate", store_dir, ITEM(res_client.tls_certfile), 0, 0, 0}, - {"tlskey", store_dir, ITEM(res_client.tls_keyfile), 0, 0, 0}, + {"tlsenable", store_yesno, ITEM(res_client.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_client.tls_require), 1, 0, 0}, + {"tlscacertificatefile", store_dir, ITEM(res_client.tls_ca_certfile), 0, 0, 0}, + {"tlscacertificatedir", store_dir, ITEM(res_client.tls_ca_certdir), 0, 0, 0}, + {"tlscertificate", store_dir, ITEM(res_client.tls_certfile), 0, 0, 0}, + {"tlskey", store_dir, ITEM(res_client.tls_keyfile), 0, 0, 0}, {NULL, NULL, NULL, 0, 0, 0} }; @@ -109,10 +104,10 @@ static RES_ITEM dir_items[] = { {"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0}, {"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0}, {"address", store_str, ITEM(res_dir.address), 0, 0, 0}, - {"monitor", store_bit, ITEM(res_dir.monitor), 1, ITEM_DEFAULT, 0}, - {"tlsenable", store_bit, ITEM(res_dir.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_dir.tls_require), 1, 0, 0}, - {"tlsverifypeer", store_bit, ITEM(res_dir.tls_verify_peer), 1, ITEM_DEFAULT, 1}, + {"monitor", store_yesno, ITEM(res_dir.monitor), 1, ITEM_DEFAULT, 0}, + {"tlsenable", store_yesno, ITEM(res_dir.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_dir.tls_require), 1, 0, 0}, + {"tlsverifypeer", store_yesno, ITEM(res_dir.tls_verify_peer), 1, ITEM_DEFAULT, 1}, {"tlscacertificatefile", store_dir, ITEM(res_dir.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_dir.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_dir.tls_certfile), 0, 0, 0}, @@ -245,37 +240,6 @@ void free_resource(RES *sres, int type) if (res->res_client.FDaddrs) { free_addresses(res->res_client.FDaddrs); } - - if (res->res_client.pki_keypair_file) { - free(res->res_client.pki_keypair_file); - } - if (res->res_client.pki_keypair) { - crypto_keypair_free(res->res_client.pki_keypair); - } - - if (res->res_client.pki_signing_key_files) { - delete res->res_client.pki_signing_key_files; - } - if (res->res_client.pki_signers) { - X509_KEYPAIR *keypair; - foreach_alist(keypair, res->res_client.pki_signers) { - crypto_keypair_free(keypair); - } - delete res->res_client.pki_signers; - } - - if (res->res_client.pki_master_key_files) { - delete res->res_client.pki_master_key_files; - } - - if (res->res_client.pki_recipients) { - X509_KEYPAIR *keypair; - foreach_alist(keypair, res->res_client.pki_recipients) { - crypto_keypair_free(keypair); - } - delete res->res_client.pki_recipients; - } - if (res->res_client.tls_ctx) { free_tls_context(res->res_client.tls_ctx); } @@ -357,12 +321,6 @@ void save_resource(int type, RES_ITEM *items, int pass) if ((res = (URES *)GetResWithName(R_CLIENT, res_all.res_dir.hdr.name)) == NULL) { Emsg1(M_ABORT, 0, _("Cannot find Client resource %s\n"), res_all.res_dir.hdr.name); } - res->res_client.pki_signing_key_files = res_all.res_client.pki_signing_key_files; - res->res_client.pki_master_key_files = res_all.res_client.pki_master_key_files; - - res->res_client.pki_signers = res_all.res_client.pki_signers; - res->res_client.pki_recipients = res_all.res_client.pki_recipients; - res->res_client.messages = res_all.res_client.messages; break; default: diff --git a/bacula/src/filed/filed_conf.h b/bacula/src/filed/filed_conf.h index e8ea53b27b..8594228f94 100644 --- a/bacula/src/filed/filed_conf.h +++ b/bacula/src/filed/filed_conf.h @@ -71,11 +71,6 @@ struct CLIENT { utime_t heartbeat_interval; /* Interval to send heartbeats to Dir */ utime_t SDConnectTimeout; /* timeout in seconds */ uint32_t max_network_buffer_size; /* max network buf size */ - int pki_sign; /* Enable Data Integrity Verification via Digital Signatures */ - int pki_encrypt; /* Enable Data Encryption */ - char *pki_keypair_file; /* PKI Key Pair File */ - alist *pki_signing_key_files; /* PKI Signing Key Files */ - alist *pki_master_key_files; /* PKI Master Key Files */ int tls_enable; /* Enable TLS */ int tls_require; /* Require TLS */ char *tls_ca_certfile; /* TLS CA Certificate File */ @@ -83,9 +78,6 @@ struct CLIENT { char *tls_certfile; /* TLS Client Certificate File */ char *tls_keyfile; /* TLS Client Key File */ - X509_KEYPAIR *pki_keypair; /* Shared PKI Public/Private Keypair */ - alist *pki_signers; /* Shared PKI Trusted Signers */ - alist *pki_recipients; /* Shared PKI Recipients */ TLS_CONTEXT *tls_ctx; /* Shared TLS Context */ }; diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index 56e43efcbf..41276c2b2b 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -25,6 +25,7 @@ #include "filed.h" #ifdef WIN32_VSS #include "vss.h" +static pthread_mutex_t vss_mutex = PTHREAD_MUTEX_INITIALIZER; #endif extern char my_name[]; @@ -173,11 +174,6 @@ void *handle_client_request(void *dirp) jcr->last_fname[0] = 0; jcr->client_name = get_memory(strlen(my_name) + 1); pm_strcpy(jcr->client_name, my_name); - jcr->pki_sign = me->pki_sign; - jcr->pki_encrypt = me->pki_encrypt; - jcr->pki_keypair = me->pki_keypair; - jcr->pki_signers = me->pki_signers; - jcr->pki_recipients = me->pki_recipients; dir->jcr = jcr; enable_backup_privileges(NULL, 1 /* ignore_errors */); @@ -328,16 +324,9 @@ static int cancel_cmd(JCR *jcr) bnet_fsend(dir, _("2901 Job %s not found.\n"), Job); } else { if (cjcr->store_bsock) { - P(cjcr->mutex); cjcr->store_bsock->timed_out = 1; cjcr->store_bsock->terminated = 1; -/* - * #if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32) - */ -#if !defined(HAVE_CYGWIN) pthread_kill(cjcr->my_thread_id, TIMEOUT_SIGNAL); -#endif - V(cjcr->mutex); } set_jcr_job_status(cjcr, JS_Canceled); free_jcr(cjcr); @@ -870,32 +859,7 @@ static void set_options(findFOPTS *fo, const char *opts) fo->flags |= FO_READFIFO; break; case 'S': - switch(*(p + 1)) { - case ' ': - /* Old director did not specify SHA variant */ - fo->flags |= FO_SHA1; - break; - case '1': - fo->flags |= FO_SHA1; - p++; - break; -#ifdef HAVE_SHA2 - case '2': - fo->flags |= FO_SHA256; - p++; - break; - case '3': - fo->flags |= FO_SHA512; - p++; - break; -#endif - default: - /* Automatically downgrade to SHA-1 if an unsupported - * SHA variant is specified */ - fo->flags |= FO_SHA1; - p++; - break; - } + fo->flags |= FO_SHA1; break; case 's': fo->flags |= FO_SPARSE; @@ -1242,6 +1206,8 @@ static int backup_cmd(JCR *jcr) #ifdef WIN32_VSS /* START VSS ON WIN 32 */ if (g_pVSSClient && enable_vss) { + /* Run only one at a time */ + P(vss_mutex); if (g_pVSSClient->InitializeForBackup()) { /* tell vss which drives to snapshot */ char szWinDriveLetters[27]; @@ -1334,8 +1300,10 @@ cleanup: #ifdef WIN32_VSS /* STOP VSS ON WIN 32 */ /* tell vss to close the backup session */ - if (g_pVSSClient && enable_vss == 1) + if (g_pVSSClient && enable_vss) { g_pVSSClient->CloseBackup(); + V(vss_mutex); + } #endif bnet_fsend(dir, EndJob, jcr->JobStatus, jcr->JobFiles, @@ -1538,7 +1506,7 @@ static int open_sd_read_session(JCR *jcr) /* * Open Read Session with Storage daemon */ - bnet_fsend(sd, read_open, "DummyVolume", + bnet_fsend(sd, read_open, jcr->VolumeName, jcr->VolSessionId, jcr->VolSessionTime, jcr->StartFile, jcr->EndFile, jcr->StartBlock, jcr->EndBlock); Dmsg1(110, ">stored: %s", sd->msg); diff --git a/bacula/src/filed/protos.h b/bacula/src/filed/protos.h index 92d0a3c83c..952f56ff11 100644 --- a/bacula/src/filed/protos.h +++ b/bacula/src/filed/protos.h @@ -23,16 +23,13 @@ */ extern bool blast_data_to_storage_daemon(JCR *jcr, char *addr); +extern void do_verify(JCR *jcr); extern void do_verify_volume(JCR *jcr); extern void do_restore(JCR *jcr); extern int authenticate_director(JCR *jcr); extern int authenticate_storagedaemon(JCR *jcr); extern int make_estimate(JCR *jcr); -/* From verify.c */ -int digest_file(JCR *jcr, FF_PKT *ff_pkt, DIGEST *digest); -void do_verify(JCR *jcr); - /* From heartbeat.c */ void start_heartbeat_monitor(JCR *jcr); void stop_heartbeat_monitor(JCR *jcr); diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index 4aed75c9b6..3b41655ff9 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -35,11 +35,8 @@ static char rec_header[] = "rechdr %ld %ld %ld %ld %ld"; #ifdef HAVE_LIBZ static const char *zlib_strerror(int stat); #endif - -int verify_signature(JCR *jcr, SIGNATURE *sig); int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, - uint64_t *addr, int flags, CIPHER_CONTEXT *cipher, size_t cipher_block_size); -bool flush_cipher(JCR *jcr, BFILE *bfd, int flags, CIPHER_CONTEXT *cipher, size_t cipher_block_size); + uint64_t *addr, int flags); #define RETRY 10 /* retry wait time */ @@ -83,11 +80,7 @@ void do_restore(JCR *jcr) BFILE altbfd; /* Alternative data stream */ uint64_t alt_addr = 0; /* Write address for alternative stream */ intmax_t alt_size = 0; /* Size of alternate stream */ - SIGNATURE *sig = NULL; /* Cryptographic signature (if any) for file */ - CRYPTO_SESSION *cs = NULL; /* Cryptographic session data (if any) for file */ - CIPHER_CONTEXT *cipher_ctx = NULL; /* Cryptographic cipher context (if any) for file */ - size_t cipher_block_size = 0; /* Cryptographic algorithm block size for file */ - int flags = 0; /* Options for extract_data() */ + int flags; /* Options for extract_data() */ int stat; ATTR *attr; @@ -133,23 +126,17 @@ void do_restore(JCR *jcr) jcr->compress_buf_size = compress_buf_size; #endif -#ifdef HAVE_CRYPTO - jcr->crypto_buf = get_memory(CRYPTO_CIPHER_MAX_BLOCK_SIZE); -#endif - /* * Get a record from the Storage daemon. We are guaranteed to * receive records in the following order: * 1. Stream record header * 2. Stream data * a. Attributes (Unix or Win32) - * b. Possibly stream encryption session data (e.g., symmetric session key) - * or c. File data for the file - * or d. Alternate data stream (e.g. Resource Fork) - * or e. Finder info - * or f. ACLs - * or g. Possibly a cryptographic signature - * or h. Possibly MD5 or SHA1 record + * or b. File data for the file + * or c. Alternate data stream (e.g. Resource Fork) + * or d. Finder info + * or e. ACLs + * or f. Possibly MD5 or SHA1 record * 3. Repeat step 1 * * NOTE: We keep track of two bacula file descriptors: @@ -207,39 +194,14 @@ void do_restore(JCR *jcr) Dmsg1(30, "Stream=Unix Attributes. extract=%d\n", extract); /* * If extracting, it was from previous stream, so - * close the output file and validate the signature. + * close the output file. */ if (extract) { if (size > 0 && !is_bopen(&bfd)) { Jmsg0(jcr, M_ERROR, 0, _("Logic error: output file should be open\n")); } - /* Flush and deallocate previous stream's cipher context */ - if (cipher_ctx && prev_stream != STREAM_ENCRYPTED_SESSION_DATA) { - flush_cipher(jcr, &bfd, flags, cipher_ctx, cipher_block_size); - crypto_cipher_free(cipher_ctx); - cipher_ctx = NULL; - } set_attributes(jcr, attr, &bfd); extract = false; - - /* Verify the cryptographic signature, if any */ - if (jcr->pki_sign) { - if (sig) { - // Failure is reported in verify_signature() ... - verify_signature(jcr, sig); - } else { - Jmsg1(jcr, M_ERROR, 0, _("Missing cryptographic signature for %s\n"), jcr->last_fname); - } - } - /* Free Signature */ - if (sig) { - crypto_sign_free(sig); - sig = NULL; - } - if (cs) { - crypto_session_free(cs); - cs = NULL; - } Dmsg0(30, "Stop extracting.\n"); } else if (is_bopen(&bfd)) { Jmsg0(jcr, M_ERROR, 0, _("Logic error: output file should not be open\n")); @@ -289,9 +251,9 @@ void do_restore(JCR *jcr) extract = true; /* FALLTHROUGH */ case CF_CREATED: /* File created, but there is no content */ - P(jcr->mutex); + jcr->lock(); pm_strcpy(jcr->last_fname, attr->ofname); - V(jcr->mutex); + jcr->unlock(); jcr->JobFiles++; fileAddr = 0; print_ls_output(jcr, attr); @@ -311,85 +273,24 @@ void do_restore(JCR *jcr) break; /* Data stream */ - case STREAM_ENCRYPTED_SESSION_DATA: - crypto_error_t cryptoerr; - - Dmsg1(30, "Stream=Encrypted Session Data, size: %d\n", sd->msglen); - - /* Decode and save session keys. */ - cryptoerr = crypto_session_decode(sd->msg, (size_t) sd->msglen, jcr->pki_recipients, &cs); - switch(cryptoerr) { - case CRYPTO_ERROR_NONE: - /* Success */ - break; - case CRYPTO_ERROR_NORECIPIENT: - Jmsg(jcr, M_ERROR, 0, _("Missing private key required to decrypt encrypted backup data.")); - break; - case CRYPTO_ERROR_DECRYPTION: - Jmsg(jcr, M_ERROR, 0, _("Decrypt of the session key failed.")); - break; - default: - /* Shouldn't happen */ - Jmsg1(jcr, M_ERROR, 0, _("An error occured while decoding encrypted session data stream: %s"), crypto_strerror(cryptoerr)); - break; - } - - if (cryptoerr != CRYPTO_ERROR_NONE) { - extract = false; - bclose(&bfd); - continue; - } - - /* Set up a decryption context */ - if ((cipher_ctx = crypto_cipher_new(cs, false, &cipher_block_size)) == NULL) { - Jmsg1(jcr, M_ERROR, 0, _("Failed to initialize decryption context for %s\n"), jcr->last_fname); - crypto_session_free(cs); - cs = NULL; - extract = false; - bclose(&bfd); - continue; - } - break; - case STREAM_FILE_DATA: case STREAM_SPARSE_DATA: case STREAM_WIN32_DATA: case STREAM_GZIP_DATA: case STREAM_SPARSE_GZIP_DATA: case STREAM_WIN32_GZIP_DATA: - case STREAM_ENCRYPTED_FILE_DATA: - case STREAM_ENCRYPTED_WIN32_DATA: - case STREAM_ENCRYPTED_FILE_GZIP_DATA: - case STREAM_ENCRYPTED_WIN32_GZIP_DATA: /* Force an expected, consistent stream type here */ if (extract && (prev_stream == stream || prev_stream == STREAM_UNIX_ATTRIBUTES - || prev_stream == STREAM_UNIX_ATTRIBUTES_EX - || prev_stream == STREAM_ENCRYPTED_SESSION_DATA)) { + || prev_stream == STREAM_UNIX_ATTRIBUTES_EX)) { flags = 0; - if (stream == STREAM_SPARSE_DATA || stream == STREAM_SPARSE_GZIP_DATA) { flags |= FO_SPARSE; } - if (stream == STREAM_GZIP_DATA || stream == STREAM_SPARSE_GZIP_DATA - || stream == STREAM_WIN32_GZIP_DATA || stream == STREAM_ENCRYPTED_FILE_GZIP_DATA - || stream == STREAM_ENCRYPTED_WIN32_GZIP_DATA) { + || stream == STREAM_WIN32_GZIP_DATA) { flags |= FO_GZIP; } - - if (stream == STREAM_ENCRYPTED_FILE_DATA - || stream == STREAM_ENCRYPTED_FILE_GZIP_DATA - || stream == STREAM_ENCRYPTED_WIN32_DATA - || stream == STREAM_ENCRYPTED_WIN32_GZIP_DATA) { - flags |= FO_ENCRYPT; - } - - if (is_win32_stream(stream) && !have_win32_api()) { - set_portable_backup(&bfd); - flags |= FO_WIN32DECOMP; /* "decompose" BackupWrite data */ - } - - if (extract_data(jcr, &bfd, sd->msg, sd->msglen, &fileAddr, flags, cipher_ctx, cipher_block_size) < 0) { + if (extract_data(jcr, &bfd, sd->msg, sd->msglen, &fileAddr, flags) < 0) { extract = false; bclose(&bfd); continue; @@ -399,8 +300,6 @@ void do_restore(JCR *jcr) /* Resource fork stream - only recorded after a file to be restored */ /* Silently ignore if we cannot write - we already reported that */ - case STREAM_ENCRYPTED_MACOS_FORK_DATA: - flags |= FO_ENCRYPT; case STREAM_MACOS_FORK_DATA: #ifdef HAVE_DARWIN_OS if (extract) { @@ -414,7 +313,7 @@ void do_restore(JCR *jcr) Dmsg0(30, "Restoring resource fork\n"); } flags = 0; - if (extract_data(jcr, &altbfd, sd->msg, sd->msglen, &alt_addr, flags, cipher_ctx, cipher_block_size) < 0) { + if (extract_data(jcr, &altbfd, sd->msg, sd->msglen, &alt_addr, flags) < 0) { extract = false; bclose(&altbfd); continue; @@ -445,7 +344,7 @@ void do_restore(JCR *jcr) pm_strcpy(jcr->acl_text, sd->msg); Dmsg2(400, "Restoring ACL type 0x%2x <%s>\n", BACL_TYPE_ACCESS, jcr->acl_text); if (bacl_set(jcr, BACL_TYPE_ACCESS) != 0) { - Qmsg1(jcr, M_WARNING, 0, _("Can't restore ACL of %s\n"), jcr->last_fname); + Jmsg1(jcr, M_WARNING, 0, _("Can't restore ACL of %s\n"), jcr->last_fname); } #else non_support_acl++; @@ -457,24 +356,15 @@ void do_restore(JCR *jcr) pm_strcpy(jcr->acl_text, sd->msg); Dmsg2(400, "Restoring ACL type 0x%2x <%s>\n", BACL_TYPE_DEFAULT, jcr->acl_text); if (bacl_set(jcr, BACL_TYPE_DEFAULT) != 0) { - Qmsg1(jcr, M_WARNING, 0, _("Can't restore default ACL of %s\n"), jcr->last_fname); + Jmsg1(jcr, M_WARNING, 0, _("Can't restore default ACL of %s\n"), jcr->last_fname); } #else non_support_acl++; #endif break; - case STREAM_SIGNED_DIGEST: - /* Save signature. */ - if ((sig = crypto_sign_decode(sd->msg, (size_t) sd->msglen)) == NULL) { - Jmsg1(jcr, M_ERROR, 0, _("Failed to decode message signature for %s\n"), jcr->last_fname); - } - break; - - case STREAM_MD5_DIGEST: - case STREAM_SHA1_DIGEST: - case STREAM_SHA256_DIGEST: - case STREAM_SHA512_DIGEST: + case STREAM_MD5_SIGNATURE: + case STREAM_SHA1_SIGNATURE: break; case STREAM_PROGRAM_NAMES: @@ -492,24 +382,7 @@ void do_restore(JCR *jcr) if (size > 0 && !is_bopen(&bfd)) { Jmsg0(jcr, M_ERROR, 0, _("Logic error: output file should be open\n")); } - /* Flush and deallocate cipher context */ - if (cipher_ctx) { - flush_cipher(jcr, &bfd, flags, cipher_ctx, cipher_block_size); - crypto_cipher_free(cipher_ctx); - cipher_ctx = NULL; - } set_attributes(jcr, attr, &bfd); - - /* Verify the cryptographic signature if any */ - if (jcr->pki_sign) { - if (sig) { - // Failure is reported in verify_signature() ... - verify_signature(jcr, sig); - } else { - Jmsg1(jcr, M_ERROR, 0, _("Missing cryptographic signature for %s\n"), jcr->last_fname); - } - } - extract = false; } else if (is_bopen(&bfd)) { Jmsg0(jcr, M_ERROR, 0, _("Logic error: output file should not be open\n")); @@ -529,58 +402,22 @@ void do_restore(JCR *jcr) bclose_chksize(jcr, &altbfd, alt_size); } if (extract) { - /* Flush and deallocate cipher context */ - if (cipher_ctx) { - flush_cipher(jcr, &bfd, flags, cipher_ctx, cipher_block_size); - crypto_cipher_free(cipher_ctx); - cipher_ctx = NULL; - } set_attributes(jcr, attr, &bfd); - - /* Verify the cryptographic signature on the last file, if any */ - if (jcr->pki_sign) { - if (sig) { - // Failure is reported in verify_signature() ... - verify_signature(jcr, sig); - } else { - Jmsg1(jcr, M_ERROR, 0, _("Missing cryptographic signature for %s\n"), jcr->last_fname); - } - } } - if (is_bopen(&bfd)) { bclose(&bfd); } - set_jcr_job_status(jcr, JS_Terminated); goto ok_out; bail_out: set_jcr_job_status(jcr, JS_ErrorTerminated); ok_out: - - /* Free Signature & Crypto Data */ - if (sig) { - crypto_sign_free(sig); - sig = NULL; - } - if (cs) { - crypto_session_free(cs); - cs = NULL; - } - if (cipher_ctx) { - crypto_cipher_free(cipher_ctx); - cipher_ctx = NULL; - } if (jcr->compress_buf) { free(jcr->compress_buf); jcr->compress_buf = NULL; jcr->compress_buf_size = 0; } - if (jcr->crypto_buf) { - free_pool_memory(jcr->crypto_buf); - jcr->crypto_buf = NULL; - } bclose(&altbfd); bclose(&bfd); free_attr(attr); @@ -631,70 +468,6 @@ static const char *zlib_strerror(int stat) } #endif -static int do_file_digest(FF_PKT *ff_pkt, void *pkt, bool top_level) { - JCR *jcr = (JCR *) pkt; - return (digest_file(jcr, ff_pkt, jcr->digest)); -} - -/* - * Verify the signature for the last restored file - * Return value is either true (signature correct) - * or false (signature could not be verified). - * TODO landonf: Better signature failure handling. - */ -int verify_signature(JCR *jcr, SIGNATURE *sig) -{ - X509_KEYPAIR *keypair; - DIGEST *digest = NULL; - crypto_error_t err; - - /* Iterate through the trusted signers */ - foreach_alist(keypair, jcr->pki_signers) { - err = crypto_sign_get_digest(sig, jcr->pki_keypair, &digest); - - switch (err) { - case CRYPTO_ERROR_NONE: - /* Signature found, digest allocated */ - jcr->digest = digest; - - /* Checksum the entire file */ - if (find_one_file(jcr, jcr->ff, do_file_digest, jcr, jcr->last_fname, (dev_t)-1, 1) != 0) { - Qmsg(jcr, M_ERROR, 0, _("Signature validation failed for %s: \n"), jcr->last_fname); - return false; - } - - /* Verify the signature */ - if ((err = crypto_sign_verify(sig, keypair, digest)) != CRYPTO_ERROR_NONE) { - Dmsg1(100, "Bad signature on %s\n", jcr->last_fname); - Qmsg2(jcr, M_ERROR, 0, _("Signature validation failed for %s: %s\n"), jcr->last_fname, crypto_strerror(err)); - crypto_digest_free(digest); - return false; - } - - /* Valid signature */ - Dmsg1(100, "Signature good on %s\n", jcr->last_fname); - crypto_digest_free(digest); - return true; - - case CRYPTO_ERROR_NOSIGNER: - /* Signature not found, try again */ - continue; - default: - /* Something strange happened (that shouldn't happen!)... */ - Qmsg2(jcr, M_ERROR, 0, _("Signature validation failed for %s: %s\n"), jcr->last_fname, crypto_strerror(err)); - if (digest) { - crypto_digest_free(digest); - } - return false; - } - } - - /* No signer */ - Dmsg1(100, "Could not find a valid public key for signature on %s\n", jcr->last_fname); - crypto_digest_free(digest); - return false; -} - /* * In the context of jcr, write data to bfd. * We write buflen bytes in buf at addr. addr is updated in place. @@ -702,16 +475,13 @@ int verify_signature(JCR *jcr, SIGNATURE *sig) * Return value is the number of bytes written, or -1 on errors. */ int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, - uint64_t *addr, int flags, CIPHER_CONTEXT *cipher, size_t cipher_block_size) + uint64_t *addr, int flags) { int stat; char *wbuf; /* write buffer */ uint32_t wsize; /* write size */ uint32_t rsize; /* read size */ char ec1[50]; /* Buffer printing huge values */ - const void *cipher_input; /* Decryption input */ - size_t cipher_input_len; /* Decryption input length */ - size_t decrypted_len = 0; /* Decryption output length */ if (flags & FO_SPARSE) { ser_declare; @@ -736,8 +506,6 @@ int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, rsize = buflen; } wsize = rsize; - cipher_input = wbuf; - cipher_input_len = wsize; if (flags & FO_GZIP) { #ifdef HAVE_LIBZ @@ -751,111 +519,31 @@ int32_t extract_data(JCR *jcr, BFILE *bfd, POOLMEM *buf, int32_t buflen, Dmsg2(100, "Comp_len=%d msglen=%d\n", compress_len, wsize); if ((stat=uncompress((Byte *)jcr->compress_buf, &compress_len, (const Byte *)wbuf, (uLong)rsize)) != Z_OK) { - Qmsg(jcr, M_ERROR, 0, _("Uncompression error on file %s. ERR=%s\n"), + Jmsg(jcr, M_ERROR, 0, _("Uncompression error on file %s. ERR=%s\n"), jcr->last_fname, zlib_strerror(stat)); return -1; } wbuf = jcr->compress_buf; wsize = compress_len; - cipher_input = jcr->compress_buf; /* decrypt decompressed data */ - cipher_input_len = compress_len; Dmsg2(100, "Write uncompressed %d bytes, total before write=%s\n", compress_len, edit_uint64(jcr->JobBytes, ec1)); #else - Qmsg(jcr, M_ERROR, 0, _("GZIP data stream found, but GZIP not configured!\n")); + Jmsg(jcr, M_ERROR, 0, _("GZIP data stream found, but GZIP not configured!\n")); return -1; #endif } else { Dmsg2(30, "Write %u bytes, total before write=%s\n", wsize, edit_uint64(jcr->JobBytes, ec1)); } - if (flags & FO_ENCRYPT) { - ASSERT(cipher); - - /* - * Grow the crypto buffer, if necessary. - * crypto_cipher_update() will process only whole blocks, - * buffering the remaining input. - */ - jcr->crypto_buf = check_pool_memory_size(jcr->crypto_buf, cipher_input_len + cipher_block_size); - - - /* Encrypt the input block */ - if (!crypto_cipher_update(cipher, cipher_input, cipher_input_len, jcr->crypto_buf, &decrypted_len)) { - /* Decryption failed. Shouldn't happen. */ - Jmsg(jcr, M_FATAL, 0, _("Decryption error\n")); - return -1; - } - - if (decrypted_len == 0) { - /* No full block of data available, write more data */ - goto ok; - } - - Dmsg2(400, "decrypted len=%d undecrypted len=%d\n", - decrypted_len, cipher_input_len); - wsize = decrypted_len; - wbuf = jcr->crypto_buf; /* Decrypted, possibly decompressed output here. */ - } - - - if (flags & FO_WIN32DECOMP) { - if (!processWin32BackupAPIBlock(bfd, wbuf, wsize)) { - berrno be; - Jmsg2(jcr, M_ERROR, 0, _("Write error in Win32 Block Decomposition on %s: %s\n"), - jcr->last_fname, be.strerror(bfd->berrno)); - return -1; - } - } else if (bwrite(bfd, wbuf, wsize) != (ssize_t)wsize) { + if (bwrite(bfd, wbuf, wsize) != (ssize_t)wsize) { berrno be; Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"), jcr->last_fname, be.strerror(bfd->berrno)); return -1; } - if (decrypted_len && decrypted_len > wsize) { - /* If more than wsize is output, it was previously buffered - * and reported, and should not be reported again */ - wsize = wsize - decrypted_len; - } - -ok: jcr->JobBytes += wsize; jcr->ReadBytes += rsize; *addr += wsize; return wsize; } - -/* - * In the context of jcr, flush any remaining data from the cipher context, - * writing it to bfd. - * Return value is true on success, false on failure. - */ -bool flush_cipher(JCR *jcr, BFILE *bfd, int flags, CIPHER_CONTEXT *cipher, size_t cipher_block_size) -{ - size_t decrypted_len; - - /* Write out the remaining block and free the cipher context */ - jcr->crypto_buf = check_pool_memory_size(jcr->crypto_buf, cipher_block_size); - - if (!crypto_cipher_finalize(cipher, jcr->crypto_buf, &decrypted_len)) { - /* Writing out the final, buffered block failed. Shouldn't happen. */ - Jmsg1(jcr, M_FATAL, 0, _("Decryption error for %s\n"), jcr->last_fname); - } - - if (flags & FO_WIN32DECOMP) { - if (!processWin32BackupAPIBlock(bfd, jcr->crypto_buf, decrypted_len)) { - berrno be; - Jmsg2(jcr, M_ERROR, 0, _("Write error in Win32 Block Decomposition on %s: %s\n"), - jcr->last_fname, be.strerror(bfd->berrno)); - return false; - } - } else if (bwrite(bfd, jcr->crypto_buf, decrypted_len) != (ssize_t)decrypted_len) { - berrno be; - Jmsg2(jcr, M_ERROR, 0, _("Write error on %s: %s\n"), - jcr->last_fname, be.strerror(bfd->berrno)); - return false; - } - - return true; -} diff --git a/bacula/src/filed/status.c b/bacula/src/filed/status.c index ede4e6d987..4962da52e5 100755 --- a/bacula/src/filed/status.c +++ b/bacula/src/filed/status.c @@ -172,9 +172,9 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a edit_uint64_with_commas(njcr->num_files_examined, b1)); sendit(msg, len, arg); if (njcr->JobFiles > 0) { - P(njcr->mutex); + njcr->lock(); len = Mmsg(msg, _(" Processing file: %s\n"), njcr->last_fname); - V(njcr->mutex); + njcr->unlock(); sendit(msg, len, arg); } diff --git a/bacula/src/filed/verify.c b/bacula/src/filed/verify.c index 8312b7006f..313825d864 100644 --- a/bacula/src/filed/verify.c +++ b/bacula/src/filed/verify.c @@ -1,5 +1,5 @@ /* - * Bacula File Daemon verify.c Verify files. + * Bacula File Daemon verify.c Verify files. * * Kern Sibbald, October MM * @@ -30,7 +30,7 @@ #include "filed.h" static int verify_file(FF_PKT *ff_pkt, void *my_pkt, bool); -static int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr); +static int read_chksum(BFILE *bfd, CHKSUM *chksum, JCR *jcr); /* * Find all the requested files and send attributes @@ -43,7 +43,7 @@ void do_verify(JCR *jcr) jcr->buf_size = DEFAULT_NETWORK_BUFFER_SIZE; if ((jcr->big_buf = (char *) malloc(jcr->buf_size)) == NULL) { Jmsg1(jcr, M_ABORT, 0, _("Cannot malloc %d network read buffer\n"), - DEFAULT_NETWORK_BUFFER_SIZE); + DEFAULT_NETWORK_BUFFER_SIZE); } set_find_options((FF_PKT *)jcr->ff, jcr->incremental, jcr->mtime); Dmsg0(10, "Start find files\n"); @@ -67,9 +67,9 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt, bool top_level) { char attribs[MAXSTRING]; char attribsEx[MAXSTRING]; - int digest_stream = STREAM_NONE; int stat; - DIGEST *digest = NULL; + BFILE bfd; + struct CHKSUM chksum; BSOCK *dir; JCR *jcr = (JCR *)pkt; @@ -78,10 +78,10 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt, bool top_level) } dir = jcr->dir_bsock; - jcr->num_files_examined++; /* bump total file count */ + jcr->num_files_examined++; /* bump total file count */ switch (ff_pkt->type) { - case FT_LNKSAVED: /* Hard linked, file already saved */ + case FT_LNKSAVED: /* Hard linked, file already saved */ Dmsg2(30, "FT_LNKSAVED saving: %s => %s\n", ff_pkt->fname, ff_pkt->link); break; case FT_REGE: @@ -94,7 +94,7 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt, bool top_level) Dmsg2(30, "FT_LNK saving: %s -> %s\n", ff_pkt->fname, ff_pkt->link); break; case FT_DIRBEGIN: - return 1; /* ignored */ + return 1; /* ignored */ case FT_DIREND: Dmsg1(30, "FT_DIR saving: %s\n", ff_pkt->fname); break; @@ -158,19 +158,19 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt, bool top_level) encode_stat(attribs, ff_pkt, 0); encode_attribsEx(jcr, attribsEx, ff_pkt); - P(jcr->mutex); - jcr->JobFiles++; /* increment number of files sent */ + jcr->lock(); + jcr->JobFiles++; /* increment number of files sent */ pm_strcpy(jcr->last_fname, ff_pkt->fname); - V(jcr->mutex); + jcr->unlock(); /* * Send file attributes to Director - * File_index - * Stream - * Verify Options - * Filename (full path) - * Encoded attributes - * Link name (if type==FT_LNK) + * File_index + * Stream + * Verify Options + * Filename (full path) + * Encoded attributes + * Link name (if type==FT_LNK) * For a directory, link is the same as fname, but with trailing * slash. For a linked file, link is the link. */ @@ -178,17 +178,17 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt, bool top_level) Dmsg2(400, "send ATTR inx=%d fname=%s\n", jcr->JobFiles, ff_pkt->fname); if (ff_pkt->type == FT_LNK || ff_pkt->type == FT_LNKSAVED) { stat = bnet_fsend(dir, "%d %d %s %s%c%s%c%s%c", jcr->JobFiles, - STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->fname, - 0, attribs, 0, ff_pkt->link, 0); + STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->fname, + 0, attribs, 0, ff_pkt->link, 0); } else if (ff_pkt->type == FT_DIREND) { - /* Here link is the canonical filename (i.e. with trailing slash) */ + /* Here link is the canonical filename (i.e. with trailing slash) */ stat = bnet_fsend(dir,"%d %d %s %s%c%s%c%c", jcr->JobFiles, - STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->link, - 0, attribs, 0, 0); + STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->link, + 0, attribs, 0, 0); } else { stat = bnet_fsend(dir,"%d %d %s %s%c%s%c%c", jcr->JobFiles, - STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->fname, - 0, attribs, 0, 0); + STREAM_UNIX_ATTRIBUTES, ff_pkt->VerifyOpts, ff_pkt->fname, + 0, attribs, 0, 0); } Dmsg2(20, "bfiled>bdird: attribs len=%d: msg=%s\n", dir->msglen, dir->msg); if (!stat) { @@ -201,64 +201,64 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt, bool top_level) * First we initialise, then we read files, other streams and Finder Info. */ if (ff_pkt->type != FT_LNKSAVED && (S_ISREG(ff_pkt->statp.st_mode) && - ff_pkt->flags & (FO_MD5|FO_SHA1|FO_SHA256|FO_SHA512))) { - /* - * Create our digest context. If this fails, the digest will be set to NULL - * and not used. - */ - if (ff_pkt->flags & FO_MD5) { - digest = crypto_digest_new(CRYPTO_DIGEST_MD5); - digest_stream = STREAM_MD5_DIGEST; - - } else if (ff_pkt->flags & FO_SHA1) { - digest = crypto_digest_new(CRYPTO_DIGEST_SHA1); - digest_stream = STREAM_SHA1_DIGEST; - - } else if (ff_pkt->flags & FO_SHA256) { - digest = crypto_digest_new(CRYPTO_DIGEST_SHA256); - digest_stream = STREAM_SHA256_DIGEST; - - } else if (ff_pkt->flags & FO_SHA512) { - digest = crypto_digest_new(CRYPTO_DIGEST_SHA512); - digest_stream = STREAM_SHA512_DIGEST; + ff_pkt->flags & (FO_MD5|FO_SHA1))) { + chksum_init(&chksum, ff_pkt->flags); + binit(&bfd); + + if (ff_pkt->statp.st_size > 0 || ff_pkt->type == FT_RAW + || ff_pkt->type == FT_FIFO) { + if ((bopen(&bfd, ff_pkt->fname, O_RDONLY | O_BINARY, 0)) < 0) { + ff_pkt->ff_errno = errno; + berrno be; + be.set_errno(bfd.berrno); + Jmsg(jcr, M_NOTSAVED, 1, _(" Cannot open %s: ERR=%s.\n"), + ff_pkt->fname, be.strerror()); + jcr->Errors++; + return 1; + } + read_chksum(&bfd, &chksum, jcr); + bclose(&bfd); } - /* Did digest initialization fail? */ - if (digest_stream != STREAM_NONE && digest == NULL) { - Jmsg(jcr, M_WARNING, 0, _("%s digest initialization failed\n"), - stream_to_ascii(digest_stream)); +#ifdef HAVE_DARWIN_OS + /* Open resource fork if necessary */ + if (ff_pkt->flags & FO_HFSPLUS && ff_pkt->hfsinfo.rsrclength > 0) { + if (bopen_rsrc(&bfd, ff_pkt->fname, O_RDONLY | O_BINARY, 0) < 0) { + ff_pkt->ff_errno = errno; + berrno be; + Jmsg(jcr, M_NOTSAVED, -1, _(" Cannot open resource fork for %s: ERR=%s.\n"), + ff_pkt->fname, be.strerror()); + jcr->Errors++; + if (is_bopen(&ff_pkt->bfd)) { + bclose(&ff_pkt->bfd); + } + return 1; + } + read_chksum(&bfd, &chksum, jcr); + bclose(&bfd); + } + if (ff_pkt->flags & FO_HFSPLUS) { + chksum_update(&chksum, ((unsigned char *)ff_pkt->hfsinfo.fndrinfo), 32); } +#endif /* compute MD5 or SHA1 hash */ - if (digest) { - char md[CRYPTO_DIGEST_MAX_SIZE]; - size_t size; - - size = sizeof(md); - - if (digest_file(jcr, ff_pkt, digest) != 0) { - jcr->Errors++; - return 1; - } - - if (crypto_digest_finalize(digest, &md, &size)) { - char *digest_buf; - const char *digest_name; - - digest_buf = (char *) malloc(BASE64_SIZE(size)); - digest_name = crypto_digest_name(digest); - - bin_to_base64(digest_buf, (char *) md, size); - Dmsg3(400, "send inx=%d %s=%s\n", jcr->JobFiles, digest_name, digest_buf); - bnet_fsend(dir, "%d %d %s *%s-%d*", jcr->JobFiles, digest_stream, digest_buf, - digest_name, jcr->JobFiles); - Dmsg3(20, "bfiled>bdird: %s len=%d: msg=%s\n", digest_name, - dir->msglen, dir->msg); - - free(digest_buf); - } - - crypto_digest_free(digest); + if (chksum.updated) { + char chksumbuf[40]; /* 24 should do */ + int stream = 0; + + chksum_final(&chksum); + if (chksum.type == CHKSUM_MD5) { + stream = STREAM_MD5_SIGNATURE; + } else if (chksum.type == CHKSUM_SHA1) { + stream = STREAM_SHA1_SIGNATURE; + } + bin_to_base64(chksumbuf, (char *)chksum.signature, chksum.length); + Dmsg3(400, "send inx=%d %s=%s\n", jcr->JobFiles, chksum.name, chksumbuf); + bnet_fsend(dir, "%d %d %s *%s-%d*", jcr->JobFiles, stream, chksumbuf, + chksum.name, jcr->JobFiles); + Dmsg3(20, "bfiled>bdird: %s len=%d: msg=%s\n", chksum.name, + dir->msglen, dir->msg); } } @@ -266,65 +266,15 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt, bool top_level) } /* - * Compute message digest for the file specified by ff_pkt. - * In case of errors we need the job control record and file name. - */ -int digest_file(JCR *jcr, FF_PKT *ff_pkt, DIGEST *digest) -{ - BFILE bfd; - - binit(&bfd); - - if (ff_pkt->statp.st_size > 0 || ff_pkt->type == FT_RAW - || ff_pkt->type == FT_FIFO) { - if ((bopen(&bfd, ff_pkt->fname, O_RDONLY | O_BINARY, 0)) < 0) { - ff_pkt->ff_errno = errno; - berrno be; - be.set_errno(bfd.berrno); - Jmsg(jcr, M_NOTSAVED, 1, _(" Cannot open %s: ERR=%s.\n"), - ff_pkt->fname, be.strerror()); - return 1; - } - read_digest(&bfd, digest, jcr); - bclose(&bfd); - } - -#ifdef HAVE_DARWIN_OS - /* Open resource fork if necessary */ - if (ff_pkt->flags & FO_HFSPLUS && ff_pkt->hfsinfo.rsrclength > 0) { - if (bopen_rsrc(&bfd, ff_pkt->fname, O_RDONLY | O_BINARY, 0) < 0) { - ff_pkt->ff_errno = errno; - berrno be; - Jmsg(jcr, M_NOTSAVED, -1, _(" Cannot open resource fork for %s: ERR=%s.\n"), - ff_pkt->fname, be.strerror()); - if (is_bopen(&ff_pkt->bfd)) { - bclose(&ff_pkt->bfd); - } - return 1; - } - read_digest(&bfd, digest, jcr); - bclose(&bfd); - } - - if (digest && ff_pkt->flags & FO_HFSPLUS) { - crypto_digest_update(digest, ff_pkt->hfsinfo.fndrinfo, 32); - } -#endif - - return 0; -} - -/* - * Read message digest of bfd, updating digest + * Read checksum of bfd, updating chksum * In case of errors we need the job control record and file name. */ -int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr) +int read_chksum(BFILE *bfd, CHKSUM *chksum, JCR *jcr) { - char buf[DEFAULT_NETWORK_BUFFER_SIZE]; int64_t n; - while ((n=bread(bfd, &buf, sizeof(buf))) > 0) { - crypto_digest_update(digest, &buf, n); + while ((n=bread(bfd, jcr->big_buf, jcr->buf_size)) > 0) { + chksum_update(chksum, ((unsigned char *)jcr->big_buf), (int)n); jcr->JobBytes += n; jcr->ReadBytes += n; } @@ -332,7 +282,7 @@ int read_digest(BFILE *bfd, DIGEST *digest, JCR *jcr) berrno be; be.set_errno(bfd->berrno); Jmsg(jcr, M_ERROR, 1, _("Error reading file %s: ERR=%s\n"), - jcr->last_fname, be.strerror()); + jcr->last_fname, be.strerror()); jcr->Errors++; return -1; } diff --git a/bacula/src/filed/verify_vol.c b/bacula/src/filed/verify_vol.c index abcf922500..cc764402a3 100644 --- a/bacula/src/filed/verify_vol.c +++ b/bacula/src/filed/verify_vol.c @@ -1,5 +1,5 @@ /* - * Bacula File Daemon verify-vol.c Verify files on a Volume + * Bacula File Daemon verify-vol.c Verify files on a Volume * versus attributes in Catalog * * Kern Sibbald, July MMII @@ -43,13 +43,12 @@ static char rec_header[] = "rechdr %ld %ld %ld %ld %ld"; void do_verify_volume(JCR *jcr) { BSOCK *sd, *dir; - POOLMEM *fname; /* original file name */ - POOLMEM *lname; /* link name */ + POOLMEM *fname; /* original file name */ + POOLMEM *lname; /* link name */ int32_t stream; uint32_t size; uint32_t VolSessionId, VolSessionTime, file_index; uint32_t record_file_index; - char digest[BASE64_SIZE(CRYPTO_DIGEST_MAX_SIZE)]; int type, stat; sd = jcr->store_bsock; @@ -68,7 +67,7 @@ void do_verify_volume(JCR *jcr) if (client) { buf_size = client->max_network_buffer_size; } else { - buf_size = 0; /* use default */ + buf_size = 0; /* use default */ } if (!bnet_set_buffer_size(sd, buf_size, BNET_SETBUF_WRITE)) { set_jcr_job_status(jcr, JS_FatalError); @@ -87,9 +86,9 @@ void do_verify_volume(JCR *jcr) * First we expect a Stream Record Header */ if (sscanf(sd->msg, rec_header, &VolSessionId, &VolSessionTime, &file_index, - &stream, &size) != 5) { + &stream, &size) != 5) { Jmsg1(jcr, M_FATAL, 0, _("Record header scan error: %s\n"), sd->msg); - goto bail_out; + goto bail_out; } Dmsg2(30, "Got hdr: FilInx=%d Stream=%d.\n", file_index, stream); @@ -98,11 +97,11 @@ void do_verify_volume(JCR *jcr) */ if (bget_msg(sd) < 0) { Jmsg1(jcr, M_FATAL, 0, _("Data record error. ERR=%s\n"), bnet_strerror(sd)); - goto bail_out; + goto bail_out; } if (size != ((uint32_t)sd->msglen)) { Jmsg2(jcr, M_FATAL, 0, _("Actual data size %d not same as header %d\n"), sd->msglen, size); - goto bail_out; + goto bail_out; } Dmsg1(30, "Got stream data, len=%d\n", sd->msglen); @@ -110,147 +109,131 @@ void do_verify_volume(JCR *jcr) switch (stream) { case STREAM_UNIX_ATTRIBUTES: case STREAM_UNIX_ATTRIBUTES_EX: - char *ap, *lp, *fp; + char *ap, *lp, *fp; Dmsg0(400, "Stream=Unix Attributes.\n"); - if ((int)sizeof_pool_memory(fname) < sd->msglen) { - fname = realloc_pool_memory(fname, sd->msglen + 1); - } - - if ((int)sizeof_pool_memory(lname) < sd->msglen) { - lname = realloc_pool_memory(lname, sd->msglen + 1); - } - *fname = 0; - *lname = 0; - - /* - * An Attributes record consists of: - * File_index - * Type (FT_types) - * Filename - * Attributes - * Link name (if file linked i.e. FT_LNK) - * Extended Attributes (if Win32) - */ + if ((int)sizeof_pool_memory(fname) < sd->msglen) { + fname = realloc_pool_memory(fname, sd->msglen + 1); + } + + if ((int)sizeof_pool_memory(lname) < sd->msglen) { + lname = realloc_pool_memory(lname, sd->msglen + 1); + } + *fname = 0; + *lname = 0; + + /* + * An Attributes record consists of: + * File_index + * Type (FT_types) + * Filename + * Attributes + * Link name (if file linked i.e. FT_LNK) + * Extended Attributes (if Win32) + */ if (sscanf(sd->msg, "%d %d", &record_file_index, &type) != 2) { Jmsg(jcr, M_FATAL, 0, _("Error scanning record header: %s\n"), sd->msg); Dmsg0(0, "\nError scanning header\n"); - goto bail_out; - } + goto bail_out; + } Dmsg2(30, "Got Attr: FilInx=%d type=%d\n", record_file_index, type); - if (record_file_index != file_index) { + if (record_file_index != file_index) { Jmsg(jcr, M_FATAL, 0, _("Record header file index %ld not equal record index %ld\n"), - file_index, record_file_index); + file_index, record_file_index); Dmsg0(0, "File index error\n"); - goto bail_out; - } - ap = sd->msg; + goto bail_out; + } + ap = sd->msg; while (*ap++ != ' ') /* skip record file index */ - ; + ; while (*ap++ != ' ') /* skip type */ - ; - /* Save filename and position to attributes */ - fp = fname; - while (*ap != 0) { - *fp++ = *ap++; /* copy filename to fname */ - } - *fp = *ap++; /* terminate filename & point to attribs */ + ; + /* Save filename and position to attributes */ + fp = fname; + while (*ap != 0) { + *fp++ = *ap++; /* copy filename to fname */ + } + *fp = *ap++; /* terminate filename & point to attribs */ Dmsg1(200, "Attr=%s\n", ap); - /* Skip to Link name */ - if (type == FT_LNK || type == FT_LNKSAVED) { - lp = ap; - while (*lp++ != 0) { - ; - } + /* Skip to Link name */ + if (type == FT_LNK || type == FT_LNKSAVED) { + lp = ap; + while (*lp++ != 0) { + ; + } pm_strcat(lname, lp); /* "save" link name */ - } else { - *lname = 0; - } - P(jcr->mutex); - jcr->JobFiles++; - jcr->num_files_examined++; - pm_strcpy(jcr->last_fname, fname); /* last file examined */ - V(jcr->mutex); - - /* - * Send file attributes to Director - * File_index - * Stream - * Verify Options - * Filename (full path) - * Encoded attributes - * Link name (if type==FT_LNK) - * For a directory, link is the same as fname, but with trailing - * slash. For a linked file, link is the link. - */ - /* Send file attributes to Director */ + } else { + *lname = 0; + } + jcr->lock(); + jcr->JobFiles++; + jcr->num_files_examined++; + pm_strcpy(jcr->last_fname, fname); /* last file examined */ + jcr->unlock(); + + /* + * Send file attributes to Director + * File_index + * Stream + * Verify Options + * Filename (full path) + * Encoded attributes + * Link name (if type==FT_LNK) + * For a directory, link is the same as fname, but with trailing + * slash. For a linked file, link is the link. + */ + /* Send file attributes to Director */ Dmsg2(200, "send ATTR inx=%d fname=%s\n", jcr->JobFiles, fname); - if (type == FT_LNK || type == FT_LNKSAVED) { + if (type == FT_LNK || type == FT_LNKSAVED) { stat = bnet_fsend(dir, "%d %d %s %s%c%s%c%s%c", jcr->JobFiles, STREAM_UNIX_ATTRIBUTES, "pinsug5", fname, - 0, ap, 0, lname, 0); - } else { + 0, ap, 0, lname, 0); + } else { stat = bnet_fsend(dir,"%d %d %s %s%c%s%c%c", jcr->JobFiles, STREAM_UNIX_ATTRIBUTES, "pinsug5", fname, - 0, ap, 0, 0); - } + 0, ap, 0, 0); + } Dmsg2(200, "bfiled>bdird: attribs len=%d: msg=%s\n", dir->msglen, dir->msg); - if (!stat) { + if (!stat) { Jmsg(jcr, M_FATAL, 0, _("Network error in send to Director: ERR=%s\n"), bnet_strerror(dir)); - goto bail_out; - } - break; + goto bail_out; + } + break; /* Data streams to ignore */ - case STREAM_ENCRYPTED_SESSION_DATA: case STREAM_FILE_DATA: case STREAM_SPARSE_DATA: case STREAM_WIN32_DATA: case STREAM_WIN32_GZIP_DATA: case STREAM_GZIP_DATA: case STREAM_SPARSE_GZIP_DATA: - case STREAM_SIGNED_DIGEST: - /* Do nothing */ - break; + /* Do nothing */ + break; - case STREAM_MD5_DIGEST: - bin_to_base64(digest, (char *)sd->msg, CRYPTO_DIGEST_MD5_SIZE); - Dmsg2(400, "send inx=%d MD5=%s\n", jcr->JobFiles, digest); - bnet_fsend(dir, "%d %d %s *MD5-%d*", jcr->JobFiles, STREAM_MD5_DIGEST, digest, - jcr->JobFiles); + case STREAM_MD5_SIGNATURE: + char MD5buf[30]; + bin_to_base64(MD5buf, (char *)sd->msg, 16); /* encode 16 bytes */ + Dmsg2(400, "send inx=%d MD5=%s\n", jcr->JobFiles, MD5buf); + bnet_fsend(dir, "%d %d %s *MD5-%d*", jcr->JobFiles, STREAM_MD5_SIGNATURE, MD5buf, + jcr->JobFiles); Dmsg2(20, "bfiled>bdird: MD5 len=%d: msg=%s\n", dir->msglen, dir->msg); break; - case STREAM_SHA1_DIGEST: - bin_to_base64(digest, (char *)sd->msg, CRYPTO_DIGEST_SHA1_SIZE); - Dmsg2(400, "send inx=%d SHA1=%s\n", jcr->JobFiles, digest); - bnet_fsend(dir, "%d %d %s *SHA1-%d*", jcr->JobFiles, STREAM_SHA1_DIGEST, - digest, jcr->JobFiles); + case STREAM_SHA1_SIGNATURE: + char SHA1buf[30]; + bin_to_base64(SHA1buf, (char *)sd->msg, 20); /* encode 20 bytes */ + Dmsg2(400, "send inx=%d SHA1=%s\n", jcr->JobFiles, SHA1buf); + bnet_fsend(dir, "%d %d %s *SHA1-%d*", jcr->JobFiles, STREAM_SHA1_SIGNATURE, + SHA1buf, jcr->JobFiles); Dmsg2(20, "bfiled>bdird: SHA1 len=%d: msg=%s\n", dir->msglen, dir->msg); break; - case STREAM_SHA256_DIGEST: - bin_to_base64(digest, (char *)sd->msg, CRYPTO_DIGEST_SHA256_SIZE); - Dmsg2(400, "send inx=%d SHA256=%s\n", jcr->JobFiles, digest); - bnet_fsend(dir, "%d %d %s *SHA256-%d*", jcr->JobFiles, STREAM_SHA256_DIGEST, - digest, jcr->JobFiles); - Dmsg2(20, "bfiled>bdird: SHA256 len=%d: msg=%s\n", dir->msglen, dir->msg); - break; - - case STREAM_SHA512_DIGEST: - bin_to_base64(digest, (char *)sd->msg, CRYPTO_DIGEST_SHA512_SIZE); - Dmsg2(400, "send inx=%d SHA512=%s\n", jcr->JobFiles, digest); - bnet_fsend(dir, "%d %d %s *SHA512-%d*", jcr->JobFiles, STREAM_SHA512_DIGEST, - digest, jcr->JobFiles); - Dmsg2(20, "bfiled>bdird: SHA512 len=%d: msg=%s\n", dir->msglen, dir->msg); - break; - default: Pmsg2(0, "None of above!!! stream=%d data=%s\n", stream,sd->msg); - break; + break; } /* end switch */ } /* end while bnet_get */ set_jcr_job_status(jcr, JS_Terminated); diff --git a/bacula/src/findlib/attribs.c b/bacula/src/findlib/attribs.c index 3e4f7cd64c..678aa9c71a 100755 --- a/bacula/src/findlib/attribs.c +++ b/bacula/src/findlib/attribs.c @@ -56,15 +56,6 @@ int select_data_stream(FF_PKT *ff_pkt) { int stream; - /* - * Fix all incompatible options - */ - - /* No sparse option for encrypted data */ - if (ff_pkt->flags & FO_ENCRYPT) { - ff_pkt->flags &= ~FO_SPARSE; - } - /* Note, no sparse option for win32_data */ if (!is_portable_backup(&ff_pkt->bfd)) { stream = STREAM_WIN32_DATA; @@ -74,65 +65,17 @@ int select_data_stream(FF_PKT *ff_pkt) } else { stream = STREAM_FILE_DATA; } - - /* Encryption is only supported for file data */ - if (stream != STREAM_FILE_DATA && stream != STREAM_WIN32_DATA && - stream != STREAM_MACOS_FORK_DATA) { - ff_pkt->flags &= ~FO_ENCRYPT; - } - - /* Compression is not supported for Mac fork data */ - if (stream == STREAM_MACOS_FORK_DATA) { - ff_pkt->flags &= ~FO_GZIP; - } - - /* - * Handle compression and encryption options - */ #ifdef HAVE_LIBZ if (ff_pkt->flags & FO_GZIP) { - switch (stream) { - case STREAM_WIN32_DATA: + if (stream == STREAM_WIN32_DATA) { stream = STREAM_WIN32_GZIP_DATA; - break; - case STREAM_SPARSE_DATA: - stream = STREAM_SPARSE_GZIP_DATA; - break; - case STREAM_FILE_DATA: + } else if (stream == STREAM_FILE_DATA) { stream = STREAM_GZIP_DATA; - break; - default: - /* All stream types that do not support gzip should clear out - * FO_GZIP above, and this code block should be unreachable. */ - ASSERT(!ff_pkt->flags & FO_GZIP); - return STREAM_NONE; - } - } -#endif -#ifdef HAVE_CRYPTO - if (ff_pkt->flags & FO_ENCRYPT) { - switch (stream) { - case STREAM_WIN32_DATA: - stream = STREAM_ENCRYPTED_WIN32_DATA; - break; - case STREAM_WIN32_GZIP_DATA: - stream = STREAM_ENCRYPTED_WIN32_GZIP_DATA; - break; - case STREAM_FILE_DATA: - stream = STREAM_ENCRYPTED_FILE_DATA; - break; - case STREAM_GZIP_DATA: - stream = STREAM_ENCRYPTED_FILE_GZIP_DATA; - break; - default: - /* All stream types that do not support encryption should clear out - * FO_ENCRYPT above, and this code block should be unreachable. */ - ASSERT(!ff_pkt->flags & FO_ENCRYPT); - return STREAM_NONE; + } else { + stream = STREAM_SPARSE_GZIP_DATA; } } #endif - return stream; } diff --git a/bacula/src/findlib/bfile.c b/bacula/src/findlib/bfile.c index 85b3ffe9e3..dc09ace024 100644 --- a/bacula/src/findlib/bfile.c +++ b/bacula/src/findlib/bfile.c @@ -12,14 +12,19 @@ Copyright (C) 2003-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ @@ -48,8 +53,6 @@ bool is_win32_stream(int stream) switch (stream) { case STREAM_WIN32_DATA: case STREAM_WIN32_GZIP_DATA: - case STREAM_ENCRYPTED_WIN32_DATA: - case STREAM_ENCRYPTED_WIN32_GZIP_DATA: return true; } return false; @@ -72,8 +75,8 @@ const char *stream_to_ascii(int stream) return _("File attributes"); case STREAM_FILE_DATA: return _("File data"); - case STREAM_MD5_DIGEST: - return _("MD5 digest"); + case STREAM_MD5_SIGNATURE: + return _("MD5 signature"); case STREAM_UNIX_ATTRIBUTES_EX: return _("Extended attributes"); case STREAM_SPARSE_DATA: @@ -82,168 +85,18 @@ const char *stream_to_ascii(int stream) return _("Program names"); case STREAM_PROGRAM_DATA: return _("Program data"); - case STREAM_SHA1_DIGEST: - return _("SHA1 digest"); + case STREAM_SHA1_SIGNATURE: + return _("SHA1 signature"); case STREAM_MACOS_FORK_DATA: return _("HFS+ resource fork"); case STREAM_HFSPLUS_ATTRIBUTES: return _("HFS+ Finder Info"); - case STREAM_SHA256_DIGEST: - return _("SHA256 digest"); - case STREAM_SHA512_DIGEST: - return _("SHA512 digest"); - case STREAM_SIGNED_DIGEST: - return _("Signed digest"); - case STREAM_ENCRYPTED_FILE_DATA: - return _("Encrypted File data"); - case STREAM_ENCRYPTED_FILE_GZIP_DATA: - return _("Encrypted GZIP data"); - case STREAM_ENCRYPTED_WIN32_DATA: - return _("Encrypted Win32 data"); - case STREAM_ENCRYPTED_WIN32_GZIP_DATA: - return _("Encrypted Win32 GZIP data"); - case STREAM_ENCRYPTED_MACOS_FORK_DATA: - return _("Encrypted HFS+ resource fork"); default: sprintf(buf, "%d", stream); return (const char *)buf; } } - -void int64_LE2BE(int64_t* pBE, const int64_t v) -{ - /* convert little endian to big endian */ - if (htonl(1) != 1L) { /* no work if on little endian machine */ - memcpy(pBE, &v, sizeof(int64_t)); - } else { - int i; - uint8_t rv[sizeof(int64_t)]; - uint8_t *pv = (uint8_t *) &v; - - for (i = 0; i < 8; i++) { - rv[i] = pv[7 - i]; - } - memcpy(pBE, &rv, sizeof(int64_t)); - } -} - - -void int32_LE2BE(int32_t* pBE, const int32_t v) -{ - /* convert little endian to big endian */ - if (htonl(1) != 1L) { /* no work if on little endian machine */ - memcpy(pBE, &v, sizeof(int32_t)); - } else { - int i; - uint8_t rv[sizeof(int32_t)]; - uint8_t *pv = (uint8_t *) &v; - - for (i = 0; i < 4; i++) { - rv[i] = pv[3 - i]; - } - memcpy(pBE, &rv, sizeof(int32_t)); - } -} - - -bool processWin32BackupAPIBlock (BFILE *bfd, void *pBuffer, ssize_t dwSize) -{ - /* pByte contains the buffer - dwSize the len to be processed. function assumes to be - called in successive incremental order over the complete - BackupRead stream beginning at pos 0 and ending at the end. - */ - - PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT* pContext = &(bfd->win32DecompContext); - bool bContinue = false; - int64_t dwDataOffset = 0; - int64_t dwDataLen; - - /* Win32 Stream Header size without name of stream. - * = sizeof (WIN32_STREAM_ID)- sizeof(WCHAR*); - */ - int32_t dwSizeHeader = 20; - - do { - if (pContext->liNextHeader >= dwSize) { - dwDataLen = dwSize-dwDataOffset; - bContinue = false; /* 1 iteration is enough */ - } - else { - dwDataLen = pContext->liNextHeader-dwDataOffset; - bContinue = true; /* multiple iterations may be necessary */ - } - - /* flush */ - /* copy block of real DATA */ - if (pContext->bIsInData) { - if (bwrite(bfd, ((char *)pBuffer)+dwDataOffset, dwDataLen) != (ssize_t)dwDataLen) - return false; - } - - if (pContext->liNextHeader < dwSize) {/* is a header in this block ? */ - int32_t dwOffsetTarget; - int32_t dwOffsetSource; - - if (pContext->liNextHeader < 0) { - /* start of header was before this block, so we - * continue with the part in the current block - */ - dwOffsetTarget = -pContext->liNextHeader; - dwOffsetSource = 0; - } else { - /* start of header is inside of this block */ - dwOffsetTarget = 0; - dwOffsetSource = pContext->liNextHeader; - } - - int32_t dwHeaderPartLen = dwSizeHeader-dwOffsetTarget; - bool bHeaderIsComplete; - - if (dwHeaderPartLen <= dwSize-dwOffsetSource) - /* header (or rest of header) is completely available - in current block - */ - bHeaderIsComplete = true; - else { - /* header will continue in next block */ - bHeaderIsComplete = false; - dwHeaderPartLen = dwSize-dwOffsetSource; - } - - /* copy the available portion of header to persistent copy */ - memcpy(((char *)&pContext->header_stream)+dwOffsetTarget, ((char *)pBuffer)+dwOffsetSource, dwHeaderPartLen); - - /* recalculate position of next header */ - if (bHeaderIsComplete) { - /* convert stream name size (32 bit little endian) to machine type */ - int32_t dwNameSize; - int32_LE2BE (&dwNameSize, pContext->header_stream.dwStreamNameSize); - dwDataOffset = dwNameSize+pContext->liNextHeader+dwSizeHeader; - - /* convert stream size (64 bit little endian) to machine type */ - int64_LE2BE (&(pContext->liNextHeader), pContext->header_stream.Size); - pContext->liNextHeader += dwDataOffset; - - pContext->bIsInData = pContext->header_stream.dwStreamId == WIN32_BACKUP_DATA; - if (dwDataOffset == dwSize) - bContinue = false; - } - else { - /* stop and continue with next block */ - bContinue = false; - pContext->bIsInData = false; - } - } - } while (bContinue); - - /* set "NextHeader" relative to the beginning of the next block */ - pContext->liNextHeader-= dwSize; - - return TRUE; -} - /* =============================================================== @@ -311,53 +164,39 @@ bool have_win32_api() /* - * Return true if we support the stream - * false if we do not support the stream - * - * This code is running under Win32, so we - * do not need #ifdef on MACOS ... + * Return 1 if we support the stream + * 0 if we do not support the stream */ bool is_restore_stream_supported(int stream) { + /* No Win32 backup on this machine */ switch (stream) { - -/* Streams known not to be supported */ #ifndef HAVE_LIBZ case STREAM_GZIP_DATA: case STREAM_SPARSE_GZIP_DATA: - case STREAM_WIN32_GZIP_DATA: + return 0; #endif + case STREAM_WIN32_DATA: + case STREAM_WIN32_GZIP_DATA: + return have_win32_api(); + case STREAM_MACOS_FORK_DATA: case STREAM_HFSPLUS_ATTRIBUTES: - case STREAM_ENCRYPTED_MACOS_FORK_DATA: return false; /* Known streams */ #ifdef HAVE_LIBZ case STREAM_GZIP_DATA: case STREAM_SPARSE_GZIP_DATA: - case STREAM_WIN32_GZIP_DATA: #endif - case STREAM_WIN32_DATA: case STREAM_UNIX_ATTRIBUTES: case STREAM_FILE_DATA: - case STREAM_MD5_DIGEST: + case STREAM_MD5_SIGNATURE: case STREAM_UNIX_ATTRIBUTES_EX: case STREAM_SPARSE_DATA: case STREAM_PROGRAM_NAMES: case STREAM_PROGRAM_DATA: - case STREAM_SHA1_DIGEST: -#ifdef HAVE_SHA2 - case STREAM_SHA256_DIGEST: - case STREAM_SHA512_DIGEST: -#endif -#ifdef HAVE_CRYPTO - case STREAM_SIGNED_DIGEST: - case STREAM_ENCRYPTED_FILE_DATA: - case STREAM_ENCRYPTED_FILE_GZIP_DATA: - case STREAM_ENCRYPTED_WIN32_DATA: - case STREAM_ENCRYPTED_WIN32_GZIP_DATA: -#endif + case STREAM_SHA1_SIGNATURE: case 0: /* compatibility with old tapes */ return true; } @@ -375,7 +214,7 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) POOLMEM *win32_fname_wchar; DWORD dwaccess, dwflags, dwshare; - + /* Convert to Windows path format */ win32_fname = get_pool_memory(PM_FNAME); win32_fname_wchar = get_pool_memory(PM_FNAME); @@ -494,8 +333,6 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) } bfd->errmsg = NULL; bfd->lpContext = NULL; - bfd->win32DecompContext.bIsInData = false; - bfd->win32DecompContext.liNextHeader = 0; free_pool_memory(win32_fname_wchar); free_pool_memory(win32_fname); return bfd->mode == BF_CLOSED ? -1 : 1; @@ -694,18 +531,17 @@ bool set_prog(BFILE *bfd, char *prog, JCR *jcr) } -/* - * This code is running on a non-Win32 machine - */ + bool is_restore_stream_supported(int stream) { /* No Win32 backup on this machine */ - switch (stream) { + switch (stream) { #ifndef HAVE_LIBZ case STREAM_GZIP_DATA: case STREAM_SPARSE_GZIP_DATA: - case STREAM_WIN32_GZIP_DATA: #endif + case STREAM_WIN32_DATA: + case STREAM_WIN32_GZIP_DATA: #ifndef HAVE_DARWIN_OS case STREAM_MACOS_FORK_DATA: case STREAM_HFSPLUS_ATTRIBUTES: @@ -716,42 +552,56 @@ bool is_restore_stream_supported(int stream) #ifdef HAVE_LIBZ case STREAM_GZIP_DATA: case STREAM_SPARSE_GZIP_DATA: - case STREAM_WIN32_GZIP_DATA: #endif - case STREAM_WIN32_DATA: case STREAM_UNIX_ATTRIBUTES: case STREAM_FILE_DATA: - case STREAM_MD5_DIGEST: + case STREAM_MD5_SIGNATURE: case STREAM_UNIX_ATTRIBUTES_EX: case STREAM_SPARSE_DATA: case STREAM_PROGRAM_NAMES: case STREAM_PROGRAM_DATA: - case STREAM_SHA1_DIGEST: -#ifdef HAVE_SHA2 - case STREAM_SHA256_DIGEST: - case STREAM_SHA512_DIGEST: -#endif -#ifdef HAVE_CRYPTO - case STREAM_SIGNED_DIGEST: - case STREAM_ENCRYPTED_FILE_DATA: - case STREAM_ENCRYPTED_FILE_GZIP_DATA: - case STREAM_ENCRYPTED_WIN32_DATA: - case STREAM_ENCRYPTED_WIN32_GZIP_DATA: -#endif + case STREAM_SHA1_SIGNATURE: #ifdef HAVE_DARWIN_OS case STREAM_MACOS_FORK_DATA: case STREAM_HFSPLUS_ATTRIBUTES: -#ifdef HAVE_CRYPTO - case STREAM_ENCRYPTED_MACOS_FORK_DATA: -#endif /* HAVE_CRYPTO */ -#endif /* HAVE_DARWIN_OS */ - case 0: /* compatibility with old tapes */ +#endif + case 0: /* compatibility with old tapes */ return true; } - return false; + return 0; } +/* Old file reader code */ +#ifdef xxx + if (bfd->prog) { + POOLMEM *ecmd = get_pool_memory(PM_FNAME); + ecmd = edit_job_codes(bfd->jcr, ecmd, bfd->prog, fname); + const char *pmode; + if (flags & O_RDONLY) { + pmode = "r"; + } else { + pmode = "w"; + } + bfd->bpipe = open_bpipe(ecmd, 0, pmode); + if (bfd->bpipe == NULL) { + bfd->berrno = errno; + bfd->fid = -1; + free_pool_memory(ecmd); + return -1; + } + free_pool_memory(ecmd); + if (flags & O_RDONLY) { + bfd->fid = fileno(bfd->bpipe->rfd); + } else { + bfd->fid = fileno(bfd->bpipe->wfd); + } + errno = 0; + return bfd->fid; + } +#endif + + int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) { /* Open reader/writer program */ @@ -765,10 +615,6 @@ int bopen(BFILE *bfd, const char *fname, int flags, mode_t mode) bfd->berrno = errno; Dmsg1(400, "Open file %d\n", bfd->fid); errno = bfd->berrno; - - bfd->win32DecompContext.bIsInData = false; - bfd->win32DecompContext.liNextHeader = 0; - return bfd->fid; } diff --git a/bacula/src/findlib/bfile.h b/bacula/src/findlib/bfile.h index dc724fa7d4..1177dece37 100644 --- a/bacula/src/findlib/bfile.h +++ b/bacula/src/findlib/bfile.h @@ -6,17 +6,22 @@ * Kern Sibbald May MMIII */ /* - Copyright (C) 2003-2005 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ @@ -36,28 +41,6 @@ struct Python_IO { }; #endif - -/* this should physically correspond to WIN32_STREAM_ID - * from winbase.h on Win32. We didn't inlcude cStreamName - * as we don't use it and don't need it for a correct struct size. - */ - -#define WIN32_BACKUP_DATA 1 - -typedef struct _BWIN32_STREAM_ID { - int32_t dwStreamId; - int32_t dwStreamAttributes; - int64_t Size; - int32_t dwStreamNameSize; -} BWIN32_STREAM_ID, *LPBWIN32_STREAM_ID ; - - -typedef struct _PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT { - int64_t liNextHeader; - bool bIsInData; - BWIN32_STREAM_ID header_stream; -} PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT; - /* ======================================================= * * W I N D O W S @@ -91,8 +74,6 @@ struct BFILE { char *prog; /* reader/writer program if any */ JCR *jcr; /* jcr for editing job codes */ Python_IO pio; /* Python I/O routines */ - PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT win32DecompContext; /* context for decomposition of win32 backup streams */ - int use_backup_decomp; /* set if using BackupRead Stream Decomposition */ }; HANDLE bget_handle(BFILE *bfd); @@ -113,8 +94,6 @@ struct BFILE { char *prog; /* reader/writer program if any */ JCR *jcr; /* jcr for editing job codes */ Python_IO pio; /* Python I/O routines */ - PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT win32DecompContext; /* context for decomposition of win32 backup streams */ - int use_backup_decomp; /* set if using BackupRead Stream Decomposition */ }; #endif @@ -139,6 +118,4 @@ ssize_t bwrite(BFILE *bfd, void *buf, size_t count); off_t blseek(BFILE *bfd, off_t offset, int whence); const char *stream_to_ascii(int stream); -bool processWin32BackupAPIBlock (BFILE *bfd, void *pBuffer, ssize_t dwSize); - #endif /* __BFILE_H */ diff --git a/bacula/src/findlib/create_file.c b/bacula/src/findlib/create_file.c index 7eef249f35..cdc8bf6ee4 100644 --- a/bacula/src/findlib/create_file.c +++ b/bacula/src/findlib/create_file.c @@ -83,20 +83,20 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) switch (replace) { case REPLACE_IFNEWER: if (attr->statp.st_mtime <= mstatp.st_mtime) { - Qmsg(jcr, M_SKIPPED, 0, _("File skipped. Not newer: %s\n"), attr->ofname); + Jmsg(jcr, M_SKIPPED, 0, _("File skipped. Not newer: %s\n"), attr->ofname); return CF_SKIP; } break; case REPLACE_IFOLDER: if (attr->statp.st_mtime >= mstatp.st_mtime) { - Qmsg(jcr, M_SKIPPED, 0, _("File skipped. Not older: %s\n"), attr->ofname); + Jmsg(jcr, M_SKIPPED, 0, _("File skipped. Not older: %s\n"), attr->ofname); return CF_SKIP; } break; case REPLACE_NEVER: - Qmsg(jcr, M_SKIPPED, 0, _("File skipped. Already exists: %s\n"), attr->ofname); + Jmsg(jcr, M_SKIPPED, 0, _("File skipped. Already exists: %s\n"), attr->ofname); return CF_SKIP; case REPLACE_ALWAYS: @@ -117,11 +117,11 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) * we may blow away a FIFO that is being used to read the * restore data, or we may blow away a partition definition. */ - if (exists && attr->type != FT_RAW) { + if (exists && attr->type != FT_RAW && attr->type != FT_FIFO) { /* Get rid of old copy */ if (unlink(attr->ofname) == -1) { berrno be; - Qmsg(jcr, M_ERROR, 0, _("File %s already exists and could not be replaced. ERR=%s.\n"), + Jmsg(jcr, M_ERROR, 0, _("File %s already exists and could not be replaced. ERR=%s.\n"), attr->ofname, be.strerror()); /* Continue despite error */ } @@ -173,7 +173,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) } Dmsg1(50, "Create file: %s\n", attr->ofname); if (is_bopen(bfd)) { - Qmsg1(jcr, M_ERROR, 0, _("bpkt already open fid=%d\n"), bfd->fid); + Jmsg1(jcr, M_ERROR, 0, _("bpkt already open fid=%d\n"), bfd->fid); bclose(bfd); } /* @@ -195,7 +195,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) attr->ofname[pnl] = 0; /* terminate path */ Dmsg1(000, "Do chdir %s\n", attr->ofname); if (save_cwd(&cwd) != 0) { - Qmsg0(jcr, M_ERROR, 0, _("Could not save_dirn")); + Jmsg0(jcr, M_ERROR, 0, _("Could not save_dirn")); attr->ofname[pnl] = savechr; return CF_ERROR; } @@ -204,7 +204,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) *e = 0; if (chdir(p) < 0) { berrno be; - Qmsg2(jcr, M_ERROR, 0, _("Could not chdir to %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Could not chdir to %s: ERR=%s\n"), attr->ofname, be.strerror()); restore_cwd(&cwd, NULL, NULL); free_cwd(&cwd); @@ -217,7 +217,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) } if (chdir(p) < 0) { berrno be; - Qmsg2(jcr, M_ERROR, 0, _("Could not chdir to %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Could not chdir to %s: ERR=%s\n"), attr->ofname, be.strerror()); restore_cwd(&cwd, NULL, NULL); free_cwd(&cwd); @@ -237,7 +237,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) return CF_EXTRACT; } } - Qmsg2(jcr, M_ERROR, 0, _("Could not create %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Could not create %s: ERR=%s\n"), attr->ofname, be.strerror(bfd->berrno)); return CF_ERROR; } @@ -250,7 +250,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) Dmsg1(200, "Restore fifo: %s\n", attr->ofname); if (mkfifo(attr->ofname, attr->statp.st_mode) != 0 && errno != EEXIST) { berrno be; - Qmsg2(jcr, M_ERROR, 0, _("Cannot make fifo %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Cannot make fifo %s: ERR=%s\n"), attr->ofname, be.strerror()); return CF_ERROR; } @@ -258,7 +258,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) Dmsg1(200, "Restore node: %s\n", attr->ofname); if (mknod(attr->ofname, attr->statp.st_mode, attr->statp.st_rdev) != 0 && errno != EEXIST) { berrno be; - Qmsg2(jcr, M_ERROR, 0, _("Cannot make node %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Cannot make node %s: ERR=%s\n"), attr->ofname, be.strerror()); return CF_ERROR; } @@ -274,12 +274,12 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) tid = NULL; } if (is_bopen(bfd)) { - Qmsg1(jcr, M_ERROR, 0, _("bpkt already open fid=%d\n"), bfd->fid); + Jmsg1(jcr, M_ERROR, 0, _("bpkt already open fid=%d\n"), bfd->fid); } if ((bopen(bfd, attr->ofname, mode, 0)) < 0) { berrno be; be.set_errno(bfd->berrno); - Qmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), attr->ofname, be.strerror()); stop_thread_timer(tid); return CF_ERROR; @@ -294,7 +294,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) Dmsg2(130, "FT_LNK should restore: %s -> %s\n", attr->ofname, attr->olname); if (symlink(attr->olname, attr->ofname) != 0 && errno != EEXIST) { berrno be; - Qmsg3(jcr, M_ERROR, 0, _("Could not symlink %s -> %s: ERR=%s\n"), + Jmsg3(jcr, M_ERROR, 0, _("Could not symlink %s -> %s: ERR=%s\n"), attr->ofname, attr->olname, be.strerror()); return CF_ERROR; } @@ -304,7 +304,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) Dmsg2(130, "Hard link %s => %s\n", attr->ofname, attr->olname); if (link(attr->olname, attr->ofname) != 0) { berrno be; - Qmsg3(jcr, M_ERROR, 0, _("Could not hard link %s -> %s: ERR=%s\n"), + Jmsg3(jcr, M_ERROR, 0, _("Could not hard link %s -> %s: ERR=%s\n"), attr->ofname, attr->olname, be.strerror()); return CF_ERROR; } @@ -325,7 +325,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) */ if (!is_portable_backup(bfd)) { if (is_bopen(bfd)) { - Qmsg1(jcr, M_ERROR, 0, _("bpkt already open fid=%d\n"), bfd->fid); + Jmsg1(jcr, M_ERROR, 0, _("bpkt already open fid=%d\n"), bfd->fid); } if ((bopen(bfd, attr->ofname, O_WRONLY|O_BINARY, 0)) < 0) { berrno be; @@ -336,7 +336,7 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) return CF_SKIP; } #endif - Qmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), + Jmsg2(jcr, M_ERROR, 0, _("Could not open %s: ERR=%s\n"), attr->ofname, be.strerror()); return CF_ERROR; } @@ -355,10 +355,10 @@ int create_file(JCR *jcr, ATTR *attr, BFILE *bfd, int replace) case FT_NORECURSE: case FT_NOFSCHG: case FT_NOOPEN: - Qmsg2(jcr, M_ERROR, 0, _("Original file %s not saved: type=%d\n"), attr->fname, attr->type); + Jmsg2(jcr, M_ERROR, 0, _("Original file %s not saved: type=%d\n"), attr->fname, attr->type); break; default: - Qmsg2(jcr, M_ERROR, 0, _("Unknown file type %d; not restored: %s\n"), attr->type, attr->fname); + Jmsg2(jcr, M_ERROR, 0, _("Unknown file type %d; not restored: %s\n"), attr->type, attr->fname); break; } return CF_ERROR; @@ -389,7 +389,7 @@ static int separate_path_and_file(JCR *jcr, char *fname, char *ofile) /* The filename length must not be zero here because we * are dealing with a file (i.e. FT_REGE or FT_REG). */ - Qmsg1(jcr, M_ERROR, 0, _("Zero length filename: %s\n"), fname); + Jmsg1(jcr, M_ERROR, 0, _("Zero length filename: %s\n"), fname); return -1; } pnl = f - ofile - 1; diff --git a/bacula/src/findlib/find.h b/bacula/src/findlib/find.h index d5487aa539..798fa25940 100755 --- a/bacula/src/findlib/find.h +++ b/bacula/src/findlib/find.h @@ -7,14 +7,19 @@ Copyright (C) 2001-2005 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. */ @@ -85,10 +90,6 @@ enum { #define FO_NO_HARDLINK (1<<15) /* don't handle hard links */ #define FO_IGNORECASE (1<<16) /* Ignore file name case */ #define FO_HFSPLUS (1<<17) /* Resource forks and Finder Info */ -#define FO_WIN32DECOMP (1<<18) /* Use BackupRead decomposition */ -#define FO_SHA256 (1<<19) /* Do SHA256 checksum */ -#define FO_SHA512 (1<<20) /* Do SHA512 checksum */ -#define FO_ENCRYPT (1<<21) /* Encrypt data stream */ struct s_included_file { struct s_included_file *next; diff --git a/bacula/src/gnome2-console/.cvsignore b/bacula/src/gnome2-console/.cvsignore index d1324549a1..37844ba1f1 100644 --- a/bacula/src/gnome2-console/.cvsignore +++ b/bacula/src/gnome2-console/.cvsignore @@ -6,4 +6,3 @@ gnome-console.conf 2 3 main.c -static-gnome-console diff --git a/bacula/src/gnome2-console/Makefile.in b/bacula/src/gnome2-console/Makefile.in index 5a4c28f3d2..89f63722e2 100644 --- a/bacula/src/gnome2-console/Makefile.in +++ b/bacula/src/gnome2-console/Makefile.in @@ -42,6 +42,8 @@ CONS_INC=$(GNOME_INCLUDEDIR) CONS_LIBS=$(GNOME_LIBS) CONS_LDFLAGS=$(GNOME_LIBDIR) $(GNOMEUI_LIBS) +OPENSSL_INC=@OPENSSL_INC@ +OPENSSL_LIBS=@OPENSSL_LIBS@ .SUFFIXES: .c .o .PHONY: @@ -49,7 +51,7 @@ CONS_LDFLAGS=$(GNOME_LIBDIR) $(GNOMEUI_LIBS) # inference rules .c.o: - $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< + $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< #------------------------------------------------------------------------- all: Makefile gnome-console @STATIC_GNOME_CONS@ @echo "==== Make of gnome-console is good ====" @@ -59,17 +61,17 @@ support.o: support.c rm -f support.c.orig mv support.c support.c.orig sed "s%parent = g_object_get_data%parent = \(GtkWidget \*\)g_object_get_data%" support.c.orig >support.c - $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< + $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(CONS_INC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $< gnome-console: $(CONSOBJS) ../lib/libbac.a $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -o $@ $(CONSOBJS) \ - $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lm + $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lm $(OPENSSL_LIBS) static-console: static-gnome-console static-gnome-console: $(CONSOBJS) ../lib/libbac.a $(CXX) $(LDFLAGS) $(CONS_LDFLAGS) -L../lib -o $@ $(CONSOBJS) \ - $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lm + $(LIBS) $(DLIB) $(CONS_LIBS) -lbac -lm $(OPENSSL_LIBS) strip $@ Makefile: $(srcdir)/Makefile.in $(topdir)/config.status @@ -122,7 +124,7 @@ depend: @$(MV) Makefile Makefile.bak @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile - @$(CXX) -S -M $(CPPFLAGS) $(XINC) -I$(srcdir) -I$(basedir) $(GNOME_INCLUDEDIR) $(SQL_INC) *.c >> Makefile + @$(CXX) -S -M $(CPPFLAGS) $(XINC) $(OPENSSL_INC) -I$(srcdir) -I$(basedir) $(GNOME_INCLUDEDIR) $(SQL_INC) *.c >> Makefile @if test -f Makefile ; then \ $(RMF) Makefile.bak; \ else \ diff --git a/bacula/src/gnome2-console/callbacks.c b/bacula/src/gnome2-console/callbacks.c index e46b575e71..f6fbfb930e 100644 --- a/bacula/src/gnome2-console/callbacks.c +++ b/bacula/src/gnome2-console/callbacks.c @@ -14,7 +14,7 @@ #include "support.h" #define KEY_Enter 65293 -#define KEY_Up 65362 +#define KEY_Up 65362 #define KEY_Down 65364 #define KEY_Left 65361 #define KEY_Right 65363 @@ -127,9 +127,9 @@ static void add_to_history(gchar *ecmd) int i; GList *hp; for (i=0; idata); - hist = g_list_remove(hist, hp->data); + hp = g_list_next(hist); + free(hp->data); + hist = g_list_remove(hist, hp->data); } hist_len -= HIST_DEL; } @@ -153,34 +153,34 @@ on_entry1_key_press_event(GtkWidget *widget, GdkEventKey *event, gpointer user_d gtk_entry_set_text((GtkEntry *)entry1, ""); } else if (event->keyval == KEY_Up) { if (!hc) { - if (!hist) { - return FALSE; - } - hc = g_list_last(hist); + if (!hist) { + return FALSE; + } + hc = g_list_last(hist); } else { - hc = g_list_previous(hc); + hc = g_list_previous(hc); } if (!hc) { - if (!hist) { - return FALSE; - } - hc = g_list_first(hist); + if (!hist) { + return FALSE; + } + hc = g_list_first(hist); } gtk_entry_set_text((GtkEntry *)entry1, (gchar *)hc->data); } else if (event->keyval == KEY_Down) { if (!hc) { - if (!hist) { - return FALSE; - } - hc = g_list_first(hist); + if (!hist) { + return FALSE; + } + hc = g_list_first(hist); } else { - hc = g_list_next(hc); + hc = g_list_next(hc); } if (!hc) { - if (!hist) { - return FALSE; - } - hc = g_list_last(hist); + if (!hist) { + return FALSE; + } + hc = g_list_last(hist); } gtk_entry_set_text((GtkEntry *)entry1, (gchar *)hc->data); } @@ -294,30 +294,30 @@ static void set_run_defaults() while (bnet_recv(UA_sock) > 0) { def = strchr(UA_sock->msg, '='); if (!def) { - continue; + continue; } *def++ = 0; if (strcmp(UA_sock->msg, "job") == 0 || - strcmp(UA_sock->msg, "when") == 0) { - continue; + strcmp(UA_sock->msg, "when") == 0) { + continue; } /* Where is an entry box */ if (strcmp(UA_sock->msg, "where") == 0) { - entry = lookup_widget(run_dialog, "entry_where"); - gtk_entry_set_text(GTK_ENTRY(entry), def); - continue; + entry = lookup_widget(run_dialog, "entry_where"); + gtk_entry_set_text(GTK_ENTRY(entry), def); + continue; } /* Now handle combo boxes */ list = find_combo_list(UA_sock->msg); if (!list) { - continue; + continue; } item = g_list_find_custom(list, def, compare_func); bsnprintf(cmd, sizeof(cmd), "combo_%s", UA_sock->msg); combo = lookup_widget(run_dialog, cmd); if (!combo) { - continue; + continue; } pos = g_list_position(list, item); gtk_list_select_item(GTK_LIST(GTK_COMBO(combo)->list), pos); @@ -405,9 +405,9 @@ on_run_ok_clicked(GtkButton *button, gpointer user_data) } bsnprintf(cmd, sizeof(cmd), - "run job=\"%s\" fileset=\"%s\" level=%s client=\"%s\" pool=\"%s\" " - "when=\"%s\" where=\"%s\" storage=\"%s\"", - job, fileset, level, client, pool, when, where, storage); + "run job=\"%s\" fileset=\"%s\" level=%s client=\"%s\" pool=\"%s\" " + "when=\"%s\" where=\"%s\" storage=\"%s\"", + job, fileset, level, client, pool, when, where, storage); write_director(cmd); set_text(cmd, strlen(cmd)); write_director("yes"); @@ -479,8 +479,8 @@ on_label_ok_clicked(GtkButton *button, gpointer user_data) } bsnprintf(cmd, sizeof(cmd), - "label volume=\"%s\" pool=\"%s\" storage=\"%s\" slot=%s", - volume, pool, storage, slot); + "label name=\"%s\" pool=\"%s\" storage=\"%s\" slot=%s", + volume, pool, storage, slot); write_director(cmd); set_text(cmd, strlen(cmd)); } @@ -516,12 +516,12 @@ on_select_files_button_clicked(GtkButton *button, gpointer user_data) } bsnprintf(cmd, sizeof(cmd), - "restore select current fileset=\"%s\" client=\"%s\" pool=\"%s\" " - "storage=\"%s\"", fileset, client, pool, storage); + "restore select current fileset=\"%s\" client=\"%s\" pool=\"%s\" " + "storage=\"%s\"", fileset, client, pool, storage); write_director(cmd); set_text(cmd, strlen(cmd)); gtk_widget_show(restore_file_selection); - select_restore_files(); /* put up select files dialog */ + select_restore_files(); /* put up select files dialog */ } void @@ -554,96 +554,96 @@ on_restore_files_delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_ void -on_new1_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_new1_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_open1_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_open1_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_save1_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_save1_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_save_as1_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_save_as1_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_quit1_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_quit1_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_cut2_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_cut2_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_copy2_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_copy2_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_paste2_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_paste2_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_clear2_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_clear2_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_properties1_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_properties1_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_preferences2_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_preferences2_activate (GtkMenuItem *menuitem, + gpointer user_data) { } void -on_about2_activate (GtkMenuItem *menuitem, - gpointer user_data) +on_about2_activate (GtkMenuItem *menuitem, + gpointer user_data) { } @@ -668,28 +668,28 @@ void set_restore_dialog_defaults() while (bnet_recv(UA_sock) > 0) { def = strchr(UA_sock->msg, '='); if (!def) { - continue; + continue; } *def++ = 0; if (strcmp(UA_sock->msg, "job") == 0 || - strcmp(UA_sock->msg, "when") == 0 || - strcmp(UA_sock->msg, "where") == 0 || - strcmp(UA_sock->msg, "messages") == 0 || - strcmp(UA_sock->msg, "level") == 0 || - strcmp(UA_sock->msg, "type") == 0) { - continue; + strcmp(UA_sock->msg, "when") == 0 || + strcmp(UA_sock->msg, "where") == 0 || + strcmp(UA_sock->msg, "messages") == 0 || + strcmp(UA_sock->msg, "level") == 0 || + strcmp(UA_sock->msg, "type") == 0) { + continue; } /* Now handle combo boxes */ list = find_combo_list(UA_sock->msg); if (!list) { - continue; + continue; } item = g_list_find_custom(list, def, compare_func); bsnprintf(cmd, sizeof(cmd), "combo_restore_%s", UA_sock->msg); combo = lookup_widget(restore_dialog, cmd); if (!combo) { - continue; + continue; } pos = g_list_position(list, item); gtk_list_select_item(GTK_LIST(GTK_COMBO(combo)->list), pos); diff --git a/bacula/src/gnome2-console/console.c b/bacula/src/gnome2-console/console.c index 17643ef706..38fc765ac9 100644 --- a/bacula/src/gnome2-console/console.c +++ b/bacula/src/gnome2-console/console.c @@ -267,8 +267,8 @@ int main(int argc, char *argv[]) parse_config(configfile); - if (init_crypto() != 0) { - Emsg0(M_ERROR_TERM, 0, _("Cryptography library initialization failed.\n")); + if (init_tls() != 0) { + Emsg0(M_ERROR_TERM, 0, _("TLS library initialization failed.\n")); } if (!check_resources()) { @@ -672,7 +672,7 @@ void terminate_console(int sig) if (already_here) /* avoid recursive temination problems */ exit(1); already_here = true; - cleanup_crypto(); + cleanup_tls(); disconnect_from_director((gpointer)NULL); gtk_main_quit(); exit(0); diff --git a/bacula/src/gnome2-console/console_conf.c b/bacula/src/gnome2-console/console_conf.c index fa9561ff65..ac4ad05fce 100644 --- a/bacula/src/gnome2-console/console_conf.c +++ b/bacula/src/gnome2-console/console_conf.c @@ -69,8 +69,8 @@ static RES_ITEM dir_items[] = { {"dirport", store_int, ITEM(dir_res.DIRport), 0, ITEM_DEFAULT, 9101}, {"address", store_str, ITEM(dir_res.address), 0, ITEM_REQUIRED, 0}, {"password", store_password, ITEM(dir_res.password), 0, 0, 0}, - {"tlsenable", store_bit, ITEM(dir_res.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(dir_res.tls_require), 1, 0, 0}, + {"tlsenable", store_yesno, ITEM(dir_res.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(dir_res.tls_require), 1, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(dir_res.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(dir_res.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(dir_res.tls_certfile), 0, 0, 0}, @@ -82,8 +82,8 @@ static RES_ITEM con_items[] = { {"name", store_name, ITEM(con_res.hdr.name), 0, ITEM_REQUIRED, 0}, {"description", store_str, ITEM(con_res.hdr.desc), 0, 0, 0}, {"password", store_password, ITEM(con_res.password), 0, ITEM_REQUIRED, 0}, - {"tlsenable", store_bit, ITEM(con_res.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(con_res.tls_require), 1, 0, 0}, + {"tlsenable", store_yesno, ITEM(con_res.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(con_res.tls_require), 1, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(con_res.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(con_res.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(con_res.tls_certfile), 0, 0, 0}, @@ -95,7 +95,7 @@ static RES_ITEM con_font_items[] = { {"name", store_name, ITEM(con_font.hdr.name), 0, ITEM_REQUIRED, 0}, {"description", store_str, ITEM(con_font.hdr.desc), 0, 0, 0}, {"font", store_str, ITEM(con_font.fontface), 0, 0, 0}, - {"requiressl", store_bit, ITEM(con_font.require_ssl), 1, ITEM_DEFAULT, 0}, + {"requiressl", store_yesno, ITEM(con_font.require_ssl), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; diff --git a/bacula/src/gnome2-console/test-gnome-console.conf b/bacula/src/gnome2-console/test-gnome-console.conf index fa5f9bcd4e..b2725a1f9f 100644 --- a/bacula/src/gnome2-console/test-gnome-console.conf +++ b/bacula/src/gnome2-console/test-gnome-console.conf @@ -5,6 +5,6 @@ Director { Name = rufus-dir DIRport = 8101 - address = localhost + address = rufus Password = UA_password } diff --git a/bacula/src/jcr.h b/bacula/src/jcr.h index a0e51aaaf2..0affa6b170 100644 --- a/bacula/src/jcr.h +++ b/bacula/src/jcr.h @@ -74,6 +74,18 @@ #define JS_WaitStartTime 't' /* Waiting for start time */ #define JS_WaitPriority 'p' /* Waiting for higher priority jobs to finish */ +/* Migration selection types */ +enum { + MT_SMALLEST_VOL = 1, + MT_OLDEST_VOL, + MT_POOL_OCCUPANCY, + MT_POOL_TIME, + MT_CLIENT, + MT_VOLUME, + MT_JOB, + MT_SQLQUERY +}; + #define job_canceled(jcr) \ (jcr->JobStatus == JS_Canceled || \ jcr->JobStatus == JS_ErrorTerminated || \ @@ -97,15 +109,22 @@ typedef void (JCR_free_HANDLER)(JCR *jcr); /* Job Control Record (JCR) */ class JCR { +private: + pthread_mutex_t mutex; /* jcr mutex */ + volatile int _use_count; /* use count */ public: - void inc_use_count(void) {P(mutex); use_count++; V(mutex); }; - void dec_use_count(void) {P(mutex); use_count--; V(mutex); }; + void inc_use_count(void) {P(mutex); _use_count++; V(mutex); }; + void dec_use_count(void) {P(mutex); _use_count--; V(mutex); }; + int use_count() { return _use_count; }; + void init_mutex(void) {pthread_mutex_init(&mutex, NULL); }; + void destroy_mutex(void) {pthread_mutex_destroy(&mutex); }; + void lock() {P(mutex); }; + void unlock() {V(mutex); }; + bool is_job_canceled() {return job_canceled(this); }; /* Global part of JCR common to all daemons */ dlink link; /* JCR chain link */ - volatile int use_count; /* use count */ pthread_t my_thread_id; /* id of thread controlling jcr */ - pthread_mutex_t mutex; /* jcr mutex */ BSOCK *dir_bsock; /* Director bsock or NULL if we are him */ BSOCK *store_bsock; /* Storage connection socket */ BSOCK *file_bsock; /* File daemon connection socket */ @@ -157,17 +176,14 @@ public: /* This should be empty in the library */ #ifdef DIRECTOR_DAEMON - /* Director Daemon specific part of JCR */ + /* Director Daemon specific data part of JCR */ pthread_t SD_msg_chan; /* Message channel thread id */ pthread_cond_t term_wait; /* Wait for job termination */ workq_ele_t *work_item; /* Work queue item if scheduled */ volatile bool sd_msg_thread_done; /* Set when Storage message thread terms */ BSOCK *ua; /* User agent */ JOB *job; /* Job resource */ - union { - JOB *verify_job; /* Job resource of verify target job */ - JOB *migration_job; /* Job resource of migration target job */ - }; + JOB *verify_job; /* Job resource of verify previous job */ alist *storage; /* Storage possibilities */ STORE *store; /* Storage daemon selected */ CLIENT *client; /* Client resource */ @@ -185,15 +201,20 @@ public: volatile int FDJobStatus; /* File daemon Job Status */ uint32_t ExpectedFiles; /* Expected restore files */ uint32_t MediaId; /* DB record IDs associated with this job */ + uint32_t PoolId; /* PoolId associated with Job */ FileId_t FileId; /* Last file id inserted */ uint32_t FileIndex; /* Last FileIndex processed */ POOLMEM *fname; /* name to put into catalog */ JOB_DBR jr; /* Job DB record for current job */ - JOB_DBR target_jr; /* target job */ - JCR *target_jcr; /* target job control record */ + JOB_DBR previous_jr; /* previous job database record */ + JOB *previous_job; /* Job resource of migration previous job */ + JCR *previous_jcr; /* previous job control record */ char FSCreateTime[MAX_TIME_LENGTH]; /* FileSet CreateTime as returned from DB */ char since[MAX_TIME_LENGTH]; /* since time */ - uint32_t RestoreJobId; /* Id specified by UA */ + union { + JobId_t RestoreJobId; /* Id specified by UA */ + JobId_t MigrateJobId; + }; POOLMEM *client_uname; /* client uname */ int replace; /* Replace option */ int NumVols; /* Number of Volume used in pool */ @@ -237,10 +258,10 @@ public: bool pki_sign; /* Enable PKI Signatures? */ bool pki_encrypt; /* Enable PKI Encryption? */ DIGEST *digest; /* Last file's digest context */ - X509_KEYPAIR *pki_keypair; /* Encryption key pair */ +// X509_KEYPAIR *pki_keypair; /* Encryption key pair */ alist *pki_signers; /* Trusted Signers */ alist *pki_recipients; /* Trusted Recipients */ - CRYPTO_SESSION *pki_session; /* PKE Public Keys + Symmetric Session Keys */ +// CRYPTO_SESSION *pki_session; /* PKE Public Keys + Symmetric Session Keys */ void *pki_session_encoded; /* Cached DER-encoded copy of pki_session */ size_t pki_session_encoded_size; /* Size of DER-encoded pki_session */ POOLMEM *crypto_buf; /* Encryption/Decryption buffer */ diff --git a/bacula/src/lib/Makefile.in b/bacula/src/lib/Makefile.in index d9809afdbf..3967cd2ebd 100644 --- a/bacula/src/lib/Makefile.in +++ b/bacula/src/lib/Makefile.in @@ -14,8 +14,6 @@ topdir = ../.. # this dir relative to top dir thisdir = src/lib -OPENSSL_LIBS = @OPENSSL_LIBS@ -OPENSSL_INC = @OPENSSL_INC@ DEBUG=@DEBUG@ @@ -24,10 +22,10 @@ dummy: LIBSRCS = alloc.c attr.c base64.c berrno.c bsys.c bget_msg.c \ bnet.c bnet_server.c \ - bpipe.c bshm.c bsnprintf.c btime.c \ - cram-md5.c crc32.c crypto.c daemon.c edit.c fnmatch.c \ + bpipe.c bshm.c btime.c \ + cram-md5.c crc32.c daemon.c edit.c fnmatch.c \ hmac.c idcache.c jcr.c lex.c alist.c dlist.c \ - md5.c message.c mem_pool.c openssl.c parse_conf.c \ + md5.c message.c mem_pool.c parse_conf.c \ queue.c regex.c \ res.c rwlock.c scan.c serial.c sha1.c \ semlock.c signal.c smartall.c tls.c tree.c \ @@ -37,10 +35,10 @@ LIBSRCS = alloc.c attr.c base64.c berrno.c bsys.c bget_msg.c \ LIBOBJS = alloc.o attr.o base64.o berrno.o bsys.o bget_msg.o \ bnet.o bnet_server.o \ - bpipe.o bshm.o bsnprintf.o btime.o \ - cram-md5.o crc32.o crypto.o daemon.o edit.o fnmatch.o \ + bpipe.o bshm.o btime.o \ + cram-md5.o crc32.o daemon.o edit.o fnmatch.o \ hmac.o idcache.o jcr.o lex.o alist.o dlist.o \ - md5.o message.o mem_pool.o openssl.o parse_conf.o \ + md5.o message.o mem_pool.o parse_conf.o \ queue.o regex.o \ res.o rwlock.o scan.o serial.o sha1.o \ semlock.o signal.o smartall.o tls.o tree.o \ @@ -50,6 +48,9 @@ LIBOBJS = alloc.o attr.o base64.o berrno.o bsys.o bget_msg.o \ EXTRAOBJS = @OBJLIST@ +OPENSSL_LIBS=@OPENSSL_LIBS@ +OPENSSL_INC=@OPENSSL_INC@ + .SUFFIXES: .c .o .ch .dvi .pdf .tex .view .w .1 .PHONY: @@ -99,15 +100,7 @@ sha1sum: sha1.o $(CXX) -DSHA1_SUM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c $(CXX) $(LDFLAGS) -L. -o $@ sha1.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm rm -f sha1.o - $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) sha1.c - -bsnprintf: bsnprintf.o - rm -f bsnprintf.o - $(CXX) -DTEST_PROGRAM $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c - $(CXX) $(LDFLAGS) -L. -o $@ bsnprintf.o $(LIBS) $(DLIB) -lbac $(OPENSSL_LIBS) -lm - rm -f bsnprintf.o - $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) bsnprintf.c - + $(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) md5.c install: @@ -130,6 +123,7 @@ distclean: realclean # `semi'-automatic since dependencies are generated at distribution time. depend: + @$(RMF) -f Makefile.bak @$(MV) Makefile Makefile.bak @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile @@ -141,5 +135,6 @@ depend: echo " ===== Something went wrong in make depend ====="; \ fi + # ----------------------------------------------------------------------- -# DO NOT DELETE: nice dependency list follows +# DO NOT DELETE: nice dependency list follows diff --git a/bacula/src/lib/alist.h b/bacula/src/lib/alist.h index 1682575703..e1c6e39ae7 100644 --- a/bacula/src/lib/alist.h +++ b/bacula/src/lib/alist.h @@ -26,17 +26,18 @@ * * Loop var through each member of list */ +#ifdef HAVE_GCC +#define foreach_alist(var, list) \ + for((var)=(typeof(var))(list)->first(); (var); (var)=(typeof(var))(list)->next() ) +#else #define foreach_alist(var, list) \ for((*((void **)&(var))=(void*)((list)->first())); \ (var); \ (*((void **)&(var))=(void*)((list)->next()))) - -#ifdef the_easy_way -#define foreach_alist(var, list) \ - for(((void*)(var))=(list)->first(); (var); ((void*)(var))=(list)->next()); ) #endif + /* Second arg of init */ enum { owned_by_alist = true, diff --git a/bacula/src/lib/attr.c b/bacula/src/lib/attr.c index 1b56f86618..379069075c 100644 --- a/bacula/src/lib/attr.c +++ b/bacula/src/lib/attr.c @@ -59,13 +59,13 @@ int unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr) * */ attr->stream = stream; - Dmsg1(400, "Attr: %s\n", rec); + Dmsg1(100, "Attr: %s\n", rec); if (sscanf(rec, "%d %d", &attr->file_index, &attr->type) != 2) { Jmsg(jcr, M_FATAL, 0, _("Error scanning attributes: %s\n"), rec); Dmsg1(100, "\nError scanning attributes. %s\n", rec); return 0; } - Dmsg2(400, "Got Attr: FilInx=%d type=%d\n", attr->file_index, attr->type); + Dmsg2(100, "Got Attr: FilInx=%d type=%d\n", attr->file_index, attr->type); if (attr->type & AR_DATA_STREAM) { attr->data_stream = 1; } else { @@ -96,7 +96,7 @@ int unpack_attributes_record(JCR *jcr, int32_t stream, char *rec, ATTR *attr) from_base64(&val, p); attr->data_stream = (int32_t)val; } - Dmsg7(400, "unpack_attr FI=%d Type=%d fname=%s attr=%s lname=%s attrEx=%s ds=%d\n", + Dmsg7(200, "unpack_attr FI=%d Type=%d fname=%s attr=%s lname=%s attrEx=%s ds=%d\n", attr->file_index, attr->type, attr->fname, attr->attr, attr->lname, attr->attrEx, attr->data_stream); *attr->ofname = 0; diff --git a/bacula/src/lib/bnet_pkt.c b/bacula/src/lib/bnet_pkt.c new file mode 100644 index 0000000000..d84d241b5f --- /dev/null +++ b/bacula/src/lib/bnet_pkt.c @@ -0,0 +1,153 @@ +/* + * Network Packet Utility Routines + * + * by Kern Sibbald, July MMII + * + * + * Version $Id$ + */ +/* + Copyright (C) 2002-2004 Kern Sibbald and John Walker + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, + MA 02111-1307, USA. + + */ + +#ifdef implemented + +#include "bacula.h" + +/* + * Receive a message from the other end. Each message consists of + * two packets. The first is a header that contains the size + * of the data that follows in the second packet. + * Returns number of bytes read + * Returns 0 on end of file + * Returns -1 on hard end of file (i.e. network connection close) + * Returns -2 on error + */ +int32_t +bnet_recv_pkt(BSOCK *bsock, BPKT *pkt, int *version) +{ + unser_declare; + short lversion; + int type; + + unser_begin(bsock->msg, 0); + unser_uint16(lversion); + *version = (int)lversion; + + + for ( ; pkt->type != BP_EOF; pkt++) { + if (pkt->id) { + ser_int8(BP_ID); + ser_string((char *)pkt->id); + } + ser_int8(pkt->type); + switch (pkt->type) { + case BP_CHAR: + ser_int8(*(int8_t *)pkt->value); + break; + case BP_INT32: + ser_int32(*(int32_t *)pkt->value); + break; + case BP_UINT32: + break; + ser_unit32(*(uint32_t *)pkt->value); + break; + case BP_INT64: + ser_int64(*(int64_t *)pkt->value); + break; + case BP_BTIME: + case BP_UTIME: + case BP_UINT64: + ser_uint64(*(uint64_t *)pkt->value); + break; + case BP_POOL: + case BP_STRING: + case BP_NAME: + ser_string((char *)pkt->value); + break; + case BP_BYTES: + ser_uint32(*(uint32_t *)pkt->len); + ser_bytes((char *)pkt->value, pkt->len); + break; + default: + Emsg1(M_ABORT, 0, _("Unknown BPKT type: %d\n"), pkt->type); + } + } + unser_end(bsock->msg, 0); + +} + +/* + * Send a message over the network. The send consists of + * two network packets. The first is sends a 32 bit integer containing + * the length of the data packet which follows. + * + * Returns: 0 on failure + * 1 on success + */ +int +bnet_send_pkt(BSOCK *bsock, BPKT *pkt, int version) +{ + ser_declare; + + ser_begin(bsock->msg, 0); + ser_uint16(version); + + for ( ; pkt->type != BP_EOF; pkt++) { + if (pkt->id) { + ser_int8(BP_ID); + ser_string((char *)pkt->id); + } + ser_int8(pkt->type); + switch (pkt->type) { + case BP_CHAR: + ser_int8(*(int8_t *)pkt->value); + break; + case BP_INT32: + ser_int32(*(int32_t *)pkt->value); + break; + case BP_UINT32: + break; + ser_unit32(*(uint32_t *)pkt->value); + break; + case BP_INT64: + ser_int64(*(int64_t *)pkt->value); + break; + case BP_BTIME: + case BP_UTIME: + case BP_UINT64: + ser_uint64(*(uint64_t *)pkt->value); + break; + case BP_POOL: + case BP_STRING: + case BP_NAME: + ser_string((char *)pkt->value); + break; + case BP_BYTES: + ser_uint32(*(uint32_t *)pkt->len); + ser_bytes((char *)pkt->value, pkt->len); + break; + default: + Emsg1(M_ABORT, 0, _("Unknown BPKT type: %d\n"), pkt->type); + } + } + ser_end(bsock->msg, 0); +} + +#endif diff --git a/bacula/src/lib/bpipe.c b/bacula/src/lib/bpipe.c index ca82913663..b87f106ab5 100644 --- a/bacula/src/lib/bpipe.c +++ b/bacula/src/lib/bpipe.c @@ -6,7 +6,7 @@ * Version $Id$ */ /* - Copyright (C) 2002-2005 Kern Sibbald + Copyright (C) 2002-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -62,13 +62,13 @@ BPIPE *open_bpipe(char *prog, int wait, const char *mode) printf("argc=%d argv=%s:\n", i, bargv[i]); } #endif - free_pool_memory(tprog); /* Each pipe is one way, write one end, read the other, so we need two */ if (mode_write && pipe(writep) == -1) { save_errno = errno; free(bpipe); errno = save_errno; + free_pool_memory(tprog); return NULL; } if (mode_read && pipe(readp) == -1) { @@ -79,6 +79,7 @@ BPIPE *open_bpipe(char *prog, int wait, const char *mode) } free(bpipe); errno = save_errno; + free_pool_memory(tprog); return NULL; } /* Start worker process */ @@ -95,6 +96,7 @@ BPIPE *open_bpipe(char *prog, int wait, const char *mode) } free(bpipe); errno = save_errno; + free_pool_memory(tprog); return NULL; case 0: /* child */ @@ -120,11 +122,10 @@ BPIPE *open_bpipe(char *prog, int wait, const char *mode) } exit(255); /* unknown errno */ - - default: /* parent */ break; } + free_pool_memory(tprog); if (mode_read) { close(readp[1]); /* close unused parent fds */ bpipe->rfd = fdopen(readp[0], "r"); /* open file descriptor */ diff --git a/bacula/src/lib/bsnprintf.c b/bacula/src/lib/bsnprintf.c deleted file mode 100644 index bd6c2a19d4..0000000000 --- a/bacula/src/lib/bsnprintf.c +++ /dev/null @@ -1,913 +0,0 @@ -/* - * Copyright Patrick Powell 1995 - * - * This code is based on code written by Patrick Powell - * (papowell@astart.com) It may be used for any purpose as long - * as this notice remains intact on all source code distributions. - * - * Adapted for Bacula -- note there were lots of bugs in - * the original code: %lld and %s were seriously broken, and - * with FP turned off %f seg faults. - * Kern Sibbald, November MMV - * - * Version $Id$ - */ - - -#include "bacula.h" -#define FP_OUTPUT 1 /* Bacula uses floating point */ - -/* - Temp only for me -- NOT YET READY FOR USE -- seems to work fine - on Linux, but doesn't build correctly on Win32 - */ -#ifdef USE_BSNPRINTF - -#ifdef HAVE_LONG_DOUBLE -#define LDOUBLE long double -#else -#define LDOUBLE double -#endif - -int bvsnprintf(char *buffer, int32_t maxlen, const char *format, va_list args); -static int32_t fmtstr(char *buffer, int32_t currlen, int32_t maxlen, - char *value, int flags, int min, int max); -static int32_t fmtint(char *buffer, int32_t currlen, int32_t maxlen, - int64_t value, int base, int min, int max, int flags); - -#ifdef FP_OUTPUT -# ifdef HAVE_FCVTL -# define fcvt fcvtl -# endif -static int32_t fmtfp(char *buffer, int32_t currlen, int32_t maxlen, - LDOUBLE fvalue, int min, int max, int flags); -#else -#define fmtfp(b, c, m, f, min, max, fl) currlen -#endif - -#define outch(c) {int len=currlen; if (currlen++ < maxlen) { buffer[len] = (c);}} - - -/* format read states */ -#define DP_S_DEFAULT 0 -#define DP_S_FLAGS 1 -#define DP_S_MIN 2 -#define DP_S_DOT 3 -#define DP_S_MAX 4 -#define DP_S_MOD 5 -#define DP_S_CONV 6 -#define DP_S_DONE 7 - -/* format flags - Bits */ -#define DP_F_MINUS (1 << 0) -#define DP_F_PLUS (1 << 1) -#define DP_F_SPACE (1 << 2) -#define DP_F_NUM (1 << 3) -#define DP_F_ZERO (1 << 4) -#define DP_F_UP (1 << 5) -#define DP_F_UNSIGNED (1 << 6) -#define DP_F_DOT (1 << 7) - -/* Conversion Flags */ -#define DP_C_INT16 1 -#define DP_C_INT32 2 -#define DP_C_LDOUBLE 3 -#define DP_C_INT64 4 - -#define char_to_int(p) ((p)- '0') -#define MAX(p,q) (((p) >= (q)) ? (p) : (q)) - -/* - You might ask why does Bacula have it's own printf routine? Well, - There are two reasons: 1. Here (as opposed to library routines), we - define %d and %ld to be 32 bit; %lld and %q to be 64 bit. 2. We - disable %n for security reasons. - */ - -int bsnprintf(char *str, int32_t size, const char *fmt, ...) -{ - va_list arg_ptr; - int len; - - va_start(arg_ptr, fmt); - len = bvsnprintf(str, size, fmt, arg_ptr); - va_end(arg_ptr); - return len; -} - - -int bvsnprintf(char *buffer, int32_t maxlen, const char *format, va_list args) -{ - char ch; - int64_t value; - char *strvalue; - int min; - int max; - int state; - int flags; - int cflags; - int32_t currlen; - int base; - int junk; -#ifdef FP_OUTPUT - LDOUBLE fvalue; -#endif - - state = DP_S_DEFAULT; - currlen = flags = cflags = min = 0; - max = -1; - ch = *format++; - *buffer = 0; - - while (state != DP_S_DONE) { - if ((ch == '\0') || (currlen >= maxlen)) - state = DP_S_DONE; - - switch (state) { - case DP_S_DEFAULT: - if (ch == '%') { - state = DP_S_FLAGS; - } else { - outch(ch); - } - ch = *format++; - break; - case DP_S_FLAGS: - switch (ch) { - case '-': - flags |= DP_F_MINUS; - ch = *format++; - break; - case '+': - flags |= DP_F_PLUS; - ch = *format++; - break; - case ' ': - flags |= DP_F_SPACE; - ch = *format++; - break; - case '#': - flags |= DP_F_NUM; - ch = *format++; - break; - case '0': - flags |= DP_F_ZERO; - ch = *format++; - break; - default: - state = DP_S_MIN; - break; - } - break; - case DP_S_MIN: - if (isdigit((unsigned char)ch)) { - min = 10 * min + char_to_int(ch); - ch = *format++; - } else if (ch == '*') { -#ifdef SECURITY_PROBLEM - min = va_arg(args, int); -#else - junk = va_arg(args, int); -#endif - ch = *format++; - state = DP_S_DOT; - } else - state = DP_S_DOT; - break; - case DP_S_DOT: - if (ch == '.') { - state = DP_S_MAX; - flags |= DP_F_DOT; - ch = *format++; - } else - state = DP_S_MOD; - break; - case DP_S_MAX: - if (isdigit((unsigned char)ch)) { - if (max < 0) - max = 0; - max = 10 * max + char_to_int(ch); - ch = *format++; - } else if (ch == '*') { -#ifdef SECURITY_PROBLEM - max = va_arg(args, int); -#else - junk = va_arg(args, int); -#endif - ch = *format++; - state = DP_S_MOD; - } else - state = DP_S_MOD; - break; - case DP_S_MOD: - switch (ch) { - case 'h': - cflags = DP_C_INT16; - ch = *format++; - break; - case 'l': - cflags = DP_C_INT32; - ch = *format++; - if (ch == 'l') { /* It's a long long */ - cflags = DP_C_INT64; - ch = *format++; - } - break; - case 'L': - cflags = DP_C_LDOUBLE; - ch = *format++; - break; - default: - break; - } - state = DP_S_CONV; - break; - case DP_S_CONV: - switch (ch) { - case 'd': - case 'i': - if (cflags == DP_C_INT16) { - value = va_arg(args, int32_t); - } else if (cflags == DP_C_INT32) { - value = va_arg(args, int32_t); - } else if (cflags == DP_C_INT64) { - value = va_arg(args, int64_t); - } else { - value = va_arg(args, int); - } - currlen = fmtint(buffer, currlen, maxlen, value, 10, min, max, flags); - break; - case 'X': - case 'x': - case 'o': - case 'u': - if (ch == 'o') { - base = 8; - } else if (ch == 'x') { - base = 16; - } else if (ch == 'X') { - base = 16; - flags |= DP_F_UP; - } else { - base = 10; - } - flags |= DP_F_UNSIGNED; - if (cflags == DP_C_INT16) { - value = va_arg(args, uint32_t); - } else if (cflags == DP_C_INT32) { - value = (long)va_arg(args, uint32_t); - } else if (cflags == DP_C_INT64) { - value = (int64_t) va_arg(args, uint64_t); - } else { - value = (long)va_arg(args, unsigned int); - } - currlen = fmtint(buffer, currlen, maxlen, value, base, min, max, flags); - break; - case 'f': - if (cflags == DP_C_LDOUBLE) { - fvalue = va_arg(args, LDOUBLE); - } else { - fvalue = va_arg(args, double); - } - currlen = fmtfp(buffer, currlen, maxlen, fvalue, min, max, flags); - break; - case 'E': - flags |= DP_F_UP; - case 'e': - if (cflags == DP_C_LDOUBLE) { - fvalue = va_arg(args, LDOUBLE); - } else { - fvalue = va_arg(args, double); - } - currlen = fmtfp(buffer, currlen, maxlen, fvalue, min, max, flags); - break; - case 'G': - flags |= DP_F_UP; - case 'g': - if (cflags == DP_C_LDOUBLE) { - fvalue = va_arg(args, LDOUBLE); - } else { - fvalue = va_arg(args, double); - } - currlen = fmtfp(buffer, currlen, maxlen, fvalue, min, max, flags); - break; - case 'c': - outch(va_arg(args, int)); - break; - case 's': - strvalue = va_arg(args, char *); - currlen = fmtstr(buffer, currlen, maxlen, strvalue, flags, min, max); - break; - case 'p': - strvalue = va_arg(args, char *); - currlen = fmtint(buffer, currlen, maxlen, (long)strvalue, 16, min, max, flags); - break; - case 'n': - if (cflags == DP_C_INT16) { - int16_t *num; - num = va_arg(args, int16_t *); -#ifdef SECURITY_PROBLEM - *num = currlen; -#endif - } else if (cflags == DP_C_INT32) { - int32_t *num; - num = va_arg(args, int32_t *); -#ifdef SECURITY_PROBLEM - *num = (int32_t)currlen; -#endif - } else if (cflags == DP_C_INT64) { - int64_t *num; - num = va_arg(args, int64_t *); -#ifdef SECURITY_PROBLEM - *num = (int64_t)currlen; -#endif - } else { - int32_t *num; - num = va_arg(args, int32_t *); -#ifdef SECURITY_PROBLEM - *num = (int32_t)currlen; -#endif - } - break; - case '%': - outch(ch); - break; - case 'w': - /* not supported yet, treat as next char */ - ch = *format++; - break; - default: - /* Unknown, skip */ - break; - } - ch = *format++; - state = DP_S_DEFAULT; - flags = cflags = min = 0; - max = -1; - break; - case DP_S_DONE: - break; - default: - /* hmm? */ - break; /* some picky compilers need this */ - } - } - if (currlen < maxlen - 1) { - buffer[currlen] = '\0'; - } else { - buffer[maxlen - 1] = '\0'; - } - return currlen; -} - -static int32_t fmtstr(char *buffer, int32_t currlen, int32_t maxlen, - char *value, int flags, int min, int max) -{ - int padlen, strln; /* amount to pad */ - int cnt = 0; - - if (value == 0) { - value = ""; - } - - if (flags & DP_F_DOT && max < 0) { /* Max not specified */ - max = 0; - } else if (max < 0) { - max = maxlen; - } - strln = strlen(value); - if (strln > max) { - strln = max; /* truncate to max */ - } - padlen = min - strln; - if (padlen < 0) { - padlen = 0; - } - if (flags & DP_F_MINUS) { - padlen = -padlen; /* Left Justify */ - } - - while (padlen > 0) { - outch(' '); - --padlen; - } - while (*value && (cnt < max)) { - outch(*value++); - ++cnt; - } - while (padlen < 0) { - outch(' '); - ++padlen; - } - return currlen; -} - -/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ - -static int32_t fmtint(char *buffer, int32_t currlen, int32_t maxlen, - int64_t value, int base, int min, int max, int flags) -{ - int signvalue = 0; - uint64_t uvalue; - char convert[20]; - int place = 0; - int spadlen = 0; /* amount to space pad */ - int zpadlen = 0; /* amount to zero pad */ - int caps = 0; - - if (max < 0) { - max = 0; - } - - uvalue = value; - - if (!(flags & DP_F_UNSIGNED)) { - if (value < 0) { - signvalue = '-'; - uvalue = -value; - } else if (flags & DP_F_PLUS) { /* Do a sign (+/i) */ - signvalue = '+'; - } else if (flags & DP_F_SPACE) { - signvalue = ' '; - } - } - - if (flags & DP_F_UP) { - caps = 1; /* Should characters be upper case? */ - } - - do { - convert[place++] = (caps ? "0123456789ABCDEF" : "0123456789abcdef") - [uvalue % (unsigned)base]; - uvalue = (uvalue / (unsigned)base); - } while (uvalue && (place < 20)); - if (place == 20) { - place--; - } - convert[place] = 0; - - zpadlen = max - place; - spadlen = min - MAX(max, place) - (signvalue ? 1 : 0); - if (zpadlen < 0) - zpadlen = 0; - if (spadlen < 0) - spadlen = 0; - if (flags & DP_F_ZERO) { - zpadlen = MAX(zpadlen, spadlen); - spadlen = 0; - } - if (flags & DP_F_MINUS) - spadlen = -spadlen; /* Left Justifty */ - -#ifdef DEBUG_SNPRINTF - printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n", - zpadlen, spadlen, min, max, place); -#endif - - /* Spaces */ - while (spadlen > 0) { - outch(' '); - --spadlen; - } - - /* Sign */ - if (signvalue) { - outch(signvalue); - } - - /* Zeros */ - if (zpadlen > 0) { - while (zpadlen > 0) { - outch('0'); - --zpadlen; - } - } - - /* Digits */ - while (place > 0) { - outch(convert[--place]); - } - - /* Left Justified spaces */ - while (spadlen < 0) { - outch(' '); - ++spadlen; - } - return currlen; -} - -#ifdef FP_OUTPUT - -static LDOUBLE abs_val(LDOUBLE value) -{ - LDOUBLE result = value; - - if (value < 0) - result = -value; - - return result; -} - -static LDOUBLE pow10(int exp) -{ - LDOUBLE result = 1; - - while (exp) { - result *= 10; - exp--; - } - - return result; -} - -static long round(LDOUBLE value) -{ - long intpart; - - intpart = (long)value; - value = value - intpart; - if (value >= 0.5) - intpart++; - - return intpart; -} - -static int32_t fmtfp(char *buffer, int32_t currlen, int32_t maxlen, - LDOUBLE fvalue, int min, int max, int flags) -{ - int signvalue = 0; - LDOUBLE ufvalue; -#ifndef HAVE_FCVT - char iconvert[20]; - char fconvert[20]; -#else - char iconvert[311]; - char fconvert[311]; - char *result; - int dec_pt, sig; - int r_length; - extern char *fcvt(double value, int ndigit, int *decpt, int *sign); -#endif - int iplace = 0; - int fplace = 0; - int padlen = 0; /* amount to pad */ - int zpadlen = 0; - int caps = 0; - int64_t intpart; - int64_t fracpart; - - /* - * AIX manpage says the default is 0, but Solaris says the default - * is 6, and sprintf on AIX defaults to 6 - */ - if (max < 0) - max = 6; - - ufvalue = abs_val(fvalue); - - if (fvalue < 0) - signvalue = '-'; - else if (flags & DP_F_PLUS) /* Do a sign (+/i) */ - signvalue = '+'; - else if (flags & DP_F_SPACE) - signvalue = ' '; - -#if 0 - if (flags & DP_F_UP) - caps = 1; /* Should characters be upper case? */ -#endif - -#ifndef HAVE_FCVT - intpart = (long)ufvalue; - - /* - * Sorry, we only support 9 digits past the decimal because of our - * conversion method - */ - if (max > 9) - max = 9; - - /* We "cheat" by converting the fractional part to integer by - * multiplying by a factor of 10 - */ - fracpart = round((pow10(max)) * (ufvalue - intpart)); - - if (fracpart >= pow10(max)) { - intpart++; - fracpart -= (int64_t)pow10(max); - } -#ifdef DEBUG_SNPRINTF - printf("fmtfp: %g %d.%d min=%d max=%d\n", - (double)fvalue, intpart, fracpart, min, max); -#endif - - /* Convert integer part */ - do { - iconvert[iplace++] = - (caps ? "0123456789ABCDEF" : "0123456789abcdef")[intpart % 10]; - intpart = (intpart / 10); - } while (intpart && (iplace < 20)); - if (iplace == 20) - iplace--; - iconvert[iplace] = 0; - - /* Convert fractional part */ - do { - fconvert[fplace++] = - (caps ? "0123456789ABCDEF" : "0123456789abcdef")[fracpart % 10]; - fracpart = (fracpart / 10); - } while (fracpart && (fplace < 20)); - if (fplace == 20) - fplace--; - fconvert[fplace] = 0; -#else /* use fcvt() */ - if (max > 310) - max = 310; -# ifdef HAVE_FCVTL - result = fcvtl(ufvalue, max, &dec_pt, &sig); -# else - result = fcvt(ufvalue, max, &dec_pt, &sig); -# endif - - r_length = strlen(result); - - /* - * Fix broken fcvt implementation returns.. - */ - - if (r_length == 0) { - result[0] = '0'; - result[1] = '\0'; - r_length = 1; - } - - if (r_length < dec_pt) - dec_pt = r_length; - - if (dec_pt <= 0) { - iplace = 1; - iconvert[0] = '0'; - iconvert[1] = '\0'; - - fplace = 0; - - while (r_length) - fconvert[fplace++] = result[--r_length]; - - while ((dec_pt < 0) && (fplace < max)) { - fconvert[fplace++] = '0'; - dec_pt++; - } - } else { - int c; - - iplace = 0; - for (c = dec_pt; c; iconvert[iplace++] = result[--c]); - iconvert[iplace] = '\0'; - - result += dec_pt; - fplace = 0; - - for (c = (r_length - dec_pt); c; fconvert[fplace++] = result[--c]); - } -#endif /* HAVE_FCVT */ - - /* -1 for decimal point, another -1 if we are printing a sign */ - padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); - zpadlen = max - fplace; - if (zpadlen < 0) { - zpadlen = 0; - } - if (padlen < 0) { - padlen = 0; - } - if (flags & DP_F_MINUS) { - padlen = -padlen; /* Left Justifty */ - } - - if ((flags & DP_F_ZERO) && (padlen > 0)) { - if (signvalue) { - outch(signvalue); - --padlen; - signvalue = 0; - } - while (padlen > 0) { - outch('0'); - --padlen; - } - } - while (padlen > 0) { - outch(' '); - --padlen; - } - if (signvalue) { - outch(signvalue); - } - - while (iplace > 0) { - outch(iconvert[--iplace]); - } - - -#ifdef DEBUG_SNPRINTF - printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); -#endif - - /* - * Decimal point. This should probably use locale to find the correct - * char to print out. - */ - if (max > 0) { - outch('.'); - while (fplace > 0) { - outch(fconvert[--fplace]); - } - } - - while (zpadlen > 0) { - outch('0'); - --zpadlen; - } - - while (padlen < 0) { - outch(' '); - ++padlen; - } - return currlen; -} -#endif /* FP_OUTPUT */ - - -#ifdef TEST_PROGRAM - -#ifndef LONG_STRING -#define LONG_STRING 1024 -#endif -int main(void) -{ - char buf1[LONG_STRING]; - char buf2[LONG_STRING]; - -#ifdef FP_OUTPUT - char *fp_fmt[] = { - "%-1.5f", - "%1.5f", - "%123.9f", - "%10.5f", - "% 10.5f", - "%+22.9f", - "%+4.9f", - "%01.3f", - "%4f", - "%3.1f", - "%3.2f", - "%.0f", - "%.1f", - NULL - }; - double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996, - 0.9996, 1.996, 4.136, 6442452944.1234, 0 - }; -#endif - char *int_fmt[] = { - "%-1.5d", - "%1.5d", - "%123.9d", - "%5.5d", - "%10.5d", - "% 10.5d", - "%+22.33d", - "%01.3d", - "%4d", - "%-1.5ld", - "%1.5ld", - "%123.9ld", - "%5.5ld", - "%10.5ld", - "% 10.5ld", - "%+22.33ld", - "%01.3ld", - "%4ld", - NULL - }; - long int_nums[] = { -1, 134, 91340, 341, 0203, 0 }; - - char *ll_fmt[] = { - "%-1.8lld", - "%1.8lld", - "%123.9lld", - "%5.8lld", - "%10.5lld", - "% 10.8lld", - "%+22.33lld", - "%01.3lld", - "%4lld", - NULL - }; - int64_t ll_nums[] = { -1976, 789134567890LL, 91340, 34123, 0203, 0 }; - - char *s_fmt[] = { - "%-1.8s", - "%1.8s", - "%123.9s", - "%5.8s", - "%10.5s", - "% 10.3s", - "%+22.1s", - "%01.3s", - "%s", - "%10s", - "%3s", - "%3.0s", - "%3.s", - NULL - }; - char *s_nums[] = { "abc", "def", "ghi", "123", "4567", "a", "bb", "ccccccc", NULL}; - - - int x, y; - int fail = 0; - int num = 0; - - printf("Testing snprintf format codes against system sprintf...\n"); - -#ifdef FP_OUTPUT - for (x = 0; fp_fmt[x] != NULL; x++) - for (y = 0; fp_nums[y] != 0; y++) { - bsnprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]); - sprintf(buf2, fp_fmt[x], fp_nums[y]); - if (strcmp(buf1, buf2)) { - printf - ("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", - fp_fmt[x], buf1, buf2); - fail++; - } - num++; - } -#endif - - for (x = 0; int_fmt[x] != NULL; x++) - for (y = 0; int_nums[y] != 0; y++) { - int pcount, bcount; - bcount = bsnprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]); - printf("%s\n", buf1); - pcount = sprintf(buf2, int_fmt[x], int_nums[y]); - if (bcount != pcount) { - printf("bsnprintf count %d doesn't match sprintf count %d\n", - bcount, pcount); - } - if (strcmp(buf1, buf2)) { - printf - ("bsnprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", - int_fmt[x], buf1, buf2); - fail++; - } - num++; - } - - for (x = 0; ll_fmt[x] != NULL; x++) { - for (y = 0; ll_nums[y] != 0; y++) { - int pcount, bcount; - bcount = bsnprintf(buf1, sizeof(buf1), ll_fmt[x], ll_nums[y]); - printf("%s\n", buf1); - pcount = sprintf(buf2, ll_fmt[x], ll_nums[y]); - if (bcount != pcount) { - printf("bsnprintf count %d doesn't match sprintf count %d\n", - bcount, pcount); - } - if (strcmp(buf1, buf2)) { - printf - ("bsnprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", - ll_fmt[x], buf1, buf2); - fail++; - } - num++; - } - } - - for (x = 0; s_fmt[x] != NULL; x++) { - for (y = 0; s_nums[y] != 0; y++) { - int pcount, bcount; - bcount = bsnprintf(buf1, sizeof(buf1), s_fmt[x], s_nums[y]); - printf("%s\n", buf1); - pcount = sprintf(buf2, s_fmt[x], s_nums[y]); - if (bcount != pcount) { - printf("bsnprintf count %d doesn't match sprintf count %d\n", - bcount, pcount); - } - if (strcmp(buf1, buf2)) { - printf - ("bsnprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", - s_fmt[x], buf1, buf2); - fail++; - } - num++; - } - } - - - printf("%d tests failed out of %d.\n", fail, num); -} -#endif /* TEST_PROGRAM */ - -#endif /* USE_BSNPRINTF */ diff --git a/bacula/src/lib/btree.c b/bacula/src/lib/btree.c deleted file mode 100644 index 5b822ba9cf..0000000000 --- a/bacula/src/lib/btree.c +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Bacula red-black binary tree routines. - * - * btree is a binary tree with the links being in the data item. - * - * Developped in part from ideas obtained from several online University - * courses. - * - * Kern Sibbald, November MMV - * - * Version $Id$ - * - */ -/* - Copyright (C) 2005 Kern Sibbald - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. - - */ - -#include "bacula.h" -#include "btree.h" - -/* =================================================================== - * btree - */ - -/* - * Insert an item in the tree, but only if it is unique - * otherwise, the item is returned non inserted - * The big trick is keeping the tree balanced after the - * insert. We use a parent pointer to make it simpler and - * to avoid recursion. - * - * Returns: item if item inserted - * other_item if same value already exists (item not inserted) - */ -bnode *btree::insert(bnode *item, int compare(bnode *item1, bnode *item2)) -{ - bnode *x, *y; - bnode *last = NULL; /* last leaf if not found */ - bnode *found = NULL; - int comp = 0; - - /* Search */ - x = head; - while (x && !found) { - last = x; - comp = compare(item, x); - if (comp < 0) { - x = x->left; - } else if (comp > 0) { - x = x->right; - } else { - found = x; - } - } - - if (found) { /* found? */ - return found; /* yes, return item found */ - } - /* Handle empty tree */ - if (num_items == 0) { - head = item; - num_items++; - return item; - } - x = last; - /* Not found, so insert it on appropriate side of tree */ - if (comp < 0) { - last->left = item; - } else { - last->right = item; - } - last->red = true; - item->parent = last; - num_items++; - - /* Now we must walk up the tree balancing it */ - x = last; - while (x != head && x->parent->red) { - if (x->parent == x->parent->parent->left) { - /* Look at the right side of our grandparent */ - y = x->parent->parent->right; - if (y && y->red) { - /* our parent must be black */ - x->parent->red = false; - y->red = false; - x->parent->parent->red = true; - x = x->parent->parent; /* move up to grandpa */ - } else { - if (x == x->parent->right) { /* right side of parent? */ - x = x->parent; - left_rotate(x); - } - /* make parent black too */ - x->parent->red = false; - x->parent->parent->red = true; - right_rotate(x->parent->parent); - } - } else { - /* Look at left side of our grandparent */ - y = x->parent->parent->left; - if (y && y->red) { - x->parent->red = false; - y->red = false; - x->parent->parent->red = true; - x = x->parent->parent; /* move up to grandpa */ - } else { - if (x == x->parent->left) { - x = x->parent; - right_rotate(x); - } - /* make parent black too */ - x->parent->red = false; - x->parent->parent->red = true; - left_rotate(x->parent->parent); - } - } - } - /* Make sure the head is always black */ - head->red = false; - return item; -} - - -/* - * Search for item - */ -bnode *btree::search(bnode *item, int compare(bnode *item1, bnode *item2)) -{ - bnode *found = NULL; - bnode *x; - int comp; - - x = head; - while (x) { - comp = compare(item, x); - if (comp < 0) { - x = x->left; - } else if (comp > 0) { - x = x->right; - } else { - found = x; - break; - } - } - return found; -} - -/* - * Get first item (i.e. lowest value) - */ -bnode *btree::first(void) -{ - bnode *x; - - x = head; - down = true; - while (x) { - if (x->left) { - x = x->left; - continue; - } - return x; - } - /* Tree is empty */ - return NULL; -} - -/* - * This is a non-recursive btree walk routine that returns - * the items one at a time in order. I've never seen a - * non-recursive tree walk routine published that returns - * one item at a time rather than doing a callback. - * - * Return the next item in sorted order. We assume first() - * was called once before calling this routine. - * We always go down as far as we can to the left, then up, and - * down one to the right, and again down as far as we can to the - * left. etc. - * - * Returns: pointer to next larger item - * NULL when no more items in tree - */ -bnode *btree::next(bnode *item) -{ - bnode *x; - - x = item; - if ((down && !x->left && x->right) || (!down && x->right)) { - /* Move down to right one */ - down = true; - x = x->right; - /* Then all the way down left */ - while (x->left) { - x = x->left; - } - return x; - } - - /* We have gone down all we can, so now go up */ - for ( ;; ) { - /* If at head, we are done */ - if (!x->parent) { - return NULL; - } - /* Move up in tree */ - down = false; - /* if coming from right, continue up */ - if (x->parent->right == x) { - x = x->parent; - continue; - } - /* Coming from left, go up one -- ie. return parent */ - return x->parent; - } -} - -/* - * Similer to next(), but visits all right nodes when - * coming up the tree. - */ -bnode *btree::any(bnode *item) -{ - bnode *x; - - x = item; - if ((down && !x->left && x->right) || (!down && x->right)) { - /* Move down to right one */ - down = true; - x = x->right; - /* Then all the way down left */ - while (x->left) { - x = x->left; - } - return x; - } - - /* We have gone down all we can, so now go up */ - for ( ;; ) { - /* If at head, we are done */ - if (!x->parent) { - return NULL; - } - down = false; - /* Go up one and return parent */ - return x->parent; - } -} - - -/* x is item, y is below and to right, then rotated to below left */ -void btree::left_rotate(bnode *item) -{ - bnode *y; - bnode *x; - - x = item; - y = x->right; - x->right = y->left; - if (y->left) { - y->left->parent = x; - } - y->parent = x->parent; - /* if no parent then we have a new head */ - if (!x->parent) { - head = y; - } else if (x == x->parent->left) { - x->parent->left = y; - } else { - x->parent->right = y; - } - y->left = x; - x->parent = y; -} - -void btree::right_rotate(bnode *item) -{ - bnode *x, *y; - - y = item; - x = y->left; - y->left = x->right; - if (x->right) { - x->right->parent = y; - } - x->parent = y->parent; - /* if no parent then we have a new head */ - if (!y->parent) { - head = x; - } else if (y == y->parent->left) { - y->parent->left = x; - } else { - y->parent->right = x; - } - x->right = y; - y->parent = x; -} - - -void btree::remove(bnode *item) -{ -} - -/* Destroy the tree contents. Not totally working */ -void btree::destroy() -{ - bnode *x, *y = NULL; - - x = first(); -// printf("head=%p first=%p left=%p right=%p\n", head, x, x->left, x->right); - - for ( ; (y=any(x)); ) { - /* Prune the last item */ - if (x->parent) { - if (x == x->parent->left) { - x->parent->left = NULL; - } else if (x == x->parent->right) { - x->parent->right = NULL; - } - } - if (!x->left && !x->right) { - if (head == x) { - head = NULL; - } -// if (num_items<30) { -// printf("free nitems=%d item=%p left=%p right=%p\n", num_items, x, x->left, x->right); -// } - free((void *)x); /* free previous node */ - num_items--; - } - x = y; /* save last node */ - } - if (x) { - if (x == head) { - head = NULL; - } -// printf("free nitems=%d item=%p left=%p right=%p\n", num_items, x, x->left, x->right); - free((void *)x); - num_items--; - } - if (head) { -// printf("Free head\n"); - free((void *)head); - } -// printf("free nitems=%d\n", num_items); - - head = NULL; -} - - - -#ifdef TEST_PROGRAM - -struct MYJCR { - bnode link; - char *buf; -}; - -static int my_compare(bnode *item1, bnode *item2) -{ - MYJCR *jcr1, *jcr2; - int comp; - jcr1 = (MYJCR *)item1; - jcr2 = (MYJCR *)item2; - comp = strcmp(jcr1->buf, jcr2->buf); - //Dmsg3(000, "compare=%d: %s to %s\n", comp, jcr1->buf, jcr2->buf); - return comp; -} - -int main() -{ - char buf[30]; - btree *jcr_chain; - MYJCR *jcr = NULL; - MYJCR *jcr1; - - - /* Now do a binary insert for the tree */ - jcr_chain = New(btree()); -#define CNT 26 - printf("append %d items\n", CNT*CNT*CNT); - strcpy(buf, "ZZZ"); - int count = 0; - for (int i=0; ibuf = bstrdup(buf); -// printf("buf=%p %s\n", jcr, jcr->buf); - jcr1 = (MYJCR *)jcr_chain->insert((bnode *)jcr, my_compare); - if (jcr != jcr1) { - Dmsg2(000, "Insert of %s vs %s failed.\n", jcr->buf, jcr1->buf); - } - buf[1]--; - } - buf[1] = 'Z'; - buf[2]--; - } - buf[2] = 'Z'; - buf[0]--; - } - printf("%d items appended\n", CNT*CNT*CNT); - printf("num_items=%d\n", jcr_chain->size()); - - jcr = (MYJCR *)malloc(sizeof(MYJCR)); - memset(jcr, 0, sizeof(MYJCR)); - - jcr->buf = bstrdup("a"); - if ((jcr1=(MYJCR *)jcr_chain->search((bnode *)jcr, my_compare))) { - printf("One less failed!!!! Got: %s\n", jcr1->buf); - } else { - printf("One less: OK\n"); - } - free(jcr->buf); - - jcr->buf = bstrdup("ZZZZZZZZZZZZZZZZ"); - if ((jcr1=(MYJCR *)jcr_chain->search((bnode *)jcr, my_compare))) { - printf("One greater failed!!!! Got:%s\n", jcr1->buf); - } else { - printf("One greater: OK\n"); - } - free(jcr->buf); - - jcr->buf = bstrdup("AAA"); - if ((jcr1=(MYJCR *)jcr_chain->search((bnode *)jcr, my_compare))) { - printf("Search for AAA got %s\n", jcr1->buf); - } else { - printf("Search for AAA not found\n"); - } - free(jcr->buf); - - jcr->buf = bstrdup("ZZZ"); - if ((jcr1 = (MYJCR *)jcr_chain->search((bnode *)jcr, my_compare))) { - printf("Search for ZZZ got %s\n", jcr1->buf); - } else { - printf("Search for ZZZ not found\n"); - } - free(jcr->buf); - free(jcr); - - - printf("Find each of %d items in tree.\n", count); - for (jcr=(MYJCR *)jcr_chain->first(); jcr; (jcr=(MYJCR *)jcr_chain->next((bnode *)jcr)) ) { -// printf("Got: %s\n", jcr->buf); - if (!jcr_chain->search((bnode *)jcr, my_compare)) { - printf("btree binary_search item not found = %s\n", jcr->buf); - } - } - printf("Free each of %d items in tree.\n", count); - for (jcr=(MYJCR *)jcr_chain->first(); jcr; (jcr=(MYJCR *)jcr_chain->next((bnode *)jcr)) ) { -// printf("Free: %p %s\n", jcr, jcr->buf); - free(jcr->buf); - jcr->buf = NULL; - } - printf("num_items=%d\n", jcr_chain->size()); - delete jcr_chain; - - - sm_dump(true); - -} -#endif diff --git a/bacula/src/lib/btree.h b/bacula/src/lib/btree.h deleted file mode 100644 index df25085341..0000000000 --- a/bacula/src/lib/btree.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Version $Id$ - */ -/* - Copyright (C) 2005 Kern Sibbald - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. - - */ - - -/* ======================================================================== - * - * red-black binary tree routines -- btree.h - * - * Kern Sibbald, MMV - * - */ - -#define M_ABORT 1 - -/* - * There is a lot of extra casting here to work around the fact - * that some compilers (Sun and Visual C++) do not accept - * (bnode *) as an lvalue on the left side of an equal. - * - * Loop var through each member of list - */ -#define foreach_btree(var, tree) \ - for(*((bnode **)&(var))=(tree)->first(); (*((bnode **)&(var))=(tree)->next((bnode *)var)); ) - -#ifdef the_old_way -#define foreach_btree(var, tree) \ - for((var)=(tree)->first(); (((bnode *)(var))=(tree)->next((bnode *)var)); ) -#endif - -struct bnode; -struct bnode { - bnode *left; - bnode *right; - bnode *parent; - bool red; -}; - -class btree : public SMARTALLOC { - bnode *head; - uint32_t num_items; - bool down; - void left_rotate(bnode *item); - void right_rotate(bnode *item); -public: - btree(void); - ~btree() { destroy(); } - void init(void); - bnode *insert(bnode *item, int compare(bnode *item1, bnode *item2)); - bnode *search(bnode *item, int compare(bnode *item1, bnode *item2)); - bnode *first(void); - bnode *next(bnode *item); - bnode *any(bnode *item); - void remove(bnode *item); - int size() const; - void destroy(); -}; - - -/* - * This allows us to do explicit initialization, - * allowing us to mix C++ classes inside malloc'ed - * C structures. Define before called in constructor. - */ -inline void btree::init() -{ - head = NULL; - num_items = 0; -} - - -/* Constructor with link at head of item */ -inline btree::btree(void) : head(0), num_items(0) -{ -} - -inline int btree::size() const -{ - return num_items; -} diff --git a/bacula/src/lib/crypto.c b/bacula/src/lib/crypto.c deleted file mode 100644 index 7cc359c2a3..0000000000 --- a/bacula/src/lib/crypto.c +++ /dev/null @@ -1,1620 +0,0 @@ -/* - * crypto.c Encryption support functions - * - * Author: Landon Fuller - * - * Version $Id$ - * - * Copyright (C) 2005 Kern Sibbald - * - * This file was contributed to the Bacula project by Landon Fuller. - * - * Landon Fuller has been granted a perpetual, worldwide, non-exclusive, - * no-charge, royalty-free, irrevocable copyright license to reproduce, - * prepare derivative works of, publicly display, publicly perform, - * sublicense, and distribute the original work contributed by Landon Fuller - * to the Bacula project in source or object form. - * - * If you wish to license these contributions under an alternate open source - * license please contact Landon Fuller . - */ -/* - Copyright (C) 2005 Kern Sibbald - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. - - */ - - -#include "bacula.h" -#include - -/* - * Bacula ASN.1 Syntax - * - * OID Allocation: - * Prefix: iso.org.dod.internet.private.enterprise.threerings.external.bacula (1.3.6.1.4.1.22054.500.2) - * Organization: Bacula Project - * Contact Name: Kern Sibbald - * Contact E-mail: kern@sibbald.com - * - * Top Level Allocations - 500.2 - * 1 - Published Allocations - * 1.1 - Bacula Encryption - * - * Bacula Encryption - 500.2.1.1 - * 1 - ASN.1 Modules - * 1.1 - BaculaCrypto - * 2 - ASN.1 Object Identifiers - * 2.1 - SignatureData - * 2.2 - SignerInfo - * 2.3 - CryptoData - * 2.4 - RecipientInfo - * - * BaculaCrypto { iso(1) identified-organization(3) usdod(6) - * internet(1) private(4) enterprises(1) three-rings(22054) - * external(500) bacula(2) published(1) bacula-encryption(1) - * asn1-modules(1) bacula-crypto(1) } - * - * DEFINITIONS AUTOMATIC TAGS ::= - * BEGIN - * - * SignatureData ::= SEQUENCE { - * version Version DEFAULT v0, - * signerInfo SignerInfo } - * - * CryptoData ::= SEQUENCE { - * version Version DEFAULT v0, - * contentEncryptionAlgorithm ContentEncryptionAlgorithmIdentifier, - * iv InitializationVector, - * recipientInfo RecipientInfo - * } - * - * SignerInfo ::= SET OF SignerInfo - * RecipientInfo ::= SET OF RecipientInfo - * - * Version ::= INTEGER { v0(0) } - * - * SignerInfo ::= SEQUENCE { - * version Version, - * subjectKeyIdentifier SubjectKeyIdentifier, - * digestAlgorithm DigestAlgorithmIdentifier, - * signatureAlgorithm SignatureAlgorithmIdentifier, - * signature SignatureValue } - * - * RecipientInfo ::= SEQUENCE { - * version Version - * subjectKeyIdentifier SubjectKeyIdentifier - * keyEncryptionAlgorithm KeyEncryptionAlgorithmIdentifier - * encryptedKey EncryptedKey - * } - * - * SubjectKeyIdentifier ::= OCTET STRING - * - * DigestAlgorithmIdentifier ::= AlgorithmIdentifier - * - * SignatureAlgorithmIdentifier ::= AlgorithmIdentifier - * - * KeyEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * ContentEncryptionAlgorithmIdentifier ::= AlgorithmIdentifier - * - * InitializationVector ::= OCTET STRING - * - * SignatureValue ::= OCTET STRING - * - * EncryptedKey ::= OCTET STRING - * - * AlgorithmIdentifier ::= OBJECT IDENTIFIER - * - * END - */ - -#ifdef HAVE_CRYPTO /* Is encryption enabled? */ -#ifdef HAVE_OPENSSL /* How about OpenSSL? */ - -/* Are we initialized? */ -static int crypto_initialized = false; - -/* ASN.1 Declarations */ -#define BACULA_ASN1_VERSION 0 - -typedef struct { - ASN1_INTEGER *version; - ASN1_OCTET_STRING *subjectKeyIdentifier; - ASN1_OBJECT *digestAlgorithm; - ASN1_OBJECT *signatureAlgorithm; - ASN1_OCTET_STRING *signature; -} SignerInfo; - -typedef struct { - ASN1_INTEGER *version; - ASN1_OCTET_STRING *subjectKeyIdentifier; - ASN1_OBJECT *keyEncryptionAlgorithm; - ASN1_OCTET_STRING *encryptedKey; -} RecipientInfo; - -ASN1_SEQUENCE(SignerInfo) = { - ASN1_SIMPLE(SignerInfo, version, ASN1_INTEGER), - ASN1_SIMPLE(SignerInfo, subjectKeyIdentifier, ASN1_OCTET_STRING), - ASN1_SIMPLE(SignerInfo, digestAlgorithm, ASN1_OBJECT), - ASN1_SIMPLE(SignerInfo, signatureAlgorithm, ASN1_OBJECT), - ASN1_SIMPLE(SignerInfo, signature, ASN1_OCTET_STRING) -} ASN1_SEQUENCE_END(SignerInfo); - -ASN1_SEQUENCE(RecipientInfo) = { - ASN1_SIMPLE(RecipientInfo, version, ASN1_INTEGER), - ASN1_SIMPLE(RecipientInfo, subjectKeyIdentifier, ASN1_OCTET_STRING), - ASN1_SIMPLE(RecipientInfo, keyEncryptionAlgorithm, ASN1_OBJECT), - ASN1_SIMPLE(RecipientInfo, encryptedKey, ASN1_OCTET_STRING), -} ASN1_SEQUENCE_END(RecipientInfo); - -typedef struct { - ASN1_INTEGER *version; - STACK_OF(SignerInfo) *signerInfo; -} SignatureData; - -typedef struct { - ASN1_INTEGER *version; - ASN1_OBJECT *contentEncryptionAlgorithm; - ASN1_OCTET_STRING *iv; - STACK_OF(RecipientInfo) *recipientInfo; -} CryptoData; - -ASN1_SEQUENCE(SignatureData) = { - ASN1_SIMPLE(SignatureData, version, ASN1_INTEGER), - ASN1_SET_OF(SignatureData, signerInfo, SignerInfo), -} ASN1_SEQUENCE_END(SignatureData); - -ASN1_SEQUENCE(CryptoData) = { - ASN1_SIMPLE(CryptoData, version, ASN1_INTEGER), - ASN1_SIMPLE(CryptoData, contentEncryptionAlgorithm, ASN1_OBJECT), - ASN1_SIMPLE(CryptoData, iv, ASN1_OCTET_STRING), - ASN1_SET_OF(CryptoData, recipientInfo, RecipientInfo) -} ASN1_SEQUENCE_END(CryptoData); - -IMPLEMENT_ASN1_FUNCTIONS(SignerInfo) -IMPLEMENT_ASN1_FUNCTIONS(RecipientInfo) -IMPLEMENT_ASN1_FUNCTIONS(SignatureData) -IMPLEMENT_ASN1_FUNCTIONS(CryptoData) -IMPLEMENT_STACK_OF(SignerInfo) -IMPLEMENT_STACK_OF(RecipientInfo) - -/* - * SignerInfo and RecipientInfo stack macros, generated by OpenSSL's util/mkstack.pl. - */ -#define sk_SignerInfo_new(st) SKM_sk_new(SignerInfo, (st)) -#define sk_SignerInfo_new_null() SKM_sk_new_null(SignerInfo) -#define sk_SignerInfo_free(st) SKM_sk_free(SignerInfo, (st)) -#define sk_SignerInfo_num(st) SKM_sk_num(SignerInfo, (st)) -#define sk_SignerInfo_value(st, i) SKM_sk_value(SignerInfo, (st), (i)) -#define sk_SignerInfo_set(st, i, val) SKM_sk_set(SignerInfo, (st), (i), (val)) -#define sk_SignerInfo_zero(st) SKM_sk_zero(SignerInfo, (st)) -#define sk_SignerInfo_push(st, val) SKM_sk_push(SignerInfo, (st), (val)) -#define sk_SignerInfo_unshift(st, val) SKM_sk_unshift(SignerInfo, (st), (val)) -#define sk_SignerInfo_find(st, val) SKM_sk_find(SignerInfo, (st), (val)) -#define sk_SignerInfo_delete(st, i) SKM_sk_delete(SignerInfo, (st), (i)) -#define sk_SignerInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(SignerInfo, (st), (ptr)) -#define sk_SignerInfo_insert(st, val, i) SKM_sk_insert(SignerInfo, (st), (val), (i)) -#define sk_SignerInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(SignerInfo, (st), (cmp)) -#define sk_SignerInfo_dup(st) SKM_sk_dup(SignerInfo, st) -#define sk_SignerInfo_pop_free(st, free_func) SKM_sk_pop_free(SignerInfo, (st), (free_func)) -#define sk_SignerInfo_shift(st) SKM_sk_shift(SignerInfo, (st)) -#define sk_SignerInfo_pop(st) SKM_sk_pop(SignerInfo, (st)) -#define sk_SignerInfo_sort(st) SKM_sk_sort(SignerInfo, (st)) -#define sk_SignerInfo_is_sorted(st) SKM_sk_is_sorted(SignerInfo, (st)) - -#define d2i_ASN1_SET_OF_SignerInfo(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(SignerInfo, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_SignerInfo(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(SignerInfo, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_SignerInfo(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(SignerInfo, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_SignerInfo(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(SignerInfo, (buf), (len), (d2i_func), (free_func)) - -#define sk_RecipientInfo_new(st) SKM_sk_new(RecipientInfo, (st)) -#define sk_RecipientInfo_new_null() SKM_sk_new_null(RecipientInfo) -#define sk_RecipientInfo_free(st) SKM_sk_free(RecipientInfo, (st)) -#define sk_RecipientInfo_num(st) SKM_sk_num(RecipientInfo, (st)) -#define sk_RecipientInfo_value(st, i) SKM_sk_value(RecipientInfo, (st), (i)) -#define sk_RecipientInfo_set(st, i, val) SKM_sk_set(RecipientInfo, (st), (i), (val)) -#define sk_RecipientInfo_zero(st) SKM_sk_zero(RecipientInfo, (st)) -#define sk_RecipientInfo_push(st, val) SKM_sk_push(RecipientInfo, (st), (val)) -#define sk_RecipientInfo_unshift(st, val) SKM_sk_unshift(RecipientInfo, (st), (val)) -#define sk_RecipientInfo_find(st, val) SKM_sk_find(RecipientInfo, (st), (val)) -#define sk_RecipientInfo_delete(st, i) SKM_sk_delete(RecipientInfo, (st), (i)) -#define sk_RecipientInfo_delete_ptr(st, ptr) SKM_sk_delete_ptr(RecipientInfo, (st), (ptr)) -#define sk_RecipientInfo_insert(st, val, i) SKM_sk_insert(RecipientInfo, (st), (val), (i)) -#define sk_RecipientInfo_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(RecipientInfo, (st), (cmp)) -#define sk_RecipientInfo_dup(st) SKM_sk_dup(RecipientInfo, st) -#define sk_RecipientInfo_pop_free(st, free_func) SKM_sk_pop_free(RecipientInfo, (st), (free_func)) -#define sk_RecipientInfo_shift(st) SKM_sk_shift(RecipientInfo, (st)) -#define sk_RecipientInfo_pop(st) SKM_sk_pop(RecipientInfo, (st)) -#define sk_RecipientInfo_sort(st) SKM_sk_sort(RecipientInfo, (st)) -#define sk_RecipientInfo_is_sorted(st) SKM_sk_is_sorted(RecipientInfo, (st)) - -#define d2i_ASN1_SET_OF_RecipientInfo(st, pp, length, d2i_func, free_func, ex_tag, ex_class) \ - SKM_ASN1_SET_OF_d2i(RecipientInfo, (st), (pp), (length), (d2i_func), (free_func), (ex_tag), (ex_class)) -#define i2d_ASN1_SET_OF_RecipientInfo(st, pp, i2d_func, ex_tag, ex_class, is_set) \ - SKM_ASN1_SET_OF_i2d(RecipientInfo, (st), (pp), (i2d_func), (ex_tag), (ex_class), (is_set)) -#define ASN1_seq_pack_RecipientInfo(st, i2d_func, buf, len) \ - SKM_ASN1_seq_pack(RecipientInfo, (st), (i2d_func), (buf), (len)) -#define ASN1_seq_unpack_RecipientInfo(buf, len, d2i_func, free_func) \ - SKM_ASN1_seq_unpack(RecipientInfo, (buf), (len), (d2i_func), (free_func)) -/* End of util/mkstack.pl block */ - -/* X509 Public/Private Key Pair Structure */ -struct X509_Keypair { - ASN1_OCTET_STRING *keyid; - EVP_PKEY *pubkey; - EVP_PKEY *privkey; -}; - -/* Message Digest Structure */ -struct Digest { - crypto_digest_t type; - EVP_MD_CTX ctx; -}; - -/* Message Signature Structure */ -struct Signature { - SignatureData *sigData; -}; - -/* Encryption Session Data */ -struct Crypto_Session { - CryptoData *cryptoData; /* ASN.1 Structure */ - unsigned char *session_key; /* Private symmetric session key */ - size_t session_key_len; /* Symmetric session key length */ -}; - -/* Symmetric Cipher Context */ -struct Cipher_Context { - EVP_CIPHER_CTX ctx; -}; - -/* PEM Password Dispatch Context */ -typedef struct PEM_CB_Context { - CRYPTO_PEM_PASSWD_CB *pem_callback; - const void *pem_userdata; -} PEM_CB_CONTEXT; - -/* - * Extract subjectKeyIdentifier from x509 certificate. - * Returns: On success, an ASN1_OCTET_STRING that must be freed via M_ASN1_OCTET_STRING_free(). - * NULL on failure. - */ -static ASN1_OCTET_STRING *openssl_cert_keyid(X509 *cert){ - X509_EXTENSION *ext; - X509V3_EXT_METHOD *method; - ASN1_OCTET_STRING *keyid; - int i; -#if (OPENSSL_VERSION_NUMBER >= 0x0090800FL) - const unsigned char *ext_value_data; -#else - unsigned char *ext_value_data; -#endif - - - /* Find the index to the subjectKeyIdentifier extension */ - i = X509_get_ext_by_NID(cert, NID_subject_key_identifier, -1); - if (i < 0) { - /* Not found */ - return NULL; - } - - /* Grab the extension */ - ext = X509_get_ext(cert, i); - - /* Get x509 extension method structure */ - if (!(method = X509V3_EXT_get(ext))) { - return NULL; - } - - ext_value_data = ext->value->data; - -#if (OPENSSL_VERSION_NUMBER > 0x00907000L) - if (method->it) { - /* New style ASN1 */ - - /* Decode ASN1 item in data */ - keyid = (ASN1_OCTET_STRING *) ASN1_item_d2i(NULL, &ext_value_data, ext->value->length, - ASN1_ITEM_ptr(method->it)); - } else { - /* Old style ASN1 */ - - /* Decode ASN1 item in data */ - keyid = (ASN1_OCTET_STRING *) method->d2i(NULL, &ext_value_data, ext->value->length); - } - -#else - keyid = (ASN1_OCTET_STRING *) method->d2i(NULL, &ext_value_data, ext->value->length); -#endif - - return keyid; -} - -/* - * Create a new keypair object. - * Returns: A pointer to a X509 KEYPAIR object on success. - * NULL on failure. - */ -X509_KEYPAIR *crypto_keypair_new (void) { - X509_KEYPAIR *keypair; - - /* Allocate our keypair structure */ - keypair = (X509_KEYPAIR *) malloc(sizeof(X509_KEYPAIR)); - if (!keypair) { - return NULL; - } - - /* Initialize our keypair structure */ - keypair->keyid = NULL; - keypair->pubkey = NULL; - keypair->privkey = NULL; - - return keypair; -} - -/* - * Create a copy of a keypair object. The underlying - * EVP objects are not duplicated, as no EVP_PKEY_dup() - * API is available. Instead, the reference count is - * incremented. - */ -X509_KEYPAIR *crypto_keypair_dup (X509_KEYPAIR *keypair) -{ - X509_KEYPAIR *newpair; - - newpair = crypto_keypair_new(); - - if (!newpair) { - /* Allocation failed */ - return NULL; - } - - /* Increment the public key ref count */ - if (keypair->pubkey) { - CRYPTO_add(&(keypair->pubkey->references), 1, CRYPTO_LOCK_EVP_PKEY); - newpair->pubkey = keypair->pubkey; - } - - /* Increment the private key ref count */ - if (keypair->privkey) { - CRYPTO_add(&(keypair->privkey->references), 1, CRYPTO_LOCK_EVP_PKEY); - newpair->privkey = keypair->privkey; - } - - /* Duplicate the keyid */ - if (keypair->keyid) { - newpair->keyid = M_ASN1_OCTET_STRING_dup(keypair->keyid); - if (!newpair->keyid) { - /* Allocation failed */ - crypto_keypair_free(newpair); - return NULL; - } - } - - return newpair; -} - - -/* - * Load a public key from a PEM-encoded x509 certificate. - * Returns: true on success - * false on failure - */ -int crypto_keypair_load_cert (X509_KEYPAIR *keypair, const char *file) -{ - BIO *bio; - X509 *cert; - - /* Open the file */ - if (!(bio = BIO_new_file(file, "r"))) { - openssl_post_errors(M_ERROR, _("Unable to open certificate file")); - return false; - } - - cert = PEM_read_bio_X509(bio, NULL, NULL, NULL); - BIO_free(bio); - if (!cert) { - openssl_post_errors(M_ERROR, _("Unable to read certificate from file")); - return false; - } - - /* Extract the public key */ - if (!(keypair->pubkey = X509_get_pubkey(cert))) { - openssl_post_errors(M_ERROR, _("Unable to extract public key from certificate")); - goto err; - } - - /* Extract the subjectKeyIdentifier extension field */ - if ((keypair->keyid = openssl_cert_keyid(cert)) == NULL) { - Emsg0(M_ERROR, 0, _("Provided certificate does not include the required subjectKeyIdentifier extension.")); - goto err; - } - - /* Validate the public key type (only RSA is supported) */ - if (EVP_PKEY_type(keypair->pubkey->type) != EVP_PKEY_RSA) { - Emsg1(M_ERROR, 0, _("Unsupported key type provided: %d\n"), EVP_PKEY_type(keypair->pubkey->type)); - goto err; - } - - X509_free(cert); - return true; - -err: - X509_free(cert); - if (keypair->pubkey) { - EVP_PKEY_free(keypair->pubkey); - } - return false; -} - -/* Dispatch user PEM encryption callbacks */ -static int crypto_pem_callback_dispatch (char *buf, int size, int rwflag, void *userdata) -{ - PEM_CB_CONTEXT *ctx = (PEM_CB_CONTEXT *) userdata; - return (ctx->pem_callback(buf, size, ctx->pem_userdata)); -} - -/* - * Check a PEM-encoded file - * for the existence of a private key. - * Returns: true if a private key is found - * false otherwise - */ -bool crypto_keypair_has_key (const char *file) { - BIO *bio; - char *name = NULL; - char *header = NULL; - unsigned char *data = NULL; - bool retval = false; - long len; - - if (!(bio = BIO_new_file(file, "r"))) { - openssl_post_errors(M_ERROR, _("Unable to open private key file")); - return false; - } - - while (PEM_read_bio(bio, &name, &header, &data, &len)) { - /* We don't care what the data is, just that it's there */ - OPENSSL_free(header); - OPENSSL_free(data); - - /* - * PEM Header Found, check for a private key - * Due to OpenSSL limitations, we must specifically - * list supported PEM private key encodings. - */ - if (strcmp(name, PEM_STRING_RSA) == 0 - || strcmp(name, PEM_STRING_DSA) == 0 - || strcmp(name, PEM_STRING_PKCS8) == 0 - || strcmp(name, PEM_STRING_PKCS8INF) == 0) { - retval = true; - OPENSSL_free(name); - break; - } else { - OPENSSL_free(name); - } - } - - /* Free our bio */ - BIO_free(bio); - - /* Post PEM-decoding error messages, if any */ - openssl_post_errors(M_ERROR, _("Unable to read private key from file")); - return retval; -} - -/* - * Load a PEM-encoded private key. - * Returns: true on success - * false on failure - */ -int crypto_keypair_load_key (X509_KEYPAIR *keypair, const char *file, - CRYPTO_PEM_PASSWD_CB *pem_callback, - const void *pem_userdata) -{ - BIO *bio; - PEM_CB_CONTEXT ctx; - - /* Open the file */ - if (!(bio = BIO_new_file(file, "r"))) { - openssl_post_errors(M_ERROR, _("Unable to open private key file")); - return false; - } - - /* Set up PEM encryption callback */ - if (pem_callback) { - ctx.pem_callback = pem_callback; - ctx.pem_userdata = pem_userdata; - } else { - ctx.pem_callback = crypto_default_pem_callback; - ctx.pem_userdata = NULL; - } - - keypair->privkey = PEM_read_bio_PrivateKey(bio, NULL, crypto_pem_callback_dispatch, &ctx); - BIO_free(bio); - if (!keypair->privkey) { - openssl_post_errors(M_ERROR, _("Unable to read private key from file")); - return false; - } - - return true; -} - -/* - * Free memory associated with a keypair object. - */ -void crypto_keypair_free (X509_KEYPAIR *keypair) -{ - if (keypair->pubkey) { - EVP_PKEY_free(keypair->pubkey); - } - if (keypair->privkey) { - EVP_PKEY_free(keypair->privkey); - } - if (keypair->keyid) { - M_ASN1_OCTET_STRING_free(keypair->keyid); - } - free(keypair); -} - -/* - * Create a new message digest context of the specified type - * Returns: A pointer to a DIGEST object on success. - * NULL on failure. - */ -DIGEST *crypto_digest_new (crypto_digest_t type) -{ - DIGEST *digest; - const EVP_MD *md = NULL; /* Quell invalid uninitialized warnings */ - - digest = (DIGEST *) malloc(sizeof(DIGEST)); - digest->type = type; - - /* Initialize the OpenSSL message digest context */ - EVP_MD_CTX_init(&digest->ctx); - - /* Determine the correct OpenSSL message digest type */ - switch (type) { - case CRYPTO_DIGEST_MD5: - md = EVP_md5(); - break; - case CRYPTO_DIGEST_SHA1: - md = EVP_sha1(); - break; -#ifdef HAVE_SHA2 - case CRYPTO_DIGEST_SHA256: - md = EVP_sha256(); - break; - case CRYPTO_DIGEST_SHA512: - md = EVP_sha512(); - break; -#endif - default: - Emsg1(M_ERROR, 0, _("Unsupported digest type: %d\n"), type); - goto err; - } - - /* Initialize the backing OpenSSL context */ - if (EVP_DigestInit_ex(&digest->ctx, md, NULL) == 0) { - goto err; - } - - return digest; - -err: - /* This should not happen, but never say never ... */ - openssl_post_errors(M_ERROR, _("OpenSSL digest initialization failed")); - crypto_digest_free(digest); - return NULL; -} - -/* - * Hash length bytes of data into the provided digest context. - * Returns: true on success - * false on failure - */ -bool crypto_digest_update (DIGEST *digest, const void *data, size_t length) { - if (EVP_DigestUpdate(&digest->ctx, data, length) == 0) { - return true; - } else { - return false; - } -} - -/* - * Finalize the data in digest, storing the result in dest and the result size - * in length. The result size can be determined with crypto_digest_size(). - * - * Returns: true on success - * false on failure - */ -bool crypto_digest_finalize (DIGEST *digest, void *dest, size_t *length) { - if (!EVP_DigestFinal(&digest->ctx, (unsigned char *) dest, (unsigned int *) length)) { - return false; - } else { - return true; - } -} - -/* - * Free memory associated with a digest object. - */ -void crypto_digest_free (DIGEST *digest) -{ - EVP_MD_CTX_cleanup(&digest->ctx); - free (digest); -} - -/* - * Create a new message signature context. - * Returns: A pointer to a SIGNATURE object on success. - * NULL on failure. - */ -SIGNATURE *crypto_sign_new (void) -{ - SIGNATURE *sig; - - sig = (SIGNATURE *) malloc(sizeof(SIGNATURE)); - if (!sig) { - return NULL; - } - - sig->sigData = SignatureData_new(); - - if (!sig->sigData) { - /* Allocation failed in OpenSSL */ - free(sig); - return NULL; - } - - /* Set the ASN.1 structure version number */ - ASN1_INTEGER_set(sig->sigData->version, BACULA_ASN1_VERSION); - - return sig; -} - -/* - * For a given public key, find the associated SignatureInfo record - * and create a digest context for signature validation - * Returns: CRYPTO_ERROR_NONE on success, with the newly allocated DIGEST in digest. - * A crypto_error_t value on failure. - */ -crypto_error_t crypto_sign_get_digest(SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST **digest) -{ - STACK_OF(SignerInfo) *signers; - SignerInfo *si; - int i; - - signers = sig->sigData->signerInfo; - - for (i = 0; i < sk_SignerInfo_num(signers); i++) { - si = sk_SignerInfo_value(signers, i); - if (M_ASN1_OCTET_STRING_cmp(keypair->keyid, si->subjectKeyIdentifier) == 0) { - /* Get the digest algorithm and allocate a digest context */ - switch (OBJ_obj2nid(si->digestAlgorithm)) { - case NID_md5: - *digest = crypto_digest_new(CRYPTO_DIGEST_MD5); - break; - case NID_sha1: - *digest = crypto_digest_new(CRYPTO_DIGEST_SHA1); - break; -#ifdef HAVE_SHA2 - case NID_sha256: - *digest = crypto_digest_new(CRYPTO_DIGEST_SHA256); - break; - case NID_sha512: - *digest = crypto_digest_new(CRYPTO_DIGEST_SHA512); - break; -#endif - default: - *digest = NULL; - return CRYPTO_ERROR_INVALID_DIGEST; - } - - /* Shouldn't happen */ - if (*digest == NULL) { - return CRYPTO_ERROR_INVALID_DIGEST; - } else { - return CRYPTO_ERROR_NONE; - } - } - } - - return CRYPTO_ERROR_NOSIGNER; -} - -/* - * For a given signature, public key, and digest, verify the SIGNATURE. - * Returns: CRYPTO_ERROR_NONE on success. - * A crypto_error_t value on failure. - */ -crypto_error_t crypto_sign_verify(SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST *digest) -{ - STACK_OF(SignerInfo) *signers; - SignerInfo *si; - int ok, i; - unsigned int sigLen; -#if (OPENSSL_VERSION_NUMBER >= 0x0090800FL) - const unsigned char *sigData; -#else - unsigned char *sigData; -#endif - - signers = sig->sigData->signerInfo; - - /* Find the signer */ - for (i = 0; i < sk_SignerInfo_num(signers); i++) { - si = sk_SignerInfo_value(signers, i); - if (M_ASN1_OCTET_STRING_cmp(keypair->keyid, si->subjectKeyIdentifier) == 0) { - /* Extract the signature data */ - sigLen = M_ASN1_STRING_length(si->signature); - sigData = M_ASN1_STRING_data(si->signature); - - ok = EVP_VerifyFinal(&digest->ctx, sigData, sigLen, keypair->pubkey); - if (ok >= 1) { - return CRYPTO_ERROR_NONE; - } else if (ok == 0) { - return CRYPTO_ERROR_BAD_SIGNATURE; - } else if (ok < 0) { - /* Shouldn't happen */ - openssl_post_errors(M_ERROR, _("OpenSSL error occured")); - return CRYPTO_ERROR_INTERNAL; - } - } - } - - /* Signer wasn't found. */ - return CRYPTO_ERROR_NOSIGNER; -} - - -/* - * Add a new signer - * Returns: true on success - * false on failure - */ -int crypto_sign_add_signer(SIGNATURE *sig, DIGEST *digest, X509_KEYPAIR *keypair) -{ - SignerInfo *si = NULL; - unsigned char *buf = NULL; - unsigned int len; - - si = SignerInfo_new(); - - if (!si) { - /* Allocation failed in OpenSSL */ - return false; - } - - /* Set the ASN.1 structure version number */ - ASN1_INTEGER_set(si->version, BACULA_ASN1_VERSION); - - /* Set the digest algorithm identifier */ - switch (digest->type) { - case CRYPTO_DIGEST_MD5: - si->digestAlgorithm = OBJ_nid2obj(NID_md5); - break; - case CRYPTO_DIGEST_SHA1: - si->digestAlgorithm = OBJ_nid2obj(NID_sha1); - break; -#ifdef HAVE_SHA2 - case CRYPTO_DIGEST_SHA256: - si->digestAlgorithm = OBJ_nid2obj(NID_sha256); - break; - case CRYPTO_DIGEST_SHA512: - si->digestAlgorithm = OBJ_nid2obj(NID_sha512); - break; -#endif - default: - /* This should never happen */ - goto err; - } - - /* Drop the string allocated by OpenSSL, and add our subjectKeyIdentifier */ - M_ASN1_OCTET_STRING_free(si->subjectKeyIdentifier); - si->subjectKeyIdentifier = M_ASN1_OCTET_STRING_dup(keypair->keyid); - - /* Set our signature algorithm. We currently require RSA */ - assert(EVP_PKEY_type(keypair->pubkey->type) == EVP_PKEY_RSA); - /* This is slightly evil. Reach into the MD structure and grab the key type */ - si->signatureAlgorithm = OBJ_nid2obj(digest->ctx.digest->pkey_type); - - /* Finalize/Sign our Digest */ - len = EVP_PKEY_size(keypair->privkey); - buf = (unsigned char *) malloc(len); - if (!EVP_SignFinal(&digest->ctx, buf, &len, keypair->privkey)) { - openssl_post_errors(M_ERROR, _("Signature creation failed")); - goto err; - } - - /* Add the signature to the SignerInfo structure */ - if (!M_ASN1_OCTET_STRING_set(si->signature, buf, len)) { - /* Allocation failed in OpenSSL */ - goto err; - } - - /* No longer needed */ - free(buf); - - /* Push the new SignerInfo structure onto the stack */ - sk_SignerInfo_push(sig->sigData->signerInfo, si); - - return true; - -err: - if (si) { - SignerInfo_free(si); - } - if (buf) { - free(buf); - } - - return false; -} - -/* - * Encodes the SignatureData structure. The length argument is used to specify the - * size of dest. A length of 0 will cause no data to be written to dest, and the - * required length to be written to length. The caller can then allocate sufficient - * space for the output. - * - * Returns: true on success, stores the encoded data in dest, and the size in length. - * false on failure. - */ -int crypto_sign_encode(SIGNATURE *sig, void *dest, size_t *length) -{ - if (*length == 0) { - *length = i2d_SignatureData(sig->sigData, NULL); - return true; - } - - *length = i2d_SignatureData(sig->sigData, (unsigned char **) &dest); - return true; -} - -/* - * Decodes the SignatureData structure. The length argument is used to specify the - * size of sigData. - * - * Returns: SIGNATURE instance on success. - * NULL on failure. - - */ - -SIGNATURE *crypto_sign_decode(const void *sigData, size_t length) -{ - SIGNATURE *sig; -#if (OPENSSL_VERSION_NUMBER >= 0x0090800FL) - const unsigned char *p = (const unsigned char *) sigData; -#else - unsigned char *p = (unsigned char *) sigData; -#endif - - sig = (SIGNATURE *) malloc(sizeof(SIGNATURE)); - if (!sig) { - return NULL; - } - - /* d2i_SignatureData modifies the supplied pointer */ - sig->sigData = d2i_SignatureData(NULL, &p, length); - - if (!sig->sigData) { - /* Allocation / Decoding failed in OpenSSL */ - openssl_post_errors(M_ERROR, _("Signature decoding failed")); - free(sig); - return NULL; - } - - return sig; -} - -/* - * Free memory associated with a signature object. - */ -void crypto_sign_free(SIGNATURE *sig) -{ - SignatureData_free(sig->sigData); - free (sig); -} - -/* - * Create a new encryption session. - * Returns: A pointer to a CRYPTO_SESSION object on success. - * NULL on failure. - */ -CRYPTO_SESSION *crypto_session_new (crypto_cipher_t cipher, alist *pubkeys) -{ - CRYPTO_SESSION *cs; - X509_KEYPAIR *keypair; - const EVP_CIPHER *ec; - unsigned char *iv; - int iv_len; - - /* Allocate our session description structures */ - cs = (CRYPTO_SESSION *) malloc(sizeof(CRYPTO_SESSION)); - if (!cs) { - return NULL; - } - - /* Initialize required fields */ - cs->session_key = NULL; - - /* Allocate a CryptoData structure */ - cs->cryptoData = CryptoData_new(); - - if (!cs->cryptoData) { - /* Allocation failed in OpenSSL */ - free(cs); - return NULL; - } - - /* Set the ASN.1 structure version number */ - ASN1_INTEGER_set(cs->cryptoData->version, BACULA_ASN1_VERSION); - - /* - * Acquire a cipher instance and set the ASN.1 cipher NID - */ - switch (cipher) { - case CRYPTO_CIPHER_AES_128_CBC: - /* AES 128 bit CBC */ - cs->cryptoData->contentEncryptionAlgorithm = OBJ_nid2obj(NID_aes_128_cbc); - ec = EVP_aes_128_cbc(); - break; - case CRYPTO_CIPHER_AES_192_CBC: - /* AES 192 bit CBC */ - cs->cryptoData->contentEncryptionAlgorithm = OBJ_nid2obj(NID_aes_192_cbc); - ec = EVP_aes_192_cbc(); - break; - case CRYPTO_CIPHER_AES_256_CBC: - /* AES 256 bit CBC */ - cs->cryptoData->contentEncryptionAlgorithm = OBJ_nid2obj(NID_aes_256_cbc); - ec = EVP_aes_256_cbc(); - break; - case CRYPTO_CIPHER_BLOWFISH_CBC: - /* Blowfish CBC */ - cs->cryptoData->contentEncryptionAlgorithm = OBJ_nid2obj(NID_bf_cbc); - ec = EVP_bf_cbc(); - break; - default: - Emsg0(M_ERROR, 0, _("Unsupported cipher type specified\n")); - crypto_session_free(cs); - return NULL; - } - - /* Generate a symmetric session key */ - cs->session_key_len = EVP_CIPHER_key_length(ec); - cs->session_key = (unsigned char *) malloc(cs->session_key_len); - if (RAND_bytes(cs->session_key, cs->session_key_len) <= 0) { - /* OpenSSL failure */ - crypto_session_free(cs); - return NULL; - } - - /* Generate an IV if possible */ - if ((iv_len = EVP_CIPHER_iv_length(ec))) { - iv = (unsigned char *) malloc(iv_len); - if (!iv) { - /* Malloc failure */ - crypto_session_free(cs); - return NULL; - } - - /* Generate random IV */ - if (RAND_bytes(iv, iv_len) <= 0) { - /* OpenSSL failure */ - crypto_session_free(cs); - free(iv); - return NULL; - } - - /* Store it in our ASN.1 structure */ - if (!M_ASN1_OCTET_STRING_set(cs->cryptoData->iv, iv, iv_len)) { - /* Allocation failed in OpenSSL */ - crypto_session_free(cs); - free(iv); - return NULL; - } - free(iv); - } - - /* - * Create RecipientInfo structures for supplied - * public keys. - */ - foreach_alist(keypair, pubkeys) { - RecipientInfo *ri; - unsigned char *ekey; - int ekey_len; - - ri = RecipientInfo_new(); - if (!ri) { - /* Allocation failed in OpenSSL */ - crypto_session_free(cs); - return NULL; - } - - /* Set the ASN.1 structure version number */ - ASN1_INTEGER_set(ri->version, BACULA_ASN1_VERSION); - - /* Drop the string allocated by OpenSSL, and add our subjectKeyIdentifier */ - M_ASN1_OCTET_STRING_free(ri->subjectKeyIdentifier); - ri->subjectKeyIdentifier = M_ASN1_OCTET_STRING_dup(keypair->keyid); - - /* Set our key encryption algorithm. We currently require RSA */ - assert(keypair->pubkey && EVP_PKEY_type(keypair->pubkey->type) == EVP_PKEY_RSA); - ri->keyEncryptionAlgorithm = OBJ_nid2obj(NID_rsaEncryption); - - /* Encrypt the session key */ - ekey = (unsigned char *) malloc(EVP_PKEY_size(keypair->pubkey)); - if (!ekey) { - RecipientInfo_free(ri); - crypto_session_free(cs); - return NULL; - } - - if ((ekey_len = EVP_PKEY_encrypt(ekey, cs->session_key, cs->session_key_len, keypair->pubkey)) <= 0) { - /* OpenSSL failure */ - RecipientInfo_free(ri); - crypto_session_free(cs); - free(ekey); - return NULL; - } - - /* Store it in our ASN.1 structure */ - if (!M_ASN1_OCTET_STRING_set(ri->encryptedKey, ekey, ekey_len)) { - /* Allocation failed in OpenSSL */ - RecipientInfo_free(ri); - crypto_session_free(cs); - free(ekey); - return NULL; - } - - /* Free the encrypted key buffer */ - free(ekey); - - /* Push the new RecipientInfo structure onto the stack */ - sk_RecipientInfo_push(cs->cryptoData->recipientInfo, ri); - } - - return cs; -} - -/* - * Encodes the CryptoData structure. The length argument is used to specify the - * size of dest. A length of 0 will cause no data to be written to dest, and the - * required length to be written to length. The caller can then allocate sufficient - * space for the output. - * - * Returns: true on success, stores the encoded data in dest, and the size in length. - * false on failure. - */ -bool crypto_session_encode(CRYPTO_SESSION *cs, void *dest, size_t *length) -{ - if (*length == 0) { - *length = i2d_CryptoData(cs->cryptoData, NULL); - return true; - } - - *length = i2d_CryptoData(cs->cryptoData, (unsigned char **) &dest); - return true; -} - -/* - * Decodes the CryptoData structure. The length argument is - * used to specify the size of data. - * - * Returns: CRYPTO_SESSION instance on success. - * NULL on failure. - * Returns: CRYPTO_ERROR_NONE and a pointer to a newly allocated CRYPTO_SESSION structure in *session on success. - * A crypto_error_t value on failure. - */ -crypto_error_t crypto_session_decode(const void *data, size_t length, alist *keypairs, CRYPTO_SESSION **session) -{ - CRYPTO_SESSION *cs; - X509_KEYPAIR *keypair; - STACK_OF(RecipientInfo) *recipients; - crypto_error_t retval = CRYPTO_ERROR_NONE; -#if (OPENSSL_VERSION_NUMBER >= 0x0090800FL) - const unsigned char *p = (const unsigned char *) data; -#else - unsigned char *p = (unsigned char *) data; -#endif - - cs = (CRYPTO_SESSION *) malloc(sizeof(CRYPTO_SESSION)); - if (!cs) { - return CRYPTO_ERROR_INTERNAL; - } - - /* Initialize required fields */ - cs->session_key = NULL; - - /* d2i_CryptoData modifies the supplied pointer */ - cs->cryptoData = d2i_CryptoData(NULL, &p, length); - - if (!cs->cryptoData) { - /* Allocation / Decoding failed in OpenSSL */ - openssl_post_errors(M_ERROR, _("CryptoData decoding failed")); - retval = CRYPTO_ERROR_INTERNAL; - goto err; - } - - recipients = cs->cryptoData->recipientInfo; - - /* - * Find a matching RecipientInfo structure for a supplied - * public key - */ - foreach_alist(keypair, keypairs) { - RecipientInfo *ri; - int i; - - /* Private key available? */ - if (keypair->privkey == NULL) { - continue; - } - - for (i = 0; i < sk_RecipientInfo_num(recipients); i++) { - ri = sk_RecipientInfo_value(recipients, i); - - /* Match against the subjectKeyIdentifier */ - if (M_ASN1_OCTET_STRING_cmp(keypair->keyid, ri->subjectKeyIdentifier) == 0) { - /* Match found, extract symmetric encryption session data */ - - /* RSA is required. */ - assert(EVP_PKEY_type(keypair->privkey->type) == EVP_PKEY_RSA); - - /* If we recieve a RecipientInfo structure that does not use - * RSA, return an error */ - if (OBJ_obj2nid(ri->keyEncryptionAlgorithm) != NID_rsaEncryption) { - retval = CRYPTO_ERROR_INVALID_CRYPTO; - goto err; - } - - /* Decrypt the session key */ - /* Allocate sufficient space for the largest possible decrypted data */ - cs->session_key = (unsigned char *) malloc(EVP_PKEY_size(keypair->privkey)); - cs->session_key_len = EVP_PKEY_decrypt(cs->session_key, M_ASN1_STRING_data(ri->encryptedKey), - M_ASN1_STRING_length(ri->encryptedKey), keypair->privkey); - - if (cs->session_key_len <= 0) { - openssl_post_errors(M_ERROR, _("Failure decrypting the session key")); - retval = CRYPTO_ERROR_DECRYPTION; - goto err; - } - - /* Session key successfully extracted, return the CRYPTO_SESSION structure */ - *session = cs; - return CRYPTO_ERROR_NONE; - } - } - } - - /* No matching recipient found */ - return CRYPTO_ERROR_NORECIPIENT; - -err: - crypto_session_free(cs); - return retval; -} - -/* - * Free memory associated with a crypto session object. - */ -void crypto_session_free (CRYPTO_SESSION *cs) -{ - if (cs->cryptoData) { - CryptoData_free(cs->cryptoData); - } - if (cs->session_key){ - free(cs->session_key); - } - free(cs); -} - -/* - * Create a new crypto cipher context with the specified session object - * Returns: A pointer to a CIPHER_CONTEXT object on success. The cipher block size is returned in blocksize. - * NULL on failure. - */ -CIPHER_CONTEXT *crypto_cipher_new (CRYPTO_SESSION *cs, bool encrypt, size_t *blocksize) -{ - CIPHER_CONTEXT *cipher_ctx; - const EVP_CIPHER *ec; - - cipher_ctx = (CIPHER_CONTEXT *) malloc(sizeof(CIPHER_CONTEXT)); - if (!cipher_ctx) { - return NULL; - } - - /* - * Acquire a cipher instance for the given ASN.1 cipher NID - */ - if ((ec = EVP_get_cipherbyobj(cs->cryptoData->contentEncryptionAlgorithm)) == NULL) { - Emsg1(M_ERROR, 0, _("Unsupported contentEncryptionAlgorithm: %d\n"), OBJ_obj2nid(cs->cryptoData->contentEncryptionAlgorithm)); - free(cipher_ctx); - return NULL; - } - - /* Initialize the OpenSSL cipher context */ - EVP_CIPHER_CTX_init(&cipher_ctx->ctx); - if (encrypt) { - /* Initialize for encryption */ - if (!EVP_CipherInit_ex(&cipher_ctx->ctx, ec, NULL, NULL, NULL, 1)) { - openssl_post_errors(M_ERROR, _("OpenSSL cipher context initialization failed")); - goto err; - } - } else { - /* Initialize for decryption */ - if (!EVP_CipherInit_ex(&cipher_ctx->ctx, ec, NULL, NULL, NULL, 0)) { - openssl_post_errors(M_ERROR, _("OpenSSL cipher context initialization failed")); - goto err; - } - } - - /* Set the key size */ - if (!EVP_CIPHER_CTX_set_key_length(&cipher_ctx->ctx, cs->session_key_len)) { - openssl_post_errors(M_ERROR, _("Encryption session provided an invalid symmetric key")); - goto err; - } - - /* Validate the IV length */ - if (EVP_CIPHER_iv_length(ec) != M_ASN1_STRING_length(cs->cryptoData->iv)) { - openssl_post_errors(M_ERROR, _("Encryption session provided an invalid IV")); - goto err; - } - - /* Add the key and IV to the cipher context */ - if (!EVP_CipherInit_ex(&cipher_ctx->ctx, NULL, NULL, cs->session_key, M_ASN1_STRING_data(cs->cryptoData->iv), -1)) { - openssl_post_errors(M_ERROR, _("OpenSSL cipher context key/IV initialization failed")); - goto err; - } - - *blocksize = EVP_CIPHER_CTX_block_size(&cipher_ctx->ctx); - return cipher_ctx; - -err: - crypto_cipher_free(cipher_ctx); - return NULL; -} - - -/* - * Encrypt/Decrypt length bytes of data using the provided cipher context - * Returns: true on success, number of bytes output in written - * false on failure - */ -bool crypto_cipher_update (CIPHER_CONTEXT *cipher_ctx, const void *data, size_t length, const void *dest, size_t *written) { - if (!EVP_CipherUpdate(&cipher_ctx->ctx, (unsigned char *) dest, (int *) written, (const unsigned char *) data, length)) { - /* This really shouldn't fail */ - return false; - } else { - return true; - } -} - -/* - * Finalize the cipher context, writing any remaining data and necessary padding - * to dest, and the size in written. - * The result size will either be one block of data or zero. - * - * Returns: true on success - * false on failure - */ -bool crypto_cipher_finalize (CIPHER_CONTEXT *cipher_ctx, void *dest, size_t *written) { - if (!EVP_CipherFinal_ex(&cipher_ctx->ctx, (unsigned char *) dest, (int *) written)) { - /* This really shouldn't fail */ - return false; - } else { - return true; - } -} - - -/* - * Free memory associated with a cipher context. - */ -void crypto_cipher_free (CIPHER_CONTEXT *cipher_ctx) -{ - EVP_CIPHER_CTX_cleanup(&cipher_ctx->ctx); - free (cipher_ctx); -} - - -/* - * Perform global initialization of OpenSSL - * This function is not thread safe. - * Returns: 0 on success - * errno on failure - */ -int init_crypto (void) -{ - int stat; - - if ((stat = openssl_init_threads()) != 0) { - Emsg1(M_ABORT, 0, _("Unable to init OpenSSL threading: ERR=%s\n"), strerror(stat)); - } - - /* Load libssl and libcrypto human-readable error strings */ - SSL_load_error_strings(); - - /* Initialize OpenSSL SSL library */ - SSL_library_init(); - - /* Register OpenSSL ciphers and digests */ - OpenSSL_add_all_algorithms(); - - if (!openssl_seed_prng()) { - Emsg0(M_ERROR_TERM, 0, _("Failed to seed OpenSSL PRNG\n")); - } - - crypto_initialized = true; - - return stat; -} - -/* - * Perform global cleanup of OpenSSL - * All cryptographic operations must be completed before calling this function. - * This function is not thread safe. - * Returns: 0 on success - * errno on failure - */ -int cleanup_crypto (void) -{ - /* - * Ensure that we've actually been initialized; Doing this here decreases the - * complexity of client's termination/cleanup code. - */ - if (!crypto_initialized) { - return 0; - } - - if (!openssl_save_prng()) { - Emsg0(M_ERROR, 0, _("Failed to save OpenSSL PRNG\n")); - } - - openssl_cleanup_threads(); - - /* Free libssl and libcrypto error strings */ - ERR_free_strings(); - - /* Free all ciphers and digests */ - EVP_cleanup(); - - /* Free memory used by PRNG */ - RAND_cleanup(); - - crypto_initialized = false; - - return 0; -} - - -#else /* HAVE_OPENSSL */ -# error No encryption library available -#endif /* HAVE_OPENSSL */ - -#else /* HAVE_CRYPTO */ - -/* - * Cryptography Support Disabled - */ - -/* Message Digest Structure */ -struct Digest { - crypto_digest_t type; - union { - SHA1Context sha1; - MD5Context md5; - }; -}; - -/* Dummy Signature Structure */ -struct Signature { -}; - -DIGEST *crypto_digest_new (crypto_digest_t type) -{ - DIGEST *digest; - - digest = (DIGEST *) malloc(sizeof(DIGEST)); - digest->type = type; - - switch (type) { - case CRYPTO_DIGEST_MD5: - MD5Init(&digest->md5); - break; - case CRYPTO_DIGEST_SHA1: - SHA1Init(&digest->sha1); - break; - default: - Emsg0(M_ERROR, 0, _("Unsupported digest type specified\n")); - free(digest); - return NULL; - } - - return (digest); -} - -bool crypto_digest_update (DIGEST *digest, const void *data, size_t length) { - switch (digest->type) { - case CRYPTO_DIGEST_MD5: - /* Doesn't return anything ... */ - MD5Update(&digest->md5, (unsigned char *) data, length); - return true; - case CRYPTO_DIGEST_SHA1: - int ret; - if ((ret = SHA1Update(&digest->sha1, (const u_int8_t *) data, length)) == shaSuccess) { - return true; - } else { - Emsg1(M_ERROR, 0, _("SHA1Update() returned an error: %d\n"), ret); - return false; - } - break; - default: - return false; - } -} - -bool crypto_digest_finalize (DIGEST *digest, void *dest, size_t *length) { - - switch (digest->type) { - case CRYPTO_DIGEST_MD5: - /* Guard against programmer error by either the API client or - * an out-of-sync CRYPTO_DIGEST_MAX_SIZE */ - assert(*length >= CRYPTO_DIGEST_MD5_SIZE); - *length = CRYPTO_DIGEST_MD5_SIZE; - /* Doesn't return anything ... */ - MD5Final((unsigned char *) dest, &digest->md5); - return true; - case CRYPTO_DIGEST_SHA1: - /* Guard against programmer error by either the API client or - * an out-of-sync CRYPTO_DIGEST_MAX_SIZE */ - assert(*length >= CRYPTO_DIGEST_SHA1_SIZE); - *length = CRYPTO_DIGEST_SHA1_SIZE; - if (SHA1Final(&digest->sha1, (u_int8_t *) dest) == shaSuccess) { - return true; - } else { - return false; - } - break; - default: - return false; - } - - return false; -} - -void crypto_digest_free (DIGEST *digest) -{ - free (digest); -} - -/* Dummy routines */ -int init_crypto (void) { return 0; } -int cleanup_crypto (void) { return 0; } - -SIGNATURE *crypto_sign_new (void) { return NULL; } - -crypto_error_t crypto_sign_get_digest (SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST **digest) { return CRYPTO_ERROR_INTERNAL; } -crypto_error_t crypto_sign_verify (SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST *digest) { return CRYPTO_ERROR_INTERNAL; } - -int crypto_sign_add_signer (SIGNATURE *sig, DIGEST *digest, X509_KEYPAIR *keypair) { return false; } -int crypto_sign_encode (SIGNATURE *sig, void *dest, size_t *length) { return false; } - -SIGNATURE *crypto_sign_decode (const void *sigData, size_t length) { return NULL; } -void crypto_sign_free (SIGNATURE *sig) { } - - -X509_KEYPAIR *crypto_keypair_new (void) { return NULL; } -X509_KEYPAIR *crypto_keypair_dup (X509_KEYPAIR *keypair) { return NULL; } -int crypto_keypair_load_cert (X509_KEYPAIR *keypair, const char *file) { return false; } -bool crypto_keypair_has_key (const char *file) { return false; } -int crypto_keypair_load_key (X509_KEYPAIR *keypair, const char *file, CRYPTO_PEM_PASSWD_CB *pem_callback, const void *pem_userdata) { return false; } -void crypto_keypair_free (X509_KEYPAIR *keypair) { } - -CRYPTO_SESSION *crypto_session_new (crypto_cipher_t cipher, alist *pubkeys) { return NULL; } -void crypto_session_free (CRYPTO_SESSION *cs) { } -bool crypto_session_encode (CRYPTO_SESSION *cs, void *dest, size_t *length) { return false; } -crypto_error_t crypto_session_decode (const void *data, size_t length, alist *keypairs, CRYPTO_SESSION **session) { return CRYPTO_ERROR_INTERNAL; } - -CIPHER_CONTEXT *crypto_cipher_new (CRYPTO_SESSION *cs, bool encrypt, size_t *blocksize) { return NULL; } -bool crypto_cipher_update (CIPHER_CONTEXT *cipher_ctx, const void *data, size_t length, const void *dest, size_t *written) { return false; } -bool crypto_cipher_finalize (CIPHER_CONTEXT *cipher_ctx, void *dest, size_t *written) { return false; } -void crypto_cipher_free (CIPHER_CONTEXT *cipher_ctx) { } - -#endif /* HAVE_CRYPTO */ - -/* Shared Code */ - -/* - * Default PEM encryption passphrase callback. - * Returns an empty password. - */ -int crypto_default_pem_callback(char *buf, int size, const void *userdata) -{ - bstrncpy(buf, "", size); - return (strlen(buf)); -} - -/* - * Returns the ASCII name of the digest type. - * Returns: ASCII name of digest type. - */ -const char *crypto_digest_name (DIGEST *digest) { - switch (digest->type) { - case CRYPTO_DIGEST_MD5: - return "MD5"; - case CRYPTO_DIGEST_SHA1: - return "SHA1"; - case CRYPTO_DIGEST_SHA256: - return "SHA256"; - case CRYPTO_DIGEST_SHA512: - return "SHA512"; - case CRYPTO_DIGEST_NONE: - return "None"; - default: - return "Invalid Digest Type"; - } - -} - -/* - * Given a stream type, returns the associated - * crypto_digest_t value. - */ -crypto_digest_t crypto_digest_stream_type (int stream) { - switch (stream) { - case STREAM_MD5_DIGEST: - return CRYPTO_DIGEST_MD5; - case STREAM_SHA1_DIGEST: - return CRYPTO_DIGEST_SHA1; - case STREAM_SHA256_DIGEST: - return CRYPTO_DIGEST_SHA256; - case STREAM_SHA512_DIGEST: - return CRYPTO_DIGEST_SHA512; - default: - return CRYPTO_DIGEST_NONE; - } -} - -/* - * * Given a crypto_error_t value, return the associated - * * error string - * */ -const char *crypto_strerror(crypto_error_t error) { - switch (error) { - case CRYPTO_ERROR_NONE: - return "No error"; - case CRYPTO_ERROR_NOSIGNER: - return "Signer not found"; - case CRYPTO_ERROR_NORECIPIENT: - return "Recipient not found"; - case CRYPTO_ERROR_INVALID_DIGEST: - return "Unsupported digest algorithm"; - case CRYPTO_ERROR_INVALID_CRYPTO: - return "Unsupported encryption algorithm"; - case CRYPTO_ERROR_BAD_SIGNATURE: - return "Signature is invalid"; - case CRYPTO_ERROR_DECRYPTION: - return "Decryption error"; - case CRYPTO_ERROR_INTERNAL: - /* This shouldn't happen */ - return "Internal error"; - default: - return "Unknown error"; - } -} diff --git a/bacula/src/lib/crypto.h b/bacula/src/lib/crypto.h index 8b3552d08c..17e546bd63 100644 --- a/bacula/src/lib/crypto.h +++ b/bacula/src/lib/crypto.h @@ -46,10 +46,7 @@ typedef struct Digest DIGEST; typedef struct Signature SIGNATURE; /* Opaque PKI Symmetric Key Data Structure */ -typedef struct Crypto_Session CRYPTO_SESSION; - -/* Opaque Encryption/Decryption Context Structure */ -typedef struct Cipher_Context CIPHER_CONTEXT; +typedef struct Crypto_Recipients CRYPTO_RECIPIENTS; /* PEM Decryption Passphrase Callback */ typedef int (CRYPTO_PEM_PASSWD_CB) (char *buf, int size, const void *userdata); @@ -77,12 +74,9 @@ typedef enum { typedef enum { CRYPTO_ERROR_NONE = 0, /* No error */ CRYPTO_ERROR_NOSIGNER = 1, /* Signer not found */ - CRYPTO_ERROR_NORECIPIENT = 2, /* Recipient not found */ - CRYPTO_ERROR_INVALID_DIGEST = 3, /* Unsupported digest algorithm */ - CRYPTO_ERROR_INVALID_CRYPTO = 4, /* Unsupported encryption algorithm */ - CRYPTO_ERROR_BAD_SIGNATURE = 5, /* Signature is invalid */ - CRYPTO_ERROR_DECRYPTION = 6, /* Decryption error */ - CRYPTO_ERROR_INTERNAL = 7 /* Internal Error */ + CRYPTO_ERROR_INVALID_DIGEST = 2, /* Unsupported digest algorithm */ + CRYPTO_ERROR_BAD_SIGNATURE = 3, /* Signature is invalid */ + CRYPTO_ERROR_INTERNAL = 4 /* Internal Error */ } crypto_error_t; /* Message Digest Sizes */ @@ -94,9 +88,8 @@ typedef enum { /* Maximum Message Digest Size */ #ifdef HAVE_OPENSSL -/* Let OpenSSL define a few things */ -#define CRYPTO_DIGEST_MAX_SIZE EVP_MAX_MD_SIZE -#define CRYPTO_CIPHER_MAX_BLOCK_SIZE EVP_MAX_BLOCK_LENGTH +/* Let OpenSSL define it */ +#define CRYPTO_DIGEST_MAX_SIZE EVP_MAX_MD_SIZE #else /* HAVE_OPENSSL */ @@ -113,9 +106,6 @@ typedef enum { #define CRYPTO_DIGEST_MAX_SIZE CRYPTO_DIGEST_SHA512_SIZE #endif -/* Dummy Value */ -#define CRYPTO_CIPHER_MAX_BLOCK_SIZE 0 - #endif /* HAVE_OPENSSL */ #endif /* __CRYPTO_H_ */ diff --git a/bacula/src/lib/dlist.h b/bacula/src/lib/dlist.h index ce975f4865..32933ad608 100644 --- a/bacula/src/lib/dlist.h +++ b/bacula/src/lib/dlist.h @@ -36,15 +36,16 @@ * * Loop var through each member of list */ +#ifdef HAVE_GCC #define foreach_dlist(var, list) \ - for((var)=NULL; (*((void **)&(var))=(void*)((list)->next(var))); ) - -#ifdef the_old_way + for((var)=NULL; ((var)=(typeof(var))(list)->next(var)); ) +#else #define foreach_dlist(var, list) \ - for((var)=NULL; (((void *)(var))=(list)->next(var)); ) + for((var)=NULL; (*((void **)&(var))=(void*)((list)->next(var))); ) #endif + struct dlink { void *next; void *prev; diff --git a/bacula/src/lib/edit.c b/bacula/src/lib/edit.c index a322931520..c0e5d0523d 100644 --- a/bacula/src/lib/edit.c +++ b/bacula/src/lib/edit.c @@ -259,10 +259,10 @@ bool duration_to_utime(char *str, utime_t *value) * to months. These "kludges" make it compatible with pre 1.31 * Baculas. */ - static const char *mod[] = {"n", "seconds", "months", "minutes", + static const char *mod[] = {"n", "seconds", "months", "minutes", "mins", "hours", "days", "weeks", "quarters", "years", NULL}; - static const int32_t mult[] = {60, 1, 60*60*24*30, 60, - 60*60, 60*60*24, 60*60*24*7, 60*60*24*91, 60*60*24*365}; + static const int32_t mult[] = {60, 1, 60*60*24*30, 60, 60, + 3600, 3600*24, 3600*24*7, 3600*24*91, 3600*24*365}; while (*str) { if (!get_modifier(str, num_str, sizeof(num_str), mod_str, sizeof(mod_str))) { diff --git a/bacula/src/lib/jcr.c b/bacula/src/lib/jcr.c index 6c7d6daa0d..8c2c241ba9 100755 --- a/bacula/src/lib/jcr.c +++ b/bacula/src/lib/jcr.c @@ -229,8 +229,8 @@ JCR *new_jcr(int size, JCR_free_HANDLER *daemon_free_jcr) jcr->job_end_push.init(1, false); jcr->sched_time = time(NULL); jcr->daemon_free_jcr = daemon_free_jcr; /* plug daemon free routine */ - jcr->use_count = 1; - pthread_mutex_init(&(jcr->mutex), NULL); + jcr->init_mutex(); + jcr->inc_use_count(); jcr->JobStatus = JS_Created; /* ready to run */ jcr->VolumeName = get_pool_memory(PM_FNAME); jcr->VolumeName[0] = 0; @@ -329,7 +329,7 @@ static void free_common_jcr(JCR *jcr) default: break; } - pthread_mutex_destroy(&jcr->mutex); + jcr->destroy_mutex(); delete jcr->msg_queue; close_msg(jcr); /* close messages for this job */ @@ -396,14 +396,14 @@ void free_jcr(JCR *jcr) dequeue_messages(jcr); lock_jcr_chain(); jcr->dec_use_count(); /* decrement use count */ - if (jcr->use_count < 0) { + if (jcr->use_count() < 0) { Emsg2(M_ERROR, 0, _("JCR use_count=%d JobId=%d\n"), - jcr->use_count, jcr->JobId); + jcr->use_count(), jcr->JobId); } - Dmsg3(3400, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count, jcr->JobId); - if (jcr->use_count > 0) { /* if in use */ + Dmsg3(3400, "Dec free_jcr 0x%x use_count=%d jobid=%d\n", jcr, jcr->use_count(), jcr->JobId); + if (jcr->use_count() > 0) { /* if in use */ unlock_jcr_chain(); - Dmsg3(3400, "free_jcr 0x%x job=%d use_count=%d\n", jcr, jcr->JobId, jcr->use_count); + Dmsg3(3400, "free_jcr 0x%x job=%d use_count=%d\n", jcr, jcr->JobId, jcr->use_count()); return; } @@ -432,15 +432,14 @@ JCR *get_jcr_by_id(uint32_t JobId) { JCR *jcr; - lock_jcr_chain(); /* lock chain */ - foreach_dlist(jcr, jcrs) { + foreach_jcr(jcr) { if (jcr->JobId == JobId) { jcr->inc_use_count(); - Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count); + Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count()); break; } } - unlock_jcr_chain(); + endeach_jcr(jcr); return jcr; } @@ -453,16 +452,15 @@ JCR *get_jcr_by_session(uint32_t SessionId, uint32_t SessionTime) { JCR *jcr; - lock_jcr_chain(); - foreach_dlist(jcr, jcrs) { + foreach_jcr(jcr) { if (jcr->VolSessionId == SessionId && jcr->VolSessionTime == SessionTime) { jcr->inc_use_count(); - Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count); + Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count()); break; } } - unlock_jcr_chain(); + endeach_jcr(jcr); return jcr; } @@ -482,16 +480,15 @@ JCR *get_jcr_by_partial_name(char *Job) if (!Job) { return NULL; } - lock_jcr_chain(); len = strlen(Job); - foreach_dlist(jcr, jcrs) { + foreach_jcr(jcr) { if (strncmp(Job, jcr->Job, len) == 0) { jcr->inc_use_count(); - Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count); + Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count()); break; } } - unlock_jcr_chain(); + endeach_jcr(jcr); return jcr; } @@ -509,15 +506,14 @@ JCR *get_jcr_by_full_name(char *Job) if (!Job) { return NULL; } - lock_jcr_chain(); - foreach_dlist(jcr, jcrs) { + foreach_jcr(jcr) { if (strcmp(jcr->Job, Job) == 0) { jcr->inc_use_count(); - Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count); + Dmsg2(3400, "Inc get_jcr 0x%x use_count=%d\n", jcr, jcr->use_count()); break; } } - unlock_jcr_chain(); + endeach_jcr(jcr); return jcr; } @@ -600,7 +596,7 @@ JCR *jcr_walk_start() if (jcr) { jcr->inc_use_count(); Dmsg3(3400, "Inc jcr_walk_start 0x%x job=%d use_count=%d\n", jcr, - jcr->JobId, jcr->use_count); + jcr->JobId, jcr->use_count()); } unlock_jcr_chain(); return jcr; @@ -618,7 +614,7 @@ JCR *jcr_walk_next(JCR *prev_jcr) if (jcr) { jcr->inc_use_count(); Dmsg3(3400, "Inc jcr_walk_next 0x%x job=%d use_count=%d\n", jcr, - jcr->JobId, jcr->use_count); + jcr->JobId, jcr->use_count()); } unlock_jcr_chain(); if (prev_jcr) { diff --git a/bacula/src/lib/lib.h b/bacula/src/lib/lib.h index 88c2fe4d16..58c404cf3b 100644 --- a/bacula/src/lib/lib.h +++ b/bacula/src/lib/lib.h @@ -9,7 +9,7 @@ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -32,7 +32,7 @@ #include "crypto.h" #include "mem_pool.h" #include "message.h" -#include "openssl.h" +/* #include "openssl.h" */ #include "lex.h" #include "parse_conf.h" #include "tls.h" diff --git a/bacula/src/lib/openssl.c b/bacula/src/lib/openssl.c deleted file mode 100644 index 929dee7c26..0000000000 --- a/bacula/src/lib/openssl.c +++ /dev/null @@ -1,232 +0,0 @@ -/* - * openssl.c OpenSSL support functions - * - * Author: Landon Fuller - * - * Version $Id$ - * - * Copyright (C) 2005 Kern Sibbald - * - * This file was contributed to the Bacula project by Landon Fuller. - * - * Landon Fuller has been granted a perpetual, worldwide, non-exclusive, - * no-charge, royalty-free, irrevocable copyright license to reproduce, - * prepare derivative works of, publicly display, publicly perform, - * sublicense, and distribute the original work contributed by Landon Fuller - * to the Bacula project in source or object form. - * - * If you wish to license these contributions under an alternate open source - * license please contact Landon Fuller . - */ -/* - Copyright (C) 2005 Kern Sibbald - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. - - */ - - -#include "bacula.h" -#include - -#ifdef HAVE_OPENSSL - -/* Array of mutexes for use with OpenSSL static locking */ -static pthread_mutex_t *mutexes; - -/* OpenSSL dynamic locking structure */ -struct CRYPTO_dynlock_value { - pthread_mutex_t mutex; -}; - - -/* - * Post all per-thread openssl errors - */ -void openssl_post_errors(int code, const char *errstring) -{ - char buf[512]; - unsigned long sslerr; - - /* Pop errors off of the per-thread queue */ - while((sslerr = ERR_get_error()) != 0) { - /* Acquire the human readable string */ - ERR_error_string_n(sslerr, (char *) &buf, sizeof(buf)); - Emsg2(M_ERROR, 0, "%s: ERR=%s\n", errstring, buf); - } -} - -/* - * Return an OpenSSL thread ID - * Returns: thread ID - * - */ -static unsigned long get_openssl_thread_id (void) -{ - /* Comparison without use of pthread_equal() is mandated by the OpenSSL API */ - return ((unsigned long) pthread_self()); -} - -/* - * Allocate a dynamic OpenSSL mutex - */ -static struct CRYPTO_dynlock_value *openssl_create_dynamic_mutex (const char *file, int line) -{ - struct CRYPTO_dynlock_value *dynlock; - int stat; - - dynlock = (struct CRYPTO_dynlock_value *) malloc(sizeof(struct CRYPTO_dynlock_value)); - - if ((stat = pthread_mutex_init(&dynlock->mutex, NULL)) != 0) { - Emsg1(M_ABORT, 0, _("Unable to init mutex: ERR=%s\n"), strerror(stat)); - } - - return dynlock; -} - -static void openssl_update_dynamic_mutex (int mode, struct CRYPTO_dynlock_value *dynlock, const char *file, int line) -{ - if (mode & CRYPTO_LOCK) { - P(dynlock->mutex); - } else { - V(dynlock->mutex); - } -} - -static void openssl_destroy_dynamic_mutex (struct CRYPTO_dynlock_value *dynlock, const char *file, int line) -{ - int stat; - - if ((stat = pthread_mutex_destroy(&dynlock->mutex)) != 0) { - Emsg1(M_ABORT, 0, _("Unable to destroy mutex: ERR=%s\n"), strerror(stat)); - } - - free(dynlock); -} - -/* - * (Un)Lock a static OpenSSL mutex - */ -static void openssl_update_static_mutex (int mode, int i, const char *file, int line) -{ - if (mode & CRYPTO_LOCK) { - P(mutexes[i]); - } else { - V(mutexes[i]); - } -} - -/* - * Initialize OpenSSL thread support - * Returns: 0 on success - * errno on failure - */ -int openssl_init_threads (void) -{ - int i, numlocks; - int stat; - - - /* Set thread ID callback */ - CRYPTO_set_id_callback(get_openssl_thread_id); - - /* Initialize static locking */ - numlocks = CRYPTO_num_locks(); - mutexes = (pthread_mutex_t *) malloc(numlocks * sizeof(pthread_mutex_t)); - for (i = 0; i < numlocks; i++) { - if ((stat = pthread_mutex_init(&mutexes[i], NULL)) != 0) { - Emsg1(M_ERROR, 0, _("Unable to init mutex: ERR=%s\n"), strerror(stat)); - return stat; - } - } - - /* Set static locking callback */ - CRYPTO_set_locking_callback(openssl_update_static_mutex); - - /* Initialize dyanmic locking */ - CRYPTO_set_dynlock_create_callback(openssl_create_dynamic_mutex); - CRYPTO_set_dynlock_lock_callback(openssl_update_dynamic_mutex); - CRYPTO_set_dynlock_destroy_callback(openssl_destroy_dynamic_mutex); - - return 0; -} - -/* - * Clean up OpenSSL threading support - */ -void openssl_cleanup_threads (void) -{ - int i, numlocks; - int stat; - - /* Unset thread ID callback */ - CRYPTO_set_id_callback(NULL); - - /* Deallocate static lock mutexes */ - numlocks = CRYPTO_num_locks(); - for (i = 0; i < numlocks; i++) { - if ((stat = pthread_mutex_destroy(&mutexes[i])) != 0) { - /* We don't halt execution, reporting the error should be sufficient */ - Emsg1(M_ERROR, 0, _("Unable to destroy mutex: ERR=%s\n"), strerror(stat)); - } - } - - /* Unset static locking callback */ - CRYPTO_set_locking_callback(NULL); - - /* Free static lock array */ - free(mutexes); - - /* Unset dynamic locking callbacks */ - CRYPTO_set_dynlock_create_callback(NULL); - CRYPTO_set_dynlock_lock_callback(NULL); - CRYPTO_set_dynlock_destroy_callback(NULL); -} - - -/* - * Seed OpenSSL PRNG - * Returns: 1 on success - * 0 on failure - */ -int openssl_seed_prng (void) -{ - const char *names[] = { "/dev/urandom", "/dev/random", NULL }; - int i; - - // ***FIXME*** - // Win32 Support - // Read saved entropy? - - for (i = 0; names[i]; i++) { - if (RAND_load_file(names[i], 1024) != -1) { - /* Success */ - return 1; - } - } - - /* Fail */ - return 0; -} - -/* - * Save OpenSSL Entropy - * Returns: 1 on success - * 0 on failure - */ -int openssl_save_prng (void) -{ - // ***FIXME*** - // Implement PRNG state save - return 1; -} - -#endif /* HAVE_OPENSSL */ diff --git a/bacula/src/lib/openssl.h b/bacula/src/lib/openssl.h deleted file mode 100644 index 7654e177cf..0000000000 --- a/bacula/src/lib/openssl.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * openssl.h OpenSSL support functions - * - * Author: Landon Fuller - * - * Version $Id$ - * - * Copyright (C) 2005 Kern Sibbald - * - * This file was contributed to the Bacula project by Landon Fuller. - * - * Landon Fuller has been granted a perpetual, worldwide, non-exclusive, - * no-charge, royalty-free, irrevocable copyright * license to reproduce, - * prepare derivative works of, publicly display, publicly perform, - * sublicense, and distribute the original work contributed by Landon Fuller - * to the Bacula project in source or object form. - * - * If you wish to license these contributions under an alternate open source - * license please contact Landon Fuller . - */ -/* - Copyright (C) 2005 Kern Sibbald - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. - - */ - -#ifndef __OPENSSL_H_ -#define __OPENSSL_H_ - -#ifdef HAVE_OPENSSL -void openssl_post_errors (int code, const char *errstring); -int openssl_init_threads (void); -void openssl_cleanup_threads (void); -int openssl_seed_prng (void); -int openssl_save_prng (void); -#endif /* HAVE_OPENSSL */ - -#endif /* __OPENSSL_H_ */ diff --git a/bacula/src/lib/parse_conf.c b/bacula/src/lib/parse_conf.c index 1e8b2be9ed..a16609b2f4 100755 --- a/bacula/src/lib/parse_conf.c +++ b/bacula/src/lib/parse_conf.c @@ -136,7 +136,7 @@ struct s_kw { * * tape label label code = token */ -static s_kw tapelabels[] = { +struct s_kw tapelabels[] = { {"bacula", B_BACULA_LABEL}, {"ansi", B_ANSI_LABEL}, {"ibm", B_IBM_LABEL}, @@ -191,10 +191,8 @@ void init_resource(int type, RES_ITEM *items, int pass) (items[i].flags & ITEM_DEFAULT) ? "yes" : "no", items[i].default_value); if (items[i].flags & ITEM_DEFAULT && items[i].default_value != 0) { - if (items[i].handler == store_bit) { + if (items[i].handler == store_yesno) { *(int *)(items[i].value) |= items[i].code; - } else if (items[i].handler == store_bool) { - *(bool *)(items[i].value) = items[i].default_value; } else if (items[i].handler == store_pint || items[i].handler == store_int) { *(int *)(items[i].value) = items[i].default_value; @@ -690,36 +688,20 @@ void store_time(LEX *lc, RES_ITEM *item, int index, int pass) /* Store a yes/no in a bit field */ -void store_bit(LEX *lc, RES_ITEM *item, int index, int pass) +void store_yesno(LEX *lc, RES_ITEM *item, int index, int pass) { lex_get_token(lc, T_NAME); - if (strcasecmp(lc->str, "yes") == 0 || strcasecmp(lc->str, "true") == 0) { + if (strcasecmp(lc->str, "yes") == 0) { *(int *)(item->value) |= item->code; - } else if (strcasecmp(lc->str, "no") == 0 || strcasecmp(lc->str, "false") == 0) { + } else if (strcasecmp(lc->str, "no") == 0) { *(int *)(item->value) &= ~(item->code); } else { - scan_err2(lc, _("Expect %s, got: %s"), "YES, NO, TRUE, or FALSE", lc->str); /* YES and NO must not be translated */ + scan_err3(lc, _("Expect a %s or %s, got: %s"), "YES", "NO", lc->str); /* YES and NO must not be translated */ } scan_to_eol(lc); set_bit(index, res_all.hdr.item_present); } -/* Store a bool in a bit field */ -void store_bool(LEX *lc, RES_ITEM *item, int index, int pass) -{ - lex_get_token(lc, T_NAME); - if (strcasecmp(lc->str, "yes") == 0 || strcasecmp(lc->str, "true") == 0) { - *(bool *)(item->value) = true; - } else if (strcasecmp(lc->str, "no") == 0 || strcasecmp(lc->str, "false") == 0) { - *(bool *)(item->value) = false; - } else { - scan_err2(lc, _("Expect %s, got: %s"), "YES, NO, TRUE, or FALSE", lc->str); /* YES and NO must not be translated */ - } - scan_to_eol(lc); - set_bit(index, res_all.hdr.item_present); -} - - /* * Store Tape Label Type (Bacula, ANSI, IBM) * diff --git a/bacula/src/lib/parse_conf.h b/bacula/src/lib/parse_conf.h index 754a009cc7..e4d3980bde 100644 --- a/bacula/src/lib/parse_conf.h +++ b/bacula/src/lib/parse_conf.h @@ -2,22 +2,17 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ @@ -32,14 +27,14 @@ typedef void (MSG_RES_HANDLER)(LEX *lc, RES_ITEM *item, int index, int pass); struct RES_ITEM { const char *name; /* Resource name i.e. Director, ... */ MSG_RES_HANDLER *handler; /* Routine storing the resource item */ - void **value; /* Where to store the item */ + char **value; /* Where to store the item */ int code; /* item code/additional info */ int flags; /* flags: default, required, ... */ int default_value; /* default value */ }; /* For storing name_addr items in res_items table */ -#define ITEM(x) ((void **)&res_all.x) +#define ITEM(x) ((char **)&res_all.x) #define MAX_RES_ITEMS 70 /* maximum resource items per RES */ @@ -114,15 +109,16 @@ void save_resource(int type, RES_ITEM *item, int pass); const char *res_to_str(int rcode); /* Loop through each resource of type, returning in var */ +#ifdef HAVE_GCC #define foreach_res(var, type) \ - for(var=NULL; (*((void **)&(var))=(void *)GetNextRes((type), (RES *)var));) - -#ifdef the_old_way + for((var)=NULL; ((var)=(typeof(var))GetNextRes((type), (RES *)var));) +#else #define foreach_res(var, type) \ - for((var)=NULL; (((void *)(var))=GetNextRes((type), (RES *)var));) + for(var=NULL; (*((void **)&(var))=(void *)GetNextRes((type), (RES *)var));) #endif + void store_str(LEX *lc, RES_ITEM *item, int index, int pass); void store_dir(LEX *lc, RES_ITEM *item, int index, int pass); void store_password(LEX *lc, RES_ITEM *item, int index, int pass); @@ -135,8 +131,7 @@ void store_int(LEX *lc, RES_ITEM *item, int index, int pass); void store_pint(LEX *lc, RES_ITEM *item, int index, int pass); void store_msgs(LEX *lc, RES_ITEM *item, int index, int pass); void store_int64(LEX *lc, RES_ITEM *item, int index, int pass); -void store_bit(LEX *lc, RES_ITEM *item, int index, int pass); -void store_bool(LEX *lc, RES_ITEM *item, int index, int pass); +void store_yesno(LEX *lc, RES_ITEM *item, int index, int pass); void store_time(LEX *lc, RES_ITEM *item, int index, int pass); void store_size(LEX *lc, RES_ITEM *item, int index, int pass); void store_defs(LEX *lc, RES_ITEM *item, int index, int pass); diff --git a/bacula/src/lib/protos.h b/bacula/src/lib/protos.h index eedbc018cb..753064c7b7 100644 --- a/bacula/src/lib/protos.h +++ b/bacula/src/lib/protos.h @@ -4,22 +4,17 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ @@ -113,49 +108,15 @@ void hmac_md5(uint8_t* text, int text_len, uint8_t* key, uint32_t bcrc32(uint8_t *buf, int len); -/* crypto.c */ -int init_crypto (void); -int cleanup_crypto (void); -DIGEST * crypto_digest_new (crypto_digest_t type); -bool crypto_digest_update (DIGEST *digest, const void *data, size_t length); -bool crypto_digest_finalize (DIGEST *digest, void *dest, size_t *length); -void crypto_digest_free (DIGEST *digest); -SIGNATURE * crypto_sign_new (void); -crypto_error_t crypto_sign_get_digest (SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST **digest); -crypto_error_t crypto_sign_verify (SIGNATURE *sig, X509_KEYPAIR *keypair, DIGEST *digest); -int crypto_sign_add_signer (SIGNATURE *sig, DIGEST *digest, X509_KEYPAIR *keypair); -int crypto_sign_encode (SIGNATURE *sig, void *dest, size_t *length); -SIGNATURE * crypto_sign_decode (const void *sigData, size_t length); -void crypto_sign_free (SIGNATURE *sig); -CRYPTO_SESSION * crypto_session_new (crypto_cipher_t cipher, alist *pubkeys); -void crypto_session_free (CRYPTO_SESSION *cs); -bool crypto_session_encode (CRYPTO_SESSION *cs, void *dest, size_t *length); -crypto_error_t crypto_session_decode (const void *data, size_t length, alist *keypairs, CRYPTO_SESSION **session); -CRYPTO_SESSION * crypto_session_decode (const void *data, size_t length); -CIPHER_CONTEXT * crypto_cipher_new (CRYPTO_SESSION *cs, bool encrypt, size_t *blocksize); -bool crypto_cipher_update (CIPHER_CONTEXT *cipher_ctx, const void *data, size_t length, const void *dest, size_t *written); -bool crypto_cipher_finalize (CIPHER_CONTEXT *cipher_ctx, void *dest, size_t *written); -void crypto_cipher_free (CIPHER_CONTEXT *cipher_ctx); -X509_KEYPAIR * crypto_keypair_new (void); -X509_KEYPAIR * crypto_keypair_dup (X509_KEYPAIR *keypair); -int crypto_keypair_load_cert (X509_KEYPAIR *keypair, const char *file); -bool crypto_keypair_has_key (const char *file); -int crypto_keypair_load_key (X509_KEYPAIR *keypair, const char *file, CRYPTO_PEM_PASSWD_CB *pem_callback, const void *pem_userdata); -void crypto_keypair_free (X509_KEYPAIR *keypair); -int crypto_default_pem_callback (char *buf, int size, const void *userdata); -const char * crypto_digest_name (DIGEST *digest); -crypto_digest_t crypto_digest_stream_type (int stream); -const char * crypto_strerror (crypto_error_t error); - /* daemon.c */ void daemon_start (); /* edit.c */ uint64_t str_to_uint64(char *str); int64_t str_to_int64(char *str); -#define str_to_int32(str) ((int32_t)str_to_int64(str)) -char * edit_uint64_with_commas (uint64_t val, char *buf); +#define str_to_int32(str) ((int32_t)str_to_int64(str)) char * edit_uint64_with_suffix (uint64_t val, char *buf); +char * edit_uint64_with_commas (uint64_t val, char *buf); char * add_commas (char *val, char *buf); char * edit_uint64 (uint64_t val, char *buf); char * edit_int64 (int64_t val, char *buf); @@ -235,6 +196,7 @@ void init_stack_dump (void); /* scan.c */ void strip_leading_space (char *str); void strip_trailing_junk (char *str); +void strip_trailing_newline (char *str); void strip_trailing_slashes (char *dir); bool skip_spaces (char **msg); bool skip_nonspaces (char **msg); @@ -248,11 +210,14 @@ int bsscanf(const char *buf, const char *fmt, ...); /* tls.c */ +int init_tls (void); +int cleanup_tls (void); + TLS_CONTEXT *new_tls_context (const char *ca_certfile, const char *ca_certdir, const char *certfile, const char *keyfile, - CRYPTO_PEM_PASSWD_CB *pem_callback, + TLS_PEM_PASSWD_CB *pem_callback, const void *pem_userdata, const char *dhfile, bool verify_peer); diff --git a/bacula/src/lib/rwlock.c b/bacula/src/lib/rwlock.c index d66a5cc983..fc70892cfd 100644 --- a/bacula/src/lib/rwlock.c +++ b/bacula/src/lib/rwlock.c @@ -13,22 +13,17 @@ * */ /* - Copyright (C) 2000-2004 Kern Sibbald and John Walker + Copyright (C) 2001-2006 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ diff --git a/bacula/src/lib/rwlock.h b/bacula/src/lib/rwlock.h index 8abd1b8311..178410945c 100644 --- a/bacula/src/lib/rwlock.h +++ b/bacula/src/lib/rwlock.h @@ -11,22 +11,17 @@ * */ /* - Copyright (C) 2000-2003 Kern Sibbald and John Walker + Copyright (C) 2001-2006 Kern Sibbald This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of - the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. - - You should have received a copy of the GNU General Public - License along with this program; if not, write to the Free - Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, - MA 02111-1307, USA. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. */ diff --git a/bacula/src/lib/scan.c b/bacula/src/lib/scan.c index cfb5751300..53c4024210 100644 --- a/bacula/src/lib/scan.c +++ b/bacula/src/lib/scan.c @@ -49,6 +49,16 @@ void strip_trailing_junk(char *cmd) *p-- = 0; } +/* Strip any trailing newline characters from the string */ +void strip_trailing_newline(char *cmd) +{ + char *p; + p = cmd + strlen(cmd) - 1; + + while ((p >= cmd) && (*p == '\n' || *p == '\r')) + *p-- = 0; +} + /* Strip any trailing slashes from a directory path */ void strip_trailing_slashes(char *dir) { diff --git a/bacula/src/lib/tls.c b/bacula/src/lib/tls.c index 978e1aede9..b35069ec3f 100644 --- a/bacula/src/lib/tls.c +++ b/bacula/src/lib/tls.c @@ -36,7 +36,6 @@ */ - #include "bacula.h" #include @@ -49,10 +48,21 @@ extern time_t watchdog_time; /* No anonymous ciphers, no <128 bit ciphers, no export ciphers, no MD5 ciphers */ #define TLS_DEFAULT_CIPHERS "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH" +/* Array of mutexes for use with OpenSSL static locking */ +static pthread_mutex_t *mutexes; + +/* OpenSSL dynamic locking structure */ +struct CRYPTO_dynlock_value { + pthread_mutex_t mutex; +}; + +/* Are we initialized? */ +static int tls_initialized = false; + /* TLS Context Structure */ struct TLS_Context { SSL_CTX *openssl; - CRYPTO_PEM_PASSWD_CB *pem_callback; + TLS_PEM_PASSWD_CB *pem_callback; const void *pem_userdata; }; @@ -60,6 +70,20 @@ struct TLS_Connection { SSL *openssl; }; +/* post all per-thread openssl errors */ +static void openssl_post_errors(int code, const char *errstring) +{ + char buf[512]; + unsigned long sslerr; + + /* Pop errors off of the per-thread queue */ + while((sslerr = ERR_get_error()) != 0) { + /* Acquire the human readable string */ + ERR_error_string_n(sslerr, (char *) &buf, sizeof(buf)); + Emsg2(M_ERROR, 0, "%s: ERR=%s\n", errstring, buf); + } +} + /* * OpenSSL certificate verification callback. * OpenSSL has already performed internal certificate verification. @@ -87,8 +111,18 @@ static int openssl_verify_peer(int ok, X509_STORE_CTX *store) return ok; } +/* + * Default PEM encryption passphrase callback. + * Returns an empty password. + */ +static int tls_default_pem_callback(char *buf, int size, const void *userdata) +{ + bstrncpy(buf, "", size); + return (strlen(buf)); +} + /* Dispatch user PEM encryption callbacks */ -static int tls_pem_callback_dispatch (char *buf, int size, int rwflag, void *userdata) +static int openssl_pem_callback_dispatch (char *buf, int size, int rwflag, void *userdata) { TLS_CONTEXT *ctx = (TLS_CONTEXT *) userdata; return (ctx->pem_callback(buf, size, ctx->pem_userdata)); @@ -101,7 +135,7 @@ static int tls_pem_callback_dispatch (char *buf, int size, int rwflag, void *use */ TLS_CONTEXT *new_tls_context(const char *ca_certfile, const char *ca_certdir, const char *certfile, const char *keyfile, - CRYPTO_PEM_PASSWD_CB *pem_callback, + TLS_PEM_PASSWD_CB *pem_callback, const void *pem_userdata, const char *dhfile, bool verify_peer) { @@ -124,10 +158,10 @@ TLS_CONTEXT *new_tls_context(const char *ca_certfile, const char *ca_certdir, ctx->pem_callback = pem_callback; ctx->pem_userdata = pem_userdata; } else { - ctx->pem_callback = crypto_default_pem_callback; + ctx->pem_callback = tls_default_pem_callback; ctx->pem_userdata = NULL; } - SSL_CTX_set_default_passwd_cb(ctx->openssl, tls_pem_callback_dispatch); + SSL_CTX_set_default_passwd_cb(ctx->openssl, openssl_pem_callback_dispatch); SSL_CTX_set_default_passwd_cb_userdata(ctx->openssl, (void *) ctx); /* @@ -333,7 +367,7 @@ bool tls_postconnect_verify_host(TLS_CONNECTION *tls, const char *host) for (j = 0; j < sk_CONF_VALUE_num(val); j++) { nval = sk_CONF_VALUE_value(val, j); if (strcmp(nval->name, "DNS") == 0) { - if (strcasecmp(nval->value, host) == 0) { + if (strcasecmp(nval->name, host) == 0) { auth_success = true; goto success; } @@ -664,6 +698,234 @@ int tls_bsock_readn(BSOCK *bsock, char *ptr, int32_t nbytes) { return (openssl_bsock_readwrite(bsock, ptr, nbytes, false)); } +/* + * Return an OpenSSL thread ID + * Returns: thread ID + * + */ +static unsigned long get_openssl_thread_id (void) +{ + /* Comparison without use of pthread_equal() is mandated by the OpenSSL API */ + return ((unsigned long) pthread_self()); +} + +/* + * Allocate a dynamic OpenSSL mutex + */ +static struct CRYPTO_dynlock_value *openssl_create_dynamic_mutex (const char *file, int line) +{ + struct CRYPTO_dynlock_value *dynlock; + int stat; + + dynlock = (struct CRYPTO_dynlock_value *) malloc(sizeof(struct CRYPTO_dynlock_value)); + + if ((stat = pthread_mutex_init(&dynlock->mutex, NULL)) != 0) { + Emsg1(M_ABORT, 0, _("Unable to init mutex: ERR=%s\n"), strerror(stat)); + } + + return dynlock; +} + +static void openssl_update_dynamic_mutex (int mode, struct CRYPTO_dynlock_value *dynlock, const char *file, int line) +{ + if (mode & CRYPTO_LOCK) { + P(dynlock->mutex); + } else { + V(dynlock->mutex); + } +} + +static void openssl_destroy_dynamic_mutex (struct CRYPTO_dynlock_value *dynlock, const char *file, int line) +{ + int stat; + + if ((stat = pthread_mutex_destroy(&dynlock->mutex)) != 0) { + Emsg1(M_ABORT, 0, _("Unable to destroy mutex: ERR=%s\n"), strerror(stat)); + } + + free(dynlock); +} + +/* + * (Un)Lock a static OpenSSL mutex + */ +static void openssl_update_static_mutex (int mode, int i, const char *file, int line) +{ + if (mode & CRYPTO_LOCK) { + P(mutexes[i]); + } else { + V(mutexes[i]); + } +} + +/* + * Initialize OpenSSL thread support + * Returns: 0 on success + * errno on failure + */ +static int openssl_init_threads (void) +{ + int i, numlocks; + int stat; + + + /* Set thread ID callback */ + CRYPTO_set_id_callback(get_openssl_thread_id); + + /* Initialize static locking */ + numlocks = CRYPTO_num_locks(); + mutexes = (pthread_mutex_t *) malloc(numlocks * sizeof(pthread_mutex_t)); + for (i = 0; i < numlocks; i++) { + if ((stat = pthread_mutex_init(&mutexes[i], NULL)) != 0) { + Emsg1(M_ERROR, 0, _("Unable to init mutex: ERR=%s\n"), strerror(stat)); + return stat; + } + } + + /* Set static locking callback */ + CRYPTO_set_locking_callback(openssl_update_static_mutex); + + /* Initialize dyanmic locking */ + CRYPTO_set_dynlock_create_callback(openssl_create_dynamic_mutex); + CRYPTO_set_dynlock_lock_callback(openssl_update_dynamic_mutex); + CRYPTO_set_dynlock_destroy_callback(openssl_destroy_dynamic_mutex); + + return 0; +} + +/* + * Clean up OpenSSL threading support + */ +static void openssl_cleanup_threads (void) +{ + int i, numlocks; + int stat; + + /* Unset thread ID callback */ + CRYPTO_set_id_callback(NULL); + + /* Deallocate static lock mutexes */ + numlocks = CRYPTO_num_locks(); + for (i = 0; i < numlocks; i++) { + if ((stat = pthread_mutex_destroy(&mutexes[i])) != 0) { + /* We don't halt execution, reporting the error should be sufficient */ + Emsg1(M_ERROR, 0, _("Unable to destroy mutex: ERR=%s\n"), strerror(stat)); + } + } + + /* Unset static locking callback */ + CRYPTO_set_locking_callback(NULL); + + /* Free static lock array */ + free(mutexes); + + /* Unset dynamic locking callbacks */ + CRYPTO_set_dynlock_create_callback(NULL); + CRYPTO_set_dynlock_lock_callback(NULL); + CRYPTO_set_dynlock_destroy_callback(NULL); +} + + +/* + * Seed TLS PRNG + * Returns: 1 on success + * 0 on failure + */ +static int seed_tls_prng (void) +{ + const char *names[] = { "/dev/urandom", "/dev/random", NULL }; + int i; + + // ***FIXME*** + // Win32 Support + // Read saved entropy? + + for (i = 0; names[i]; i++) { + if (RAND_load_file(names[i], 1024) != -1) { + /* Success */ + return 1; + } + } + + /* Fail */ + return 0; +} + +/* + * Save TLS Entropy + * Returns: 1 on success + * 0 on failure + */ +static int save_tls_prng (void) +{ + // ***FIXME*** + // Implement PRNG state save + return 1; +} + +/* + * Perform global initialization of TLS + * This function is not thread safe. + * Returns: 0 on success + * errno on failure + */ +int init_tls (void) +{ + int stat; + + if ((stat = openssl_init_threads()) != 0) { + Emsg1(M_ABORT, 0, _("Unable to init OpenSSL threading: ERR=%s\n"), strerror(stat)); + } + + /* Load libssl and libcrypto human-readable error strings */ + SSL_load_error_strings(); + + /* Register OpenSSL ciphers */ + SSL_library_init(); + + if (!seed_tls_prng()) { + Emsg0(M_ERROR_TERM, 0, _("Failed to seed OpenSSL PRNG\n")); + } + + tls_initialized = true; + + return stat; +} + +/* + * Perform global cleanup of TLS + * All TLS connections must be closed before calling this function. + * This function is not thread safe. + * Returns: 0 on success + * errno on failure + */ +int cleanup_tls (void) +{ + /* + * Ensure that we've actually been initialized; Doing this here decreases the + * complexity of client's termination/cleanup code. + */ + if (!tls_initialized) { + return 0; + } + + if (!save_tls_prng()) { + Emsg0(M_ERROR, 0, _("Failed to save OpenSSL PRNG\n")); + } + + openssl_cleanup_threads(); + + /* Free libssl and libcrypto error strings */ + ERR_free_strings(); + + /* Free memory used by PRNG */ + RAND_cleanup(); + + tls_initialized = false; + + return 0; +} + #else /* HAVE_OPENSSL */ # error No TLS implementation available. #endif /* !HAVE_OPENSSL */ @@ -671,9 +933,11 @@ int tls_bsock_readn(BSOCK *bsock, char *ptr, int32_t nbytes) { #else /* Dummy routines */ +int init_tls(void) { return 0; } +int cleanup_tls (void) { return 0; } TLS_CONTEXT *new_tls_context(const char *ca_certfile, const char *ca_certdir, const char *certfile, const char *keyfile, - CRYPTO_PEM_PASSWD_CB *pem_callback, + TLS_PEM_PASSWD_CB *pem_callback, const void *pem_userdata, const char *dhfile, bool verify_peer) { diff --git a/bacula/src/lib/tls.h b/bacula/src/lib/tls.h index 28d6fd6111..13595dd17f 100644 --- a/bacula/src/lib/tls.h +++ b/bacula/src/lib/tls.h @@ -50,4 +50,7 @@ typedef struct TLS_Context TLS_CONTEXT; /* Opaque TLS Connection Structure */ typedef struct TLS_Connection TLS_CONNECTION; +/* PEM Decryption Passphrase Callback */ +typedef int (TLS_PEM_PASSWD_CB) (char *buf, int size, const void *userdata); + #endif /* __TLS_H_ */ diff --git a/bacula/src/lib/util.c b/bacula/src/lib/util.c index 90cf6044a0..95799f2498 100644 --- a/bacula/src/lib/util.c +++ b/bacula/src/lib/util.c @@ -510,7 +510,7 @@ void make_session_key(char *key, char *seed, int mode) * %d = Director's name * %e = Job Exit code * %i = JobId - * %j = Unique Job name + * %j = Unique Job id * %l = job level * %n = Unadorned Job name * %s = Since time diff --git a/bacula/src/stored/Makefile.in b/bacula/src/stored/Makefile.in index ba70f04ef6..2b9e2141ea 100644 --- a/bacula/src/stored/Makefile.in +++ b/bacula/src/stored/Makefile.in @@ -23,14 +23,14 @@ first_rule: all dummy: # bacula-sd -SDOBJS = stored.o ansi_label.o \ +SVROBJS = stored.o ansi_label.o \ autochanger.o acquire.o append.o \ askdir.o authenticate.o \ block.o butil.o dev.o \ device.o dircmd.o dvd.o ebcdic.c fd_cmds.o job.o \ - label.o mac.o match_bsr.o mount.o parse_bsr.o \ + label.o match_bsr.o mount.o parse_bsr.o \ pythonsd.o read.o read_record.o record.o \ - reserve.o scan.o \ + reserve.o \ spool.o status.o stored_conf.o wait.o # btape @@ -38,33 +38,35 @@ TAPEOBJS = btape.o block.o butil.o dev.o device.o label.o \ ansi_label.o dvd.o ebcdic.o \ autochanger.o acquire.o mount.o record.o read_record.o \ reserve.o \ - stored_conf.o match_bsr.o parse_bsr.o scan.o spool.o wait.o + stored_conf.o match_bsr.o parse_bsr.o spool.o wait.o # bls BLSOBJS = bls.o block.o butil.o device.o dev.o label.o match_bsr.o \ ansi_label.o dvd.o ebcdic.o \ autochanger.o acquire.o mount.o parse_bsr.o record.o \ - read_record.o reserve.o scan.o stored_conf.o spool.o wait.o + reserve.o \ + read_record.o stored_conf.o spool.o wait.o # bextract BEXTOBJS = bextract.o block.o device.o dev.o label.o record.o \ ansi_label.o dvd.o ebcdic.o \ autochanger.o acquire.o mount.o match_bsr.o parse_bsr.o butil.o \ - pythonsd.o read_record.o reserve.o \ - scan.o stored_conf.o spool.o wait.o + pythonsd.o reserve.o \ + read_record.o stored_conf.o spool.o wait.o # bscan SCNOBJS = bscan.o block.o device.o dev.o label.o \ ansi_label.o dvd.o ebcdic.o \ autochanger.o acquire.o mount.o record.o match_bsr.o parse_bsr.o \ - butil.o read_record.o scan.o reserve.o stored_conf.o spool.o wait.o + reserve.o \ + butil.o read_record.o stored_conf.o spool.o wait.o # bcopy COPYOBJS = bcopy.o block.o device.o dev.o label.o \ ansi_label.o dvd.o ebcdic.o \ autochanger.o acquire.o mount.o record.o match_bsr.o parse_bsr.o \ - butil.o read_record.o reserve.o \ - scan.o stored_conf.o spool.o wait.o + reserve.o \ + butil.o read_record.o stored_conf.o spool.o wait.o @@ -87,13 +89,13 @@ all: Makefile bacula-sd @STATIC_SD@ bls bextract bscan btape bcopy @echo "===== Make of stored is good ====" @echo " " -bacula-sd: $(SDOBJS) ../lib/libbac.a - $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -o $@ $(SDOBJS) $(FDLIBS) \ +bacula-sd: $(SVROBJS) ../lib/libbac.a + $(CXX) $(WLDFLAGS) $(LDFLAGS) -L../lib -o $@ $(SVROBJS) $(FDLIBS) \ -lbac -lm $(PYTHON_LIBS) $(DLIB) $(LIBS) $(WRAPLIBS) \ $(GETTEXT_LIBS) $(OPENSSL_LIBS) -static-bacula-sd: $(SDOBJS) ../lib/libbac.a - $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -o $@ $(SDOBJS) $(FDLIBS) \ +static-bacula-sd: $(SVROBJS) ../lib/libbac.a + $(CXX) $(WLDFLAGS) $(LDFLAGS) -static -L../lib -o $@ $(SVROBJS) $(FDLIBS) \ -lbac -lm $(PYTHON_LIBS) $(DLIB) $(LIBS) $(WRAPLIBS) \ $(GETTEXT_LIBS) $(OPENSSL_LIBS) strip $@ diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 4d32968cfc..156c73cf1e 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -23,9 +23,6 @@ #include "bacula.h" /* pull in global headers */ #include "stored.h" /* pull in Storage Deamon headers */ -/* Forward referenced functions */ -static void detach_dcr_from_dev(DCR *dcr); - /********************************************************************* * Acquire device for reading. @@ -36,17 +33,18 @@ static void detach_dcr_from_dev(DCR *dcr); * Returns: NULL if failed for any reason * dcr if successful */ -bool acquire_device_for_read(DCR *dcr) +DCR *acquire_device_for_read(DCR *dcr) { DEVICE *dev = dcr->dev; JCR *jcr = dcr->jcr; - bool ok = false; + bool vol_ok = false; bool tape_previously_mounted; bool tape_initially_mounted; VOL_LIST *vol; bool try_autochanger = true; int i; int vol_label_status; + int retry = 0; dev->block(BST_DOING_ACQUIRE); @@ -70,71 +68,6 @@ bool acquire_device_for_read(DCR *dcr) goto get_out; /* should not happen */ } bstrncpy(dcr->VolumeName, vol->VolumeName, sizeof(dcr->VolumeName)); - bstrncpy(dcr->media_type, vol->MediaType, sizeof(dcr->media_type)); - dcr->VolCatInfo.Slot = vol->Slot; - - /* - * If the MediaType requested for this volume is not the - * same as the current drive, we attempt to find the same - * device that was used to write the orginal volume. If - * found, we switch to using that device. - */ - Dmsg2(100, "MediaType dcr=%s dev=%s\n", dcr->media_type, dev->device->media_type); - if (dcr->media_type[0] && strcmp(dcr->media_type, dev->device->media_type) != 0) { - RCTX rctx; - DIRSTORE *store; - int stat; - memset(&rctx, 0, sizeof(RCTX)); - rctx.jcr = jcr; - jcr->reserve_msgs = New(alist(10, not_owned_by_alist)); - rctx.any_drive = true; - rctx.device_name = vol->device; - store = new DIRSTORE; - memset(store, 0, sizeof(DIRSTORE)); - store->name[0] = 0; /* No dir name */ - bstrncpy(store->media_type, vol->MediaType, sizeof(store->media_type)); - bstrncpy(store->pool_name, dcr->pool_name, sizeof(store->pool_name)); - bstrncpy(store->pool_type, dcr->pool_type, sizeof(store->pool_type)); - store->append = false; - rctx.store = store; - - /* - * Note, if search_for_device() succeeds, we get a new_dcr, - * which we do not use except for the dev info. - */ - stat = search_res_for_device(rctx); - release_msgs(jcr); /* release queued messages */ - if (stat == 1) { - DCR *new_dcr = jcr->read_dcr; - dev->unblock(); - detach_dcr_from_dev(dcr); /* release old device */ - /* Copy important info from the new dcr */ - dev = dcr->dev = new_dcr->dev; - jcr->read_dcr = dcr; - dcr->device = new_dcr->device; - dcr->max_job_spool_size = dcr->device->max_job_spool_size; - if (dev->fd != 0 && jcr && jcr->JobType != JT_SYSTEM) { - dev->attached_dcrs->append(dcr); /* attach dcr to device */ - } - new_dcr->VolumeName[0] = 0; - free_dcr(new_dcr); - dev->block(BST_DOING_ACQUIRE); - Jmsg(jcr, M_INFO, 0, _("Media Type change. New device %s chosen.\n"), - dev->print_name()); - bstrncpy(dcr->VolumeName, vol->VolumeName, sizeof(dcr->VolumeName)); - bstrncpy(dcr->media_type, vol->MediaType, sizeof(dcr->media_type)); - dcr->VolCatInfo.Slot = vol->Slot; - bstrncpy(dcr->pool_name, store->pool_name, sizeof(dcr->pool_name)); - bstrncpy(dcr->pool_type, store->pool_type, sizeof(dcr->pool_type)); - } else if (stat == 0) { /* device busy */ - Dmsg1(000, "Device %s is busy.\n", vol->device); - } else { - /* error */ - Jmsg1(jcr, M_FATAL, 0, _("No suitable device found to read Volume \"%s\"\n"), - vol->VolumeName); - goto get_out; - } - } init_device_wait_timers(dcr); @@ -149,7 +82,11 @@ bool acquire_device_for_read(DCR *dcr) Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg); } - for (i=0; i<5; i++) { + for ( ;; ) { + /* If not polling limit retries */ + if (!dev->poll && retry++ > 10) { + break; + } dev->clear_labeled(); /* force reread of label */ if (job_canceled(jcr)) { Mmsg1(dev->errmsg, _("Job %d canceled.\n"), jcr->JobId); @@ -164,12 +101,12 @@ bool acquire_device_for_read(DCR *dcr) if (dev->open(dcr, OPEN_READ_ONLY) < 0) { if (dev->dev_errno == EIO) { /* no tape loaded */ Jmsg3(jcr, M_WARNING, 0, _("Read open device %s Volume \"%s\" failed (EIO): ERR=%s\n"), - dev->print_name(), dcr->VolumeName, dev->bstrerror()); + dev->print_name(), dcr->VolumeName, strerror_dev(dev)); goto default_path; } Jmsg3(jcr, M_FATAL, 0, _("Read open device %s Volume \"%s\" failed: ERR=%s\n"), - dev->print_name(), dcr->VolumeName, dev->bstrerror()); + dev->print_name(), dcr->VolumeName, strerror_dev(dev)); goto get_out; } Dmsg1(100, "opened dev %s OK\n", dev->print_name()); @@ -180,7 +117,7 @@ bool acquire_device_for_read(DCR *dcr) vol_label_status = read_dev_volume_label(dcr); switch (vol_label_status) { case VOL_OK: - ok = true; + vol_ok = true; memcpy(&dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dev->VolCatInfo)); break; /* got it */ case VOL_IO_ERROR: @@ -198,17 +135,22 @@ bool acquire_device_for_read(DCR *dcr) tape_initially_mounted = false; goto default_path; } + /* If polling and got a previous bad name, ignore it */ + if (dev->poll && strcmp(dev->BadVolName, dev->VolHdr.VolumeName) == 0) { + goto default_path; + } else { + bstrncpy(dev->BadVolName, dev->VolHdr.VolumeName, sizeof(dev->BadVolName)); + } /* Fall through */ default: Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg); default_path: tape_previously_mounted = true; - /* - * If the device requires mount, close it, so the device can be ejected. - */ + /* If the device requires mount, close it, so the device can be ejected. + * FIXME: This should perhaps be done for all devices. */ if (dev->requires_mount()) { - dev->close(); + force_close_device(dev); } /* Call autochanger only once unless ask_sysop called */ @@ -233,7 +175,7 @@ default_path: } /* end switch */ break; } /* end for loop */ - if (!ok) { + if (!vol_ok) { Jmsg1(jcr, M_FATAL, 0, _("Too many errors trying to mount device %s.\n"), dev->print_name()); goto get_out; @@ -255,7 +197,8 @@ get_out: } V(dev->mutex); dev->unblock(); - return ok; + Dmsg1(000, "jcr->dcr=%p\n", jcr->dcr); + return dcr; } @@ -373,7 +316,7 @@ DCR *acquire_device_for_append(DCR *dcr) P(dev->mutex); if (dcr->reserved_device) { dev->reserved_device--; - Dmsg2(100, "Dec reserve=%d dev=%s\n", dev->reserved_device, dev->print_name()); + Dmsg1(100, "Dec reserve=%d\n", dev->reserved_device); dcr->reserved_device = false; } V(dev->mutex); @@ -387,15 +330,15 @@ get_out: P(dev->mutex); if (dcr->reserved_device) { dev->reserved_device--; - Dmsg2(100, "Dec reserve=%d dev=%s\n", dev->reserved_device, dev->print_name()); + Dmsg1(100, "Dec reserve=%d\n", dev->reserved_device); dcr->reserved_device = false; } V(dev->mutex); + free_dcr(dcr); dev->unblock(); return NULL; } - /* * This job is done, so release the device. From a Unix standpoint, * the device remains open. @@ -408,12 +351,12 @@ bool release_device(DCR *dcr) bool ok = true; lock_device(dev); - Dmsg2(100, "release_device device %s is %s\n", dev->print_name(), dev->is_tape()?"tape":"disk"); + Dmsg1(100, "release_device device is %s\n", dev->is_tape()?"tape":"disk"); /* if device is reserved, job never started, so release the reserve here */ if (dcr->reserved_device) { dev->reserved_device--; - Dmsg2(100, "Dec reserve=%d dev=%s\n", dev->reserved_device, dev->print_name()); + Dmsg1(100, "Dec reserve=%d\n", dev->reserved_device); dcr->reserved_device = false; } @@ -461,7 +404,8 @@ bool release_device(DCR *dcr) /* If no writers, close if file or !CAP_ALWAYS_OPEN */ if (dev->num_writers == 0 && (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN))) { - dev->close(); + offline_or_rewind_dev(dev); + close_device(dev); } /* Fire off Alert command and include any output */ @@ -552,18 +496,22 @@ static void remove_dcr_from_dcrs(DCR *dcr) } #endif -static void detach_dcr_from_dev(DCR *dcr) +/* + * Free up all aspects of the given dcr -- i.e. dechain it, + * release allocated memory, zap pointers, ... + */ +void free_dcr(DCR *dcr) { + JCR *jcr = dcr->jcr; DEVICE *dev = dcr->dev; if (dcr->reserved_device) { - dcr->reserved_device = false; lock_device(dev); dev->reserved_device--; Dmsg2(100, "Dec reserve=%d dev=%s\n", dev->reserved_device, dev->print_name()); dcr->reserved_device = false; /* If we set read mode in reserving, remove it */ - if (dev->can_read()) { + if (dev->can_read()) { dev->clear_read(); } if (dev->num_writers < 0) { @@ -574,24 +522,10 @@ static void detach_dcr_from_dev(DCR *dcr) } /* Detach this dcr only if the dev is initialized */ - if (dcr->dev->fd != 0 && dcr->jcr && dcr->jcr->JobType != JT_SYSTEM) { - dcr->dev->attached_dcrs->remove(dcr); /* detach dcr from device */ + if (dev->fd != 0 && jcr && jcr->JobType != JT_SYSTEM) { + dev->attached_dcrs->remove(dcr); /* detach dcr from device */ // remove_dcr_from_dcrs(dcr); /* remove dcr from jcr list */ } - free_unused_volume(dcr); /* free unused vols attached to this dcr */ - pthread_cond_broadcast(&dcr->dev->wait_next_vol); - pthread_cond_broadcast(&wait_device_release); -} - -/* - * Free up all aspects of the given dcr -- i.e. dechain it, - * release allocated memory, zap pointers, ... - */ -void free_dcr(DCR *dcr) -{ - - detach_dcr_from_dev(dcr); - if (dcr->block) { free_block(dcr->block); } @@ -601,5 +535,8 @@ void free_dcr(DCR *dcr) if (dcr->jcr) { dcr->jcr->dcr = NULL; } + free_unused_volume(dcr); /* free unused vols attached to this dcr */ free(dcr); + pthread_cond_broadcast(&dev->wait_next_vol); + pthread_cond_broadcast(&wait_device_release); } diff --git a/bacula/src/stored/append.c b/bacula/src/stored/append.c index eeae53420b..4c6c12d53b 100644 --- a/bacula/src/stored/append.c +++ b/bacula/src/stored/append.c @@ -5,7 +5,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -69,7 +69,6 @@ bool do_append_data(JCR *jcr) if (!acquire_device_for_append(dcr)) { set_jcr_job_status(jcr, JS_ErrorTerminated); - jcr->dcr = NULL; return false; } @@ -93,7 +92,7 @@ bool do_append_data(JCR *jcr) */ if (!write_session_label(dcr, SOS_LABEL)) { Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"), - dev->bstrerror()); + strerror_dev(dev)); set_jcr_job_status(jcr, JS_ErrorTerminated); ok = false; } @@ -203,9 +202,9 @@ bool do_append_data(JCR *jcr) rec.remainder); if (!write_block_to_device(dcr)) { Dmsg2(90, "Got write_block_to_dev error on device %s. %s\n", - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); ok = false; break; } @@ -220,8 +219,8 @@ bool do_append_data(JCR *jcr) stream_to_ascii(buf2, rec.Stream, rec.FileIndex), rec.data_len); /* Send attributes and digest to Director for Catalog */ - if (stream == STREAM_UNIX_ATTRIBUTES || stream == STREAM_UNIX_ATTRIBUTES_EX || - crypto_digest_stream_type(stream) != CRYPTO_DIGEST_NONE) { + if (stream == STREAM_UNIX_ATTRIBUTES || stream == STREAM_MD5_SIGNATURE || + stream == STREAM_UNIX_ATTRIBUTES_EX || stream == STREAM_SHA1_SIGNATURE) { if (!jcr->no_attributes) { if (are_attributes_spooled(jcr)) { jcr->dir_bsock->spool = true; @@ -252,7 +251,10 @@ bool do_append_data(JCR *jcr) /* Create Job status for end of session label */ set_jcr_job_status(jcr, ok?JS_Terminated:JS_ErrorTerminated); - Dmsg1(200, "Write EOS label JobStatus=%c\n", jcr->JobStatus); + Dmsg1(200, "Write session label JobStatus=%d\n", jcr->JobStatus); + if ((!ok || job_canceled(jcr)) && dev->VolCatInfo.VolCatName[0] == 0) { + Pmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n")); + } /* * If !OK, check if we can still write. This may not be the case @@ -261,7 +263,7 @@ bool do_append_data(JCR *jcr) if (ok || dev->can_write()) { if (!write_session_label(dcr, EOS_LABEL)) { Jmsg1(jcr, M_FATAL, 0, _("Error writting end session label. ERR=%s\n"), - dev->bstrerror()); + strerror_dev(dev)); set_jcr_job_status(jcr, JS_ErrorTerminated); ok = false; } @@ -272,7 +274,7 @@ bool do_append_data(JCR *jcr) /* Flush out final partial block of this session */ if (!write_block_to_device(dcr)) { Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); Dmsg0(100, _("Set ok=FALSE after write_block_to_device.\n")); ok = false; } diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 16557abd98..8d31f72fc5 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -162,7 +162,7 @@ static bool do_get_volume_info(DCR *dcr) return false; } memset(&vol, 0, sizeof(vol)); - Dmsg1(100, "msg); + Dmsg1(110, "msg); n = sscanf(dir->msg, OK_media, vol.VolCatName, &vol.VolCatJobs, &vol.VolCatFiles, &vol.VolCatBlocks, &vol.VolCatBytes, @@ -174,7 +174,7 @@ static bool do_get_volume_info(DCR *dcr) &vol.EndFile, &vol.EndBlock, &vol.VolCatParts, &vol.LabelType); if (n != 21) { - Dmsg2(100, "Bad response from Dir fields=%d: %s", n, dir->msg); + Dmsg2(110, "Bad response from Dir fields=%d: %s", n, dir->msg); Mmsg(jcr->errmsg, _("Error getting Volume info: %s"), dir->msg); return false; } @@ -228,10 +228,6 @@ bool dir_find_next_appendable_volume(DCR *dcr) JCR *jcr = dcr->jcr; BSOCK *dir = jcr->dir_bsock; bool found = false; - /* This mutex should keep different devices from getting the - * same Volume. - */ - static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; Dmsg0(200, "dir_find_next_appendable_volume\n"); /* @@ -239,7 +235,7 @@ bool dir_find_next_appendable_volume(DCR *dcr) * the most available could already be mounted on another * drive, so we continue looking for a not in use Volume. */ - P(mutex); + lock_reservations(); for (int vol_index=1; vol_index < 20; vol_index++) { bash_spaces(dcr->media_type); bash_spaces(dcr->pool_name); @@ -257,7 +253,8 @@ bool dir_find_next_appendable_volume(DCR *dcr) continue; } } else { - Dmsg0(200, "No volume info, return false\n"); + Dmsg2(100, "No vol. index %d return false. dev=%s\n", vol_index, + dcr->dev->print_name()); found = false; break; } @@ -265,11 +262,11 @@ bool dir_find_next_appendable_volume(DCR *dcr) if (found) { Dmsg0(400, "dir_find_next_appendable_volume return true\n"); new_volume(dcr, dcr->VolumeName); /* reserve volume */ - V(mutex); + unlock_reservations(); return true; } dcr->VolumeName[0] = 0; - V(mutex); + unlock_reservations(); return false; } @@ -520,7 +517,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr) } if (dev->is_dvd()) { - unmount_dvd(dev, 0); + unmount_dev(dev, 0); } /* diff --git a/bacula/src/stored/autochanger.c b/bacula/src/stored/autochanger.c index e135852474..8c822b9ebb 100644 --- a/bacula/src/stored/autochanger.c +++ b/bacula/src/stored/autochanger.c @@ -105,7 +105,6 @@ int autoload_device(DCR *dcr, int writing, BSOCK *dir) POOLMEM *changer; if (!dev->is_autochanger()) { - Dmsg0(200, "======== NOT AUTOCHANGER ======\n"); return 0; } slot = dcr->VolCatInfo.InChanger ? dcr->VolCatInfo.Slot : 0; @@ -155,8 +154,8 @@ int autoload_device(DCR *dcr, int writing, BSOCK *dir) dcr->VolCatInfo.Slot = slot; /* slot to be loaded */ changer = edit_device_codes(dcr, changer, dcr->device->changer_command, "load"); - dev->close(); - Dmsg1(200, "Run program=%s\n", changer); + offline_or_rewind_dev(dev); + force_close_device(dev); status = run_program(changer, timeout, NULL); if (status == 0) { Jmsg(jcr, M_INFO, 0, _("3305 Autochanger \"load slot %d, drive %d\", status is OK.\n"), @@ -220,9 +219,8 @@ int get_autochanger_loaded_slot(DCR *dcr) drive); changer = edit_device_codes(dcr, changer, dcr->device->changer_command, "loaded"); *results = 0; - Dmsg1(200, "Run program=%s\n", changer); status = run_program(changer, timeout, results); - Dmsg3(200, "run_prog: %s stat=%d result=%s\n", changer, status, results); + Dmsg3(50, "run_prog: %s stat=%d result=%s\n", changer, status, results); if (status == 0) { loaded = str_to_int32(results); if (loaded > 0) { @@ -302,8 +300,8 @@ bool unload_autochanger(DCR *dcr, int loaded) dcr->VolCatInfo.Slot = loaded; changer = edit_device_codes(dcr, changer, dcr->device->changer_command, "unload"); - dev->close(); - Dmsg1(200, "Run program=%s\n", changer); + offline_or_rewind_dev(dev); + force_close_device(dev); int stat = run_program(changer, timeout, NULL); dcr->VolCatInfo.Slot = slot; if (stat != 0) { @@ -337,6 +335,7 @@ static bool unload_other_drive(DCR *dcr, int slot) bool found = false; bool first = true; + if (!changer) { return false; } @@ -367,9 +366,9 @@ static bool unload_other_drive(DCR *dcr, int slot) } P(dev->mutex); if (dev->is_busy()) { - Jmsg(jcr, M_WARNING, 0, _("Volume \"%s\" is in use by device %s\n"), + Jmsg(jcr, M_WARNING, 0, _("Volume %s is in use by device %s\n"), dcr->VolumeName, dev->print_name()); - Dmsg2(200, "Volume \"%s\" is in use by device %s\n", + Dmsg2(200, "Volume %s is in use by device %s\n", dcr->VolumeName, dev->print_name()); V(dev->mutex); return false; @@ -384,16 +383,15 @@ static bool unload_other_drive(DCR *dcr, int slot) Dmsg2(200, "Issuing autochanger \"unload slot %d, drive %d\" command.\n", slot, dev->drive_index); + save_slot = dcr->VolCatInfo.Slot; save_dev = dcr->dev; dcr->dev = dev; - save_slot = dcr->VolCatInfo.Slot; dcr->VolCatInfo.Slot = slot; changer_cmd = edit_device_codes(dcr, changer_cmd, dcr->device->changer_command, "unload"); - dev->close(); - Dmsg2(200, "close dev=%s reserve=%d\n", dev->print_name(), - dev->reserved_device); Dmsg1(200, "Run program=%s\n", changer_cmd); + offline_or_rewind_dev(dev); + force_close_device(dev); int stat = run_program(changer_cmd, timeout, NULL); dcr->VolCatInfo.Slot = save_slot; dcr->dev = save_dev; diff --git a/bacula/src/stored/bcopy.c b/bacula/src/stored/bcopy.c index b072bd9a93..08e9ba6614 100644 --- a/bacula/src/stored/bcopy.c +++ b/bacula/src/stored/bcopy.c @@ -190,8 +190,8 @@ int main (int argc, char *argv[]) free_jcr(in_jcr); free_jcr(out_jcr); - in_dev->term(); - out_dev->term(); + term_dev(in_dev); + term_dev(out_dev); return 0; } @@ -231,16 +231,16 @@ static bool record_cb(DCR *in_dcr, DEV_RECORD *rec) rec->remainder); if (!write_block_to_device(out_jcr->dcr)) { Dmsg2(90, "Got write_block_to_dev error on device %s: ERR=%s\n", - out_dev->print_name(), out_dev->bstrerror()); + out_dev->print_name(), strerror_dev(out_dev)); Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"), - out_dev->bstrerror()); + strerror_dev(out_dev)); } } if (!write_block_to_device(out_jcr->dcr)) { Dmsg2(90, "Got write_block_to_dev error on device %s: ERR=%s\n", - out_dev->print_name(), out_dev->bstrerror()); + out_dev->print_name(), strerror_dev(out_dev)); Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"), - out_dev->bstrerror()); + strerror_dev(out_dev)); } break; case EOM_LABEL: @@ -261,9 +261,9 @@ static bool record_cb(DCR *in_dcr, DEV_RECORD *rec) rec->remainder); if (!write_block_to_device(out_jcr->dcr)) { Dmsg2(90, "Got write_block_to_dev error on device %s: ERR=%s\n", - out_dev->print_name(), out_dev->bstrerror()); + out_dev->print_name(), strerror_dev(out_dev)); Jmsg(out_jcr, M_FATAL, 0, _("Cannot fixup device error. %s\n"), - out_dev->bstrerror()); + strerror_dev(out_dev)); break; } } diff --git a/bacula/src/stored/bextract.c b/bacula/src/stored/bextract.c index 4d1cf2051d..ec1a670831 100644 --- a/bacula/src/stored/bextract.c +++ b/bacula/src/stored/bextract.c @@ -8,7 +8,7 @@ * */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -246,7 +246,7 @@ static void do_extract(char *devname) release_device(dcr); free_attr(attr); free_jcr(jcr); - dev->term(); + term_dev(dev); printf(_("%u files restored.\n"), num_files); return; @@ -432,8 +432,7 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec) break; case STREAM_SIGNED_DIGEST: - case STREAM_ENCRYPTED_SESSION_DATA: - // TODO landonf: Investigate crypto support in the storage daemon + // TODO landonf: Investigate signed digest support in the storage daemon break; case STREAM_PROGRAM_NAMES: diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index d1d7b2669d..1a38ee7c81 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -9,7 +9,7 @@ * */ /* - Copyright (C) 2001-2006 Kern Sibbald + Copyright (C) 2001-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -480,7 +480,7 @@ bool write_block_to_dev(DCR *dcr) if (weof_dev(dev, 1) != 0) { /* write eof */ Dmsg0(190, "WEOF error in max file size.\n"); Jmsg(jcr, M_FATAL, 0, _("Unable to write EOF. ERR=%s\n"), - dev->bstrerror()); + strerror_dev(dev)); terminate_writing_volume(dcr); dev->dev_errno = ENOSPC; return false; @@ -613,20 +613,20 @@ static void reread_last_block(DCR *dcr) */ if (dev->is_tape() && dev_cap(dev, CAP_BSR)) { /* Now back up over what we wrote and read the last block */ - if (!dev->bsf(1)) { + if (!bsf_dev(dev, 1)) { berrno be; ok = false; Jmsg(jcr, M_ERROR, 0, _("Backspace file at EOT failed. ERR=%s\n"), be.strerror(dev->dev_errno)); } - if (ok && dev->has_cap(CAP_TWOEOF) && !dev->bsf(1)) { + if (ok && dev_cap(dev, CAP_TWOEOF) && !bsf_dev(dev, 1)) { berrno be; ok = false; Jmsg(jcr, M_ERROR, 0, _("Backspace file at EOT failed. ERR=%s\n"), be.strerror(dev->dev_errno)); } /* Backspace over record */ - if (ok && !dev->bsr(1)) { + if (ok && !bsr_dev(dev, 1)) { berrno be; ok = false; Jmsg(jcr, M_ERROR, 0, _("Backspace record at EOT failed. ERR=%s\n"), @@ -637,7 +637,7 @@ static void reread_last_block(DCR *dcr) * rewind(), but if we do that, higher levels in cleaning up, will * most likely write the EOS record over the beginning of the * tape. The rewind *is* done later in mount.c when another - * tape is requested. Note, the clrerror_dev() call in bsr() + * tape is requested. Note, the clrerror_dev() call in bsr_dev() * calls ioctl(MTCERRSTAT), which *should* fix the problem. */ } @@ -649,12 +649,17 @@ static void reread_last_block(DCR *dcr) Jmsg(jcr, M_ERROR, 0, _("Re-read last block at EOT failed. ERR=%s"), dev->errmsg); } else { - if (lblock->BlockNumber+1 == block->BlockNumber) { - Jmsg(jcr, M_INFO, 0, _("Re-read of last block succeeded.\n")); - } else { + /* + * If we wrote block and the block numbers don't agree + * we have a possible problem. + */ + if (lblock->VolSessionId == block->VolSessionId && + lblock->BlockNumber+1 != block->BlockNumber) { Jmsg(jcr, M_ERROR, 0, _( -"Re-read of last block failed. Last block=%u Current block=%u.\n"), +"Re-read of last block OK, but block numbers differ. Last block=%u Current block=%u.\n"), lblock->BlockNumber, block->BlockNumber); + } else { + Jmsg(jcr, M_INFO, 0, _("Re-read of last block succeeded.\n")); } } free_block(lblock); @@ -801,7 +806,7 @@ static bool do_dvd_size_checks(DCR *dcr) if (dvd_open_next_part(dcr) < 0) { Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device next part %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); dev->dev_errno = EIO; return false; } @@ -911,7 +916,7 @@ reread: (dev->part < dev->num_parts)) { if (dvd_open_next_part(dcr) < 0) { Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device next part %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); dev->dev_errno = EIO; return false; } @@ -994,8 +999,8 @@ reread: /* Attempt to reposition to re-read the block */ if (dev->is_tape()) { Dmsg0(200, "BSR for reread; block too big for buffer.\n"); - if (!dev->bsr(1)) { - Jmsg(jcr, M_ERROR, 0, "%s", dev->bstrerror()); + if (!bsr_dev(dev, 1)) { + Jmsg(jcr, M_ERROR, 0, "%s", strerror_dev(dev)); block->read_len = 0; return false; } diff --git a/bacula/src/stored/bls.c b/bacula/src/stored/bls.c index d0e317340a..8dbea4c8c2 100644 --- a/bacula/src/stored/bls.c +++ b/bacula/src/stored/bls.c @@ -45,7 +45,6 @@ static bool dump_label = false; static bool list_blocks = false; static bool list_jobs = false; static DEV_RECORD *rec; -static DEV_BLOCK *block; static JCR *jcr; static SESSION_LABEL sessrec; static uint32_t num_files = 0; @@ -216,7 +215,6 @@ int main (int argc, char *argv[]) } dcr = jcr->dcr; rec = new_record(); - block = new_block(dev); attr = new_attr(); /* * Assume that we have already read the volume label. @@ -251,9 +249,8 @@ static void do_close(JCR *jcr) release_device(jcr->dcr); free_attr(attr); free_record(rec); - free_block(block); free_jcr(jcr); - dev->term(); + term_dev(dev); } @@ -261,6 +258,7 @@ static void do_close(JCR *jcr) static void do_blocks(char *infname) { char buf1[100], buf2[100]; + DEV_BLOCK *block = dcr->block; for ( ;; ) { if (!read_block_from_device(dcr, NO_BLOCK_NUMBER_CHECK)) { Dmsg1(100, "!read_block(): ERR=%s\n", dev->strerror()); @@ -279,7 +277,7 @@ static void do_blocks(char *infname) free_record(record); Jmsg(jcr, M_INFO, 0, _("Mounted Volume \"%s\".\n"), dcr->VolumeName); } else if (dev->at_eof()) { - Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"), + Jmsg(jcr, M_INFO, 0, _("End of file %u on device %s, Volume \"%s\"\n"), dev->file, dev->print_name(), dcr->VolumeName); Dmsg0(20, "read_record got eof. try again\n"); continue; @@ -409,7 +407,6 @@ static void get_session_record(DEVICE *dev, DEV_RECORD *rec, SESSION_LABEL *sess case EOS_LABEL: rtype = _("End Job Session"); break; - case 0: case EOM_LABEL: rtype = _("End of Medium"); break; diff --git a/bacula/src/stored/bscan.c b/bacula/src/stored/bscan.c index d88a10991a..68ff836e26 100644 --- a/bacula/src/stored/bscan.c +++ b/bacula/src/stored/bscan.c @@ -10,7 +10,7 @@ * Version $Id$ */ /* - Copyright (C) 2001-2006 Kern Sibbald + Copyright (C) 2001-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -48,7 +48,7 @@ static int create_client_record(B_DB *db, CLIENT_DBR *cr); static int create_fileset_record(B_DB *db, FILESET_DBR *fsr); static int create_jobmedia_record(B_DB *db, JCR *jcr); static JCR *create_jcr(JOB_DBR *jr, DEV_RECORD *rec, uint32_t JobId); -static int update_digest_record(B_DB *db, char *digest, DEV_RECORD *rec, int type); +static int update_SIG_record(B_DB *db, char *SIGbuf, DEV_RECORD *rec, int type); /* Global variables */ @@ -292,7 +292,7 @@ int main (int argc, char *argv[]) } free_jcr(bjcr); - dev->term(); + term_dev(dev); return 0; } @@ -373,7 +373,6 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec) DEVICE *dev = dcr->dev; JCR *bjcr = dcr->jcr; DEV_BLOCK *block = dcr->block; - char digest[BASE64_SIZE(CRYPTO_DIGEST_MAX_SIZE)]; if (rec->data_len > 0) { mr.VolBytes += rec->data_len + WRITE_RECHDR_LENGTH; /* Accumulate Volume bytes */ @@ -702,51 +701,24 @@ static bool record_cb(DCR *dcr, DEV_RECORD *rec) free_jcr(mjcr); /* done using JCR */ break; - case STREAM_MD5_DIGEST: - bin_to_base64(digest, (char *)rec->data, CRYPTO_DIGEST_MD5_SIZE); + case STREAM_MD5_SIGNATURE: + char MD5buf[50]; + bin_to_base64(MD5buf, (char *)rec->data, 16); /* encode 16 bytes */ if (verbose > 1) { - Pmsg1(000, _("Got MD5 record: %s\n"), digest); + Pmsg1(000, _("Got MD5 record: %s\n"), MD5buf); } - update_digest_record(db, digest, rec, CRYPTO_DIGEST_MD5); + update_SIG_record(db, MD5buf, rec, MD5_SIG); break; - case STREAM_SHA1_DIGEST: - bin_to_base64(digest, (char *)rec->data, CRYPTO_DIGEST_SHA1_SIZE); + case STREAM_SHA1_SIGNATURE: + char SIGbuf[50]; + bin_to_base64(SIGbuf, (char *)rec->data, 20); /* encode 20 bytes */ if (verbose > 1) { - Pmsg1(000, _("Got SHA1 record: %s\n"), digest); + Pmsg1(000, _("Got SHA1 record: %s\n"), SIGbuf); } - update_digest_record(db, digest, rec, CRYPTO_DIGEST_SHA1); + update_SIG_record(db, SIGbuf, rec, SHA1_SIG); break; - case STREAM_SHA256_DIGEST: - bin_to_base64(digest, (char *)rec->data, CRYPTO_DIGEST_SHA256_SIZE); - if (verbose > 1) { - Pmsg1(000, _("Got SHA256 record: %s\n"), digest); - } - update_digest_record(db, digest, rec, CRYPTO_DIGEST_SHA256); - break; - - case STREAM_SHA512_DIGEST: - bin_to_base64(digest, (char *)rec->data, CRYPTO_DIGEST_SHA512_SIZE); - if (verbose > 1) { - Pmsg1(000, _("Got SHA512 record: %s\n"), digest); - } - update_digest_record(db, digest, rec, CRYPTO_DIGEST_SHA512); - break; - - case STREAM_ENCRYPTED_SESSION_DATA: - // TODO landonf: Investigate crypto support in bscan - if (verbose > 1) { - Pmsg0(000, _("Got signed digest record\n")); - } - break; - - case STREAM_SIGNED_DIGEST: - // TODO landonf: Investigate crypto support in bscan - if (verbose > 1) { - Pmsg0(000, _("Got signed digest record\n")); - } - break; case STREAM_PROGRAM_NAMES: if (verbose) { @@ -1178,7 +1150,7 @@ static int create_jobmedia_record(B_DB *db, JCR *mjcr) /* * Simulate the database call that updates the MD5/SHA1 record */ -static int update_digest_record(B_DB *db, char *digest, DEV_RECORD *rec, int type) +static int update_SIG_record(B_DB *db, char *SIGbuf, DEV_RECORD *rec, int type) { JCR *mjcr; @@ -1198,7 +1170,7 @@ static int update_digest_record(B_DB *db, char *digest, DEV_RECORD *rec, int typ return 1; } - if (!db_add_digest_to_file_record(bjcr, db, mjcr->FileId, digest, type)) { + if (!db_add_SIG_to_file_record(bjcr, db, mjcr->FileId, SIGbuf, type)) { Pmsg1(0, _("Could not add MD5/SHA1 to File record. ERR=%s\n"), db_strerror(db)); free_jcr(mjcr); return 0; @@ -1252,7 +1224,10 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr) DEVICE *dev = dcr->dev; Dmsg0(20, "Enter dir_ask_sysop_to_mount_volume\n"); /* Close device so user can use autochanger if desired */ - dev->close(); + if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) { + offline_dev(dev); + } + force_close_device(dev); fprintf(stderr, _("Mount Volume \"%s\" on device %s and press return when ready: "), dcr->VolumeName, dev->print_name()); getchar(); diff --git a/bacula/src/stored/btape.c b/bacula/src/stored/btape.c index c8979749be..f84cee4eda 100644 --- a/bacula/src/stored/btape.c +++ b/bacula/src/stored/btape.c @@ -14,7 +14,7 @@ * */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -303,7 +303,7 @@ static void terminate_btape(int stat) jcr = NULL; if (dev) { - dev->term(); + term_dev(dev); } if (debug_level > 10) @@ -363,7 +363,7 @@ static void labelcmd() if (!dev->is_open()) { if (!first_open_device(dcr)) { - Pmsg1(0, _("Device open failed. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Device open failed. ERR=%s\n"), strerror_dev(dev)); } } dev->rewind(dcr); @@ -388,13 +388,13 @@ static void readlabelcmd() Pmsg0(0, _("Volume label read correctly.\n")); break; case VOL_IO_ERROR: - Pmsg1(0, _("I/O error on device: ERR=%s"), dev->bstrerror()); + Pmsg1(0, _("I/O error on device: ERR=%s"), strerror_dev(dev)); break; case VOL_NAME_ERROR: Pmsg0(0, _("Volume name error\n")); break; case VOL_CREATE_ERROR: - Pmsg1(0, _("Error creating label. ERR=%s"), dev->bstrerror()); + Pmsg1(0, _("Error creating label. ERR=%s"), strerror_dev(dev)); break; case VOL_VERSION_ERROR: Pmsg0(0, _("Volume version error.\n")); @@ -421,7 +421,7 @@ static void loadcmd() { if (!load_dev(dev)) { - Pmsg1(0, _("Bad status from load. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from load. ERR=%s\n"), strerror_dev(dev)); } else Pmsg1(0, _("Loaded %s\n"), dev->print_name()); } @@ -432,7 +432,7 @@ static void loadcmd() static void rewindcmd() { if (!dev->rewind(dcr)) { - Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), strerror_dev(dev)); clrerror_dev(dev, -1); } else { Pmsg1(0, _("Rewound %s\n"), dev->print_name()); @@ -462,7 +462,7 @@ static void weofcmd() } if ((stat = weof_dev(dev, num)) < 0) { - Pmsg2(0, _("Bad status from weof %d. ERR=%s\n"), stat, dev->bstrerror()); + Pmsg2(0, _("Bad status from weof %d. ERR=%s\n"), stat, strerror_dev(dev)); return; } else { if (num==1) { @@ -483,8 +483,8 @@ static void weofcmd() */ static void eomcmd() { - if (!dev->eod()) { - Pmsg1(0, "%s", dev->bstrerror()); + if (!eod_dev(dev)) { + Pmsg1(0, "%s", strerror_dev(dev)); return; } else { Pmsg0(0, _("Moved to end of medium.\n")); @@ -513,8 +513,8 @@ static void bsfcmd() num = 1; } - if (!dev->bsf(num)) { - Pmsg1(0, _("Bad status from bsf. ERR=%s\n"), dev->bstrerror()); + if (!bsf_dev(dev, num)) { + Pmsg1(0, _("Bad status from bsf. ERR=%s\n"), strerror_dev(dev)); } else { Pmsg2(0, _("Backspaced %d file%s.\n"), num, num==1?"":"s"); } @@ -532,8 +532,8 @@ static void bsrcmd() if (num <= 0) { num = 1; } - if (!dev->bsr(num)) { - Pmsg1(0, _("Bad status from bsr. ERR=%s\n"), dev->bstrerror()); + if (!bsr_dev(dev, num)) { + Pmsg1(0, _("Bad status from bsr. ERR=%s\n"), strerror_dev(dev)); } else { Pmsg2(0, _("Backspaced %d record%s.\n"), num, num==1?"":"s"); } @@ -699,19 +699,19 @@ static int re_read_block_test() if (dev_cap(dev, CAP_TWOEOF)) { weofcmd(); } - if (!dev->bsf(1)) { - Pmsg1(0, _("Backspace file failed! ERR=%s\n"), dev->bstrerror()); + if (!bsf_dev(dev, 1)) { + Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror_dev(dev)); goto bail_out; } if (dev_cap(dev, CAP_TWOEOF)) { - if (!dev->bsf(1)) { - Pmsg1(0, _("Backspace file failed! ERR=%s\n"), dev->bstrerror()); + if (!bsf_dev(dev, 1)) { + Pmsg1(0, _("Backspace file failed! ERR=%s\n"), strerror_dev(dev)); goto bail_out; } } Pmsg0(0, _("Backspaced over EOF OK.\n")); - if (!dev->bsr(1)) { - Pmsg1(0, _("Backspace record failed! ERR=%s\n"), dev->bstrerror()); + if (!bsr_dev(dev, 1)) { + Pmsg1(0, _("Backspace record failed! ERR=%s\n"), strerror_dev(dev)); goto bail_out; } Pmsg0(0, _("Backspace record OK.\n")); @@ -772,7 +772,7 @@ static int write_read_test() block = dcr->block; rec = new_record(); if (!dev->rewind(dcr)) { - Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } rec->data = check_pool_memory_size(rec->data, block->buf_len); @@ -814,7 +814,7 @@ static int write_read_test() weofcmd(); } if (!dev->rewind(dcr)) { - Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } else { Pmsg0(0, _("Rewind OK.\n")); @@ -884,7 +884,7 @@ static int position_test() empty_block(block); rec = new_record(); if (!dev->rewind(dcr)) { - Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } rec->data = check_pool_memory_size(rec->data, block->buf_len); @@ -926,7 +926,7 @@ static int position_test() weofcmd(); } if (!dev->rewind(dcr)) { - Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } else { Pmsg0(0, _("Rewind OK.\n")); @@ -970,7 +970,7 @@ static int position_test() continue; } Pmsg2(-1, _("Reposition to file:block %d:%d\n"), file, blk); - if (!dev->reposition(file, blk)) { + if (!reposition_dev(dev, file, blk)) { Pmsg0(0, _("Reposition error.\n")); goto bail_out; } @@ -1053,7 +1053,7 @@ static int append_test() if (dev_cap(dev, CAP_TWOEOF)) { weofcmd(); } - dev->close(); /* release device */ + force_close_device(dev); /* release device */ if (!open_the_device()) { return -1; } @@ -1147,8 +1147,9 @@ try_again: Dmsg1(100, "Results from loaded query=%s\n", results); if (loaded) { dcr->VolCatInfo.Slot = loaded; + offline_or_rewind_dev(dev); /* We are going to load a new tape, so close the device */ - dev->close(); + force_close_device(dev); Pmsg2(-1, _("3302 Issuing autochanger \"unload %d %d\" command.\n"), loaded, dev->drive_index); changer = edit_device_codes(dcr, changer, @@ -1173,7 +1174,7 @@ try_again: changer = edit_device_codes(dcr, changer, dcr->device->changer_command, "load"); Dmsg1(100, "Changer=%s\n", changer); - dev->close(); + force_close_device(dev); status = run_program(changer, timeout, results); if (status == 0) { Pmsg2(-1, _("3303 Autochanger \"load %d %d\" status is OK.\n"), @@ -1194,7 +1195,7 @@ try_again: */ bmicrosleep(sleep_time, 0); if (!dev->rewind(dcr) || weof_dev(dev,1) < 0) { - Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from rewind. ERR=%s\n"), strerror_dev(dev)); clrerror_dev(dev, -1); Pmsg0(-1, _("\nThe test failed, probably because you need to put\n" "a longer sleep time in the mtx-script in the load) case.\n" @@ -1206,7 +1207,7 @@ try_again: } if ((status = weof_dev(dev, 1)) < 0) { - Pmsg2(0, _("Bad status from weof %d. ERR=%s\n"), status, dev->bstrerror()); + Pmsg2(0, _("Bad status from weof %d. ERR=%s\n"), status, strerror_dev(dev)); goto bail_out; } else { Pmsg1(0, _("Wrote EOF to %s\n"), dev->print_name()); @@ -1274,7 +1275,7 @@ test_again: rewindcmd(); Pmsg0(0, _("Now forward spacing 1 file.\n")); if (!dev->fsf(1)) { - Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } Pmsg2(-1, _("We should be in file 1. I am at file %d. %s\n"), @@ -1286,7 +1287,7 @@ test_again: Pmsg0(0, _("Now forward spacing 2 files.\n")); if (!dev->fsf(2)) { - Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } Pmsg2(-1, _("We should be in file 3. I am at file %d. %s\n"), @@ -1299,7 +1300,7 @@ test_again: rewindcmd(); Pmsg0(0, _("Now forward spacing 4 files.\n")); if (!dev->fsf(4)) { - Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } Pmsg2(-1, _("We should be in file 4. I am at file %d. %s\n"), @@ -1317,7 +1318,7 @@ test_again: Pmsg0(-1, "\n"); Pmsg0(0, _("Now forward spacing 1 more file.\n")); if (!dev->fsf(1)) { - Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), strerror_dev(dev)); } Pmsg2(-1, _("We should be in file 5. I am at file %d. %s\n"), dev->file, dev->file == 5 ? _("This is correct!") : _("This is NOT correct!!!!")); @@ -1464,7 +1465,7 @@ static void fsfcmd() num = 1; } if (!dev->fsf(num)) { - Pmsg1(0, _("Bad status from fsf. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from fsf. ERR=%s\n"), strerror_dev(dev)); return; } if (num == 1) { @@ -1486,7 +1487,7 @@ static void fsrcmd() num = 1; } if (!dev->fsr(num)) { - Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), dev->bstrerror()); + Pmsg1(0, _("Bad status from fsr. ERR=%s\n"), strerror_dev(dev)); return; } if (num == 1) { @@ -1593,7 +1594,7 @@ static void scancmd() clrerror_dev(dev, -1); Mmsg2(dev->errmsg, _("read error on %s. ERR=%s.\n"), dev->dev_name, be.strerror()); - Pmsg2(0, _("Bad status from read %d. ERR=%s\n"), stat, dev->bstrerror()); + Pmsg2(0, _("Bad status from read %d. ERR=%s\n"), stat, strerror_dev(dev)); if (blocks > 0) { if (blocks==1) { printf(_("1 block of %d bytes in file %d\n"), block_size, dev->file); @@ -1670,7 +1671,7 @@ static void scan_blocks() tot_files = dev->file; for (;;) { if (!read_block_from_device(dcr, NO_BLOCK_NUMBER_CHECK)) { - Dmsg1(100, "!read_block(): ERR=%s\n", dev->bstrerror()); + Dmsg1(100, "!read_block(): ERR=%s\n", strerror_dev(dev)); if (dev->state & ST_EOT) { if (blocks > 0) { if (blocks==1) { @@ -1709,7 +1710,7 @@ static void scan_blocks() printf(_("Short block read.\n")); continue; } - printf(_("Error reading block. ERR=%s\n"), dev->bstrerror()); + printf(_("Error reading block. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } if (block->block_len != block_size) { @@ -1755,7 +1756,7 @@ static void statcmd() { int debug = debug_level; debug_level = 30; - Pmsg2(0, _("Device status: %u. ERR=%s\n"), status_dev(dev), dev->bstrerror()); + Pmsg2(0, _("Device status: %u. ERR=%s\n"), status_dev(dev), strerror_dev(dev)); #ifdef xxxx dump_volume_label(dev); #endif @@ -1851,7 +1852,7 @@ static void fillcmd() if (!write_session_label(dcr, SOS_LABEL)) { set_jcr_job_status(jcr, JS_ErrorTerminated); Jmsg1(jcr, M_FATAL, 0, _("Write session label failed. ERR=%s\n"), - dev->bstrerror()); + strerror_dev(dev)); ok = false; } Pmsg0(-1, _("Wrote Start of Session label.\n")); @@ -1972,7 +1973,7 @@ static void fillcmd() set_jcr_job_status(jcr, JS_ErrorTerminated); } if (!write_session_label(dcr, EOS_LABEL)) { - Pmsg1(000, _("Error writting end session label. ERR=%s\n"), dev->bstrerror()); + Pmsg1(000, _("Error writting end session label. ERR=%s\n"), strerror_dev(dev)); ok = false; } /* Write out final block of this session */ @@ -2102,11 +2103,11 @@ static void do_unfill() /* Multiple Volume tape */ /* Close device so user can use autochanger if desired */ if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) { - dev->offline(); + offline_dev(dev); } autochanger = autoload_device(dcr, 1, NULL); if (!autochanger) { - dev->close(); + force_close_device(dev); get_cmd(_("Mount first tape. Press enter when ready: ")); } free_restore_volume_list(jcr); @@ -2114,7 +2115,8 @@ static void do_unfill() set_volume_name("TestVolume1", 1); jcr->bsr = NULL; create_restore_volume_list(jcr); - dev->close(); + close_device(dev); + dev->state &= ~(ST_READ|ST_APPEND); dev->num_writers = 0; if (!acquire_device_for_read(dcr)) { Pmsg1(-1, "%s", dev->errmsg); @@ -2137,13 +2139,13 @@ static void do_unfill() read_records(dcr, quickie_cb, my_mount_next_read_volume); Pmsg4(-1, _("Reposition from %u:%u to %u:%u\n"), dev->file, dev->block_num, last_file, last_block_num); - if (!dev->reposition(last_file, last_block_num)) { - Pmsg1(-1, _("Reposition error. ERR=%s\n"), dev->bstrerror()); + if (!reposition_dev(dev, last_file, last_block_num)) { + Pmsg1(-1, _("Reposition error. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } Pmsg1(-1, _("Reading block %u.\n"), last_block_num); if (!read_block_from_device(dcr, NO_BLOCK_NUMBER_CHECK)) { - Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->bstrerror()); + Pmsg1(-1, _("Error reading block: ERR=%s\n"), strerror_dev(dev)); goto bail_out; } if (compare_blocks(last_block, block)) { @@ -2165,7 +2167,7 @@ static void do_unfill() /* Multiple Volume tape */ /* Close device so user can use autochanger if desired */ if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) { - dev->offline(); + offline_dev(dev); } free_restore_volume_list(jcr); @@ -2174,7 +2176,7 @@ static void do_unfill() create_restore_volume_list(jcr); autochanger = autoload_device(dcr, 1, NULL); if (!autochanger) { - dev->close(); + force_close_device(dev); get_cmd(_("Mount second tape. Press enter when ready: ")); } @@ -2188,13 +2190,13 @@ static void do_unfill() * on the previous tape. */ Pmsg2(-1, _("Reposition from %u:%u to 0:1\n"), dev->file, dev->block_num); - if (!dev->reposition(0, 1)) { - Pmsg1(-1, _("Reposition error. ERR=%s\n"), dev->bstrerror()); + if (!reposition_dev(dev, 0, 1)) { + Pmsg1(-1, _("Reposition error. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } Pmsg1(-1, _("Reading block %d.\n"), dev->block_num); if (!read_block_from_device(dcr, NO_BLOCK_NUMBER_CHECK)) { - Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->bstrerror()); + Pmsg1(-1, _("Error reading block: ERR=%s\n"), strerror_dev(dev)); goto bail_out; } if (compare_blocks(first_block, block)) { @@ -2204,13 +2206,13 @@ static void do_unfill() /* Now find and compare the last block */ Pmsg4(-1, _("Reposition from %u:%u to %u:%u\n"), dev->file, dev->block_num, last_file, last_block_num); - if (!dev->reposition(last_file, last_block_num)) { - Pmsg1(-1, _("Reposition error. ERR=%s\n"), dev->bstrerror()); + if (!reposition_dev(dev, last_file, last_block_num)) { + Pmsg1(-1, _("Reposition error. ERR=%s\n"), strerror_dev(dev)); goto bail_out; } Pmsg1(-1, _("Reading block %d.\n"), dev->block_num); if (!read_block_from_device(dcr, NO_BLOCK_NUMBER_CHECK)) { - Pmsg1(-1, _("Error reading block: ERR=%s\n"), dev->bstrerror()); + Pmsg1(-1, _("Error reading block: ERR=%s\n"), strerror_dev(dev)); goto bail_out; } if (compare_blocks(last_block, block)) { @@ -2337,7 +2339,7 @@ static int flush_block(DEV_BLOCK *block, int dump) } else { /* Full test in progress */ if (!fixup_device_block_write_error(jcr->dcr)) { - Pmsg1(000, _("Cannot fixup device error. %s\n"), dev->bstrerror()); + Pmsg1(000, _("Cannot fixup device error. %s\n"), strerror_dev(dev)); ok = false; unlock_device(dev); return 0; @@ -2675,7 +2677,11 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr) if (dcr->VolumeName[0] == 0) { return dir_ask_sysop_to_create_appendable_volume(dcr); } - dev->close(); + /* Close device so user can use autochanger if desired */ + if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) { + offline_dev(dev); + } + force_close_device(dev); Pmsg1(-1, "%s", dev->errmsg); /* print reason */ if (dcr->VolumeName[0] == 0 || strcmp(dcr->VolumeName, "TestVolume2") == 0) { fprintf(stderr, _("Mount second Volume on device %s and press return when ready: "), @@ -2700,11 +2706,11 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) } /* Close device so user can use autochanger if desired */ if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) { - dev->offline(); + offline_dev(dev); } autochanger = autoload_device(dcr, 1, NULL); if (!autochanger) { - dev->close(); + force_close_device(dev); fprintf(stderr, _("Mount blank Volume on device %s and press return when ready: "), dev->print_name()); getchar(); @@ -2747,7 +2753,8 @@ static bool my_mount_next_read_volume(DCR *dcr) set_volume_name("TestVolume2", 2); jcr->bsr = NULL; create_restore_volume_list(jcr); - dev->close(); + close_device(dev); + dev->clear_read(); if (!acquire_device_for_read(dcr)) { Pmsg2(0, _("Cannot open Dev=%s, Vol=%s\n"), dev->print_name(), dcr->VolumeName); return false; @@ -2765,3 +2772,4 @@ static void set_volume_name(const char *VolName, int volnum) bstrncpy(dcr->VolumeName, VolName, sizeof(dcr->VolumeName)); dcr->VolCatInfo.Slot = volnum; } + diff --git a/bacula/src/stored/butil.c b/bacula/src/stored/butil.c index 44f190761f..43a8088a8f 100644 --- a/bacula/src/stored/butil.c +++ b/bacula/src/stored/butil.c @@ -12,7 +12,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2005 Kern Sibbald + Copyright (C) 2000-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -93,7 +93,7 @@ JCR *setup_jcr(const char *name, char *dev_name, BSR *bsr, pm_strcpy(jcr->fileset_md5, "Dummy.fileset.md5"); init_autochangers(); - init_volume_list(); + create_volume_list(); dcr = setup_to_access_device(jcr, dev_name, VolumeName, mode); if (!dcr) { @@ -121,6 +121,8 @@ static DCR *setup_to_access_device(JCR *jcr, char *dev_name, DCR *dcr; char VolName[MAX_NAME_LENGTH]; + init_reservations_lock(); + /* * If no volume name already given and no bsr, and it is a file, * try getting name from Filename diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index a00a6e25ea..294c17d9c3 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -103,7 +103,7 @@ init_dev(JCR *jcr, DEVRES *device) DCR *dcr = NULL; DEVICE *dev; - + /* If no device type specified, try to guess */ if (!device->dev_type) { /* Check that device is available */ @@ -129,8 +129,9 @@ init_dev(JCR *jcr, DEVRES *device) } } - dev = (DEVICE *)malloc(sizeof(DEVICE)); + dev = (DEVICE *)get_memory(sizeof(DEVICE)); memset(dev, 0, sizeof(DEVICE)); + dev->state = ST_MALLOC; /* Copy user supplied device parameters from Resource */ dev->dev_name = get_memory(strlen(device->device_name)+1); @@ -138,7 +139,6 @@ init_dev(JCR *jcr, DEVRES *device) dev->prt_name = get_memory(strlen(device->device_name) + strlen(device->hdr.name) + 20); /* We edit "Resource-name" (physical-name) */ Mmsg(dev->prt_name, "\"%s\" (%s)", device->hdr.name, device->device_name); - Dmsg1(400, "Allocate dev=%s\n", dev->print_name()); dev->capabilities = device->cap_bits; dev->min_block_size = device->min_block_size; dev->max_block_size = device->max_block_size; @@ -154,7 +154,7 @@ init_dev(JCR *jcr, DEVRES *device) dev->autoselect = device->autoselect; dev->dev_type = device->dev_type; if (dev->is_tape()) { /* No parts on tapes */ - dev->max_part_size = 0; + dev->max_part_size = 0; } else { dev->max_part_size = device->max_part_size; } @@ -162,9 +162,7 @@ init_dev(JCR *jcr, DEVRES *device) if (dev->vol_poll_interval && dev->vol_poll_interval < 60) { dev->vol_poll_interval = 60; } - /* Link the dev and device structures together */ dev->device = device; - device->dev = dev; if (dev->is_fifo()) { dev->capabilities |= CAP_STREAM; /* set stream device */ @@ -274,7 +272,7 @@ DEVICE::open(DCR *dcr, int omode) bstrncpy(VolCatInfo.VolCatName, dcr->VolumeName, sizeof(VolCatInfo.VolCatName)); } - Dmsg4(29, "open dev: type=%d dev_name=%s vol=%s mode=%s\n", dev_type, + Dmsg4(29, "open dev: tape=%d dev_name=%s vol=%s mode=%s\n", is_tape(), print_name(), VolCatInfo.VolCatName, mode_to_str(omode)); state &= ~(ST_LABEL|ST_APPEND|ST_READ|ST_EOT|ST_WEOT|ST_EOF); label_type = B_BACULA_LABEL; @@ -285,12 +283,9 @@ DEVICE::open(DCR *dcr, int omode) open_dvd_device(dcr, omode); } else { Dmsg1(100, "call open_file_device mode=%s\n", mode_to_str(omode)); - open_file_device(dcr, omode); + open_file_device(omode); } state |= preserve; /* reset any important state info */ - if (preserve) { - Dmsg1(000, "preserve=0x%x\n", preserve); - } return fd; } @@ -301,7 +296,11 @@ void DEVICE::set_mode(int new_mode) mode = O_CREAT | O_RDWR | O_BINARY; break; case OPEN_READ_WRITE: - mode = O_RDWR | O_BINARY; + if (is_dvd() || is_file()) { + mode = O_CREAT | O_RDWR | O_BINARY; + } else { + mode = O_RDWR | O_BINARY; + } break; case OPEN_READ_ONLY: mode = O_RDONLY | O_BINARY; @@ -405,14 +404,10 @@ void DEVICE::set_blocking() /* * Open a file device */ -void DEVICE::open_file_device(DCR *dcr, int omode) +void DEVICE::open_file_device(int omode) { POOL_MEM archive_name(PM_FNAME); - if (is_autochanger()) { - get_autochanger_loaded_slot(dcr); - } - /* * Handle opening of File Archive (not a tape) */ @@ -437,12 +432,15 @@ void DEVICE::open_file_device(DCR *dcr, int omode) pm_strcat(archive_name, VolCatInfo.VolCatName); } - mount(1); /* do mount if required */ + Dmsg3(29, "open dev: %s dev=%s mode=%s\n", is_dvd()?"DVD":"disk", + archive_name.c_str(), mode_to_str(omode)); openmode = omode; + Dmsg2(100, "openmode=%d %s\n", openmode, mode_to_str(openmode)); + set_mode(omode); /* If creating file, give 0640 permissions */ - Dmsg3(29, "open disk: mode=%s open(%s, 0x%x, 0640)\n", mode_to_str(omode), + Dmsg3(29, "mode=%s open(%s, 0x%x, 0640)\n", mode_to_str(omode), archive_name.c_str(), mode); /* Use system open() */ if ((fd = ::open(archive_name.c_str(), mode, 0640)) < 0) { @@ -456,13 +454,13 @@ void DEVICE::open_file_device(DCR *dcr, int omode) dev_errno = 0; update_pos_dev(this); /* update position */ } - Dmsg4(29, "open dev: disk fd=%d opened, part=%d/%d, part_size=%u\n", - fd, part, num_parts, part_size); + Dmsg5(29, "open dev: %s fd=%d opened, part=%d/%d, part_size=%u\n", + is_dvd()?"DVD":"disk", fd, part, num_parts, + part_size); } /* - * Open a DVD device. N.B. at this point, dcr->VolCatInfo.VolCatName - * (NB:??? I think it's VolCatInfo.VolCatName that is right) + * Open a DVD device. N.B. at this point, dcr->VolCatInfo.VolCatName (NB:??? I think it's VolCatInfo.VolCatName that is right) * has the desired Volume name, but there is NO assurance that * any other field of VolCatInfo is correct. */ @@ -499,20 +497,21 @@ void DEVICE::open_dvd_device(DCR *dcr, int omode) dcr->dev->num_parts = dcr->VolCatInfo.VolCatParts; } - if (mount_dvd(this, 1)) { + if (mount_dev(this, 1)) { if ((num_parts == 0) && (!truncating)) { /* If we can mount the device, and we are not truncating the DVD, we usually want to abort. */ /* There is one exception, if there is only one 0-sized file on the DVD, with the right volume name, - * we continue (it's the method used by truncate_dvd to truncate a volume). */ + * we continue (it's the method used by truncate_dvd_dev to truncate a volume). */ if (!check_can_write_on_non_blank_dvd(dcr)) { Mmsg(errmsg, _("The media in the device %s is not empty, please blank it before writing anything to it.\n"), print_name()); Emsg0(M_FATAL, 0, errmsg); - unmount_dvd(this, 1); /* Unmount the device, so the operator can change it. */ + unmount_dev(this, 1); /* Unmount the device, so the operator can change it. */ clear_opened(); return; } } - } else { + } + else { /* We cannot mount the device */ if (num_parts == 0) { /* Run free space, check there is a media. */ @@ -625,7 +624,7 @@ bool DEVICE::rewind(DCR *dcr) unsigned int i; bool first = true; - Dmsg3(400, "rewind res=%d fd=%d %s\n", reserved_device, fd, print_name()); + Dmsg3(29, "rewind res=%d fd=%d %s\n", reserved_device, fd, print_name()); if (fd < 0) { if (!is_dvd()) { /* In case of major error, the fd is not open on DVD, so we don't want to abort. */ dev_errno = EBADF; @@ -760,54 +759,56 @@ void DEVICE::set_ateot() * Returns: true on succes * false on error */ -bool DEVICE::eod() +bool +eod_dev(DEVICE *dev) { struct mtop mt_com; struct mtget mt_stat; bool ok = true; off_t pos; - if (fd < 0) { - dev_errno = EBADF; - Mmsg1(errmsg, _("Bad call to eod_dev. Device %s not open\n"), print_name()); + if (dev->fd < 0) { + dev->dev_errno = EBADF; + Mmsg1(dev->errmsg, _("Bad call to eod_dev. Device %s not open\n"), + dev->print_name()); return false; } #if defined (__digital__) && defined (__unix__) - return fsf(VolCatInfo.VolCatFiles); + return dev->fsf(dev->VolCatInfo.VolCatFiles); #endif Dmsg0(29, "eod_dev\n"); - if (at_eot()) { + if (dev->at_eot()) { return true; } - state &= ~(ST_EOF); /* remove EOF flags */ - block_num = file = 0; - file_size = 0; - file_addr = 0; - if (is_fifo() || is_prog()) { + dev->state &= ~(ST_EOF); /* remove EOF flags */ + dev->block_num = dev->file = 0; + dev->file_size = 0; + dev->file_addr = 0; + if (dev->is_fifo() || dev->is_prog()) { return true; } - if (!is_tape()) { - pos = lseek_dev(this, (off_t)0, SEEK_END); + if (!dev->is_tape()) { + pos = lseek_dev(dev, (off_t)0, SEEK_END); // Dmsg1(100, "====== Seek to %lld\n", pos); if (pos >= 0) { - update_pos_dev(this); - state |= ST_EOT; + update_pos_dev(dev); + dev->state |= ST_EOT; return true; } - dev_errno = errno; + dev->dev_errno = errno; berrno be; - Mmsg2(errmsg, _("lseek_dev error on %s. ERR=%s.\n"), - print_name(), be.strerror()); + Mmsg2(dev->errmsg, _("lseek_dev error on %s. ERR=%s.\n"), + dev->print_name(), be.strerror()); return false; } #ifdef MTEOM - if (has_cap(CAP_FASTFSF) && !has_cap(CAP_EOM)) { + if (dev_cap(dev, CAP_FASTFSF) && !dev_cap(dev, CAP_EOM)) { Dmsg0(100,"Using FAST FSF for EOM\n"); /* If unknown position, rewind */ - if (!dev_get_os_pos(this, &mt_stat)) { - if (!rewind(NULL)) { + if (!dev_get_os_pos(dev, &mt_stat)) { + if (!dev->rewind(NULL)) { return false; } } @@ -822,33 +823,33 @@ bool DEVICE::eod() } } - if (has_cap(CAP_MTIOCGET) && (has_cap(CAP_FASTFSF) || has_cap(CAP_EOM))) { - if (has_cap(CAP_EOM)) { + if (dev_cap(dev, CAP_MTIOCGET) && (dev_cap(dev, CAP_FASTFSF) || dev_cap(dev, CAP_EOM))) { + if (dev_cap(dev, CAP_EOM)) { Dmsg0(100,"Using EOM for EOM\n"); mt_com.mt_op = MTEOM; mt_com.mt_count = 1; } - if (ioctl(fd, MTIOCTOP, (char *)&mt_com) < 0) { + if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) { berrno be; - clrerror_dev(this, mt_com.mt_op); + clrerror_dev(dev, mt_com.mt_op); Dmsg1(50, "ioctl error: %s\n", be.strerror()); - update_pos_dev(this); - Mmsg2(errmsg, _("ioctl MTEOM error on %s. ERR=%s.\n"), - print_name(), be.strerror()); + update_pos_dev(dev); + Mmsg2(dev->errmsg, _("ioctl MTEOM error on %s. ERR=%s.\n"), + dev->print_name(), be.strerror()); return false; } - if (!dev_get_os_pos(this, &mt_stat)) { + if (!dev_get_os_pos(dev, &mt_stat)) { berrno be; - clrerror_dev(this, -1); - Mmsg2(errmsg, _("ioctl MTIOCGET error on %s. ERR=%s.\n"), - print_name(), be.strerror()); + clrerror_dev(dev, -1); + Mmsg2(dev->errmsg, _("ioctl MTIOCGET error on %s. ERR=%s.\n"), + dev->print_name(), be.strerror()); return false; } Dmsg2(100, "EOD file=%d block=%d\n", mt_stat.mt_fileno, mt_stat.mt_blkno); - set_ateof(); - file = mt_stat.mt_fileno; + dev->set_ateof(); + dev->file = mt_stat.mt_fileno; } else { #else { @@ -856,29 +857,29 @@ bool DEVICE::eod() /* * Rewind then use FSF until EOT reached */ - if (!rewind(NULL)) { + if (!dev->rewind(NULL)) { return false; } /* * Move file by file to the end of the tape */ int file_num; - for (file_num=file; !at_eot(); file_num++) { + for (file_num=dev->file; !dev->at_eot(); file_num++) { Dmsg0(200, "eod_dev: doing fsf 1\n"); - if (!fsf(1)) { + if (!dev->fsf(1)) { Dmsg0(200, "fsf error.\n"); return false; } /* * Avoid infinite loop by ensuring we advance. */ - if (file_num == (int)file) { + if (file_num == (int)dev->file) { struct mtget mt_stat; Dmsg1(100, "fsf did not advance from file %d\n", file_num); - set_ateof(); - if (dev_get_os_pos(this, &mt_stat)) { - Dmsg2(100, "Adjust file from %d to %d\n", file , mt_stat.mt_fileno); - file = mt_stat.mt_fileno; + dev->set_ateof(); + if (dev_get_os_pos(dev, &mt_stat)) { + Dmsg2(100, "Adjust file from %d to %d\n", dev->file , mt_stat.mt_fileno); + dev->file = mt_stat.mt_fileno; } break; } @@ -889,21 +890,21 @@ bool DEVICE::eod() * MTEOM, so we must backup so that appending overwrites * the second EOF. */ - if (has_cap(CAP_BSFATEOM)) { + if (dev_cap(dev, CAP_BSFATEOM)) { struct mtget mt_stat; /* Backup over EOF */ - ok = bsf(1); + ok = bsf_dev(dev, 1); /* If BSF worked and fileno is known (not -1), set file */ - if (dev_get_os_pos(this, &mt_stat)) { - Dmsg2(100, "BSFATEOF adjust file from %d to %d\n", file , mt_stat.mt_fileno); - file = mt_stat.mt_fileno; + if (dev_get_os_pos(dev, &mt_stat)) { + Dmsg2(100, "BSFATEOF adjust file from %d to %d\n", dev->file , mt_stat.mt_fileno); + dev->file = mt_stat.mt_fileno; } else { - file++; /* wing it -- not correct on all OSes */ + dev->file++; /* wing it -- not correct on all OSes */ } } else { - update_pos_dev(this); /* update position */ + update_pos_dev(dev); /* update position */ } - Dmsg1(200, "EOD dev->file=%d\n", file); + Dmsg1(200, "EOD dev->file=%d\n", dev->file); return ok; } @@ -1018,7 +1019,7 @@ uint32_t status_dev(DEVICE *dev) Pmsg0(-20, " IM_REP_EN"); } #endif /* !SunOS && !OSF */ - if (dev->has_cap(CAP_MTIOCGET)) { + if (dev_cap(dev, CAP_MTIOCGET)) { Pmsg2(-20, _(" file=%d block=%d\n"), mt_stat.mt_fileno, mt_stat.mt_blkno); } else { Pmsg2(-20, _(" file=%d block=%d\n"), -1, -1); @@ -1080,44 +1081,44 @@ bool load_dev(DEVICE *dev) * Returns: true on success * false on failure */ -bool DEVICE::offline() +bool offline_dev(DEVICE *dev) { struct mtop mt_com; - if (!is_tape()) { + if (!dev || dev->fd < 0 || !dev->is_tape()) { return true; /* device not open */ } - state &= ~(ST_APPEND|ST_READ|ST_EOT|ST_EOF|ST_WEOT); /* remove EOF/EOT flags */ - block_num = file = 0; - file_size = 0; - file_addr = 0; - part = 0; + dev->state &= ~(ST_APPEND|ST_READ|ST_EOT|ST_EOF|ST_WEOT); /* remove EOF/EOT flags */ + dev->block_num = dev->file = 0; + dev->file_size = 0; + dev->file_addr = 0; + dev->part = 0; #ifdef MTUNLOCK mt_com.mt_op = MTUNLOCK; mt_com.mt_count = 1; - ioctl(fd, MTIOCTOP, (char *)&mt_com); + ioctl(dev->fd, MTIOCTOP, (char *)&mt_com); #endif mt_com.mt_op = MTOFFL; mt_com.mt_count = 1; - if (ioctl(fd, MTIOCTOP, (char *)&mt_com) < 0) { + if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) { berrno be; - dev_errno = errno; - Mmsg2(errmsg, _("ioctl MTOFFL error on %s. ERR=%s.\n"), - print_name(), be.strerror()); + dev->dev_errno = errno; + Mmsg2(dev->errmsg, _("ioctl MTOFFL error on %s. ERR=%s.\n"), + dev->print_name(), be.strerror()); return false; } - Dmsg1(100, "Offlined device %s\n", print_name()); + Dmsg1(100, "Offlined device %s\n", dev->print_name()); return true; } -bool DEVICE::offline_or_rewind() +bool offline_or_rewind_dev(DEVICE *dev) { - if (fd < 0) { + if (dev->fd < 0) { return false; } - if (has_cap(CAP_OFFLINEUNMOUNT)) { - return offline(); + if (dev_cap(dev, CAP_OFFLINEUNMOUNT)) { + return offline_dev(dev); } else { /* * Note, this rewind probably should not be here (it wasn't @@ -1126,8 +1127,8 @@ bool DEVICE::offline_or_rewind() * such as backspacing after writing and EOF. If it is not * done, all future references to the drive get and I/O error. */ - clrerror_dev(this, MTREW); - return rewind(NULL); + clrerror_dev(dev, MTREW); + return dev->rewind(NULL); } } @@ -1170,7 +1171,7 @@ bool DEVICE::fsf(int num) * the SCSI driver will ensure that we do not * forward space past the end of the medium. */ - if (has_cap(CAP_FSF) && has_cap(CAP_MTIOCGET) && has_cap(CAP_FASTFSF)) { + if (dev_cap(this, CAP_FSF) && dev_cap(this, CAP_MTIOCGET) && dev_cap(this, CAP_FASTFSF)) { mt_com.mt_op = MTFSF; mt_com.mt_count = num; stat = ioctl(fd, MTIOCTOP, (char *)&mt_com); @@ -1196,7 +1197,7 @@ bool DEVICE::fsf(int num) * is the only way we can be sure that we don't read * two consecutive EOF marks, which means End of Data. */ - } else if (has_cap(CAP_FSF)) { + } else if (dev_cap(this, CAP_FSF)) { POOLMEM *rbuf; int rbuf_len; Dmsg0(200, "FSF has cap_fsf\n"); @@ -1296,38 +1297,39 @@ bool DEVICE::fsf(int num) * Returns: false on failure * true on success */ -bool DEVICE::bsf(int num) +bool +bsf_dev(DEVICE *dev, int num) { struct mtop mt_com; int stat; - if (fd < 0) { - dev_errno = EBADF; - Mmsg0(errmsg, _("Bad call to bsf. Device not open\n")); - Emsg0(M_FATAL, 0, errmsg); + if (dev->fd < 0) { + dev->dev_errno = EBADF; + Mmsg0(dev->errmsg, _("Bad call to bsf_dev. Device not open\n")); + Emsg0(M_FATAL, 0, dev->errmsg); return false; } - if (!is_tape()) { - Mmsg1(errmsg, _("Device %s cannot BSF because it is not a tape.\n"), - print_name()); + if (!dev->is_tape()) { + Mmsg1(dev->errmsg, _("Device %s cannot BSF because it is not a tape.\n"), + dev->print_name()); return false; } - Dmsg0(29, "bsf\n"); - state &= ~(ST_EOT|ST_EOF); - file -= num; - file_addr = 0; - file_size = 0; + Dmsg0(29, "bsf_dev\n"); + dev->state &= ~(ST_EOT|ST_EOF); + dev->file -= num; + dev->file_addr = 0; + dev->file_size = 0; mt_com.mt_op = MTBSF; mt_com.mt_count = num; - stat = ioctl(fd, MTIOCTOP, (char *)&mt_com); + stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com); if (stat < 0) { berrno be; - clrerror_dev(this, MTBSF); - Mmsg2(errmsg, _("ioctl MTBSF error on %s. ERR=%s.\n"), - print_name(), be.strerror()); + clrerror_dev(dev, MTBSF); + Mmsg2(dev->errmsg, _("ioctl MTBSF error on %s. ERR=%s.\n"), + dev->print_name(), be.strerror()); } - update_pos_dev(this); + update_pos_dev(dev); return stat == 0; } @@ -1352,7 +1354,7 @@ bool DEVICE::fsr(int num) if (!is_tape()) { return false; } - if (!has_cap(CAP_FSR)) { + if (!dev_cap(this, CAP_FSR)) { Mmsg1(errmsg, _("ioctl MTFSR not permitted on %s.\n"), print_name()); return false; } @@ -1393,40 +1395,41 @@ bool DEVICE::fsr(int num) * Returns: false on failure * true on success */ -bool DEVICE::bsr(int num) +bool +bsr_dev(DEVICE *dev, int num) { struct mtop mt_com; int stat; - if (fd < 0) { - dev_errno = EBADF; - Mmsg0(errmsg, _("Bad call to bsr_dev. Device not open\n")); - Emsg0(M_FATAL, 0, errmsg); + if (dev->fd < 0) { + dev->dev_errno = EBADF; + Mmsg0(dev->errmsg, _("Bad call to bsr_dev. Device not open\n")); + Emsg0(M_FATAL, 0, dev->errmsg); return false; } - if (!is_tape()) { + if (!dev->is_tape()) { return false; } - if (!has_cap(CAP_BSR)) { - Mmsg1(errmsg, _("ioctl MTBSR not permitted on %s.\n"), print_name()); + if (!dev_cap(dev, CAP_BSR)) { + Mmsg1(dev->errmsg, _("ioctl MTBSR not permitted on %s.\n"), dev->print_name()); return false; } Dmsg0(29, "bsr_dev\n"); - block_num -= num; - state &= ~(ST_EOF|ST_EOT|ST_EOF); + dev->block_num -= num; + dev->state &= ~(ST_EOF|ST_EOT|ST_EOF); mt_com.mt_op = MTBSR; mt_com.mt_count = num; - stat = ioctl(fd, MTIOCTOP, (char *)&mt_com); + stat = ioctl(dev->fd, MTIOCTOP, (char *)&mt_com); if (stat < 0) { berrno be; - clrerror_dev(this, MTBSR); - Mmsg2(errmsg, _("ioctl MTBSR error on %s. ERR=%s.\n"), - print_name(), be.strerror()); + clrerror_dev(dev, MTBSR); + Mmsg2(dev->errmsg, _("ioctl MTBSR error on %s. ERR=%s.\n"), + dev->print_name(), be.strerror()); } - update_pos_dev(this); + update_pos_dev(dev); return stat == 0; } @@ -1435,58 +1438,59 @@ bool DEVICE::bsr(int num) * Returns: false on failure * true on success */ -bool DEVICE::reposition(uint32_t rfile, uint32_t rblock) +bool +reposition_dev(DEVICE *dev, uint32_t file, uint32_t block) { - if (fd < 0) { - dev_errno = EBADF; - Mmsg0(errmsg, _("Bad call to reposition. Device not open\n")); - Emsg0(M_FATAL, 0, errmsg); + if (dev->fd < 0) { + dev->dev_errno = EBADF; + Mmsg0(dev->errmsg, _("Bad call to reposition_dev. Device not open\n")); + Emsg0(M_FATAL, 0, dev->errmsg); return false; } - if (!is_tape()) { - off_t pos = (((off_t)rfile)<<32) + (off_t)rblock; + if (!dev->is_tape()) { + off_t pos = (((off_t)file)<<32) + (off_t)block; Dmsg1(100, "===== lseek_dev to %d\n", (int)pos); - if (lseek_dev(this, pos, SEEK_SET) == (off_t)-1) { + if (lseek_dev(dev, pos, SEEK_SET) == (off_t)-1) { berrno be; - dev_errno = errno; - Mmsg2(errmsg, _("lseek_dev error on %s. ERR=%s.\n"), - print_name(), be.strerror()); + dev->dev_errno = errno; + Mmsg2(dev->errmsg, _("lseek_dev error on %s. ERR=%s.\n"), + dev->print_name(), be.strerror()); return false; } - file = rfile; - block_num = rblock; - file_addr = pos; + dev->file = file; + dev->block_num = block; + dev->file_addr = pos; return true; } - Dmsg4(100, "reposition from %u:%u to %u:%u\n", - file, block_num, rfile, rblock); - if (rfile < file) { + Dmsg4(100, "reposition_dev from %u:%u to %u:%u\n", + dev->file, dev->block_num, file, block); + if (file < dev->file) { Dmsg0(100, "Rewind\n"); - if (!rewind(NULL)) { + if (!dev->rewind(NULL)) { return false; } } - if (rfile > file) { - Dmsg1(100, "fsf %d\n", rfile-file); - if (!fsf(rfile-file)) { - Dmsg1(100, "fsf failed! ERR=%s\n", bstrerror()); + if (file > dev->file) { + Dmsg1(100, "fsf %d\n", file-dev->file); + if (!dev->fsf(file-dev->file)) { + Dmsg1(100, "fsf failed! ERR=%s\n", strerror_dev(dev)); return false; } - Dmsg2(100, "wanted_file=%d at_file=%d\n", rfile, file); + Dmsg2(100, "wanted_file=%d at_file=%d\n", file, dev->file); } - if (rblock < block_num) { - Dmsg2(100, "wanted_blk=%d at_blk=%d\n", rblock, block_num); - Dmsg0(100, "bsf 1\n"); - bsf(1); + if (block < dev->block_num) { + Dmsg2(100, "wanted_blk=%d at_blk=%d\n", block, dev->block_num); + Dmsg0(100, "bsf_dev 1\n"); + bsf_dev(dev, 1); Dmsg0(100, "fsf_dev 1\n"); - fsf(1); - Dmsg2(100, "wanted_blk=%d at_blk=%d\n", rblock, block_num); + dev->fsf(1); + Dmsg2(100, "wanted_blk=%d at_blk=%d\n", block, dev->block_num); } - if (has_cap(CAP_POSITIONBLOCKS) && rblock > block_num) { + if (dev_cap(dev, CAP_POSITIONBLOCKS) && block > dev->block_num) { /* Ignore errors as Bacula can read to the correct block */ - Dmsg1(100, "fsr %d\n", rblock-block_num); - return fsr(rblock-block_num); + Dmsg1(100, "fsr %d\n", block-dev->block_num); + return dev->fsr(block-dev->block_num); } return true; } @@ -1541,6 +1545,18 @@ weof_dev(DEVICE *dev, int num) return stat; } +/* + * Return string message with last error in English + * Be careful not to call this routine from within dev.c + * while editing an Mmsg() or you will end up in a recursive + * loop creating a Segmentation Violation. + */ +char * +strerror_dev(DEVICE *dev) +{ + return dev->errmsg; +} + /* * If implemented in system, clear the tape @@ -1661,31 +1677,33 @@ clrerror_dev(DEVICE *dev, int func) } /* - * Close the device + * Flush buffer contents + * No longer used. */ -void DEVICE::close() +int flush_dev(DEVICE *dev) { - Dmsg1(100, "close_dev %s\n", print_name()); - if (has_cap(CAP_OFFLINEUNMOUNT)) { - offline(); - } - if (fd >= 0) { - ::close(fd); - } else { - return; /* already closed */ + return 1; +} + +static void do_close(DEVICE *dev) +{ + + Dmsg1(100, "really close_dev %s\n", dev->print_name()); + if (dev->fd >= 0) { + ::close(dev->fd); } - if (is_dvd() && !unmount_dvd(this, 1)) { - Dmsg1(0, "Cannot unmount device %s.\n", print_name()); + if (!unmount_dev(dev, 1)) { + Dmsg1(0, "Cannot unmount device %s.\n", dev->print_name()); } /* Remove the last part file if it is empty */ - if (num_parts > 0) { + if (dev->num_parts > 0) { struct stat statp; POOL_MEM archive_name(PM_FNAME); - part = num_parts; - Dmsg1(100, "Call make_dvd_filename. Vol=%s\n", VolCatInfo.VolCatName); - make_spooled_dvd_filename(this, archive_name); + dev->part = dev->num_parts; + Dmsg1(100, "Call make_dvd_filename. Vol=%s\n", dev->VolCatInfo.VolCatName); + make_spooled_dvd_filename(dev, archive_name); /* Check that the part file is empty */ if ((stat(archive_name.c_str(), &statp) == 0) && (statp.st_size == 0)) { Dmsg1(100, "unlink(%s)\n", archive_name.c_str()); @@ -1694,263 +1712,59 @@ void DEVICE::close() } /* Clean up device packet so it can be reused */ - clear_opened(); - state &= ~(ST_LABEL|ST_READ|ST_APPEND|ST_EOT|ST_WEOT|ST_EOF); - label_type = B_BACULA_LABEL; - file = block_num = 0; - file_size = 0; - file_addr = 0; - part = 0; - num_parts = 0; - part_size = 0; - part_start = 0; - EndFile = EndBlock = 0; - memset(&VolCatInfo, 0, sizeof(VolCatInfo)); - free_volume(this); - memset(&VolHdr, 0, sizeof(VolHdr)); - if (tid) { - stop_thread_timer(tid); - tid = 0; - } - openmode = 0; + dev->clear_opened(); + dev->state &= ~(ST_LABEL|ST_READ|ST_APPEND|ST_EOT|ST_WEOT|ST_EOF); + dev->label_type = B_BACULA_LABEL; + dev->file = dev->block_num = 0; + dev->file_size = 0; + dev->file_addr = 0; + dev->part = 0; + dev->num_parts = 0; + dev->part_size = 0; + dev->part_start = 0; + dev->EndFile = dev->EndBlock = 0; + free_volume(dev); + memset(&dev->VolCatInfo, 0, sizeof(dev->VolCatInfo)); + memset(&dev->VolHdr, 0, sizeof(dev->VolHdr)); + if (dev->tid) { + stop_thread_timer(dev->tid); + dev->tid = 0; + } + dev->openmode = 0; } +/* + * Close the device + */ +void DEVICE::close() +{ + do_close(this); +} -bool DEVICE::truncate(DCR *dcr) /* We need the DCR for DVD-writing */ +bool truncate_dev(DCR *dcr) /* We need the DCR for DVD-writing */ { - Dmsg1(100, "truncate_dev %s\n", print_name()); - if (is_tape()) { + DEVICE *dev = dcr->dev; + + Dmsg1(100, "truncate_dev %s\n", dev->print_name()); + if (dev->is_tape()) { return true; /* we don't really truncate tapes */ /* maybe we should rewind and write and eof ???? */ } - if (is_dvd()) { - return truncate_dvd(dcr); + if (dev->is_dvd()) { + return truncate_dvd_dev(dcr); } - if (ftruncate(fd, 0) != 0) { + if (ftruncate(dev->fd, 0) != 0) { berrno be; - Mmsg2(errmsg, _("Unable to truncate device %s. ERR=%s\n"), - print_name(), be.strerror()); - return false; - } - return true; -} - -/* Mount the device. - * If timeout, wait until the mount command returns 0. - * If !timeout, try to mount the device only once. - */ -bool DEVICE::mount(int timeout) -{ - Dmsg0(90, "Enter mount\n"); - if (is_mounted()) { - return true; - } else if (requires_mount()) { - return do_mount(1, timeout); - } - return true; -} - -/* Unmount the device - * If timeout, wait until the unmount command returns 0. - * If !timeout, try to unmount the device only once. - */ -bool DEVICE::unmount(int timeout) -{ - Dmsg0(90, "Enter unmount_dvd\n"); - if (is_mounted()) { - return do_mount(0, timeout); - } - return true; -} - -/* (Un)mount the device */ -bool DEVICE::do_mount(int mount, int dotimeout) -{ - POOL_MEM ocmd(PM_FNAME); - POOLMEM *results; - char *icmd; - int status, timeout; - - sm_check(__FILE__, __LINE__, false); - if (mount) { - if (is_mounted()) { - Dmsg0(200, "======= mount=1\n"); - return true; - } - icmd = device->mount_command; - } else { - if (!is_mounted()) { - Dmsg0(200, "======= mount=0\n"); - return true; - } - icmd = device->unmount_command; - } - - edit_mount_codes(ocmd, icmd); - - Dmsg2(000, "do_mount_dvd: cmd=%s mounted=%d\n", ocmd.c_str(), !!is_mounted()); - - if (dotimeout) { - /* Try at most 1 time to (un)mount the device. This should perhaps be configurable. */ - timeout = 1; - } else { - timeout = 0; - } - results = get_memory(2000); - results[0] = 0; - /* If busy retry each second */ - while ((status = run_program_full_output(ocmd.c_str(), - max_open_wait/2, results)) != 0) { - /* Doesn't work with internationalisation (This is not a problem) */ - if (fnmatch("*is already mounted on", results, 0) == 0) { - break; - } - if (timeout-- > 0) { - /* Sometimes the device cannot be mounted because it is already mounted. - * Try to unmount it, then remount it */ - if (mount) { - Dmsg1(400, "Trying to unmount the device %s...\n", print_name()); - do_mount(0, 0); - } - bmicrosleep(1, 0); - continue; - } - Dmsg2(40, "Device %s cannot be mounted. ERR=%s\n", print_name(), results); - Mmsg(errmsg, _("Device %s cannot be mounted. ERR=%s\n"), - print_name(), results); - /* - * Now, just to be sure it is not mounted, try to read the - * filesystem. - */ - DIR* dp; - struct dirent *entry, *result; - int name_max; - int count; - - name_max = pathconf(".", _PC_NAME_MAX); - if (name_max < 1024) { - name_max = 1024; - } - - if (!(dp = opendir(device->mount_point))) { - berrno be; - dev_errno = errno; - Dmsg3(29, "do_mount: failed to open dir %s (dev=%s), ERR=%s\n", - device->mount_point, print_name(), be.strerror()); - goto get_out; - } - - entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 1000); - count = 0; - while (1) { - if ((readdir_r(dp, entry, &result) != 0) || (result == NULL)) { - dev_errno = EIO; - Dmsg2(129, "do_mount: failed to find suitable file in dir %s (dev=%s)\n", - device->mount_point, print_name()); - break; - } - if ((strcmp(result->d_name, ".")) && (strcmp(result->d_name, "..")) && (strcmp(result->d_name, ".keep"))) { - count++; /* result->d_name != ., .. or .keep (Gentoo-specific) */ - break; - } else { - Dmsg2(129, "do_mount: ignoring %s in %s\n", result->d_name, device->mount_point); - } - } - free(entry); - closedir(dp); - - Dmsg1(29, "do_mount: got %d files in the mount point (not counting ., .. and .keep)\n", count); - - if (count > 0) { - mount = 1; /* If we got more than ., .. and .keep */ - break; /* there must be something mounted */ - } -get_out: - set_mounted(false); - sm_check(__FILE__, __LINE__, false); - free_pool_memory(results); - Dmsg0(200, "============ mount=0\n"); + Mmsg2(dev->errmsg, _("Unable to truncate device %s. ERR=%s\n"), + dev->print_name(), be.strerror()); return false; } - - set_mounted(mount); /* set/clear mounted flag */ - free_pool_memory(results); - Dmsg1(200, "============ mount=%d\n", mount); return true; } -/* - * Edit codes into (Un)MountCommand, Write(First)PartCommand - * %% = % - * %a = archive device name - * %e = erase (set if cannot mount and first part) - * %n = part number - * %m = mount point - * %v = last part name - * - * omsg = edited output message - * imsg = input string containing edit codes (%x) - * - */ -void DEVICE::edit_mount_codes(POOL_MEM &omsg, const char *imsg) -{ - const char *p; - const char *str; - char add[20]; - - POOL_MEM archive_name(PM_FNAME); - - omsg.c_str()[0] = 0; - Dmsg1(800, "edit_mount_codes: %s\n", imsg); - for (p=imsg; *p; p++) { - if (*p == '%') { - switch (*++p) { - case '%': - str = "%"; - break; - case 'a': - str = dev_name; - break; - case 'e': - if (num_parts == 0) { - str = "1"; - } else { - str = "0"; - } - break; - case 'n': - bsnprintf(add, sizeof(add), "%d", part); - str = add; - break; - case 'm': - str = device->mount_point; - break; - case 'v': - make_spooled_dvd_filename(this, archive_name); - str = archive_name.c_str(); - break; - default: - add[0] = '%'; - add[1] = *p; - add[2] = 0; - str = add; - break; - } - } else { - add[0] = *p; - add[1] = 0; - str = add; - } - Dmsg1(1900, "add_str %s\n", str); - pm_strcat(omsg, (char *)str); - Dmsg1(1800, "omsg=%s\n", omsg.c_str()); - } -} - - /* Return the resource name for the device */ const char *DEVICE::name() const { @@ -1978,35 +1792,41 @@ uint32_t dev_file(DEVICE *dev) /* * Free memory allocated for the device */ -void DEVICE::term(void) +void +term_dev(DEVICE *dev) { - Dmsg1(900, "term dev: %s\n", print_name()); - close(); - if (dev_name) { - free_memory(dev_name); - dev_name = NULL; - } - if (prt_name) { - free_memory(prt_name); - prt_name = NULL; - } - if (errmsg) { - free_pool_memory(errmsg); - errmsg = NULL; - } - pthread_mutex_destroy(&mutex); - pthread_cond_destroy(&wait); - pthread_cond_destroy(&wait_next_vol); - pthread_mutex_destroy(&spool_mutex); - rwl_destroy(&lock); - if (attached_dcrs) { - delete attached_dcrs; - attached_dcrs = NULL; - } - if (device) { - device->dev = NULL; - } - free((char *)this); + if (!dev) { + dev->dev_errno = EBADF; + Mmsg0(dev->errmsg, _("Bad call to term_dev. Device not open\n")); + Emsg0(M_FATAL, 0, dev->errmsg); + return; + } + Dmsg1(29, "term_dev: %s\n", dev->print_name()); + do_close(dev); + if (dev->dev_name) { + free_memory(dev->dev_name); + dev->dev_name = NULL; + } + if (dev->prt_name) { + free_memory(dev->prt_name); + dev->prt_name = NULL; + } + if (dev->errmsg) { + free_pool_memory(dev->errmsg); + dev->errmsg = NULL; + } + pthread_mutex_destroy(&dev->mutex); + pthread_cond_destroy(&dev->wait); + pthread_cond_destroy(&dev->wait_next_vol); + pthread_mutex_destroy(&dev->spool_mutex); + rwl_destroy(&dev->lock); + if (dev->attached_dcrs) { + delete dev->attached_dcrs; + dev->attached_dcrs = NULL; + } + if (dev->state & ST_MALLOC) { + free_pool_memory((POOLMEM *)dev); + } } /* @@ -2082,10 +1902,10 @@ void set_os_device_parameters(DEVICE *dev) } mt_com.mt_op = MTSETDRVBUFFER; mt_com.mt_count = MT_ST_CLEARBOOLEANS; - if (!dev->has_cap(CAP_TWOEOF)) { + if (!dev_cap(dev, CAP_TWOEOF)) { mt_com.mt_count |= MT_ST_TWO_FM; } - if (dev->has_cap(CAP_EOM)) { + if (dev_cap(dev, CAP_EOM)) { mt_com.mt_count |= MT_ST_FAST_MTEOM; } if (ioctl(dev->fd, MTIOCTOP, (char *)&mt_com) < 0) { @@ -2143,7 +1963,7 @@ void set_os_device_parameters(DEVICE *dev) static bool dev_get_os_pos(DEVICE *dev, struct mtget *mt_stat) { - return dev->has_cap(CAP_MTIOCGET) && + return dev_cap(dev, CAP_MTIOCGET) && ioctl(dev->fd, MTIOCGET, (char *)mt_stat) == 0 && mt_stat->mt_fileno >= 0; } diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index 72a9607044..7d62347ff8 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -309,6 +309,8 @@ public: dev_blocked == BST_WAITING_FOR_SYSOP || dev_blocked == BST_UNMOUNTED_WAITING_FOR_SYSOP); }; bool weof() { return !weof_dev(this, 1); }; + bool fsr(int num); /* in dev.c */ + bool fsf(int num); /* in dev.c */ const char *strerror() const; const char *archive_name() const; const char *name() const; @@ -319,7 +321,7 @@ public: void set_eof() { state |= ST_EOF; }; void set_append() { state |= ST_APPEND; }; void set_labeled() { state |= ST_LABEL; }; - inline void set_read() { state |= ST_READ; }; + void set_read() { state |= ST_READ; }; void set_offline() { state |= ST_OFFLINE; }; void set_mounted() { state |= ST_MOUNTED; }; void set_media() { state |= ST_MEDIA; }; @@ -339,28 +341,14 @@ public: void clear_mounted() { state &= ~ST_MOUNTED; }; void clear_media() { state &= ~ST_MEDIA; }; void clear_short_block() { state &= ~ST_SHORT; }; - void clear_freespace_ok() { state &= ~ST_FREESPACE_OK; }; - char *bstrerror(void) { return errmsg; }; + void clear_freespace_ok() { state &= ~ST_FREESPACE_OK; } - void block(int why); /* in dev.c */ - void unblock(); /* in dev.c */ - void close(); /* in dev.c */ - bool truncate(DCR *dcr); /* in dev.c */ + void block(int why); /* in dev.c */ + void unblock(); /* in dev.c */ + void close(); /* in dev.c */ int open(DCR *dcr, int mode); /* in dev.c */ - void term(void); /* in dev.c */ - bool rewind(DCR *dcr); /* in dev.c */ - bool mount(int timeout); /* in dev.c */ - bool unmount(int timeout); /* in dev.c */ - void edit_mount_codes(POOL_MEM &omsg, const char *imsg); /* in dev.c */ - bool offline_or_rewind(); /* in dev.c */ - bool offline(); /* in dev.c */ - bool bsf(int count); /* in dev.c */ - bool eod(); /* in dev.c */ - bool fsr(int num); /* in dev.c */ - bool fsf(int num); /* in dev.c */ - bool bsr(int num); /* in dev.c */ - bool scan_dir_for_volume(DCR *dcr); /* in scan.c */ - bool reposition(uint32_t rfile, uint32_t rblock); /* in dev.c */ + bool rewind(DCR *dcr); /* in dev.c */ + void set_blocked(int block) { dev_blocked = block; }; int get_blocked() const { return dev_blocked; }; @@ -368,12 +356,11 @@ public: bool is_blocked() const { return dev_blocked != BST_NOT_BLOCKED; }; private: - bool do_mount(int mount, int timeout); /* in dev.c */ - void set_mode(int omode); /* in dev.c */ + void set_mode(int omode); /* in dev.c */ void open_tape_device(DCR *dcr, int omode); /* in dev.c */ - void open_file_device(DCR *dcr, int omode); /* in dev.c */ - void open_dvd_device(DCR *dcr, int omode); /* in dev.c */ - void set_blocking(); /* in dev.c */ + void open_file_device(int omode); /* in dev.c */ + void open_dvd_device(DCR *dcr, int omode); /* in dev.c */ + void set_blocking(); /* in dev.c */ }; diff --git a/bacula/src/stored/device.c b/bacula/src/stored/device.c index 30f6c403f6..c7407d5d24 100644 --- a/bacula/src/stored/device.c +++ b/bacula/src/stored/device.c @@ -291,17 +291,38 @@ bool open_device(DCR *dcr) /* If polling, ignore the error */ /* If DVD, also ignore the error, very often you cannot open the device * (when there is no DVD, or when the one inserted is a wrong one) */ - if (!dev->poll && !dev->is_dvd() && !dev->is_removable()) { + if ((!dev->poll) && (!dev->is_dvd())) { Jmsg2(dcr->jcr, M_FATAL, 0, _("Unable to open device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); Pmsg2(000, _("Unable to open archive %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); } return false; } return true; } +/* + * Release any Volume attached to this device + * then close the device. + */ +void close_device(DEVICE *dev) +{ + free_volume(dev); + dev->close(); +} + +/* + */ +void force_close_device(DEVICE *dev) +{ + if (!dev || dev->fd < 0) { + return; + } + Dmsg1(29, "Force close_dev %s\n", dev->print_name()); + free_volume(dev); + dev->close(); +} void dev_lock(DEVICE *dev) diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index a371688fe3..10c3a20590 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -20,7 +20,7 @@ * */ /* - Copyright (C) 2001-2006 Kern Sibbald + Copyright (C) 2001-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -71,7 +71,6 @@ static bool setdebug_cmd(JCR *jcr); static bool cancel_cmd(JCR *cjcr); static bool mount_cmd(JCR *jcr); static bool unmount_cmd(JCR *jcr); -static bool bootstrap_cmd(JCR *jcr); static bool changer_cmd(JCR *sjcr); static bool do_label(JCR *jcr, int relabel); static DCR *find_device(JCR *jcr, POOL_MEM &dev_name, int drive); @@ -192,7 +191,7 @@ void *handle_connection_request(void *arg) if ((bnet_stat = bnet_recv(bs)) <= 0) { break; /* connection terminated */ } - Dmsg1(199, "msg); + Dmsg1(199, "msg); /* Ensure that device initialization is complete */ while (!init_done) { bmicrosleep(1, 0); @@ -262,13 +261,13 @@ static bool cancel_cmd(JCR *cjcr) if (!(jcr=get_jcr_by_full_name(Job))) { bnet_fsend(dir, _("3904 Job %s not found.\n"), Job); } else { - P(jcr->mutex); + jcr->lock(); oldStatus = jcr->JobStatus; set_jcr_job_status(jcr, JS_Canceled); if (!jcr->authenticated && oldStatus == JS_WaitFD) { pthread_cond_signal(&jcr->job_start_wait); /* wake waiting thread */ } - V(jcr->mutex); + jcr->unlock(); if (jcr->file_bsock) { bnet_sig(jcr->file_bsock, BNET_TERMINATE); } @@ -345,9 +344,9 @@ static bool do_label(JCR *jcr, int relabel) dev = dcr->dev; P(dev->mutex); /* Use P to avoid indefinite block */ if (!dev->is_open()) { - Dmsg1(400, "Can %slabel. Device is not open\n", relabel?"re":""); + Dmsg0(400, "Can relabel. Device is not open\n"); label_volume_if_ok(dcr, oldname, newname, poolname, slot, relabel); - dev->close(); + force_close_device(dev); /* Under certain "safe" conditions, we can steal the lock */ } else if (dev->can_steal_lock()) { Dmsg0(400, "Can relabel. can_steal_lock\n"); @@ -391,27 +390,15 @@ static void label_volume_if_ok(DCR *dcr, char *oldname, bsteal_lock_t hold; DEVICE *dev = dcr->dev; int label_status; - int mode; steal_device_lock(dev, &hold, BST_WRITING_LABEL); Dmsg1(100, "Stole device %s lock, writing label.\n", dev->print_name()); + /* Note, try_autoload_device() opens the device */ if (!try_autoload_device(dcr->jcr, slot, newname)) { goto bail_out; /* error */ } - /* Ensure that the device is open -- autoload_device() closes it */ - if (dev->is_tape()) { - mode = OPEN_READ_WRITE; - } else { - mode = CREATE_READ_WRITE; - } - if (dev->open(dcr, mode) < 0) { - bnet_fsend(dir, _("3910 Unable to open device %s: ERR=%s\n"), - dev->print_name(), dev->strerror()); - return; - } - /* See what we have for a Volume */ label_status = read_dev_volume_label(dcr); @@ -441,7 +428,7 @@ static void label_volume_if_ok(DCR *dcr, char *oldname, case VOL_IO_ERROR: case VOL_NO_LABEL: if (!write_new_volume_label_to_dev(dcr, newname, poolname)) { - bnet_fsend(dir, _("3912 Failed to label Volume: ERR=%s\n"), dev->bstrerror()); + bnet_fsend(dir, _("3912 Failed to label Volume: ERR=%s\n"), strerror_dev(dev)); break; } bstrncpy(dcr->VolumeName, newname, sizeof(dcr->VolumeName)); @@ -450,7 +437,7 @@ static void label_volume_if_ok(DCR *dcr, char *oldname, newname, dev->print_name()); break; case VOL_NO_MEDIA: - bnet_fsend(dir, _("3912 Failed to label Volume: ERR=%s\n"), dev->bstrerror()); + bnet_fsend(dir, _("3912 Failed to label Volume: ERR=%s\n"), strerror_dev(dev)); break; default: bnet_fsend(dir, _("3913 Cannot label Volume. " @@ -528,42 +515,40 @@ static DCR *find_device(JCR *jcr, POOL_MEM &devname, int drive) break; } } - if (!found) { - foreach_res(changer, R_AUTOCHANGER) { - /* Find resource, and make sure we were able to open it */ - if (fnmatch(devname.c_str(), changer->hdr.name, 0) == 0) { - /* Try each device in this AutoChanger */ - foreach_alist(device, changer->device) { - Dmsg1(100, "Try changer device %s\n", device->hdr.name); - if (!device->dev) { - device->dev = init_dev(jcr, device); - } - if (!device->dev) { - Dmsg1(100, "Device %s could not be opened. Skipped\n", devname.c_str()); - Jmsg(jcr, M_WARNING, 0, _("\n" - " Device \"%s\" in changer \"%s\" requested by DIR could not be opened or does not exist.\n"), - device->hdr.name, devname.c_str()); - continue; - } - if (!device->dev->autoselect) { - Dmsg1(100, "Device %s not autoselect skipped.\n", devname.c_str()); - continue; /* device is not available */ - } - if (drive < 0 || drive == (int)device->dev->drive_index) { - Dmsg1(20, "Found changer device %s\n", device->hdr.name); - found = true; - break; - } - Dmsg3(100, "Device %s drive wrong: want=%d got=%d skipping\n", - devname.c_str(), drive, (int)device->dev->drive_index); + foreach_res(changer, R_AUTOCHANGER) { + /* Find resource, and make sure we were able to open it */ + if (fnmatch(devname.c_str(), changer->hdr.name, 0) == 0) { + /* Try each device in this AutoChanger */ + foreach_alist(device, changer->device) { + Dmsg1(100, "Try changer device %s\n", device->hdr.name); + if (!device->dev) { + device->dev = init_dev(jcr, device); + } + if (!device->dev) { + Dmsg1(100, "Device %s could not be opened. Skipped\n", devname.c_str()); + Jmsg(jcr, M_WARNING, 0, _("\n" + " Device \"%s\" in changer \"%s\" requested by DIR could not be opened or does not exist.\n"), + device->hdr.name, devname.c_str()); + continue; } - break; /* we found it but could not open a device */ + if (!device->dev->autoselect) { + Dmsg1(100, "Device %s not autoselect skipped.\n", devname.c_str()); + continue; /* device is not available */ + } + if (drive < 0 || drive == (int)device->dev->drive_index) { + Dmsg1(20, "Found changer device %s\n", device->hdr.name); + found = true; + break; + } + Dmsg3(100, "Device %s drive wrong: want=%d got=%d skipping\n", + devname.c_str(), drive, (int)device->dev->drive_index); } + break; /* we found it but could not open a device */ } } if (found) { - Dmsg1(100, "Found device %s\n", device->hdr.name); + Dmsg1(100, "Found changer device %s\n", device->hdr.name); dcr = new_dcr(jcr, device->dev); dcr->device = device; jcr->dcr = dcr; @@ -606,7 +591,7 @@ static bool mount_cmd(JCR *jcr) /* We freed the device, so reopen it and wake any waiting threads */ if (dev->open(dcr, OPEN_READ_ONLY) < 0) { bnet_fsend(dir, _("3901 open device failed: ERR=%s\n"), - dev->bstrerror()); + strerror_dev(dev)); if (dev->dev_blocked == BST_UNMOUNTED) { /* We blocked the device, so unblock it */ Dmsg0(100, "Unmounted. Unblocking device\n"); @@ -659,7 +644,7 @@ static bool mount_cmd(JCR *jcr) } else if (dev->is_tape()) { if (dev->open(dcr, OPEN_READ_ONLY) < 0) { bnet_fsend(dir, _("3901 open device failed: ERR=%s\n"), - dev->bstrerror()); + strerror_dev(dev)); break; } read_label(dcr); @@ -672,11 +657,11 @@ static bool mount_cmd(JCR *jcr) dev->print_name()); } } else if (dev->is_dvd()) { - if (mount_dvd(dev, 1)) { + if (mount_dev(dev, 1)) { bnet_fsend(dir, _("3002 Device %s is mounted.\n"), dev->print_name()); } else { - bnet_fsend(dir, _("3907 %s"), dev->bstrerror()); + bnet_fsend(dir, _("3907 %s"), strerror_dev(dev)); } } else { /* must be file */ bnet_fsend(dir, _("3906 File device %s is always mounted.\n"), @@ -730,7 +715,8 @@ static bool unmount_cmd(JCR *jcr) Dmsg2(90, "%d waiter dev_block=%d. doing unmount\n", dev->num_waiting, dev->dev_blocked); if (!unload_autochanger(jcr->dcr, -1)) { - dev->close(); + offline_or_rewind_dev(dev); + force_close_device(dev); } dev->dev_blocked = BST_UNMOUNTED_WAITING_FOR_SYSOP; bnet_fsend(dir, _("3001 Device %s unmounted.\n"), @@ -757,7 +743,8 @@ static bool unmount_cmd(JCR *jcr) dev->dev_blocked = BST_UNMOUNTED; dev->no_wait_id = 0; if (!unload_autochanger(jcr->dcr, -1)) { - dev->close(); + offline_or_rewind_dev(dev); + force_close_device(dev); } bnet_fsend(dir, _("3002 Device %s unmounted.\n"), dev->print_name()); @@ -841,10 +828,6 @@ static bool release_cmd(JCR *jcr) } -static bool bootstrap_cmd(JCR *jcr) -{ - return get_bootstrap_file(jcr, jcr->dir_bsock); -} /* * Autochanger command from Director @@ -873,7 +856,7 @@ static bool changer_cmd(JCR *jcr) if (dcr) { dev = dcr->dev; P(dev->mutex); /* Use P to avoid indefinite block */ - if (!dev->device->changer_res) { + if (!dev->device->changer_res) { bnet_fsend(dir, _("3995 Device %s is not an autochanger.\n"), dev->print_name()); /* Under certain "safe" conditions, we can steal the lock */ @@ -919,7 +902,7 @@ static bool readlabel_cmd(JCR *jcr) P(dev->mutex); /* Use P to avoid indefinite block */ if (!dev->is_open()) { read_volume_label(jcr, dev, Slot); - dev->close(); + force_close_device(dev); /* Under certain "safe" conditions, we can steal the lock */ } else if (dev->can_steal_lock()) { read_volume_label(jcr, dev, Slot); @@ -942,7 +925,6 @@ static bool readlabel_cmd(JCR *jcr) return true; } - /* * Read the tape label * @@ -983,6 +965,7 @@ static bool try_autoload_device(JCR *jcr, int slot, const char *VolName) { DCR *dcr = jcr->dcr; BSOCK *dir = jcr->dir_bsock; + DEVICE *dev = dcr->dev; bstrncpy(dcr->VolumeName, VolName, sizeof(dcr->VolumeName)); dcr->VolCatInfo.Slot = slot; @@ -990,6 +973,13 @@ static bool try_autoload_device(JCR *jcr, int slot, const char *VolName) if (autoload_device(dcr, 0, dir) < 0) { /* autoload if possible */ return false; } + + /* Ensure that the device is open -- autoload_device() closes it */ + if (dev->open(dcr, OPEN_READ_WRITE) < 0) { + bnet_fsend(dir, _("3910 Unable to open device %s: ERR=%s\n"), + dev->print_name(), dev->strerror()); + return false; + } return true; } diff --git a/bacula/src/stored/dvd.c b/bacula/src/stored/dvd.c index 8284256911..417cf5fcec 100644 --- a/bacula/src/stored/dvd.c +++ b/bacula/src/stored/dvd.c @@ -8,7 +8,7 @@ * Version $Id$ */ /* - Copyright (C) 2005-2006 Kern Sibbald + Copyright (C) 2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -26,7 +26,8 @@ #include "stored.h" /* Forward referenced functions */ -static bool do_mount_dvd(DEVICE* dev, int mount, int dotimeout); +static void edit_device_codes_dev(DEVICE *dev, POOL_MEM &omsg, const char *imsg); +static bool do_mount_dev(DEVICE* dev, int mount, int dotimeout); static void add_file_and_part_name(DEVICE *dev, POOL_MEM &archive_name); /* @@ -65,20 +66,20 @@ static void add_file_and_part_name(DEVICE *dev, POOL_MEM &archive_name) bsnprintf(partnumber, sizeof(partnumber), "%d", dev->part); pm_strcat(archive_name, partnumber); } - Dmsg1(400, "Exit make_dvd_filename: arch=%s\n", archive_name.c_str()); + Dmsg1(100, "Exit make_dvd_filename: arch=%s\n", archive_name.c_str()); } /* Mount the device. * If timeout, wait until the mount command returns 0. * If !timeout, try to mount the device only once. */ -bool mount_dvd(DEVICE* dev, int timeout) +bool mount_dev(DEVICE* dev, int timeout) { - Dmsg0(90, "Enter mount_dvd\n"); + Dmsg0(90, "Enter mount_dev\n"); if (dev->is_mounted()) { return true; } else if (dev->requires_mount()) { - return do_mount_dvd(dev, 1, timeout); + return do_mount_dev(dev, 1, timeout); } return true; } @@ -87,20 +88,17 @@ bool mount_dvd(DEVICE* dev, int timeout) * If timeout, wait until the unmount command returns 0. * If !timeout, try to unmount the device only once. */ -bool unmount_dvd(DEVICE *dev, int timeout) +bool unmount_dev(DEVICE *dev, int timeout) { - if (!dev->is_dvd()) { - return true; - } - Dmsg0(90, "Enter unmount_dvd\n"); + Dmsg0(90, "Enter unmount_dev\n"); if (dev->is_mounted()) { - return do_mount_dvd(dev, 0, timeout); + return do_mount_dev(dev, 0, timeout); } return true; } /* (Un)mount the device */ -static bool do_mount_dvd(DEVICE* dev, int mount, int dotimeout) +static bool do_mount_dev(DEVICE* dev, int mount, int dotimeout) { POOL_MEM ocmd(PM_FNAME); POOLMEM *results; @@ -122,9 +120,9 @@ static bool do_mount_dvd(DEVICE* dev, int mount, int dotimeout) icmd = dev->device->unmount_command; } - dev->edit_mount_codes(ocmd, icmd); + edit_device_codes_dev(dev, ocmd, icmd); - Dmsg2(200, "do_mount_dvd: cmd=%s mounted=%d\n", ocmd.c_str(), !!dev->is_mounted()); + Dmsg2(200, "do_mount_dev: cmd=%s mounted=%d\n", ocmd.c_str(), !!dev->is_mounted()); if (dotimeout) { /* Try at most 1 time to (un)mount the device. This should perhaps be configurable. */ @@ -146,7 +144,7 @@ static bool do_mount_dvd(DEVICE* dev, int mount, int dotimeout) * Try to unmount it, then remount it */ if (mount) { Dmsg1(400, "Trying to unmount the device %s...\n", dev->print_name()); - do_mount_dvd(dev, 0, 0); + do_mount_dev(dev, 0, 0); } bmicrosleep(1, 0); continue; @@ -161,7 +159,7 @@ static bool do_mount_dvd(DEVICE* dev, int mount, int dotimeout) DIR* dp; struct dirent *entry, *result; int name_max; - int count; + int count = 0; name_max = pathconf(".", _PC_NAME_MAX); if (name_max < 1024) { @@ -171,34 +169,31 @@ static bool do_mount_dvd(DEVICE* dev, int mount, int dotimeout) if (!(dp = opendir(dev->device->mount_point))) { berrno be; dev->dev_errno = errno; - Dmsg3(29, "do_mount_dvd: failed to open dir %s (dev=%s), ERR=%s\n", + Dmsg3(29, "open_mounted_dev: failed to open dir %s (dev=%s), ERR=%s\n", dev->device->mount_point, dev->print_name(), be.strerror()); goto get_out; } entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 1000); - count = 0; while (1) { if ((readdir_r(dp, entry, &result) != 0) || (result == NULL)) { dev->dev_errno = EIO; - Dmsg2(129, "do_mount_dvd: failed to find suitable file in dir %s (dev=%s)\n", + Dmsg2(129, "open_mounted_dev: failed to find suitable file in dir %s (dev=%s)\n", dev->device->mount_point, dev->print_name()); break; } - if (strcmp(result->d_name, ".") && strcmp(result->d_name, "..") && - strcmp(result->d_name, ".keep")) { + if ((strcmp(result->d_name, ".")) && (strcmp(result->d_name, "..")) && (strcmp(result->d_name, ".keep"))) { count++; /* result->d_name != ., .. or .keep (Gentoo-specific) */ - break; } else { - Dmsg2(129, "do_mount_dvd: ignoring %s in %s\n", + Dmsg2(129, "open_mounted_dev: ignoring %s in %s\n", result->d_name, dev->device->mount_point); } } free(entry); closedir(dp); - Dmsg1(29, "do_mount_dvd: got %d files in the mount point (not counting ., .. and .keep)\n", count); + Dmsg1(29, "open_mounted_dev: got %d files in the mount point (not counting ., .. and .keep)\n", count); if (count > 0) { mount = 1; /* If we got more than ., .. and .keep */ @@ -233,7 +228,7 @@ void update_free_space_dev(DEVICE* dev) char ed1[50]; /* The device must be mounted in order to dvd-freespace to work */ - mount_dvd(dev, 1); + mount_dev(dev, 1); sm_check(__FILE__, __LINE__, false); icmd = dev->device->free_space_command; @@ -248,7 +243,7 @@ void update_free_space_dev(DEVICE* dev) return; } - dev->edit_mount_codes(ocmd, icmd); + edit_device_codes_dev(dev, ocmd, icmd); Dmsg1(29, "update_free_space_dev: cmd=%s\n", ocmd.c_str()); @@ -259,7 +254,7 @@ void update_free_space_dev(DEVICE* dev) while (1) { if (run_program_full_output(ocmd.c_str(), dev->max_open_wait/2, results) == 0) { - Dmsg1(400, "Free space program run : %s\n", results); + Dmsg1(100, "Free space program run : %s\n", results); free = str_to_int64(results); if (free >= 0) { dev->free_space = free; @@ -303,7 +298,7 @@ void update_free_space_dev(DEVICE* dev) * Write a part (Vol, Vol.1, ...) from the spool to the DVD * This routine does not update the part number, so normally, you * should call open_next_part() - * It is also called from truncate_dvd to "blank" the medium, as + * It is also called from truncate_dvd_dev to "blank" the medium, as * well as from block.c when the DVD is full to write the last part. */ bool dvd_write_part(DCR *dcr) @@ -347,7 +342,7 @@ bool dvd_write_part(DCR *dcr) Dmsg3(29, "dvd_write_part: device is %s, part is %d, is_mounted=%d\n", dev->print_name(), dev->part, dev->is_mounted()); icmd = dev->device->write_part_command; - dev->edit_mount_codes(ocmd, icmd); + edit_device_codes_dev(dev, ocmd, icmd); /* * original line follows @@ -395,7 +390,7 @@ bool dvd_write_part(DCR *dcr) /* growisofs umounted the device, so remount it (it will update the free space) */ dev->clear_mounted(); - mount_dvd(dev, 1); + mount_dev(dev, 1); Jmsg(dcr->jcr, M_INFO, 0, _("Remaining free space %s on %s\n"), edit_uint64_with_commas(dev->free_space, ed1), dev->print_name()); sm_check(__FILE__, __LINE__, false); @@ -472,7 +467,7 @@ int dvd_open_next_part(DCR *dcr) } } - Dmsg2(400, "num_parts=%d part=%d\n", dev->num_parts, dev->part); + Dmsg2(100, "num_parts=%d part=%d\n", dev->num_parts, dev->part); dev->VolCatInfo.VolCatParts = dev->part; make_spooled_dvd_filename(dev, archive_name); /* makes spool name */ @@ -497,11 +492,11 @@ int dvd_open_next_part(DCR *dcr) * think it is not needed. */ if (dev->num_parts < dev->part) { - Dmsg2(400, "Set npart=%d to part=%d\n", dev->num_parts, dev->part); + Dmsg2(100, "Set npart=%d to part=%d\n", dev->num_parts, dev->part); dev->num_parts = dev->part; dev->VolCatInfo.VolCatParts = dev->part; } - Dmsg2(400, "Call dev->open(vol=%s, mode=%d\n", dev->VolCatInfo.VolCatName, + Dmsg2(50, "Call dev->open(vol=%s, mode=%d\n", dev->VolCatInfo.VolCatName, dev->openmode); /* Open next part */ @@ -537,17 +532,17 @@ int dvd_open_first_part(DCR *dcr, int mode) dev->part_start = 0; dev->part = 0; - Dmsg2(400, "Call dev->open(vol=%s, mode=%d)\n", dcr->VolCatInfo.VolCatName, + Dmsg2(50, "Call dev->open(vol=%s, mode=%d)\n", dcr->VolCatInfo.VolCatName, mode); int append = dev->can_append(); if (dev->open(dcr, mode) < 0) { - Dmsg0(400, "open dev() failed\n"); + Dmsg0(50, "open dev() failed\n"); return -1; } if (append && (dev->part == dev->num_parts)) { /* If needed, set the append flag back */ dev->set_append(); } - Dmsg2(400, "Leave open_first_part state=%s append=%d\n", dev->is_open()?"open":"not open", dev->can_append()); + Dmsg2(50, "Leave open_first_part state=%s append=%d\n", dev->is_open()?"open":"not open", dev->can_append()); return dev->fd; } @@ -560,17 +555,17 @@ off_t lseek_dev(DEVICE *dev, off_t offset, int whence) off_t pos; char ed1[50], ed2[50]; - Dmsg3(400, "Enter lseek_dev fd=%d part=%d nparts=%d\n", dev->fd, + Dmsg3(100, "Enter lseek_dev fd=%d part=%d nparts=%d\n", dev->fd, dev->part, dev->num_parts); if (!dev->is_dvd()) { - Dmsg0(400, "Using sys lseek\n"); + Dmsg0(100, "Using sys lseek\n"); return lseek(dev->fd, offset, whence); } dcr = (DCR *)dev->attached_dcrs->first(); /* any dcr will do */ switch(whence) { case SEEK_SET: - Dmsg2(400, "lseek_dev SEEK_SET to %s (part_start=%s)\n", + Dmsg2(100, "lseek_dev SEEK_SET to %s (part_start=%s)\n", edit_uint64(offset, ed1), edit_uint64(dev->part_start, ed2)); if ((uint64_t)offset >= dev->part_start) { if (((uint64_t)offset == dev->part_start) || ((uint64_t)offset < (dev->part_start+dev->part_size))) { @@ -583,7 +578,7 @@ off_t lseek_dev(DEVICE *dev, off_t offset, int whence) } else { /* Load next part, and start again */ if (dvd_open_next_part(dcr) < 0) { - Dmsg0(400, "lseek_dev failed while trying to open the next part\n"); + Dmsg0(100, "lseek_dev failed while trying to open the next part\n"); return -1; } return lseek_dev(dev, offset, SEEK_SET); @@ -596,27 +591,27 @@ off_t lseek_dev(DEVICE *dev, off_t offset, int whence) * until the right one is loaded */ if (dvd_open_first_part(dcr, dev->openmode) < 0) { - Dmsg0(400, "lseek_dev failed while trying to open the first part\n"); + Dmsg0(100, "lseek_dev failed while trying to open the first part\n"); return -1; } return lseek_dev(dev, offset, SEEK_SET); } break; case SEEK_CUR: - Dmsg1(400, "lseek_dev SEEK_CUR to %s\n", edit_uint64(offset, ed1)); + Dmsg1(100, "lseek_dev SEEK_CUR to %s\n", edit_uint64(offset, ed1)); if ((pos = lseek(dev->fd, (off_t)0, SEEK_CUR)) < 0) { return pos; } pos += dev->part_start; if (offset == 0) { - Dmsg1(400, "lseek_dev SEEK_CUR returns %s\n", edit_uint64(pos, ed1)); + Dmsg1(100, "lseek_dev SEEK_CUR returns %s\n", edit_uint64(pos, ed1)); return pos; } else { /* Not used in Bacula, but should work */ return lseek_dev(dev, pos, SEEK_SET); } break; case SEEK_END: - Dmsg1(400, "lseek_dev SEEK_END to %s\n", edit_uint64(offset, ed1)); + Dmsg1(100, "lseek_dev SEEK_END to %s\n", edit_uint64(offset, ed1)); /* * Bacula does not use offsets for SEEK_END * Also, Bacula uses seek_end only when it wants to @@ -625,7 +620,7 @@ off_t lseek_dev(DEVICE *dev, off_t offset, int whence) * itself is read-only (as currently implemented). */ if (offset > 0) { /* Not used by bacula */ - Dmsg1(400, "lseek_dev SEEK_END called with an invalid offset %s\n", + Dmsg1(100, "lseek_dev SEEK_END called with an invalid offset %s\n", edit_uint64(offset, ed1)); errno = EINVAL; return -1; @@ -637,7 +632,7 @@ off_t lseek_dev(DEVICE *dev, off_t offset, int whence) if ((pos = lseek(dev->fd, (off_t)0, SEEK_END)) < 0) { return pos; } else { - Dmsg1(400, "lseek_dev SEEK_END returns %s\n", + Dmsg1(100, "lseek_dev SEEK_END returns %s\n", edit_uint64(pos + dev->part_start, ed1)); return pos + dev->part_start; } @@ -652,19 +647,19 @@ off_t lseek_dev(DEVICE *dev, off_t offset, int whence) int modesave = dev->openmode; /* Works because num_parts > 0. */ if (dvd_open_first_part(dcr, OPEN_READ_ONLY) < 0) { - Dmsg0(400, "lseek_dev failed while trying to open the first part\n"); + Dmsg0(100, "lseek_dev failed while trying to open the first part\n"); return -1; } if (dev->num_parts > 0) { while (dev->part < (dev->num_parts-1)) { if (dvd_open_next_part(dcr) < 0) { - Dmsg0(400, "lseek_dev failed while trying to open the next part\n"); + Dmsg0(100, "lseek_dev failed while trying to open the next part\n"); return -1; } } dev->openmode = modesave; if (dvd_open_next_part(dcr) < 0) { - Dmsg0(400, "lseek_dev failed while trying to open the next part\n"); + Dmsg0(100, "lseek_dev failed while trying to open the next part\n"); return -1; } } @@ -688,7 +683,7 @@ bool dvd_close_job(DCR *dcr) * that requires mount, it will be written to the device. */ if (dev->is_dvd() && jcr->write_part_after_job && (dev->part_size > 0)) { - Dmsg1(400, "Writing last part=%d write_partafter_job is set.\n", + Dmsg1(100, "Writing last part=%d write_partafter_job is set.\n", dev->part); if (dev->part < dev->num_parts) { Jmsg3(jcr, M_FATAL, 0, _("Error while writing, current part number is less than the total number of parts (%d/%d, device=%s)\n"), @@ -703,7 +698,7 @@ bool dvd_close_job(DCR *dcr) update the part number. */ if (ok && (dvd_open_next_part(dcr) < 0)) { Jmsg2(jcr, M_FATAL, 0, _("Unable to write part %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); dev->dev_errno = EIO; ok = false; } @@ -713,7 +708,7 @@ bool dvd_close_job(DCR *dcr) return ok; } -bool truncate_dvd(DCR *dcr) { +bool truncate_dvd_dev(DCR *dcr) { DEVICE* dev = dcr->dev; /* Set num_parts to zero (on disk) */ @@ -721,17 +716,17 @@ bool truncate_dvd(DCR *dcr) { dcr->VolCatInfo.VolCatParts = 0; dev->VolCatInfo.VolCatParts = 0; - Dmsg0(400, "truncate_dvd: Opening first part (1)...\n"); + Dmsg0(100, "truncate_dvd_dev: Opening first part (1)...\n"); dev->truncating = true; if (dvd_open_first_part(dcr, OPEN_READ_WRITE) < 0) { - Dmsg0(400, "truncate_dvd: Error while opening first part (1).\n"); + Dmsg0(100, "truncate_dvd_dev: Error while opening first part (1).\n"); dev->truncating = false; return false; } dev->truncating = false; - Dmsg0(400, "truncate_dvd: Truncating...\n"); + Dmsg0(100, "truncate_dvd_dev: Truncating...\n"); /* If necessary, truncate it. */ if (ftruncate(dev->fd, 0) != 0) { @@ -745,10 +740,10 @@ bool truncate_dvd(DCR *dcr) { dev->fd = -1; dev->clear_opened(); - Dmsg0(400, "truncate_dvd: Opening first part (2)...\n"); + Dmsg0(100, "truncate_dvd_dev: Opening first part (2)...\n"); if (!dvd_write_part(dcr)) { - Dmsg0(400, "truncate_dvd: Error while writing to DVD.\n"); + Dmsg0(100, "truncate_dvd_dev: Error while writing to DVD.\n"); return false; } @@ -758,7 +753,7 @@ bool truncate_dvd(DCR *dcr) { dev->VolCatInfo.VolCatParts = 0; if (dvd_open_first_part(dcr, OPEN_READ_WRITE) < 0) { - Dmsg0(400, "truncate_dvd: Error while opening first part (2).\n"); + Dmsg0(100, "truncate_dvd_dev: Error while opening first part (2).\n"); return false; } @@ -797,7 +792,8 @@ bool check_can_write_on_non_blank_dvd(DCR *dcr) { Dmsg2(129, "check_can_write_on_non_blank_dvd: failed to find suitable file in dir %s (dev=%s)\n", dev->device->mount_point, dev->print_name()); break; - } else { + } + else { Dmsg2(99, "check_can_write_on_non_blank_dvd: found %s (versus %s)\n", result->d_name, dev->VolCatInfo.VolCatName); if (strcmp(result->d_name, dev->VolCatInfo.VolCatName) == 0) { @@ -817,7 +813,7 @@ bool check_can_write_on_non_blank_dvd(DCR *dcr) { } Dmsg2(99, "check_can_write_on_non_blank_dvd: size of %s is %d\n", filename.c_str(), filestat.st_size); - matched = filestat.st_size == 0; + matched = (filestat.st_size == 0); } } count++; @@ -828,9 +824,77 @@ bool check_can_write_on_non_blank_dvd(DCR *dcr) { Dmsg2(29, "check_can_write_on_non_blank_dvd: got %d files in the mount point (matched=%d)\n", count, matched); if (count != 3) { - /* There are more than 3 files (., .., and the volume file) */ + /* There is more than 3 files (., .., and the volume file) */ return false; } return matched; } + +/* + * Edit codes into (Un)MountCommand, Write(First)PartCommand + * %% = % + * %a = archive device name + * %e = erase (set if cannot mount and first part) + * %n = part number + * %m = mount point + * %v = last part name + * + * omsg = edited output message + * imsg = input string containing edit codes (%x) + * + */ +static void edit_device_codes_dev(DEVICE* dev, POOL_MEM &omsg, const char *imsg) +{ + const char *p; + const char *str; + char add[20]; + + POOL_MEM archive_name(PM_FNAME); + + omsg.c_str()[0] = 0; + Dmsg1(800, "edit_device_codes: %s\n", imsg); + for (p=imsg; *p; p++) { + if (*p == '%') { + switch (*++p) { + case '%': + str = "%"; + break; + case 'a': + str = dev->dev_name; + break; + case 'e': + if (dev->num_parts == 0) { + str = "1"; + } else { + str = "0"; + } + break; + case 'n': + bsnprintf(add, sizeof(add), "%d", dev->part); + str = add; + break; + case 'm': + str = dev->device->mount_point; + break; + case 'v': + make_spooled_dvd_filename(dev, archive_name); + str = archive_name.c_str(); + break; + default: + add[0] = '%'; + add[1] = *p; + add[2] = 0; + str = add; + break; + } + } else { + add[0] = *p; + add[1] = 0; + str = add; + } + Dmsg1(1900, "add_str %s\n", str); + pm_strcat(omsg, (char *)str); + Dmsg1(1800, "omsg=%s\n", omsg.c_str()); + } +} diff --git a/bacula/src/stored/fd_cmds.c b/bacula/src/stored/fd_cmds.c index aca7e3c0d4..0387f2399e 100644 --- a/bacula/src/stored/fd_cmds.c +++ b/bacula/src/stored/fd_cmds.c @@ -13,7 +13,7 @@ * */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -53,10 +53,9 @@ static bool append_end_session(JCR *jcr); static bool read_open_session(JCR *jcr); static bool read_data_cmd(JCR *jcr); static bool read_close_session(JCR *jcr); -static bool bootstrap_cmd(JCR *jcr); /* Exported function */ -bool get_bootstrap_file(JCR *jcr, BSOCK *bs); +bool bootstrap_cmd(JCR *jcr); struct s_cmds { const char *cmd; @@ -94,7 +93,7 @@ static char ERROR_bootstrap[] = "3904 Error bootstrap\n"; /* Information sent to the Director */ static char Job_start[] = "3010 Job %s start\n"; -char Job_end[] = +static char Job_end[] = "3099 Job %s end JobStatus=%d JobFiles=%d JobBytes=%s\n"; /* @@ -138,7 +137,7 @@ void run_job(JCR *jcr) for (i=0; fd_cmds[i].cmd; i++) { if (strncmp(fd_cmds[i].cmd, fd->msg, strlen(fd_cmds[i].cmd)) == 0) { found = true; /* indicate command found */ - if (!fd_cmds[i].func(jcr)) { /* do command */ + if (!fd_cmds[i].func(jcr) || job_canceled(jcr)) { /* do command */ set_jcr_job_status(jcr, JS_ErrorTerminated); quit = true; } @@ -310,13 +309,9 @@ static bool read_open_session(JCR *jcr) return true; } -static bool bootstrap_cmd(JCR *jcr) -{ - return get_bootstrap_file(jcr, jcr->file_bsock); -} - -bool get_bootstrap_file(JCR *jcr, BSOCK *sock) +bool bootstrap_cmd(JCR *jcr) { + BSOCK *fd = jcr->file_bsock; POOLMEM *fname = get_pool_memory(PM_FNAME); FILE *bs; bool ok = false; @@ -335,9 +330,9 @@ bool get_bootstrap_file(JCR *jcr, BSOCK *sock) jcr->RestoreBootstrap, strerror(errno)); goto bail_out; } - while (bnet_recv(sock) >= 0) { - Dmsg1(400, "storedmsg); - fputs(sock->msg, bs); + while (bnet_recv(fd) >= 0) { + Dmsg1(400, "storedmsg); + fputs(fd->msg, bs); } fclose(bs); jcr->bsr = parse_bsr(jcr, jcr->RestoreBootstrap); @@ -355,10 +350,10 @@ bail_out: free_pool_memory(jcr->RestoreBootstrap); jcr->RestoreBootstrap = NULL; if (!ok) { - bnet_fsend(sock, ERROR_bootstrap); + bnet_fsend(fd, ERROR_bootstrap); return false; } - return bnet_fsend(sock, OK_bootstrap); + return bnet_fsend(fd, OK_bootstrap); } diff --git a/bacula/src/stored/job.c b/bacula/src/stored/job.c index 4809fc7286..6a139c3cce 100644 --- a/bacula/src/stored/job.c +++ b/bacula/src/stored/job.c @@ -24,12 +24,13 @@ #include "bacula.h" #include "stored.h" +static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; + /* Imported variables */ extern uint32_t VolSessionTime; /* Imported functions */ extern uint32_t newVolSessionId(); -extern bool do_mac(JCR *jcr); /* Requests from the Director daemon */ static char jobcmd[] = "JobId=%d job=%127s job_name=%127s client_name=%127s " @@ -39,7 +40,7 @@ static char jobcmd[] = "JobId=%d job=%127s job_name=%127s client_name=%127s " /* Responses sent to Director daemon */ static char OKjob[] = "3000 OK Job SDid=%u SDtime=%u Authorization=%s\n"; -static char BAD_job[] = "3915 Bad Job command: %s\n"; +static char BAD_job[] = "3915 Bad Job command. stat=%d CMD: %s\n"; //static char OK_query[] = "3001 OK query\n"; //static char NO_query[] = "3918 Query failed\n"; //static char BAD_query[] = "3917 Bad query command: %s\n"; @@ -62,22 +63,22 @@ bool job_cmd(JCR *jcr) POOL_MEM job_name, client_name, job, fileset_name, fileset_md5; int JobType, level, spool_attributes, no_attributes, spool_data; int write_part_after_job, PreferMountedVols; - + int stat; JCR *ojcr; /* * Get JobId and permissions from Director */ Dmsg1(100, "msg); - if (sscanf(dir->msg, jobcmd, &JobId, job.c_str(), job_name.c_str(), + stat = sscanf(dir->msg, jobcmd, &JobId, job.c_str(), job_name.c_str(), client_name.c_str(), &JobType, &level, fileset_name.c_str(), &no_attributes, &spool_attributes, fileset_md5.c_str(), &spool_data, - &write_part_after_job, &PreferMountedVols) != 13) { + &write_part_after_job, &PreferMountedVols); + if (stat != 13) { pm_strcpy(jcr->errmsg, dir->msg); - bnet_fsend(dir, BAD_job, jcr->errmsg); + bnet_fsend(dir, BAD_job, stat, jcr->errmsg); Dmsg1(100, ">dird: %s", dir->msg); - Emsg1(M_FATAL, 0, _("Bad Job Command from Director: %s\n"), jcr->errmsg); set_jcr_job_status(jcr, JS_ErrorTerminated); return false; } @@ -142,7 +143,7 @@ bool run_cmd(JCR *jcr) case JT_COPY: case JT_ARCHIVE: jcr->authenticated = true; - do_mac(jcr); + run_job(jcr); return false; } @@ -159,14 +160,14 @@ bool run_cmd(JCR *jcr) * when he does, we will be released, unless the 30 minutes * expires. */ - P(jcr->mutex); + P(mutex); for ( ;!job_canceled(jcr); ) { - errstat = pthread_cond_timedwait(&jcr->job_start_wait, &jcr->mutex, &timeout); + errstat = pthread_cond_timedwait(&jcr->job_start_wait, &mutex, &timeout); if (errstat == 0 || errstat == ETIMEDOUT) { break; } } - V(jcr->mutex); + V(mutex); memset(jcr->sd_auth_key, 0, strlen(jcr->sd_auth_key)); @@ -215,12 +216,10 @@ void handle_filed_connection(BSOCK *fd, char *job_name) Dmsg1(110, "OK Authentication Job %s\n", jcr->Job); } - P(jcr->mutex); if (!jcr->authenticated) { set_jcr_job_status(jcr, JS_ErrorTerminated); } pthread_cond_signal(&jcr->job_start_wait); /* wake waiting job */ - V(jcr->mutex); free_jcr(jcr); return; } diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index 612c2b4b97..ee0d4fbd74 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -8,7 +8,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -71,9 +71,7 @@ int read_dev_volume_label(DCR *dcr) dev->VolHdr.VolumeName[0]?dev->VolHdr.VolumeName:"*NULL*"); if (!dev->is_open()) { - if (dev->open(dcr, OPEN_READ_ONLY) < 0) { - return VOL_IO_ERROR; - } + Emsg0(M_ABORT, 0, _("BAD call to read_dev_volume_label\n")); } if (dev->is_labeled()) { /* did we already read label? */ /* Compare Volume Names allow special wild card */ @@ -102,7 +100,7 @@ int read_dev_volume_label(DCR *dcr) if (!dev->rewind(dcr)) { Mmsg(jcr->errmsg, _("Couldn't rewind device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); Dmsg1(30, "return VOL_NO_MEDIA: %s", jcr->errmsg); return VOL_NO_MEDIA; } @@ -141,14 +139,14 @@ int read_dev_volume_label(DCR *dcr) if (!read_block_from_dev(dcr, NO_BLOCK_NUMBER_CHECK)) { Mmsg(jcr->errmsg, _("Requested Volume \"%s\" on %s is not a Bacula " "labeled Volume, because: ERR=%s"), NPRT(VolName), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); Dmsg1(30, "%s", jcr->errmsg); } else if (!read_record_from_block(block, record)) { Mmsg(jcr->errmsg, _("Could not read Volume label from block.\n")); Dmsg1(30, "%s", jcr->errmsg); } else if (!unser_volume_label(dev, record)) { Mmsg(jcr->errmsg, _("Could not unserialize Volume label: ERR=%s\n"), - dev->bstrerror()); + strerror_dev(dev)); Dmsg1(30, "%s", jcr->errmsg); } else if (strcmp(dev->VolHdr.Id, BaculaId) != 0 && strcmp(dev->VolHdr.Id, OldBaculaId) != 0) { @@ -289,6 +287,8 @@ bool write_volume_label_to_block(DCR *dcr) * after the label will be destroyed, * in fact, we write the label 5 times !!!! * + * This routine expects that open_device() was previously called. + * * This routine should be used only when labeling a blank tape. */ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName, const char *PoolName) @@ -300,16 +300,13 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName, const char *Po empty_block(dcr->block); if (dev->open(dcr, OPEN_READ_WRITE) < 0) { - /* If device is not tape, attempt to create it */ - if (dev->is_tape() || dev->open(dcr, CREATE_READ_WRITE) < 0) { - goto bail_out; - } + goto bail_out; } Dmsg1(150, "Label type=%d\n", dev->label_type); if (!dev->rewind(dcr)) { free_volume(dev); memset(&dev->VolHdr, 0, sizeof(dev->VolHdr)); - Dmsg2(30, "Bad status on %s from rewind: ERR=%s\n", dev->print_name(), dev->bstrerror()); + Dmsg2(30, "Bad status on %s from rewind: ERR=%s\n", dev->print_name(), strerror_dev(dev)); if (!forge_on) { goto bail_out; } @@ -338,7 +335,7 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName, const char *Po /* Temporarily mark in append state to enable writing */ dev->set_append(); if (!write_record_to_block(dcr->block, dcr->rec)) { - Dmsg2(30, "Bad Label write on %s: ERR=%s\n", dev->print_name(), dev->bstrerror()); + Dmsg2(30, "Bad Label write on %s: ERR=%s\n", dev->print_name(), strerror_dev(dev)); goto bail_out; } else { Dmsg2(30, "Wrote label of %d bytes to %s\n", dcr->rec->data_len, dev->print_name()); @@ -346,7 +343,7 @@ bool write_new_volume_label_to_dev(DCR *dcr, const char *VolName, const char *Po Dmsg0(99, "Call write_block_to_dev()\n"); if (!write_block_to_dev(dcr)) { - Dmsg2(30, "Bad Label write on %s: ERR=%s\n", dev->print_name(), dev->bstrerror()); + Dmsg2(30, "Bad Label write on %s: ERR=%s\n", dev->print_name(), strerror_dev(dev)); goto bail_out; } Dmsg0(99, " Wrote block to device\n"); @@ -401,12 +398,12 @@ bool rewrite_volume_label(DCR *dcr, bool recycle) if (!dev_cap(dev, CAP_STREAM)) { if (!dev->rewind(dcr)) { Jmsg2(jcr, M_WARNING, 0, _("Rewind error on device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); } if (recycle) { - if (!dev->truncate(dcr)) { + if (!truncate_dev(dcr)) { Jmsg2(jcr, M_WARNING, 0, _("Truncate error on device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); } } @@ -428,7 +425,7 @@ bool rewrite_volume_label(DCR *dcr, bool recycle) Dmsg1(200, "Attempt to write to device fd=%d.\n", dev->fd); if (!write_block_to_dev(dcr)) { Jmsg2(jcr, M_ERROR, 0, _("Unable to write device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); Dmsg0(200, "===ERROR write block to dev\n"); return false; } diff --git a/bacula/src/stored/mac.c b/bacula/src/stored/mac.c deleted file mode 100644 index aedbf100b4..0000000000 --- a/bacula/src/stored/mac.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * SD -- mac.c -- responsible for doing - * migration, archive, and copy jobs. - * - * Kern Sibbald, January MMVI - * - * Version $Id$ - */ -/* - Copyright (C) 2006 Kern Sibbald - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. - - */ - -#include "bacula.h" -#include "stored.h" - -/* Import functions */ -extern char Job_end[]; - -/* Forward referenced subroutines */ -static bool record_cb(DCR *dcr, DEV_RECORD *rec); - - -/* - * Read Data and send to File Daemon - * Returns: false on failure - * true on success - */ -bool do_mac(JCR *jcr) -{ - bool ok = true; - BSOCK *dir = jcr->dir_bsock; - const char *Type; - char ec1[50]; - DEVICE *dev; - - switch(jcr->JobType) { - case JT_MIGRATE: - Type = "Migration"; - break; - case JT_ARCHIVE: - Type = "Archive"; - break; - case JT_COPY: - Type = "Copy"; - break; - default: - Type = "Unknown"; - break; - } - - - Dmsg0(20, "Start read data.\n"); - - - create_restore_volume_list(jcr); - if (jcr->NumVolumes == 0) { - Jmsg(jcr, M_FATAL, 0, _("No Volume names found for %s.\n"), Type); - free_restore_volume_list(jcr); - return false; - } - - Dmsg3(200, "Found %d volumes names for %s. First=%s\n", jcr->NumVolumes, - jcr->VolList->VolumeName, Type); - - /* Ready device for reading */ - if (!acquire_device_for_read(jcr->read_dcr)) { - ok = false; - goto bail_out; - } - - if (!acquire_device_for_append(jcr->dcr)) { - set_jcr_job_status(jcr, JS_ErrorTerminated); - ok = false; - goto bail_out; - } - jcr->dcr->VolFirstIndex = jcr->dcr->VolLastIndex = 0; - jcr->run_time = time(NULL); - - ok = read_records(jcr->read_dcr, record_cb, mount_next_read_volume); - -bail_out: - - dev = jcr->dcr->dev; - if (ok || dev->can_write()) { - /* Flush out final partial block of this session */ - if (!write_block_to_device(jcr->dcr)) { - Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); - Dmsg0(100, _("Set ok=FALSE after write_block_to_device.\n")); - ok = false; - } - } - - - if (ok && dev->is_dvd()) { - ok = dvd_close_job(jcr->dcr); /* do DVD cleanup if any */ - } - /* Release the device -- and send final Vol info to DIR */ - release_device(jcr->dcr); - - if (!release_device(jcr->read_dcr)) { - ok = false; - } - - free_restore_volume_list(jcr); - - - if (!ok || job_canceled(jcr)) { - discard_attribute_spool(jcr); - } else { - commit_attribute_spool(jcr); - } - - dir_send_job_status(jcr); /* update director */ - - - Dmsg0(30, "Done reading.\n"); - jcr->end_time = time(NULL); - dequeue_messages(jcr); /* send any queued messages */ - if (ok) { - set_jcr_job_status(jcr, JS_Terminated); - } - generate_daemon_event(jcr, "JobEnd"); - bnet_fsend(dir, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, - edit_uint64(jcr->JobBytes, ec1)); - Dmsg4(400, Job_end, jcr->Job, jcr->JobStatus, jcr->JobFiles, ec1); - - bnet_sig(dir, BNET_EOD); /* send EOD to Director daemon */ - - return ok; -} - -/* - * Called here for each record from read_records() - * Returns: true if OK - * false if error - */ -static bool record_cb(DCR *dcr, DEV_RECORD *rec) -{ - bool ok = true; - JCR *jcr = dcr->jcr; - char buf1[100], buf2[100]; - int32_t stream; - - switch (rec->FileIndex) { - case PRE_LABEL: - case VOL_LABEL: - case EOT_LABEL: - return true; /* don't write vol labels */ - } - rec->VolSessionId = jcr->VolSessionId; - rec->VolSessionTime = jcr->VolSessionTime; - Dmsg4(850, "before writ_rec FI=%d SessId=%d Strm=%s len=%d\n", - rec->FileIndex, rec->VolSessionId, - stream_to_ascii(buf1, rec->Stream,rec->FileIndex), - rec->data_len); - - while (!write_record_to_block(jcr->dcr->block, rec)) { - Dmsg2(850, "!write_record_to_block data_len=%d rem=%d\n", rec->data_len, - rec->remainder); - if (!write_block_to_device(jcr->dcr)) { - DEVICE *dev = jcr->dcr->dev; - Dmsg2(90, "Got write_block_to_dev error on device %s. %s\n", - dev->print_name(), dev->bstrerror()); - Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); - return false; - } - } - jcr->JobBytes += rec->data_len; /* increment bytes this job */ - if (rec->FileIndex > 0) { - jcr->JobFiles = rec->FileIndex; - } - Dmsg4(850, "write_record FI=%s SessId=%d Strm=%s len=%d\n", - FI_to_ascii(buf1, rec->FileIndex), rec->VolSessionId, - stream_to_ascii(buf2, rec->Stream, rec->FileIndex), rec->data_len); - - /* Send attributes and digest to Director for Catalog */ - stream = rec->Stream; - if (stream == STREAM_UNIX_ATTRIBUTES || stream == STREAM_UNIX_ATTRIBUTES_EX || - crypto_digest_stream_type(stream) != CRYPTO_DIGEST_NONE) { - if (!jcr->no_attributes) { - if (are_attributes_spooled(jcr)) { - jcr->dir_bsock->spool = true; - } - Dmsg0(850, "Send attributes to dir.\n"); - if (!dir_update_file_attributes(jcr->dcr, rec)) { - jcr->dir_bsock->spool = false; - Jmsg(jcr, M_FATAL, 0, _("Error updating file attributes. ERR=%s\n"), - bnet_strerror(jcr->dir_bsock)); - return false; - } - jcr->dir_bsock->spool = false; - } - } - - return ok; -} diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 8b86db484b..65100cdcc0 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -8,7 +8,7 @@ * Version $Id$ */ /* - Copyright (C) 2002-2006 Kern Sibbald + Copyright (C) 2002-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -26,14 +26,6 @@ #include "stored.h" /* pull in Storage Deamon headers */ static void mark_volume_not_inchanger(DCR *dcr); -static int try_autolabel(DCR *dcr); - -enum { - try_next_vol = 1, - try_read_vol, - try_error, - try_default -}; /* * If release is set, we rewind the current volume, @@ -55,10 +47,8 @@ bool mount_next_write_volume(DCR *dcr, bool release) DEVICE *dev = dcr->dev; JCR *jcr = dcr->jcr; DEV_BLOCK *block = dcr->block; - int mode; - Dmsg2(150, "Enter mount_next_volume(release=%d) dev=%s\n", release, - dev->print_name()); + Dmsg1(150, "Enter mount_next_volume(release=%d)\n", release); init_device_wait_timers(dcr); @@ -133,12 +123,12 @@ mount_next_vol: * and read the label. If there is no tape in the drive, * we will err, recurse and ask the operator the next time. */ - if (!release && dev->is_tape() && dev->has_cap(CAP_AUTOMOUNT)) { + if (!release && dev->is_tape() && dev_cap(dev, CAP_AUTOMOUNT)) { Dmsg0(150, "(1)Ask=0\n"); ask = false; /* don't ask SYSOP this time */ } /* Don't ask if not removable */ - if (!dev->is_removable()) { + if (!dev_cap(dev, CAP_REM)) { Dmsg0(150, "(2)Ask=0\n"); ask = false; } @@ -154,30 +144,15 @@ mount_next_vol: } Dmsg1(150, "want vol=%s\n", dcr->VolumeName); - if (dev->poll && dev->has_cap(CAP_CLOSEONPOLL)) { - dev->close(); + if (dev->poll && dev_cap(dev, CAP_CLOSEONPOLL)) { + force_close_device(dev); } /* Ensure the device is open */ - if (dev_cap(dev, CAP_STREAM)) { - mode = OPEN_WRITE_ONLY; - } else { - mode = OPEN_READ_WRITE; - } - while (dev->open(dcr, mode) < 0) { - Dmsg0(150, "open_device failed\n"); - if (dev->is_file() && dev->is_removable()) { - Dmsg0(150, "call scan_dir_for_vol\n"); - if (dev->scan_dir_for_volume(dcr)) { - break; /* got a valid volume */ - } - } - if (try_autolabel(dcr) == try_read_vol) { - break; /* created a new volume label */ - } + if (!open_device(dcr)) { /* If DVD, ignore the error, very often you cannot open the device * (when there is no DVD, or when the one inserted is a wrong one) */ - if (dev->poll || dev->is_dvd() || dev->is_removable()) { + if ((dev->poll) || (dev->is_dvd())) { goto mount_next_vol; } else { return false; @@ -192,7 +167,7 @@ read_volume: * If we are writing to a stream device, ASSUME the volume label * is correct. */ - if (dev->has_cap(CAP_STREAM)) { + if (dev_cap(dev, CAP_STREAM)) { vol_label_status = VOL_OK; create_volume_label(dev, dcr->VolumeName, "Default"); dev->VolHdr.LabelType = PRE_LABEL; @@ -219,7 +194,7 @@ read_volume: VOLUME_CAT_INFO VolCatInfo, devVolCatInfo; /* If not removable, Volume is broken */ - if (!dev->is_removable()) { + if (!dev_cap(dev, CAP_REM)) { Jmsg(jcr, M_WARNING, 0, _("Volume \"%s\" not on device %s.\n"), dcr->VolumeName, dev->print_name()); mark_volume_in_error(dcr); @@ -230,7 +205,8 @@ read_volume: /* If polling and got a previous bad name, ignore it */ if (dev->poll && strcmp(dev->BadVolName, dev->VolHdr.VolumeName) == 0) { ask = true; - Dmsg1(200, "Vol Name error supress due to poll. Name=%s\n", dcr->VolumeName); + Dmsg1(200, "Vol Name error supress due to poll. Name=%s\n", + dcr->VolumeName); goto mount_next_vol; } /* @@ -244,19 +220,20 @@ read_volume: /* Check if this is a valid Volume in the pool */ bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName)); if (!dir_get_volume_info(dcr, GET_VOL_INFO_FOR_WRITE)) { - /* Restore desired volume name, note device info out of sync */ - /* This gets the info regardless of the Pool */ + /* Saved bad volume name */ + bstrncpy(dev->BadVolName, dev->VolHdr.VolumeName, sizeof(dev->BadVolName)); + Jmsg(jcr, M_WARNING, 0, _("Director wanted Volume \"%s\" for device %s.\n" + " Current Volume \"%s\" not acceptable because:\n" + " %s"), + VolCatInfo.VolCatName, dev->print_name(), + dev->VolHdr.VolumeName, jcr->dir_bsock->msg); + /* This gets the info regardless of the Pool so we can change chgr status */ bstrncpy(dcr->VolumeName, dev->VolHdr.VolumeName, sizeof(dcr->VolumeName)); if (autochanger && !dir_get_volume_info(dcr, GET_VOL_INFO_FOR_READ)) { mark_volume_not_inchanger(dcr); } + /* Restore original info */ memcpy(&dev->VolCatInfo, &devVolCatInfo, sizeof(dev->VolCatInfo)); - bstrncpy(dev->BadVolName, dev->VolHdr.VolumeName, sizeof(dev->BadVolName)); - Jmsg(jcr, M_WARNING, 0, _("Director wanted Volume \"%s\".\n" - " Current Volume \"%s\" not acceptable because:\n" - " %s"), - VolCatInfo.VolCatName, dev->VolHdr.VolumeName, - jcr->dir_bsock->msg); ask = true; goto mount_next_vol; } @@ -278,17 +255,49 @@ read_volume: } /* Fall through wanted */ case VOL_NO_LABEL: - switch (try_autolabel(dcr)) { - case try_next_vol: + /* + * If permitted, we label the device, make sure we can do + * it by checking that the VolCatBytes is zero => not labeled, + * once the Volume is labeled we don't want to label another + * blank tape with the same name. For disk, we go ahead and + * label it anyway, because the OS insures that there is only + * one Volume with that name. + * As noted above, at this point dcr->VolCatInfo has what + * the Director wants and dev->VolCatInfo has info on the + * previous tape (or nothing). + */ + if (dev_cap(dev, CAP_LABEL) && (dcr->VolCatInfo.VolCatBytes == 0 || + (!dev->is_tape() && strcmp(dcr->VolCatInfo.VolCatStatus, + "Recycle") == 0))) { + Dmsg0(150, "Create volume label\n"); + /* Create a new Volume label and write it to the device */ + if (!write_new_volume_label_to_dev(dcr, dcr->VolumeName, + dcr->pool_name)) { + Dmsg0(150, "!write_vol_label\n"); + mark_volume_in_error(dcr); + goto mount_next_vol; + } + Dmsg0(150, "dir_update_vol_info. Set Append\n"); + /* Copy Director's info into the device info */ + memcpy(&dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dev->VolCatInfo)); + if (!dir_update_volume_info(dcr, true)) { /* indicate tape labeled */ + return false; + } + Jmsg(jcr, M_INFO, 0, _("Labeled new Volume \"%s\" on device %s.\n"), + dcr->VolumeName, dev->print_name()); + goto read_volume; /* read label we just wrote */ + } + if (!dev_cap(dev, CAP_LABEL) && dcr->VolCatInfo.VolCatBytes == 0) { + Jmsg(jcr, M_INFO, 0, _("Warning device %s not configured to autolabel Volumes.\n"), + dev->print_name()); + } + /* If not removable, Volume is broken */ + if (!dev_cap(dev, CAP_REM)) { + Jmsg(jcr, M_WARNING, 0, _("Volume \"%s\" not on device %s.\n"), + dcr->VolumeName, dev->print_name()); + mark_volume_in_error(dcr); goto mount_next_vol; - case try_read_vol: - goto read_volume; - case try_error: - return false; - case try_default: - break; } - /* NOTE! Fall-through wanted. */ case VOL_NO_MEDIA: default: @@ -301,7 +310,7 @@ read_volume: ask = true; /* Needed, so the medium can be changed */ if (dev->requires_mount()) { - dev->close(); + close_device(dev); } goto mount_next_vol; } @@ -333,9 +342,9 @@ read_volume: Dmsg0(200, "Device previously written, moving to end of data\n"); Jmsg(jcr, M_INFO, 0, _("Volume \"%s\" previously written, moving to end of data.\n"), dcr->VolumeName); - if (!dev->eod()) { + if (!eod_dev(dev)) { Jmsg(jcr, M_ERROR, 0, _("Unable to position to end of data on device %s: ERR=%s\n"), - dev->print_name(), dev->bstrerror()); + dev->print_name(), strerror_dev(dev)); mark_volume_in_error(dcr); goto mount_next_vol; } @@ -395,60 +404,10 @@ read_volume: empty_block(block); /* we used it for reading so set for write */ } dev->set_append(); - Dmsg1(150, "set APPEND, normal return from mount_next_write_volume. dev=%s\n", - dev->print_name()); - + Dmsg0(150, "set APPEND, normal return from read_dev_for_append\n"); return true; } -/* - * If permitted, we label the device, make sure we can do - * it by checking that the VolCatBytes is zero => not labeled, - * once the Volume is labeled we don't want to label another - * blank tape with the same name. For disk, we go ahead and - * label it anyway, because the OS insures that there is only - * one Volume with that name. - * As noted above, at this point dcr->VolCatInfo has what - * the Director wants and dev->VolCatInfo has info on the - * previous tape (or nothing). - */ -static int try_autolabel(DCR *dcr) -{ - DEVICE *dev = dcr->dev; - if (dev->has_cap(CAP_LABEL) && (dcr->VolCatInfo.VolCatBytes == 0 || - (!dev->is_tape() && strcmp(dcr->VolCatInfo.VolCatStatus, - "Recycle") == 0))) { - Dmsg0(150, "Create volume label\n"); - /* Create a new Volume label and write it to the device */ - if (!write_new_volume_label_to_dev(dcr, dcr->VolumeName, - dcr->pool_name)) { - Dmsg0(150, "!write_vol_label\n"); - mark_volume_in_error(dcr); - return try_next_vol; - } - Dmsg0(150, "dir_update_vol_info. Set Append\n"); - /* Copy Director's info into the device info */ - memcpy(&dev->VolCatInfo, &dcr->VolCatInfo, sizeof(dev->VolCatInfo)); - if (!dir_update_volume_info(dcr, true)) { /* indicate tape labeled */ - return try_error; - } - Jmsg(dcr->jcr, M_INFO, 0, _("Labeled new Volume \"%s\" on device %s.\n"), - dcr->VolumeName, dev->print_name()); - return try_read_vol; /* read label we just wrote */ - } - if (!dev->has_cap(CAP_LABEL) && dcr->VolCatInfo.VolCatBytes == 0) { - Jmsg(dcr->jcr, M_INFO, 0, _("Warning device %s not configured to autolabel Volumes.\n"), - dev->print_name()); - } - /* If not removable, Volume is broken */ - if (!dev->is_removable()) { - Jmsg(dcr->jcr, M_WARNING, 0, _("Volume \"%s\" not on device %s.\n"), - dcr->VolumeName, dev->print_name()); - mark_volume_in_error(dcr); - return try_next_vol; - } - return try_default; -} /* @@ -512,12 +471,13 @@ void release_volume(DCR *dcr) dcr->VolumeName[0] = 0; if (dev->is_open() && (!dev->is_tape() || !dev_cap(dev, CAP_ALWAYSOPEN))) { - dev->close(); + offline_or_rewind_dev(dev); + close_device(dev); } /* If we have not closed the device, then at least rewind the tape */ if (dev->is_open()) { - dev->offline_or_rewind(); + offline_or_rewind_dev(dev); } Dmsg0(190, "release_volume\n"); } @@ -535,7 +495,8 @@ bool mount_next_read_volume(DCR *dcr) * End Of Tape -- mount next Volume (if another specified) */ if (jcr->NumVolumes > 1 && jcr->CurVolume < jcr->NumVolumes) { - dev->close(); + close_device(dev); + dev->clear_read(); if (!acquire_device_for_read(dcr)) { Jmsg2(jcr, M_FATAL, 0, _("Cannot open Dev=%s, Vol=%s\n"), dev->print_name(), dcr->VolumeName); diff --git a/bacula/src/stored/protos.h b/bacula/src/stored/protos.h index 7b7da1390e..ea2367e2b8 100644 --- a/bacula/src/stored/protos.h +++ b/bacula/src/stored/protos.h @@ -23,7 +23,7 @@ uint32_t new_VolSessionId(); /* From acquire.c */ DCR *acquire_device_for_append(DCR *dcr); -bool acquire_device_for_read(DCR *dcr); +DCR *acquire_device_for_read(DCR *dcr); bool release_device(DCR *dcr); DCR *new_dcr(JCR *jcr, DEVICE *dev); void free_dcr(DCR *dcr); @@ -91,6 +91,7 @@ void clrerror_dev(DEVICE *dev, int func); bool update_pos_dev(DEVICE *dev); bool rewind_dev(DEVICE *dev); bool load_dev(DEVICE *dev); +bool offline_dev(DEVICE *dev); int flush_dev(DEVICE *dev); int weof_dev(DEVICE *dev, int num); int write_block(DEVICE *dev); @@ -98,9 +99,12 @@ uint32_t status_dev(DEVICE *dev); bool eod_dev(DEVICE *dev); bool fsf_dev(DEVICE *dev, int num); bool bsf_dev(DEVICE *dev, int num); +bool bsr_dev(DEVICE *dev, int num); void attach_jcr_to_device(DEVICE *dev, JCR *jcr); void detach_jcr_from_device(DEVICE *dev, JCR *jcr); JCR *next_attached_jcr(DEVICE *dev, JCR *jcr); +bool offline_or_rewind_dev(DEVICE *dev); +bool reposition_dev(DEVICE *dev, uint32_t file, uint32_t block); void init_device_wait_timers(DCR *dcr); void init_jcr_device_wait_timers(JCR *jcr); bool double_dev_wait_time(DEVICE *dev); @@ -114,16 +118,18 @@ uint32_t dev_file(DEVICE *dev); int dvd_open_next_part(DCR *dcr); bool dvd_write_part(DCR *dcr); bool dvd_close_job(DCR *dcr); -bool mount_dvd(DEVICE* dev, int timeout); -bool unmount_dvd(DEVICE* dev, int timeout); +bool mount_dev(DEVICE* dev, int timeout); +bool unmount_dev(DEVICE* dev, int timeout); void update_free_space_dev(DEVICE *dev); void make_mounted_dvd_filename(DEVICE *dev, POOL_MEM &archive_name); void make_spooled_dvd_filename(DEVICE *dev, POOL_MEM &archive_name); -bool truncate_dvd(DCR *dcr); +bool truncate_dvd_dev(DCR *dcr); bool check_can_write_on_non_blank_dvd(DCR *dcr); /* From device.c */ bool open_device(DCR *dcr); +void close_device(DEVICE *dev); +void force_close_device(DEVICE *dev); bool first_open_device(DCR *dcr); bool fixup_device_block_write_error(DCR *dcr); void _lock_device(const char *file, int line, DEVICE *dev); @@ -144,7 +150,7 @@ void *handle_connection_request(void *arg); /* From fd_cmds.c */ void run_job(JCR *jcr); -bool get_bootstrap_file(JCR *jcr, BSOCK *bsock); +bool bootstrap_cmd(JCR *jcr); /* From job.c */ void stored_free_jcr(JCR *jcr); @@ -208,12 +214,16 @@ bool read_records(DCR *dcr, bool mount_cb(DCR *dcr)); /* From reserve.c */ +void init_reservations_lock(); +void term_reservations_lock(); +void lock_reservations(); +void unlock_reservations(); void release_volume(DCR *dcr); VOLRES *new_volume(DCR *dcr, const char *VolumeName); VOLRES *find_volume(const char *VolumeName); bool free_volume(DEVICE *dev); void free_unused_volume(DCR *dcr); -void init_volume_list(); +void create_volume_list(); void free_volume_list(); void list_volumes(BSOCK *user); bool is_volume_in_use(DCR *dcr); @@ -222,7 +232,6 @@ bool find_suitable_device_for_job(JCR *jcr, RCTX &rctx); int search_res_for_device(RCTX &rctx); void release_msgs(JCR *jcr); - /* From spool.c */ bool begin_data_spool (DCR *dcr); bool discard_data_spool (DCR *dcr); diff --git a/bacula/src/stored/read.c b/bacula/src/stored/read.c index 412b4a20b7..2eb3518665 100644 --- a/bacula/src/stored/read.c +++ b/bacula/src/stored/read.c @@ -6,7 +6,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -75,7 +75,7 @@ bool do_read_data(JCR *jcr) /* Send end of data to FD */ bnet_sig(fd, BNET_EOD); - if (!release_device(jcr->read_dcr)) { + if (!release_device(dcr)) { ok = false; } diff --git a/bacula/src/stored/read_record.c b/bacula/src/stored/read_record.c index f450574132..a3cdbbfbe0 100644 --- a/bacula/src/stored/read_record.c +++ b/bacula/src/stored/read_record.c @@ -14,7 +14,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -86,11 +86,6 @@ bool read_records(DCR *dcr, break; } jcr->mount_next_volume = false; - /* - * The Device can change at the end of a tape, so refresh it - * from the dcr. - */ - dev = dcr->dev; /* * We just have a new tape up, now read the label (first record) * and pass it off to the callback routine, then continue @@ -107,10 +102,10 @@ bool read_records(DCR *dcr, } else if (dev->at_eof()) { if (verbose) { - Jmsg(jcr, M_INFO, 0, _("Got EOF at file %u on device %s, Volume \"%s\"\n"), + Jmsg(jcr, M_INFO, 0, _("End of file %u on device %s, Volume \"%s\"\n"), dev->file, dev->print_name(), dcr->VolumeName); } - Dmsg3(200, "Got EOF at file %u on device %s, Volume \"%s\"\n", + Dmsg3(200, "End of file %u on device %s, Volume \"%s\"\n", dev->file, dev->print_name(), dcr->VolumeName); continue; } else if (dev->is_short_block()) { @@ -210,7 +205,7 @@ bool read_records(DCR *dcr, Dmsg2(300, "All done=(file:block) %u:%u\n", dev->file, dev->block_num); break; } else if (stat == 0) { /* no match */ - Dmsg4(300, "BSR no match: clear rem=%d FI=%d before set_eof pos %u:%u\n", + Dmsg4(300, "Clear rem=%d FI=%d before set_eof pos %u:%u\n", rec->remainder, rec->FileIndex, dev->file, dev->block_num); rec->remainder = 0; rec->state &= ~REC_PARTIAL_RECORD; @@ -228,7 +223,7 @@ bool read_records(DCR *dcr, break; /* read second part of record */ } ok = record_cb(dcr, rec); - if (crypto_digest_stream_type(rec->Stream) != CRYPTO_DIGEST_NONE) { + if (rec->Stream == STREAM_MD5_SIGNATURE || rec->Stream == STREAM_SHA1_SIGNATURE) { Dmsg3(300, "Done FI=%u before set_eof pos %u:%u\n", rec->FileIndex, dev->file, dev->block_num); if (match_set_eof(jcr->bsr, rec) && try_repositioning(jcr, rec, dev)) { @@ -285,7 +280,7 @@ static bool try_repositioning(JCR *jcr, DEV_RECORD *rec, DEVICE *dev) Dmsg4(300, "Try_Reposition from (file:block) %u:%u to %u:%u\n", dev->file, dev->block_num, bsr->volfile->sfile, bsr->volblock->sblock); - dev->reposition(bsr->volfile->sfile, bsr->volblock->sblock); + reposition_dev(dev, bsr->volfile->sfile, bsr->volblock->sblock); rec->Block = 0; } return false; @@ -309,7 +304,7 @@ static BSR *position_to_first_file(JCR *jcr, DEVICE *dev) bsr->volfile->sfile, bsr->volblock->sblock); Dmsg2(300, "Forward spacing to file:block %u:%u.\n", bsr->volfile->sfile, bsr->volblock->sblock); - dev->reposition(bsr->volfile->sfile, bsr->volblock->sblock); + reposition_dev(dev, bsr->volfile->sfile, bsr->volblock->sblock); } } return bsr; diff --git a/bacula/src/stored/record.c b/bacula/src/stored/record.c index 130a2884b7..522c50a49b 100644 --- a/bacula/src/stored/record.c +++ b/bacula/src/stored/record.c @@ -115,18 +115,6 @@ const char *stream_to_ascii(char *buf, int stream, int fi) return "SHA512"; case STREAM_SIGNED_DIGEST: return "SIGNED-DIGEST"; - case STREAM_ENCRYPTED_SESSION_DATA: - return "ENCRYPTED-SESSION-DATA"; - case STREAM_ENCRYPTED_FILE_DATA: - return "ENCRYPTED-FILE"; - case STREAM_ENCRYPTED_FILE_GZIP_DATA: - return "ENCRYPTED-GZIP"; - case STREAM_ENCRYPTED_WIN32_DATA: - return "ENCRYPTED-WIN32-DATA"; - case STREAM_ENCRYPTED_WIN32_GZIP_DATA: - return "ENCRYPTED-WIN32-GZIP"; - case STREAM_ENCRYPTED_MACOS_FORK_DATA: - return "ENCRYPTED-MACOS-RSRC"; case -STREAM_UNIX_ATTRIBUTES: return "contUATTR"; case -STREAM_FILE_DATA: @@ -161,18 +149,6 @@ const char *stream_to_ascii(char *buf, int stream, int fi) return "contSHA512"; case -STREAM_SIGNED_DIGEST: return "contSIGNED-DIGEST"; - case -STREAM_ENCRYPTED_SESSION_DATA: - return "contENCRYPTED-SESSION-DATA"; - case -STREAM_ENCRYPTED_FILE_DATA: - return "contENCRYPTED-FILE"; - case -STREAM_ENCRYPTED_FILE_GZIP_DATA: - return "contENCRYPTED-GZIP"; - case -STREAM_ENCRYPTED_WIN32_DATA: - return "contENCRYPTED-WIN32-DATA"; - case -STREAM_ENCRYPTED_WIN32_GZIP_DATA: - return "contENCRYPTED-WIN32-GZIP"; - case -STREAM_ENCRYPTED_MACOS_FORK_DATA: - return "contENCRYPTED-MACOS-RSRC"; default: sprintf(buf, "%d", stream); return buf; diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index dd38158e44..1859001811 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -26,10 +26,8 @@ #include "bacula.h" #include "stored.h" - static dlist *vol_list = NULL; static pthread_mutex_t vol_list_lock = PTHREAD_MUTEX_INITIALIZER; -static pthread_mutex_t search_lock = PTHREAD_MUTEX_INITIALIZER; /* Forward referenced functions */ static int can_reserve_drive(DCR *dcr, RCTX &rctx); @@ -67,6 +65,45 @@ static int my_compare(void *item1, void *item2) return strcmp(((VOLRES *)item1)->vol_name, ((VOLRES *)item2)->vol_name); } +static brwlock_t reservation_lock; + +void init_reservations_lock() +{ + int errstat; + if ((errstat=rwl_init(&reservation_lock)) != 0) { + berrno be; + Emsg1(M_ABORT, 0, _("Unable to initialize reservation lock. ERR=%s\n"), + be.strerror(errstat)); + } + +} + +void term_reservations_lock() +{ + rwl_destroy(&reservation_lock); +} + +/* This applies to a drive and to Volumes */ +void lock_reservations() +{ + int errstat; + if ((errstat=rwl_writelock(&reservation_lock)) != 0) { + berrno be; + Emsg2(M_ABORT, 0, "rwl_writelock failure. stat=%d: ERR=%s\n", + errstat, be.strerror(errstat)); + } +} + +void unlock_reservations() +{ + int errstat; + if ((errstat=rwl_writeunlock(&reservation_lock)) != 0) { + berrno be; + Emsg2(M_ABORT, 0, "rwl_writeunlock failure. stat=%d: ERR=%s\n", + errstat, be.strerror(errstat)); + } +} + /* * Put a new Volume entry in the Volume list. This @@ -81,6 +118,12 @@ VOLRES *new_volume(DCR *dcr, const char *VolumeName) VOLRES *vol, *nvol; Dmsg1(400, "new_volume %s\n", VolumeName); + /* + * We lock the reservations system here to ensure + * when adding a new volume that no newly scheduled + * job can reserve it. + */ + lock_reservations(); P(vol_list_lock); if (dcr->dev) { again: @@ -100,16 +143,27 @@ again: vol->vol_name = bstrdup(VolumeName); vol->dev = dcr->dev; vol->dcr = dcr; + Dmsg2(100, "New Vol=%s dev=%s\n", VolumeName, dcr->dev->print_name()); nvol = (VOLRES *)vol_list->binary_insert(vol, my_compare); if (nvol != vol) { free(vol->vol_name); free(vol); vol = NULL; if (dcr->dev) { - nvol->dev = dcr->dev; + DEVICE *dev = nvol->dev; + if (!dev->is_busy()) { + Dmsg3(100, "Swap vol=%s from dev=%s to %s\n", VolumeName, + dev->print_name(), dcr->dev->print_name()); + nvol->dev = dcr->dev; + dev->VolHdr.VolumeName[0] = 0; + } else { + Dmsg3(100, "!!!! could not swap vol=%s from dev=%s to %s\n", VolumeName, + dev->print_name(), dcr->dev->print_name()); + } } } V(vol_list_lock); + unlock_reservations(); return vol; } @@ -122,6 +176,7 @@ again: VOLRES *find_volume(const char *VolumeName) { VOLRES vol, *fvol; + /* Do not lock reservations here */ P(vol_list_lock); vol.vol_name = bstrdup(VolumeName); fvol = (VOLRES *)vol_list->binary_search(&vol, my_compare); @@ -140,8 +195,9 @@ bool free_volume(DEVICE *dev) { VOLRES vol, *fvol; - P(vol_list_lock); + P(vol_list_lock); if (dev->VolHdr.VolumeName[0] == 0) { + Dmsg1(100, "free_volume: no vol on dev %s\n", dev->print_name()); /* * Our device has no VolumeName listed, but * search the list for any Volume attached to @@ -151,6 +207,7 @@ bool free_volume(DEVICE *dev) if (fvol && fvol->dev == dev) { vol_list->remove(fvol); if (fvol->vol_name) { + Dmsg2(100, "free_volume %s dev=%s\n", fvol->vol_name, dev->print_name()); free(fvol->vol_name); } free(fvol); @@ -164,6 +221,7 @@ bool free_volume(DEVICE *dev) fvol = (VOLRES *)vol_list->binary_search(&vol, my_compare); if (fvol) { vol_list->remove(fvol); + Dmsg2(100, "free_volume %s dev=%s\n", fvol->vol_name, dev->print_name()); free(fvol->vol_name); free(fvol); } @@ -184,6 +242,7 @@ void free_unused_volume(DCR *dcr) if (vol->dcr == dcr && (vol->dev == NULL || strcmp(vol->vol_name, vol->dev->VolHdr.VolumeName) != 0)) { vol_list->remove(vol); + Dmsg1(100, "free_unused_olume %s\n", vol->vol_name); free(vol->vol_name); free(vol); break; @@ -198,6 +257,7 @@ void free_unused_volume(DCR *dcr) void list_volumes(BSOCK *user) { VOLRES *vol; + P(vol_list_lock); for (vol=(VOLRES *)vol_list->first(); vol; vol=(VOLRES *)vol_list->next(vol)) { if (vol->dev) { bnet_fsend(user, "%s on device %s\n", vol->vol_name, vol->dev->print_name()); @@ -205,10 +265,11 @@ void list_volumes(BSOCK *user) bnet_fsend(user, "%s\n", vol->vol_name); } } + V(vol_list_lock); } /* Create the Volume list */ -void init_volume_list() +void create_volume_list() { VOLRES *dummy = NULL; if (vol_list == NULL) { @@ -223,29 +284,36 @@ void free_volume_list() if (!vol_list) { return; } + P(vol_list_lock); for (vol=(VOLRES *)vol_list->first(); vol; vol=(VOLRES *)vol_list->next(vol)) { Dmsg3(000, "Unreleased Volume=%s dcr=0x%x dev=0x%x\n", vol->vol_name, vol->dcr, vol->dev); } delete vol_list; vol_list = NULL; + V(vol_list_lock); } bool is_volume_in_use(DCR *dcr) { VOLRES *vol = find_volume(dcr->VolumeName); if (!vol) { + Dmsg1(100, "Vol=%s not in use.\n", dcr->VolumeName); return false; /* vol not in list */ } if (!vol->dev) { /* vol not attached to device */ + Dmsg1(100, "Vol=%s has no dev.\n", dcr->VolumeName); return false; } if (dcr->dev == vol->dev) { /* same device OK */ + Dmsg1(100, "Vol=%s on same dev.\n", dcr->VolumeName); return false; } if (!vol->dev->is_busy()) { + Dmsg2(100, "Vol=%s dev=%s not busy.\n", dcr->VolumeName, vol->dev->print_name()); return false; } + Dmsg2(100, "Vol=%s used by %s.\n", dcr->VolumeName, vol->dev->print_name()); return true; } @@ -320,11 +388,11 @@ static bool use_storage_cmd(JCR *jcr) /* ***FIXME**** remove after 1.38 release */ char *device_name; foreach_alist(store, jcr->dirstore) { - Dmsg5(100, "Storage=%s media_type=%s pool=%s pool_type=%s append=%d\n", + Dmsg5(110, "Storage=%s media_type=%s pool=%s pool_type=%s append=%d\n", store->name, store->media_type, store->pool_name, store->pool_type, store->append); foreach_alist(device_name, store->device) { - Dmsg1(100, " Device=%s\n", device_name); + Dmsg1(110, " Device=%s\n", device_name); } } #endif @@ -341,9 +409,10 @@ static bool use_storage_cmd(JCR *jcr) */ if (ok) { bool first = true; /* print wait message once */ + bool fail = false; rctx.notify_dir = true; - for ( ; !job_canceled(jcr); ) { - P(search_lock); /* only one thread at a time */ + lock_reservations(); + for ( ; !fail && !job_canceled(jcr); ) { while ((msg = (char *)msgs->pop())) { free(msg); } @@ -357,7 +426,7 @@ static bool use_storage_cmd(JCR *jcr) rctx.PreferMountedVols = false; rctx.exact_match = false; rctx.autochanger_only = true; - Dmsg5(100, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", + Dmsg5(110, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", rctx.PreferMountedVols, rctx.exact_match, rctx.suitable_device, rctx.autochanger_only, rctx.any_drive); if ((ok = find_suitable_device_for_job(jcr, rctx))) { @@ -372,7 +441,7 @@ static bool use_storage_cmd(JCR *jcr) rctx.try_low_use_drive = false; } rctx.autochanger_only = false; - Dmsg5(100, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", + Dmsg5(110, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", rctx.PreferMountedVols, rctx.exact_match, rctx.suitable_device, rctx.autochanger_only, rctx.any_drive); if ((ok = find_suitable_device_for_job(jcr, rctx))) { @@ -383,7 +452,7 @@ static bool use_storage_cmd(JCR *jcr) rctx.PreferMountedVols = true; rctx.exact_match = true; rctx.autochanger_only = false; - Dmsg5(100, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", + Dmsg5(110, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", rctx.PreferMountedVols, rctx.exact_match, rctx.suitable_device, rctx.autochanger_only, rctx.any_drive); if ((ok = find_suitable_device_for_job(jcr, rctx))) { @@ -391,7 +460,7 @@ static bool use_storage_cmd(JCR *jcr) } /* Look for any mounted drive */ rctx.exact_match = false; - Dmsg5(100, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", + Dmsg5(110, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", rctx.PreferMountedVols, rctx.exact_match, rctx.suitable_device, rctx.autochanger_only, rctx.any_drive); if ((ok = find_suitable_device_for_job(jcr, rctx))) { @@ -399,53 +468,47 @@ static bool use_storage_cmd(JCR *jcr) } /* Try any drive */ rctx.any_drive = true; - Dmsg5(100, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", + Dmsg5(110, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", rctx.PreferMountedVols, rctx.exact_match, rctx.suitable_device, rctx.autochanger_only, rctx.any_drive); if ((ok = find_suitable_device_for_job(jcr, rctx))) { break; } - /* Unlock before possible wait */ - V(search_lock); + /* Keep reservations locked *except* during wait_for_device() */ + unlock_reservations(); if (!rctx.suitable_device || !wait_for_device(jcr, first)) { - break; /* Get out, failure ... */ + Dmsg0(100, "Fail. !suitable_device || !wait_for_device\n"); + fail = true; } + lock_reservations(); first = false; bnet_sig(dir, BNET_HEARTBEAT); /* Inform Dir that we are alive */ } - /* Note if !ok then search_lock is already cleared */ - if (ok) { - V(search_lock); - goto all_done; - } - - /* - * If we get here, there are no suitable devices available, which - * means nothing configured. If a device is suitable but busy - * with another Volume, we will not come here. - */ - if (verbose) { + unlock_reservations(); + if (!ok) { + /* + * If we get here, there are no suitable devices available, which + * means nothing configured. If a device is suitable but busy + * with another Volume, we will not come here. + */ unbash_spaces(dir->msg); pm_strcpy(jcr->errmsg, dir->msg); Jmsg(jcr, M_INFO, 0, _("Failed command: %s\n"), jcr->errmsg); - } - Jmsg(jcr, M_FATAL, 0, _("\n" - " Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD Device resources.\n"), - dev_name.c_str(), media_type.c_str()); - bnet_fsend(dir, NO_device, dev_name.c_str()); + Jmsg(jcr, M_FATAL, 0, _("\n" + " Device \"%s\" with MediaType \"%s\" requested by DIR not found in SD Device resources.\n"), + dev_name.c_str(), media_type.c_str()); + bnet_fsend(dir, NO_device, dev_name.c_str()); - Dmsg1(100, ">dird: %s", dir->msg); + Dmsg1(100, ">dird: %s", dir->msg); + } } else { unbash_spaces(dir->msg); pm_strcpy(jcr->errmsg, dir->msg); - if (verbose) { - Jmsg(jcr, M_INFO, 0, _("Failed command: %s\n"), jcr->errmsg); - } + Jmsg(jcr, M_FATAL, 0, _("Failed command: %s\n"), jcr->errmsg); bnet_fsend(dir, BAD_use, jcr->errmsg); Dmsg1(100, ">dird: %s", dir->msg); } -all_done: release_msgs(jcr); return ok; } @@ -458,13 +521,13 @@ void release_msgs(JCR *jcr) if (!msgs) { return; } - P(search_lock); + lock_reservations(); while ((msg = (char *)msgs->pop())) { free(msg); } delete msgs; jcr->reserve_msgs = NULL; - V(search_lock); + unlock_reservations(); } /* @@ -480,7 +543,7 @@ bool find_suitable_device_for_job(JCR *jcr, RCTX &rctx) * For each storage device that the user specified, we * search and see if there is a resource for that device. */ - Dmsg4(100, "PrefMnt=%d exact=%d suitable=%d chgronly=%d\n", + Dmsg4(110, "PrefMnt=%d exact=%d suitable=%d chgronly=%d\n", rctx.PreferMountedVols, rctx.exact_match, rctx.suitable_device, rctx.autochanger_only); ok = false; @@ -495,10 +558,10 @@ bool find_suitable_device_for_job(JCR *jcr, RCTX &rctx) ok = true; break; } else if (stat == 0) { /* device busy */ - Dmsg1(100, "Suitable device found=%s, not used: busy\n", device_name); + Dmsg1(110, "Suitable device found=%s, not used: busy\n", device_name); } else { /* otherwise error */ - Dmsg0(100, "No suitable device found.\n"); + Dmsg0(110, "No suitable device found.\n"); } } if (ok) { @@ -520,7 +583,7 @@ int search_res_for_device(RCTX &rctx) bool ok; int stat; - Dmsg1(100, "Search res for %s\n", rctx.device_name); + Dmsg1(110, "Search res for %s\n", rctx.device_name); /* Look through Autochangers first */ foreach_res(changer, R_AUTOCHANGER) { Dmsg1(150, "Try match changer res=%s\n", changer->hdr.name); @@ -528,7 +591,7 @@ int search_res_for_device(RCTX &rctx) if (fnmatch(rctx.device_name, changer->hdr.name, 0) == 0) { /* Try each device in this AutoChanger */ foreach_alist(rctx.device, changer->device) { - Dmsg1(100, "Try changer device %s\n", rctx.device->hdr.name); + Dmsg1(110, "Try changer device %s\n", rctx.device->hdr.name); stat = reserve_device(rctx); if (stat != 1) { /* try another device */ continue; @@ -592,7 +655,7 @@ static int reserve_device(RCTX &rctx) const int name_len = MAX_NAME_LENGTH; /* Make sure MediaType is OK */ - Dmsg2(100, "MediaType device=%s request=%s\n", + Dmsg2(110, "MediaType device=%s request=%s\n", rctx.device->media_type, rctx.store->media_type); if (strcmp(rctx.device->media_type, rctx.store->media_type) != 0) { return -1; @@ -616,7 +679,7 @@ static int reserve_device(RCTX &rctx) } rctx.suitable_device = true; - Dmsg2(100, "Try reserve %s JobId=%u\n", rctx.device->hdr.name, + Dmsg2(110, "Try reserve %s JobId=%u\n", rctx.device->hdr.name, rctx.jcr->JobId); dcr = new_dcr(rctx.jcr, rctx.device->dev); if (!dcr) { @@ -659,7 +722,7 @@ static int reserve_device(RCTX &rctx) } if (!ok) { free_dcr(dcr); - Dmsg0(100, "Not OK.\n"); + Dmsg0(110, "Not OK.\n"); return 0; } return 1; @@ -679,7 +742,10 @@ static bool reserve_device_for_read(DCR *dcr) ASSERT(dcr); + /* Get locks in correct order */ + unlock_reservations(); P(dev->mutex); + lock_reservations(); if (is_device_unmounted(dev)) { Dmsg1(200, "Device %s is BLOCKED due to user unmount.\n", dev->print_name()); @@ -741,7 +807,7 @@ static bool reserve_device_for_append(DCR *dcr, RCTX &rctx) if (dev->can_read()) { Mmsg(jcr->errmsg, _("3603 JobId=%u device %s is busy reading.\n"), jcr->JobId, dev->print_name()); - Dmsg1(100, "%s", jcr->errmsg); + Dmsg1(110, "%s", jcr->errmsg); queue_reserve_message(jcr); goto bail_out; } @@ -750,16 +816,16 @@ static bool reserve_device_for_append(DCR *dcr, RCTX &rctx) if (is_device_unmounted(dev)) { Mmsg(jcr->errmsg, _("3604 JobId=%u device %s is BLOCKED due to user unmount.\n"), jcr->JobId, dev->print_name()); - Dmsg1(100, "%s", jcr->errmsg); + Dmsg1(110, "%s", jcr->errmsg); queue_reserve_message(jcr); goto bail_out; } - Dmsg1(100, "reserve_append device is %s\n", dev->is_tape()?"tape":"disk"); + Dmsg1(110, "reserve_append device is %s\n", dev->is_tape()?"tape":"disk"); /* Now do detailed tests ... */ if (can_reserve_drive(dcr, rctx) != 1) { - Dmsg0(100, "can_reserve_drive!=1\n"); + Dmsg0(110, "can_reserve_drive!=1\n"); goto bail_out; } @@ -784,7 +850,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) DEVICE *dev = dcr->dev; JCR *jcr = dcr->jcr; - Dmsg5(100, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", + Dmsg5(110, "PrefMnt=%d exact=%d suitable=%d chgronly=%d any=%d\n", rctx.PreferMountedVols, rctx.exact_match, rctx.suitable_device, rctx.autochanger_only, rctx.any_drive); @@ -797,7 +863,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) * helps spread the load to the least used drives. */ if (rctx.try_low_use_drive && dev == rctx.low_use_drive) { - Dmsg3(100, "OK dev=%s == low_drive=%s. JobId=%u\n", + Dmsg3(110, "OK dev=%s == low_drive=%s. JobId=%u\n", dev->print_name(), rctx.low_use_drive->print_name(), jcr->JobId); return 1; } @@ -807,13 +873,13 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) if ((dev->num_writers + dev->reserved_device) < rctx.num_writers) { rctx.num_writers = dev->num_writers + dev->reserved_device; rctx.low_use_drive = dev; - Dmsg2(100, "set low use drive=%s num_writers=%d\n", dev->print_name(), + Dmsg2(110, "set low use drive=%s num_writers=%d\n", dev->print_name(), rctx.num_writers); } else { - Dmsg1(100, "not low use num_writers=%d\n", dev->num_writers+ + Dmsg1(110, "not low use num_writers=%d\n", dev->num_writers+ dev->reserved_device); } - Dmsg1(100, "failed: !prefMnt && busy. JobId=%u\n", jcr->JobId); + Dmsg1(110, "failed: !prefMnt && busy. JobId=%u\n", jcr->JobId); Mmsg(jcr->errmsg, _("3605 JobId=%u wants free drive but device %s is busy.\n"), jcr->JobId, dev->print_name()); queue_reserve_message(jcr); @@ -825,7 +891,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) Mmsg(jcr->errmsg, _("3606 JobId=%u wants mounted, but drive %s has no Volume.\n"), jcr->JobId, dev->print_name()); queue_reserve_message(jcr); - Dmsg1(100, "failed: want mounted -- no vol JobId=%u\n", jcr->JobId); + Dmsg1(110, "failed: want mounted -- no vol JobId=%u\n", jcr->JobId); return 0; /* No volume mounted */ } @@ -836,7 +902,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) jcr->JobId, rctx.VolumeName, dev->VolHdr.VolumeName, dev->print_name()); queue_reserve_message(jcr); - Dmsg2(100, "failed: Not exact match have=%s want=%s\n", + Dmsg2(110, "failed: Not exact match have=%s want=%s\n", dev->VolHdr.VolumeName, rctx.VolumeName); return 0; } @@ -871,7 +937,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) Mmsg(jcr->errmsg, _("3608 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n"), jcr->JobId, dcr->pool_name, dev->pool_name, dev->print_name()); queue_reserve_message(jcr); - Dmsg2(100, "failed: busy num_writers=0, reserved, pool=%s wanted=%s\n", + Dmsg2(110, "failed: busy num_writers=0, reserved, pool=%s wanted=%s\n", dev->pool_name, dcr->pool_name); return 0; /* wait */ } @@ -914,7 +980,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) Mmsg(jcr->errmsg, _("3609 JobId=%u wants Pool=\"%s\" but have Pool=\"%s\" on drive %s.\n"), jcr->JobId, dcr->pool_name, dev->pool_name, dev->print_name()); queue_reserve_message(jcr); - Dmsg2(100, "failed: busy num_writers>0, can_append, pool=%s wanted=%s\n", + Dmsg2(110, "failed: busy num_writers>0, can_append, pool=%s wanted=%s\n", dev->pool_name, dcr->pool_name); return 0; /* wait */ } @@ -929,7 +995,7 @@ static int can_reserve_drive(DCR *dcr, RCTX &rctx) Mmsg(jcr->errmsg, _("3911 JobId=%u failed reserve drive %s.\n"), jcr->JobId, dev->print_name()); queue_reserve_message(jcr); - Dmsg2(100, "failed: No reserve %s JobId=%u\n", dev->print_name(), jcr->JobId); + Dmsg2(110, "failed: No reserve %s JobId=%u\n", dev->print_name(), jcr->JobId); return 0; } @@ -972,10 +1038,10 @@ void send_drive_reserve_messages(JCR *jcr, BSOCK *user) alist *msgs; char *msg; - P(search_lock); + lock_reservations(); msgs = jcr->reserve_msgs; if (!msgs || msgs->size() == 0) { - V(search_lock); + unlock_reservations(); return; } for (i=msgs->size()-1; i >= 0; i--) { @@ -986,5 +1052,5 @@ void send_drive_reserve_messages(JCR *jcr, BSOCK *user) break; } } - V(search_lock); + unlock_reservations(); } diff --git a/bacula/src/stored/scan.c b/bacula/src/stored/scan.c deleted file mode 100644 index 5700ec2142..0000000000 --- a/bacula/src/stored/scan.c +++ /dev/null @@ -1,148 +0,0 @@ -/* - * - * scan.c scan a directory (on a removable file) for a valid - * Volume name. If found, open the file for append. - * - * Kern Sibbald, MMVI - * - * Version $Id$ - */ -/* - Copyright (C) 2006 Kern Sibbald - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - version 2 as amended with additional clauses defined in the - file LICENSE in the main source directory. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - the file LICENSE for additional details. - - */ - -#include "bacula.h" -#include "stored.h" - -/* Forward referenced functions */ -static bool is_volume_name_legal(char *name); - - -bool DEVICE::scan_dir_for_volume(DCR *dcr) -{ - DIR* dp; - struct dirent *entry, *result; - int name_max; - char *mount_point; - VOLUME_CAT_INFO dcrVolCatInfo, devVolCatInfo; - struct stat statp; - bool found = false; - POOL_MEM fname(PM_FNAME); - bool need_slash = false; - int len; - - - name_max = pathconf(".", _PC_NAME_MAX); - if (name_max < 1024) { - name_max = 1024; - } - - if (device->mount_point) { - mount_point = device->mount_point; - } else { - mount_point = device->device_name; - } - - if (!(dp = opendir(mount_point))) { - berrno be; - dev_errno = errno; - Dmsg3(29, "scan_dir_for_vol: failed to open dir %s (dev=%s), ERR=%s\n", - mount_point, print_name(), be.strerror()); - goto get_out; - } - - len = strlen(mount_point); - if (len > 0) { - need_slash = mount_point[len - 1] != '/'; - } - entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 1000); - for ( ;; ) { - if ((readdir_r(dp, entry, &result) != 0) || (result == NULL)) { - dev_errno = EIO; - Dmsg2(129, "scan_dir_for_vol: failed to find suitable file in dir %s (dev=%s)\n", - mount_point, print_name()); - break; - } - if (strcmp(result->d_name, ".") == 0 || - strcmp(result->d_name, "..") == 0) { - continue; - } - - if (!is_volume_name_legal(result->d_name)) { - continue; - } - pm_strcpy(fname, mount_point); - if (need_slash) { - pm_strcat(fname, "/"); - } - pm_strcat(fname, result->d_name); - if (lstat(fname.c_str(), &statp) != 0 || - !S_ISREG(statp.st_mode)) { - continue; /* ignore directories & special files */ - } - - /* - * OK, we got a different volume mounted. First save the - * requested Volume info (dcr) structure, then query if - * this volume is really OK. If not, put back the desired - * volume name, mark it not in changer and continue. - */ - memcpy(&dcrVolCatInfo, &dcr->VolCatInfo, sizeof(dcrVolCatInfo)); - memcpy(&devVolCatInfo, &VolCatInfo, sizeof(devVolCatInfo)); - /* Check if this is a valid Volume in the pool */ - bstrncpy(dcr->VolumeName, result->d_name, sizeof(dcr->VolumeName)); - if (!dir_get_volume_info(dcr, GET_VOL_INFO_FOR_WRITE)) { - continue; - } - /* This was not the volume we expected, but it is OK with - * the Director, so use it. - */ - memcpy(&VolCatInfo, &dcr->VolCatInfo, sizeof(VolCatInfo)); - found = true; - break; /* got a Volume */ - } - free(entry); - closedir(dp); - -get_out: - sm_check(__FILE__, __LINE__, false); - return found; -} - -/* - * Check if the Volume name has legal characters - * If ua is non-NULL send the message - */ -static bool is_volume_name_legal(char *name) -{ - int len; - const char *p; - const char *accept = ":.-_"; - - /* Restrict the characters permitted in the Volume name */ - for (p=name; *p; p++) { - if (B_ISALPHA(*p) || B_ISDIGIT(*p) || strchr(accept, (int)(*p))) { - continue; - } - return false; - } - len = strlen(name); - if (len >= MAX_NAME_LENGTH) { - return false; - } - if (len == 0) { - return false; - } - return true; -} diff --git a/bacula/src/stored/spool.c b/bacula/src/stored/spool.c index 9cf930447b..cd73dea27b 100644 --- a/bacula/src/stored/spool.c +++ b/bacula/src/stored/spool.c @@ -246,7 +246,7 @@ static bool despool_data(DCR *dcr, bool commit) ok = write_block_to_device(dcr); if (!ok) { Jmsg2(jcr, M_FATAL, 0, _("Fatal append error on device %s: ERR=%s\n"), - dcr->dev->print_name(), dcr->dev->bstrerror()); + dcr->dev->print_name(), strerror_dev(dcr->dev)); } Dmsg3(800, "Write block ok=%d FI=%d LI=%d\n", ok, block->FirstIndex, block->LastIndex); } diff --git a/bacula/src/stored/status.c b/bacula/src/stored/status.c index eff170455e..596bbafc14 100644 --- a/bacula/src/stored/status.c +++ b/bacula/src/stored/status.c @@ -155,7 +155,7 @@ bool status_cmd(JCR *jcr) } else { if (dev) { - bnet_fsend(user, _("Device %s is not open.\n"), dev->print_name()); + bnet_fsend(user, _("Device %s is not open or does not exist.\n"), dev->print_name()); } else { bnet_fsend(user, _("Device \"%s\" is not open or does not exist.\n"), device->hdr.name); } diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index 71d180a6bf..e0e30c1519 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -193,6 +193,8 @@ int main (int argc, char *argv[]) Jmsg((JCR *)NULL, M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile); } + init_reservations_lock(); + if (test_config) { terminate_stored(0); } @@ -228,7 +230,7 @@ int main (int argc, char *argv[]) /* * Start the device allocation thread */ - init_volume_list(); /* do before device_init */ + create_volume_list(); /* do before device_init */ if (pthread_create(&thid, NULL, device_initialization, NULL) != 0) { Emsg1(M_ABORT, 0, _("Unable to create thread. ERR=%s\n"), strerror(errno)); } @@ -449,7 +451,7 @@ void *device_initialization(void *arg) foreach_res(device, R_DEVICE) { Dmsg1(90, "calling init_dev %s\n", device->device_name); - dev = init_dev(NULL, device); + device->dev = dev = init_dev(NULL, device); Dmsg1(10, "SD init done %s\n", device->device_name); if (!dev) { Jmsg1(NULL, M_ERROR, 0, _("Could not initialize %s\n"), device->device_name); @@ -548,8 +550,7 @@ void terminate_stored(int sig) Dmsg1(10, "Term device %s\n", device->device_name); if (device->dev) { free_volume(device->dev); - device->dev->term(); - device->dev = NULL; + term_dev(device->dev); } else { Dmsg1(10, "No dev structure %s\n", device->device_name); } @@ -564,6 +565,7 @@ void terminate_stored(int sig) if (debug_level > 10) { print_memory_pool_stats(); } + term_reservations_lock(); term_msg(); stop_watchdog(); cleanup_crypto(); diff --git a/bacula/src/stored/stored_conf.c b/bacula/src/stored/stored_conf.c index 99e5652fe0..03699ff0e4 100644 --- a/bacula/src/stored/stored_conf.c +++ b/bacula/src/stored/stored_conf.c @@ -36,7 +36,6 @@ RES **res_head = sres_head; /* Forward referenced subroutines */ static void store_devtype(LEX *lc, RES_ITEM *item, int index, int pass); - /* We build the current resource here statically, * then move it to dynamic memory */ URES res_all; @@ -61,9 +60,9 @@ static RES_ITEM store_items[] = { {"scriptsdirectory", store_dir, ITEM(res_store.scripts_directory), 0, 0, 0}, {"maximumconcurrentjobs", store_pint, ITEM(res_store.max_concurrent_jobs), 0, ITEM_DEFAULT, 10}, {"heartbeatinterval", store_time, ITEM(res_store.heartbeat_interval), 0, ITEM_DEFAULT, 0}, - {"tlsenable", store_bit, ITEM(res_store.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_store.tls_require), 1, 0, 0}, - {"tlsverifypeer", store_bit, ITEM(res_store.tls_verify_peer), 1, ITEM_DEFAULT, 1}, + {"tlsenable", store_yesno, ITEM(res_store.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_store.tls_require), 1, 0, 0}, + {"tlsverifypeer", store_yesno, ITEM(res_store.tls_verify_peer), 1, ITEM_DEFAULT, 1}, {"tlscacertificatefile", store_dir, ITEM(res_store.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_store.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_store.tls_certfile), 0, 0, 0}, @@ -79,10 +78,10 @@ static RES_ITEM dir_items[] = { {"name", store_name, ITEM(res_dir.hdr.name), 0, ITEM_REQUIRED, 0}, {"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0}, {"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0}, - {"monitor", store_bit, ITEM(res_dir.monitor), 1, ITEM_DEFAULT, 0}, - {"tlsenable", store_bit, ITEM(res_dir.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_dir.tls_require), 1, 0, 0}, - {"tlsverifypeer", store_bit, ITEM(res_dir.tls_verify_peer), 1, ITEM_DEFAULT, 1}, + {"monitor", store_yesno, ITEM(res_dir.monitor), 1, ITEM_DEFAULT, 0}, + {"tlsenable", store_yesno, ITEM(res_dir.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_dir.tls_require), 1, 0, 0}, + {"tlsverifypeer", store_yesno, ITEM(res_dir.tls_verify_peer), 1, ITEM_DEFAULT, 1}, {"tlscacertificatefile", store_dir, ITEM(res_dir.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_dir.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_dir.tls_certfile), 0, 0, 0}, @@ -99,37 +98,37 @@ static RES_ITEM dev_items[] = { {"mediatype", store_strname,ITEM(res_dev.media_type), 0, ITEM_REQUIRED, 0}, {"devicetype", store_devtype,ITEM(res_dev.dev_type), 0, 0, 0}, {"archivedevice", store_strname,ITEM(res_dev.device_name), 0, ITEM_REQUIRED, 0}, - {"hardwareendoffile", store_bit, ITEM(res_dev.cap_bits), CAP_EOF, ITEM_DEFAULT, 1}, - {"hardwareendofmedium", store_bit, ITEM(res_dev.cap_bits), CAP_EOM, ITEM_DEFAULT, 1}, - {"backwardspacerecord", store_bit, ITEM(res_dev.cap_bits), CAP_BSR, ITEM_DEFAULT, 1}, - {"backwardspacefile", store_bit, ITEM(res_dev.cap_bits), CAP_BSF, ITEM_DEFAULT, 1}, - {"bsfateom", store_bit, ITEM(res_dev.cap_bits), CAP_BSFATEOM, ITEM_DEFAULT, 0}, - {"twoeof", store_bit, ITEM(res_dev.cap_bits), CAP_TWOEOF, ITEM_DEFAULT, 0}, - {"forwardspacerecord", store_bit, ITEM(res_dev.cap_bits), CAP_FSR, ITEM_DEFAULT, 1}, - {"forwardspacefile", store_bit, ITEM(res_dev.cap_bits), CAP_FSF, ITEM_DEFAULT, 1}, - {"fastforwardspacefile", store_bit, ITEM(res_dev.cap_bits), CAP_FASTFSF, ITEM_DEFAULT, 1}, - {"removablemedia", store_bit, ITEM(res_dev.cap_bits), CAP_REM, ITEM_DEFAULT, 1}, - {"randomaccess", store_bit, ITEM(res_dev.cap_bits), CAP_RACCESS, 0, 0}, - {"automaticmount", store_bit, ITEM(res_dev.cap_bits), CAP_AUTOMOUNT, ITEM_DEFAULT, 0}, - {"labelmedia", store_bit, ITEM(res_dev.cap_bits), CAP_LABEL, ITEM_DEFAULT, 0}, - {"alwaysopen", store_bit, ITEM(res_dev.cap_bits), CAP_ALWAYSOPEN, ITEM_DEFAULT, 1}, - {"autochanger", store_bit, ITEM(res_dev.cap_bits), CAP_AUTOCHANGER, ITEM_DEFAULT, 0}, - {"closeonpoll", store_bit, ITEM(res_dev.cap_bits), CAP_CLOSEONPOLL, ITEM_DEFAULT, 0}, - {"blockpositioning", store_bit, ITEM(res_dev.cap_bits), CAP_POSITIONBLOCKS, ITEM_DEFAULT, 1}, - {"usemtiocget", store_bit, ITEM(res_dev.cap_bits), CAP_MTIOCGET, ITEM_DEFAULT, 1}, - {"checklabels", store_bit, ITEM(res_dev.cap_bits), CAP_CHECKLABELS, ITEM_DEFAULT, 0}, - {"requiresmount", store_bit, ITEM(res_dev.cap_bits), CAP_REQMOUNT, ITEM_DEFAULT, 0}, - {"offlineonunmount", store_bit, ITEM(res_dev.cap_bits), CAP_OFFLINEUNMOUNT, ITEM_DEFAULT, 0}, - {"autoselect", store_bit, ITEM(res_dev.autoselect), 1, ITEM_DEFAULT, 1}, + {"hardwareendoffile", store_yesno, ITEM(res_dev.cap_bits), CAP_EOF, ITEM_DEFAULT, 1}, + {"hardwareendofmedium", store_yesno, ITEM(res_dev.cap_bits), CAP_EOM, ITEM_DEFAULT, 1}, + {"backwardspacerecord", store_yesno, ITEM(res_dev.cap_bits), CAP_BSR, ITEM_DEFAULT, 1}, + {"backwardspacefile", store_yesno, ITEM(res_dev.cap_bits), CAP_BSF, ITEM_DEFAULT, 1}, + {"bsfateom", store_yesno, ITEM(res_dev.cap_bits), CAP_BSFATEOM, ITEM_DEFAULT, 0}, + {"twoeof", store_yesno, ITEM(res_dev.cap_bits), CAP_TWOEOF, ITEM_DEFAULT, 0}, + {"forwardspacerecord", store_yesno, ITEM(res_dev.cap_bits), CAP_FSR, ITEM_DEFAULT, 1}, + {"forwardspacefile", store_yesno, ITEM(res_dev.cap_bits), CAP_FSF, ITEM_DEFAULT, 1}, + {"fastforwardspacefile", store_yesno, ITEM(res_dev.cap_bits), CAP_FASTFSF, ITEM_DEFAULT, 1}, + {"removablemedia", store_yesno, ITEM(res_dev.cap_bits), CAP_REM, ITEM_DEFAULT, 1}, + {"randomaccess", store_yesno, ITEM(res_dev.cap_bits), CAP_RACCESS, 0, 0}, + {"automaticmount", store_yesno, ITEM(res_dev.cap_bits), CAP_AUTOMOUNT, ITEM_DEFAULT, 0}, + {"labelmedia", store_yesno, ITEM(res_dev.cap_bits), CAP_LABEL, ITEM_DEFAULT, 0}, + {"alwaysopen", store_yesno, ITEM(res_dev.cap_bits), CAP_ALWAYSOPEN, ITEM_DEFAULT, 1}, + {"autochanger", store_yesno, ITEM(res_dev.cap_bits), CAP_AUTOCHANGER, ITEM_DEFAULT, 0}, + {"closeonpoll", store_yesno, ITEM(res_dev.cap_bits), CAP_CLOSEONPOLL, ITEM_DEFAULT, 0}, + {"blockpositioning", store_yesno, ITEM(res_dev.cap_bits), CAP_POSITIONBLOCKS, ITEM_DEFAULT, 1}, + {"usemtiocget", store_yesno, ITEM(res_dev.cap_bits), CAP_MTIOCGET, ITEM_DEFAULT, 1}, + {"checklabels", store_yesno, ITEM(res_dev.cap_bits), CAP_CHECKLABELS, ITEM_DEFAULT, 0}, + {"requiresmount", store_yesno, ITEM(res_dev.cap_bits), CAP_REQMOUNT, ITEM_DEFAULT, 0}, + {"offlineonunmount", store_yesno, ITEM(res_dev.cap_bits), CAP_OFFLINEUNMOUNT, ITEM_DEFAULT, 0}, + {"autoselect", store_yesno, ITEM(res_dev.autoselect), 1, ITEM_DEFAULT, 1}, {"changerdevice", store_strname,ITEM(res_dev.changer_name), 0, 0, 0}, {"changercommand", store_strname,ITEM(res_dev.changer_command), 0, 0, 0}, {"alertcommand", store_strname,ITEM(res_dev.alert_command), 0, 0, 0}, - {"maximumchangerwait", store_pint, ITEM(res_dev.max_changer_wait), 0, ITEM_DEFAULT, 5 * 60}, - {"maximumopenwait", store_pint, ITEM(res_dev.max_open_wait), 0, ITEM_DEFAULT, 5 * 60}, + {"maximumchangerwait", store_time, ITEM(res_dev.max_changer_wait), 0, ITEM_DEFAULT, 5 * 60}, + {"maximumopenwait", store_time, ITEM(res_dev.max_open_wait), 0, ITEM_DEFAULT, 5 * 60}, {"maximumopenvolumes", store_pint, ITEM(res_dev.max_open_vols), 0, ITEM_DEFAULT, 1}, {"maximumnetworkbuffersize", store_pint, ITEM(res_dev.max_network_buffer_size), 0, 0, 0}, {"volumepollinterval", store_time, ITEM(res_dev.vol_poll_interval), 0, 0, 0}, - {"maximumrewindwait", store_pint, ITEM(res_dev.max_rewind_wait), 0, ITEM_DEFAULT, 5 * 60}, + {"maximumrewindwait", store_time, ITEM(res_dev.max_rewind_wait), 0, ITEM_DEFAULT, 5 * 60}, {"minimumblocksize", store_pint, ITEM(res_dev.min_block_size), 0, 0, 0}, {"maximumblocksize", store_pint, ITEM(res_dev.max_block_size), 0, 0, 0}, {"maximumvolumesize", store_size, ITEM(res_dev.max_volume_size), 0, 0, 0}, @@ -160,7 +159,7 @@ static RES_ITEM changer_items[] = { }; -// {"mountanonymousvolumes", store_bit, ITEM(res_dev.cap_bits), CAP_ANONVOLS, ITEM_DEFAULT, 0}, +// {"mountanonymousvolumes", store_yesno, ITEM(res_dev.cap_bits), CAP_ANONVOLS, ITEM_DEFAULT, 0}, /* Message resource */ diff --git a/bacula/src/stored/stored_conf.h b/bacula/src/stored/stored_conf.h index 6cc91f3eea..e1db10d0bc 100644 --- a/bacula/src/stored/stored_conf.h +++ b/bacula/src/stored/stored_conf.h @@ -112,9 +112,9 @@ public: int autoselect; /* Automatically select from AutoChanger */ uint32_t drive_index; /* Autochanger drive index */ uint32_t cap_bits; /* Capabilities of this device */ - uint32_t max_changer_wait; /* Changer timeout */ - uint32_t max_rewind_wait; /* maximum secs to wait for rewind */ - uint32_t max_open_wait; /* maximum secs to wait for open */ + utime_t max_changer_wait; /* Changer timeout */ + utime_t max_rewind_wait; /* maximum secs to wait for rewind */ + utime_t max_open_wait; /* maximum secs to wait for open */ uint32_t max_open_vols; /* maximum simultaneous open volumes */ uint32_t min_block_size; /* min block size */ uint32_t max_block_size; /* max block size */ diff --git a/bacula/src/stored/wait.c b/bacula/src/stored/wait.c index 8555561818..a4c4351441 100644 --- a/bacula/src/stored/wait.c +++ b/bacula/src/stored/wait.c @@ -9,7 +9,7 @@ * Version $Id$ */ /* - Copyright (C) 2000-2006 Kern Sibbald + Copyright (C) 2000-2005 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -190,7 +190,7 @@ bool wait_for_device(JCR *jcr, bool first) struct timespec timeout; int stat = 0; bool ok = true; - const int wait_time = 5 * 60; /* wait 5 minutes */ + const int wait_time = 5 * 60; /* wait 5 minutes */ Dmsg0(100, "Enter wait_for_device\n"); P(device_release_mutex); diff --git a/bacula/src/tools/Makefile.in b/bacula/src/tools/Makefile.in index 2debf389cb..d961440392 100644 --- a/bacula/src/tools/Makefile.in +++ b/bacula/src/tools/Makefile.in @@ -38,7 +38,7 @@ EXTRAOBJS = @OBJLIST@ DIRCONFOBJS = ../dird/dird_conf.o ../dird/run_conf.o ../dird/inc_conf.o NODIRTOOLS = bsmtp -DIRTOOLS = bsmtp dbcheck fstype testfind testls +DIRTOOLS = bsmtp dbcheck fstype testfind testls regex TOOLS = $(@DIR_TOOLS@) INSNODIRTOOLS = bsmtp @@ -75,6 +75,11 @@ testls: ../findlib/libfind.a ../lib/libbac.a testls.o $(CXX) -g $(LDFLAGS) -L. -L../lib -L../findlib -o $@ testls.o \ $(DLIB) -lfind -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) +regex: ../findlib/libfind.a ../lib/libbac.a regex.o + $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ regex.o \ + $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS) + + Makefile: $(srcdir)/Makefile.in $(topdir)/config.status cd $(topdir) \ && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status diff --git a/bacula/src/tools/bsmtp.c b/bacula/src/tools/bsmtp.c index ab6883db73..5c22b0c830 100644 --- a/bacula/src/tools/bsmtp.c +++ b/bacula/src/tools/bsmtp.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2001-2005 Kern Sibbald + Copyright (C) 2001-2006 Kern Sibbald This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -125,6 +125,8 @@ _("\n" " -f set the From: field\n" " -h use mailhost:port as the SMTP server\n" " -s set the Subject: field\n" +" -r set the Reply-To: field\n" +" -l set the maximum number of lines that should be sent (default: unlimited)\n" " -? print this message.\n" "\n"), MY_NAME); @@ -142,18 +144,20 @@ int main (int argc, char *argv[]) struct sockaddr_in sin; struct hostent *hp; int s, r, i, ch; + unsigned long maxlines, lines; struct passwd *pwd; char *cp, *p; time_t now = time(NULL); struct tm tm; - setlocale(LC_ALL, ""); + setlocale(LC_ALL, "en_US"); bindtextdomain("bacula", LOCALEDIR); textdomain("bacula"); my_name_is(argc, argv, "bsmtp"); + maxlines = 0; - while ((ch = getopt(argc, argv, "c:d:f:h:r:s:?")) != -1) { + while ((ch = getopt(argc, argv, "c:d:f:h:r:s:l:?")) != -1) { switch (ch) { case 'c': Dmsg1(20, "cc=%s\n", optarg); @@ -191,6 +195,11 @@ int main (int argc, char *argv[]) reply_addr = optarg; break; + case 'l': + Dmsg1(20, "maxlines=%s\n", optarg); + maxlines = (unsigned long) atol(optarg); + break; + case '?': default: usage(); @@ -313,42 +322,58 @@ hp: * Send message header */ fprintf(sfp, "From: %s\r\n", from_addr); + Dmsg1(10, "From: %s\r\n", from_addr); if (subject) { fprintf(sfp, "Subject: %s\r\n", subject); + Dmsg1(10, "Subject: %s\r\n", subject); } if (reply_addr) { fprintf(sfp, "Reply-To: %s\r\n", reply_addr); + Dmsg1(10, "Reply-To: %s\r\n", reply_addr); } if (err_addr) { fprintf(sfp, "Errors-To: %s\r\n", err_addr); + Dmsg1(10, "Errors-To: %s\r\n", err_addr); } if ((pwd = getpwuid(getuid())) == 0) { fprintf(sfp, "Sender: userid-%d@%s\r\n", (int)getuid(), my_hostname); + Dmsg2(10, "Sender: userid-%d@%s\r\n", (int)getuid(), my_hostname); } else { fprintf(sfp, "Sender: %s@%s\r\n", pwd->pw_name, my_hostname); + Dmsg2(10, "Sender: %s@%s\r\n", pwd->pw_name, my_hostname); } fprintf(sfp, "To: %s", argv[0]); + Dmsg1(10, "To: %s", argv[0]); for (i = 1; i < argc; i++) { fprintf(sfp, ",%s", argv[i]); + Dmsg1(10, ",%s", argv[i]); } fprintf(sfp, "\r\n"); + Dmsg0(10, "\r\n"); if (cc_addr) { fprintf(sfp, "Cc: %s\r\n", cc_addr); + Dmsg1(10, "Cc: %s\r\n", cc_addr); } /* Add RFC822 date */ localtime_r(&now, &tm); strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S %z", &tm); fprintf(sfp, "Date: %s\r\n", buf); + Dmsg1(10, "Date: %s\r\n", buf); fprintf(sfp, "\r\n"); /* * Send message body */ + lines = 0; while (fgets(buf, sizeof(buf), stdin)) { + if (maxlines > 0 && ++lines > maxlines) { + Dmsg1(20, "skip line because of maxlines limit: %lu\n", maxlines); + continue; + } buf[strlen(buf)-1] = 0; if (strcmp(buf, ".") == 0) { /* quote lone dots */ fprintf(sfp, "..\r\n"); @@ -357,6 +382,11 @@ hp: } } + if (lines > maxlines) { + Dmsg1(10, "hit maxlines limit: %lu\n", maxlines); + fprintf(sfp, "\r\n[maximum of %lu lines exceeded, skipped %lu lines of output]\r\n", maxlines, lines-maxlines); + } + /* * Send SMTP quit command */ diff --git a/bacula/src/tools/regex.c b/bacula/src/tools/regex.c new file mode 100644 index 0000000000..c2dcd58f9c --- /dev/null +++ b/bacula/src/tools/regex.c @@ -0,0 +1,137 @@ +/* + * Test program for testing regular expressions. + */ +/* + Copyright (C) 2006 Kern Sibbald + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + version 2 as amended with additional clauses defined in the + file LICENSE in the main source directory. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + the file LICENSE for additional details. + + */ + +#include "bacula.h" +#ifdef HAVE_REGEX_H +#include +#endif + + +static void usage() +{ + fprintf(stderr, +"\n" +"Usage: regex [-d debug_level] -f \n" +" -f specify file of data to be matched\n" +" -l suppress line numbers\n" +" -n print lines that do not match\n" +" -? print this message.\n" +"\n\n"); + + exit(1); +} + + +int main(int argc, char *const *argv) +{ +#ifndef HAVE_REGEX_H + printf("The regex libraries don't seem to be available.\n"); + exit(1); +#else + regex_t preg; + char prbuf[500]; + char *fname = NULL; + int rc, ch; + char data[1000]; + char pat[500]; + FILE *fd; + bool match_only = true; + int lineno; + bool no_linenos = false; + + + setlocale(LC_ALL, ""); + bindtextdomain("bacula", LOCALEDIR); + textdomain("bacula"); + + while ((ch = getopt(argc, argv, "d:f:n?")) != -1) { + switch (ch) { + case 'd': /* set debug level */ + debug_level = atoi(optarg); + if (debug_level <= 0) { + debug_level = 1; + } + break; + + case 'f': /* data */ + fname = optarg; + break; + + case 'l': + no_linenos = true; + break; + + case 'n': + match_only = false; + break; + + case '?': + default: + usage(); + + } + } + argc -= optind; + argv += optind; + + if (!fname) { + printf("A data file must be specified.\n"); + usage(); + } + + for ( ;; ) { + printf("Enter regex pattern: "); + if (fgets(pat, sizeof(pat)-1, stdin) == NULL) { + break; + } + strip_trailing_newline(pat); + if (pat[0] == 0) { + exit(0); + } + rc = regcomp(&preg, pat, REG_EXTENDED); + if (rc != 0) { + regerror(rc, &preg, prbuf, sizeof(prbuf)); + printf("Regex compile error: %s\n", prbuf); + continue; + } + fd = fopen(fname, "r"); + if (!fd) { + printf(_("Could not open data file: %s\n"), fname); + exit(1); + } + lineno = 0; + while (fgets(data, sizeof(data)-1, fd)) { + const int nmatch = 30; + regmatch_t pmatch[nmatch]; + strip_trailing_newline(data); + lineno++; + rc = regexec(&preg, data, nmatch, pmatch, 0); + if ((match_only && rc == 0) || (!match_only && rc != 0)) { + if (no_linenos) { + printf("%s\n", data); + } else { + printf("%5d: %s\n", lineno, data); + } + } + } + fclose(fd); + regfree(&preg); + } + exit(0); +#endif +} diff --git a/bacula/src/tray-monitor/tray_conf.c b/bacula/src/tray-monitor/tray_conf.c index 18cfdf04f4..7614c2052a 100644 --- a/bacula/src/tray-monitor/tray_conf.c +++ b/bacula/src/tray-monitor/tray_conf.c @@ -8,14 +8,14 @@ * 1. The generic lexical scanner in lib/lex.c and lib/lex.h * * 2. The generic config scanner in lib/parse_config.c and -* lib/parse_config.h. -* These files contain the parser code, some utility -* routines, and the common store routines (name, int, -* string). +* lib/parse_config.h. +* These files contain the parser code, some utility +* routines, and the common store routines (name, int, +* string). * * 3. The daemon specific file, which contains the Resource -* definitions as well as any specific store routines -* for the resource records. +* definitions as well as any specific store routines +* for the resource records. * * Nicolas Boichat, August MMIV * @@ -69,12 +69,12 @@ int res_all_size = sizeof(res_all); /* * Monitor Resource * -* name handler value code flags default_value +* name handler value code flags default_value */ static RES_ITEM mon_items[] = { {"name", store_name, ITEM(res_monitor.hdr.name), 0, ITEM_REQUIRED, 0}, {"description", store_str, ITEM(res_monitor.hdr.desc), 0, 0, 0}, - {"requiressl", store_bit, ITEM(res_monitor.require_ssl), 1, ITEM_DEFAULT, 0}, + {"requiressl", store_yesno, ITEM(res_monitor.require_ssl), 1, ITEM_DEFAULT, 0}, {"password", store_password, ITEM(res_monitor.password), 0, ITEM_REQUIRED, 0}, {"refreshinterval", store_time,ITEM(res_monitor.RefreshInterval), 0, ITEM_DEFAULT, 5}, {"fdconnecttimeout", store_time,ITEM(res_monitor.FDConnectTimeout), 0, ITEM_DEFAULT, 60 * 30}, @@ -88,14 +88,14 @@ static RES_ITEM dir_items[] = { {"description", store_str, ITEM(res_dir.hdr.desc), 0, 0, 0}, {"dirport", store_int, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101}, {"address", store_str, ITEM(res_dir.address), 0, 0, 0}, - {"enablessl", store_bit, ITEM(res_dir.enable_ssl), 1, ITEM_DEFAULT, 0}, + {"enablessl", store_yesno, ITEM(res_dir.enable_ssl), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; /* * Client or File daemon resource * -* name handler value code flags default_value +* name handler value code flags default_value */ static RES_ITEM cli_items[] = { @@ -104,13 +104,13 @@ static RES_ITEM cli_items[] = { {"address", store_str, ITEM(res_client.address), 0, ITEM_REQUIRED, 0}, {"fdport", store_pint, ITEM(res_client.FDport), 0, ITEM_DEFAULT, 9102}, {"password", store_password, ITEM(res_client.password), 0, ITEM_REQUIRED, 0}, - {"enablessl", store_bit, ITEM(res_client.enable_ssl), 1, ITEM_DEFAULT, 0}, + {"enablessl", store_yesno, ITEM(res_client.enable_ssl), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; /* Storage daemon resource * -* name handler value code flags default_value +* name handler value code flags default_value */ static RES_ITEM store_items[] = { {"name", store_name, ITEM(res_store.hdr.name), 0, ITEM_REQUIRED, 0}, @@ -120,7 +120,7 @@ static RES_ITEM store_items[] = { {"sdaddress", store_str, ITEM(res_store.address), 0, 0, 0}, {"password", store_password, ITEM(res_store.password), 0, ITEM_REQUIRED, 0}, {"sdpassword", store_password, ITEM(res_store.password), 0, 0, 0}, - {"enablessl", store_bit, ITEM(res_store.enable_ssl), 1, ITEM_DEFAULT, 0}, + {"enablessl", store_yesno, ITEM(res_store.enable_ssl), 1, ITEM_DEFAULT, 0}, {NULL, NULL, NULL, 0, 0, 0} }; @@ -131,7 +131,7 @@ static RES_ITEM store_items[] = { * NOTE!!! keep it in the same order as the R_codes * or eliminate all resources[rindex].name * -* name items rcode res_head +* name items rcode res_head */ RES_TABLE resources[] = { {"monitor", mon_items, R_MONITOR}, @@ -152,7 +152,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm sendit(sock, _("No %s resource defined\n"), res_to_str(type)); return; } - if (type < 0) { /* no recursion */ + if (type < 0) { /* no recursion */ type = - type; recurse = false; } @@ -194,7 +194,7 @@ void dump_resource(int type, RES *reshdr, void sendit(void *sock, const char *fm */ void free_resource(RES *sres, int type) { - RES *nres; /* next resource if linked */ + RES *nres; /* next resource if linked */ URES *res = (URES *)sres; if (res == NULL) @@ -258,14 +258,14 @@ void save_resource(int type, RES_ITEM *items, int pass) */ for (i=0; items[i].name; i++) { if (items[i].flags & ITEM_REQUIRED) { - if (!bit_is_set(i, res_all.res_monitor.hdr.item_present)) { - Emsg2(M_ERROR_TERM, 0, _("%s item is required in %s resource, but not found.\n"), - items[i].name, resources[rindex]); - } + if (!bit_is_set(i, res_all.res_monitor.hdr.item_present)) { + Emsg2(M_ERROR_TERM, 0, _("%s item is required in %s resource, but not found.\n"), + items[i].name, resources[rindex]); + } } /* If this triggers, take a look at lib/parse_conf.h */ if (i >= MAX_RES_ITEMS) { - Emsg1(M_ERROR_TERM, 0, _("Too many items in %s resource\n"), resources[rindex]); + Emsg1(M_ERROR_TERM, 0, _("Too many items in %s resource\n"), resources[rindex]); } } @@ -282,22 +282,22 @@ void save_resource(int type, RES_ITEM *items, int pass) case R_CLIENT: case R_STORAGE: case R_DIRECTOR: - break; + break; default: - Emsg1(M_ERROR, 0, _("Unknown resource type %d in save_resource.\n"), type); - error = 1; - break; + Emsg1(M_ERROR, 0, _("Unknown resource type %d in save_resource.\n"), type); + error = 1; + break; } /* Note, the resource name was already saved during pass 1, * so here, we can just release it. */ if (res_all.res_monitor.hdr.name) { - free(res_all.res_monitor.hdr.name); - res_all.res_monitor.hdr.name = NULL; + free(res_all.res_monitor.hdr.name); + res_all.res_monitor.hdr.name = NULL; } if (res_all.res_monitor.hdr.desc) { - free(res_all.res_monitor.hdr.desc); - res_all.res_monitor.hdr.desc = NULL; + free(res_all.res_monitor.hdr.desc); + res_all.res_monitor.hdr.desc = NULL; } return; } @@ -330,21 +330,21 @@ void save_resource(int type, RES_ITEM *items, int pass) memcpy(res, &res_all, size); if (!res_head[rindex]) { res_head[rindex] = (RES *)res; /* store first entry */ - Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type), - res->res_monitor.hdr.name, rindex); + Dmsg3(900, "Inserting first %s res: %s index=%d\n", res_to_str(type), + res->res_monitor.hdr.name, rindex); } else { RES *next; /* Add new res to end of chain */ for (next=res_head[rindex]; next->next; next=next->next) { if (strcmp(next->name, res->res_monitor.hdr.name) == 0) { - Emsg2(M_ERROR_TERM, 0, - _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), - resources[rindex].name, res->res_monitor.hdr.name); + Emsg2(M_ERROR_TERM, 0, + _("Attempt to define second %s resource named \"%s\" is not permitted.\n"), + resources[rindex].name, res->res_monitor.hdr.name); } } next->next = (RES *)res; - Dmsg4(900, "Inserting %s res: %s index=%d pass=%d\n", res_to_str(type), - res->res_monitor.hdr.name, rindex, pass); + Dmsg4(900, "Inserting %s res: %s index=%d pass=%d\n", res_to_str(type), + res->res_monitor.hdr.name, rindex, pass); } } } diff --git a/bacula/src/version.h b/bacula/src/version.h index 0870424a32..723cc5b7dc 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -3,9 +3,9 @@ */ #undef VERSION -#define VERSION "1.39.5" -#define BDATE "20 February 2006" -#define LSMDATE "20Feb06" +#define VERSION "1.38.7" +#define BDATE "06 April 2006" +#define LSMDATE "06Apr06" /* Debug flags */ #undef DEBUG @@ -15,7 +15,7 @@ #define TRACE_FILE 1 /* If this is set stdout will not be closed on startup */ -#define DEVELOPER 1 +/* #define DEVELOPER 1 */ /* #define USE_BSNPRINTF */ diff --git a/bacula/src/win32/baculafd/baculafd.mak b/bacula/src/win32/baculafd/baculafd.mak index df2c8f7f8d..7afb9dca66 100644 --- a/bacula/src/win32/baculafd/baculafd.mak +++ b/bacula/src/win32/baculafd/baculafd.mak @@ -57,11 +57,11 @@ CLEAN : -@erase "$(INTDIR)\bsys.obj" -@erase "$(INTDIR)\btime.obj" -@erase "$(INTDIR)\btimers.obj" + -@erase "$(INTDIR)\chksum.obj" -@erase "$(INTDIR)\compat.obj" -@erase "$(INTDIR)\cram-md5.obj" -@erase "$(INTDIR)\crc32.obj" -@erase "$(INTDIR)\create_file.obj" - -@erase "$(INTDIR)\crypto.obj" -@erase "$(INTDIR)\daemon.obj" -@erase "$(INTDIR)\dlist.obj" -@erase "$(INTDIR)\edit.obj" @@ -154,11 +154,11 @@ LINK32_OBJS= \ "$(INTDIR)\bsys.obj" \ "$(INTDIR)\btime.obj" \ "$(INTDIR)\btimers.obj" \ + "$(INTDIR)\chksum.obj" \ "$(INTDIR)\compat.obj" \ "$(INTDIR)\cram-md5.obj" \ "$(INTDIR)\crc32.obj" \ "$(INTDIR)\create_file.obj" \ - "$(INTDIR)\crypto.obj" \ "$(INTDIR)\daemon.obj" \ "$(INTDIR)\dlist.obj" \ "$(INTDIR)\edit.obj" \ @@ -271,6 +271,8 @@ CLEAN : -@erase "$(INTDIR)\btime.sbr" -@erase "$(INTDIR)\btimers.obj" -@erase "$(INTDIR)\btimers.sbr" + -@erase "$(INTDIR)\chksum.obj" + -@erase "$(INTDIR)\chksum.sbr" -@erase "$(INTDIR)\compat.obj" -@erase "$(INTDIR)\compat.sbr" -@erase "$(INTDIR)\cram-md5.obj" @@ -279,8 +281,6 @@ CLEAN : -@erase "$(INTDIR)\crc32.sbr" -@erase "$(INTDIR)\create_file.obj" -@erase "$(INTDIR)\create_file.sbr" - -@erase "$(INTDIR)\crypto.obj" - -@erase "$(INTDIR)\crypto.sbr" -@erase "$(INTDIR)\daemon.obj" -@erase "$(INTDIR)\daemon.sbr" -@erase "$(INTDIR)\dlist.obj" @@ -430,11 +430,11 @@ BSC32_SBRS= \ "$(INTDIR)\bsys.sbr" \ "$(INTDIR)\btime.sbr" \ "$(INTDIR)\btimers.sbr" \ + "$(INTDIR)\chksum.sbr" \ "$(INTDIR)\compat.sbr" \ "$(INTDIR)\cram-md5.sbr" \ "$(INTDIR)\crc32.sbr" \ "$(INTDIR)\create_file.sbr" \ - "$(INTDIR)\crypto.sbr" \ "$(INTDIR)\daemon.sbr" \ "$(INTDIR)\dlist.sbr" \ "$(INTDIR)\edit.sbr" \ @@ -520,11 +520,11 @@ LINK32_OBJS= \ "$(INTDIR)\bsys.obj" \ "$(INTDIR)\btime.obj" \ "$(INTDIR)\btimers.obj" \ + "$(INTDIR)\chksum.obj" \ "$(INTDIR)\compat.obj" \ "$(INTDIR)\cram-md5.obj" \ "$(INTDIR)\crc32.obj" \ "$(INTDIR)\create_file.obj" \ - "$(INTDIR)\crypto.obj" \ "$(INTDIR)\daemon.obj" \ "$(INTDIR)\dlist.obj" \ "$(INTDIR)\edit.obj" \ @@ -944,98 +944,97 @@ SOURCE=..\lib\btimers.cpp !ENDIF -SOURCE=..\compat\compat.cpp +SOURCE=..\filed\chksum.cpp !IF "$(CFG)" == "baculafd - Win32 Release" -"$(INTDIR)\compat.obj" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\chksum.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "baculafd - Win32 Debug" -"$(INTDIR)\compat.obj" "$(INTDIR)\compat.sbr" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\chksum.obj" "$(INTDIR)\chksum.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF -SOURCE="..\lib\cram-md5.cpp" + +SOURCE=..\compat\compat.cpp !IF "$(CFG)" == "baculafd - Win32 Release" -"$(INTDIR)\cram-md5.obj" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\compat.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "baculafd - Win32 Debug" -"$(INTDIR)\cram-md5.obj" "$(INTDIR)\cram-md5.sbr" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\compat.obj" "$(INTDIR)\compat.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF -SOURCE=..\lib\crc32.cpp +SOURCE="..\lib\cram-md5.cpp" !IF "$(CFG)" == "baculafd - Win32 Release" -"$(INTDIR)\crc32.obj" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\cram-md5.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "baculafd - Win32 Debug" -"$(INTDIR)\crc32.obj" "$(INTDIR)\crc32.sbr" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\cram-md5.obj" "$(INTDIR)\cram-md5.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF -SOURCE=..\findlib\create_file.cpp +SOURCE=..\lib\crc32.cpp !IF "$(CFG)" == "baculafd - Win32 Release" -"$(INTDIR)\create_file.obj" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\crc32.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "baculafd - Win32 Debug" -"$(INTDIR)\create_file.obj" "$(INTDIR)\create_file.sbr" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\crc32.obj" "$(INTDIR)\crc32.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF - -SOURCE=..\lib\crypto.cpp +SOURCE=..\findlib\create_file.cpp !IF "$(CFG)" == "baculafd - Win32 Release" -"$(INTDIR)\crypto.obj" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\create_file.obj" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ELSEIF "$(CFG)" == "baculafd - Win32 Debug" -"$(INTDIR)\crypto.obj" "$(INTDIR)\crypto.sbr" : $(SOURCE) "$(INTDIR)" +"$(INTDIR)\create_file.obj" "$(INTDIR)\create_file.sbr" : $(SOURCE) "$(INTDIR)" $(CPP) $(CPP_PROJ) $(SOURCE) !ENDIF - SOURCE=..\lib\daemon.cpp !IF "$(CFG)" == "baculafd - Win32 Release" diff --git a/bacula/src/win32/compat/vss_generic.cpp b/bacula/src/win32/compat/vss_generic.cpp index 75387df272..94beae42f0 100644 --- a/bacula/src/win32/compat/vss_generic.cpp +++ b/bacula/src/win32/compat/vss_generic.cpp @@ -4,7 +4,7 @@ // Copyright transferred from MATRIX-Computer GmbH to // Kern Sibbald by express permission. // -// Copyright (C) 2005 Kern Sibbald +// Copyright (C) 2005-2006 Kern Sibbald // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -67,6 +67,8 @@ using namespace std; #ifdef B_VSS_XP #pragma message("compile VSS for Windows XP") #define VSSClientGeneric VSSClientXP + // wait is not available under XP... + #define VSS_TIMEOUT #include "vss/inc/WinXP/vss.h" #include "vss/inc/WinXP/vswriter.h" @@ -85,6 +87,9 @@ using namespace std; #ifdef B_VSS_W2K3 #pragma message("compile VSS for Windows 2003") #define VSSClientGeneric VSSClient2003 + // wait x ms for a VSS asynchronous operation (-1 = infinite) + // unfortunately, it doesn't work, so do not set timeout + #define VSS_TIMEOUT #include "vss/inc/Win2003/vss.h" #include "vss/inc/Win2003/vswriter.h" @@ -277,8 +282,10 @@ BOOL VSSClientGeneric::Initialize(DWORD dwContext, BOOL bDuringRestore) void VSSClientGeneric::WaitAndCheckForAsyncOperation(IVssAsync* pAsync) { - // Wait until the async operation finishes - HRESULT hr = pAsync->Wait(); + // Wait until the async operation finishes + // unfortunately we can't use a timeout here yet. + // the interface would allow it on W2k3, but it is not implemented yet.... + HRESULT hr = pAsync->Wait(VSS_TIMEOUT); // Check the result of the asynchronous operation HRESULT hrReturned = S_OK; diff --git a/bacula/src/win32/console/console.mak b/bacula/src/win32/console/console.mak index 4a117ec1f9..7d0c98213b 100644 --- a/bacula/src/win32/console/console.mak +++ b/bacula/src/win32/console/console.mak @@ -54,7 +54,6 @@ CLEAN : -@erase "$(INTDIR)\console_conf.obj" -@erase "$(INTDIR)\cram-md5.obj" -@erase "$(INTDIR)\crc32.obj" - -@erase "$(INTDIR)\crypto.obj" -@erase "$(INTDIR)\dlist.obj" -@erase "$(INTDIR)\edit.obj" -@erase "$(INTDIR)\getopt.obj" @@ -107,7 +106,6 @@ LINK32_OBJS= \ "$(INTDIR)\console_conf.obj" \ "$(INTDIR)\cram-md5.obj" \ "$(INTDIR)\crc32.obj" \ - "$(INTDIR)\crypto.obj" \ "$(INTDIR)\dlist.obj" \ "$(INTDIR)\edit.obj" \ "$(INTDIR)\getopt.obj" \ @@ -165,7 +163,6 @@ CLEAN : -@erase "$(INTDIR)\console_conf.obj" -@erase "$(INTDIR)\cram-md5.obj" -@erase "$(INTDIR)\crc32.obj" - -@erase "$(INTDIR)\crypto.obj" -@erase "$(INTDIR)\dlist.obj" -@erase "$(INTDIR)\edit.obj" -@erase "$(INTDIR)\getopt.obj" @@ -219,7 +216,6 @@ LINK32_OBJS= \ "$(INTDIR)\console_conf.obj" \ "$(INTDIR)\cram-md5.obj" \ "$(INTDIR)\crc32.obj" \ - "$(INTDIR)\crypto.obj" \ "$(INTDIR)\dlist.obj" \ "$(INTDIR)\edit.obj" \ "$(INTDIR)\getopt.obj" \ @@ -370,13 +366,6 @@ SOURCE=..\lib\crc32.cpp $(CPP) $(CPP_PROJ) $(SOURCE) -SOURCE=..\lib\crypto.cpp - -"$(INTDIR)\crypto.obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - - SOURCE=..\lib\dlist.cpp "$(INTDIR)\dlist.obj" : $(SOURCE) "$(INTDIR)" diff --git a/bacula/src/win32/filed/chksum.cpp b/bacula/src/win32/filed/chksum.cpp new file mode 100644 index 0000000000..de3fd34fb5 --- /dev/null +++ b/bacula/src/win32/filed/chksum.cpp @@ -0,0 +1 @@ +#include "../../filed/chksum.c" diff --git a/bacula/src/win32/lib/crypto.cpp b/bacula/src/win32/lib/crypto.cpp deleted file mode 100644 index 961ae75983..0000000000 --- a/bacula/src/win32/lib/crypto.cpp +++ /dev/null @@ -1 +0,0 @@ -#include "../../lib/crypto.c" diff --git a/bacula/src/win32/wx-console/filelist b/bacula/src/win32/wx-console/filelist index 9f044978ae..f97c202452 100644 --- a/bacula/src/win32/wx-console/filelist +++ b/bacula/src/win32/wx-console/filelist @@ -13,7 +13,6 @@ ..\lib\btime ..\lib\cram-md5 ..\lib\crc32 -..\lib\crypto ..\lib\daemon ..\lib\dlist ..\lib\edit diff --git a/bacula/src/win32/wx-console/wx-console.mak b/bacula/src/win32/wx-console/wx-console.mak index 863dd927c8..f5c116914e 100644 --- a/bacula/src/win32/wx-console/wx-console.mak +++ b/bacula/src/win32/wx-console/wx-console.mak @@ -55,7 +55,6 @@ CLEAN : -@erase "$(INTDIR)\btime.obj" -@erase "$(INTDIR)\cram-md5.obj" -@erase "$(INTDIR)\crc32.obj" - -@erase "$(INTDIR)\crypto.obj" -@erase "$(INTDIR)\daemon.obj" -@erase "$(INTDIR)\dlist.obj" -@erase "$(INTDIR)\edit.obj" @@ -133,7 +132,6 @@ LINK32_OBJS= \ "$(INTDIR)\btime.obj" \ "$(INTDIR)\cram-md5.obj" \ "$(INTDIR)\crc32.obj" \ - "$(INTDIR)\crypto.obj" \ "$(INTDIR)\daemon.obj" \ "$(INTDIR)\dlist.obj" \ "$(INTDIR)\edit.obj" \ @@ -227,8 +225,6 @@ CLEAN : -@erase "$(INTDIR)\cram-md5.sbr" -@erase "$(INTDIR)\crc32.obj -@erase "$(INTDIR)\crc32.sbr" - -@erase "$(INTDIR)\crypto.obj - -@erase "$(INTDIR)\crypto.sbr" -@erase "$(INTDIR)\daemon.obj -@erase "$(INTDIR)\daemon.sbr" -@erase "$(INTDIR)\dlist.obj @@ -346,7 +342,6 @@ BSC32_SBRS= \ "$(INTDIR)\btime.sbr" \ "$(INTDIR)\cram-md5.sbr" \ "$(INTDIR)\crc32.sbr" \ - "$(INTDIR)\crypto.sbr" \ "$(INTDIR)\daemon.sbr" \ "$(INTDIR)\dlist.sbr" \ "$(INTDIR)\edit.sbr" \ @@ -419,7 +414,6 @@ LINK32_OBJS= \ "$(INTDIR)\btime.obj" \ "$(INTDIR)\cram-md5.obj" \ "$(INTDIR)\crc32.obj" \ - "$(INTDIR)\crypto.obj" \ "$(INTDIR)\daemon.obj" \ "$(INTDIR)\dlist.obj" \ "$(INTDIR)\edit.obj" \ @@ -803,25 +797,6 @@ SOURCE=..\lib\crc32.cpp !ENDIF -FILENAME=crypto -SOURCE=..\lib\crypto.cpp -!IF "$(CFG)" == "wx-console - Win32 Release" - - -"$(INTDIR)\$(FILENAME).obj" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ELSEIF "$(CFG)" == "wx-console - Win32 Debug" - - -"$(INTDIR)\$(FILENAME).obj" "$(INTDIR)\$(FILENAME).sbr" : $(SOURCE) "$(INTDIR)" - $(CPP) $(CPP_PROJ) $(SOURCE) - - -!ENDIF - - FILENAME=daemon SOURCE=..\lib\daemon.cpp !IF "$(CFG)" == "wx-console - Win32 Release" diff --git a/bacula/src/wx-console/Makefile.in b/bacula/src/wx-console/Makefile.in index 214887256d..293f49699c 100644 --- a/bacula/src/wx-console/Makefile.in +++ b/bacula/src/wx-console/Makefile.in @@ -126,7 +126,7 @@ depend: @$(MV) Makefile Makefile.bak @$(SED) "/^# DO NOT DELETE:/,$$ d" Makefile.bak > Makefile @$(ECHO) "# DO NOT DELETE: nice dependency list follows" >> Makefile - @$(CXX) -S -M $(CPPFLAGS) $(CONS_CPPFLAGS) -I$(srcdir) -I$(basedir) $(CONSSRCS) >> Makefile + @$(CXX) -S -M $(CPPFLAGS) $(CONS_CPPFLAGS) -I$(srcdir) -I$(basedir) $(OPENSSL_INC) $(CONSSRCS) >> Makefile @if test -f Makefile ; then \ $(RMF) Makefile.bak; \ else \ diff --git a/bacula/src/wx-console/console_conf.c b/bacula/src/wx-console/console_conf.c index b6c05f7151..c13abcac29 100644 --- a/bacula/src/wx-console/console_conf.c +++ b/bacula/src/wx-console/console_conf.c @@ -81,8 +81,8 @@ static RES_ITEM cons_items[] = { {"rcfile", store_dir, ITEM(res_cons.rc_file), 0, 0, 0}, {"historyfile", store_dir, ITEM(res_cons.hist_file), 0, 0, 0}, {"password", store_password, ITEM(res_cons.password), 0, ITEM_REQUIRED, 0}, - {"tlsenable", store_bit, ITEM(res_cons.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_cons.tls_require), 1, 0, 0}, + {"tlsenable", store_yesno, ITEM(res_cons.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_cons.tls_require), 1, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(res_cons.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_cons.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_cons.tls_certfile), 0, 0, 0}, @@ -98,8 +98,8 @@ static RES_ITEM dir_items[] = { {"dirport", store_int, ITEM(res_dir.DIRport), 0, ITEM_DEFAULT, 9101}, {"address", store_str, ITEM(res_dir.address), 0, 0, 0}, {"password", store_password, ITEM(res_dir.password), 0, ITEM_REQUIRED, 0}, - {"tlsenable", store_bit, ITEM(res_dir.tls_enable), 1, 0, 0}, - {"tlsrequire", store_bit, ITEM(res_dir.tls_require), 1, 0, 0}, + {"tlsenable", store_yesno, ITEM(res_dir.tls_enable), 1, 0, 0}, + {"tlsrequire", store_yesno, ITEM(res_dir.tls_require), 1, 0, 0}, {"tlscacertificatefile", store_dir, ITEM(res_dir.tls_ca_certfile), 0, 0, 0}, {"tlscacertificatedir", store_dir, ITEM(res_dir.tls_ca_certdir), 0, 0, 0}, {"tlscertificate", store_dir, ITEM(res_dir.tls_certfile), 0, 0, 0}, diff --git a/gui/.cvsignore b/gui/.cvsignore deleted file mode 100644 index e1649d8074..0000000000 --- a/gui/.cvsignore +++ /dev/null @@ -1,6 +0,0 @@ -diff -config.status -config.out -config.log -autom4te.cache -kernsconfig diff --git a/gui/Makefile b/gui/Makefile deleted file mode 100644 index a026ecc2c6..0000000000 --- a/gui/Makefile +++ /dev/null @@ -1,140 +0,0 @@ -# -# gui Makefile.in -# -# Version $Id$ -# - -# autoconf/Make.common.in -*- Makefile -*- -# release date (man), LSM date, version number/name, current maintainer -DATE="18 January 2006" -LSMDATE=@LSMDATE@ -VERSION=1.38.5 -VERNAME=bacula-$(VERSION)# -MAINT=Kern Sibbald# -MAINTEMAIL=# -#------------------------------------------------------------------------- - -SHELL = /bin/sh - -# Installation target directories & other installation stuff -prefix = /usr/local -exec_prefix = ${prefix} -binprefix = -manprefix = -sbindir = ${exec_prefix}/sbin -sysconfdir = ${prefix}/etc -scriptdir = @scriptdir@ -mandir = ${prefix}/man/man1 -manext = 1 - -# Tools & program stuff -MV = /bin/mv -RM = /bin/rm -RMF = /bin/rm -f -CP = /bin/cp -SED = @SED@ -AWK = /usr/bin/gawk -ECHO = /bin/echo -CMP = @CMP@ -INSTALL = /usr/bin/install -c -# add the -s to the following in PRODUCTION mode -INSTALL_PROGRAM = /usr/bin/install -c -m @SBINPERM@ -INSTALL_DATA = /usr/bin/install -c -m 644 -INSTALL_SCRIPT = /usr/bin/install -c -m @SBINPERM@ -INSTALL_CONFIG = /usr/bin/install -c -m 640 - - -# End of common section of the Makefile -#------------------------------------------------------------------------- - -srcdir = . - -.PATH: . -topdir = . -thisdir = . - - -first_rule: all -dummy: - -MKDIR = $(topdir)/autoconf/mkinstalldirs - -#------------------------------------------------------------------------- - -all: Makefile - - -depend: - - -#------------------------------------------------------------------------- - - -install: - -uninstall: - -configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in - cd $(srcdir); - ${RMF} -f config.cache config.log config.out config.status src/config.h - autoconf --prepend-include=$(srcdir)/autoconf \ - autoconf/configure.in > configure - chmod 755 configure - -Makefile: Makefile.in - cd $(topdir) \ - && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -Makefiles: - $(SHELL) config.status - -clean: - @$(RMF) *~ 1 2 3 diff */diff *.tar.gz - @$(RMF) config.log config.out config.status - @rm -rf autom4te.cache - -# clean for distribution -distclean: clean - @$(RMF) -rf CVS - -devclean: clean - @for subdir in freebsd linux solaris; do \ - if [ -f $${subdir}/Makefile ]; then \ - (cd $${subdir}; $(MAKE) devclean) \ - fi; \ - -release-bacula-web: - (cwd=`pwd`; rm -rf /tmp/bacula-web-$(VERSION); \ - cd ..; cp -rp $$cwd/bacula-web /tmp/bacula-web-$(VERSION); \ - cd /tmp/bacula-web-$(VERSION); \ - make clean; \ - find . -name ".#*" -exec rm -rf {} \; ; \ - find . -name "CVS" -exec rm -rf {} \; ; \ - find . -name ".cvsignore" -exec rm -rf {} \; ; \ - rm -rf autom4te.cache; \ - cd ..; \ - tar cvfz $$cwd/bacula-web-$(VERSION).tar.gz bacula-web-$(VERSION); \ - rm -rf /tmp/bacula-web-$(VERSION); \ - echo " "; \ - echo "bacula-web release is in: $$cwd/bacula-web-$(VERSION).tar.gz"; \ - echo " ") - -release-bimagemgr: - (cwd=`pwd`; rm -rf /tmp/bimagemgr-$(VERSION); \ - cd ..; cp -rp $$cwd/bimagemgr /tmp/bimagemgr-$(VERSION); \ - cd /tmp/bimagemgr-$(VERSION); \ - make clean; \ - find . -name ".#*" -exec rm -rf {} \; ; \ - find . -name "CVS" -exec rm -rf {} \; ; \ - find . -name ".cvsignore" -exec rm -rf {} \; ; \ - rm -rf autom4te.cache; \ - cd ..; \ - tar cvfz $$cwd/bimagemgr-$(VERSION).tar.gz bimagemgr-$(VERSION); \ - rm -rf /tmp/bimagemgr-$(VERSION); \ - echo " "; \ - echo "bimagemgr release is in: $$cwd/bimagemgr-$(VERSION).tar.gz"; \ - echo " ") - -release: clean release-bacula-web release-bimagemgr - -# ------------------------------------------------------------------------ diff --git a/gui/Makefile.in b/gui/Makefile.in deleted file mode 100755 index abc5de3b30..0000000000 --- a/gui/Makefile.in +++ /dev/null @@ -1,98 +0,0 @@ -# -# gui Makefile.in -# -# Version $Id$ -# -@MCOMMON@ - -srcdir = @srcdir@ -VPATH = @srcdir@ -.PATH: @srcdir@ -topdir = . -thisdir = . - - -first_rule: all -dummy: - -MKDIR = $(topdir)/autoconf/mkinstalldirs - -#------------------------------------------------------------------------- - -all: Makefile - - -depend: - - -#------------------------------------------------------------------------- - - -install: - -uninstall: - -configure: autoconf/configure.in autoconf/aclocal.m4 autoconf/acconfig.h autoconf/config.h.in - cd $(srcdir); - ${RMF} -f config.cache config.log config.out config.status src/config.h - autoconf --prepend-include=$(srcdir)/autoconf \ - autoconf/configure.in > configure - chmod 755 configure - -Makefile: Makefile.in - cd $(topdir) \ - && CONFIG_FILES=$(thisdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -Makefiles: - $(SHELL) config.status - -clean: - @$(RMF) *~ 1 2 3 diff */diff *.tar.gz - @$(RMF) config.log config.out config.status - @rm -rf autom4te.cache - -# clean for distribution -distclean: clean - @$(RMF) -rf CVS - -devclean: clean - @for subdir in freebsd linux solaris; do \ - if [ -f $${subdir}/Makefile ]; then \ - (cd $${subdir}; $(MAKE) devclean) \ - fi; \ - -release-bacula-web: - (cwd=`pwd`; rm -rf /tmp/bacula-web-$(VERSION); \ - cd ..; cp -rp $$cwd/bacula-web /tmp/bacula-web-$(VERSION); \ - cd /tmp/bacula-web-$(VERSION); \ - make clean; \ - find . -name ".#*" -exec rm -rf {} \; ; \ - find . -name "CVS" -exec rm -rf {} \; ; \ - find . -name ".cvsignore" -exec rm -rf {} \; ; \ - rm -rf autom4te.cache; \ - cd ..; \ - tar cvfz $$cwd/bacula-web-$(VERSION).tar.gz bacula-web-$(VERSION); \ - rm -rf /tmp/bacula-web-$(VERSION); \ - echo " "; \ - echo "bacula-web release is in: $$cwd/bacula-web-$(VERSION).tar.gz"; \ - echo " ") - -release-bimagemgr: - (cwd=`pwd`; rm -rf /tmp/bimagemgr-$(VERSION); \ - cd ..; cp -rp $$cwd/bimagemgr /tmp/bimagemgr-$(VERSION); \ - cd /tmp/bimagemgr-$(VERSION); \ - make clean; \ - find . -name ".#*" -exec rm -rf {} \; ; \ - find . -name "CVS" -exec rm -rf {} \; ; \ - find . -name ".cvsignore" -exec rm -rf {} \; ; \ - rm -rf autom4te.cache; \ - cd ..; \ - tar cvfz $$cwd/bimagemgr-$(VERSION).tar.gz bimagemgr-$(VERSION); \ - rm -rf /tmp/bimagemgr-$(VERSION); \ - echo " "; \ - echo "bimagemgr release is in: $$cwd/bimagemgr-$(VERSION).tar.gz"; \ - echo " ") - -release: clean release-bacula-web release-bimagemgr - -# ------------------------------------------------------------------------ diff --git a/gui/README b/gui/README deleted file mode 100644 index 16540a97ce..0000000000 --- a/gui/README +++ /dev/null @@ -1,50 +0,0 @@ - -This is the Bacula GUI directory. It contains graphical tools for -Bacula, and consists of the following subdirectories: - - Directory Contents - bacula-web A management level tool for reporting Backup - job status. It is a Web based application that - uses php. - bimagemgr A web based tool for managing and burning CD - images of Volumes created by Bacula. - -Build instructions: - -First, you must do: - - cd - ./configure --with-bacula= - - This will find the current Bacula version, and create - all the Makefiles from Makefile.in - - Do not edit the Makefiles or your changes will be lost. Always - edit Makefile.in - -For bacula-web: - cd bacula-web - examine the README - or alternatively use the html document released as - bacula-docs-nn.mm.xx.tar.gz - -For bimagemgr: - There are a number of additional configuration options that - you may specify on the ./configure line shown above. To see - them enter: ./configure --help - cd bimagemgr - make - make install - ... - -To create a distribution tar file - cd - ./configure --with-bacula= - make clean - make - make release - - The output will be two .tar.gz files in the current directory - with the names bacula-web-.tar.gz and - bimagemgr-.tar.gz - It will print the name. diff --git a/gui/autoconf/.cvsignore b/gui/autoconf/.cvsignore deleted file mode 100644 index 2ab7eba232..0000000000 --- a/gui/autoconf/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -config.log -Make.common -config.h.in diff --git a/gui/autoconf/Make.common.in b/gui/autoconf/Make.common.in deleted file mode 100644 index dfd552bac8..0000000000 --- a/gui/autoconf/Make.common.in +++ /dev/null @@ -1,42 +0,0 @@ -# autoconf/Make.common.in -*- Makefile -*- -# release date (man), LSM date, version number/name, current maintainer -DATE="@DATE@" -LSMDATE=@LSMDATE@ -VERSION=@VERSION@ -VERNAME=bacula-$(VERSION)# -MAINT=Kern Sibbald# -MAINTEMAIL=# -#------------------------------------------------------------------------- - -SHELL = /bin/sh - -# Installation target directories & other installation stuff -prefix = @prefix@ -exec_prefix = @exec_prefix@ -binprefix = -manprefix = -sbindir = @sbindir@ -sysconfdir = @sysconfdir@ -scriptdir = @scriptdir@ -mandir = @mandir@/man1 -manext = 1 - -# Tools & program stuff -MV = @MV@ -RM = @RM@ -RMF = @RM@ -f -CP = @CP@ -SED = @SED@ -AWK = @AWK@ -ECHO = @ECHO@ -CMP = @CMP@ -INSTALL = @INSTALL@ -# add the -s to the following in PRODUCTION mode -INSTALL_PROGRAM = @INSTALL@ -m @SBINPERM@ -INSTALL_DATA = @INSTALL@ -m 644 -INSTALL_SCRIPT = @INSTALL@ -m @SBINPERM@ -INSTALL_CONFIG = @INSTALL@ -m 640 - - -# End of common section of the Makefile -#------------------------------------------------------------------------- diff --git a/gui/autoconf/acconfig.h b/gui/autoconf/acconfig.h deleted file mode 100644 index 1d86c66dec..0000000000 --- a/gui/autoconf/acconfig.h +++ /dev/null @@ -1,24 +0,0 @@ -/* ------------------------------------------------------------------------- */ -/* -- CONFIGURE SPECIFIED FEATURES -- */ -/* ------------------------------------------------------------------------- */ - - -/* ------------------------------------------------------------------------- */ -/* -- CONFIGURE DETECTED FEATURES -- */ -/* ------------------------------------------------------------------------- */ - -/* Operating systems */ -/* OSes */ -#undef HAVE_LINUX_OS -#undef HAVE_FREEBSD_OS -#undef HAVE_NETBSD_OS -#undef HAVE_OPENBSD_OS -#undef HAVE_BSDI_OS -#undef HAVE_HPUX_OS -#undef HAVE_SUN_OS -#undef HAVE_IRIX_OS -#undef HAVE_AIX_OS -#undef HAVE_SGI_OS -#undef HAVE_CYGWIN -#undef HAVE_OSF1_OS -#undef HAVE_DARWIN_OS diff --git a/gui/autoconf/aclocal.m4 b/gui/autoconf/aclocal.m4 deleted file mode 100644 index eb5b2c8656..0000000000 --- a/gui/autoconf/aclocal.m4 +++ /dev/null @@ -1,196 +0,0 @@ -dnl - -AC_DEFUN(BA_CONDITIONAL, -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) - - -AC_DEFUN(BA_CHECK_OPSYS, -[ -AC_CYGWIN -if test $HAVE_UNAME=yes -a x`uname -s` = xSunOS -then - BA_CONDITIONAL(HAVE_SUN_OS, $TRUEPRG) - AC_DEFINE(HAVE_SUN_OS) -else - BA_CONDITIONAL(HAVE_SUN_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xOSF1 -then - BA_CONDITIONAL(HAVE_OSF1_OS, $TRUEPRG) - AC_DEFINE(HAVE_OSF1_OS) -else - BA_CONDITIONAL(HAVE_OSF1_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xAIX -then - BA_CONDITIONAL(HAVE_AIX_OS, $TRUEPRG) - AC_DEFINE(HAVE_AIX_OS) -else - BA_CONDITIONAL(HAVE_AIX_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX -then - BA_CONDITIONAL(HAVE_HPUX_OS, $TRUEPRG) - AC_DEFINE(HAVE_HPUX_OS) -else - BA_CONDITIONAL(HAVE_HPUX_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xLinux -then - BA_CONDITIONAL(HAVE_LINUX_OS, $TRUEPRG) - AC_DEFINE(HAVE_LINUX_OS) -else - BA_CONDITIONAL(HAVE_LINUX_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD -then - BA_CONDITIONAL(HAVE_FREEBSD_OS, $TRUEPRG) - AC_DEFINE(HAVE_FREEBSD_OS) -else - BA_CONDITIONAL(HAVE_FREEBSD_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD -then - BA_CONDITIONAL(HAVE_NETBSD_OS, $TRUEPRG) - AC_DEFINE(HAVE_NETBSD_OS) -else - BA_CONDITIONAL(HAVE_NETBSD_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD -then - BA_CONDITIONAL(HAVE_OPENBSD_OS, $TRUEPRG) - AC_DEFINE(HAVE_OPENBSD_OS) -else - BA_CONDITIONAL(HAVE_OPENBSD_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS -then - BA_CONDITIONAL(HAVE_BSDI_OS, $TRUEPRG) - AC_DEFINE(HAVE_BSDI_OS) -else - BA_CONDITIONAL(HAVE_BSDI_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xSGI -then - BA_CONDITIONAL(HAVE_SGI_OS, $TRUEPRG) - AC_DEFINE(HAVE_SGI_OS) -else - BA_CONDITIONAL(HAVE_SGI_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX -then - BA_CONDITIONAL(HAVE_IRIX_OS, $TRUEPRG) - AC_DEFINE(HAVE_IRIX_OS) -else - BA_CONDITIONAL(HAVE_IRIX_OS, $FALSEPRG) -fi - -if test $HAVE_UNAME=yes -a x`uname -s` = xDarwin -then - AM_CONDITIONAL(HAVE_DARWIN_OS, $TRUEPRG) - AC_DEFINE(HAVE_DARWIN_OS) -else - AM_CONDITIONAL(HAVE_DARWIN_OS, $FALSEPRG) -fi -]) - -AC_DEFUN(BA_CHECK_OPSYS_DISTNAME, -[AC_MSG_CHECKING(for Operating System Distribution) -if test "x$DISTNAME" != "x" -then - echo "distname set to $DISTNAME" -elif test $HAVE_UNAME=yes -a x`uname -s` = xOSF1 -then - DISTNAME=alpha -elif test $HAVE_UNAME=yes -a x`uname -s` = xAIX -then - DISTNAME=aix -elif test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX -then - DISTNAME=hpux -elif test $HAVE_UNAME=yes -a x`uname -s` = xSunOS -then - DISTNAME=solaris -elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD -then - DISTNAME=freebsd -elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD -then - DISTNAME=netbsd -elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD -then - DISTNAME=openbsd -elif test $HAVE_UNAME=yes -a x`uname -s` = xIRIX -then - DISTNAME=irix -elif test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS -then - DISTNAME=bsdi -elif test -f /etc/SuSE-release -then - DISTNAME=suse -elif test -d /etc/SuSEconfig -then - DISTNAME=suse5 -elif test -f /etc/mandrake-release -then - DISTNAME=mandrake -elif test -f /etc/whitebox-release -then - DISTNAME=redhat -elif test -f /etc/redhat-release -then - DISTNAME=redhat -elif test -f /etc/gentoo-release -then - DISTNAME=gentoo -elif test -f /etc/debian_version -then - DISTNAME=debian -elif test -f /etc/slackware-version -then - DISTNAME=slackware -elif test $HAVE_UNAME=yes -a x`uname -s` = xDarwin -then - DISTNAME=darwin -elif test -f /etc/engarde-version -then - DISTNAME=engarde -elif test "$CYGWIN" = yes -then - DISTNAME=cygwin - AC_DEFINE(HAVE_CYGWIN) -else - DISTNAME=unknown -fi -AC_MSG_RESULT(done) -]) - -AC_DEFUN(AM_CONDITIONAL, -[AC_SUBST($1_TRUE) -AC_SUBST($1_FALSE) -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi]) diff --git a/gui/autoconf/config.guess b/gui/autoconf/config.guess deleted file mode 100755 index 7d0185e019..0000000000 --- a/gui/autoconf/config.guess +++ /dev/null @@ -1,1447 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. - -timestamp='2004-09-07' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" >&2 - exit 1 ;; - * ) - break ;; - esac -done - -if test $# != 0; then - echo "$me: too many arguments$help" >&2 - exit 1 -fi - -trap 'exit 1' 1 2 15 - -# CC_FOR_BUILD -- compiler used by this script. Note that the use of a -# compiler to aid in system detection is discouraged as it requires -# temporary files to be created and, as you can see below, it is a -# headache to deal with in a portable fashion. - -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. - -# Portable tmp directory creation inspired by the Autoconf team. - -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ;' - -# This is needed to find uname on a Pyramid OSx when run in the BSD universe. -# (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then - PATH=$PATH:/.attbin ; export PATH -fi - -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown - -# Note: order is significant - the case branches are not exclusive. - -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in - *:NetBSD:*:*) - # NetBSD (nbsd) targets should (where applicable) match one or - # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, - # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently - # switched to ELF, *-*-netbsd* would select the old - # object file format. This provides both forward - # compatibility and a consistent mechanism for selecting the - # object file format. - # - # Note: NetBSD doesn't particularly care about the vendor - # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || echo unknown)` - case "${UNAME_MACHINE_ARCH}" in - armeb) machine=armeb-unknown ;; - arm*) machine=arm-unknown ;; - sh3el) machine=shl-unknown ;; - sh3eb) machine=sh-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; - esac - # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build - if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit 0 ;; - amd64:OpenBSD:*:*) - echo x86_64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - amiga:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - cats:OpenBSD:*:*) - echo arm-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - hp300:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - luna88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mac68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - macppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme68k:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvme88k:OpenBSD:*:*) - echo m88k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - mvmeppc:OpenBSD:*:*) - echo powerpc-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sgi:OpenBSD:*:*) - echo mips64-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - sun3:OpenBSD:*:*) - echo m68k-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:OpenBSD:*:*) - echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE} - exit 0 ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit 0 ;; - macppc:MirBSD:*:*) - echo powerppc-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit 0 ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - exit 0 ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit 0 ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit 0 ;; - Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit 0;; - *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit 0 ;; - *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit 0 ;; - *:OS/390:*:*) - echo i370-ibm-openedition - exit 0 ;; - *:OS400:*:*) - echo powerpc-ibm-os400 - exit 0 ;; - arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit 0;; - SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit 0;; - Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) - # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit 0 ;; - NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit 0 ;; - DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit 0 ;; - DRS?6000:UNIX_SV:4.2*:7*) - case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7 && exit 0 ;; - esac ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - i86pc:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit 0 ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit 0 ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit 0 ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit 0 ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit 0 ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit 0 ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit 0 ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit 0 ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit 0 ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit 0 ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit 0 ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit 0 ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit 0 ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c \ - && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ - && exit 0 - echo mips-mips-riscos${UNAME_RELEASE} - exit 0 ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit 0 ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit 0 ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit 0 ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit 0 ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit 0 ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit 0 ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit 0 ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit 0 ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit 0 ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit 0 ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit 0 ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit 0 ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit 0 ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo rs6000-ibm-aix3.2.5 - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit 0 ;; - *:AIX:*:[45]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then - IBM_ARCH=rs6000 - else - IBM_ARCH=powerpc - fi - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit 0 ;; - *:AIX:*:*) - echo rs6000-ibm-aix - exit 0 ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit 0 ;; - ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit 0 ;; # report: romp-ibm BSD 4.3 - *:BOSX:*:*) - echo rs6000-bull-bosx - exit 0 ;; - DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit 0 ;; - 9000/[34]??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit 0 ;; - hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit 0 ;; - 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; - 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 - 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 - esac ;; - esac - fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - - #define _HPUX_SOURCE - #include - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - # avoid double evaluation of $set_cc_for_build - test -n "$CC_FOR_BUILD" || eval $set_cc_for_build - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit 0 ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit 0 ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0 - echo unknown-hitachi-hiuxwe2 - exit 0 ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit 0 ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit 0 ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit 0 ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit 0 ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit 0 ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit 0 ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit 0 ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit 0 ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit 0 ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit 0 ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit 0 ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit 0 ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit 0 ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit 0 ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit 0 ;; - *:FreeBSD:*:*) - echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit 0 ;; - i*:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit 0 ;; - i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit 0 ;; - x86:Interix*:[34]*) - echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//' - exit 0 ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit 0 ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit 0 ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit 0 ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit 0 ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit 0 ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit 0 ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit 0 ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit 0 ;; - arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - cris:Linux:*:*) - echo cris-axis-linux-gnu - exit 0 ;; - crisv32:Linux:*:*) - echo crisv32-axis-linux-gnu - exit 0 ;; - frv:Linux:*:*) - echo frv-unknown-linux-gnu - exit 0 ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - mips:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips - #undef mipsel - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=` - test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0 - ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit 0 ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit 0 ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit 0 ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit 0 ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit 0 ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit 0 ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit 0 ;; - x86_64:Linux:*:*) - echo x86_64-unknown-linux-gnu - exit 0 ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit 0 ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit 0 ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit 0 ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #ifdef __INTEL_COMPILER - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=` - test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0 - test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0 - ;; - i*86:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit 0 ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit 0 ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit 0 ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit 0 ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit 0 ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit 0 ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit 0 ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit 0 ;; - i*86:*:5:[78]*) - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit 0 ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit 0 ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit 0 ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit 0 ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit 0 ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit 0 ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit 0 ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit 0 ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit 0 ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4.3${OS_REL} && exit 0 - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && echo i486-ncr-sysv4 && exit 0 ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit 0 ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit 0 ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit 0 ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit 0 ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit 0 ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit 0 ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit 0 ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit 0 ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit 0 ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit 0 ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit 0 ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit 0 ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit 0 ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit 0 ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit 0 ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit 0 ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit 0 ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit 0 ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - *86) UNAME_PROCESSOR=i686 ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit 0 ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit 0 ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit 0 ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit 0 ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit 0 ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit 0 ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit 0 ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit 0 ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit 0 ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit 0 ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit 0 ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit 0 ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit 0 ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit 0 ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit 0 ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit 0 ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms && exit 0 ;; - I*) echo ia64-dec-vms && exit 0 ;; - V*) echo vax-dec-vms && exit 0 ;; - esac -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0 - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit 0 ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit 0 ;; - c34*) - echo c34-convex-bsd - exit 0 ;; - c38*) - echo c38-convex-bsd - exit 0 ;; - c4*) - echo c4-convex-bsd - exit 0 ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/gui/autoconf/config.h.in b/gui/autoconf/config.h.in deleted file mode 100644 index e15bcecaaa..0000000000 --- a/gui/autoconf/config.h.in +++ /dev/null @@ -1,32 +0,0 @@ -/* autoconf/config.h.in. Generated from autoconf/configure.in by autoheader. */ -/* ------------------------------------------------------------------------- */ -/* -- CONFIGURE SPECIFIED FEATURES -- */ -/* ------------------------------------------------------------------------- */ - - -/* ------------------------------------------------------------------------- */ -/* -- CONFIGURE DETECTED FEATURES -- */ -/* ------------------------------------------------------------------------- */ - -/* Define if you have GCC */ -#undef HAVE_GCC - -/* General libs */ -#undef LIBS - -/* Operating systems */ -/* OSes */ -#undef HAVE_LINUX_OS -#undef HAVE_FREEBSD_OS -#undef HAVE_NETBSD_OS -#undef HAVE_OPENBSD_OS -#undef HAVE_BSDI_OS -#undef HAVE_HPUX_OS -#undef HAVE_SUN_OS -#undef HAVE_IRIX_OS -#undef HAVE_AIX_OS -#undef HAVE_SGI_OS -#undef HAVE_CYGWIN -#undef HAVE_OSF1_OS -#undef HAVE_DARWIN_OS - diff --git a/gui/autoconf/config.sub b/gui/autoconf/config.sub deleted file mode 100755 index edb6b663ca..0000000000 --- a/gui/autoconf/config.sub +++ /dev/null @@ -1,1555 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. - -timestamp='2004-08-29' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 -Free Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit 0 ;; - --version | -v ) - echo "$version" ; exit 0 ;; - --help | --h* | -h ) - echo "$usage"; exit 0 ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit 0;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | \ - kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) - os= - basic_machine=$1 - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fr30 | frv \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | m32r | m32rle | m68000 | m68k | m88k | mcore \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64vr | mips64vrel \ - | mips64orion | mips64orionel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | msp430 \ - | ns16k | ns32k \ - | openrisc | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \ - | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | v850 | v850e \ - | we32k \ - | x86 | xscale | xstormy16 | xtensa \ - | z8k) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* \ - | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | mcore-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | msp430-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tron-* \ - | v850-* | v850e-* | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ - | xtensa-* \ - | ymp-* \ - | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16c) - basic_machine=cr16c-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - or32 | or32-*) - basic_machine=or32-unknown - os=-coff - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown - ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* | -openbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-uclibc* | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit 0 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/gui/autoconf/configure.in b/gui/autoconf/configure.in deleted file mode 100644 index 66f93a7dd2..0000000000 --- a/gui/autoconf/configure.in +++ /dev/null @@ -1,288 +0,0 @@ -lal# -dnl# -dnl# Process this file with autoconf to produce a configure script. -dnl# -AC_INIT(autoconf/configure.in) -BUILD_DIR=`pwd` -cd .. -TOP_DIR=`pwd` -cd ${BUILD_DIR} -AC_SUBST(BUILD_DIR) -AC_CONFIG_AUX_DIR(${BUILD_DIR}/autoconf) - -dnl require a recent autoconf -AC_PREREQ(2.13) - - -# ------------------------------------------ -# Where to get Bacula source -# ------------------------------------------ -AC_ARG_WITH(bacula, - [ --with-bacula=PATH specify path to Bacula source], - [ - if test "x$withval" != "xno" ; then - bacula=$withval - fi - ] -) - -AC_SUBST(bacula) -if test "x$bacula" = "x" ; then - AC_MSG_ERROR(The Bacula source directory must be specified. Use --with-bacula=) -fi - -dnl Bacula version -VERSION=`sed -n -e 's/^.*VERSION.*"\(.*\)"$/\1/p' ${bacula}/src/version.h` -DATE=`sed -n -e 's/^.*[ \t]*BDATE.*"\(.*\)"$/\1/p' ${bacula}/src/version.h` -AC_SUBST(VERSION)dnl -AC_SUBST(DATE)dnl -if test "x$VERSION" = "x" ; then - AC_MSG_ERROR(Bacula version not found) -fi -echo "configuring for Bacula source $VERSION ($DATE)" - - -dnl search for true and false programs. -AC_PATH_PROGS(TRUEPRG, true, :) -AC_PATH_PROGS(FALSEPRG, false, :) - -AC_PROG_AWK -# Some AWK programs fail, so test it and warn the user -if echo xfoo | $AWK 'BEGIN { prog=ARGV[1]; ARGC=1 } - { if ((prog == $2) || (("(" prog ")") == $2) || - (("[" prog "]") == $2) || - ((prog ":") == $2)) { print $1 ; exit 0 } }' xfoo>/dev/null; then :; -else - AC_MSG_ERROR([!!!!!!!!! WARNING !!!!!!!!!!!!!! - The regex engine of $AWK is too broken to be used you - might want to install GNU AWK. - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!]) -fi -THE_AWK=$AWK -AC_PATH_PROG(AWK, $THE_AWK, $THE_AWK) - - -dnl ------------------------------------------------------- -dnl# Check for programs. -dnl ------------------------------------------------------ -AC_PROG_INSTALL -AC_PATH_PROG(MV, mv, mv) -AC_PATH_PROG(RM, rm, rm) -AC_PATH_PROG(CP, cp, cp) -AC_PATH_PROG(ECHO, echo, echo) -AC_PATH_PROG(AR, ar, ar) - -dnl -------------------------------------------------- -dnl OP Sys determination (see aclocal.m4) -dnl -------------------------------------------------- -BA_CHECK_OPSYS - -# ----------------------------------------------------------- -dnl OPSys Distribution determination (see aclocal.m4) -# ---------------------------------------------------------- -BA_CHECK_OPSYS_DISTNAME - -# ------------------------------------------------------------------------- -# If the user has not set --exec-prefix, we default to ${prefix} -# ------------------------------------------------------------------------- -if test x${exec_prefix} = xNONE ; then - exec_prefix=${prefix} -fi - - -dnl# -------------------------------------------------------------------------- -dnl# CHECKING COMMAND LINE OPTIONS -dnl# -------------------------------------------------------------------------- - - -# ------------------------------------------------------------------------- -# Set variables for bimagemgr installation -# ------------------------------------------------------------------------- -bimagemgr_cgidir=/var/www/cgi-bin -AC_ARG_WITH(bimagemgr-cgidir, - [ --with-bimagemgr-cgidir=DIR specify bimagemgr cgi-bin dir], - [ - if test "x$withval" != "xno" ; then - bimagemgr_cgidir=$withval - fi - ] -) - -bimagemgr_docdir=/var/www/html -AC_ARG_WITH(bimagemgr-docdir, - [ --with-bimagemgr-docdir=DIR specify bimagemgr doc root dir], - [ - if test "x$withval" != "xno" ; then - bimagemgr_docdir=$withval - fi - ] -) - -bimagemgr_binowner=root -AC_ARG_WITH(bimagemgr-binowner, - [ --with-bimagemgr-binowner=USER specify bimagemgr binary file owner], - [ - if test "x$withval" != "xno" ; then - bimagemgr_binowner=$withval - fi - ] -) - -bimagemgr_bingroup=root -AC_ARG_WITH(bimagemgr-bingroup, - [ --with-bimagemgr-bingroup=USER specify bimagemgr binary file group], - [ - if test "x$withval" != "xno" ; then - bimagemgr_bingroup=$withval - fi - ] -) - -bimagemgr_dataowner=apache -AC_ARG_WITH(bimagemgr-dataowner, - [ --with-bimagemgr-dataowner=USER specify bimagemgr data file owner], - [ - if test "x$withval" != "xno" ; then - bimagemgr_dataowner=$withval - fi - ] -) - -bimagemgr_datagroup=apache -AC_ARG_WITH(bimagemgr-datagroup, - [ --with-bimagemgr-datagroup=USER specify bimagemgr data file group], - [ - if test "x$withval" != "xno" ; then - bimagemgr_datagroup=$withval - fi - ] -) - -AC_SUBST(bimagemgr_cgidir) -AC_SUBST(bimagemgr_docdir) -AC_SUBST(bimagemgr_binowner) -AC_SUBST(bimagemgr_bingroup) -AC_SUBST(bimagemgr_dataowner) -AC_SUBST(bimagemgr_datagroup) - - -AC_SUBST(bacula) - -# -# Finally we set appropriate distribution specific -# variables and defaults -# -# PFILES are platform specific files -PFILES="" -WIN32= -MACOSX= -hostname=`uname -n | cut -d '.' -f 1` -case "$DISTNAME" in -aix) - DISTVER=`uname -r` - ;; -alpha) - DISTVER=`uname -r` - ;; -bsdi) - DISTVER=`uname -a |awk '{print $3}'` - ;; -cygwin) - DISTVER=`uname -a |awk '{print $3}'` - WIN32=win32 - ;; -darwin) - DISTVER=`uname -r` - ;; -debian) - DISTVER=`cat /etc/debian_version` - ;; -freebsd) - DISTVER=`uname -a |awk '{print $3}'` - ;; -hpux) - DISTVER=`uname -r` - ;; -irix) - DISTVER=`uname -r` - ;; -netbsd) - DISTVER=`uname -a |awk '{print $3}'` - ;; -openbsd) - DISTVER=`uname -a |awk '{print $3}'` - ;; -redhat) - if test -f /etc/whitebox-release ; then - f=/etc/whitebox-release - else - f=/etc/redhat-release - fi - if test `cat $f | grep release |\ - cut -f 3 -d ' '`x = "Enterprise"x ; then - DISTVER="Enterprise "`cat $f | grep release |\ - cut -f 6 -d ' '` - else - DISTVER=`cat /etc/redhat-release | grep release |\ - cut -f 5 -d ' '` - fi - hostname=`hostname -s` - ;; -mandrake) - DISTVER=`cat /etc/mandrake-release | grep release |\ - cut -f 5 -d ' '` - ;; -gentoo) - DISTVER=`awk '/version / {print $5}' < /etc/gentoo-release` - ;; -slackware) - DISTVER=`cat /etc/slackware-version` - ;; -solaris) - DISTVER=`uname -r` - ;; -suse) - DISTVER=`cat /etc/SuSE-release |grep VERSION|\ - cut -f 3 -d ' '` - ;; -suse5) - DISTNAME=suse - DISTVER=5.x - ;; -unknown) - DISTVER=unknown - ;; -*) - echo " === Something went wrong. Unknown DISTNAME $DISTNAME ===" - ;; -esac - -AC_SUBST(hostname) - -AC_SUBST(DISTNAME) -AC_SUBST(DISTVER) - -dnl# common parts of the Makefile -MCOMMON=./autoconf/Make.common -AC_SUBST_FILE(MCOMMON) - - -AC_OUTPUT([ \ - autoconf/Make.common \ - Makefile \ - bimagemgr/Makefile \ - bimagemgr/bacula-bimagemgr.spec \ - $PFILES ], - [ ] -) - - -echo " -Configuration on `date`: - - Host: $host -- ${DISTNAME} ${DISTVER} - Source code location: ${bacula} - - " > config.out - -cat config.out diff --git a/gui/autoconf/install-sh b/gui/autoconf/install-sh deleted file mode 100755 index 11870f1b01..0000000000 --- a/gui/autoconf/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -transformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - : -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - chmodcmd="" - else - instcmd=$mkdirprog - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f "$src" ] || [ -d "$src" ] - then - : - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - : - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - : - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' - ' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - : - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - : - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/gui/autoconf/install.sh b/gui/autoconf/install.sh deleted file mode 100755 index ea88212bb5..0000000000 --- a/gui/autoconf/install.sh +++ /dev/null @@ -1,235 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5. -# -# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ -# -# This script is compatible with the BSD install script, but was written -# from scratch. -# - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" - - -# put in absolute paths if you don't have them in your path; or use env. vars. - -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" - -tranformbasename="" -transform_arg="" -instcmd="$mvprog" -chmodcmd="$chmodprog 0755" -chowncmd="" -chgrpcmd="" -stripcmd="" -rmcmd="$rmprog -f" -mvcmd="$mvprog" -src="" -dst="" -dir_arg="" - -while [ x"$1" != x ]; do - case $1 in - -c) instcmd="$cpprog" - shift - continue;; - - -d) dir_arg=true - shift - continue;; - - -m) chmodcmd="$chmodprog $2" - shift - shift - continue;; - - -o) chowncmd="$chownprog $2" - shift - shift - continue;; - - -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; - - -s) stripcmd="$stripprog" - shift - continue;; - - -t=*) transformarg=`echo $1 | sed 's/-t=//'` - shift - continue;; - - -b=*) transformbasename=`echo $1 | sed 's/-b=//'` - shift - continue;; - - *) if [ x"$src" = x ] - then - src=$1 - else - # this colon is to work around a 386BSD /bin/sh bug - : - dst=$1 - fi - shift - continue;; - esac -done - -if [ x"$src" = x ] -then - echo "install: no input file specified" - exit 1 -else - true -fi - -if [ x"$dir_arg" != x ]; then - dst=$src - src="" - - if [ -d $dst ]; then - instcmd=: - else - instcmd=mkdir - fi -else - -# Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad -# if $src (and thus $dsttmp) contains '*'. - - if [ -f $src -o -d $src ] - then - true - else - echo "install: $src does not exist" - exit 1 - fi - - if [ x"$dst" = x ] - then - echo "install: no destination specified" - exit 1 - else - true - fi - -# If destination is a directory, append the input filename; if your system -# does not like double slashes in filenames, you may need to add some logic - - if [ -d $dst ] - then - dst="$dst"/`basename $src` - else - true - fi -fi - -## this sed command emulates the dirname command -dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` - -# Make sure that the destination directory exists. -# this part is taken from Noah Friedman's mkinstalldirs script - -# Skip lots of stat calls in the usual case. -if [ ! -d "$dstdir" ]; then -defaultIFS=' -' -IFS="${IFS-${defaultIFS}}" - -oIFS="${IFS}" -# Some sh's can't handle IFS=/ for some reason. -IFS='%' -set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` -IFS="${oIFS}" - -pathcomp='' - -while [ $# -ne 0 ] ; do - pathcomp="${pathcomp}${1}" - shift - - if [ ! -d "${pathcomp}" ] ; - then - $mkdirprog "${pathcomp}" - else - true - fi - - pathcomp="${pathcomp}/" -done -fi - -if [ x"$dir_arg" != x ] -then - $doit $instcmd $dst && - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi -else - -# If we're going to rename the final executable, determine the name now. - - if [ x"$transformarg" = x ] - then - dstfile=`basename $dst` - else - dstfile=`basename $dst $transformbasename | - sed $transformarg`$transformbasename - fi - -# don't allow the sed command to completely eliminate the filename - - if [ x"$dstfile" = x ] - then - dstfile=`basename $dst` - else - true - fi - -# Make a temp file name in the proper directory. - - dsttmp=$dstdir/#inst.$$# - -# Move or copy the file name to the temp name - - $doit $instcmd $src $dsttmp && - - trap "rm -f ${dsttmp}" 0 && - -# and set any options; do chmod last to preserve setuid bits - -# If any of these fail, we abort the whole thing. If we want to -# ignore errors from any of these, just make sure not to ignore -# errors from the above "$doit $instcmd $src $dsttmp" command. - - if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && - if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && - if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && - if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && - -# Now rename the file to the real destination. - - $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile - -fi && - - -exit 0 diff --git a/gui/autoconf/mkinstalldirs b/gui/autoconf/mkinstalldirs deleted file mode 100755 index 8ab885ec92..0000000000 --- a/gui/autoconf/mkinstalldirs +++ /dev/null @@ -1,99 +0,0 @@ -#! /bin/sh -# mkinstalldirs --- make directory hierarchy -# Author: Noah Friedman -# Created: 1993-05-16 -# Public domain - -errstatus=0 -dirmode="" - -usage="\ -Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." - -# process command line arguments -while test $# -gt 0 ; do - case "${1}" in - -h | --help | --h* ) # -h for help - echo "${usage}" 1>&2; exit 0 ;; - -m ) # -m PERM arg - shift - test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } - dirmode="${1}" - shift ;; - -- ) shift; break ;; # stop option processing - -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option - * ) break ;; # first non-opt arg - esac -done - -for file -do - if test -d "$file"; then - shift - else - break - fi -done - -case $# in -0) exit 0 ;; -esac - -case $dirmode in -'') - if mkdir -p -- . 2>/dev/null; then - echo "mkdir -p -- $*" - exec mkdir -p -- "$@" - fi ;; -*) - if mkdir -m "$dirmode" -p -- . 2>/dev/null; then - echo "mkdir -m $dirmode -p -- $*" - exec mkdir -m "$dirmode" -p -- "$@" - fi ;; -esac - -for file -do - set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` - shift - - pathcomp= - for d - do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp=./$pathcomp ;; - esac - - if test ! -d "$pathcomp"; then - echo "mkdir $pathcomp" - - mkdir "$pathcomp" || lasterr=$? - - if test ! -d "$pathcomp"; then - errstatus=$lasterr - else - if test ! -z "$dirmode"; then - echo "chmod $dirmode $pathcomp" - - lasterr="" - chmod "$dirmode" "$pathcomp" || lasterr=$? - - if test ! -z "$lasterr"; then - errstatus=$lasterr - fi - fi - fi - fi - - pathcomp="$pathcomp/" - done -done - -exit $errstatus - -# Local Variables: -# mode: shell-script -# sh-indentation: 3 -# End: -# mkinstalldirs ends here diff --git a/gui/bacula-web/.cvsignore b/gui/bacula-web/.cvsignore deleted file mode 100644 index 75790c67fc..0000000000 --- a/gui/bacula-web/.cvsignore +++ /dev/null @@ -1 +0,0 @@ -%%*.php diff --git a/gui/bacula-web/CONTACT b/gui/bacula-web/CONTACT deleted file mode 100644 index edc09b93b8..0000000000 --- a/gui/bacula-web/CONTACT +++ /dev/null @@ -1,2 +0,0 @@ - -Juan Luis Francés, bacula_list AT veloxia.com diff --git a/gui/bacula-web/COPYING b/gui/bacula-web/COPYING deleted file mode 100644 index 960fe7469f..0000000000 --- a/gui/bacula-web/COPYING +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/gui/bacula-web/ChangeLog b/gui/bacula-web/ChangeLog deleted file mode 100644 index 295de189ae..0000000000 --- a/gui/bacula-web/ChangeLog +++ /dev/null @@ -1,40 +0,0 @@ -26-01-2006 Bacula-web 1.3 - - (0000019,0000021) Fixed psql querys. - - Fixed XTicks (Graphs). - -06-10-2005 Bacula web 1.2 - - Human redable Y-axis of graphs - - Updated French translation - - Initial support for PostgreSQL (thanks to Dan Langille) - - Upgrade Phplot to 5.0rc2 version. - - Added templates_c to cvs repository. - - Added German translation - - Fix mysql database size (reported by Roland Arendes) - - Added JobID column in report template. (thanks to Stephan Ebeit) - - Upgraded Smarty to 2.6.10 version. - - Added multicatalog support - -25-10-2004 Bacula web 1.1 - - Add array_fill function (as Mikael suggested) - - Fix url encode of links. (reported by Phil Stracchino) - - Upgraded Smarty to 2.6.6 version. - - Add French translation - -04-08-2004 Bacula web 1.0 - - Add Italian translation - - Change some colors of graphs. More clear now (I hope). - - (0000012) Fix, don't load config in report.php - - (0000015) Fix, error date in When expire? field. - -14-06-2004 Bacula web 1.0 Beta2 - - (0000009) Fix incorrect date of "select report". - - (0000010) Fix incorrect symbolic link (Add paths.php). - - (0000008) Fix elapsed time of execution of jobs more than 24h in Lite mode. - -11-06-2004 Bacula-web 1.0 Beta1 - - Check connection error (reported by Thomas Contamine) - - register_globals on/off compatible (reported by Thomas Contamine) - - Fix bug in graph type=69. The data now is correct. - - Fix config system. - - Very internal fixes. - + Add "Last report". diff --git a/gui/bacula-web/README b/gui/bacula-web/README deleted file mode 100644 index dfd6bccce2..0000000000 --- a/gui/bacula-web/README +++ /dev/null @@ -1,64 +0,0 @@ -This is my little contribution to the bacula community and the -best backup software (http://www.bacula.org). - -Juan Luis Francés Jiménez (bacula_list [at] veloxia.com) - -News and bugs: http://indpnday.com/bacula_stuff/bacula-web/mantisbt/login_page.php - -REQUIREMENTS: -************** - - - Web server (Tested with apache) - - PHP (Tested with php.4.3.4) - - Gettext (Optional) - - GD 2.x - - TrueType (optional) - - Pear DB (http://pear.php.net/package/DB) - - MySQL or PostgreSQL - - Sessions - - If you use PostgreSQL - - dbsize contrib package - - Bacula (Oh!, yes, you need this ;-) ) http://www.bacula.org - - -INSTALL -******* -- Copy this distribution to root directory or a subdirectory of your webroot. -- Edit configs/bacula.conf with your preferences -- Run "test.php" from your browser. - - -NOTES -***** -- Best resolution: 1024x768 -- Best viewed with Firefox. -- Tested with Microsoft Explorer. -- Restart web server if language changes isn't showing itself. - -KNOWN BUGS -********** -- In Pie graphs, the margins don't work. It is a phplot bug. -- The total elapsed time "calculation" is rudimentary. If you have 2 or more concurrency jobs this is not real. - -Send your bugs at this link: http://indpnday.com/bacula_stuff/bacula-web/mantisbt/login_page.php - -TEMPLATES -********* -- In this version you will have to edit code pages (*.php) to show diferent templates. -- Bacula-web needs a good designer!!! ;-) - -TRANSLATIONS -************ -- Edit "messages.po" and send me, please, with your LANGUAGE code. - -- You can extract strings with this command: -$ ./tsmarty2c.php templates > lang.c -$ xgettext lang.c -- Now you must have this file: messages.po -- Edit and send me, please. - - -PS: Feel free to make improvements to the code. All suggestions are welcome. - - -Bacula®is a registered trademark of Kern Sibbald and John Walker diff --git a/gui/bacula-web/TODO b/gui/bacula-web/TODO deleted file mode 100644 index 98ceb42343..0000000000 --- a/gui/bacula-web/TODO +++ /dev/null @@ -1,17 +0,0 @@ -- Improve check errors routines. -- Improve security. (stats.php mainly) -- Optimize database querys (Very poor now) (TO_DAYS,etc.). -- Improve PostgreSQL support. -- Autoresolution of web and graphics (Now only 1024x768) -- SQLPrepareData - type = ALL_CLIENTS_PERIOD_REPORT -- Elapsed time of full execution of clients. (rudimentaryly done) -- Graph generator for "General data". -- Change template from bacula.config -- Show clients and their jobs in a selectable menu. - -LOW PRIORITY ------------- -- WebConsole!!! -- Add support to PDF creation. -- Build documentation of classes. -- Best icons and design ;-) \ No newline at end of file diff --git a/gui/bacula-web/array_fill.func.php b/gui/bacula-web/array_fill.func.php deleted file mode 100644 index d6c23c823b..0000000000 --- a/gui/bacula-web/array_fill.func.php +++ /dev/null @@ -1,14 +0,0 @@ - \ No newline at end of file diff --git a/gui/bacula-web/classes.inc b/gui/bacula-web/classes.inc deleted file mode 100644 index ec57f26f71..0000000000 --- a/gui/bacula-web/classes.inc +++ /dev/null @@ -1,503 +0,0 @@ -dbs = array(); - $i = 2; - $sections = $conf->get(CONFIG_FILE,"DATABASE","host"); - array_push($this->dbs, "DATABASE"); - while ( !empty($sections) ) { - $sections = $conf->get(CONFIG_FILE,"DATABASE".$i,"host"); - if ( !empty($sections) ) - array_push($this->dbs,"DATABASE".$i); - $i++; - } - - if ( $i < 4) - $sec = "DATABASE"; - else { - if ( !empty($_POST['sel_database']) ) { - $_SESSION['DATABASE'] = $_POST['sel_database']; - $sec = $_POST['sel_database']; - } else { - if (isset($_SESSION['DATABASE']) ) - $sec = $_SESSION['DATABASE']; - else - $sec = "DATABASE"; - } - } - - $this->dsn['hostspec'] = $conf->get(CONFIG_FILE,$sec,"host"); - $this->dsn['username'] = $conf->get(CONFIG_FILE,$sec,"login"); - $this->dsn['password'] = $conf->get(CONFIG_FILE,$sec,"pass"); - $this->dsn['database'] = $conf->get(CONFIG_FILE,$sec,"db_name"); - $this->dsn['phptype'] = $conf->get(CONFIG_FILE,$sec,"db_type"); // mysql, pgsql - if ( $conf->get(CONFIG_FILE,$sec,"db_port") ) - $this->dsn[port] = $conf->get(CONFIG_FILE,$sec,"db_port"); - - $this->link =& $this->connect($this->dsn); - - if (DB::isError($this->link)) - die($this->link->getMessage()); - $this->driver = $this->dsn[phptype]; - register_shutdown_function(array(&$this,'close')); - $this->dbs_name = $this->dsn['database']; - } - - function close() { - - $this->link->disconnect(); - } - - - - function CalculateBytesPeriod($server,$StartDate,$EndPeriod) { // Bytes transferred in a period. - - $result =& $this->link->query("select SUM(JobBytes) from Job WHERE EndTime < '$EndPeriod' and EndTime > '$StartDate' and Name='$server'") - or die("classes.inc: Error query: 1"); - $return =& $result->fetchRow(); - return $return[0]; - }//end function - - - - function CalculateFilesPeriod($server,$StartDate,$EndPeriod) { // Number of files transferred in a period. - - $result =& $this->link->query("select SUM(JobFiles) from Job WHERE EndTime < '$EndPeriod' and EndTime > '$StartDate' and Name='$server'") - or die("classes.inc: Error query: 2"); - $return =& $result->fetchRow(); - return $return[0]; - }//end function - - - - function PrepareDate($StartDateMonth,$StartDateDay,$StartDateYear,$EndDateMonth,$EndDateDay,$EndDateYear) { // Convert date for Smarty. Check if only works with Mysql. - - $this->StartDate=$StartDateYear."-".$StartDateMonth."-".$StartDateDay." 00:00:00"; - $this->EndDate=$EndDateYear."-".$EndDateMonth."-".$EndDateDay." 23:59:59"; // last day full - - }//end function - - - - function GetDataVolumes() { - - $volume = array(); - $res = $this->link->query("SELECT Name FROM Pool"); - while ( $tmp =& $res->fetchRow() ) { - if ($this->driver == "mysql" ) - $result = $this->link->query("select Media.VolumeName, Media.VolBytes,Media.VolStatus,Pool.Name,Media.MediaType,Media.LastWritten,FROM_UNIXTIME(UNIX_TIMESTAMP(Media.LastWritten)+Media.VolRetention ) as expire from Pool LEFT JOIN Media ON Media.PoolId=Pool.PoolId where Name='$tmp[0]' order by Media.VolumeName"); - else if ($this->driver == "pgsql") - $result = $this->link->query("select Media.VolumeName, Media.VolBytes,Media.VolStatus,Pool.Name,Media.MediaType,Media.LastWritten, Media.LastWritten + Media.VolRetention * interval '1 second' as expire from Pool LEFT JOIN Media ON Media.PoolId=Pool.PoolId where Name='$tmp[0]' order by Media.VolumeName"); - while ( $tmp1 = $result->fetchRow() ) { - $pos = array_key_exists($tmp[0],$volume); - if ($pos != FALSE) - array_push($volume["$tmp[0]"],$tmp1); - else - $volume += array($tmp[0]=>array($tmp1)); - } - } - - $res->free(); - $result->free(); - return $volume; - } - - function GetDbSize() { - if ( $this->driver == "mysql") { - $dbsize = $this->link->query("show table status") - or die ("classes.inc: Error query: 3"); - if ( $dbsize->numRows() ) { - while ( $res = $dbsize->fetchRow(DB_FETCHMODE_ASSOC) ) - $database_size += $res["Data_length"]; - } - else - return 0; - } - else if ( $this->driver == "pgsql") { - $dbsize = $this->link->query("select pg_database_size('$this->dbs_name')") - or die ("classes.inc: Error query: 4"); - if (PEAR::isError($dbsize)) - die($dbsize->getMessage()); - if ( $dbsize->numRows() ) { - while ( $res = $dbsize->fetchRow() ) - $database_size += $res[0]; - } - else - return 0; - } - $dbsize->free(); - return $database_size; - } - -} - -class BGraph { - - var $type; - var $sizex; - var $sizey; - var $MarginBottom; - var $MarginLeft; - var $Leg; - - - - function BShowGraph($datos,$title,$xlabel,$ylabel,$leyenda,$tipo="lines") { - - global $type; - - require_once ("external_packages/phplot/phplot.php"); - - if ( empty($this->sizex) || empty($this->sizey) ) { //Default size - $this->sizex = "600"; - $this->sizey = "400"; - } - if ( empty($this->MarginBottom) ) { - $this->MarginBottom = 120; - } - - $legend = $leyenda; -// $bgcolor = array(222,206,215); // Background color of graph - $bgcolor = array(207,231,231); - $fgcolor = array(110,41,57); - - - - $graph = new PHPlot($this->sizex,$this->sizey,"",""); - - if ( !empty($type) ) - $graph->setDataType($type); - - $graph->SetDataValues($datos); - $graph->SetPlotType($tipo); -// $graph->SetUseTTF(1); - $graph->SetBackgroundColor($bgcolor); - - $graph->SetLegendPixels(1,20); - $graph->SetDataColors(array('SkyBlue','purple','PeachPuff','aquamarine1','#2CB04B','beige','#9F865F','#135568','orchid','navy','red', 'black', 'blue', 'green', 'brown', 'yellow','cyan','orange','#B9F5A7','#AFAFAF')); - $graph->SetTitle($title); - $graph->SetXLabel($xlabel); - $graph->SetYLabel($ylabel); - $graph->SetPlotAreaWorld("","","",""); - - if ( count($datos) > 5 ) - $graph->SetXDataLabelAngle(90); - else - $graph->SetXDataLabelAngle(0); - $graph->SetNumXTicks(1); -// $graph->SetXDataLabelPos('none'); -// $graph->SetXTickLabelPos('plotdown'); - -// $graph->SetXGridLabelType("time"); -// $graph->SetXTimeFormat("%b ") ; - - if ( $this->Leg == 1 ) { - $this->MarginLeftWithLegend($legend); - $graph->SetMarginsPixels($this->MarginLeft,10,35,$this->MarginBottom); - $graph->SetLegend($legend); - } - else - $graph->SetMarginsPixels(90,35,35,$this->MarginBottom); -// $graph->SetDataColors(array($fgcolor),array( "black")); - $graph->SetFileFormat( "png"); -// $graph->DoScaleData(1,1); -// $graph->DoMovingAverage(1,1,1); - -// FIX ME -- to round y axis. - $vtick = strlen (round ($graph->max_y)); - $res = 1; - for ($i=1;$i < $vtick; $i++) - $res = $res*10; - if (strlen($graph->max_y-$res) != $vtick ) - $res = $res/10; - $graph->SetVertTickIncrement($res); - $graph->DrawGraph(); - - }//end Crear - - -//Estupidez que tengo que cambiar. !!!!!!!!!!! - function SetDataType($typ) { - - global $type; - $type = $typ; - } - - function MarginLeftWithLegend($clients) { - - $maxlen = 0; - - while (next($clients)) { - $tmp = strlen(current($clients)); - if ( $tmp > $maxlen ) - $maxlen = $tmp; - } - $this->MarginLeft = $maxlen * 9; - } - -}//end class - - - - - -class BCreateGraph extends BGraph { - - var $BD_bacula; - var $izquierda; - var $derecha; - var $StartDate; - var $EndDate; - var $elapsed; // Default elapsed time to show complex graphs - - - - function BCreateGraph() { - - $this->StartDate = "1900-01-01"; - $this->EndDate = "4000-01-01"; - $this->elapsed = "86400"; // 24 hours in seconds. - - } - - - - function BCreate($server,$tipo_dato,$title,$tipo="bars",$xlabel="",$ylabel="") { - - global $DB_bacula; - global $izquierda; - global $derecha; - global $clientes; - - $this->clientes=array(); - $DB_bacula = new Bweb(); - $datos = $this->SQLPrepareData($server,$tipo_dato); - - if ( empty($datos) ) { //No data = No stats = Empty graph - header("Content-type: image/png"); - $img= @ImageCreate(200,100) or die ("Cannot intialize GD stream"); - $bgc= ImageColorAllocate($img, 0, 255,255); - $txc= ImageColorAllocate($img, 0,0,0); - ImageString($img, 5, 4, 4, "None data to process", $txc); - ImagePng($img); - ImageDestroy($img); - return; - } - - if ( empty ($xlabel) ) { // If no label, table names like leyends - $xlabel=$derecha; $ylabel=$izquierda; - } - - $this->SetDataType("text-data"); - $this->BShowGraph($datos,$title,$xlabel,$ylabel,$this->clientes,$tipo); - - } - - - - function SQLPrepareData($servidor,$tipo_dato=0) { // Prepare bytes data from database. - - global $DB_bacula; - global $izquierda; - global $derecha; - - if ( $tipo_dato<30 ) { // Simple graph. Only 2 data - - switch ($tipo_dato) - { - case BACULA_TYPE_BYTES_FILES: - $izquierda="jobbytes"; - $derecha="jobfiles"; - break; - case BACULA_TYPE_FILES_JOBID: - $izquierda="jobfiles"; - $derecha="jobid"; - break; - default: - $izquierda="jobbytes"; - $derecha="endtime"; - break; - } - $result = $DB_bacula->link->query("select $derecha,$izquierda from Job where Name='$servidor' and EndTime < '$this->EndDate' and EndTime > '$this->StartDate' order by SchedTime asc") - or die ("classes.inc: Error at query: 5"); - while ( $row = $result->fetchRow(DB_FETCHMODE_ASSOC) ) { - $whole_result[] = $this->array_merge_php4($row["$derecha"],$row[$izquierda]); - } - $result->free(); - } else { // Complex graph. 3 or more data. - - switch ( $tipo_dato ) - { - case '30': // Unused, at this time. - $result = $DB_bacula->link->query("select JobBytes,JobFiles,Jobid from Job where Name='$servidor' order by EndTime asc") - or die ("classes.inc: Error at query: 6"); - while ( $row = $result->fetchRow(DB_FETCHMODE_ASSOC) ) - $whole_result[] = array_merge($row["Jobid"],$row["JobFiles"],$row["JobBytes"]); - $result->free(); - break; - case BACULA_TYPE_BYTES_ENDTIME_ALLJOBS: // Special: Generic graph from all clientes. - $i = -1; // Counter of number of jobs of one client. SP: Contador del nmero de jobs totales de un cliente. - $i2 = 0; // Counter of number of keys of array. SP: Contador del nmero de valores del array. - - if ($DB_bacula->driver == "mysql") { - $res = $DB_bacula->link->query("select Name from Job where UNIX_TIMESTAMP(EndTime) > UNIX_TIMESTAMP(NOW())-$this->elapsed group by Name order by Name desc") - or die ("classes.inc: Error at query: 7"); - $resdata = $DB_bacula->link->query("select date_format(EndTime,\"%Y-%m-%d\") from Job where UNIX_TIMESTAMP(EndTime) > UNIX_TIMESTAMP(NOW())-$this->elapsed group by date_format(EndTime, \"%Y-%m-%d\") order by EndTime") - or die ("classes.inc: Error at query: 8"); - } - else if ($DB_bacula->driver == "pgsql") { - $res = $DB_bacula->link->query("select Name from Job where EndTime > now() - 1*interval'$this->elapsed s' group by Name order by Name desc") - or die ("classes.inc: Error at query: 8"); - $resdata = $DB_bacula->link->query("select to_char(EndTime,'YY-MM-DD') from Job where EndTime > NOW() - 1*interval'$this->elapsed s' group by EndTime order by EndTime") - or die ("classes.inc: Error at query: 9"); - } - - if (PEAR::isError($resdata)) - die("classes.inc: Error at query: 9.1
".$resdata->getMessage()); - while ( $tmpdata = $res->fetchRow() ) - array_push($this->clientes,$tmpdata[0]); - -// echo "
";
-//                                      print_r ($this->clientes);
-//                                      echo "
"; - - - $spr = array(); // Temporal array - $spr2 = array(); // Temporal array - $whole_result = array(); - - while ( $tmpdata = $resdata->fetchRow() ) { - $count++; - array_push($spr,$tmpdata[0]); - if ($DB_bacula->driver == "mysql") - $result = $DB_bacula->link->query("select date_format(EndTime,\"%Y-%m-%d\"),SUM(JobBytes) as sum,Name as name,count(Name) as Nname from Job WHERE EndTime like '$tmpdata[0]%' group by Name order by Name desc") - or die ("classes.inc: Error at query: 10"); - else if ($DB_bacula->driver == "pgsql") { - $query = "select to_char(EndTime,'YY-MM-DD'),SUM(JobBytes) as sum,Name,count(Name) as Nname from Job WHERE EndTime like '%$tmpdata[0]%' group by EndTime,Name order by Name desc"; - $result = $DB_bacula->link->query($query) - or die ("classes.inc: Error at query: 11"); - } - while ( $row = $result->fetchRow(DB_FETCHMODE_ASSOC) ) { - $spr2 = array_merge($spr2,array($row["name"]=>$row["sum"])); - $i = $result->numRows(); - } - - -// echo "
";
-//                                              print_r ($spr2);
-//                                              echo "
"; - - reset ($this->clientes); - do { - if ( $spr2[current($this->clientes)] != NULL) - array_push($spr,$spr2[current($this->clientes)]); - else - array_push($spr,0); - } while ( next($this->clientes) ); - - if ( $i2 < $i ) - $i2 = $i; - - if ( $tmpdata[0] != $row["EndTime"] ) - array_push($whole_result,$spr); - - $spr = array(); - $spr2 = array(); - } - - for ( $i = 0; $i < count($whole_result); $i++ ) { // To equal the arrays so that the graph is not unsquared. SP:Igualamos las matrices para que la gr�ica no se descuadre - $tmp = count($whole_result[$i]); - if ( $i2 < $tmp ) // Estupidez?. Check this code later... - continue; - $tmp = $i2 - $tmp; - for ( $a = 0; $a <= $tmp; $a++ ) - array_push($whole_result[$i],"0"); // Fill the array - } - $resdata->free(); -// echo "DEBUG:
"; -// echo "
";
-//                                      print_r ($whole_result);
-//                                      echo "
"; - break; - - default: - break; - } - } -// $result->free(); - return $whole_result; - }//end function - - - - //Convert date from mysql to smarty. THE SAME FUNCTION AT 2 CLASSES. THIS WAY IS BUGGY. TO SOLVE LATER. - function PrepareDate($StartDateMonth,$StartDateDay,$StartDateYear,$EndDateMonth,$EndDateDay,$EndDateYear){ - - $this->StartDate = $StartDateYear."-".$StartDateMonth."-".$StartDateDay." 00:00:00"; - $this->EndDate = $EndDateYear."-".$EndDateMonth."-".$EndDateDay." 23:59:00"; - - }//end function - - - function array_merge_php4($array1,$array2) { - $return=array(); - - foreach(func_get_args() as $arg) { - if(!is_array($arg)){ - $arg=array($arg); - } - foreach($arg as $key=>$val){ - if(!is_int($key)){ - $return[$key]=$val; - }else{ - $return[]=$val; - } - } - } - return $return; - } - -}//end class - -?> diff --git a/gui/bacula-web/configs/.htaccess b/gui/bacula-web/configs/.htaccess deleted file mode 100644 index 8d2f25636d..0000000000 --- a/gui/bacula-web/configs/.htaccess +++ /dev/null @@ -1 +0,0 @@ -deny from all diff --git a/gui/bacula-web/configs/bacula.conf b/gui/bacula-web/configs/bacula.conf deleted file mode 100644 index a48d3e7580..0000000000 --- a/gui/bacula-web/configs/bacula.conf +++ /dev/null @@ -1,87 +0,0 @@ -# This is the config file. -# Please, modify with your preferences - -# Title of main window -title = Bacula-Web 1.2 - -# If http://www.domain.com/bacula/ -# root = /bacula -root = /bacula-web - -# Show a box with a detailed report at index or Status report -# I'll remove this in future versions. -IndexReport = 0 - -# Secs since last run. Default 24h. -# Unused in this version -# LastRun = 86400 - - -# Mode of index page: Full or Lite -# Only useful if IndexReport = 0 -# -# Lite: Only shows a little report for the last 24h. -# Maybe you would want this if you have very much jobs. -# Full: This shows a full table with detailed data -# Maybe you would want this if you have a bit of jobs. -mode = Lite - - - -# LANGUAGE: -# en_EN -> English -# es_ES -> Spanish, Mantained by Juan Luis Francés Jiménez. -# it_IT -> Italian, Mantained by Gian Domenico Messina (gianni.messina AT c-ict.it). -# fr_FR -> Frech, Mantained by Morgan LEFIEUX (comete AT daknet.org). -# de_DE -> German, Mantained by Florian Heigl. -lang = en_EN - - - -# DATABASE INFORMATION AND MULTICATALOG SUPPORT -# --------------------------------------------- -# This section contains the database configuration. -# You must create a user or to give it permissions to access -# from web machine. - -[.DATABASE] -# Your database host or IP -host = localhost - -# Your database login -login = bacula - -# Your database password. -# For empty passwords use this: -# pass = -pass = - -# Your database name -db_name = bacula - -# Your database type: mysql,sqlite,pgsql -db_type = mysql - -# Uncomment this and modify it if your database runs on a non standard port. -# db_port = 3306 - -# MULTICATALOG SUPPORT -# --------------------- -# If you have only one catalog don't remove the comments. -# If you have 2 or more catalogs, please remove the coments of this section -# and configure with your preferences. -# You can add so many as you want. - -#[.DATABASE2] -#host = 192.168.2.55 -#login = bacula -#pass = -#db_name = bacula -#db_type = mysql - -#[.DATABASE3] -#host = 192.168.20.40 -#login = bacula -#pass = -#db_name = bacula -#db_type= pgsql diff --git a/gui/bacula-web/external_packages/phplot/ChangeLog b/gui/bacula-web/external_packages/phplot/ChangeLog deleted file mode 100644 index b1c6d91afb..0000000000 --- a/gui/bacula-web/external_packages/phplot/ChangeLog +++ /dev/null @@ -1,1610 +0,0 @@ -2004-10-24 18:40 migueldb - - * phplot.php: - - + array_merge_php4(): added to cope with the bug introduced by - the change in array_merge() from PHP4 to PHP5 (I haven't verified - this) - - + Fixed some divisions by zero, thanks to an old bug report. - -2004-10-24 17:44 migueldb - - * README.txt, doc/quickstart.html, examples/create_chart.php, - examples/format_chart.php, examples/inline_image.php: - - + Updated to the latest changes in phplot - -2004-10-24 17:40 migueldb - - * doc/index.php: - - + Minimal change - -2004-09-09 20:27 migueldb - - * phplot.php: - - + SetPointSize(): deprecated - - + SetPointSizes(): added as replacement for SetPointSize().Now - able to set point sizes on a per line basis. - - + SetPointShape(): deprecated. - - + SetPointShapes(): added as replacement for SetPointShape(). Now - able to set point shape on a per line basis. - - + DrawDot(): now needs record number to decide which dot shape - and size to draw. - - + CalcMargins(): dirty fix for x data label placing. - - + tile_img(): fixed tile placement. - -2004-06-14 14:19 migueldb - - * phplot.php: - - + SetXTickLabelPos() and others: more on the bug reported by Jo - Demol. - -2004-06-14 11:35 migueldb - - * phplot.php: - - + Fixed bug reported by Jo Demol. - -2004-05-11 14:14 migueldb - - * phplot.php: - - + SetBgImage(): added. - - + SetPlotAreaBgImage(): added. - - + SetInputFile(): deprecated. - - + DrawBackground(): now accepts images as backgrounds. - - + DrawPlotAreaBackground(): now accepts images as backgrounds. - - + tile_img(): internal method added. - -2004-04-14 13:26 migueldb - - * phplot.php: - - + DrawXAxis(): No more horizontal tick nor label at X-axis' - sides. - -2004-03-21 18:01 migueldb - - * phplot.php: - - + x/y_label_type automaticaally set to 'data' when setting label - precision. - - + minor corrections. - -2004-03-03 08:17 afan - - * phplot.php: PlotAreaWorld - last fix - -2004-03-03 02:40 migueldb - - * phplot.php: - - + SetPlotAreaWorld(): fixed. - -2004-03-01 21:14 afan - - * phplot.php: Needed one more = in ($ymin === NULL) - -2004-02-29 11:21 afan - - * phplot.php: phplot.php SetPlotAreaWorld - changed ($!ymin) to - ($ymin == NULL) for cases where $ymin = 0. (also done for ymax, - xmin, xmax) afan - -2004-02-23 10:34 migueldb - - * phplot.php: - - + SetPlotAreaWorld(): Fixed the calculation of max and min y. - -2004-02-14 12:29 migueldb - - * phplot.php: - - + SetPlotAreaWorld(): Fine grained control over which values are - auto-calculated. Should fix some trouble with y-scaling. - - + DrawGraph(): yet another fix to drawing order... - - + CheckOption(): fixes problems with mixedcase arguments. - - + SetFileFormat(), FormatLabel(): typos fixed. - -2004-01-30 12:56 migueldb - - * examples/data_sample1.php: - - + Added "stacked bars" plot type. - -2004-01-30 12:50 migueldb - - * phplot.php: - - + DrawStackedBars(): added plot type. - - + SetEqualXCoord(): renamed to more intuitive CalcBarWidths(). - Modified for stacked bars. - - + Changed graphing order. The grids are again at the background, - as they should. Added var $grid_at_foreground (bool) to alter - this. - - + text-data-pie renamed to text-data-single. - - + SetPlotAreaWorld(): fixed min_y bug. - -2004-01-29 17:10 migueldb - - * phplot.php: - - + SetPlotAreaWorld(): default behaviour is to adjust Y axis to Y - min/max. - - + SetSkipLeftTick(), SetSkipRightTick(): added. - - + SetFileFormat(): fixed silly bug that prevented selections from - being made. - -2004-01-28 20:00 migueldb - - * phplot.php, doc/quickstart.html: - - + Merged final changes to rel-5-0 into main trunk. - -2004-01-28 19:12 migueldb - - * phplot.php: - - + DrawGraph(): Fixed graph drawing order for default plots - (bars). Removed some redundat lines of code. - -2004-01-28 18:58 migueldb - - * doc/quickstart.html: - - + More stuff... - -2004-01-28 18:49 migueldb - - * phplot.php: - - + DrawPieChart(): fixed use of old variable. - - + First steps for data labels autoadjustement and skipping. - -2004-01-27 12:12 migueldb - - * phplot.php: - - + Added missing SetSkipTopTick() - - + Some comments. - - + Fixed option checking for a couple of functions. Added some - more. - -2004-01-27 00:03 migueldb - - * doc/index.php: [no log message] - -2004-01-25 20:28 migueldb - - * doc/index.php: - - + Fixed typo. - -2004-01-25 19:57 migueldb - - * doc/index.php: - - + Commit for 5.0rc1. - -2004-01-25 19:50 migueldb - - * README.txt, doc/index.php, doc/quickstart.html, doc/schema.html: - - + Commit for 5.0rc1. - -2004-01-25 19:44 migueldb - - * phplot.php: - - + Added missing SetDrawXDataLabelLines() and - SetDrawYDataLabelLines(). - - + Added some parameter checking with CheckOption(). - - + Added some comments. - -2004-01-25 19:32 migueldb - - * examples/: create_chart.php, example3.php, format_chart.php: - - + Commiting for 5.0rc1 - -2004-01-25 18:21 migueldb - - * examples/example8.php: [no log message] - -2004-01-25 18:20 migueldb - - * doc/style.css: - - + Added 'box' style. - -2004-01-25 17:11 migueldb - - * phplot.php: - - + Set*Colors(): should be faster when using default values. - - + array_pad_array() non class-member function added. - - + PadArrays(): now pads arrays with themselves, to mimic previous - behaviour, uses array_pad_array() - - + DrawAxisLegend(): skeleton added. To do. - -2004-01-24 23:18 migueldb - - * phplot_data.php: - - + DoMovingAverage(): some corrections. The legend isn't correctly - updated yet. - -2004-01-24 23:16 migueldb - - * phplot.php: - - + PadArrays(): added. Formerly in SetDataValues(), now called - from DrawGraph(). Fixes SetLineWidths() buggy behaviour. - - + Added MINY and MAXY constants, for DrawXDataLine(). - - + DrawGraph(): changed order when drawing axis, to avoid - overwriting. - -2004-01-21 20:08 migueldb - - * doc/quickstart.html: - - + More corrections - - + Some links - - + $Id$ tag - -2004-01-21 19:55 migueldb - - * doc/quickstart.html: - - + HTML heavily cleaned - - + Some corrections - -2004-01-21 18:47 migueldb - - * doc/index.php: - - + Added quickstart. - - + More things in whishlist. - -2004-01-21 18:46 migueldb - - * doc/quickstart.html: - - + Doc by Afan. With slight corrections. - -2004-01-21 18:44 migueldb - - * examples/rgb.inc.php, doc/index.html: [no log message] - -2004-01-21 18:43 migueldb - - * phplot.php: - - + Small changes to functions' documentation. - -2004-01-21 18:06 migueldb - - * phplot_data.php: - - + renamed tedious data_values to data - - + work still in progress - -2004-01-21 18:03 migueldb - - * phplot.php: - - + Added check for __FUNCTION__ for old PHP versions. - - + DrawPieChart(): 'data-data' support added. - - + DrawGraph(): added check to avoid calling FindDataLimits() - twice. - - + DrawXDataLine(): Added. - - + DrawXDataLabels(): Added support for vertical lines to data - points via DrawXDataLine() - - + FindDataLimits(): Added calculation of per-row min_y and max_y, - for DrawDataLine() - -2003-12-30 13:26 migueldb - - * phplot.php: - - + SetDataValues(). Now reads a reference and copies it to - $this->data, a numeric array. All indices are converted to - numeric. num_recs[] holds the number of records per data row. - - + FindDataLimits(). Works with new $this->data - - + The following functions now work with the new data set and use - faster loops: - - + DrawDots() - - + DrawDotsError() - - + DrawThinBarLines() - - + DrawPieChart(). Minimum changes. - - + DrawLines() - - + DrawArea(). Other optimizations too. - - + DrawBars(). Other things too. - -2003-12-30 00:01 migueldb - - * phplot_data.php: - - + Fixed constructor. Added parameters to fit PHPlot()'s - - + Fixed many "undefined index" errors. - - + DoMovingAverage(): puts data in a new row, and sets colors and - legend. Won't work for the moment. - -2003-12-29 21:58 migueldb - - * phplot_data.php: - - + Formatted after phplot.php style (PEAR) - - + Added Doxygen comments. - - + DoScaleData(): Optimized with for loops. Needs testing. - - + DoMovingAverage(): Optimized. Changed behaviour with first - elements in dataset. Needs testing. - - + DoExponentialMovingAverage(): added. Needs testing. - -2003-12-27 14:53 migueldb - - * benjamingothic.ttf: - - + The TTFont is only needed in 'examples/'. - -2003-12-27 14:52 migueldb - - * phplot.php: - - + Removed some (done) TODO marks. - -2003-12-27 14:06 migueldb - - * examples/test_setup.php: [no log message] - -2003-12-27 14:06 migueldb - - * examples/nav.html: - - + This was unnecessary. - -2003-12-27 14:01 migueldb - - * README.txt, LICENSE.GPL, LICENSE.PHP_3_0: [no log message] - -2003-12-27 13:46 migueldb - - * doc/index.php: - - + Added all the examples. - - + Added 5.0 version number. - - + Added myself as author. - -2003-12-27 13:44 migueldb - - * examples/example9.php: - - + Changed to follow phplot function renaming (again!) - -2003-12-24 13:39 migueldb - - * examples/: create_chart.php, format_chart.php: - - + New data type: randfunction, using data-data-error. - -2003-12-24 13:38 migueldb - - * examples/: data_sample1.php, data_sample2.php, data_sample3.php, - data_sample4.php: - - + Moved data type selection links to format_chart.php - -2003-12-24 13:36 migueldb - - * phplot.php: - - + Fixed spurious ticks bug. - - + Corrected some comments. - -2003-12-24 12:52 migueldb - - * examples/example5.php: - - + Now in format_chart.php - -2003-12-24 12:47 migueldb - - * examples/example4.php: Ooops! I deleted the wrong file! - -2003-12-24 12:39 migueldb - - * examples/data_sample5.php: - - + New 'randfunction' data type in example-o-matic. Taken from - deleted example4.php and test1.php. - -2003-12-24 12:37 migueldb - - * examples/example4.php: - - + Inserted example in example-o-matic as 'randfunction' - -2003-12-24 12:35 migueldb - - * examples/test1.php: inserted example in example-o-matic as - 'randfunction' - -2003-12-24 10:38 migueldb - - * phplot.php: - - + Fixed silly typo. - -2003-12-23 17:40 migueldb - - * phplot.php: - - + All renaming with leading underscores undone for compatibility. - It was a mess. - - + Fixed a couple function call typos. - - + Fixed axis position calculation. - -2003-12-17 16:28 migueldb - - * examples/create_chart.php: - - + Fixed to work with phplot.php v1.69 - -2003-12-17 16:28 migueldb - - * phplot.php: - - + Added skip_left_tick and skip_right tick for x axis. - - + Added y_label_angle (last commit) - - + Fixed automatic axis positioning for plots with negative values - or log scales. - - + Deleted messy SetGridParams(), SetTickParams() and - SetDataLabelParams(). I realized they were a bad idea of mine... - :( - - + Some more code grouping and reorganisation. - -2003-12-15 16:52 migueldb - - * examples/: create_chart.php, format_chart.php: - - + Added x/y tick crossing lenghts. - - + Added x axis and y axis positioning. - - + Corrected some label placement options. - -2003-12-15 16:50 migueldb - - * examples/: example4.php, example5.php, example9.php, test1.php: - - + Updated examples to work with new PHPlot. - - + Fixed some things. - -2003-12-15 16:48 migueldb - - * phplot.php: - - + x_tick_pos: added support for 'xaxis' position. - - + x_tick_label_pos: added support for 'xaxis' position. - - + DrawYTick(): fixed 'yaxis' - - + Set[X|Y]TickCrossing(): added. Draw ticks crossing axis by a - specified length in pixels. - - + DrawText(): improved vertical centering for TTF. - - + SetDrawBrokenLines(): fixed silly thing. - - + _DrawPlotBorder(): new option 'right' and 'sides' - - + DrawLinesError(): removed some 'ifs' for speed. - - + DrawDotsError(): removed some 'ifs' for speed. - - + Minor corrections here and there. - -2003-12-13 04:58 migueldb - - * phplot.php: - - + DrawGraph(): Fixed drawing order error. - -2003-12-13 04:44 migueldb - - * phplot.php: - - + _SetIndexColors(): removed. When sessions were not set, indexes - were being calculated twice - - + Centralized color and style defaults in _SetDefaultStyles() - (former _SetDefaultColors()) - - + SetLineWidth(): superseded by new SetLineWidths(). Now using an - array of values for per-line setting. - - + DrawDashedLine(): added again for backward compatibility. - - + DrawBars(): Faster shading. - - + DrawYTicks(): slightly improved, DrawYTick() modified too. - - + DrawGraph(): plot borders now drawn after plots. - - + Added color and style variable declarations for easier - modification. - - + More formatting. Some renaming undone for backwards - compatibility. - -2003-12-10 04:04 migueldb - - * examples/: data_sample1.php, data_sample2.php: - - + New plot type 'squared' added. - -2003-12-10 04:03 migueldb - - * examples/: create_chart.php, format_chart.php: - - + New option 'Draw broken lines' added. - -2003-12-10 04:00 migueldb - - * phplot.php: - - + Better available graph room usage. - - + More renaming and formatting... - - + Parameter validation with _CheckOption(), but I might drop it - if it slows everything down. - - + DrawBinary() is again DrawSquared()... ooops. :) It is at least - now working. - - + DrawSquared() done, quite silly thing, though. - - + SetBrokenLines() added. Tells whether to draw lines for missing - Y data. - -2003-12-10 01:32 migueldb - - * doc/schema.html: - - + Simple [go to index] link. - - + Typos fixed. - -2003-12-10 00:56 migueldb - - * phplot.php: - - + Reworking PEAR coding standards conformance, I had quite - screwed it up. Vim regexes are proving veeeery useful ;) - - + Important comment about the destructor and class instantiation. - - + Internal methods will now have a prepended underscore. I'm - renaming them little by little. - - + SetDefaultDashedStyle(): now accepts any string as style. - - + DrawSquared() renamed to DrawBinary() - - + _CalcMargins(): corrected [x|y]_tick_label_width calculation. - -2003-12-07 18:58 migueldb - - * examples/: example6.php, example7.php: - - + SetDrawXDataLabels(false); - -2003-12-07 18:30 migueldb - - * phplot.php: - - + DrawDotsError(): doesn't fail anymore if data type isn't - data-data-error (might include text-data-error in the future). - - + More variables changed to bool. - - + SetNewPlotAreaPixels(): removed, SetPlotAreaPixels() now does - the same work. - - + SetMarginsPixels(): now updates margin variables. - - + SetTitle(): fixed wrong height calc for empty title. - - + Removed many internal variable declarations. See the beggining - of the class declaration for comments on this. This might be a - bit stupid... :-? - - + DrawSquared(): plot type on the works, addressing Feature - Request [558302]. Just the skeleton for now. - -2003-12-07 02:12 migueldb - - * phplot.php: - - + SetInputFile(): deallocates previously allocated 'img' - - + Added 'line_spacing' and SetLineSpacing() - - + InitImage(): deleted, moved into the constructor - - + DrawError(): shows plain text message if 'img' unavailable. - - + SetXTitle(): Fixed x_title_height calculation for TTF. - - + More code reorganisation. As I seem to be alone in this, that - should be no problem... - -2003-12-07 01:12 migueldb - - * phplot.php: - - + TTF font provided with package now works (it wasn't being - found). - - + TTF placement a bit adjusted. - - + SetTitle(): Fixed wrong title height calculation for TTFonts. - - + DrawLegend(): TTF support added. - - + DrawDot(): renamed dot type 'crosshair' to 'plus'. Added - 'cross' and 'trianglemid'. - - + FormatTickLabel(): now used for tick and data labels. Renamed - to FormatLabel(). - - + draw_x_data_label: variable removed, now using - [x/y]_data_label_pos for both x and y data labels. - - + draw_x_data_label_lines: parameter added. - - + line_width: minor usage fixes. - - + SetXDataLabelAngle() renamed to SetXLabelAngle(). Old function - kept in 'deprecated' section. - - + Changed some options to bool format. - - + Tried to make better decisions on Set*LabelParams() regarding - placement. - - + Removed superfluous DrawLabels() function. - - + Moved CalcXHeights() and CalcYWidths() into CalcMargins() for - speed (unperceptible I must admit) and clarity. - - + Other changes here and there... - -2003-12-07 01:06 migueldb - - * examples/data_sample2.php: - - + Added missing data. - -2003-12-07 01:05 migueldb - - * examples/: create_chart.php, data_sample1.php: [no log message] - -2003-12-07 01:04 migueldb - - * examples/format_chart.php: - - + Added a check to see if we are being called from the right - place. - - + New data label angle option. - - + New line and error bar line width options. - - + New data label options. - - + New point types. - - + Some corrections. - -2003-12-06 21:12 migueldb - - * examples/nav.html: [no log message] - -2003-12-06 21:09 migueldb - - * examples/test_setup.php: - - + Added nav. bar - -2003-12-06 21:08 migueldb - - * examples/nav.html: - - + Simple navigation bar, not very useful yet. - -2003-12-06 20:43 migueldb - - * doc/style.css: - - + New "nav" class. - -2003-12-06 20:42 migueldb - - * doc/index.php: - - + New index, now calls some php. - -2003-12-06 20:41 migueldb - - * doc/php_test.php: - - + Added the test for php functionality in index.php, so this file - is no longer necessary. - -2003-12-05 19:13 migueldb - - * examples/inline_image.php: - - + Added warning message when called on its own. - -2003-11-28 01:21 migueldb - - * phplot.php: - - + Default title position='none' for better positioning of - elements. - - + xtr(), yrt(): return value round()ed - - + DrawLines(): better (?) management of incomplete data sets. No - begin or end points forced. No more "undefined offset x in ..." - - + DrawArea(): more modifications when working with incomplete - data sets. No extra beginning or ending points. - -2003-11-26 17:52 migueldb - - * phplot.php: [no log message] - -2003-11-26 17:16 migueldb - - * examples/: create_chart.php, format_chart.php: - - + Added shading option - -2003-11-26 16:43 migueldb - - * phplot.php: - - + Added spaces after every comma, around every equal sign for - prettier code. :) - - + DrawXTitle(): Another fix. Removed the check for tick_pos I - just introduced. Works better now. - - + _PHPlot(): destructor added. - - + Comments, indenting, and a couple of minor corrections here and - there. - -2003-11-26 12:19 migueldb - - * phplot.php: l - - + DrawXTitle(): check for tick_label_pos when calculating title - position (before the title would be misplaced under certain - circumstances) - - + Added SetIndexDarkColor() and $ndx_data_dark_color[] calculated - from $data_colors[], for shadows. - - + New data type (one value per data row) 'text-data-once' for pie - charts - - + DrawPieChart(): some optimisations. Shading added. - -2003-11-25 17:30 migueldb - - * examples/create_chart.php: - - + Now accepts point size from format_chart.php. - -2003-11-25 17:29 migueldb - - * examples/format_chart.php: - - + New point type 'crosshair' added to the options. - - + Link to the documentation index at the bottom of the page. - -2003-11-25 17:28 migueldb - - * examples/data_sample1.php: - - + Fixed wrong comment. - -2003-11-25 17:28 migueldb - - * phplot.php: - - + DrawDot(): added new variables to avoid calls to ytr() and - xtr(), replaced imagefilledrectangle() with imageline() in - "halfline" and "line" modes. - - + DrawDot(): added point type 'crosshair' - - + DrawArea(): modified to follow the structure of the other plot - drawing methods. Removed obsolete DrawAreaSeries() - - + DrawLines(): same modifications as with other plot drawing - methods. - - + Removed dummy DrawLineSeries() - - + More use of imagesetthickness() - -2003-11-25 01:34 migueldb - - * phplot.php: Right now working on richer data label placement, but - in the meantime: - - + Removed unnecessary (and wrong) right alignment option in - FormatTickLabel() - - + Removed unused (thought it better :) DrawPlotLabel - - + DrawYErrorBar(): uses imagesetthickness() - - + DrawDots() optimised and cleaned. - - + DrawThinBarLines() optimised and cleaned. - - + DrawDotsError() optimised (I hope!) - - + DrawLinesError() optimised. Fixed a bug with multiple lines - - + Other small things, as usual... - -2003-11-25 01:27 migueldb - - * examples/data_sample2.php: - - + Removed bogus tag. - -2003-11-25 00:49 migueldb - - * examples/data_sample4.php: - - + Added 'thinbarline' data plot option. - -2003-11-25 00:48 migueldb - - * examples/data_sample1.php: - - + Added thinbarline plot mode. - - + Added comment on 'text-data' data type. - -2003-11-24 23:32 migueldb - - * examples/: data_sample1.php, data_sample2.php, data_sample4.php, - format_chart.php: - - + Replaced old data type "linear" with new "data" everywhere. - -2003-11-24 23:32 migueldb - - * examples/create_chart.php: - - + Accepts new $data_row format from data_sample3.php - (data-data-error format) - - + Replaced old data type "linear" with new "data". - -2003-11-24 23:30 migueldb - - * examples/data_sample3.php: - - + Replaced old "linear" with new "data" everywhere. - - + Modified code and $data_row organization to allow for easier - changes. - - + Added another set of values (to have two lines in the example) - -2003-11-24 21:06 migueldb - - * examples/data_sample3.php: - - + Removed bogus tag - - + Added slashes to input tags end - -2003-11-24 17:44 migueldb - - * phplot.php: - - + Fixed a typo. - -2003-11-24 17:03 migueldb - - * doc/: examples.html, function_reference.html, quick_start.php: - - + Inserted into index.html (some time ago) - -2003-11-24 17:00 migueldb - - * doc/style.css: - - + Added new classes for the docs. - -2003-11-24 16:37 migueldb - - * phplot.php: - - + Added SetDefaultDashedStyle() - - + Replaced outdated call to imagesetstyle() with SetDashedStyle() - - + Moved the check for dashed_grid from constructor (where it - could lead to strange behaviour) into DrawXTicks() and - DrawYticks() (BTW, shouldn't these be renamed?) - -2003-11-24 16:12 migueldb - - * examples/: data_sample1.php, data_sample2.php, data_sample3.php, - data_sample4.php: - - + HTML tags to lowercase. - - + Added missing closing tags. - - + Indented code. - -2003-11-24 16:05 migueldb - - * examples/create_chart.php: - - + Modified to work with the new format_chart.php - -2003-11-24 16:04 migueldb - - * examples/format_chart.php: - - + New layout - - + Many new options - - + Some introductory words - - + Removed "you have to reload" warning (the default behaviour for - PHPlot now is to send no-cache header) - - + Small corrections - -2003-11-24 14:46 migueldb - - * phplot.php: - - + Added checks for tick placement in CalcMargins() - - + Uninportant renaming of some internal variables. - -2003-11-24 14:25 migueldb - - * phplot.php: - - + Some more renaming for consistency: vtick, vert_tick, etc are - now y_tick_ - - + Same for htick -> x_tick_ - - + + Draw*Ticks() renamed following the same scheme - - + Grouped tick label parameter setting functions in - SetTickLabelParams(). Left original ones in 'deprecated' - - + Grouped grid parameter setting functions in SetGridParams(). - Left original ones in 'deprecated' - - + Grouped Title setting and positioning in Set*Title(). Left - original ones in 'deprecated' - - + Slight modifications to data label placement - -2003-11-24 11:30 migueldb - - * doc/index.html: - - + More reorganisation - -2003-11-23 23:53 migueldb - - * phplot.php: - - + Corrected a typo. - -2003-11-23 23:39 migueldb - - * phplot.php: - - + Restructured internal font management: font variables are now - hashes with all associated info. DrawText() now only needs that - and chooses whether to draw TrueType or not. Almost every "if - ($this->use_ttf)" check removed as a result. - - + Added SetDefaultTTFont() - - + When drawing pie charts (no axis titles nor labels), maximize - plot area. - -2003-11-23 21:48 migueldb - - * doc/index.html: - - + Included function_reference.html links here. - -2003-11-23 21:42 migueldb - - * doc/: index.html, schema.html: [no log message] - -2003-11-23 21:39 migueldb - - * doc/index.html: - - + New welcome page, some text. - - + Some features listed. - - + Uses stylesheet - -2003-11-23 21:37 migueldb - - * doc/: style.css, php_test.php: - - + First commit - -2003-11-23 21:36 migueldb - - * examples/test_setup.php: - - + Added stylesheet - - + Silly change - -2003-11-23 21:35 migueldb - - * examples/inline_image.php: - - + Silly change - -2003-11-23 21:34 migueldb - - * examples/create_chart.php: - - + Renamed SetYLabel() and SetXLabel() to SetYTitle() and - SetXTitle() - -2003-11-23 21:33 migueldb - - * examples/format_chart.php: - - + Added file format option - - + Added stylesheet - -2003-11-23 20:00 migueldb - - * phplot.php: - - + DrawText(): horizontal (left, center and right) and vertical - (top, center, bottom) alignment finished. - - + Replaced all outdated ocurrences of ImageString() with calls to - DrawText(). - - + Removed redundant text placement calculations. - - + DrawLegend() now draws the legend box more accurately (final - solution to bug #527867) - -2003-11-23 02:02 migueldb - - * phplot.php: - - + tick_length and tick_length2 now are htick_length and - vtick_length. - - + Included SetHTickLength() and SetVTickLength() - - + Fixed silly bug with SetDefaultFonts() - - + SetUseTTF() now resets the fonts. - - + More room for title - -2003-11-22 23:40 migueldb - - * phplot.php: - - + Somewhat clearer naming convention for labels, ticks, titles - and fonts. - - + X tick labels and X Title can be: plotdow, plotup, both, none - - + Y tick labels and Y Title can be: plotleft, plotright, both, - none - - + Renamed some Set*() internal functions to Calc*() (Set - - + is to be left for "public" methods) - - + More doxygen comments - - + Optimised FindDataLimits() - - + A few bugfixes - -2003-11-22 18:04 migueldb - - * examples/test_setup.php: - - + Added wbmp format - - + Now using imagetypes() instead of function_exists() - -2003-11-22 13:57 migueldb - - * examples/test_setup.php: - - + Graphic formats availability checks now use function_exists() - - + HTML code restructured. - -2003-11-22 13:55 migueldb - - * examples/create_chart.php: - - + Using $_GET and $_POST - - + SetImageFormat() option added - -2003-11-22 13:54 migueldb - - * examples/format_chart.php: - - + HTML code rewritten, better layout - - + Image format option - -2003-11-22 03:02 migueldb - - * phplot.php: - - + Improved datalabel_font - - + + Added SetDatalabelFontSize() - - + Added many more doxygen comments. - - + Other micro-changes. - -2003-11-22 02:06 migueldb - - * examples/inline_image.php: - - + register_globals default (PHP4) setting taken into account - -2003-11-22 01:46 migueldb - - * phplot.php: - - + Bug #790745 fixed. Thx. to the poster. - - + DrawError() now accepts position and centers text - - + '[423202] Catch error on empty arrays' solved. No more 'divide - by zero's - - + Some (random) doxygen comments inserted. It might be a good - idea for auto-docs. - -2003-11-21 22:27 migueldb - - * phplot.php: My first commit, here are the changes (that I - remember) - - + Y axis tick and label options now work - - + X axis tick and label options: plotdown,plotup,both,none - - + Implemented tick_length2 for rightmost/upper side - - + More default data colors assigned to data_color and error_color - arrays - - + Deprecated draw_vert_ticks and SetDrawVertTicks() in favor of - 'none' value in vert_tick_position - - + Better? upper,lower, rightmost margin calculation - - + Dashed grid lines - - + Added FormatTickLabel(). Removed redundant code in - DrawHorizontalTicks() - - + Removed all calls left to DrawDataLabel(), moved to - "deprecated"... - - + Moved some code and functions around. - - + Attempted correction for Bug [440065] "Pie labels not centered - correctly" - - + Corrected '$which_pt not an acceptable plot type' typo [682068] - - + Now using SetFileFormat() for PHP4 - - + Bug [484235] might be solved by now (not sure!) - -2003-11-21 20:42 migueldb - - * examples/create_chart.php: Now works with register_globals off - -2002-06-21 01:35 afan - - * examples/test_setup.php: Testing update: (Moved GIF to last - check) - -2002-04-30 15:25 afan - - * phplot.php: Fixed error in pie graphs with data=0. Changed - functions and tabs to PEAR standards - - Afan - -2002-02-22 03:15 afan - - * phplot.php: No changes - just settting up new server - -2001-04-19 03:03 afan - - * phplot.php, examples/inline_image.php: fix error on function - -2001-04-19 00:18 mdj_guardian - - * phplot.php: Fixed problem with example 8. Also modified the - default y_padding value so the examples with zero on the bottom - turn out that way. - -2001-04-18 07:18 mdj_guardian - - * phplot.php: Made the following changes: - - + Fixed the case of built in functions to match PHP documentation - - + Modified SetFileFormat to work in PHP3 & 4 with no changes - - + Improved auto-scaling signifcantly (SetVertPadding, y_padding, - SetPlotAreaWorld) (needs docs and examples) - - + Fixed a problem in DrawDashedLine when the line segments were - zero length - - + Modified DrawLegend to fix positioning of lower right corner of - box. Was cutting through text - - + Removed a duplicated line in FindDataLimits - -2001-04-08 15:58 afan - - * phplot.php: Minor change to formatting - -2001-03-27 07:42 afan - - * phplot.php, phplot_data.php, examples/data.php, - examples/data_sample1.php, examples/data_sample3.php, - examples/example1.php, examples/example2.php, - examples/example3.php, examples/example4.php, - examples/example6.php, examples/example7.php, - examples/example8.php, examples/example9.php, - examples/format_chart.php, examples/inline_image.php, - examples/test_setup.php: Committing 4.4.6 - -2001-03-19 16:08 afan - - * phplot.php, doc/user_functions.html: Cleaned up Shading Function - for Bars Bug Fix in Placement of Datalabels. - -2001-03-17 16:40 afan - - * examples/: data.php, data_date.php, data_date2.php, - data_sample1.php, data_sample2.php, data_sample3.php, - example1.php, example2.php, example3.php, example6.php, - example7.php, example8.php, example9.php, format_chart.php, - inline_image.php, test_setup.php: changed examples from ? to ?php - format. - -2001-03-16 13:59 afan - - * phplot.php: Error in line 361 corrected. - -2001-03-16 03:10 afan - - * phplot.php: Major updates to DrawDots and DrawBars to make it - easy to put labels and dots overwriting bars. Code optimizations - and checks to make sure you don't need to set error_reporting(0). - -2001-03-09 19:58 afan - - * phplot.php: Minor bug fixes - -2001-03-01 17:47 afan - - * README.txt, phplot.php, rgb_small.inc.php, examples/example8.php: - Bug on line 164 corrected Removed rgb_small.inc.php - -2001-02-27 17:49 afan - - * phplot.php: Added ability to use background Images with plots - Changed Image Color Allocation to work even with background - Images Note: this change requires usage of PHPLOT 3.0.2 or later. - -2001-02-23 21:22 afan - - * phplot.php, phplot_data.php, examples/example3.php, - examples/example6.php, examples/example9.php: DrawText, - SetRGBColor, Sessions fixes - -2001-02-16 16:40 afan - - * phplot.php, examples/example1.php: Added output_file and - input_file Added Constructor Added check to see if an image index - has already been added for smaller files - -2001-02-14 21:06 afan - - * phplot.php, examples/example1.php: Added Function SetColorIndex - for operating on image color indexes directly Also checks to see - if the color has already been defined for image size - optimization. - -2001-02-13 20:50 afan - - * phplot.php, examples/example1.php: Minor Bugfix - -2001-02-13 18:16 afan - - * phplot.php, examples/data.php, examples/example2.php, - examples/example3.php, examples/example4.php: Title - modifications, added movable Y axis - -2001-02-12 14:54 afan - - * examples/example8.php: Adding example8: two plots on one image - -2001-02-09 18:56 afan - - * phplot.php: Added SetYAxisPosition and changed DrawYAxisCode - -2001-02-09 10:14 afan - - * phplot.php: Added Title return lines - -2001-02-08 05:35 afan - - * README.txt, phplot.php, doc/user_functions.html, - doc/user_internal_functions.html, examples/data.php, - examples/example1.php, examples/example4.php: Added Error Bar - Widths, Missing Data Handling, Minor bugfix, More docs - -2001-01-29 05:51 afan - - * phplot.php, examples/create_chart.php, examples/example7.php: - Added NumHorizTicks, fixed bug in example 7 - -2001-01-23 05:09 afan - - * doc/user_functions.html: Doc Fix - -2001-01-23 05:04 afan - - * phplot.php: Minor Changes - -2001-01-23 05:03 afan - - * phplot.php, doc/internal_functions.html, doc/user_functions.html: - Updated Documentation - -2001-01-23 04:36 afan - - * phplot.php, examples/example3.php: Minor bug fixes. - -2001-01-23 01:33 afan - - * phplot.php: Minor fix to phplot after major update - -2001-01-23 01:06 afan - - * README.txt, phplot.php, phplot_data.php, - examples/create_chart.php, examples/data.php, - examples/data_date.php, examples/data_date2.php, - examples/example2.php, examples/example4.php, - examples/example6.php, examples/example7.php, examples/test1.php: - Lots changed: easier to make multiple images, logs, etc. - -2001-01-17 04:05 afan - - * phplot.php: [no log message] - -2001-01-17 03:42 afan - - * phplot.php: Implemented Log Plots. Very little error checking - -2001-01-17 03:41 afan - - * phplot.php: Log plots implemented. Very little data error - checking. - -2001-01-14 03:02 extensive - - * phplot.php, phplot_data.php, doc/internal_functions.html, - doc/user_functions.html: Changed ReportError to DrawError - respectively PrintError, added new functionality to PHPlot_data - and added some documentation of PHPlot_data - -2001-01-11 18:43 afan - - * phplot.php, doc/internal_functions.html: Added documentation. - -2001-01-11 17:07 afan - - * create_chart.php, data_sample1.php, data_sample2.php, - data_sample3.php, data_sample4.php, doc.htm, format_chart.php, - phplot.php, doc/examples.html, doc/function_reference.html, - doc/index.html, doc/internal_functions.html, doc/quick_start.php, - doc/user_functions.html, doc/user_internal_functions.html, - examples/benjamingothic.ttf, examples/create_chart.php, - examples/data_sample1.php, examples/data_sample2.php, - examples/data_sample3.php, examples/data_sample4.php, - examples/format_chart.php, examples/inline_image.php, - examples/test_setup.php: Major change to structure of PHPLOT. Doc - directory, moved examples to examples directory. - -2001-01-11 16:25 extensive - - * phplot.php: just added ReportError() and changed all DrawError() - calls to use ReportError(). phplot seems to be broken on my - system but I don't think it is my fault (this was the first time - I was testing a 3.7.x version), let's address that later. Is it - broken on your system, too, Afan? - -2001-01-11 02:14 extensive - - * phplot.php, phplot_data.php: I just corrected some typos (mostly - my name being misspelled ;-) - -2001-01-08 00:53 afan - - * doc.htm, phplot.php, phplot_data.php: Added Plot Border types - -2001-01-07 00:35 afan - - * doc.htm, phplot_data.php: Adding phplot_data for release 3.7.0 - -2001-01-07 00:30 afan - - * examples/: data.php, example1.php, example2.php, example3.php, - example4.php, example5.php, rgb.inc.php, test1.php: Adding - PHPLOT_DATA routines. Defining the first sub-class. Added - examples: Afan - -2001-01-07 00:23 afan - - * README.txt, create_chart.php, data_sample3.php, doc.htm, - phplot.php, stocks.php, stocks1.php, test1.php: 3.6.4 Committed - -2000-12-13 22:02 afan - - * phplot.php: Allowing data in time_format but printed using - strftime - -2000-12-13 04:47 afan - - * doc.htm, phplot.php, stocks.php: ver 3.2.1 and New Docs - -2000-12-11 18:03 afan - - * create_chart.php, data_sample2.php, format_chart.php, phplot.php: - Release version 3.2.0 - -2000-11-29 17:12 afan - - * README.txt, benjamingothic.ttf, create_chart.php, - data_sample1.php, data_sample2.php, data_sample3.php, - data_sample4.php, doc.htm, format_chart.php, phplot.php, - rgb.inc.php, rgb_small.inc.php, stocks.php, stocks1.php, - test1.php: Initial revision - -2000-11-29 17:12 afan - - * README.txt, benjamingothic.ttf, create_chart.php, - data_sample1.php, data_sample2.php, data_sample3.php, - data_sample4.php, doc.htm, format_chart.php, phplot.php, - rgb.inc.php, rgb_small.inc.php, stocks.php, stocks1.php, - test1.php: The first upload! Afan Ottenheimer - diff --git a/gui/bacula-web/external_packages/phplot/LICENSE.GPL b/gui/bacula-web/external_packages/phplot/LICENSE.GPL deleted file mode 100644 index 5b6e7c66c2..0000000000 --- a/gui/bacula-web/external_packages/phplot/LICENSE.GPL +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/gui/bacula-web/external_packages/phplot/LICENSE.PHP_3_0 b/gui/bacula-web/external_packages/phplot/LICENSE.PHP_3_0 deleted file mode 100644 index ffc1ab71f3..0000000000 --- a/gui/bacula-web/external_packages/phplot/LICENSE.PHP_3_0 +++ /dev/null @@ -1,68 +0,0 @@ --------------------------------------------------------------------- - The PHP License, version 3.0 -Copyright (c) 1999 - 2003 The PHP Group. All rights reserved. --------------------------------------------------------------------- - -Redistribution and use in source and binary forms, with or without -modification, is permitted provided that the following conditions -are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. - - 3. The name "PHP" must not be used to endorse or promote products - derived from this software without prior written permission. For - written permission, please contact group@php.net. - - 4. Products derived from this software may not be called "PHP", nor - may "PHP" appear in their name, without prior written permission - from group@php.net. You may indicate that your software works in - conjunction with PHP by saying "Foo for PHP" instead of calling - it "PHP Foo" or "phpfoo" - - 5. The PHP Group may publish revised and/or new versions of the - license from time to time. Each version will be given a - distinguishing version number. - Once covered code has been published under a particular version - of the license, you may always continue to use it under the terms - of that version. You may also choose to use such covered code - under the terms of any subsequent version of the license - published by the PHP Group. No one other than the PHP Group has - the right to modify the terms applicable to covered code created - under this License. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes PHP, freely available from - ". - -THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND -ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A -PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP -DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -OF THE POSSIBILITY OF SUCH DAMAGE. - --------------------------------------------------------------------- - -This software consists of voluntary contributions made by many -individuals on behalf of the PHP Group. - -The PHP Group can be contacted via Email at group@php.net. - -For more information on the PHP Group and the PHP project, -please see . - -This product includes the Zend Engine, freely available at -. diff --git a/gui/bacula-web/external_packages/phplot/README b/gui/bacula-web/external_packages/phplot/README deleted file mode 100644 index b571f13ee3..0000000000 --- a/gui/bacula-web/external_packages/phplot/README +++ /dev/null @@ -1,45 +0,0 @@ -This is a class for creating scientific and business charts. -To start extract the files with - - tar -zxvf phplot-5.0rc1.tar.gz - -and then point your browser to - - doc/index.php. - -There are some configuration settings that you will need to make -based on your setup. - -1. File Type: Depending on the version of GD you are using, - you may or may not have GIF or PNG file ability. That is - set with the function. - - SetFileFormat("") where is png, gif, jpeg, ... - - or edit the file phplot.php and change the line - - var $file_format = ""; - -2. TTF: If you have TTF installed then use (and read the docs) - - SetUseTTF(TRUE); - - otherwise use - - SetUseTTF(FALSE); - -Everything else should be independent of what version you are using. -This has been tested with PHP3, PHP4, GD1.2 and GD 3.8. - -To start please see doc/index.php. There you'll find examples, tests and -some introductory documents. - --------------------------- - -This is distributed with NO WARRANTY and under the terms of the GNU GPL -and PHP licenses. If you use it - a cookie or some credit would be nice. - -You can get a copy of the GNU GPL at http://www.gnu.org/copyleft/gpl.html -You can get a copy of the PHP License at http://www.php.net/license.html - -See http://www.sourceforge.net/projects/phplot/ for the latest changes. diff --git a/gui/bacula-web/external_packages/phplot/doc/imgs/graph1.png b/gui/bacula-web/external_packages/phplot/doc/imgs/graph1.png deleted file mode 100644 index 3b5a1c205a..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/doc/imgs/graph1.png and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/doc/imgs/graph2.png b/gui/bacula-web/external_packages/phplot/doc/imgs/graph2.png deleted file mode 100644 index ff0e80beb8..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/doc/imgs/graph2.png and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/doc/imgs/graph3.png b/gui/bacula-web/external_packages/phplot/doc/imgs/graph3.png deleted file mode 100644 index e437c8789e..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/doc/imgs/graph3.png and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/doc/imgs/phplot-dia.png b/gui/bacula-web/external_packages/phplot/doc/imgs/phplot-dia.png deleted file mode 100644 index eac14eb27d..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/doc/imgs/phplot-dia.png and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig1.png b/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig1.png deleted file mode 100644 index 08fc68bc3b..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig1.png and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig2.png b/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig2.png deleted file mode 100644 index 5deafe4b04..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig2.png and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig3.png b/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig3.png deleted file mode 100644 index c98f692c52..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig3.png and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig4.png b/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig4.png deleted file mode 100644 index f6c6872c0a..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/doc/imgs/qstart_fig4.png and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/doc/index.php b/gui/bacula-web/external_packages/phplot/doc/index.php deleted file mode 100644 index a6482ec64a..0000000000 --- a/gui/bacula-web/external_packages/phplot/doc/index.php +++ /dev/null @@ -1,152 +0,0 @@ - - - - - Welcome to PHPlot - - - - -

Welcome to PHPlot 5.0

- - - - - -
-

- PHPlot is a PHP4 class for on the fly graphs - generation. It was started by - Afan Ottenheimer in 2000 as an - opensource project, and is now co-developed with - Miguel de Benito thanks to - sourceforge. It is distributed under - the terms of the - GNU General Public License, - and the PHP license. You can always - obtain the latest source from the - sourceforge project page, please do also check CVS, we try to have it always working - there. -

-

For further information, please check - our website -

-
- - - -
Example line graph with labels, legend - and left and lower axis titles.
-
- - -

Features

- - - - - -
- - - -
Example 3d pie chart.
-
-

- Here goes a (incomplete) list, in no particular order.: -

    -
  • Several different graph types: lines, bars, stacked bars, points, areas, pie, squared.
  • -
  • text-data, data only and data-error data types accepted.
  • -
  • 3D shading for pie and bar graphs.
  • -
  • Different line types: solid and wholly customizable dashed ones.
  • -
  • Can draw error margins along y-axis when supplied in data.
  • -
  • Highly customizable canvas: titles, labels and ticks can be - placed anywhere, with any color and everything gets automagically placed without overlapping.
  • -
  • Vertical and horizontal grids.
  • -
  • Legend. Different types on the works.
  • -
  • TrueType font support.
  • -
  • Linear and logaritmic scales.
  • -
  • Several output formats: jpeg, png, gif, wbmp (those supported by your GD)
  • -
- And here a short to-do/whishlist: -
    -
  • Horizontal bars.
  • -
  • Simple isometric 3D plots.
  • -
  • Automatic placement of several plots in one image.
  • -
  • Better or automatic management of many drawing options (ticks, labels, etc.)
  • -
  • Subclassing for optimisation: move features into subclasses for optional use - and leave a fast core.
  • -
-

-
- - -

Requirements

-

-We are not sure about exact requirements, but at least PHP 4.2.0 and -GD Lib 2 are necessary. Feedback is welcome. -

- - -

Quick start

-

You can rush for a quick start here.

- - -

Tests and examples

-

-These examples make use of many, but not all, of the features present in PHPlot. -The best one is the example-o-matic, where you can alter many parameters. Please proceed -to any of them: -

-

- - -

Internals

-

-Description of the use and inner workings of PHPlot: -

-

- -

The Authors

-

-

-

- -

$Id$

- - diff --git a/gui/bacula-web/external_packages/phplot/doc/internal_functions.html b/gui/bacula-web/external_packages/phplot/doc/internal_functions.html deleted file mode 100644 index 90895c0d7c..0000000000 --- a/gui/bacula-web/external_packages/phplot/doc/internal_functions.html +++ /dev/null @@ -1,269 +0,0 @@ - - -PHPlot Internal Functions - - - -

PHPlot Internal Functions

- -

DrawArea() -
Internal Function: Draw an Area Chart. $data[] must already be defined as data-data -using $data[] = array("title",x,y1,y2,...) Points are placed at (x,y1), (x,y2), ... -one x-point per $data[] element.
Colors and border colors for each of the y1, y2, ... is set -by SetDataColors($which_data,$which_border) -This function is called if -you use SetPlotType("area") and SetDataType("data-data") - - -

DrawAreaSeries() -
Internal Function: Draw an Area Chart. $data[] must already be defined as $data[] = -array("title",y1,y2,y3,...) The x axis is divided evenly, one x-point per -$data[] element.
Colors and border colors for each of the y1, y2, ... is set -by SetDataColors($which_data,$which_border) -This function is called if -you use SetPlotType("area") and SetDataType("text-data") - -

DrawBackground() -
Internal Function: Draw the full background of the image on image pointer. Should be used -BEFORE other Draw functions unless you really want to overwrite what you've done -before. See SetBackgroundColor and SetImageArea for setting -parameters. - -

DrawBars() -
Internal Function: Draw vertical bars. $data[] must already be defined as $data[] = -array("title",y1,y2,y3,...) The x axis is divided evenly, one x-point per -$data[] element.
Colors and border colors for each of the y1, y2, ... is set -by SetDataColors($which_data,$which_border) -This function is called if -you use SetPlotType("bars") and SetDataType("text-data") - -

DrawDashedLine($x1,$y1,$x2,$y2,$dashed, $space, $color) -
Internal Function: Called instead of ImageLine when line_style = 'dashed' -line_style is set by SetLineStyles All variables passed to DrawDashedLine -are in pixel coordinates. - -

DrawDots() -
Internal Function: Draw Dots as defined by SetPointType and data in x,y format. $data[] -must already be defined as $data[] = array("title",x,y1,y2,...) Where the point -occurs depends on both the X and Y values.
Colors and border colors for each -y1, y2, , ... is set by SetDataColors($which_data,$which_border) -This function is called if -you use SetPlotType("dots") and SetDataType("data-data") - -

DrawDotSeries() -
Internal Function: Draw Dots as defined by SetPointType and data in text-data format. -$data[] must already be defined as $data[] = array("title",y1,y2,...) -The x axis is divided evenly, one x-point per $data[] element.
-Colors and border colors -for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) -This function is called if -you use SetPlotType("dots") and SetDataType("text-data") - -

DrawDotsError() -
Internal Function: Draw Dots and Error Bars as defined by SetPointType and -data in data-data-error format. $data[] must already be defined -as $data[] = array("label",x,y,error+,error-) -Colors and border colors -for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) -The shape of the error bars is defined by SetErrorBarShape($which_ebs) -and SetErrorBarSize($which_ebs)
-This function is called if -you use SetPlotType("dots") and SetDataType("data-data-error") - -

DrawError($error_message) -
Internal Function: Draw an internal error message printed on the Image directly. -This way - if there is an error and the output is an image you -don't get the PHP "Header already sent" messages. - -

DrawGraph() -
Internal Function: This is th last function called after you have set up -all the parameters of the graph see Set.... functions below. - -

DrawHorizontalTicks() -
Internal Function: Draw the ticks on the X axis. -The distance between ticks can be defined in a number of ways. Note: -that for text-data data its best to let the program handle the -distance between ticks - the default is 1. (Text-data data is data where the data is evenly spaced over -the x axis, no x-value is entered) - -

DrawImageBorder() -
Internal Function: Draw the border around the entire image. Currently this -generates the raised border look around the image. - -

DrawLabels() -
Internal Function: Draw the Title, X-axis label, and the Y-axis label. This -really just calls DrawTitle, DrawXLabel, and DrawYLabel. - -

DrawLegend(x,y,type) -
Internal Function: Draw the Legend. See SetLegendPixels() - -

DrawLines() -
Internal Function: Draw lines in data-data format. -$data[] must already be defined -as $data[] = array("label",x,y1,y2,....) -Colors and border colors -for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) -This function is called if -you use SetPlotType("lines") and SetDataType("data-data") -
- -

DrawLineSeries() -
Internal Function: Draw lines in text-data format. -$data[] must already be defined -as $data[] = array("label",y1,y2,y3,....) -The x axis is divided evenly, one x-point per -$data[] element.
Colors and border colors for each of the y1, y2, ... is set -by SetDataColors($which_data,$which_border) -This function is called if -you use SetPlotType("lines") and SetDataType("text-data") - -

DrawLinesError() -
Internal Function: Lines and Error Bars as defined by SetPointType and -data in data-data-error format. $data[] must already be defined -as $data[] = array("label",x,y,error+,error-) -Colors and border colors -for each y1, y2, , ... is set by SetDataColors($which_data,$which_border) -The shape of the error bars is defined by SetErrorBarShape($which_ebs) -and SetErrorBarSize($which_ebs) -This function is called if -you use SetPlotType("lines") and SetDataType("data-data-error") - -

DrawPieChart() -
Internal Function: Draw pie chart. Data is in text-data format. $data[] must -already been defined as $data[] = array("label",y1,y2,y3,...)
-Colors and border colors for each of the y1, y2, ... is set -by SetDataColors($which_data,$which_border) -This function is called if -you use SetPlotType("pie") and SetDataType("text-data") - -

DrawPlotAreaBackground() -
Internal Function: Draw the Background - in the color as defined by X -and in an area as defined by X - -

DrawPlotBorder() -
Internal Function: Draw the border around the -plot area - (Note: this is NOT the full image). This draws -the rectangle as well as calling the functions -DrawVerticalTicks() and DrawXAxis() - -

DrawTitle() -
Internal Function: This will draw the title as set by -SetTitle and -SetTitleColor. This is also affected by SetUseTTF -to show how the title appears. - - -

DrawVerticalTicks() -
Internal Function: Called by DrawPlotBorder. The spacing between the ticks -is automatically set unless you have previously set the increment -by - SetNumVertTicks($which_nt) -or - SetVertTickIncrements but not both. - -

DrawXAxis() -
Internal Function: Draw the horizontal X axis at the world position X=0. - -

DrawXLabel() -
Internal Function: Called from DrawLabels. Draws the label of the X-Axis. - -

DrawYErrorBar($x_world,$y_world,$error_height,$error_bar_type,$color) -
Internal Function: This is similar to DrawDot, but it draws error bars. -Draw one set of error bars at $x_world and $y_world where the -data is defined in world coordinates (not pixel coordinates). - -

DrawYLabel() -
Internal Function: Called from DrawLabels. Draws the label of the Y-Axis. Its -position is defined by the size of the font. Typically there is a -two character height width around the plot area for drawing the -labels. - -

FindDataLimits() -
Internal Function: This must be called AFTER SetDataType. It finds -the maxima and minima for setting the scaling to be -able to convert from world to pixel coordinates. - -

InitImage() -
Internal Function: An internal function called to set the -image pointer for GD. - -

PrintError($error_message) -
Internal Function: Prints the given error message to stdout. The function -is used for fatal errors that do not allow for creating an image. - -

PrintImage() -
Internal Function: An internal function which prints the image using the PHP -functions Header("Content-type:...") and ImageGIF(), ImageJPEG(), -or ImagePNG() depending on what the setting is of $this->file_format. -This is set by SetFileFormat() - -

SetColor($color_asked) -
Internal Function: Translate from $color_asked to the index -name color used in GD. -$color_asked can be either a name like "black" or an rgb color array -array(int,int,int).
- -

SetDefaultColors() -
Internal Function: Sets the default colors when first defining an image. -Overridden by functions like SetPlotBgColor, - SetBackgroundColor, - SetTextColor, - SetGridColor, - SetLightGridColor, - SetTickColor, and - SetTitleColor - -

SetDrawYGrid($which_dyg) -
Internal Function: 1 = Draw the Y grid. Anything else, don't draw the Y grid. - -

SetEqualXCoord() -
Internal Function: For text-data graphs set the spacing between -data points on the x-axis. - -

SetMargins() -
Internal Function: When the image is first created - set the margins - as the full area of the view surface (or panel), - less a margin of 4 character heights all round for labelling. - It thus depends on the current character size, set by SetCharacterHeight(). - -

SetTranslation() -
Internal Function: Calculate the scale and origin for translating from -world to pixel coordinates. This is an internal function, -not one that you'd use normally, but if you are going to -use it make sure you do it after SetDataType. - -

SetXLabelHeight() -
Internal Function: This is an internal function that sets the -height of the X labels based on the maximum string -length of the X data. It is used for positioning -where the labels go relative to the x-axis. - - -

SetYLabelWidth() -
Internal Function: Set the -width of the Y Label based on the maximum string -length of the Y data. It is used for positioning -where the labels go relative to the y-axis. - - -

TTFBBoxSize($size, $angle, $font, $string) -
Internal Function: Calculate the size of the box which encloses the -text string $string using font $font, -angle $angle and size $size. This is -an internal function which is not called unless use_ttf is -set to 1. - -

xtr($x_world) -
Internal Function: Translate into x-pixels coordinates from x world coordinates. - -

ytr($y_world) -
Internal Function: Translate into y-pixels coordinates from y world coordinates. - - - - - - - - - diff --git a/gui/bacula-web/external_packages/phplot/doc/quickstart.html b/gui/bacula-web/external_packages/phplot/doc/quickstart.html deleted file mode 100644 index 6f738c6c9c..0000000000 --- a/gui/bacula-web/external_packages/phplot/doc/quickstart.html +++ /dev/null @@ -1,455 +0,0 @@ - - - - - PHPLOT Quick Start and Examples - - - - - - - - - - - - - - -

PHPlot Quick Start and Examples

- -

Afan Ottenheimer, January 7, 2001

-

Miguel de Benito, January 21, 2004

-

Contents

- - -

Introduction

- -

Many web sites need to create real-time or dynamic charts and graphs. -from live data sets. Many users have found PHP a great way for this dynamic -creation of images using the GD library and there have been several -good articles describing this [] [] []. The advantage of using the server -to create an image (server side scripting) is that one does not have to -worry about browser compatibility or client operating system compatibility issues. -The PHP image generating library uses the GD library to create elementary -shapes (elipse, line, rectangle, ...). -PHPlot is a graphics library which provides a means by which you can have your -(PHP enabled) web server create and manipulate graphs as objects and -display the completed graph as an image. Data sets passed to PHPlot use a very -convenient way for database driven sites, in rows with y coordinate data. -

- -

First, lets discuss how PHPlot works in general with some -terminology. A PHPlot image can consist of several graphs , -each graph consisting of several elements. -You define an object (e.g. a variable like $graph), -select the properties of the element that compose the graph and "Draw" -what you want into the object. Tipically by selecting the plot type with -SetPlotType and at the end calling DrawGraph. You -can also directly invoke PrintImage, which either inserts the image -into the data streaming to the client or writes it to disk. -

-

In PHPlot there are World coordinates, which are the XY coordinates -relative to the axis origin, in the units of the data set; and -device (pixel) coordinates which in GD are relative to the -origin at the upper left side of the image. -

-

You can think of the "Draw" functions as shaping the -image object and the "Print" function as the method of -finally creating the digital image. PHPlot is smart enough that if -you only have one graph on an image, then the "Print" is -done for you automatically. If you do have multiple graphs per image -then you'll need to use both the "Draw" and "Print" -functions. We'll talk about that a bit later. -

-

Since PHP is a server scripted language you have several options -for how you can "Print" the image. You can:

-
    -
  1. Write the image as a file on the server. (You specify a file - name and can specify caching as well)
  2. -
  3. Have the raw data stream out within an HTML file, as <IMG - SRC="my_PHPlot_code.php">
  4. -
  5. Precede the raw data with html image headers and call the - script directly (showing up as an image) e.g. - http://somewhere/my_PHPlot_code2.php .
  6. -
-

This document explains how to create plots using PHPlot from a -PHP script. Information on PHP can be found at www.php.net. -Information about the GD library which PHP uses to create images can -be found at www.boutell.com. -More information about PHPlot can be found at www.PHPlot.com.

- -

Creating the Object

- -

You create a PHPlot object by first including the code to be used -and then defining the variable:

-
-
<?php
-include('./phplot.php');  // here we include the PHPlot code 
-$graph =& new PHPlot();   // here we define the variable graph
-
-//Rest of code goes below
-?>
-
- -

The above code assigns the PHPlot object to the variable $graph. Please, -use that '&' to create a reference, it is needed by phplot's approximation of a destructor, -a facility unavailable in PHP4.

- -

Back to top

- - -

Real World Examples

-

Case 1: A simple graph

- -

We will start with a simple line graph.

-
-
<?php
-//Include the code
-include('./PHPlot.php');
-
-//Define the object
-$graph =& new PHPlot();
-
-//Define some data
-$example_data = array(
-     array('a',3),
-     array('b',5),
-     array('c',7),
-     array('d',8),
-     array('e',2),
-     array('f',6),
-     array('g',7)
-);
-$graph->SetDataValues($example_data);
-
-//Draw it
-$graph->DrawGraph(); // remember, since in this example we have one graph, PHPlot
-                        // does the PrintImage part for you
-?>
-
- -

And that's it! What we get is the following graph:

- -
- figure 1 -
Figure 1 -
- -

That's a great start, but now we'd like to specify the width and height -of the image.

- - -

Case 1a: Different Size Images and Titles

-

-Lets say we want it to have a width of 300 and a height of 250 pixels. -So instead of having the line

- $graph =& new PHPlot();

-we replace it with

- $graph =& new PHPlot(300,250);

-and you have specified the size in pixels of the image to be created. -A couple of things to note: -

-
    -
  • The default is not to use TTF fonts.
  • -
  • Since there was only one graph on the image we didn't have to - specify PrintImage, DrawGraph took care of it for us. -
  • -
  • - We did not specify the data type. If you do not specify the data - type PHPlot assumes text-data. -
  • -
  • - We did not specify the file type (gif, png, jpg, ...) . - PHPlot 5.0 assumes PNG image formats. -
  • -
  • - The data is passed in as an array of arrays. This may seem awkward - now, but as we add functionality this will be beneficial. -
  • -
-

Ok, now we're ready to add some customization to the plot. Let's change -the size, the title and the x/y axis labels. All we need to do is modify -the variable $graph before printing the image. We achieve this with: -

-
-
<?php
-include ('./phplot.php');
-
-//create an graph object 300x250 pixels
-$graph =& new PHPlot(300,250);
-//Set titles
-$graph->SetTitle("Title\n\rSubtitle");
-$graph->SetXTitle('X data');
-$graph->SetYTitle('Y data');
-
-//...rest of the code
-
-
-?>
-
-
-
- Figure 2 -
- -

Note that in order for the "\n" and "\r " to be interpreted as -new line/new return characters for SetTitle you have to -enclose the string in double quotes.

- -

Case 2: Multiple Lines per Graph

-

Lets say we want to plot not just one -dataset but several y values for each x position. With PHPlot it is -easy to specify the multiple data lines by just passing in all the Y -values for a given X value at once. So instead of array('label', y) -we specify array('label', y1, y2, y3, -...) This is very convenient when working with rows of data from databases. -
-Now our data will have three Y values for each position on the X axis -

-
-
<?php
-//Include the code
-include('./phplot.php');
-
-//Define the object
-$graph =& new PHPlot(300,250);
-
-//Set titles
-$graph->SetTitle("Title\n\rSubtitle");
-$graph->SetXTitle('X data');
-$graph->SetYTitle('Y data');
-
-
-//Define some data
-$example_data = array(
-     array('a',3,4,2),
-     array('b',5,'',1),  // here we have a missing data point, that's ok
-     array('c',7,2,6),
-     array('d',8,1,4),
-     array('e',2,4,6),
-     array('f',6,4,5),
-     array('g',7,2,3)
-);
-$graph->SetDataValues($example_data);
-
-//Draw it
-$graph->DrawGraph();
-?>
-
-

Which gives us:

-
- -
Figure 3 -
- -

Notice that each set of Y data gets a different color. -Also the missing data point is skipped, this behaviour can be adjusted with -SetDrawBrokenLines(TRUE); -

-

-This gives you the basics of how to create a graph in PHPlot. -A nice start, but now we'd like to add some customization, namely different -fonts, margins and types of graphs. -

-

Back to top

- - -

Customization

-

Valid types of plots (as of PHPlot 5.0): -

    -
  • bars (with optional shadows)
  • -
  • lines
  • -
  • linepoints (a faster way of plotting when - you want both points and lines)
  • -
  • area
  • -
  • points (lots of point types here)
  • -
  • pie (2D or 3D)
  • -
  • thinbarline (sometimes also called impulse)
  • -
  • error bar (which can also be used for stock market data graphs)
  • -
  • squared (for binary data)
  • -
-

-

You specify which type with the SetPlotType function. -We'll look at that function with bars and lines in the next example when we look at -multiple graphs per image. -

-

As we discussed before, there are several ways we can manipulate -the look/feel of the graph object. Almost every parameter of ticks, grids and data labels -can be adjusted via (among many others): -

    -
  • SetXTickPos()
  • -
  • SetYTickPos()
  • -
  • SetXTickLength()
  • -
  • SetYTickLength()
  • -
  • SetXTickCrossing()
  • -
  • SetYTickCrossing()
  • -
  • SetXTickIncrement()
  • -
  • SetYTickIncrement()
  • -
  • SetNumXTicks()
  • -
  • SetNumYticks()
  • -
  • SetSkipTopTick()
  • -
  • SetSkipBottomTick()
  • - -
  • SetDrawXGrid()
  • -
  • SetDrawYGrid()
  • -
  • SetDrawDashedGrid()
  • -
  • SetDrawXDataLabelLines()
  • -
  • SetDrawYDataLabelLines() (not yet implemented)
  • -
  • SetXDataLabelPos()
  • -
  • SetYDataLabelPos()
  • -
  • SetXLabelAngle()
  • -
  • SetYLabelAngle()
  • -
  • SetXLabelType()
  • -
  • SetYLabelType()
  • -
-As we go further we will introduce some of these features of PHPlot. -For more specialized examples, please go back to the index and -look in the examples section. -

- -

Back to top

- -

Case 3: Multiple Graphs per Image

- -

To create an image with several separate graphs -on it is a straightforward process. As in the previous examples we -first have to create an object (e.g. variable) but now we tell it to -not print the image at the same time as the draw command. Now -we want it to wait for the explicit PrintImage function call. -To tell PHPlot this is the way we want to work, we use the -SetPrintImage function. -SetPrintImage(TRUE) is the default, and tells to draw the image -when DrawGraph is called. To turn this -off we use SetPrintImage(FALSE).

-

Now we will draw several images entirely within one object. That -means that if we set a value for one graph, there will be a couple of -other commands we will need. -

-

To specify in pixels the placement of each graph we use -SetNewPlotAreaPixels. The format is -SetNewPlotAreaPixels(upper_left_x, upper_left_y, lower_right_x, -lower_right_y) . Again we are using the GD coordinates where 0,0 -is the upper left corner of the image. -

-

In more detail:

-
-
<?php
-include('./PHPlot.php');  // here we include the PHPlot code
-$graph =& new PHPlot(400,250);   // here we define the variable $graph
-$graph->SetPrintImage(0); //Don't draw the image yet
-
-//....Data and Values for first graph here .....
-
-$graph->SetNewPlotAreaPixels(70,10,375,100);  // where to place it
-
-$graph->DrawGraph();   //Draw the first graph to the image.
-
-//....Data and Values for second graph here .....
-
-$graph->SetNewPlotAreaPixels(70,120,375,220); //where to place graph 2
-$graph->DrawGraph();  //Draw the second graph to the image
-
-//Print the image with both graphs
-$graph->PrintImage();
-?>
-
- -

Lets now create an image with 2 graphs on it with some example data.

- -
-
<?php
-//Include the code
-include('./phplot.php');
-
-//Define the object
-$graph =& new PHPlot(400,250);
-
-$graph->SetPrintImage(0); //Don't draw the image until specified explicitly
-
-$example_data = array(
-     array('a',3),
-     array('b',5),
-     array('c',7),
-     array('d',8),
-     array('e',2),
-     array('f',6),
-     array('g',7)
-);
-
-$graph->SetDataType("text-data");  //Must be called before SetDataValues
-
-$graph->SetDataValues($example_data);
-$graph->SetYTickIncrement(2);  //a smaller graph now - so we set a new tick increment
-
-$graph->SetXLabelAngle(90);
-$graph->SetXTitle("");
-$graph->SetYTitle("Price");
-$graph->SetPlotType("lines");
-$graph->SetLineWidth(1);
-
-$graph->SetNewPlotAreaPixels(70,10,375,100);  // where do we want the graph to go
-$graph->DrawGraph(); // remember, since we said not to draw yet, PHPlot
-                     // still needs a PrintImage command to write an image.
-
-
-//Now do the second chart on the same image
-unset($example_data);  //we are re-using $example_data (to save memory), but you don't have to
-$example_data = array(
-     array('a',30,40,20),
-     array('b',50,'',10),  // here we have a missing data point, that's ok
-     array('c',70,20,60),
-     array('d',80,10,40),
-     array('e',20,40,60),
-     array('f',60,40,50),
-     array('g',70,20,30)
-);
-
-$graph->SetDataType("text-data");  //Must be called before SetDataValues
-
-$graph->SetDataValues($example_data);
-
-$graph->SetXTitle("");
-$graph->SetYTitle("Verbal Cues");
-$graph->SetYTickIncrement(10);
-$graph->SetPlotType("bars");
-$graph->SetXLabelAngle(0);  //have to re-set as defined above
-
-$graph->SetNewPlotAreaPixels(70,120,375,220);
-$graph->SetPlotAreaWorld(0,0,7,80);
-$graph->DrawGraph();
-
-//Print the image
-$graph->PrintImage();
-?>
-
- -



Which gives us:

- -
-
- Figure 4
-
- -

-You must remember that world Coordinates are the XY coordinates relative to the -axis origin that can be drawn. Not the device (pixel) coordinates -which in GD are relative to the origin at the upper left -side of the image. -

- - -
$Id$
- - - diff --git a/gui/bacula-web/external_packages/phplot/doc/schema.html b/gui/bacula-web/external_packages/phplot/doc/schema.html deleted file mode 100644 index 458ede2772..0000000000 --- a/gui/bacula-web/external_packages/phplot/doc/schema.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - PHPlot schema - - - - - - -

The Drawing

-

-The drawing you can see here is an attempt to illustrate the positioning -of elements on the canvas of PHPlot graphs. I'm not specially good at it -so please don't complain. I (Miguel) -hope it will help somebody as it did with me when I first began browsing -through the 3000 lines of code Afan had written. -

-

If you are curious, for the drawing I used -Dia a gtk+ diagram creation -sofware which I find easy and suited for my purposes. -

schema
-

- -

The words

-

Creating a graph with PHPlot is easy, you just create an instance of -the class, set up a few options, push in the data and smile at your -new cute graphic. However here we'll proceed a little more step by step so -to show you how to get the most of PHPlot. Please go to -quickstart. -

- -

$Id$

- - diff --git a/gui/bacula-web/external_packages/phplot/doc/style.css b/gui/bacula-web/external_packages/phplot/doc/style.css deleted file mode 100644 index ff700e0f5e..0000000000 --- a/gui/bacula-web/external_packages/phplot/doc/style.css +++ /dev/null @@ -1,42 +0,0 @@ -/* $Id$ - * Style sheet for PHPlot - */ - - -.foot { - text-align:right; - font-style:italic; - font-size:smaller; - width:100%; - background:#CCCCCC; - color:#000000; - } - - -.nav { - text-align:center; - color:#DDDDDD; - background:#FFFFFF; - font-size:7px; - } - -.imgfoot { text-align:center; font-size:small; font-style:italic; } -.hdr { text-align:center; background: #DDDDDD; color:#000000; } -.bighdr { text-align:center; font-weight: bold; } - -h2 { border-bottom: 1px dashed; } -h3 { border-bottom: 1px dotted; margin-left:1em;} - -img { padding: 0.5em; } - -.box { - background-color: #cccccc; - color: #000000; - border:1px solid; - width:75%; - margin:2em; - font-size:smaller; - } - -pre { font-family: monospace, "white-space" } - diff --git a/gui/bacula-web/external_packages/phplot/doc/user_functions.html b/gui/bacula-web/external_packages/phplot/doc/user_functions.html deleted file mode 100644 index 9b529019f3..0000000000 --- a/gui/bacula-web/external_packages/phplot/doc/user_functions.html +++ /dev/null @@ -1,316 +0,0 @@ - - -PHPlot User Functions - - - -

PHPlot User Functions

- - - - -
- -

Important functions

- -

SetDataType($which_dt) -
User Function: PHPLOT can accept data in a number of different -formats. One main difference between PHPLOT and PGPLOT -is that the x-y or x-y-error data should be passed in -with the data grouped together in an array. -

-Asside: Why the author chose this data format: In PGPLOT -you would have the X-values in one array and the Y-values -in a second. This would sometimes lead to really strange -graphs if one array was accidentally one data element -short. Plus most of the data the author was using came in -from a database using a _get_row or _get_array (in php) -and one can just pass it straight in to PHPLOT.

- -Colors and border colors are set by SetDataColors. Why -not have colors as part of the same array? Because most -data applications are used to putting out raw data and not -raw data + color information.

- -So in PHPLOT the datalabel,x-value,y-value and error are -grouped together as a value array. Then the -entire set of points to be plotted is passed in as a data array -E.g. Data_array = array(value_array_1,value_array_2,....)

-See below for examples of the various data types:
- -

  • text-data: Data is displayed at equal spacing along the x-axis. Data -is passed in as a data array of value arrays. Each element of the data -array is a position on the x-axis. The first element of the value array is -the label for that x-axis position, every subsequent element of the value -array is a y-value. -Example data
    -
    -$data = array(
    -	array("label 1",1.1,2,3,4),
    -	array("label 2",2,3,4,5),
    -	array("label 3",5,6,7,8),
    -	array("label 4",10,12,13,14)
    -);
    -
    -Which will display data points at -(1,1.1), (1,2), (1,3), (1,4), (2,2), (2,3)....
    - -
  • -
  • data-data: - X-Y data is passed in like text-data except -that the second element of the value array is the position along the -x axis of the data point(s). One data element would be $data[] = (title,x,y1,y2,y3,y4,...) -or -
    -$data = array(
    -	array("label 1",1.1,2,3,4),
    -	array("label 2",2,3,4,5),
    -	array("label 3",5,6,7,8),
    -	array("label 4",10,12,13,14)
    -);
    -
    -Notice that this is the same as in the previous example except that -the x,y data points are at (1.1,2), (1.1,3), (1.1,4), (2,3)... -
  • -
  • data-data-error: -Again X-Y data is passed in as an array with each value -array being (data_label,x_position,y_position,error_plus,error_minus) -
  • - -

    SetDataValues($which_dv) -
    User Function: Passes the raw data values into the class variable -$this->data_values. This function needs to be called before any -image can be drawn. - -

    SetPlotType($which_pt) -
    User Function: Can be: bars, lines, linepoints, area, points, and pie - -

    SetErrorBarLineWidth($width) -
    Width of the Error Bars in Pixels. If not set then -uses "line_width" to set the width of the error_bar lines. - -

    SetFileFormat($which_file_format) -
    User Function: Set the format of the output graph. Supported formats -are GIF, JPEG, and PNG. You can only use those formats -that are supported by your version of GD. For example, -if you use GD-1.8.3 you can not use GIF images. If you -use GD-1.2 you can not use PNG or JPEG images. - -

    SetUseTTF($which_ttf) -
    User Function: Call this as SetUseTTF(1) when you have TTF compiled into PHP -otherwise call this as SetUseTTF(0) - - -
    - -

    Appearance functions

    - - -

    SetErrorBarShape($which_ebs) -
    User Function: Can be "tee" or "line." If it is tee, then -the half-width of the tee is set by SetErrorBarSize - -

    SetErrorBarSize($which_ebs) -
    User Function: Size in pixels of the Tee shape of the error bar. - -

    SetHorizTickIncrement($which_ti) -
    User Function: Set where to place the X-tick marks. - -

    SetNumHorizTicks($which_nt) -
    User Function: Use this or SetHorizTickIncrements but not both. - -

    SetNumVertTicks($which_nt) -
    User Function: Use this or SetVertTickIncrements but not both. - -

    SetPlotAreaPixels($x1,$y1,$x2,$y2) -
    User Function: You can use this to set the actual size in -pixels of the plot area on the image. - -

    SetPointShape($which_pt) -
    User Function: Can be: rect,circle,diamond,triangle,dot,line,halfline - -

    SetPointSize($which_ps) -
    User Function: Set the width of the displayed data point for -plot_type's that have data points. E.g. dots, linepoints -This is an integer. For diamonds, values that are even -make the diamond look better. - -

    SetPrecisionX($which_prec) -
    User Function: Set the precision of the data written to the X axis. -$which_prec is an integer which represents the number of digits -displayed to the right of the decimal. This uses the number_format -command in PHP. - -

    SetPrecisionY($which_prec) -
    User Function: Set the precision of the data written to the Y axis. -$which_prec is an integer which represents the number of digits -displayed to the right of the decimal. This uses the number_format -command in PHP. - -

    SetShading($which_s) -
    User Function: Set the length of the shadows for shading bar charts -The color used is the LightGridColor See SetLightGridColor.
    - -

    SetTickLength($which_tl) -
    User Function: Set the length of the tick in pixels for the x axis and y axis. -$which_color can be either a name like "black" or an rgb color array -array(int,int,int).
    - - -

    SetTitle($title) -
    User Function: Set the title of the graph. Printed at the top -middle of the graph. - -

    SetHorizTickIncrement($which_ti) -
    User Function: Set the distance between tick marks on the X axis. $which_ti -is in world coordinates. - -

    SetVertTickIncrement($which_ti) -
    User Function: Set the distance between tick marks on the Y axis. $which_ti -is in world coordinates. - -

    SetXDatalabelMaxlength($which_xdlm) -
    User Function: Sets the maximum length of the datalabels on the x-axis. -This adjusts the margins if the angle of the labels is not 0. - -

    - -

    SetXGridLabelType($which_xtf) -
    User Function: Can be "time", "title", "none", "default" or "data".
    -time - label is set by the the php command strftime()
    -title - label is treated as text, the first element of the data array.
    -data - label is formateed using php command number_format
    -none - no labelss are printed.
    -default - prints as it is entered.
    -

    - - -

    SetXScaleType($which_xct) -
    Can be "log" or "linear". - -

    SetXTimeFormat($which_xtf) -
    User Function: Used for x_grid_label_type="time". -For the format see the php manual for strftime(). It assumes the x-data values are unix timestamps, and displays them according to the passed format string. -

    Example: If x values are seconds offset from the beginning of the day. This coresponds to unix timestamps on January 1, 1970, so all I had to do was $graph->SetXGridLabelType("%H:%M") to display the time properly. -

    -The php strtotime() function also comes in handy turning dates into timestamps, especially for parameters to SetPlotAreaWorld(). -

    -Example:
    -$graph->SetPlotAreaWorld(strtotime("October 1"), 0,strtotime("December 15"),10);
    -$graph->SetXGridLabelType("time") ;
    -$graph->SetXTimeFormat("%b %d") ;
    - -

    SetXLabel($xlbl) -
    User Function: Set the label for the X axis. - -

    SetYLabel($ylbl) -
    User Function: Set the label for the Y axis. - -

    SetYScaleType($which_xct) -
    Can be "log" or "linear". - - -
    - -

    Color functions

    - -

    SetBackgroundColor($which_color) -
    User Function: Set the color of the background of the entire image. -$which_color can be either a name like "black" or an rgb color array -array(int,int,int).
    It defaults to array(222,222,222) if -not defined.
    - -

    SetGridColor ($which_color) -
    User Function: Set the color of the grid. Defaults to "black" -$which_color can be either a name like "black" or an rgb color array -array(int,int,int).
    - -

    SetLegend($which_legend) -
    $which_legend is an array of text for display in a small box -on the image. If you do not set the position with SetLegendPixels() -then it puts it in the upper right hand side. - -

    SetLegendPixels($which_x,$which_y,$which_type) -
    Pick the upper left corner of the legend box with -$which_x and $which_y in pixels. $which_type is reserved -for future use. - -

    SetLegendWorld($which_x,$which_y,$which_type) -
    Untested and documentation not written. Have Fun! - -

    SetLightGridColor ($which_color) -
    User Function: There are two grid colors, this sets the -light grid color. -$which_color can be either a name like "black" or an rgb color array -array(int,int,int).
    It defaults to array(222,222,222) if -not defined.
    - -

    SetLineWidth($which_lt) -
    User Function: Set the width of lines in pixels for graphs that use -lines (linepoints and lines). Affects the size of the -error bar lines as well. - -

    SetLineStyles($which_sls) -
    User Function: Set style of the line to be printed. -This is an array. Currently only 'dashed' and 'solid' are -supported. - -

    SetPlotBgColor($which_color) -
    User Function: Set the Background color of the area on which -the plot is defined. Called from PlotAreaBackground
    -$which_color can be either a name like "black" or an rgb color array -array(int,int,int).
    It defaults to array(222,222,222) if -not defined. - -

    SetTextColor ($which_color) -
    User Function: Set the color of text written. It defaults to black if not called. -You can call this function multiple times - each time it changes the -color of text written. -$which_color can be either a name like "black" or an rgb color array -array(int,int,int).
    - -

    SetTickColor ($which_color) -
    User Function: Set the color of the ticks on the axes -$which_color can be either a name like "black" or an rgb color array -array(int,int,int).
    - -

    SetTitleColor($which_color) -
    User Function: Set the color of the title. -$which_color can be either a name like "black" or an rgb color array -array(int,int,int).
    - -
    - -

    Data manipulation functions

    - -

    These functions only are availabe in the class PHPlot_data that extends PHPlot. -Since all functions of that section do calculations on the data, it is neccessary -that data is supplied to the class by the SetDataValues() function before calling -any of the functions.

    - -

    DoScaleData($even, $show_in_legend) -
    User Function: Scales the data so that graphs with widely different amplitudes -can be plotted into one image. If $show_in_legend is true, the amplification factor -that is applied to each for the datasets is appended to the legend of the graph. If -$even is true, the function multiplies only by 10^x,2*10^x or 5*10^x.
    - -

    DoMovingAverage($datarow, $interval, $show_in_legend) -
    User Function: Computes a moving average over an amount of $interval units -on the data row that is indexed by $datarow. If $show_in_legend is true, a notice -that a data row is averaged and the length of the interval are appended to the legend. -
    - -
    - -

    not implemented

    - -

    SetCharacterHeight() -
    User Function: Not yet implemented - - - diff --git a/gui/bacula-web/external_packages/phplot/doc/user_internal_functions.html b/gui/bacula-web/external_packages/phplot/doc/user_internal_functions.html deleted file mode 100644 index bb2346322d..0000000000 --- a/gui/bacula-web/external_packages/phplot/doc/user_internal_functions.html +++ /dev/null @@ -1,62 +0,0 @@ - - -PHPlot User / Internal Functions - - - -

    PHPlot User / Internal Functions

    - - -

    DrawDataLabel($lab,$x_world,$y_world) -
    User Function and Internal Function: Draw a label at the world coordinates of x_world and y_world. - - -

    DrawDot($x_world,$y_world,$dot_type,$color) -
    User Function and Internal Function: Draw one dot at $x_world and $y_world where the world -coordinates (not pixel coordinates). - - -

    DrawXDataLabel($xlab,$xpos) -
    User Function and Internal Function: Draw a data label on the x axis at world -position $xpos. The position below -the x axis is set based on the size of the font, and (if -using TTF) the maximum string length of the labels, and -the angle at which the labels are printed. - - -

    SetDataColors($which_data,$which_border) -
    If called with $which_data="" it defaults to - $which_data = array("blue","bisque",array(0,176,0)); - $which_border = array("black"); - - -

    SetErrorBarColors($which_data) -
    If not called then the colors are the same as the -colors of the data as set by SetDataColors() -otherwise it sets the colors of the error bars. - -

    SetLabels($xlbl,$ylbl,$title) -
    Internal Function and User Function: Set the text of the X, Y and Title labels. -If you want to just set the X-axis label you can use SetXLabel. - - -

    SetNewPlotAreaPixels($x1,$y1,$x2,$y2) -
    Reserved - not used yet. - - - -

    SetPlotAreaWorld($xmin,$ymin,$xmax,$ymax) -
    User Function and Internal Function: You do not have to call this function as the -program will set the plot area automatically based on -max values of X and Y.
    You can call this function -as SetPlotAreaWorld("","","","") and it will set the -plot area based on max/min values of data. - - - - - - - - - diff --git a/gui/bacula-web/external_packages/phplot/examples/benjamingothic.ttf b/gui/bacula-web/external_packages/phplot/examples/benjamingothic.ttf deleted file mode 100644 index 61058a6e21..0000000000 Binary files a/gui/bacula-web/external_packages/phplot/examples/benjamingothic.ttf and /dev/null differ diff --git a/gui/bacula-web/external_packages/phplot/examples/create_chart.php b/gui/bacula-web/external_packages/phplot/examples/create_chart.php deleted file mode 100644 index 37e43cb07c..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/create_chart.php +++ /dev/null @@ -1,167 +0,0 @@ -This file is intended to be called from format_chart.php, the example-o-matic.". - "Please click here to try it.

    "; - exit; -} -*/ - -extract ($_GET, EXTR_OVERWRITE); -extract ($_POST, EXTR_OVERWRITE); - - -//Sample functions - -// data-data as a function -if ($which_data_type == 'function') { - //Put function here - $dx = ".3"; - $max = 6.4; - $maxi = $max/$dx; - for ($i=0; $i<$maxi; $i++) { - $a = 4; - $x = $dx*$i; - $data[$i] = array("", $x, $a*sin($x),$a*cos($x),$a*cos($x+1)); - } - $which_data_type = "data-data"; -} -// data-data-error as a random function -else if ($which_data_type == 'randfunction') { - srand ((double) microtime() * 1000000); - $a = 9.62; - $label[0] = "October"; $label[5] = "Day 5"; $label[10] = "Day 10"; - $label[15] = "Day 15"; $label[20] = "Day 20"; $label[25] = "Day 25"; - - for ($i = 0; $i <= 30; $i++) { - $a += rand(-1, 2); - $b = rand(0,1); - $c = rand(0,1); - $data[] = @ array($label[$i],$i+1,$a,$b,$c); - } - $which_data_type = 'data-data-error'; -} -// MBD, this is for data_sample3.php, $num_data_rows is set there -else if ($which_data_type == 'data-data-error') { - for ($i = 0; $i < $num_data_rows; $i++) { - eval ("\$data[\$i] = \$data_row$i; "); - } -} else { - foreach($data_row0 as $key=>$val) { - $data[$key] = array($data_row0[$key],$data_row1[$key],$data_row2[$key],$data_row3[$key],$data_row4[$key]); - } -} - - -//////////////////////////////////////////////// - -//Required Settings - include("../phplot.php"); - $graph = new PHPlot($xsize_in, $ysize_in); - $graph->SetDataType($which_data_type); // Must be first thing - - $graph->SetDataValues($data); - -//Optional Settings (Don't need them) - -// $graph->SetTitle("This is a\n\rmultiple line title\n\rspanning three lines."); - $graph->SetTitle($title); - $graph->SetXTitle($xlbl, $which_xtitle_pos); - $graph->SetYTitle($ylbl, $which_ytitle_pos); - $graph->SetLegend(array("A","Bee","Cee","Dee")); - - $graph->SetFileFormat($which_fileformat); - $graph->SetPlotType($which_plot_type); - - $graph->SetUseTTF($which_use_ttf); - - $graph->SetYTickIncrement($which_yti); - $graph->SetXTickIncrement($which_xti); - $graph->SetXTickLength($which_xtl); - $graph->SetYTickLength($which_ytl); - $graph->SetXTickCrossing($which_xtc); - $graph->SetYTickCrossing($which_ytc); - $graph->SetXTickPos($which_xtick_pos); - $graph->SetYTickPos($which_ytick_pos); - - - $graph->SetShading($which_shading); - $graph->SetLineWidth($which_line_width); - $graph->SetErrorBarLineWidth($which_errorbar_line_width); - - $graph->SetDrawDashedGrid($which_dashed_grid); - switch($which_draw_grid) { - case 'x': - $graph->SetDrawXGrid(TRUE); - $graph->SetDrawYGrid(FALSE); - break; - case 'y': - $graph->SetDrawXGrid(FALSE); - $graph->SetDrawYGrid(TRUE); - break; - case 'both': - $graph->SetDrawXGrid(TRUE); - $graph->SetDrawYGrid(TRUE); - break; - case 'none': - $graph->SetDrawXGrid(FALSE); - $graph->SetDrawYGrid(FALSE); - } - - $graph->SetXTickLabelPos($which_xtick_label_pos); - $graph->SetYTickLabelPos($which_ytick_label_pos); - $graph->SetXDataLabelPos($which_xdata_label_pos); - $graph->SetYDataLabelPos($which_ydata_label_pos); - - // Please remember that angles other than 90 are taken as 0 when working fith fixed fonts. - $graph->SetXLabelAngle($which_xlabel_angle); - $graph->SetYLabelAngle($which_ylabel_angle); - - //$graph->SetLineStyles(array("dashed","dashed","solid","solid")); - $graph->SetPointShape($which_point); - $graph->SetPointSize($which_point_size); - $graph->SetDrawBrokenLines($which_broken); - - // Some forms in format_chart.php don't set this variable, suppress errors. - @ $graph->SetErrorBarShape($which_error_type); - - $graph->SetXAxisPosition($which_xap); - $graph->SetYAxisPosition($which_yap); - $graph->SetPlotBorderType($which_btype); - - if ($maxy_in) { - if ($which_data_type = "text-data") { - $graph->SetPlotAreaWorld(0,$miny_in,count($data),$maxy_in); - } - } - -/* -//Even more settings - - $graph->SetPlotAreaWorld(0,100,5.5,1000); - $graph->SetPlotAreaWorld(0,-10,6,35); - $graph->SetPlotAreaPixels(150,50,600,400); - - $graph->SetDataColors( - array("blue","green","yellow","red"), //Data Colors - array("black") //Border Colors - ); - - $graph->SetPlotBgColor(array(222,222,222)); - $graph->SetBackgroundColor(array(200,222,222)); //can use rgb values or "name" values - $graph->SetTextColor("black"); - $graph->SetGridColor("black"); - $graph->SetLightGridColor(array(175,175,175)); - $graph->SetTickColor("black"); - $graph->SetTitleColor(array(0,0,0)); // Can be array or name -*/ - -// $graph->SetPrintImage(false); - $graph->DrawGraph(); -// xdebug_dump_function_profile(XDEBUG_PROFILER_FS_SUM); -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/data.php b/gui/bacula-web/external_packages/phplot/examples/data.php deleted file mode 100644 index b1d1314db9..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/data.php +++ /dev/null @@ -1,27 +0,0 @@ - diff --git a/gui/bacula-web/external_packages/phplot/examples/data_date.php b/gui/bacula-web/external_packages/phplot/examples/data_date.php deleted file mode 100644 index 4a14d7b5cf..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/data_date.php +++ /dev/null @@ -1,267 +0,0 @@ - diff --git a/gui/bacula-web/external_packages/phplot/examples/data_date2.php b/gui/bacula-web/external_packages/phplot/examples/data_date2.php deleted file mode 100644 index 37152c7c6f..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/data_date2.php +++ /dev/null @@ -1,267 +0,0 @@ - diff --git a/gui/bacula-web/external_packages/phplot/examples/data_sample1.php b/gui/bacula-web/external_packages/phplot/examples/data_sample1.php deleted file mode 100644 index 11b8117c1e..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/data_sample1.php +++ /dev/null @@ -1,58 +0,0 @@ -

    -Data type: (Text-data)
    -

    - - - - - - - - - - - - - -
    Title (x axis)Y data 1Y data 2Y data 3 Y data 4
    - - - - - - - - - -
    - -

    -Graph type: - -

    -
    -Please note when writing your application that the graph
    -types marked with an asterisk only support the data
    -type for this form, "text-data". -
    diff --git a/gui/bacula-web/external_packages/phplot/examples/data_sample2.php b/gui/bacula-web/external_packages/phplot/examples/data_sample2.php deleted file mode 100644 index e754a039d3..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/data_sample2.php +++ /dev/null @@ -1,52 +0,0 @@ - -

    -Data type: (data-data)
    - - - - - - - - - - - - - - -
    Title (data label)X dataY data 1Y data 2Y data 3
    - - - - - - - - - -
    - -

    -Graph type: - -

    diff --git a/gui/bacula-web/external_packages/phplot/examples/data_sample3.php b/gui/bacula-web/external_packages/phplot/examples/data_sample3.php deleted file mode 100644 index 46f774b56d..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/data_sample3.php +++ /dev/null @@ -1,58 +0,0 @@ -

    -Data set as X, Y, E+, E-, Y2, E2+, E2-,...
    - -Data type: (data-data-error) -

    - - - - - - - - -
    Title (data label)X dataY data 1Error +Error -Y data 2Error +Error -
    - - "; - - for ($i = 0; $i < $num_rows; $i++) { - // The label input element must be bigger. - $lines[0] = "\n"; - - // Show s for the rest of the columns - for ($j=1; $j<8; $j++) - $lines[$j] = "\n"; - $groups[$i] = join('', $lines); - } - echo join("
    \n", $groups); - ?> - -
    - -

    -Graph type: - -     -Error bar type: - -

    diff --git a/gui/bacula-web/external_packages/phplot/examples/data_sample4.php b/gui/bacula-web/external_packages/phplot/examples/data_sample4.php deleted file mode 100644 index 5c4d14c16f..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/data_sample4.php +++ /dev/null @@ -1,24 +0,0 @@ -

    -Data type: data-data calculated from a function. -

    -
    -	$dx = ".3";
    -	$max = 6.4;
    -	$maxi = $max/$dx;
    -	for ($i=0; $i<$maxi; $i++) {
    -		$a = 4;
    -		$x = $dx*$i;
    -		$data[$i] = array("", $x, $a*sin($x), 
    -                              $a*cos($x), $a*cos($x+1)); 	
    -	}
    -
    -

    -Chart type: - - -

    diff --git a/gui/bacula-web/external_packages/phplot/examples/data_sample5.php b/gui/bacula-web/external_packages/phplot/examples/data_sample5.php deleted file mode 100644 index b8859b6345..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/data_sample5.php +++ /dev/null @@ -1,31 +0,0 @@ -

    -Data type: data-data-error calculated from a function. -

    -
    -    srand ((double) microtime() * 1000000);
    -    $a = 9.62;
    -    $label[0] = "October"; $label[5] = "Day 5"; $label[10] = "Day 10";
    -    $label[15] = "Day 15"; $label[20] = "Day 20"; $label[25] = "Day 25";
    -
    -    for ($i = 0; $i <= 30; $i++) {
    -        $a += rand(-1, 2);
    -        $b = rand(0,1);
    -        $c = rand(0,1);
    -        $data[] = @ array($label[$i],$i+1,$a,$b,$c);
    -    }
    -
    -

    -Chart type: - -     -Error bar type: - - -

    diff --git a/gui/bacula-web/external_packages/phplot/examples/example1.php b/gui/bacula-web/external_packages/phplot/examples/example1.php deleted file mode 100644 index a134097785..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/example1.php +++ /dev/null @@ -1,16 +0,0 @@ -SetDataValues($example_data); - - -//Draw it -$graph->DrawGraph(); - -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/example2.php b/gui/bacula-web/external_packages/phplot/examples/example2.php deleted file mode 100644 index 8f06a20dba..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/example2.php +++ /dev/null @@ -1,22 +0,0 @@ -SetDataType("linear-linear"); - -//Remove the X data labels -//$graph->SetXGridLabelType("none"); - -//Load the data into data array -$graph->SetDataValues($example_data); - -//Draw the graph -$graph->DrawGraph(); -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/example3.php b/gui/bacula-web/external_packages/phplot/examples/example3.php deleted file mode 100644 index a518e1315e..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/example3.php +++ /dev/null @@ -1,32 +0,0 @@ -SetDataType("data-data"); - -//Load the data into the data array -$graph->SetDataValues($example_data); -$graph->DoMovingAverage(4,2,TRUE); - -//Call Scaling Function (in phplot_data.php) -//$graph->DoScaleData(1,1); - -//Draw a Legend at pixel location 100,100 -$graph->SetLegendPixels(100,100,""); - -//have no labels on Y axis -//$graph->SetYGridLabelType("none"); - -//Print that puppy! -$graph->DrawGraph(); -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/example4.php b/gui/bacula-web/external_packages/phplot/examples/example4.php deleted file mode 100644 index 360d2df8aa..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/example4.php +++ /dev/null @@ -1,80 +0,0 @@ -SetDataType("linear-linear-error"); //Must be first thing - -//Set the Graph particulars - $graph->SetPrecisionX(0); - $graph->SetPrecisionY(0); - $graph->SetUseTTF("0"); - $graph->SetDrawYGrid("1"); // 1 = true - $graph->SetDataValues($data); - $graph->SetImageArea(600, 400); - $graph->SetVertTickIncrement(""); - $graph->SetHorizTickIncrement(1); - $graph->SetErrorBarLineWidth(1); - $graph->SetYScaleType("log"); - $graph->SetPointShape("halfline"); - $graph->SetErrorBarShape("line"); - $graph->SetPlotType("points"); - $graph->SetXGridLabelType("title"); - $graph->SetXLabel("Day"); - $graph->SetYLabel("Stock value"); - $graph->SetTitle("Logarithmic scale\nexample 4"); - //$graph->SetErrorBarColors(array("blue","red","green","black")); - $graph->SetDataColors( - array("blue","green","yellow","red"), //Data Colors - array("black") //Border Colors - ); - - $graph->SetPlotAreaWorld(0,0,32,50); - //$graph->SetPlotAreaPixels(150,50,600,400); - -/* -//Other settings - $graph->SetPlotBgColor(array(222,222,222)); - $graph->SetBackgroundColor(array(200,222,222)); //can use rgb values or "name" values - $graph->SetTextColor("black"); - $graph->SetGridColor("black"); - $graph->SetLightGridColor(array(175,175,175)); - $graph->SetTickColor("black"); - $graph->SetTitleColor(array(0,0,0)); // Can be array or name - -*/ - - -//Draw the graph - $graph->DrawGraph(); -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/example6.php b/gui/bacula-web/external_packages/phplot/examples/example6.php deleted file mode 100644 index 405943b297..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/example6.php +++ /dev/null @@ -1,19 +0,0 @@ -SetDataType("data-data"); //Must be called before SetDataValues - -$graph->SetXGridLabelType("time"); -$graph->SetXDataLabelAngle(90); -$graph->SetXLabel(""); -$graph->SetYLabel("Volume"); -$graph->SetVertTickIncrement(30); -$graph->SetXTimeFormat("%b %y"); -$graph->SetDataValues($example_data); -$graph->SetHorizTickIncrement(2679000); -$graph->SetPlotType("thinbarline"); -$graph->SetDrawXDataLabels(false); -$graph->SetPlotAreaWorld(883634400,0,915095000,90); -$graph->DrawGraph(); -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/example7.php b/gui/bacula-web/external_packages/phplot/examples/example7.php deleted file mode 100644 index 4b93ee8df2..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/example7.php +++ /dev/null @@ -1,33 +0,0 @@ -SetDataType("data-data-error"); //Must be called before SetDataValues - -$graph->SetImageArea(600,400); -$graph->SetPrecisionY(0); -$graph->SetXLabel(""); -$graph->SetYLabel("Volume"); -$graph->SetVertTickIncrement(20); -$graph->SetXAxisPosition(1); -//$graph->SetSkipBottomTick(1); - -//Set Unixtime Increment and X Axis Settings -$graph->SetHorizTickIncrement(2679000); -$graph->SetXGridLabelType("time"); -$graph->SetXTimeFormat("%b %y"); -$graph->SetXDataLabelAngle(90); - -$graph->SetDataValues($example_data); -$graph->SetPlotType("lines"); -$graph->SetErrorBarShape("line"); -$graph->SetPointShape("halfline"); -$graph->SetYScaleType("log"); -$graph->SetLineWidth(1); -$graph->SetDrawXDataLabels(false); - -//Since X axis is in Unixtime format we set the limits accordingly -$graph->SetPlotAreaWorld(883634400,1,915095000,140); - -$graph->DrawGraph(); -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/example8.php b/gui/bacula-web/external_packages/phplot/examples/example8.php deleted file mode 100644 index d60c053957..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/example8.php +++ /dev/null @@ -1,61 +0,0 @@ -SetPrintImage(0); //Don't draw the image yet - -$graph->SetDataType("data-data-error"); //Must be called before SetDataValues - -$graph->SetNewPlotAreaPixels(90,40,540,190); -$graph->SetDataValues($example_data); - -$graph->SetXLabelType("time"); -$graph->SetXLabelAngle(90); -$graph->SetXTitle(""); -$graph->SetYTitle("Price"); -$graph->SetYTickIncrement(20); -$graph->SetXTickIncrement(2679000); -$graph->SetXTimeFormat("%b %y"); -$graph->SetPlotType("lines"); -$graph->SetErrorBarShape("line"); -$graph->SetPointShape("halfline"); -$graph->SetYScaleType("log"); -$graph->SetLineWidths(array(1)); -$graph->SetPlotAreaWorld(883634400,1,915095000,140); -$graph->SetXDataLabelPos('none'); -$graph->DrawGraph(); - -//Now do the second chart on the image - -unset($example_data); - -$graph->SetYScaleType("linear"); -include("./data_date.php"); - -$graph->SetDataType("data-data"); //Must be called before SetDataValues - -$graph->SetDataValues($example_data); -$graph->SetNewPlotAreaPixels(90,260,540,350); -$graph->SetDataValues($example_data); - -$graph->SetXLabelType("time"); -$graph->SetXLabelAngle(90); -$graph->SetXTitle(""); -$graph->SetYTitle("Volume"); -$graph->SetYTickIncrement(30); -$graph->SetPlotType("thinbarline"); - -//Set how to display the x-axis ticks -$graph->SetXTimeFormat("%b %y"); -$graph->SetXTickIncrement(2679000); -$graph->SetXAxisPosition(0); //Have to reset it after log plots - -//Set Plot to go from x = Jan 1 1998, to x = Dec 31 1998 -// and from y = 0 to y = 90 -$graph->SetPlotAreaWorld(883634400,0,915095000,90); - -$graph->DrawGraph(); - -//Print the image -$graph->PrintImage(); -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/example9.php b/gui/bacula-web/external_packages/phplot/examples/example9.php deleted file mode 100644 index 32865c1526..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/example9.php +++ /dev/null @@ -1,35 +0,0 @@ -SetDataValues($example_data); - -//Don't print until we say so -$graph->SetPrintImage(0); - -//Draw it -$graph->DrawGraph(); - -//Define some colors -$ndx_color = $graph->SetIndexColor("blue"); -$ndx_color1 = $graph->SetIndexColor("orange"); - -//The image data colors are now ndx_data_color[] -$graph->DrawDashedLine(250,$graph->plot_area[1],250,250,4,0,$graph->ndx_data_colors[0]); - -$graph->DrawDashedLine($graph->xtr(5),$graph->ytr(12), - $graph->xtr(20),$graph->ytr(42),5,3,$ndx_color); - -$graph->DrawDashedLine($graph->plot_area[0],250,$graph->plot_area[2],250,2,0,$ndx_color1); -$graph->DrawDashedLine($graph->plot_area[0],251,$graph->plot_area[2],251,2,0,$ndx_color1); - - -//Now print the image -$graph->PrintImage(); - -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/format_chart.php b/gui/bacula-web/external_packages/phplot/examples/format_chart.php deleted file mode 100644 index 5e2f4b899c..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/format_chart.php +++ /dev/null @@ -1,345 +0,0 @@ - - - - Example-o-matic - - - - - - -

    PHPlot test graph form

    - -

    Use this form to test many different options of PHPlot. You can test -every graph type supported for any of four different data types. You can -tweak as you like or you can leave everything as is and press "Submit" for -automatic values. -

    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Data Settings
    -

    - Data type: [ - text-data | - data-data | - function | - data-data-error | - randfunction ] -

    - -
    -
    -

    Optional values

    -
    -
    Sizes
    Width of graph in pixels:
    Height of graph in pixels:
    Maximum height of graph in y axis units:
    Minimum height of graph in y axis units:
    Titles and data labels
    Title:
    Y axis title:
    Y axis title position: - -
    Y axis data labels position: - -
    Y axis labels angle:
    X axis title:
    X axis title position: - -
    X axis data labels position: - -
    X axis labels angle:
    Grid and ticks
    Grid drawn: - -
    Dashed grid? - -
    X axis ticks length:
    X axis ticks crossing:
    X axis ticks position: - -
    X axis tick labels position: - -
    Y axis ticks length:
    Y axis ticks crossing:
    Y axis ticks position: - -
    Y axis tick labels position: - -
    X tick increment:
    Y tick increment:
    Other
    X axis position:
    Y axis position:
    Plot Border: - -
    Shade height (0 for none):
    Plot line width:
    Error bar line width:
    Point Type: - -
    Point Size:
    Draw broken lines with missing Y data: - -
    Use TrueType font: - -
    File format: - -
    -
    -
    - -

    -Please visit PHPlot's site, the -sourceforge project page, -or see more php code and examples -by Afan Ottenheimer of jeonet. -

    - -

    $Id$

    - - diff --git a/gui/bacula-web/external_packages/phplot/examples/inline_image.php b/gui/bacula-web/external_packages/phplot/examples/inline_image.php deleted file mode 100644 index 16a5a352c5..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/inline_image.php +++ /dev/null @@ -1,28 +0,0 @@ - - ************************************************* - * This file is meant to be called only from the * - * test page * - * It will fail if called by itself. * - ************************************************* - -EOF -; -exit; -} - -// From PHP 4.?, register_globals is off, take it into account (MBD) - -include('../phplot.php'); -$graph = new PHPlot; -include('./data.php'); -$graph->SetTitle("$_GET[which_title]"); -$graph->SetDataValues($example_data); -$graph->SetIsInline('1'); -$graph->SetFileFormat("$_GET[which_format]"); -$graph->DrawGraph(); -?> diff --git a/gui/bacula-web/external_packages/phplot/examples/test_setup.php b/gui/bacula-web/external_packages/phplot/examples/test_setup.php deleted file mode 100644 index b8860ca978..0000000000 --- a/gui/bacula-web/external_packages/phplot/examples/test_setup.php +++ /dev/null @@ -1,67 +0,0 @@ - - - - - PHPlot graphic formats test - - - - - - -

    PHPlot test graph form

    - -

    Use this form to test many different options of PHPlot. You can test -every graph type supported for any of four different data types. You can -tweak as you like or you can leave everything as is and press "Submit" for -

    PHPlot graphic formats test

    - -

    -This page will test which graphic formats are supported by the version of GD -linked into PHP. You should see at least one of the four images below. -

    - -
    - - - - - - - - - -
    PNG graphics
    -"; - -?> -
    JPEG graphics
    -"; -?> -
    GIF graphics
    -"; -?> -
    BMP graphics
    -"; -?> -
    -
    - - - diff --git a/gui/bacula-web/external_packages/phplot/phplot.php b/gui/bacula-web/external_packages/phplot/phplot.php deleted file mode 100644 index 4d4fe58c6c..0000000000 --- a/gui/bacula-web/external_packages/phplot/phplot.php +++ /dev/null @@ -1,4448 +0,0 @@ - - * - * Requires PHP 4.2.0 or later (CHECK THIS) - */ - -if (! defined(__FUNCTION__)) - define(__FUNCTION__, '__FUNCTION__ Requires at least PHP 4.3.0.'); - -define ('MINY', -1); // Indexes in $data (for DrawXDataLine()) -define ('MAXY', -2); -define ('TOTY', -3); - -error_reporting(E_ALL); - -class PHPlot { - - /* I have removed internal variable declarations, some isset() checking was required, - * but now the variables left are those which can be tweaked by the user. This is intended to - * be the first step towards moving most of the Set...() methods into a subclass which will be - * used only when strictly necessary. Many users will be able to put default values here in the - * class and thus avoid memory overhead and reduce parsing times. - */ - //////////////// CONFIG PARAMETERS ////////////////////// - - var $is_inline = FALSE; // FALSE = Sends headers, TRUE = sends just raw image data - var $browser_cache = FALSE; // FALSE = Sends headers for browser to not cache the image, - // (only if is_inline = FALSE also) - - var $safe_margin = 5; // Extra margin used in several places. In pixels - - var $x_axis_position = ''; // Where to draw both axis (world coordinates), - var $y_axis_position = ''; // leave blank for X axis at 0 and Y axis at left of plot. - - var $xscale_type = 'linear'; // linear, log - var $yscale_type = 'linear'; - -//Fonts - var $use_ttf = FALSE; // Use True Type Fonts? - var $ttf_path = '.'; // Default path to look in for TT Fonts. - var $default_ttfont = 'benjamingothic.ttf'; - var $line_spacing = 4; // Pixels between lines. - - // Font angles: 0 or 90 degrees for fixed fonts, any for TTF - var $x_label_angle = 0; // For labels on X axis (tick and data) - var $y_label_angle = 0; // For labels on Y axis (tick and data) - var $x_title_angle = 0; // Don't change this if you don't want to screw things up! - var $y_title_angle = 90; // Nor this. - var $title_angle = 0; // Or this. - -//Formats - var $file_format = 'png'; - var $output_file = ''; // For output to a file instead of stdout - -//Data - var $data_type = 'text-data'; // text-data, data-data-error, data-data, text-data-single - var $plot_type= 'linepoints'; // bars, lines, linepoints, area, points, pie, thinbarline, squared - - var $label_scale_position = 0.5; // Shifts data labes in pie charts. 1 = top, 0 = bottom - var $group_frac_width = 0.7; // value from 0 to 1 = width of bar groups - var $bar_width_adjust = 1; // 1 = bars of normal width, must be > 0 - - var $y_precision = 1; - var $x_precision = 1; - - var $data_units_text = ''; // Units text for 'data' labels (i.e: '¤', '$', etc.) - -// Titles - var $title_txt = ''; - - var $x_title_txt = ''; - var $x_title_pos = 'plotdown'; // plotdown, plotup, both, none - - var $y_title_txt = ''; - var $y_title_pos = 'plotleft'; // plotleft, plotright, both, none - - -//Labels - // There are two types of labels in PHPlot: - // Tick labels: they follow the grid, next to ticks in axis. (DONE) - // they are drawn at grid drawing time, by DrawXTicks() and DrawYTicks() - // Data labels: they follow the data points, and can be placed on the axis or the plot (x/y) (TODO) - // they are drawn at graph plotting time, by Draw*DataLabel(), called by DrawLines(), etc. - // Draw*DataLabel() also draws H/V lines to datapoints depending on draw_*_data_label_lines - - // Tick Labels - var $x_tick_label_pos = 'plotdown'; // plotdown, plotup, both, xaxis, none - var $y_tick_label_pos = 'plotleft'; // plotleft, plotright, both, yaxis, none - - // Data Labels: - var $x_data_label_pos = 'plotdown'; // plotdown, plotup, both, plot, all, none - var $y_data_label_pos = 'plotleft'; // plotleft, plotright, both, plot, all, none - - var $draw_x_data_label_lines = FALSE; // Draw a line from the data point to the axis? - var $draw_y_data_label_lines = FALSE; // TODO - - // Label types: (for tick, data and plot labels) - var $x_label_type = ''; // data, time. Leave blank for no formatting. - var $y_label_type = ''; // data, time. Leave blank for no formatting. - var $x_time_format = '%H:%m:%s'; // See http://www.php.net/manual/html/function.strftime.html - var $y_time_format = '%H:%m:%s'; // SetYTimeFormat() too... - - // Skipping labels - var $x_label_inc = 1; // Draw a label every this many (1 = all) (TODO) - var $y_label_inc = 1; - var $_x_label_cnt = 0; // internal count FIXME: work in progress - - // Legend - var $legend = ''; // An array with legend titles - var $legend_x_pos = ''; - var $legend_y_pos = ''; - - -//Ticks - var $x_tick_length = 5; // tick length in pixels for upper/lower axis - var $y_tick_length = 5; // tick length in pixels for left/right axis - - var $x_tick_cross = 3; // ticks cross x axis this many pixels - var $y_tick_cross = 3; // ticks cross y axis this many pixels - - var $x_tick_pos = 'plotdown'; // plotdown, plotup, both, xaxis, none - var $y_tick_pos = 'plotleft'; // plotright, plotleft, both, yaxis, none - - var $num_x_ticks = ''; - var $num_y_ticks = ''; - - var $x_tick_inc = ''; // Set num_x_ticks or x_tick_inc, not both. - var $y_tick_inc = ''; // Set num_y_ticks or y_tick_inc, not both. - - var $skip_top_tick = FALSE; - var $skip_bottom_tick = FALSE; - var $skip_left_tick = FALSE; - var $skip_right_tick = FALSE; - -//Grid Formatting - var $draw_x_grid = FALSE; - var $draw_y_grid = TRUE; - - var $dashed_grid = TRUE; - var $grid_at_foreground = FALSE; // Chooses whether to draw the grid below or above the graph - -//Colors and styles (all colors can be array (R,G,B) or named color) - var $color_array = 'small'; // 'small', 'large' or array (define your own colors) - // See rgb.inc.php and SetRGBArray() - var $i_border = array(194, 194, 194); - var $plot_bg_color = 'white'; - var $bg_color = 'white'; - var $label_color = 'black'; - var $text_color = 'black'; - var $grid_color = 'black'; - var $light_grid_color = 'gray'; - var $tick_color = 'black'; - var $title_color = 'black'; - var $data_colors = array('SkyBlue', 'green', 'orange', 'blue', 'orange', 'red', 'violet', 'azure1'); - var $error_bar_colors = array('SkyBlue', 'green', 'orange', 'blue', 'orange', 'red', 'violet', 'azure1'); - var $data_border_colors = array('black'); - - var $line_widths = 1; // single value or array - var $line_styles = array('solid', 'solid', 'dashed'); // single value or array - var $dashed_style = '2-4'; // colored dots-transparent dots - - var $point_sizes = array(5,5,3); // single value or array - var $point_shapes = array('diamond'); // rect, circle, diamond, triangle, dot, line, halfline, cross - - var $error_bar_size = 5; // right and left size of tee - var $error_bar_shape = 'tee'; // 'tee' or 'line' - var $error_bar_line_width = 1; // single value (or array TODO) - - var $plot_border_type = 'sides'; // left, sides, none, full - var $image_border_type = 'none'; // 'raised', 'plain', 'none' - - var $shading = 5; // 0 for no shading, > 0 is size of shadows in pixels - - var $draw_plot_area_background = FALSE; - var $draw_broken_lines = FALSE; // Tells not to draw lines for missing Y data. - - -////////////////////////////////////////////////////// -//BEGIN CODE -////////////////////////////////////////////////////// - - /*! - * Constructor: Setup img resource, colors and size of the image, and font sizes. - * - * \param which_width int Image width in pixels. - * \param which_height int Image height in pixels. - * \param which_output_file string Filename for output. - * \param which_input_fule string Path to a file to be used as background. - */ - function PHPlot($which_width=600, $which_height=400, $which_output_file=NULL, $which_input_file=NULL) - { - /* - * Please see http://www.php.net/register_shutdown_function - * PLEASE NOTE: register_shutdown_function() will take a copy of the object rather than a reference - * so we put an ampersand. However, the function registered will work on the object as it - * was upon registration. To solve this, one of two methods can be used: - * $obj = new object(); - * register_shutdown_function(array(&$obj,'shutdown')); - * OR - * $obj = &new object(); - * HOWEVER, as the second statement assigns $obj a reference to the current object, it might be that - * several instances mess things up... (CHECK THIS) - * - * AND - * as $this->img is set upon construction of the object, problems will not arise for us (for the - * moment maybe, so I put all this here just in case) - */ - register_shutdown_function(array(&$this, '_PHPlot')); - - $this->SetRGBArray($this->color_array); - - $this->background_done = FALSE; // Set to TRUE after background image is drawn once - - if ($which_output_file) - $this->SetOutputFile($which_output_file); - - if ($which_input_file) - $this->SetInputFile($which_input_file); - else { - $this->image_width = $which_width; - $this->image_height = $which_height; - - $this->img = ImageCreate($this->image_width, $this->image_height); - if (! $this->img) - $this->PrintError('PHPlot(): Could not create image resource.'); - - } - - $this->SetDefaultStyles(); - $this->SetDefaultFonts(); - - $this->SetTitle(''); - $this->SetXTitle(''); - $this->SetYTitle(''); - - $this->print_image = TRUE; // Use for multiple plots per image (TODO: automatic) - } - - /*! - * Destructor. Image resources not deallocated can be memory hogs, I think - * it is safer to automatically call imagedestroy upon script termination than - * do it ourselves. - * See notes in the constructor code. - */ - function _PHPlot () - { - ImageDestroy($this->img); - return; - } - - -///////////////////////////////////////////// -////////////// COLORS -///////////////////////////////////////////// - - /*! - * Returns an index to a color passed in as anything (string, hex, rgb) - * - * \param which_color * Color (can be '#AABBCC', 'Colorname', or array(r,g,b)) - */ - function SetIndexColor($which_color) - { - list ($r, $g, $b) = $this->SetRGBColor($which_color); //Translate to RGB - $index = ImageColorExact($this->img, $r, $g, $b); - if ($index == -1) { - return ImageColorResolve($this->img, $r, $g, $b); - } else { - return $index; - } - } - - - /*! - * Returns an index to a slightly darker color than the one requested. - */ - function SetIndexDarkColor($which_color) - { - list ($r, $g, $b) = $this->SetRGBColor($which_color); - - $r -= 0x30; $r = ($r < 0) ? 0 : $r; - $g -= 0x30; $g = ($g < 0) ? 0 : $g; - $b -= 0x30; $b = ($b < 0) ? 0 : $b; - - $index = ImageColorExact($this->img, $r, $g, $b); - if ($index == -1) { - return ImageColorResolve($this->img, $r, $g, $b); - } else { - return $index; - } - } - - /*! - * Sets/reverts all colors and styles to their defaults. If session is set, then only updates indices, - * as they are lost with every script execution, else, sets the default colors by name or value and - * then updates indices too. - * - * FIXME Isn't this too slow? - * - */ - function SetDefaultStyles() - { - /* Some of the Set*() functions use default values when they get no parameters. */ - - if (! isset($this->session_set)) { - // If sessions are enabled, this variable will be preserved, so upon future executions, we - // will have it set, as well as color names (though not color indices, that's why we - // need to rebuild them) - $this->session_set = TRUE; - - // These only need to be set once - $this->SetLineWidths(); - $this->SetLineStyles(); - $this->SetDefaultDashedStyle($this->dashed_style); - $this->SetPointSizes($this->point_sizes); - } - - $this->SetImageBorderColor($this->i_border); - $this->SetPlotBgColor($this->plot_bg_color); - $this->SetBackgroundColor($this->bg_color); - $this->SetLabelColor($this->label_color); - $this->SetTextColor($this->text_color); - $this->SetGridColor($this->grid_color); - $this->SetLightGridColor($this->light_grid_color); - $this->SetTickColor($this->tick_color); - $this->SetTitleColor($this->title_color); - $this->SetDataColors(); - $this->SetErrorBarColors(); - $this->SetDataBorderColors(); - } - - - /* - * - */ - function SetBackgroundColor($which_color) - { - $this->bg_color= $which_color; - $this->ndx_bg_color= $this->SetIndexColor($this->bg_color); - return TRUE; - } - - /* - * - */ - function SetPlotBgColor($which_color) - { - $this->plot_bg_color= $which_color; - $this->ndx_plot_bg_color= $this->SetIndexColor($this->plot_bg_color); - return TRUE; - } - - /* - * - */ - function SetTitleColor($which_color) - { - $this->title_color= $which_color; - $this->ndx_title_color= $this->SetIndexColor($this->title_color); - return TRUE; - } - - /* - * - */ - function SetTickColor ($which_color) - { - $this->tick_color= $which_color; - $this->ndx_tick_color= $this->SetIndexColor($this->tick_color); - return TRUE; - } - - - /* - * - */ - function SetLabelColor ($which_color) - { - $this->label_color = $which_color; - $this->ndx_title_color= $this->SetIndexColor($this->label_color); - return TRUE; - } - - - /* - * - */ - function SetTextColor ($which_color) - { - $this->text_color= $which_color; - $this->ndx_text_color= $this->SetIndexColor($this->text_color); - return TRUE; - } - - - /* - * - */ - function SetLightGridColor ($which_color) - { - $this->light_grid_color= $which_color; - $this->ndx_light_grid_color= $this->SetIndexColor($this->light_grid_color); - return TRUE; - } - - - /* - * - */ - function SetGridColor ($which_color) - { - $this->grid_color = $which_color; - $this->ndx_grid_color= $this->SetIndexColor($this->grid_color); - return TRUE; - } - - - /* - * - */ - function SetImageBorderColor($which_color) - { - $this->i_border = $which_color; - $this->ndx_i_border = $this->SetIndexColor($this->i_border); - $this->ndx_i_border_dark = $this->SetIndexDarkColor($this->i_border); - return TRUE; - } - - - /* - * - */ - function SetTransparentColor($which_color) - { - ImageColorTransparent($this->img, $this->SetIndexColor($which_color)); - return TRUE; - } - - - /*! - * Sets the array of colors to be used. It can be user defined, a small predefined one - * or a large one included from 'rgb.inc.php'. - * - * \param which_color_array If an array, the used as color array. If a string can - * be one of 'small' or 'large'. - */ - function SetRGBArray ($which_color_array) - { - if ( is_array($which_color_array) ) { // User defined array - $this->rgb_array = $which_color_array; - return TRUE; - } elseif ($which_color_array == 'small') { // Small predefined color array - $this->rgb_array = array( - 'white' => array(255, 255, 255), - 'snow' => array(255, 250, 250), - 'PeachPuff' => array(255, 218, 185), - 'ivory' => array(255, 255, 240), - 'lavender' => array(230, 230, 250), - 'black' => array( 0, 0, 0), - 'DimGrey' => array(105, 105, 105), - 'gray' => array(190, 190, 190), - 'grey' => array(190, 190, 190), - 'navy' => array( 0, 0, 128), - 'SlateBlue' => array(106, 90, 205), - 'blue' => array( 0, 0, 255), - 'SkyBlue' => array(135, 206, 235), - 'cyan' => array( 0, 255, 255), - 'DarkGreen' => array( 0, 100, 0), - 'green' => array( 0, 255, 0), - 'YellowGreen' => array(154, 205, 50), - 'yellow' => array(255, 255, 0), - 'orange' => array(255, 165, 0), - 'gold' => array(255, 215, 0), - 'peru' => array(205, 133, 63), - 'beige' => array(245, 245, 220), - 'wheat' => array(245, 222, 179), - 'tan' => array(210, 180, 140), - 'brown' => array(165, 42, 42), - 'salmon' => array(250, 128, 114), - 'red' => array(255, 0, 0), - 'pink' => array(255, 192, 203), - 'maroon' => array(176, 48, 96), - 'magenta' => array(255, 0, 255), - 'violet' => array(238, 130, 238), - 'plum' => array(221, 160, 221), - 'orchid' => array(218, 112, 214), - 'purple' => array(160, 32, 240), - 'azure1' => array(240, 255, 255), - 'aquamarine1' => array(127, 255, 212) - ); - return TRUE; - } elseif ($which_color_array === 'large') { // Large color array - include("./rgb.inc.php"); - $this->rgb_array = $RGBArray; - } else { // Default to black and white only. - $this->rgb_array = array('white' => array(255, 255, 255), 'black' => array(0, 0, 0)); - } - - return TRUE; - } - - /*! - * Returns an array in R, G, B format 0-255 - * - * \param color_asked array(R,G,B) or string (named color or '#AABBCC') - */ - function SetRGBColor($color_asked) - { - if ($color_asked == '') { $color_asked = array(0, 0, 0); }; - - if ( count($color_asked) == 3 ) { // already array of 3 rgb - $ret_val = $color_asked; - } else { // asking for a color by string - if(substr($color_asked, 0, 1) == '#') { // asking in #FFFFFF format. - $ret_val = array(hexdec(substr($color_asked, 1, 2)), hexdec(substr($color_asked, 3, 2)), - hexdec(substr($color_asked, 5, 2))); - } else { // asking by color name - $ret_val = $this->rgb_array[$color_asked]; - } - } - return $ret_val; - } - - - /*! - * Sets the colors for the data. - */ - function SetDataColors($which_data = NULL, $which_border = NULL) - { - if (is_null($which_data) && is_array($this->data_colors)) { - // use already set data_colors - } else if (! is_array($which_data)) { - $this->data_colors = ($which_data) ? array($which_data) : array('blue', 'red', 'green', 'orange'); - } else { - $this->data_colors = $which_data; - } - - $i = 0; - foreach ($this->data_colors as $col) { - $this->ndx_data_colors[$i] = $this->SetIndexColor($col); - $this->ndx_data_dark_colors[$i] = $this->SetIndexDarkColor($col); - $i++; - } - - // For past compatibility: - $this->SetDataBorderColors($which_border); - } // function SetDataColors() - - - /*! - * - */ - function SetDataBorderColors($which_br = NULL) - { - if (is_null($which_br) && is_array($this->data_border_colors)) { - // use already set data_border_colors - } else if (! is_array($which_br)) { - // Create new array with specified color - $this->data_border_colors = ($which_br) ? array($which_br) : array('black'); - } else { - $this->data_border_colors = $which_br; - } - - $i = 0; - foreach($this->data_border_colors as $col) { - $this->ndx_data_border_colors[$i] = $this->SetIndexColor($col); - $i++; - } - } // function SetDataBorderColors() - - - /*! - * Sets the colors for the data error bars. - */ - function SetErrorBarColors($which_err = NULL) - { - if (is_null($which_err) && is_array($this->error_bar_colors)) { - // use already set error_bar_colors - } else if (! is_array($which_err)) { - $this->error_bar_colors = ($which_err) ? array($which_err) : array('black'); - } else { - $this->error_bar_colors = $which_err; - } - - $i = 0; - foreach($this->error_bar_colors as $col) { - $this->ndx_error_bar_colors[$i] = $this->SetIndexColor($col); - $i++; - } - return TRUE; - - } // function SetErrorBarColors() - - - /*! - * Sets the default dashed style. - * \param which_style A string specifying order of colored and transparent dots, - * i.e: '4-3' means 4 colored, 3 transparent; - * '2-3-1-2' means 2 colored, 3 transparent, 1 colored, 2 transparent. - */ - function SetDefaultDashedStyle($which_style) - { - // String: "numcol-numtrans-numcol-numtrans..." - $asked = explode('-', $which_style); - - if (count($asked) < 2) { - $this->DrawError("SetDefaultDashedStyle(): Wrong parameter '$which_style'."); - return FALSE; - } - - // Build the string to be eval()uated later by SetDashedStyle() - $this->default_dashed_style = 'array( '; - - $t = 0; - foreach($asked as $s) { - if ($t % 2 == 0) { - $this->default_dashed_style .= str_repeat('$which_ndxcol,', $s); - } else { - $this->default_dashed_style .= str_repeat('IMG_COLOR_TRANSPARENT,', $s); - } - $t++; - } - // Remove trailing comma and add closing parenthesis - $this->default_dashed_style = substr($this->default_dashed_style, 0, -1); - $this->default_dashed_style .= ')'; - - return TRUE; - } - - - /*! - * Sets the style before drawing a dashed line. Defaults to $this->default_dashed_style - * \param which_ndxcol Color index to be used. - */ - function SetDashedStyle($which_ndxcol) - { - // See SetDefaultDashedStyle() to understand this. - eval ("\$style = $this->default_dashed_style;"); - return imagesetstyle($this->img, $style); - } - - - /*! - * Sets line widths on a per-line basis. - */ - function SetLineWidths($which_lw=NULL) - { - if (is_null($which_lw)) { - // Do nothing, use default value. - } else if (is_array($which_lw)) { - // Did we get an array with line widths? - $this->line_widths = $which_lw; - } else { - $this->line_widths = array($which_lw); - } - return TRUE; - } - - /*! - * - */ - function SetLineStyles($which_ls=NULL) - { - if (is_null($which_ls)) { - // Do nothing, use default value. - } else if (! is_array($which_ls)) { - // Did we get an array with line styles? - $this->line_styles = $which_ls; - } else { - $this->line_styles = ($which_ls) ? array($which_ls) : array('solid'); - } - return TRUE; - } - - -///////////////////////////////////////////// -////////////// FONTS -///////////////////////////////////////////// - - - /*! - * Sets number of pixels between lines of the same text. - */ - function SetLineSpacing($which_spc) - { - $this->line_spacing = $which_spc; - } - - - /*! - * Enables use of TrueType fonts in the graph. Font initialisation methods - * depend on this setting, so when called, SetUseTTF() resets the font - * settings - */ - function SetUseTTF($which_ttf) - { - $this->use_ttf = $which_ttf; - if ($which_ttf) - $this->SetDefaultFonts(); - return TRUE; - } - - /*! - * Sets the directory name to look into for TrueType fonts. - */ - function SetTTFPath($which_path) - { - // Maybe someone needs really dynamic config. He'll need this: - // clearstatcache(); - - if (is_dir($which_path) && is_readable($which_path)) { - $this->ttf_path = $which_path; - return TRUE; - } else { - $this->PrintError("SetTTFPath(): $which_path is not a valid path."); - return FALSE; - } - } - - /*! - * Sets the default TrueType font and updates all fonts to that. - */ - function SetDefaultTTFont($which_font) - { - if (is_file($which_font) && is_readable($which_font)) { - $this->default_ttfont = $which_font; - return $this->SetDefaultFonts(); - } else { - $this->PrintError("SetDefaultTTFont(): $which_font is not a valid font file."); - return FALSE; - } - } - - /*! - * Sets fonts to their defaults - */ - function SetDefaultFonts() - { - // TTF: - if ($this->use_ttf) { - //$this->SetTTFPath(dirname($_SERVER['PHP_SELF'])); - $this->SetTTFPath(getcwd()); - $this->SetFont('generic', $this->default_ttfont, 8); - $this->SetFont('title', $this->default_ttfont, 14); - $this->SetFont('legend', $this->default_ttfont, 8); - $this->SetFont('x_label', $this->default_ttfont, 6); - $this->SetFont('y_label', $this->default_ttfont, 6); - $this->SetFont('x_title', $this->default_ttfont, 10); - $this->SetFont('y_title', $this->default_ttfont, 10); - } - // Fixed: - else { - $this->SetFont('generic', 2); - $this->SetFont('title', 5); - $this->SetFont('legend', 2); - $this->SetFont('x_label', 1); - $this->SetFont('y_label', 1); - $this->SetFont('x_title', 3); - $this->SetFont('y_title', 3); - } - - return TRUE; - } - - /*! - * Sets Fixed/Truetype font parameters. - * \param $which_elem Is the element whose font is to be changed. - * It can be one of 'title', 'legend', 'generic', - * 'x_label', 'y_label', x_title' or 'y_title' - * \param $which_font Can be a number (for fixed font sizes) or - * a string with the filename when using TTFonts. - * \param $which_size Point size (TTF only) - * Calculates and updates internal height and width variables. - */ - function SetFont($which_elem, $which_font, $which_size = 12) - { - // TTF: - if ($this->use_ttf) { - $path = $this->ttf_path.'/'.$which_font; - - if (! is_file($path) || ! is_readable($path) ) { - $this->DrawError("SetFont(): True Type font $path doesn't exist"); - return FALSE; - } - - switch ($which_elem) { - case 'generic': - $this->generic_font['font'] = $path; - $this->generic_font['size'] = $which_size; - break; - case 'title': - $this->title_font['font'] = $path; - $this->title_font['size'] = $which_size; - break; - case 'legend': - $this->legend_font['font'] = $path; - $this->legend_font['size'] = $which_size; - break; - case 'x_label': - $this->x_label_font['font'] = $path; - $this->x_label_font['size'] = $which_size; - break; - case 'y_label': - $this->y_label_font['font'] = $path; - $this->y_label_font['size'] = $which_size; - break; - case 'x_title': - $this->x_title_font['font'] = $path; - $this->x_title_font['size'] = $which_size; - break; - case 'y_title': - $this->y_title_font['font'] = $path; - $this->y_title_font['size'] = $which_size; - break; - default: - $this->DrawError("SetFont(): Unknown element '$which_elem' specified."); - return FALSE; - } - return TRUE; - - } - - // Fixed fonts: - if ($which_font > 5 || $which_font < 0) { - $this->DrawError('SetFont(): Non-TTF font size must be 1, 2, 3, 4 or 5'); - return FALSE; - } - - switch ($which_elem) { - case 'generic': - $this->generic_font['font'] = $which_font; - $this->generic_font['height'] = ImageFontHeight($which_font); - $this->generic_font['width'] = ImageFontWidth($which_font); - break; - case 'title': - $this->title_font['font'] = $which_font; - $this->title_font['height'] = ImageFontHeight($which_font); - $this->title_font['width'] = ImageFontWidth($which_font); - break; - case 'legend': - $this->legend_font['font'] = $which_font; - $this->legend_font['height'] = ImageFontHeight($which_font); - $this->legend_font['width'] = ImageFontWidth($which_font); - break; - case 'x_label': - $this->x_label_font['font'] = $which_font; - $this->x_label_font['height'] = ImageFontHeight($which_font); - $this->x_label_font['width'] = ImageFontWidth($which_font); - break; - case 'y_label': - $this->y_label_font['font'] = $which_font; - $this->y_label_font['height'] = ImageFontHeight($which_font); - $this->y_label_font['width'] = ImageFontWidth($which_font); - break; - case 'x_title': - $this->x_title_font['font'] = $which_font; - $this->x_title_font['height'] = ImageFontHeight($which_font); - $this->x_title_font['width'] = ImageFontWidth($which_font); - break; - case 'y_title': - $this->y_title_font['font'] = $which_font; - $this->y_title_font['height'] = ImageFontHeight($which_font); - $this->y_title_font['width'] = ImageFontWidth($which_font); - break; - default: - $this->DrawError("SetFont(): Unknown element '$which_elem' specified."); - return FALSE; - } - return TRUE; - } - - - /*! - * Returns an array with the size of the bounding box of an - * arbitrarily placed (rotated) TrueType text string. - */ - function TTFBBoxSize($size, $angle, $font, $string) - { - // First, assume angle < 90 - $arr = ImageTTFBBox($size, 0, $font, $string); - $flat_width = $arr[2] - $arr[0]; - $flat_height = abs($arr[3] - $arr[5]); - - // Now the bounding box - $angle = deg2rad($angle); - $width = ceil(abs($flat_width*cos($angle) + $flat_height*sin($angle))); //Must be integer - $height = ceil(abs($flat_width*sin($angle) + $flat_height*cos($angle))); //Must be integer - - return array($width, $height); - } - - - /*! - * Draws a string of text. Horizontal and vertical alignment are relative to - * to the drawing. That is: vertical text (90 deg) gets centered along y-axis - * with v_align = 'center', and adjusted to the left of x-axis with h_align = 'right', - * - * \note Original multiple lines code submitted by Remi Ricard. - * \note Original vertical code submitted by Marlin Viss. - */ - function DrawText($which_font, $which_angle, $which_xpos, $which_ypos, $which_color, $which_text, - $which_halign = 'left', $which_valign = 'bottom') - { - // TTF: - if ($this->use_ttf) { - $size = $this->TTFBBoxSize($which_font['size'], $which_angle, $which_font['font'], $which_text); - $rads = deg2rad($which_angle); - - if ($which_valign == 'center') - $which_ypos += $size[1]/2; - - if ($which_valign == 'bottom') - $which_ypos += $size[1]; - - if ($which_halign == 'center') - $which_xpos -= ($size[0]/2) * cos($rads); - - if ($which_halign == 'left') - $which_xpos += $size[0] * sin($rads); - - if ($which_halign == 'right') - $which_xpos -= $size[0] * cos($rads); - - ImageTTFText($this->img, $which_font['size'], $which_angle, - $which_xpos, $which_ypos, $which_color, $which_font['font'], $which_text); - } - // Fixed fonts: - else { - // Split the text by its lines, and count them - $which_text = ereg_replace("\r", "", $which_text); - $str = split("\n", $which_text); - $nlines = count($str); - $spacing = $this->line_spacing * ($nlines - 1); - - // Vertical text: - // (Remember the alignment convention with vertical text) - if ($which_angle == 90) { - // The text goes around $which_xpos. - if ($which_halign == 'center') - $which_xpos -= ($nlines * ($which_font['height'] + $spacing))/2; - - // Left alignment requires no modification to $xpos... - // Right-align it. $which_xpos designated the rightmost x coordinate. - else if ($which_halign == 'right') - $which_xpos += ($nlines * ($which_font['height'] + $spacing)); - - $ypos = $which_ypos; - for($i = 0; $i < $nlines; $i++) { - // Center the text vertically around $which_ypos (each line) - if ($which_valign == 'center') - $ypos = $which_ypos + (strlen($str[$i]) * $which_font['width']) / 2; - // Make the text finish (vertically) at $which_ypos - if ($which_valign == 'bottom') - $ypos = $which_ypos + strlen($str[$i]) * $which_font['width']; - - ImageStringUp($this->img, $which_font['font'], - $i * ($which_font['height'] + $spacing) + $which_xpos, - $ypos, $str[$i], $which_color); - } - } - // Horizontal text: - else { - // The text goes above $which_ypos - if ($which_valign == 'top') - $which_ypos -= $nlines * ($which_font['height'] + $spacing); - // The text is centered around $which_ypos - if ($which_valign == 'center') - $which_ypos -= ($nlines * ($which_font['height'] + $spacing))/2; - // valign = 'bottom' requires no modification - - $xpos = $which_xpos; - for($i = 0; $i < $nlines; $i++) { - // center the text around $which_xpos - if ($which_halign == 'center') - $xpos = $which_xpos - (strlen($str[$i]) * $which_font['width'])/2; - // make the text finish at $which_xpos - if ($which_halign == 'right') - $xpos = $which_xpos - strlen($str[$i]) * $which_font['width']; - - ImageString($this->img, $which_font['font'], $xpos, - $i * ($which_font['height'] + $spacing) + $which_ypos, - $str[$i], $which_color); - } - } - } - return TRUE; - } // function DrawText() - - -///////////////////////////////////////////// -/////////// INPUT / OUTPUT CONTROL -///////////////////////////////////////////// - - /*! - * Sets output file format. - */ - function SetFileFormat($format) - { - $asked = $this->CheckOption($format, 'jpg, png, gif, wbmp', __FUNCTION__); - - switch ($asked) { - case 'jpg': - if (imagetypes() & IMG_JPG) - $this->file_format = 'jpg'; - return TRUE; - break; - case 'png': - if (imagetypes() & IMG_PNG) - $this->file_format = 'png'; - return TRUE; - break; - case 'gif': - if (imagetypes() & IMG_GIF) - $this->file_format = 'gif'; - return TRUE; - break; - case 'wbmp': - if (imagetypes() & IMG_WBMP) - $this->file_format = 'wbmp'; - return TRUE; - break; - default: - $this->PrintError("SetFileFormat():File format '$format' not supported"); - return FALSE; - } - } - - - /*! - * Selects an input file to be used as graph background and scales or tiles this image - * to fit the sizes. - * \param input_file string Path to the file to be used (jpeg, png and gif accepted) - * \param mode string 'centeredtile', 'tile', 'scale' (the image to the graph's size) - */ - function SetBgImage($input_file, $mode='centeredtile') - { - $this->bgmode = $this->CheckOption($mode, 'tile, centeredtile, scale', __FUNCTION__); - $this->bgimg = $input_file; - } - - /*! - * Selects an input file to be used as plot area background and scales or tiles this image - * to fit the sizes. - * \param input_file string Path to the file to be used (jpeg, png and gif accepted) - * \param mode string 'centeredtile', 'tile', 'scale' (the image to the graph's size) - */ - function SetPlotAreaBgImage($input_file, $mode='tile') - { - $this->plotbgmode = $this->CheckOption($mode, 'tile, centeredtile, scale', __FUNCTION__); - $this->plotbgimg = $input_file; - } - - - /*! - * Sets the name of the file to be used as output file. - */ - function SetOutputFile($which_output_file) - { - $this->output_file = $which_output_file; - return TRUE; - } - - /*! - * Sets the output image as 'inline', that is: no Content-Type headers are sent - * to the browser. Needed if you want to embed the images. - */ - function SetIsInline($which_ii) - { - $this->is_inline = (bool)$which_ii; - return TRUE; - } - - - /*! - * Performs the actual outputting of the generated graph, and - * destroys the image resource. - */ - function PrintImage() - { - // Browser cache stuff submitted by Thiemo Nagel - if ( (! $this->browser_cache) && (! $this->is_inline)) { - header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); - header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . 'GMT'); - header('Cache-Control: no-cache, must-revalidate'); - header('Pragma: no-cache'); - } - - switch($this->file_format) { - case 'png': - if (! $this->is_inline) { - Header('Content-type: image/png'); - } - if ($this->is_inline && $this->output_file != '') { - ImagePng($this->img, $this->output_file); - } else { - ImagePng($this->img); - } - break; - case 'jpg': - if (! $this->is_inline) { - Header('Content-type: image/jpeg'); - } - if ($this->is_inline && $this->output_file != '') { - ImageJPEG($this->img, $this->output_file); - } else { - ImageJPEG($this->img); - } - break; - case 'gif': - if (! $this->is_inline) { - Header('Content-type: image/gif'); - } - if ($this->is_inline && $this->output_file != '') { - ImageGIF($this->img, $this->output_file); - } else { - ImageGIF($this->img); - } - - break; - case 'wbmp': // wireless bitmap, 2 bit. - if (! $this->is_inline) { - Header('Content-type: image/wbmp'); - } - if ($this->is_inline && $this->output_file != '') { - ImageWBMP($this->img, $this->output_file); - } else { - ImageWBMP($this->img); - } - - break; - default: - $this->PrintError('PrintImage(): Please select an image type!'); - break; - } - return TRUE; - } - - /*! - * Prints an error message to stdout and dies - */ - function PrintError($error_message) - { - echo "

    Fatal error: $error_message

    "; - die; - } - - /*! - * Prints an error message inline into the generated image and draws it centered - * around the given coordinates (defaults to center of the image) - * \param error_message Message to be drawn - * \param where_x X coordinate - * \param where_y Y coordinate - */ - function DrawError($error_message, $where_x = NULL, $where_y = NULL) - { - if (! $this->img) - $this->PrintError('_DrawError(): Warning, no image resource allocated. '. - 'The message to be written was: '.$error_message); - - $ypos = (! $where_y) ? $this->image_height/2 : $where_y; - $xpos = (! $where_x) ? $this->image_width/2 : $where_x; - ImageRectangle($this->img, 0, 0, $this->image_width, $this->image_height, - ImageColorAllocate($this->img, 255, 255, 255)); - - $this->DrawText($this->generic_font, 0, $xpos, $ypos, ImageColorAllocate($this->img, 0, 0, 0), - $error_message, 'center', 'center'); - - $this->PrintImage(); - exit; -// return TRUE; - } - -///////////////////////////////////////////// -/////////// LABELS -///////////////////////////////////////////// - - - /*! - * Sets position for X labels following data points. - */ - function SetXDataLabelPos($which_xdlp) - { - $this->x_data_label_pos = $this->CheckOption($which_xdlp, 'plotdown, plotup, both, xaxis, all, none', - __FUNCTION__); - if ($which_xdlp != 'none') - $this->x_tick_label_pos = 'none'; - - return TRUE; - } - - /*! - * Sets position for Y labels following data points. - */ - function SetYDataLabelPos($which_ydlp) - { - $this->y_data_label_pos = $this->CheckOption($which_ydlp, 'plotleft, plotright, both, yaxis, all, none', - __FUNCTION__); - if ($which_ydlp != 'none') - $this->y_tick_label_pos = 'none'; - - return TRUE; - } - - - /*! - * Sets position for X labels following ticks (hence grid lines) - */ - function SetXTickLabelPos($which_xtlp) - { - $this->x_tick_label_pos = $this->CheckOption($which_xtlp, 'plotdown, plotup, both, xaxis, all, none', - __FUNCTION__); - if ($which_xtlp != 'none') - $this->x_data_label_pos = 'none'; - - return TRUE; - } - - /*! - * Sets position for Y labels following ticks (hence grid lines) - */ - function SetYTickLabelPos($which_ytlp) - { - $this->y_tick_label_pos = $this->CheckOption($which_ytlp, 'plotleft, plotright, both, yaxis, all, none', - __FUNCTION__); - if ($which_ytlp != 'none') - $this->y_data_label_pos = 'none'; - - return TRUE; - } - - /*! - * Sets type for tick and data labels on X axis. - * \note 'title' type left for backwards compatibility. - */ - function SetXLabelType($which_xlt) - { - $this->x_label_type = $this->CheckOption($which_xlt, 'data, time, title', __FUNCTION__); - return TRUE; - } - - /*! - * Sets type for tick and data labels on Y axis. - */ - function SetYLabelType($which_ylt) - { - $this->y_label_type = $this->CheckOption($which_ylt, 'data, time', __FUNCTION__); - return TRUE; - } - - function SetXTimeFormat($which_xtf) - { - $this->x_time_format = $which_xtf; - return TRUE; - } - function SetYTimeFormat($which_ytf) - { - $this->y_time_format = $which_ytf; - return TRUE; - } - - function SetXLabelAngle($which_xla) - { - $this->x_label_angle = $which_xla; - return TRUE; - } - - function SetYLabelAngle($which_yla) - { - $this->y_label_angle = $which_yla; - return TRUE; - } - -///////////////////////////////////////////// -/////////// MISC -///////////////////////////////////////////// - - /*! - * Checks the valididy of an option. - * \param which_opt String to check. - * \param which_acc String of accepted choices. - * \param which_func Name of the calling function, for error messages. - * \note If checking everywhere for correctness slows things down, we could provide a - * child class overriding every Set...() method which uses CheckOption(). Those new - * methods could proceed in the unsafe but faster way. - */ - function CheckOption($which_opt, $which_acc, $which_func) - { - $asked = trim($which_opt); - - // FIXME: this for backward compatibility, as eregi() fails with empty strings. - if ($asked == '') - return ''; - - $asked = strtolower($asked); - if (@ eregi($asked, $which_acc)) { - return $asked; - } else { - $this->DrawError("$which_func(): '$which_opt' not in available choices: '$which_acc'."); - return NULL; - } - } - - - /*! - * \note Submitted by Thiemo Nagel - */ - function SetBrowserCache($which_browser_cache) - { - $this->browser_cache = $which_browser_cache; - return TRUE; - } - - /*! - * Whether to show the final image or not - */ - function SetPrintImage($which_pi) - { - $this->print_image = $which_pi; - return TRUE; - } - - /*! - * Sets the graph's legend. If argument is not an array, appends it to the legend. - */ - function SetLegend($which_leg) - { - if (is_array($which_leg)) { // use array - $this->legend = $which_leg; - return TRUE; - } else if (! is_null($which_leg)) { // append string - $this->legend[] = $which_leg; - return TRUE; - } else { - $this->DrawError("SetLegend(): argument must not be null."); - return FALSE; - } - } - - /*! - * Specifies the absolute (relative to image's up/left corner) position - * of the legend's upper/leftmost corner. - * $which_type not yet used (TODO) - */ - function SetLegendPixels($which_x, $which_y, $which_type=NULL) - { - $this->legend_x_pos = $which_x; - $this->legend_y_pos = $which_y; - - return TRUE; - } - - /*! - * Specifies the relative (to graph's origin) position of the legend's - * upper/leftmost corner. MUST be called after scales are set up. - * $which_type not yet used (TODO) - */ - function SetLegendWorld($which_x, $which_y, $which_type=NULL) - { - if (! isset($this->scale_is_set)) - $this->CalcTranslation(); - - $this->legend_x_pos = $this->xtr($which_x); - $this->legend_y_pos = $this->ytr($which_y); - - return TRUE; - } - - /*! - * Accepted values are: left, sides, none, full - */ - function SetPlotBorderType($pbt) - { - $this->plot_border_type = $this->CheckOption($pbt, 'left, sides, none, full', __FUNCTION__); - } - - /*! - * Accepted values are: raised, plain - */ - function SetImageBorderType($sibt) - { - $this->image_border_type = $this->CheckOption($sibt, 'raised, plain', __FUNCTION__); - } - - - /*! - * \param dpab bool - */ - function SetDrawPlotAreaBackground($dpab) - { - $this->draw_plot_area_background = (bool)$dpab; - } - - - /*! - * \param dyg bool - */ - function SetDrawYGrid($dyg) - { - $this->draw_y_grid = (bool)$dyg; - return TRUE; - } - - - /*! - * \param dxg bool - */ - function SetDrawXGrid($dxg) - { - $this->draw_x_grid = (bool)$dxg; - return TRUE; - } - - - /*! - * \param ddg bool - */ - function SetDrawDashedGrid($ddg) - { - $this->dashed_grid = (bool)$ddg; - return TRUE; - } - - - /*! - * \param dxdl bool - */ - function SetDrawXDataLabelLines($dxdl) - { - $this->draw_x_data_label_lines = (bool)$dxdl; - return TRUE; - } - - - /*! - * TODO: draw_y_data_label_lines not implemented. - * \param dydl bool - */ - function SetDrawYDataLabelLines($dydl) - { - $this->draw_y_data_label_lines = $dydl; - return TRUE; - } - - /*! - * Sets the graph's title. - * TODO: add parameter to choose title placement: left, right, centered= - */ - function SetTitle($which_title) - { - $this->title_txt = $which_title; - - if ($which_title == '') { - $this->title_height = 0; - return TRUE; - } - - $str = split("\n", $which_title); - $lines = count($str); - $spacing = $this->line_spacing * ($lines - 1); - - if ($this->use_ttf) { - $size = $this->TTFBBoxSize($this->title_font['size'], 0, $this->title_font['font'], $which_title); - $this->title_height = $size[1] * $lines; - } else { - $this->title_height = ($this->title_font['height'] + $spacing) * $lines; - } - return TRUE; - } - - /*! - * Sets the X axis title and position. - */ - function SetXTitle($which_xtitle, $which_xpos = 'plotdown') - { - if ($which_xtitle == '') - $which_xpos = 'none'; - - $this->x_title_pos = $this->CheckOption($which_xpos, 'plotdown, plotup, both, none', __FUNCTION__); - - $this->x_title_txt = $which_xtitle; - - $str = split("\n", $which_xtitle); - $lines = count($str); - $spacing = $this->line_spacing * ($lines - 1); - - if ($this->use_ttf) { - $size = $this->TTFBBoxSize($this->x_title_font['size'], 0, $this->x_title_font['font'], $which_xtitle); - $this->x_title_height = $size[1] * $lines; - } else { - $this->x_title_height = ($this->y_title_font['height'] + $spacing) * $lines; - } - - return TRUE; - } - - - /*! - * Sets the Y axis title and position. - */ - function SetYTitle($which_ytitle, $which_ypos = 'plotleft') - { - if ($which_ytitle == '') - $which_ypos = 'none'; - - $this->y_title_pos = $this->CheckOption($which_ypos, 'plotleft, plotright, both, none', __FUNCTION__); - - $this->y_title_txt = $which_ytitle; - - $str = split("\n", $which_ytitle); - $lines = count($str); - $spacing = $this->line_spacing * ($lines - 1); - - if ($this->use_ttf) { - $size = $this->TTFBBoxSize($this->y_title_font['size'], 90, $this->y_title_font['font'], - $which_ytitle); - $this->y_title_width = $size[0] * $lines; - } else { - $this->y_title_width = ($this->y_title_font['height'] + $spacing) * $lines; - } - - return TRUE; - } - - /*! - * Sets the size of the drop shadow for bar and pie charts. - * \param which_s int Size in pixels. - */ - function SetShading($which_s) - { - $this->shading = (int)$which_s; - return TRUE; - } - - function SetPlotType($which_pt) - { - $this->plot_type = $this->CheckOption($which_pt, - 'bars, stackedbars, lines, linepoints, area, points, pie, thinbarline, squared', - __FUNCTION__); - } - - /*! - * Sets the position of Y axis. - * \param pos int Position in world coordinates. - */ - function SetYAxisPosition($pos) - { - $this->y_axis_position = (int)$pos; - if (isset($this->scale_is_set)) { - $this->CalcTranslation(); - } - return TRUE; - } - - /*! - * Sets the position of X axis. - * \param pos int Position in world coordinates. - */ - function SetXAxisPosition($pos) - { - $this->x_axis_position = (int)$pos; - if (isset($this->scale_is_set)) { - $this->CalcTranslation(); - } - return TRUE; - } - - - function SetXScaleType($which_xst) - { - $this->xscale_type = $this->CheckOption($which_xst, 'linear, log', __FUNCTION__); - return TRUE; - } - - function SetYScaleType($which_yst) - { - $this->yscale_type = $this->CheckOption($which_yst, 'linear, log', __FUNCTION__); - return TRUE; - } - - function SetPrecisionX($which_prec) - { - $this->x_precision = $which_prec; - $this->SetXLabelType('data'); - return TRUE; - } - - function SetPrecisionY($which_prec) - { - $this->y_precision = $which_prec; - $this->SetYLabelType('data'); - return TRUE; - } - - function SetErrorBarLineWidth($which_seblw) - { - $this->error_bar_line_width = $which_seblw; - return TRUE; - } - - function SetLabelScalePosition($which_blp) - { - //0 to 1 - $this->label_scale_position = $which_blp; - return TRUE; - } - - function SetErrorBarSize($which_ebs) - { - //in pixels - $this->error_bar_size = $which_ebs; - return TRUE; - } - - /*! - * Can be one of: 'tee', 'line' - */ - function SetErrorBarShape($which_ebs) - { - $this->error_bar_shape = $this->CheckOption($which_ebs, 'tee, line', __FUNCTION__); - } - - /*! - * Sets point shape for each data set via an array. - * Shape can be one of: 'halfline', 'line', 'plus', 'cross', 'rect', 'circle', 'dot', - * 'diamond', 'triangle', 'trianglemid' - */ - function SetPointShapes($which_pt) - { - if (is_null($which_pt)) { - // Do nothing, use default value. - } else if (is_array($which_pt)) { - // Did we get an array with point shapes? - $this->point_shapes = $which_pt; - } else { - // Single value into array - $this->point_shapes = array($which_pt); - } - - foreach ($this->point_shapes as $shape) - { - // TODO, better check, per element rectification - $this->CheckOption($shape, - 'halfline, line, plus, cross, rect, circle, dot, diamond, triangle, trianglemid', - __FUNCTION__); - } - - // Make both point_shapes and point_sizes same size. - $ps = count($this->point_sizes); - $pt = count($this->point_shapes); - - if ($ps < $pt) { - array_pad_array($this->point_sizes, $pt); - } else if ($pt > $ps) { - array_pad_array($this->point_shapes, $ps); - } - return TRUE; - } - - /*! - * Sets the point size for point plots. - * \param ps int Size in pixels. - * \note Test this more extensively - */ - function SetPointSizes($which_ps) - { - if (is_null($which_ps)) { - // Do nothing, use default value. - } else if (is_array($which_ps)) { - // Did we get an array with point sizes? - $this->point_sizes = $which_ps; - } else { - // Single value into array - $this->point_sizes = array($which_ps); - } - - // Make both point_shapes and point_sizes same size. - $ps = count($this->point_sizes); - $pt = count($this->point_shapes); - - if ($ps < $pt) { - array_pad_array($this->point_sizes, $pt); - } else if ($pt > $ps) { - array_pad_array($this->point_shapes, $ps); - } - - // Fix odd point sizes for point shapes which need it - for ($i = 0; $i < $pt; $i++) { - if ($this->point_shapes[$i] == 'diamond' or $this->point_shapes[$i] == 'triangle') { - if ($this->point_sizes[$i] % 2 != 0) { - $this->point_sizes[$i]++; - } - } - } - return TRUE; - } - - - /*! - * Tells not to draw lines for missing Y data. Only works with 'lines' and 'squared' plots. - * \param bl bool - */ - function SetDrawBrokenLines($bl) - { - $this->draw_broken_lines = (bool)$bl; - } - - - /*! - * text-data: ('label', y1, y2, y3, ...) - * text-data-single: ('label', data), for some pie charts. - * data-data: ('label', x, y1, y2, y3, ...) - * data-data-error: ('label', x1, y1, e1+, e2-, y2, e2+, e2-, y3, e3+, e3-, ...) - */ - function SetDataType($which_dt) - { - //The next four lines are for past compatibility. - if ($which_dt == 'text-linear') { $which_dt = 'text-data'; }; - if ($which_dt == 'linear-linear') { $which_dt = 'data-data'; }; - if ($which_dt == 'linear-linear-error') { $which_dt = 'data-data-error'; }; - if ($which_dt == 'text-data-pie') { $which_dt = 'text-data-single'; } - - - $this->data_type = $this->CheckOption($which_dt, 'text-data, text-data-single, '. - 'data-data, data-data-error', __FUNCTION__); - return TRUE; - } - - /*! - * Copy the array passed as data values. We convert to numerical indexes, for its - * use for (or while) loops, which sometimes are faster. Performance improvements - * vary from 28% in DrawLines() to 49% in DrawArea() for plot drawing functions. - */ - function SetDataValues(&$which_dv) - { - unset ($this->data_limits_done); // Reset this for every new data_set - $this->num_data_rows = count($which_dv); - $this->total_records = 0; // Perform some useful calculations. - $this->records_per_group = 1; - for ($i = 0, $recs = 0; $i < $this->num_data_rows; $i++) { - // Copy - $this->data[$i] = array_values($which_dv[$i]); // convert to numerical indices. - - // Compute some values - $recs = count($this->data[$i]); - $this->total_records += $recs; - - if ($recs > $this->records_per_group) - $this->records_per_group = $recs; - - $this->num_recs[$i] = $recs; - } - } - - /*! - * Pad styles arrays for later use by plot drawing functions: - * This removes the need for $max_data_colors, etc. and $color_index = $color_index % $max_data_colors - * in DrawBars(), DrawLines(), etc. - */ - function PadArrays() - { - array_pad_array($this->line_widths, $this->records_per_group); - array_pad_array($this->line_styles, $this->records_per_group); - - array_pad_array($this->data_colors, $this->records_per_group); - array_pad_array($this->data_border_colors, $this->records_per_group); - array_pad_array($this->error_bar_colors, $this->records_per_group); - - $this->SetDataColors(); - $this->SetDataBorderColors(); - $this->SetErrorBarColors(); - - return TRUE; - } - - -////////////////////////////////////////////////////////// -/////////// DATA ANALYSIS, SCALING AND TRANSLATION -////////////////////////////////////////////////////////// - - /*! - * Analizes data and sets up internal maxima and minima - * Needed by: CalcMargins(), ... - * Text-Data is different than data-data graphs. For them what - * we have, instead of X values, is # of records equally spaced on data. - * text-data is passed in as $data[] = (title, y1, y2, y3, y4, ...) - * data-data is passed in as $data[] = (title, x, y1, y2, y3, y4, ...) - */ - function FindDataLimits() - { - // Set some default min and max values before running through the data - switch ($this->data_type) { - case 'text-data': - $minx = 0; - $maxx = $this->num_data_rows - 1 ; - $miny = $this->data[0][1]; - $maxy = $miny; - break; - default: //Everything else: data-data, etc, take first value - $minx = $this->data[0][1]; - $maxx = $minx; - $miny = $this->data[0][2]; - $maxy = $miny; - break; - } - - $mine = 0; // Maximum value for the -error bar (assume error bars always > 0) - $maxe = 0; // Maximum value for the +error bar (assume error bars always > 0) - $maxt = 0; // Maximum number of characters in text labels - - $minminy = $miny; - $maxmaxy = $maxy; - - if ($this->plot_type == 'stackedbars') { $maxmaxy = $minminy = 0; } - - // Process each row of data - for ($i=0; $i < $this->num_data_rows; $i++) { - $j=0; - // Extract maximum text label length - $val = @ strlen($this->data[$i][$j++]); - $maxt = ($val > $maxt) ? $val : $maxt; - - - if ($this->plot_type == 'stackedbars') { $maxy = $miny = 0; } - - switch ($this->data_type) { - case 'text-data': // Data is passed in as (title, y1, y2, y3, ...) - case 'text-data-single': // This one is for some pie charts - // $numrecs = @ count($this->data[$i]); - $miny = $maxy = (double)$this->data[$i][$j]; - for (; $j < $this->num_recs[$i]; $j++) { - $val = (double)$this->data[$i][$j]; - if ($this->plot_type == 'stackedbars') { - $maxy += abs($val); // only positive values for the moment - } else { - $maxy = ($val > $maxy) ? $val : $maxy; - $miny = ($val < $miny) ? $val : $miny; - } - } - break; - case 'data-data': // Data is passed in as (title, x, y, y2, y3, ...) - // X value: - $val = (double)$this->data[$i][$j++]; - $maxx = ($val > $maxx) ? $val : $maxx; - $minx = ($val < $minx) ? $val : $minx; - - $miny = $maxy = (double)$this->data[$i][$j]; - // $numrecs = @ count($this->data[$i]); - for (; $j < $this->num_recs[$i]; $j++) { - $val = (double)$this->data[$i][$j]; - $maxy = ($val > $maxy) ? $val : $maxy; - $miny = ($val < $miny) ? $val : $miny; - } - break; - case 'data-data-error': // Data is passed in as (title, x, y, err+, err-, y2, err2+, err2-,...) - // X value: - $val = (double)$this->data[$i][$j++]; - $maxx = ($val > $maxx) ? $val : $maxx; - $minx = ($val < $minx) ? $val : $minx; - - $miny = $maxy = (double)$this->data[$i][$j]; - // $numrecs = @ count($this->data[$i]); - for (; $j < $this->num_recs[$i];) { - // Y value: - $val = (double)$this->data[$i][$j++]; - $maxy = ($val > $maxy) ? $val : $maxy; - $miny = ($val < $miny) ? $val : $miny; - // Error +: - $val = (double)$this->data[$i][$j++]; - $maxe = ($val > $maxe) ? $val : $maxe; - // Error -: - $val = (double)$this->data[$i][$j++]; - $mine = ($val > $mine) ? $val : $mine; - } - $maxy = $maxy + $maxe; - $miny = $miny - $mine; // assume error bars are always > 0 - break; - default: - $this->PrintError("FindDataLimits(): Unknown data type '$data_type'."); - break; - } - $this->data[$i][MINY] = $miny; // This row's min Y, for DrawXDataLine() - $this->data[$i][MAXY] = $maxy; // This row's max Y, for DrawXDataLine() - - $minminy = ($miny < $minminy) ? $miny : $minminy; // global min - $maxmaxy = ($maxy > $maxmaxy) ? $maxy : $maxmaxy; // global max - } - - $this->min_x = $minx; - $this->max_x = $maxx; - $this->min_y = $minminy; - $this->max_y = $maxmaxy; - $this->max_t = $maxt; - - $this->data_limits_done = TRUE; - - return TRUE; - } - - - /*! - * Calculates image margins on the fly from title positions and sizes, - * and tick labels positions and sizes. - * - * FIXME: fix x_data_label_pos behaviour. Now we are leaving room for it AND x_tick_label_pos - * maybe it shouldn't be so... - * - * FIXME: y_data_label_pos is not yet used... - * - * TODO: add x_tick_label_width and y_tick_label_height and use them to calculate - * max_x_labels and max_y_labels, to be used by drawing functions to avoid overlapping. - */ - function CalcMargins() - { - // Temporary variables for label size calculation - $xlab = $this->FormatLabel('x', $this->max_x); - $ylab = $this->FormatLabel('y', $this->max_y); - - // dirty fix: - // max_t is the maximum data label length (from column 0 of each data row). - if ($this->max_t > strlen ($xlab)) - $xlab = sprintf ("%{$this->max_t}s","_"); - - //////// Calculate maximum X/Y axis label height and width: - - // TTFonts: - if ($this->use_ttf) { - // Maximum X axis label height - $size = $this->TTFBBoxSize($this->x_label_font['size'], $this->x_label_angle, - $this->x_label_font['font'], $xlab); - $this->x_tick_label_height = $size[1]; - - // Maximum Y axis label width - $size = $this->TTFBBoxSize($this->y_label_font['size'], $this->y_label_angle, - $this->y_label_font['font'], $ylab); - $this->y_tick_label_width = $size[0]; - } - // Fixed fonts: - else { - // Maximum X axis label height - if ($this->x_label_angle == 90) - $this->x_tick_label_height = strlen($xlab) * $this->x_label_font['width']; - else - $this->x_tick_label_height = $this->x_label_font['height']; - - // Maximum Y axis label width - $this->y_tick_label_width = strlen($ylab) * $this->y_label_font['width']; - } - - - ///////// Calculate margins: - - // Upper title, ticks and tick labels, and data labels: - $this->y_top_margin = $this->title_height + $this->safe_margin * 2; - - if ($this->x_title_pos == 'plotup' || $this->x_title_pos == 'both') - $this->y_top_margin += $this->x_title_height + $this->safe_margin; - - if ($this->x_tick_label_pos == 'plotup' || $this->x_tick_label_pos == 'both') - $this->y_top_margin += $this->x_tick_label_height; - - if ($this->x_tick_pos == 'plotup' || $this->x_tick_pos == 'both') - $this->y_top_margin += $this->x_tick_length * 2; - - if ($this->x_data_label_pos == 'plotup' || $this->x_data_label_pos == 'both') - $this->y_top_margin += $this->x_tick_label_height; - - // Lower title, ticks and tick labels, and data labels: - $this->y_bot_margin = $this->safe_margin * 2; - - if ($this->x_title_pos == 'plotdown' || $this->x_title_pos == 'both') - $this->y_bot_margin += $this->x_title_height; - - if ($this->x_tick_pos == 'plotdown' || $this->x_tick_pos == 'both') - $this->y_bot_margin += $this->x_tick_length * 2; - - if ($this->x_tick_pos == 'xaxis' && ($this->x_axis_position == '' || $this->x_axis_position == 0)) - $this->y_bot_margin += $this->x_tick_length * 2; - - if ($this->x_tick_label_pos == 'plotdown' || $this->x_tick_label_pos == 'both') - $this->y_bot_margin += $this->x_tick_label_height; - - if ($this->x_tick_label_pos == 'xaxis' && ($this->x_axis_position == '' || $this->x_axis_position == 0)) - $this->y_bot_margin += $this->x_tick_label_height; - - if ($this->x_data_label_pos == 'plotdown' || $this->x_data_label_pos == 'both') - $this->y_bot_margin += $this->x_tick_label_height; - - // Left title, ticks and tick labels: - $this->x_left_margin = $this->safe_margin * 2; - - if ($this->y_title_pos == 'plotleft' || $this->y_title_pos == 'both') - $this->x_left_margin += $this->y_title_width + $this->safe_margin; - - if ($this->y_tick_label_pos == 'plotleft' || $this->y_tick_label_pos == 'both') - $this->x_left_margin += $this->y_tick_label_width; - - if ($this->y_tick_pos == 'plotleft' || $this->y_tick_pos == 'both') - $this->x_left_margin += $this->y_tick_length * 2 ; - - // Right title, ticks and tick labels: - $this->x_right_margin = $this->safe_margin * 2; - - if ($this->y_title_pos == 'plotright' || $this->y_title_pos == 'both') - $this->x_right_margin += $this->y_title_width + $this->safe_margin; - - if ($this->y_tick_label_pos == 'plotright' || $this->y_tick_label_pos == 'both') - $this->x_right_margin += $this->y_tick_label_width; - - if ($this->y_tick_pos == 'plotright' || $this->y_tick_pos == 'both') - $this->x_right_margin += $this->y_tick_length * 2; - - - $this->x_tot_margin = $this->x_left_margin + $this->x_right_margin; - $this->y_tot_margin = $this->y_top_margin + $this->y_bot_margin; - - return; - } - - - /*! - * Set the margins in pixels (left, right, top, bottom) - */ - function SetMarginsPixels($which_lm, $which_rm, $which_tm, $which_bm) - { - - $this->x_left_margin = $which_lm; - $this->x_right_margin = $which_rm; - $this->x_tot_margin = $which_lm + $which_rm; - - $this->y_top_margin = $which_tm; - $this->y_bot_margin = $which_bm; - $this->y_tot_margin = $which_tm + $which_bm; - - $this->SetPlotAreaPixels(); - - return; - } - - - /*! - * Sets the limits for the plot area. If no arguments are supplied, uses - * values calculated from CalcMargins(); - * Like in GD, (0,0) is upper left - * - * This resets the scale if SetPlotAreaWorld() was already called - */ - function SetPlotAreaPixels($x1=NULL, $y1=NULL, $x2=NULL, $y2=NULL) - { - if ($x2 && $y2) { - $this->plot_area = array($x1, $y1, $x2, $y2); - } else { - if (! isset($this->x_tot_margin)) - $this->CalcMargins(); - - $this->plot_area = array($this->x_left_margin, $this->y_top_margin, - $this->image_width - $this->x_right_margin, - $this->image_height - $this->y_bot_margin); - } - $this->plot_area_width = $this->plot_area[2] - $this->plot_area[0]; - $this->plot_area_height = $this->plot_area[3] - $this->plot_area[1]; - - // Reset the scale with the new plot area. - if (isset($this->plot_max_x)) - $this->CalcTranslation(); - - return TRUE; - - } - - - /*! - * Sets minimum and maximum x and y values in the plot using FindDataLimits() - * or from the supplied parameters, if any. - * - * This resets the scale if SetPlotAreaPixels() was already called - */ - function SetPlotAreaWorld($xmin=NULL, $ymin=NULL, $xmax=NULL, $ymax=NULL) - { - if (! isset($this->data_limits_done)) { // For automatic setting of data we need data limits - $this->FindDataLimits() ; - } - - if ($xmin === NULL || $xmin === '') { - if ($this->data_type == 'text-data') // Valid for data without X values only. - $xmin = 0; - else - $xmin = $this->min_x; - } - if ($xmax === NULL || $xmax === '') { - if ($this->data_type == 'text-data') // Valid for data without X values only. - $xmax = $this->max_x + 1; - else - $xmax = $this->max_x; - } - - // Leave room above and below the highest and lowest data points. - - if ($ymin === NULL || $ymin === '') { - if ($this->min_y < 0) - $ymin = ceil($this->min_y * 1.1); - else - $ymin = floor($this->min_y * 0.9); - } - if ($ymax === NULL || $ymax === '') { - if ($this->max_y < 0) - $ymax = floor($this->max_y * 0.9); - else - $ymax = ceil($this->max_y * 1.1); - } - - // Error checking - - if ($ymin == $ymax) // Minimum height - $ymax += 1; - - if ($this->yscale_type == 'log') { - if ($ymin <= 0) { - $ymin = 1; - } - if ($ymax <= 0) { - $this->PrintError('SetPlotAreaWorld(): Log plots need data greater than 0'); - return FALSE; - } - } - - if ($ymax <= $ymin) { - $this->DrawError('SetPlotAreaWorld(): Error in data - max not greater than min'); - return FALSE; - } - - - // Reset (if it was already set) the scale with the new maxs and mins - - $this->plot_min_x = $xmin; - $this->plot_max_x = $xmax; - $this->plot_min_y = $ymin; - $this->plot_max_y = $ymax; - - if (isset($this->plot_area_width)) { - $this->CalcTranslation(); - } - - return TRUE; - } //function SetPlotAreaWorld - - - /*! - * For bar plots, which have equally spaced x variables. - */ - function CalcBarWidths() - { - $group_width = ($this->plot_area[2] - $this->plot_area[0]) / - $this->num_data_rows * $this->group_frac_width; - if ($this->plot_type == 'bars') { - $this->record_bar_width = $group_width / $this->records_per_group; - } else if ($this->plot_type == 'stackedbars') { - $this->record_bar_width = $group_width; - } - $this->data_group_space = $group_width / 2; - return TRUE; - } - - /*! - * Calculates scaling stuff... - */ - function CalcTranslation() - { - if ($this->plot_max_x - $this->plot_min_x == 0) { // Check for div by 0 - $this->xscale = 0; - } else { - if ($this->xscale_type == 'log') { - $this->xscale = ($this->plot_area_width)/(log10($this->plot_max_x) - log10($this->plot_min_x)); - } else { - $this->xscale = ($this->plot_area_width)/($this->plot_max_x - $this->plot_min_x); - } - } - - if ($this->plot_max_y - $this->plot_min_y == 0) { // Check for div by 0 - $this->yscale = 0; - } else { - if ($this->yscale_type == 'log') { - $this->yscale = ($this->plot_area_height)/(log10($this->plot_max_y) - log10($this->plot_min_y)); - } else { - $this->yscale = ($this->plot_area_height)/($this->plot_max_y - $this->plot_min_y); - } - } - // GD defines x = 0 at left and y = 0 at TOP so -/+ respectively - if ($this->xscale_type == 'log') { - $this->plot_origin_x = $this->plot_area[0] - ($this->xscale * log10($this->plot_min_x) ); - } else { - $this->plot_origin_x = $this->plot_area[0] - ($this->xscale * $this->plot_min_x); - } - if ($this->yscale_type == 'log') { - $this->plot_origin_y = $this->plot_area[3] + ($this->yscale * log10($this->plot_min_y)); - } else { - $this->plot_origin_y = $this->plot_area[3] + ($this->yscale * $this->plot_min_y); - } - - $this->scale_is_set = TRUE; - - /************** FIXME?? *************/ - // There should be a better place for this. - - // User provided y axis position? - if ($this->y_axis_position != '') { - // Make sure we draw our axis inside the plot - $this->y_axis_position = ($this->y_axis_position < $this->plot_min_x) - ? $this->plot_min_x : $this->y_axis_position; - $this->y_axis_position = ($this->y_axis_position > $this->plot_max_x) - ? $this->plot_max_x : $this->y_axis_position; - $this->y_axis_x_pixels = $this->xtr($this->y_axis_position); - } else { - // Default to left axis - $this->y_axis_x_pixels = $this->xtr($this->plot_min_x); - } - // User provided x axis position? - if ($this->x_axis_position != '') { - // Make sure we draw our axis inside the plot - $this->x_axis_position = ($this->x_axis_position < $this->plot_min_y) - ? $this->plot_min_y : $this->x_axis_position; - $this->x_axis_position = ($this->x_axis_position > $this->plot_max_y) - ? $this->plot_max_y : $this->x_axis_position; - $this->x_axis_y_pixels = $this->ytr($this->x_axis_position); - } else { - if ($this->yscale_type == 'log') - $this->x_axis_y_pixels = $this->ytr(1); - else - // Default to axis at 0 or plot_min_y (should be 0 anyway, from SetPlotAreaWorld()) - $this->x_axis_y_pixels = ($this->plot_min_y <= 0) && (0 <= $this->plot_max_y) - ? $this->ytr(0) : $this->ytr($this->plot_min_y); - } - - } // function CalcTranslation() - - - /*! - * Translate X world coordinate into pixel coordinate - * Needs values calculated by _CalcTranslation() - */ - function xtr($x_world) - { - //$x_pixels = $this->x_left_margin + ($this->image_width - $this->x_tot_margin)* - // (($x_world - $this->plot_min_x) / ($this->plot_max_x - $this->plot_min_x)) ; - //which with a little bit of math reduces to ... - if ($this->xscale_type == 'log') { - $x_pixels = $this->plot_origin_x + log10($x_world) * $this->xscale ; - } else { - $x_pixels = $this->plot_origin_x + $x_world * $this->xscale ; - } - return round($x_pixels); - } - - - /*! - * Translate Y world coordinate into pixel coordinate. - * Needs values calculated by _CalcTranslation() - */ - function ytr($y_world) - { - if ($this->yscale_type == 'log') { - //minus because GD defines y = 0 at top. doh! - $y_pixels = $this->plot_origin_y - log10($y_world) * $this->yscale ; - } else { - $y_pixels = $this->plot_origin_y - $y_world * $this->yscale ; - } - return round($y_pixels); - } - - /*! - * Formats a tick or data label. - * - * \note Time formatting suggested by Marlin Viss - */ - function FormatLabel($which_pos, $which_lab) - { - switch ($which_pos) { - case 'x': - case 'plotx': - switch ($this->x_label_type) { - case 'title': - $lab = @ $this->data[$which_lab][0]; - break; - case 'data': - $lab = number_format($which_lab, $this->x_precision, '.', ',').$this->data_units_text; - break; - case 'time': - $lab = strftime($this->x_time_format, $which_lab); - break; - default: - // Unchanged from whatever format it is passed in - $lab = $which_lab; - break; - } - break; - case 'y': - case 'ploty': - switch ($this->y_label_type) { - case 'data': - $lab = number_format($which_lab, $this->y_precision, '.', ',').$this->data_units_text; - break; - case 'time': - $lab = strftime($this->y_time_format, $which_lab); - break; - default: - // Unchanged from whatever format it is passed in - $lab = $which_lab; - break; - } - break; - default: - $this->PrintError("FormatLabel(): Unknown label type $which_type"); - return NULL; - } - - return $lab; - } //function FormatLabel - - - -///////////////////////////////////////////// -/////////////// TICKS -///////////////////////////////////////////// - - /*! - * Use either this or SetNumXTicks() to set where to place x tick marks - */ - function SetXTickIncrement($which_ti=NULL) - { - if ($which_ti) { - $this->x_tick_inc = $which_ti; //world coordinates - } else { - if (! isset($this->data_limits_done)) { - $this->FindDataLimits(); //Get maxima and minima for scaling - } - $this->x_tick_inc = ($this->plot_max_x - $this->plot_min_x )/10; - } - $this->num_x_ticks = ''; //either use num_y_ticks or y_tick_inc, not both - return TRUE; - } - - /*! - * Use either this or SetNumYTicks() to set where to place y tick marks - */ - function SetYTickIncrement($which_ti=NULL) - { - if ($which_ti) { - $this->y_tick_inc = $which_ti; //world coordinates - } else { - if (! isset($this->data_limits_done)) { - $this->FindDataLimits(); //Get maxima and minima for scaling - } - if (! isset($this->plot_max_y)) - $this->SetPlotAreaWorld(); - - $this->y_tick_inc = ($this->plot_max_y - $this->plot_min_y )/10; - } - $this->num_y_ticks = ''; //either use num_y_ticks or y_tick_inc, not both - return TRUE; - } - - - function SetNumXTicks($which_nt) - { - $this->num_x_ticks = $which_nt; - $this->x_tick_inc = ''; //either use num_x_ticks or x_tick_inc, not both - return TRUE; - } - - function SetNumYTicks($which_nt) - { - $this->num_y_ticks = $which_nt; - $this->y_tick_inc = ''; //either use num_y_ticks or y_tick_inc, not both - return TRUE; - } - - /*! - * - */ - function SetYTickPos($which_tp) - { - $this->y_tick_pos = $this->CheckOption($which_tp, 'plotleft, plotright, both, yaxis, none', __FUNCTION__); - return TRUE; - } - /*! - * - */ - function SetXTickPos($which_tp) - { - $this->x_tick_pos = $this->CheckOption($which_tp, 'plotdown, plotup, both, xaxis, none', __FUNCTION__); - return TRUE; - } - - /*! - * \param skip bool - */ - function SetSkipTopTick($skip) - { - $this->skip_top_tick = (bool)$skip; - return TRUE; - } - - /*! - * \param skip bool - */ - function SetSkipBottomTick($skip) - { - $this->skip_bottom_tick = (bool)$skip; - return TRUE; - } - - /*! - * \param skip bool - */ - function SetSkipLeftTick($skip) - { - $this->skip_left_tick = (bool)$skip; - return TRUE; - } - - /*! - * \param skip bool - */ - function SetSkipRightTick($skip) - { - $this->skip_right_tick = (bool)$skip; - return TRUE; - } - - function SetXTickLength($which_xln) - { - $this->x_tick_length = $which_xln; - return TRUE; - } - - function SetYTickLength($which_yln) - { - $this->y_tick_length = $which_yln; - return TRUE; - } - - function SetXTickCrossing($which_xc) - { - $this->x_tick_cross = $which_xc; - return TRUE; - } - - function SetYTickCrossing($which_yc) - { - $this->y_tick_cross = $which_yc; - return TRUE; - } - - -///////////////////////////////////////////// -//////////////////// GENERIC DRAWING -///////////////////////////////////////////// - - /*! - * Fills the background. - */ - function DrawBackground() - { - // Don't draw this twice if drawing two plots on one image - if (! $this->background_done) { - if (isset($this->bgimg)) { // If bgimg is defined, use it - $this->tile_img($this->bgimg, 0, 0, $this->image_width, $this->image_height, $this->bgmode); - } else { // Else use solid color - ImageFilledRectangle($this->img, 0, 0, $this->image_width, $this->image_height, - $this->ndx_bg_color); - } - $this->background_done = TRUE; - return TRUE; // Done - } - return FALSE; // Nothing done - } - - - /*! - * Fills the plot area background. - */ - function DrawPlotAreaBackground() - { - if (isset($this->plotbgimg)) { - $this->tile_img($this->plotbgimg, $this->plot_area[0], $this->plot_area[1], - $this->plot_area_width, $this->plot_area_height, $this->plotbgmode); - } - else { - if ($this->draw_plot_area_background) { - ImageFilledRectangle($this->img, $this->plot_area[0], $this->plot_area[1], - $this->plot_area[2], $this->plot_area[3], $this->ndx_plot_bg_color); - } - } - - return TRUE; - } - - - /*! - * Tiles an image at some given coordinates. - * - * \param $file string Filename of the picture to be used as tile. - * \param $xorig int X coordinate of the plot where the tile is to begin. - * \param $yorig int Y coordinate of the plot where the tile is to begin. - * \param $width int Width of the area to be tiled. - * \param $height int Height of the area to be tiled. - * \param $mode string One of 'centeredtile', 'tile', 'scale'. - */ - function tile_img($file, $xorig, $yorig, $width, $height, $mode) - { - $size = getimagesize($file); - $input_format = $size[2]; - - switch($input_format) { - case 1: - $im = @ imagecreatefromGIF ($file); - if (! $im) { - $this->PrintError("tile_img:() Unable to open $file as a GIF."); - return FALSE; - } - break; - case 2: - $im = @ imagecreatefromJPEG ($file); - if (! $im) { - $this->PrintError("tile_img(): Unable to open $file as a JPG."); - return FALSE; - } - break; - case 3: - $im = @ imagecreatefromPNG ($file); - if (! $im) { - $this->PrintError("tile_img(): Unable to open $file as a PNG."); - return FALSE; - } - break; - default: - $this->PrintError('tile_img(): Please select a gif, jpg, or png image.'); - return FALSE; - break; - } - - - if ($mode == 'scale') { - imagecopyresized($this->img, $im, $xorig, $yorig, 0, 0, $width, $height, $size[0],$size[1]); - return TRUE; - } else if ($mode == 'centeredtile') { - $x0 = - floor($size[0]/2); // Make the tile look better - $y0 = - floor($size[1]/2); - } else if ($mode = 'tile') { - $x0 = 0; - $y0 = 0; - } - - // Actually draw the tile - - // But first on a temporal image. - $tmp = ImageCreate($width, $height); - if (! $tmp) - $this->PrintError('tile_img(): Could not create image resource.'); - - for ($x = $x0; $x < $width; $x += $size[0]) - for ($y = $y0; $y < $height; $y += $size[1]) - imagecopy($tmp, $im, $x, $y, 0, 0, $size[0], $size[1]); - - // Copy the temporal image onto the final one. - imagecopy($this->img, $tmp, $xorig, $yorig, 0,0, $width, $height); - - // Free resources - imagedestroy($tmp); - imagedestroy($im); - - return TRUE; - } // function tile_img - - - /*! - * Draws a border around the final image. - */ - function DrawImageBorder() - { - switch ($this->image_border_type) { - case 'raised': - ImageLine($this->img, 0, 0, $this->image_width-1, 0, $this->ndx_i_border); - ImageLine($this->img, 1, 1, $this->image_width-2, 1, $this->ndx_i_border); - ImageLine($this->img, 0, 0, 0, $this->image_height-1, $this->ndx_i_border); - ImageLine($this->img, 1, 1, 1, $this->image_height-2, $this->ndx_i_border); - ImageLine($this->img, $this->image_width-1, 0, $this->image_width-1, - $this->image_height-1, $this->ndx_i_border_dark); - ImageLine($this->img, 0, $this->image_height-1, $this->image_width-1, - $this->image_height-1, $this->ndx_i_border_dark); - ImageLine($this->img, $this->image_width-2, 1, $this->image_width-2, - $this->image_height-2, $this->ndx_i_border_dark); - ImageLine($this->img, 1, $this->image_height-2, $this->image_width-2, - $this->image_height-2, $this->ndx_i_border_dark); - break; - case 'plain': - ImageLine($this->img, 0, 0, $this->image_width, 0, $this->ndx_i_border_dark); - ImageLine($this->img, $this->image_width-1, 0, $this->image_width-1, - $this->image_height, $this->ndx_i_border_dark); - ImageLine($this->img, $this->image_width-1, $this->image_height-1, 0, $this->image_height-1, - $this->ndx_i_border_dark); - ImageLine($this->img, 0, 0, 0, $this->image_height, $this->ndx_i_border_dark); - break; - case 'none': - break; - default: - $this->DrawError("DrawImageBorder(): unknown image_border_type: '$this->image_border_type'"); - return FALSE; - } - return TRUE; - } - - - /*! - * Adds the title to the graph. - */ - function DrawTitle() - { - // Center of the plot area - //$xpos = ($this->plot_area[0] + $this->plot_area_width )/ 2; - - // Center of the image: - $xpos = $this->image_width / 2; - - // Place it at almost at the top - $ypos = $this->safe_margin; - - $this->DrawText($this->title_font, $this->title_angle, $xpos, $ypos, - $this->ndx_title_color, $this->title_txt, 'center', 'bottom'); - - return TRUE; - - } - - - /*! - * Draws the X-Axis Title - */ - function DrawXTitle() - { - if ($this->x_title_pos == 'none') - return; - - // Center of the plot - $xpos = ($this->plot_area[2] + $this->plot_area[0]) / 2; - - // Upper title - if ($this->x_title_pos == 'plotup' || $this->x_title_pos == 'both') { - $ypos = $this->safe_margin + $this->title_height + $this->safe_margin; - $this->DrawText($this->x_title_font, $this->x_title_angle, - $xpos, $ypos, $this->ndx_title_color, $this->x_title_txt, 'center'); - } - // Lower title - if ($this->x_title_pos == 'plotdown' || $this->x_title_pos == 'both') { - $ypos = $this->image_height - $this->x_title_height - $this->safe_margin; - $this->DrawText($this->x_title_font, $this->x_title_angle, - $xpos, $ypos, $this->ndx_title_color, $this->x_title_txt, 'center'); - } - return TRUE; - } - - /*! - * Draws the Y-Axis Title - */ - function DrawYTitle() - { - if ($this->y_title_pos == 'none') - return; - - // Center the title vertically to the plot - $ypos = ($this->plot_area[3] + $this->plot_area[1]) / 2; - - if ($this->y_title_pos == 'plotleft' || $this->y_title_pos == 'both') { - $xpos = $this->safe_margin; - $this->DrawText($this->y_title_font, 90, $xpos, $ypos, $this->ndx_title_color, - $this->y_title_txt, 'left', 'center'); - } - if ($this->y_title_pos == 'plotright' || $this->y_title_pos == 'both') { - $xpos = $this->image_width - $this->safe_margin - $this->y_title_width - $this->safe_margin; - $this->DrawText($this->y_title_font, 90, $xpos, $ypos, $this->ndx_title_color, - $this->y_title_txt, 'left', 'center'); - } - - return TRUE; - } - - - /* - * \note Horizontal grid lines overwrite horizontal axis with y=0, so call this first, then DrawXAxis() - */ - function DrawYAxis() - { - // Draw ticks, labels and grid, if any - $this->DrawYTicks(); - - // Draw Y axis at X = y_axis_x_pixels - ImageLine($this->img, $this->y_axis_x_pixels, $this->plot_area[1], - $this->y_axis_x_pixels, $this->plot_area[3], $this->ndx_grid_color); - - return TRUE; - } - - /* - * - */ - function DrawXAxis() - { - // Draw ticks, labels and grid - $this->DrawXTicks(); - - /* This tick and label tend to overlap with regular Y Axis labels, - * as Mike Pullen pointed out. - * - //Draw Tick and Label for X axis - if (! $this->skip_bottom_tick) { - $ylab =$this->FormatLabel('y', $this->x_axis_position); - $this->DrawYTick($ylab, $this->x_axis_y_pixels); - } - */ - //Draw X Axis at Y = x_axis_y_pixels - ImageLine($this->img, $this->plot_area[0]+1, $this->x_axis_y_pixels, - $this->plot_area[2]-1, $this->x_axis_y_pixels, $this->ndx_grid_color); - - return TRUE; - } - - /*! - * Draw Just one Tick, called from DrawYTicks() and DrawXAxis() - * TODO? Move this inside DrawYTicks() and Modify DrawXAxis() ? - */ - function DrawYTick($which_ylab, $which_ypix) - { - // Ticks on Y axis - if ($this->y_tick_pos == 'yaxis') { - ImageLine($this->img, $this->y_axis_x_pixels - $this->y_tick_length, $which_ypix, - $this->y_axis_x_pixels + $this->y_tick_cross, $which_ypix, - $this->ndx_tick_color); - } - - // Labels on Y axis - if ($this->y_tick_label_pos == 'yaxis') { - $this->DrawText($this->y_label_font, $this->y_label_angle, - $this->y_axis_x_pixels - $this->y_tick_length * 1.5, $which_ypix, - $this->ndx_text_color, $which_ylab, 'right', 'center'); - } - - // Ticks to the left of the Plot Area - if (($this->y_tick_pos == 'plotleft') || ($this->y_tick_pos == 'both') ) { - ImageLine($this->img, $this->plot_area[0] - $this->y_tick_length, - $which_ypix, $this->plot_area[0] + $this->y_tick_cross, - $which_ypix, $this->ndx_tick_color); - } - - // Ticks to the right of the Plot Area - if (($this->y_tick_pos == 'plotright') || ($this->y_tick_pos == 'both') ) { - ImageLine($this->img, ($this->plot_area[2] + $this->y_tick_length), - $which_ypix, $this->plot_area[2] - $this->y_tick_cross, - $which_ypix, $this->ndx_tick_color); - } - - // Labels to the left of the plot area - if ($this->y_tick_label_pos == 'plotleft' || $this->y_tick_label_pos == 'both') { - $this->DrawText($this->y_label_font, $this->y_label_angle, - $this->plot_area[0] - $this->y_tick_length * 1.5, $which_ypix, - $this->ndx_text_color, $which_ylab, 'right', 'center'); - } - // Labels to the right of the plot area - if ($this->y_tick_label_pos == 'plotright' || $this->y_tick_label_pos == 'both') { - $this->DrawText($this->y_label_font, $this->y_label_angle, - $this->plot_area[2] + $this->y_tick_length * 1.5, $which_ypix, - $this->ndx_text_color, $which_ylab, 'left', 'center'); - } - } // Function DrawYTick() - - - /*! - * Draws Grid, Ticks and Tick Labels along Y-Axis - * Ticks and ticklabels can be left of plot only, right of plot only, - * both on the left and right of plot, or crossing a user defined Y-axis - * TODO: marks at whole numbers (-10, 10, 20, 30 ...) no matter where the plot begins (-3, 4.7, etc.) - */ - function DrawYTicks() - { - // Sets the line style for IMG_COLOR_STYLED lines (grid) - if ($this->dashed_grid) { - $this->SetDashedStyle($this->ndx_light_grid_color); - $style = IMG_COLOR_STYLED; - } else { - $style = $this->ndx_light_grid_color; - } - - // maxy is always > miny so delta_y is always positive - if ($this->y_tick_inc) { - $delta_y = $this->y_tick_inc; - } elseif ($this->num_y_ticks) { - $delta_y = ($this->plot_max_y - $this->plot_min_y) / $this->num_y_ticks; - } else { - $delta_y = ($this->plot_max_y - $this->plot_min_y) / 10 ; - } - - // NOTE: When working with floats, because of approximations when adding $delta_y, - // $y_tmp never equals $y_end at the for loop, so one spurious line would get drawn where - // not for the substraction to $y_end here. - $y_tmp = (double)$this->plot_min_y; - $y_end = (double)$this->plot_max_y - ($delta_y/2); - - if ($this->skip_bottom_tick) - $y_tmp += $delta_y; - - if ($this->skip_top_tick) - $y_end -= $delta_y; - - for (;$y_tmp < $y_end; $y_tmp += $delta_y) { - $ylab = $this->FormatLabel('y', $y_tmp); - $y_pixels = $this->ytr($y_tmp); - - // Horizontal grid line - if ($this->draw_y_grid) { - ImageLine($this->img, $this->plot_area[0]+1, $y_pixels, $this->plot_area[2]-1, $y_pixels, $style); - } - - // Draw ticks - $this->DrawYTick($ylab, $y_pixels); - } - return TRUE; - } // function DrawYTicks - - - /*! - * Draws Grid, Ticks and Tick Labels along X-Axis - * Ticks and tick labels can be down of plot only, up of plot only, - * both on up and down of plot, or crossing a user defined X-axis - * - * \note Original vertical code submitted by Marlin Viss - */ - function DrawXTicks() - { - // Sets the line style for IMG_COLOR_STYLED lines (grid) - if ($this->dashed_grid) { - $this->SetDashedStyle($this->ndx_light_grid_color); - $style = IMG_COLOR_STYLED; - } else { - $style = $this->ndx_light_grid_color; - } - - // Calculate x increment between ticks - if ($this->x_tick_inc) { - $delta_x = $this->x_tick_inc; - } elseif ($this->num_x_ticks) { - $delta_x = ($this->plot_max_x - $this->plot_min_x) / $this->num_x_ticks; - } else { - $delta_x =($this->plot_max_x - $this->plot_min_x) / 10 ; - } - - // NOTE: When working with decimals, because of approximations when adding $delta_x, - // $x_tmp never equals $x_end at the for loop, so one spurious line would get drawn where - // not for the substraction to $x_end here. - $x_tmp = (double)$this->plot_min_x; - $x_end = (double)$this->plot_max_x - ($delta_x/2); - - // Should the leftmost tick be drawn? - if ($this->skip_left_tick) - $x_tmp += $delta_x; - - // And the rightmost? - if (! $this->skip_right_tick) - $x_end += $delta_x; - - for (;$x_tmp < $x_end; $x_tmp += $delta_x) { - $xlab = $this->FormatLabel('x', $x_tmp); - $x_pixels = $this->xtr($x_tmp); - - // Vertical grid lines - if ($this->draw_x_grid) { - ImageLine($this->img, $x_pixels, $this->plot_area[1], $x_pixels, $this->plot_area[3], $style); - } - - // Tick on X Axis - if ($this->x_tick_pos == 'xaxis') { - - ImageLine($this->img, $x_pixels, $this->x_axis_y_pixels - $this->x_tick_cross, - $x_pixels, $this->x_axis_y_pixels + $this->x_tick_length, $this->ndx_tick_color); - } - - // Label on X axis - if ($this->x_tick_label_pos == 'xaxis') { - $this->DrawText($this->x_label_font, $this->x_label_angle, $x_pixels, - $this->x_axis_y_pixels + $this->x_tick_length*1.5, $this->ndx_text_color, - $xlab, 'center', 'bottom'); - } - - // Top of the plot area tick - if ($this->x_tick_pos == 'plotup' || $this->x_tick_pos == 'both') { - ImageLine($this->img, $x_pixels, $this->plot_area[1] - $this->x_tick_length, - $x_pixels, $this->plot_area[1] + $this->x_tick_cross, $this->ndx_tick_color); - } - // Bottom of the plot area tick - if ($this->x_tick_pos == 'plotdown' || $this->x_tick_pos == 'both') { - ImageLine($this->img, $x_pixels, $this->plot_area[3] + $this->x_tick_length, - $x_pixels, $this->plot_area[3] - $this->x_tick_cross, $this->ndx_tick_color); - } - - // Top of the plot area tick label - if ($this->x_tick_label_pos == 'plotup' || $this->x_tick_label_pos == 'both') { - $this->DrawText($this->x_label_font, $this->x_label_angle, $x_pixels, - $this->plot_area[1] - $this->x_tick_length*1.5, $this->ndx_text_color, - $xlab, 'center', 'top'); - } - - // Bottom of the plot area tick label - if ($this->x_tick_label_pos == 'plotdown' || $this->x_tick_label_pos == 'both') { - $this->DrawText($this->x_label_font, $this->x_label_angle, $x_pixels, - $this->plot_area[3] + $this->x_tick_length*1.5, $this->ndx_text_color, - $xlab, 'center', 'bottom'); - } - } - return; - } // function DrawXTicks - - - /*! - * - */ - function DrawPlotBorder() - { - switch ($this->plot_border_type) { - case 'left': // for past compatibility - case 'plotleft': - ImageLine($this->img, $this->plot_area[0], $this->ytr($this->plot_min_y), - $this->plot_area[0], $this->ytr($this->plot_max_y), $this->ndx_grid_color); - break; - case 'right': - case 'plotright': - ImageLine($this->img, $this->plot_area[2], $this->ytr($this->plot_min_y), - $this->plot_area[2], $this->ytr($this->plot_max_y), $this->ndx_grid_color); - break; - case 'both': - case 'sides': - ImageLine($this->img, $this->plot_area[0], $this->ytr($this->plot_min_y), - $this->plot_area[0], $this->ytr($this->plot_max_y), $this->ndx_grid_color); - ImageLine($this->img, $this->plot_area[2], $this->ytr($this->plot_min_y), - $this->plot_area[2], $this->ytr($this->plot_max_y), $this->ndx_grid_color); - break; - case 'none': - //Draw No Border - break; - case 'full': - default: - ImageRectangle($this->img, $this->plot_area[0], $this->ytr($this->plot_min_y), - $this->plot_area[2], $this->ytr($this->plot_max_y), $this->ndx_grid_color); - break; - } - return TRUE; - } - - - /*! - * Draws the data label associated with a point in the plot. - * This is different from x_labels drawn by DrawXTicks() and care - * should be taken not to draw both, as they'd probably overlap. - * Calling of this function in DrawLines(), etc is decided after x_data_label_pos value. - * Leave the last parameter out, to avoid the drawing of vertical lines, no matter - * what the setting is (for plots that need it, like DrawSquared()) - */ - function DrawXDataLabel($xlab, $xpos, $row=FALSE) - { - // FIXME!! not working... - if (($this->_x_label_cnt++ % $this->x_label_inc) != 0) - return; - - $xlab = $this->FormatLabel('x', $xlab); - - // Labels below the plot area - if ($this->x_data_label_pos == 'plotdown' || $this->x_data_label_pos == 'both') - $this->DrawText($this->x_label_font, $this->x_label_angle, $xpos, - $this->plot_area[3] + $this->x_tick_length, - $this->ndx_text_color, $xlab, 'center', 'bottom'); - - // Labels above the plot area - if ($this->x_data_label_pos == 'plotup' || $this->x_data_label_pos == 'both') - $this->DrawText($this->x_label_font, $this->x_label_angle, $xpos, - $this->plot_area[1] - $this->x_tick_length , - $this->ndx_text_color, $xlab, 'center', 'top'); - - if ($row && $this->draw_x_data_label_lines) - $this->DrawXDataLine($xpos, $row); - } - - /*! - * Draws Vertical lines from data points up and down. - * Which lines are drawn depends on the value of x_data_label_pos, - * and whether this is at all done or not, on draw_x_data_label_lines - * - * \param xpos int position in pixels of the line. - * \param row int index of the data row being drawn. - */ - function DrawXDataLine($xpos, $row) - { - // Sets the line style for IMG_COLOR_STYLED lines (grid) - if($this->dashed_grid) { - $this->SetDashedStyle($this->ndx_light_grid_color); - $style = IMG_COLOR_STYLED; - } else { - $style = $this->ndx_light_grid_color; - } - - // Lines from the bottom up - if ($this->x_data_label_pos == 'both') { - ImageLine($this->img, $xpos, $this->plot_area[3], $xpos, $this->plot_area[1], $style); - } - // Lines coming from the bottom of the plot - else if ($this->x_data_label_pos == 'plotdown') { - // See FindDataLimits() to see why 'MAXY' index. - $ypos = $this->ytr($this->data[$row][MAXY]); - ImageLine($this->img, $xpos, $ypos, $xpos, $this->plot_area[3], $style); - } - // Lines coming from the top of the plot - else if ($this->x_data_label_pos == 'plotup') { - // See FindDataLimits() to see why 'MINY' index. - $ypos = $this->ytr($this->data[$row][MINY]); - ImageLine($this->img, $xpos, $this->plot_area[1], $xpos, $ypos, $style); - } - } - -/* - function DrawPlotLabel($xlab, $xpos, $ypos) - { - $this->DrawText($this->x_label_font, $this->x_label_angle, $xpos, $this -*/ - - /*! - * Draws the graph legend - * - * \note Base code submitted by Marlin Viss - * FIXME: maximum label length should be calculated more accurately for TT fonts - * Performing a BBox calculation for every legend element, for example. - */ - function DrawLegend($which_x1, $which_y1, $which_boxtype) - { - // Find maximum legend label length - $max_len = 0; - foreach ($this->legend as $leg) { - $len = strlen($leg); - $max_len = ($len > $max_len) ? $len : $max_len; - } - $max_len += 5; // Leave room for the boxes and margins - - /////// Calculate legend labels sizes: FIXME - dirty hack - FIXME - // TTF: - if ($this->use_ttf) { - $size = $this->TTFBBoxSize($this->legend_font['size'], 0, - $this->legend_font['font'], '_'); - $char_w = $size[0]; - - $size = $this->TTFBBoxSize($this->legend_font['size'], 0, - $this->legend_font['font'], '|'); - $char_h = $size[1]; - } - // Fixed fonts: - else { - $char_w = $this->legend_font['width']; - $char_h = $this->legend_font['height']; - } - - $v_margin = $char_h/2; // Between vertical borders and labels - $dot_height = $char_h + $this->line_spacing; // Height of the small colored boxes - $width = $char_w * $max_len; - - //////// Calculate box size - // upper Left - if ( (! $which_x1) || (! $which_y1) ) { - $box_start_x = $this->plot_area[2] - $width; - $box_start_y = $this->plot_area[1] + 5; - } else { - $box_start_x = $which_x1; - $box_start_y = $which_y1; - } - - // Lower right corner - $box_end_y = $box_start_y + $dot_height*(count($this->legend)) + 2*$v_margin; - $box_end_x = $box_start_x + $width - 5; - - - // Draw outer box - ImageFilledRectangle($this->img, $box_start_x, $box_start_y, $box_end_x, $box_end_y, $this->ndx_bg_color); - ImageRectangle($this->img, $box_start_x, $box_start_y, $box_end_x, $box_end_y, $this->ndx_grid_color); - - $color_index = 0; - $max_color_index = count($this->ndx_data_colors) - 1; - - $dot_left_x = $box_end_x - $char_w * 2; - $dot_right_x = $box_end_x - $char_w; - $y_pos = $box_start_y + $v_margin; - - foreach ($this->legend as $leg) { - // Text right aligned to the little box - $this->DrawText($this->legend_font, 0, $dot_left_x - $char_w, $y_pos, - $this->ndx_text_color, $leg, 'right'); - // Draw a box in the data color - ImageFilledRectangle($this->img, $dot_left_x, $y_pos + 1, $dot_right_x, - $y_pos + $dot_height-1, $this->ndx_data_colors[$color_index]); - // Draw a rectangle around the box - ImageRectangle($this->img, $dot_left_x, $y_pos + 1, $dot_right_x, - $y_pos + $dot_height-1, $this->ndx_text_color); - - $y_pos += $char_h + $this->line_spacing; - - $color_index++; - if ($color_index > $max_color_index) - $color_index = 0; - } - } // Function DrawLegend() - - - /*! - * TODO Draws a legend over (or below) an axis of the plot. - */ - function DrawAxisLegend() - { - // Calculate available room - // Calculate length of all items (boxes included) - // Calculate number of lines and room it would take. FIXME: this should be known in CalcMargins() - // Draw. - } - -///////////////////////////////////////////// -//////////////////// PLOT DRAWING -///////////////////////////////////////////// - - - /*! - * Draws a pie chart. Data has to be 'text-data' type. - * - * This can work in two ways: the classical, with a column for each sector - * (computes the column totals and draws the pie with that) - * OR - * Takes each row as a sector and uses it's first value. This has the added - * advantage of using the labels provided, which is not the case with the - * former method. This might prove useful for pie charts from GROUP BY sql queries - */ - function DrawPieChart() - { - $xpos = $this->plot_area[0] + $this->plot_area_width/2; - $ypos = $this->plot_area[1] + $this->plot_area_height/2; - $diameter = min($this->plot_area_width, $this->plot_area_height); - $radius = $diameter/2; - - // Get sum of each column? One pie slice per column - if ($this->data_type === 'text-data') { - for ($i = 0; $i < $this->num_data_rows; $i++) { - for ($j = 1; $j < $this->num_recs[$i]; $j++) { // Label ($row[0]) unused in these pie charts - @ $sumarr[$j] += abs($this->data[$i][$j]); // NOTE! sum > 0 to make pie charts - } - } - } - // Or only one column per row, one pie slice per row? - else if ($this->data_type == 'text-data-single') { - for ($i = 0; $i < $this->num_data_rows; $i++) { - $legend[$i] = $this->data[$i][0]; // Set the legend to column labels - $sumarr[$i] = $this->data[$i][1]; - } - } - else if ($this->data_type == 'data-data') { - for ($i = 0; $i < $this->num_data_rows; $i++) { - for ($j = 2; $j < $this->num_recs[$i]; $j++) { - @ $sumarr[$j] += abs($this->data[$i][$j]); - } - } - } - else { - $this->DrawError("DrawPieChart(): Data type '$this->data_type' not supported."); - return FALSE; - } - - $total = array_sum($sumarr); - - if ($total == 0) { - $this->DrawError('DrawPieChart(): Empty data set'); - return FALSE; - } - - if ($this->shading) { - $diam2 = $diameter / 2; - } else { - $diam2 = $diameter; - } - $max_data_colors = count ($this->data_colors); - - for ($h = $this->shading; $h >= 0; $h--) { - $color_index = 0; - $start_angle = 0; - $end_angle = 0; - foreach ($sumarr as $val) { - // For shaded pies: the last one (at the top of the "stack") has a brighter color: - if ($h == 0) - $slicecol = $this->ndx_data_colors[$color_index]; - else - $slicecol = $this->ndx_data_dark_colors[$color_index]; - - $label_txt = number_format(($val / $total * 100), $this->y_precision, '.', ', ') . '%'; - $val = 360 * ($val / $total); - - // NOTE that imagefilledarc measures angles CLOCKWISE (go figure why), - // so the pie chart would start clockwise from 3 o'clock, would it not be - // for the reversal of start and end angles in imagefilledarc() - $start_angle = $end_angle; - $end_angle += $val; - $mid_angle = deg2rad($end_angle - ($val / 2)); - - // Draw the slice - ImageFilledArc($this->img, $xpos, $ypos+$h, $diameter, $diam2, - 360-$end_angle, 360-$start_angle, - $slicecol, IMG_ARC_PIE); - - // Draw the labels only once - if ($h == 0) { - // Draw the outline - if (! $this->shading) - ImageFilledArc($this->img, $xpos, $ypos+$h, $diameter, $diam2, - 360-$end_angle, 360-$start_angle, - $this->ndx_grid_color, IMG_ARC_PIE | IMG_ARC_EDGED |IMG_ARC_NOFILL); - - - // The '* 1.2' trick is to get labels out of the pie chart so there are more - // chances they can be seen in small sectors. - $label_x = $xpos + ($diameter * 1.2 * cos($mid_angle)) * $this->label_scale_position; - $label_y = $ypos+$h - ($diam2 * 1.2 * sin($mid_angle)) * $this->label_scale_position; - - $this->DrawText($this->generic_font, 0, $label_x, $label_y, $this->ndx_grid_color, - $label_txt, 'center', 'center'); - } - $color_index++; - $color_index = $color_index % $max_data_colors; - } // end for - } // end for - } - - - /*! - * Supported data formats: data-data-error, text-data-error (doesn't exist yet) - * ( data comes in as array("title", x, y, error+, error-, y2, error2+, error2-, ...) ) - */ - function DrawDotsError() - { - $this->CheckOption($this->data_type, 'data-data-error', __FUNCTION__); - - for($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { - $record = 1; // Skip record #0 (title) - - // Do we have a value for X? - if ($this->data_type == 'data-data-error') - $x_now = $this->data[$row][$record++]; // Read it, advance record index - else - $x_now = 0.5 + $cnt++; // Place text-data at X = 0.5, 1.5, 2.5, etc... - - // Draw X Data labels? - if ($this->x_data_label_pos != 'none') - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels, $row); - - while ($record < $this->num_recs[$row]) { - // Y: - $y_now = $this->data[$row][$record]; - $this->DrawDot($x_now, $y_now, $record, $this->ndx_data_colors[$record++]); - - // Error + - $val = $this->data[$row][$record]; - $this->DrawYErrorBar($x_now, $y_now, $val, $this->error_bar_shape, - $this->ndx_error_bar_colors[$record++]); - // Error - - $val = $this->data[$row][$record]; - $this->DrawYErrorBar($x_now, $y_now, -$val, $this->error_bar_shape, - $this->ndx_error_bar_colors[$record++]); - } - } - } // function DrawDotsError() - - - /* - * Supported data types: - * - data-data ("title", x, y1, y2, y3, ...) - * - text-data ("title", y1, y2, y3, ...) - */ - function DrawDots() - { - $this->CheckOption($this->data_type, 'text-data, data-data', __FUNCTION__); - - for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { - $rec = 1; // Skip record #0 (data label) - - // Do we have a value for X? - if ($this->data_type == 'data-data') - $x_now = $this->data[$row][$rec++]; // Read it, advance record index - else - $x_now = 0.5 + $cnt++; // Place text-data at X = 0.5, 1.5, 2.5, etc... - - $x_now_pixels = $this->xtr($x_now); - - // Draw X Data labels? - if ($this->x_data_label_pos != 'none') - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels, $row); - - // Proceed with Y values - for($idx = 0;$rec < $this->num_recs[$row]; $rec++, $idx++) { - if (is_numeric($this->data[$row][$rec])) { // Allow for missing Y data - $this->DrawDot($x_now, $this->data[$row][$rec], - $rec, $this->ndx_data_colors[$idx]); - } - } - } - } //function DrawDots - - - /*! - * A clean, fast routine for when you just want charts like stock volume charts - */ - function DrawThinBarLines() - { - $this->CheckOption($this->data_type, 'text-data, data-data', __FUNCTION__); - - for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { - $rec = 1; // Skip record #0 (data label) - - // Do we have a value for X? - if ($this->data_type == 'data-data') - $x_now = $this->data[$row][$rec++]; // Read it, advance record index - else - $x_now = 0.5 + $cnt++; // Place text-data at X = 0.5, 1.5, 2.5, etc... - - $x_now_pixels = $this->xtr($x_now); - - // Draw X Data labels? - if ($this->x_data_label_pos != 'none') - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels); - - // Proceed with Y values - for($idx = 0;$rec < $this->num_recs[$row]; $rec++, $idx++) { - if (is_numeric($this->data[$row][$rec])) { // Allow for missing Y data - ImageSetThickness($this->img, $this->line_widths[$idx]); - // Draws a line from user defined x axis position up to ytr($val) - ImageLine($this->img, $x_now_pixels, $this->x_axis_y_pixels, $x_now_pixels, - $this->ytr($this->data[$row][$rec]), $this->ndx_data_colors[$idx]); - } - } - } - - ImageSetThickness($this->img, 1); - } //function DrawThinBarLines - - /*! - * - */ - function DrawYErrorBar($x_world, $y_world, $error_height, $error_bar_type, $color) - { - /* - // TODO: add a parameter to show datalabels next to error bars? - // something like this: - if ($this->x_data_label_pos == 'plot') { - $this->DrawText($this->error_font, 90, $x1, $y2, - $color, $label, 'center', 'top'); - */ - - $x1 = $this->xtr($x_world); - $y1 = $this->ytr($y_world); - $y2 = $this->ytr($y_world+$error_height) ; - - ImageSetThickness($this->img, $this->error_bar_line_width); - ImageLine($this->img, $x1, $y1 , $x1, $y2, $color); - - switch ($error_bar_type) { - case 'line': - break; - case 'tee': - ImageLine($this->img, $x1-$this->error_bar_size, $y2, $x1+$this->error_bar_size, $y2, $color); - break; - default: - ImageLine($this->img, $x1-$this->error_bar_size, $y2, $x1+$this->error_bar_size, $y2, $color); - break; - } - - ImageSetThickness($this->img, 1); - return TRUE; - } - - /*! - * Draws a styled dot. Uses world coordinates. - * Supported types: 'halfline', 'line', 'plus', 'cross', 'rect', 'circle', 'dot', - * 'diamond', 'triangle', 'trianglemid' - */ - function DrawDot($x_world, $y_world, $record, $color) - { - // TODO: optimize, avoid counting every time we are called. - $record = $record % count ($this->point_shapes); - - $half_point = $this->point_sizes[$record] / 2; - - $x_mid = $this->xtr($x_world); - $y_mid = $this->ytr($y_world); - - $x1 = $x_mid - $half_point; - $x2 = $x_mid + $half_point; - $y1 = $y_mid - $half_point; - $y2 = $y_mid + $half_point; - - switch ($this->point_shapes[$record]) { - case 'halfline': - ImageLine($this->img, $x1, $y_mid, $x_mid, $y_mid, $color); - break; - case 'line': - ImageLine($this->img, $x1, $y_mid, $x2, $y_mid, $color); - break; - case 'plus': - ImageLine($this->img, $x1, $y_mid, $x2, $y_mid, $color); - ImageLine($this->img, $x_mid, $y1, $x_mid, $y2, $color); - break; - case 'cross': - ImageLine($this->img, $x1, $y1, $x2, $y2, $color); - ImageLine($this->img, $x1, $y2, $x2, $y1, $color); - break; - case 'rect': - ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $color); - break; - case 'circle': - ImageArc($this->img, $x_mid, $y_mid, $this->point_sizes[$record], $this->point_sizes[$record], 0, 360, $color); - break; - case 'dot': - ImageFilledArc($this->img, $x_mid, $y_mid, $this->point_sizes[$record], $this->point_sizes[$record], 0, 360, - $color, IMG_ARC_PIE); - break; - case 'diamond': - $arrpoints = array( $x1, $y_mid, $x_mid, $y1, $x2, $y_mid, $x_mid, $y2); - ImageFilledPolygon($this->img, $arrpoints, 4, $color); - break; - case 'triangle': - $arrpoints = array( $x1, $y_mid, $x2, $y_mid, $x_mid, $y2); - ImageFilledPolygon($this->img, $arrpoints, 3, $color); - break; - case 'trianglemid': - $arrpoints = array( $x1, $y1, $x2, $y1, $x_mid, $y_mid); - ImageFilledPolygon($this->img, $arrpoints, 3, $color); - break; - default: - ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $color); - break; - } - return TRUE; - } - - /*! - * Draw an area plot. Supported data types: - * 'text-data' - * 'data-data' - * NOTE: This function used to add first and last data values even on incomplete - * sets. That is not the behaviour now. As for missing data in between, - * there are two posibilities: replace the point with one on the X axis (previous - * way), or forget about it and use the preceding and following ones to draw the polygon. - * There is the possibility to use both, we just need to add the method to set - * it. Something like SetMissingDataBehaviour(), for example. - */ - function DrawArea() - { - $incomplete_data_defaults_to_x_axis = FALSE; // TODO: make this configurable - - for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { - $rec = 1; // Skip record #0 (data label) - - if ($this->data_type == 'data-data') // Do we have a value for X? - $x_now = $this->data[$row][$rec++]; // Read it, advance record index - else - $x_now = 0.5 + $cnt++; // Place text-data at X = 0.5, 1.5, 2.5, etc... - - $x_now_pixels = $this->xtr($x_now); // Absolute coordinates - - - if ($this->x_data_label_pos != 'none') // Draw X Data labels? - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels); - - // Proceed with Y values - // Create array of points for imagefilledpolygon() - for($idx = 0; $rec < $this->num_recs[$row]; $rec++, $idx++) { - if (is_numeric($this->data[$row][$rec])) { // Allow for missing Y data - $y_now_pixels = $this->ytr($this->data[$row][$rec]); - - $posarr[$idx][] = $x_now_pixels; - $posarr[$idx][] = $y_now_pixels; - - $num_points[$idx] = isset($num_points[$idx]) ? $num_points[$idx]+1 : 1; - } - // If there's missing data... - else { - if (isset ($incomplete_data_defaults_to_x_axis)) { - $posarr[$idx][] = $x_now_pixels; - $posarr[$idx][] = $this->x_axis_y_pixels; - $num_points[$idx] = isset($num_points[$idx]) ? $num_points[$idx]+1 : 1; - } - } - } - } // end for - - $end = count($posarr); - for ($i = 0; $i < $end; $i++) { - // Prepend initial points. X = first point's X, Y = x_axis_y_pixels - $x = $posarr[$i][0]; - array_unshift($posarr[$i], $x, $this->x_axis_y_pixels); - - // Append final points. X = last point's X, Y = x_axis_y_pixels - $x = $posarr[$i][count($posarr[$i])-2]; - array_push($posarr[$i], $x, $this->x_axis_y_pixels); - - $num_points[$i] += 2; - - // Draw the poligon - ImageFilledPolygon($this->img, $posarr[$i], $num_points[$i], $this->ndx_data_colors[$i]); - } - - } // function DrawArea() - - - /*! - * Draw Lines. Supported data-types: - * 'data-data', - * 'text-data' - * NOTE: Please see the note regarding incomplete data sets on DrawArea() - */ - function DrawLines() - { - // This will tell us if lines have already begun to be drawn. - // It is an array to keep separate information for every line, with a single - // variable we would sometimes get "undefined offset" errors and no plot... - $start_lines = array_fill(0, $this->records_per_group, FALSE); - - if ($this->data_type == 'text-data') { - $lastx[0] = $this->xtr(0); - $lasty[0] = $this->xtr(0); - } - - for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { - $record = 1; // Skip record #0 (data label) - - if ($this->data_type == 'data-data') // Do we have a value for X? - $x_now = $this->data[$row][$record++]; // Read it, advance record index - else - $x_now = 0.5 + $cnt++; // Place text-data at X = 0.5, 1.5, 2.5, etc... - - $x_now_pixels = $this->xtr($x_now); // Absolute coordinates - - if ($this->x_data_label_pos != 'none') // Draw X Data labels? - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels, $row); - - for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) { - if (is_numeric($this->data[$row][$record])) { //Allow for missing Y data - $y_now_pixels = $this->ytr($this->data[$row][$record]); - - if ($start_lines[$idx] == TRUE) { - // Set line width, revert it to normal at the end - ImageSetThickness($this->img, $this->line_widths[$idx]); - - if ($this->line_styles[$idx] == 'dashed') { - $this->SetDashedStyle($this->ndx_data_colors[$idx]); - ImageLine($this->img, $x_now_pixels, $y_now_pixels, $lastx[$idx], $lasty[$idx], - IMG_COLOR_STYLED); - } else { - ImageLine($this->img, $x_now_pixels, $y_now_pixels, $lastx[$idx], $lasty[$idx], - $this->ndx_data_colors[$idx]); - } - - } - $lasty[$idx] = $y_now_pixels; - $lastx[$idx] = $x_now_pixels; - $start_lines[$idx] = TRUE; - } - // Y data missing... should we leave a blank or not? - else if ($this->draw_broken_lines) { - $start_lines[$idx] = FALSE; - } - } // end for - } // end for - - ImageSetThickness($this->img, 1); // Revert to original state for lines to be drawn later. - } // function DrawLines() - - - /*! - * Draw lines with error bars - data comes in as - * array("label", x, y, error+, error-, y2, error2+, error2-, ...); - */ - function DrawLinesError() - { - if ($this->data_type != 'data-data-error') { - $this->DrawError("DrawLinesError(): Data type '$this->data_type' not supported."); - return FALSE; - } - - $start_lines = array_fill(0, $this->records_per_group, FALSE); - - for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { - $record = 1; // Skip record #0 (data label) - - $x_now = $this->data[$row][$record++]; // Read X value, advance record index - - $x_now_pixels = $this->xtr($x_now); // Absolute coordinates. - - - if ($this->x_data_label_pos != 'none') // Draw X Data labels? - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels, $row); - - // Now go for Y, E+, E- - for ($idx = 0; $record < $this->num_recs[$row]; $idx++) { - // Y - $y_now = $this->data[$row][$record++]; - $y_now_pixels = $this->ytr($y_now); - - if ($start_lines[$idx] == TRUE) { - ImageSetThickness($this->img, $this->line_widths[$idx]); - - if ($this->line_styles[$idx] == 'dashed') { - $this->SetDashedStyle($this->ndx_data_colors[$idx]); - ImageLine($this->img, $x_now_pixels, $y_now_pixels, $lastx[$idx], $lasty[$idx], - IMG_COLOR_STYLED); - } else { - ImageLine($this->img, $x_now_pixels, $y_now_pixels, $lastx[$idx], $lasty[$idx], - $this->ndx_data_colors[$idx]); - } - } - - // Error+ - $val = $this->data[$row][$record++]; - $this->DrawYErrorBar($x_now, $y_now, $val, $this->error_bar_shape, - $this->ndx_error_bar_colors[$idx]); - - // Error- - $val = $this->data[$row][$record++]; - $this->DrawYErrorBar($x_now, $y_now, -$val, $this->error_bar_shape, - $this->ndx_error_bar_colors[$idx]); - - // Update indexes: - $start_lines[$idx] = TRUE; // Tells us if we already drew the first column of points, - // thus having $lastx and $lasty ready for the next column. - $lastx[$idx] = $x_now_pixels; - $lasty[$idx] = $y_now_pixels; - } // end while - } // end for - - ImageSetThickness($this->img, 1); // Revert to original state for lines to be drawn later. - } // function DrawLinesError() - - - - /*! - * This is a mere copy of DrawLines() with one more line drawn for each point - */ - function DrawSquared() - { - // This will tell us if lines have already begun to be drawn. - // It is an array to keep separate information for every line, for with a single - // variable we could sometimes get "undefined offset" errors and no plot... - $start_lines = array_fill(0, $this->records_per_group, FALSE); - - if ($this->data_type == 'text-data') { - $lastx[0] = $this->xtr(0); - $lasty[0] = $this->xtr(0); - } - - for ($row = 0, $cnt = 0; $row < $this->num_data_rows; $row++) { - $record = 1; // Skip record #0 (data label) - - if ($this->data_type == 'data-data') // Do we have a value for X? - $x_now = $this->data[$row][$record++]; // Read it, advance record index - else - $x_now = 0.5 + $cnt++; // Place text-data at X = 0.5, 1.5, 2.5, etc... - - $x_now_pixels = $this->xtr($x_now); // Absolute coordinates - - if ($this->x_data_label_pos != 'none') // Draw X Data labels? - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels); // notice there is no last param. - - // Draw Lines - for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) { - if (is_numeric($this->data[$row][$record])) { // Allow for missing Y data - $y_now_pixels = $this->ytr($this->data[$row][$record]); - - if ($start_lines[$idx] == TRUE) { - // Set line width, revert it to normal at the end - ImageSetThickness($this->img, $this->line_widths[$idx]); - - if ($this->line_styles[$idx] == 'dashed') { - $this->SetDashedStyle($this->ndx_data_colors[$idx]); - ImageLine($this->img, $lastx[$idx], $lasty[$idx], $x_now_pixels, $lasty[$idx], - IMG_COLOR_STYLED); - ImageLine($this->img, $x_now_pixels, $lasty[$idx], $x_now_pixels, $y_now_pixels, - IMG_COLOR_STYLED); - } else { - ImageLine($this->img, $lastx[$idx], $lasty[$idx], $x_now_pixels, $lasty[$idx], - $this->ndx_data_colors[$idx]); - ImageLine($this->img, $x_now_pixels, $lasty[$idx], $x_now_pixels, $y_now_pixels, - $this->ndx_data_colors[$idx]); - } - } - $lastx[$idx] = $x_now_pixels; - $lasty[$idx] = $y_now_pixels; - $start_lines[$idx] = TRUE; - } - // Y data missing... should we leave a blank or not? - else if ($this->draw_broken_lines) { - $start_lines[$idx] = FALSE; - } - } - } // end while - - ImageSetThickness($this->img, 1); - } // function DrawSquared() - - - /*! - * Data comes in as array("title", x, y, y2, y3, ...) - */ - function DrawBars() - { - if ($this->data_type != 'text-data') { - $this->DrawError('DrawBars(): Bar plots must be text-data: use function SetDataType("text-data")'); - return FALSE; - } - - for ($row = 0; $row < $this->num_data_rows; $row++) { - $record = 1; // Skip record #0 (data label) - - $x_now_pixels = $this->xtr(0.5 + $row); // Place text-data at X = 0.5, 1.5, 2.5, etc... - - if ($this->x_data_label_pos != 'none') // Draw X Data labels? TODO:labels on top of bars. - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels); - - // Draw the bar - for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) { - if (is_numeric($this->data[$row][$record])) { // Allow for missing Y data - $x1 = $x_now_pixels - $this->data_group_space + ($idx * $this->record_bar_width); - $x2 = $x1 + ($this->bar_width_adjust * $this->record_bar_width); - - if ($this->data[$row][$record] < $this->x_axis_position) { - $y1 = $this->x_axis_y_pixels; - $y2 = $this->ytr($this->data[$row][$record]); - } else { - $y1 = $this->ytr($this->data[$row][$record]); - $y2 = $this->x_axis_y_pixels; - } - - if ($this->shading) { // Draw the shade? - ImageFilledPolygon($this->img, array($x1, $y1, - $x1 + $this->shading, $y1 - $this->shading, - $x2 + $this->shading, $y1 - $this->shading, - $x2 + $this->shading, $y2 - $this->shading, - $x2, $y2, - $x2, $y1), - 6, $this->ndx_data_dark_colors[$idx]); - } - // Or draw a border? - else { - ImageRectangle($this->img, $x1, $y1, $x2,$y2, $this->ndx_data_border_colors[$idx]); - } - // Draw the bar - ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $this->ndx_data_colors[$idx]); - } - } // end for - } // end for - } //function DrawBars - - - /*! - * Data comes in as array("title", x, y, y2, y3, ...) - * \note Original stacked bars idea by Laurent Kruk < lolok at users.sourceforge.net > - */ - function DrawStackedBars() - { - if ($this->data_type != 'text-data') { - $this->DrawError('DrawStackedBars(): Bar plots must be text-data: use SetDataType("text-data")'); - return FALSE; - } - - for ($row = 0; $row < $this->num_data_rows; $row++) { - $record = 1; // Skip record #0 (data label) - - $x_now_pixels = $this->xtr(0.5 + $row); // Place text-data at X = 0.5, 1.5, 2.5, etc... - - if ($this->x_data_label_pos != 'none') // Draw X Data labels? - $this->DrawXDataLabel($this->data[$row][0], $x_now_pixels); - - // Draw the bars - $oldv = 0; - for ($idx = 0; $record < $this->num_recs[$row]; $record++, $idx++) { - if (is_numeric($this->data[$row][$record])) { // Allow for missing Y data - $x1 = $x_now_pixels - $this->data_group_space; - $x2 = $x_now_pixels + $this->data_group_space; - - $y1 = $this->ytr(abs($this->data[$row][$record]) + $oldv); - $y2 = $this->ytr($this->x_axis_position + $oldv); - $oldv += abs($this->data[$row][$record]); - - if ($this->shading) { // Draw the shade? - ImageFilledPolygon($this->img, array($x1, $y1, - $x1 + $this->shading, $y1 - $this->shading, - $x2 + $this->shading, $y1 - $this->shading, - $x2 + $this->shading, $y2 - $this->shading, - $x2, $y2, - $x2, $y1), - 6, $this->ndx_data_dark_colors[$idx]); - } - // Or draw a border? - else { - ImageRectangle($this->img, $x1, $y1, $x2,$y2, $this->ndx_data_border_colors[$idx]); - } - // Draw the bar - ImageFilledRectangle($this->img, $x1, $y1, $x2, $y2, $this->ndx_data_colors[$idx]); - - } - } // end for - } // end for - } //function DrawStackedBars - - - /*! - * - */ - function DrawGraph() - { - if (! $this->img) { - $this->DrawError('DrawGraph(): No image resource allocated'); - return FALSE; - } - - if (! is_array($this->data)) { - $this->DrawError("DrawGraph(): No array of data in \$data"); - return FALSE; - } - - if (! isset($this->data_limits_done)) - $this->FindDataLimits(); // Get maxima and minima for scaling - - if ($this->total_records == 0) { // Check for empty data sets - $this->DrawError('Empty data set'); - return FALSE; - } - - $this->CalcMargins(); // Calculate margins - - if (! isset($this->plot_area_width)) // Set plot area pixel values (plot_area[]) - $this->SetPlotAreaPixels(); - - if (! isset($this->plot_max_y)) // Set plot area world values (plot_max_x, etc.) - $this->SetPlotAreaWorld(); - - if ($this->plot_type == 'bars' || $this->plot_type == 'stackedbars') // Calculate bar widths - $this->CalcBarWidths(); -/* FIXME!! this sort of thing should not be done without user's consent - if ($this->x_data_label_pos != 'none') { // Default: do not draw tick stuff if - $this->x_tick_label_pos = 'none'; // there are data labels. - $this->x_tick_pos = 'none'; - } -*/ - $this->PadArrays(); // Pad color and style arrays to fit records per group. - - $this->DrawBackground(); - - $this->DrawImageBorder(); - - $this->DrawPlotAreaBackground(); - - $this->DrawTitle(); - $this->DrawXTitle(); - $this->DrawYTitle(); - - // Pie charts are drawn differently, handle them first - if ($this->plot_type == 'pie') { - // Pie charts can maximize image space usage. - $this->SetPlotAreaPixels($this->safe_margin, $this->title_height, - $this->image_width - $this->safe_margin, - $this->image_height - $this->safe_margin); - $this->DrawPieChart(); - - if ($this->legend) - $this->DrawLegend($this->legend_x_pos, $this->legend_y_pos, ''); - - if ($this->print_image) - $this->PrintImage(); - - return; - } - - ////// All other chart types: - - if (! $this->grid_at_foreground) { // Usually one wants grids to go back, but... - $this->DrawYAxis(); // Y axis must be drawn before X axis (see DrawYAxis()) - $this->DrawXAxis(); - } - - switch ($this->plot_type) { - case 'thinbarline': - $this->DrawThinBarLines(); - break; - case 'area': - $this->DrawArea(); - break; - case 'squared': - $this->DrawSquared(); - break; - case 'lines': - if ( $this->data_type == 'data-data-error') { - $this->DrawLinesError(); - } else { - $this->DrawLines(); - } - break; - case 'linepoints': // FIXME !!! DrawXDataLabel gets called in DrawLines() and DrawDots() - if ( $this->data_type == 'data-data-error') { - $this->DrawLinesError(); - $this->DrawDotsError(); - } else { - $this->DrawLines(); - $this->DrawDots(); - } - break; - case 'points'; - if ( $this->data_type == 'data-data-error') { - $this->DrawDotsError(); - } else { - $this->DrawDots(); - } - break; - case 'stackedbars': - $this->DrawStackedBars(); - break; - case 'bars': - $this->DrawBars(); - break; - default: - $this->plot_type = 'bars'; // Set it if it wasn't already set. - $this->DrawBars(); - break; - } // end switch - - if ($this->grid_at_foreground) { // Usually one wants grids to go back, but... - $this->DrawYAxis(); // Y axis must be drawn before X axis (see DrawYAxis()) - $this->DrawXAxis(); - } - - $this->DrawPlotBorder(); - - if ($this->legend) - $this->DrawLegend($this->legend_x_pos, $this->legend_y_pos, ''); - - if ($this->print_image) - $this->PrintImage(); - - } //function DrawGraph() - -///////////////////////////////////////////// -////////////////// DEPRECATED METHODS -///////////////////////////////////////////// - - /*! - * Deprecated, use SetYTickPos() - */ - function SetDrawVertTicks($which_dvt) - { - if ($which_dvt != 1) - $this->SetYTickPos('none'); - return TRUE; - } - - /*! - * Deprecated, use SetXTickPos() - */ - function SetDrawHorizTicks($which_dht) - { - if ($which_dht != 1) - $this->SetXTickPos('none'); - return TRUE; - } - - /*! - * \deprecated Use SetNumXTicks() - */ - function SetNumHorizTicks($n) - { - return $this->SetNumXTicks($n); - } - - /*! - * \deprecated Use SetNumYTicks() - */ - function SetNumVertTicks($n) - { - return $this->SetNumYTicks($n); - } - - /*! - * \deprecated Use SetXTickIncrement() - */ - function SetHorizTickIncrement($inc) - { - return $this->SetXTickIncrement($inc); - } - - - /*! - * \deprecated Use SetYTickIncrement() - */ - function SetVertTickIncrement($inc) - { - return $this->SetYTickIncrement($inc); - } - - /*! - * \deprecated Use SetYTickPos() - */ - function SetVertTickPosition($which_tp) - { - return $this->SetYTickPos($which_tp); - } - - /*! - * \deprecated Use SetXTickPos() - */ - function SetHorizTickPosition($which_tp) - { - return $this->SetXTickPos($which_tp); - } - - /*! - * \deprecated Use SetFont() - */ - function SetTitleFontSize($which_size) - { - return $this->SetFont('title', $which_size); - } - - /*! - * \deprecated Use SetFont() - */ - function SetAxisFontSize($which_size) - { - $this->SetFont('x_label', $which_size); - $this->SetFont('y_label', $whic_size); - } - - /*! - * \deprecated Use SetFont() - */ - function SetSmallFontSize($which_size) - { - return $this->SetFont('generic', $which_size); - } - - /*! - * \deprecated Use SetFont() - */ - function SetXLabelFontSize($which_size) - { - return $this->SetFont('x_title', $which_size); - } - - /*! - * \deprecated Use SetFont() - */ - function SetYLabelFontSize($which_size) - { - return $this->SetFont('y_title', $which_size); - } - - /*! - * \deprecated Use SetXTitle() - */ - function SetXLabel($which_xlab) - { - return $this->SetXTitle($which_xlab); - } - - /*! - * \deprecated Use SetYTitle() - */ - function SetYLabel($which_ylab) - { - return $this->SetYTitle($which_ylab); - } - - /*! - * \deprecated This is now an Internal function - please set width and - * height via PHPlot() upon object construction - */ - function SetImageArea($which_iw, $which_ih) - { - $this->image_width = $which_iw; - $this->image_height = $which_ih; - - return TRUE; - } - - /*! - * \deprecated Use SetXTickLength() and SetYTickLength() instead. - */ - function SetTickLength($which_tl) - { - $this->SetXTickLength($which_tl); - $this->SetYTickLength($which_tl); - return TRUE; - } - - /*! - * \deprecated Use SetYLabelType() - */ - function SetYGridLabelType($which_yglt) - { - return $this->SetYLabelType($which_yglt); - } - - /*! - * \deprecated Use SetXLabelType() - */ - function SetXGridLabelType($which_xglt) - { - return $this->SetXLabelType($which_xglt); - } - /*! - * \deprecated Use SetYTickLabelPos() - */ - function SetYGridLabelPos($which_yglp) - { - return $this->SetYTickLabelPos($which_yglp); - } - /*! - * \deprecated Use SetXTickLabelPos() - */ - function SetXGridLabelPos($which_xglp) - { - return $this->SetXTickLabelPos($which_xglp); - } - - - /*! - * \deprecated Use SetXtitle() - */ - function SetXTitlePos($xpos) - { - $this->x_title_pos = $xpos; - return TRUE; - } - - /*! - * \deprecated Use SetYTitle() - */ - function SetYTitlePos($xpos) - { - $this->y_title_pos = $xpos; - return TRUE; - } - - /*! - * \deprecated Use DrawDots() - */ - function DrawDotSeries() - { - $this->DrawDots(); - } - - /*! - * \deprecated Use SetXLabelAngle() - */ - function SetXDataLabelAngle($which_xdla) - { - return $this->SetXLabelAngle($which_xdla); - } - - /*! - * Draw Labels (not grid labels) on X Axis, following data points. Default position is - * down of plot. Care must be taken not to draw these and x_tick_labels as they'd probably overlap. - * - * \deprecated Use SetXDataLabelPos() - */ - function SetDrawXDataLabels($which_dxdl) - { - if ($which_dxdl == '1' ) - $this->SetXDataLabelPos('plotdown'); - else - $this->SetXDataLabelPos('none'); - } - - /*! - * \deprecated This method was intended to improve performance by being specially - * written for 'data-data'. However, the improvement didn't pay. Use DrawLines() instead - */ - function DrawLineSeries() - { - return $this->DrawLines(); - } - - /*! - * \deprecated Calculates maximum X-Axis label height. Now inside CalcMargins() - */ - function CalcXHeights() - { - // TTF - if ($this->use_ttf) { - $xstr = str_repeat('.', $this->max_t); - $size = $this->TTFBBoxSize($this->x_label_font['size'], $this->x_label_angle, - $this->x_label_font['font'], $xstr); - $this->x_tick_label_height = $size[1]; - } - // Fixed font - else { // For Non-TTF fonts we can have only angles 0 or 90 - if ($this->x_label_angle == 90) - $this->x_tick_label_height = $this->max_t * $this->x_label_font['width']; - else - $this->x_tick_label_height = $this->x_label_font['height']; - } - - return TRUE; - } - - - /*! - * \deprecated Calculates Maximum Y-Axis tick label width. Now inside CalcMargins() - */ - function CalcYWidths() - { - //the "." is for space. It isn't actually printed - $ylab = number_format($this->max_y, $this->y_precision, '.', ', ') . $this->data_units_text . '.'; - - // TTF - if ($this->use_ttf) { - // Maximum Y tick label width - $size = $this->TTFBBoxSize($this->y_label_font['size'], 0, $this->y_label_font['font'], $ylab); - $this->y_tick_label_width = $size[0]; - - } - // Fixed font - else { - // Y axis title width - $this->y_tick_label_width = strlen($ylab) * $this->y_label_font['width']; - } - - return TRUE; - } - - /*! - * \deprecated Superfluous. - */ - function DrawLabels() - { - $this->DrawTitle(); - $this->DrawXTitle(); - $this->DrawYTitle(); - } - - /*! - * Set up the image resource 'img' - * \deprecated The constructor should init 'img' - */ - function InitImage() - { - $this->img = ImageCreate($this->image_width, $this->image_height); - - if (! $this->img) - $this->PrintError('InitImage(): Could not create image resource'); - return TRUE; - } - - /*! - * \deprecated - */ - function SetNewPlotAreaPixels($x1, $y1, $x2, $y2) - { - //Like in GD 0, 0 is upper left set via pixel Coordinates - $this->plot_area = array($x1, $y1, $x2, $y2); - $this->plot_area_width = $this->plot_area[2] - $this->plot_area[0]; - $this->plot_area_height = $this->plot_area[3] - $this->plot_area[1]; - $this->y_top_margin = $this->plot_area[1]; - - if (isset($this->plot_max_x)) - $this->CalcTranslation(); - - return TRUE; - } - - /*! - * \deprecated Use _SetRGBColor() - */ - function SetColor($which_color) - { - $this->SetRGBColor($which_color); - return TRUE; - } - - /* - * \deprecated Use SetLineWidths(). - */ - function SetLineWidth($which_lw) - { - - $this->SetLineWidths($which_lw); - - if (!$this->error_bar_line_width) { - $this->SetErrorBarLineWidth($which_lw); - } - return TRUE; - } - - /*! - * \deprecated - */ - function DrawDashedLine($x1, $y1, $x2, $y2 , $dash_length, $dash_space, $color) - { - if ($dash_length) - $dashes = array_fill(0, $dash_length, $color); - else - $dashes = array(); - if ($dash_space) - $spaces = array_fill(0, $dash_space, IMG_COLOR_TRANSPARENT); - else - $spaces = array(); - - $style = array_merge($dashes, $spaces); - ImageSetStyle($this->img, $style); - ImageLine($this->img, $x1, $y1, $x2, $y2, IMG_COLOR_STYLED); - } - - /*! - * \deprecated Selects an input file to be used as background for the whole graph. - * This resizes the graph to the image's size. - */ - function SetInputFile($which_input_file) - { - $size = GetImageSize($which_input_file); - $input_type = $size[2]; - - switch($input_type) { - case 1: - $im = @ ImageCreateFromGIF ($which_input_file); - if (!$im) { // See if it failed - $this->PrintError("Unable to open $which_input_file as a GIF"); - return FALSE; - } - break; - case 3: - $im = @ ImageCreateFromPNG ($which_input_file); - if (!$im) { // See if it failed - $this->PrintError("Unable to open $which_input_file as a PNG"); - return FALSE; - } - break; - case 2: - $im = @ ImageCreateFromJPEG ($which_input_file); - if (!$im) { // See if it failed - $this->PrintError("Unable to open $which_input_file as a JPG"); - return FALSE; - } - break; - default: - $this->PrintError('SetInputFile(): Please select gif, jpg, or png for image type!'); - return FALSE; - break; - } - - // Set Width and Height of Image - $this->image_width = $size[0]; - $this->image_height = $size[1]; - - // Deallocate any resources previously allocated - if ($this->img) - imagedestroy($this->img); - - $this->img = $im; - - return TRUE; - - } - - - /* - * \deprecated Use SetPointShapes(). - */ - function SetPointShape($which_pt) - { - $this->SetPointShapes($which_pt); - return TRUE; - } - - /* - * \deprecated Use SetPointSizes(). - */ - function SetPointSize($which_ps) - { - $this->SetPointSizes($which_ps); - return TRUE; - } -} // class PHPlot - - - -//////////////////////// - - -/*! - * Pads an array with another or with itself. - * \param arr array Original array (reference) - * \param size int Size of the resulting array. - * \param arr2 array If specified, array to use for padding. If unspecified, pad with $arr. - */ -function array_pad_array(&$arr, $size, $arr2=NULL) -{ - if (! is_array($arr2)) { - $arr2 = $arr; // copy the original array - } - while (count($arr) < $size) - $arr = array_merge_php4($arr, $arr2); // append until done -} - -/*! - * Fixes problem with array_merge() in PHP5. - * \note I simply copied this from a bug report. I am not running php5 yet, so - * I cannot reproduce it, which is why I trust the reporter. - */ -function array_merge_php4($array1,$array2) -{ - $return=array(); - - foreach(func_get_args() as $arg){ - if(!is_array($arg)){ - $arg=array($arg); - } - foreach($arg as $key=>$val){ - if(!is_int($key)){ - $return[$key]=$val; - }else{ - $return[]=$val; - } - } - } - return $return; - } - - - - -?> diff --git a/gui/bacula-web/external_packages/phplot/phplot_data.php b/gui/bacula-web/external_packages/phplot/phplot_data.php deleted file mode 100644 index 37351504c1..0000000000 --- a/gui/bacula-web/external_packages/phplot/phplot_data.php +++ /dev/null @@ -1,258 +0,0 @@ -img)) { - $this->PHPlot($which_width, $which_height, $which_output_file, $which_input_file); - } - } - - /*! - * Will scale all data rows - * Maybe later I will do a function that only scales some rows - * if $even is TRUE, data will be scaled with "even" factors. - * \note Original code by Thiemo Nagel - */ - function DoScaleData($even, $show_in_legend) - { - $offset = 0; // We use this not to read labels in text-data - - if ($this->data_type == 'text-data') { - $offset = 1; - } elseif ($this->data_type != 'data-data') { - $this->DrawError('wrong data type!!'); - return FALSE; - } - - // Determine maxima for each data row in array $max - // Put maximum of the maxima in $maxmax - $maxmax = 0; - for($i=0; $i < $this->num_data_rows; $i++) { - $rowsize = count($this->data[$i]); - for ($j=$offset; $j < $rowsize; $j++) { - if ($this->data[$i][$j] > @ $max[$j]) - $max[$j] = $this->data[$i][$j]; - if (@ $max[$j] > $maxmax) - $maxmax = $max[$j]; - } - } - - // determine amplification factor $amplify - $end = count($max) + $offset; - for ($i=$offset; $i < $end; $i++) { - if ($max[$i] == 0 || $max[$i] == $maxmax) { - $amplify[$i] = 1; // no divide by zero - } else { - if ($even) { - $amp = pow(10,round(log10($maxmax / $max[$i]))-1); - if ($amp * $max[$i] * 5 < $maxmax) { - $amp *= 5; - } elseif ($amp * $max[$i] * 2 < $maxmax) { - $amp *= 2; - } - } else { - $amp = $maxmax / $max[$i]; - $digits = floor(log10($amp)); - $amp = round($amp/pow(10,$digits-1))*pow(10,$digits-1); - } - $amplify[$i] = $amp; - } - if ($amplify[$i] != 1 && $show_in_legend) - @ $this->legend[$i] .= "*$amplify[$i]"; - } - - // Amplify data - // On my machine, running 1000 iterations over 1000 rows of 12 elements each, - // the for loops were 43.2% faster (MBD) - for ($i = 0; $i < $this->num_data_rows; $i++) { - $rowsize = count($this->data[$i]); - for ($j=$offset; $j < $rowsize; $j++) { - $this->data[$i][$j] *= $amplify[$j]; - } - } - - //Re-Scale Vertical Ticks if not already set - if ( ! $this->y_tick_increment) { - $this->SetYTickIncrement() ; - } - - return TRUE; - } //function DoScaleData - - - /*! - * Computes a moving average of strength $interval for - * data row number $datarow, where 0 denotes the first - * row of y-data. - * - * \param int datarow Index of the row whereupon to make calculations - * \param int interval Number of elements to use in average ("strength") - * \param bool show Whether to tell about the moving average in the legend. - * \param string color Color for the line to be drawn. This color is darkened. - * Can be named or #RRGGBB. - * \param int width Width of the line to be drawn. - * - * \note Original idea by Theimo Nagel - */ - function DoMovingAverage($datarow, $interval, $show=TRUE, $color=NULL, $width=NULL) - { - $off = 1; // Skip record #0 (data label) - - $this->PadArrays(); - - if ($interval == 0) { - $this->DrawError('DoMovingAverage(): interval can\'t be 0'); - return FALSE; - } - - if ($datarow >= $this->records_per_group) { - $this->DrawError("DoMovingAverage(): Data row out of bounds ($datarow >= $this->records_per_group)"); - return FALSE; - } - - if ($this->data_type == 'text-data') { - // Ok. No need to set the offset to skip more records. - } elseif ($this->data_type == 'data-data') { - $off++; // first Y value at $data[][2] - } else { - $this->DrawError('DoMovingAverage(): wrong data type!!'); - return FALSE; - } - - // Set color: - if ($color) { - array_push($this->ndx_data_colors, $this->SetIndexDarkColor($color)); - } else { - array_push($this->ndx_data_colors, $this->SetIndexDarkColor($this->data_colors[$datarow])); - } - // Set line width: - if ($width) { - array_push($this->line_widths, $width); - } else { - array_push($this->line_widths, $this->line_widths[$datarow] * 2); - } - // Show in legend? - if ($show) { - $this->legend[$this->records_per_group-1] = "(MA[$datarow]:$interval)"; - } - - $datarow += $off; - for ($i = 0; $i < $this->num_data_rows; $i++) { - $storage[$i % $interval] = @ $this->data[$i][$datarow]; - $ma = array_sum($storage); - $ma /= count($storage); - array_push($this->data[$i], $ma); // Push the data onto the array - $this->num_recs[$i]++; // Tell the drawing functions it is there - } - $this->records_per_group++; -// $this->FindDataLimits(); - return TRUE; - } //function DoMovingAverage() - - - /** - * Computes an exponentially smoothed moving average. - * @param int perc "smoothing percentage" - * FIXME!!! I haven't checked this. - */ - function DoExponentialMovingAverage($datarow, $perc, $show_in_legend) - { - if ($this->data_type == 'text-data') { - $datarow++; - } elseif ($this->data_type != 'data-data') { - $this->DrawError('DoWeightedMovingAverage(): wrong data type!!'); - return FALSE; - } - - if ($show_in_legend) { - $this->legend[$datarow] .= " (MA: $interval)"; - } - - $storage[0] = $this->data[0][$datarow]; - for ($i=1;$i < $this->num_data_rows; $i++) { - $storage[$i] = @ $storage[$i-1] + $perc * ($this->data[$i][$datarow] - $storage[$i-1]); - $ma = array_sum($storage); - $ma /= count($storage); - $this->data[$i][$datarow] = $ma; - } - return TRUE; - } // function DoExponentialMovingAverage() - - - /*! - * Removes the DataSet of number $index - */ - function DoRemoveDataSet($index) - { - $offset = 1; - if ($this->data_type == 'data-data') { - $offset++; - } elseif ($this->data_type != 'text-data') { - $this->DrawError('wrong data type!!'); - return FALSE; - } - - $index += $offset; - foreach ($this->data as $key=>$val) { - foreach ($val as $key2=>$val2) { - if ($key2 >= $index) { - if (isset($this->data[$key][$key2+1])) { - $this->data[$key][$key2] = $this->data[$key][$key2+1]; - } else { - unset($this->data[$key][$key2]); - } - } - } - } - } // function DoRemoveDataSet - - - /*! - * Computes row x divided by row y, stores the result in row x - * and deletes row y - */ - function DoDivision($x,$y) - { - $offset = 1; - if ($this->data_type == 'data-data') { - $offset++; - } elseif ($this->data_type != 'text-data') { - $this->DrawError('wrong data type!!'); - return FALSE; - } - - $x += $offset; $y += $offset; - reset($this->data); - while (list($key, $val) = each($this->data)) { - if ($this->data[$key][$y] == 0) { - $this->data[$key][$x] = 0; - } else { - $this->data[$key][$x] /= $this->data[$key][$y]; - } - } - - $this->DoRemoveDataSet($y-$offset); - } // function DoDivision - -} // class PHPlot_Data extends PHPlot -?> diff --git a/gui/bacula-web/external_packages/phplot/rgb.inc.php b/gui/bacula-web/external_packages/phplot/rgb.inc.php deleted file mode 100644 index 3353e28e50..0000000000 --- a/gui/bacula-web/external_packages/phplot/rgb.inc.php +++ /dev/null @@ -1,744 +0,0 @@ - array(255, 250, 250), - "ghost white" => array(248, 248, 255), - "GhostWhite" => array(248, 248, 255), - "white smoke" => array(245, 245, 245), - "WhiteSmoke" => array(245, 245, 245), - "gainsboro" => array(220, 220, 220), - "floral white" => array(255, 250, 240), - "FloralWhite" => array(255, 250, 240), - "old lace" => array(253, 245, 230), - "OldLace" => array(253, 245, 230), - "linen" => array(250, 240, 230), - "antique white" => array(250, 235, 215), - "AntiqueWhite" => array(250, 235, 215), - "papaya whip" => array(255, 239, 213), - "PapayaWhip" => array(255, 239, 213), - "blanched almond" => array(255, 235, 205), - "BlanchedAlmond" => array(255, 235, 205), - "bisque" => array(255, 228, 196), - "peach puff" => array(255, 218, 185), - "PeachPuff" => array(255, 218, 185), - "navajo white" => array(255, 222, 173), - "NavajoWhite" => array(255, 222, 173), - "moccasin" => array(255, 228, 181), - "cornsilk" => array(255, 248, 220), - "ivory" => array(255, 255, 240), - "lemon chiffon" => array(255, 250, 205), - "LemonChiffon" => array(255, 250, 205), - "seashell" => array(255, 245, 238), - "honeydew" => array(240, 255, 240), - "mint cream" => array(245, 255, 250), - "MintCream" => array(245, 255, 250), - "azure" => array(240, 255, 255), - "alice blue" => array(240, 248, 255), - "AliceBlue" => array(240, 248, 255), - "lavender" => array(230, 230, 250), - "lavender blush" => array(255, 240, 245), - "LavenderBlush" => array(255, 240, 245), - "misty rose" => array(255, 228, 225), - "MistyRose" => array(255, 228, 225), - "white" => array(255, 255, 255), - "black" => array( 0, 0, 0), - "dark slate gray" => array( 47, 79, 79), - "DarkSlateGray" => array( 47, 79, 79), - "dark slate grey" => array( 47, 79, 79), - "DarkSlateGrey" => array( 47, 79, 79), - "dim gray" => array(105, 105, 105), - "DimGray" => array(105, 105, 105), - "dim grey" => array(105, 105, 105), - "DimGrey" => array(105, 105, 105), - "slate gray" => array(112, 128, 144), - "SlateGray" => array(112, 128, 144), - "slate grey" => array(112, 128, 144), - "SlateGrey" => array(112, 128, 144), - "light slate gray" => array(119, 136, 153), - "LightSlateGray" => array(119, 136, 153), - "light slate grey" => array(119, 136, 153), - "LightSlateGrey" => array(119, 136, 153), - "gray" => array(190, 190, 190), - "grey" => array(190, 190, 190), - "light grey" => array(211, 211, 211), - "LightGrey" => array(211, 211, 211), - "light gray" => array(211, 211, 211), - "LightGray" => array(211, 211, 211), - "midnight blue" => array( 25, 25, 112), - "MidnightBlue" => array( 25, 25, 112), - "navy" => array( 0, 0, 128), - "navy blue" => array( 0, 0, 128), - "NavyBlue" => array( 0, 0, 128), - "cornflower blue" => array(100, 149, 237), - "CornflowerBlue" => array(100, 149, 237), - "dark slate blue" => array( 72, 61, 139), - "DarkSlateBlue" => array( 72, 61, 139), - "slate blue" => array(106, 90, 205), - "SlateBlue" => array(106, 90, 205), - "medium slate blue" => array(123, 104, 238), - "MediumSlateBlue" => array(123, 104, 238), - "light slate blue" => array(132, 112, 255), - "LightSlateBlue" => array(132, 112, 255), - "medium blue" => array( 0, 0, 205), - "MediumBlue" => array( 0, 0, 205), - "royal blue" => array( 65, 105, 225), - "RoyalBlue" => array( 65, 105, 225), - "blue" => array( 0, 0, 255), - "dodger blue" => array( 30, 144, 255), - "DodgerBlue" => array( 30, 144, 255), - "deep sky blue" => array( 0, 191, 255), - "DeepSkyBlue" => array( 0, 191, 255), - "sky blue" => array(135, 206, 235), - "SkyBlue" => array(135, 206, 235), - "light sky blue" => array(135, 206, 250), - "LightSkyBlue" => array(135, 206, 250), - "steel blue" => array( 70, 130, 180), - "SteelBlue" => array( 70, 130, 180), - "light steel blue" => array(176, 196, 222), - "LightSteelBlue" => array(176, 196, 222), - "light blue" => array(173, 216, 230), - "LightBlue" => array(173, 216, 230), - "powder blue" => array(176, 224, 230), - "PowderBlue" => array(176, 224, 230), - "pale turquoise" => array(175, 238, 238), - "PaleTurquoise" => array(175, 238, 238), - "dark turquoise" => array( 0, 206, 209), - "DarkTurquoise" => array( 0, 206, 209), - "medium turquoise" => array( 72, 209, 204), - "MediumTurquoise" => array( 72, 209, 204), - "turquoise" => array( 64, 224, 208), - "cyan" => array( 0, 255, 255), - "light cyan" => array(224, 255, 255), - "LightCyan" => array(224, 255, 255), - "cadet blue" => array( 95, 158, 160), - "CadetBlue" => array( 95, 158, 160), - "medium aquamarine" => array(102, 205, 170), - "MediumAquamarine" => array(102, 205, 170), - "aquamarine" => array(127, 255, 212), - "dark green" => array( 0, 100, 0), - "DarkGreen" => array( 0, 100, 0), - "dark olive green" => array( 85, 107, 47), - "DarkOliveGreen" => array( 85, 107, 47), - "dark sea green" => array(143, 188, 143), - "DarkSeaGreen" => array(143, 188, 143), - "sea green" => array( 46, 139, 87), - "SeaGreen" => array( 46, 139, 87), - "medium sea green" => array( 60, 179, 113), - "MediumSeaGreen" => array( 60, 179, 113), - "light sea green" => array( 32, 178, 170), - "LightSeaGreen" => array( 32, 178, 170), - "pale green" => array(152, 251, 152), - "PaleGreen" => array(152, 251, 152), - "spring green" => array( 0, 255, 127), - "SpringGreen" => array( 0, 255, 127), - "lawn green" => array(124, 252, 0), - "LawnGreen" => array(124, 252, 0), - "green" => array( 0, 255, 0), - "chartreuse" => array(127, 255, 0), - "medium spring green" => array( 0, 250, 154), - "MediumSpringGreen" => array( 0, 250, 154), - "green yellow" => array(173, 255, 47), - "GreenYellow" => array(173, 255, 47), - "lime green" => array( 50, 205, 50), - "LimeGreen" => array( 50, 205, 50), - "yellow green" => array(154, 205, 50), - "YellowGreen" => array(154, 205, 50), - "forest green" => array( 34, 139, 34), - "ForestGreen" => array( 34, 139, 34), - "olive drab" => array(107, 142, 35), - "OliveDrab" => array(107, 142, 35), - "dark khaki" => array(189, 183, 107), - "DarkKhaki" => array(189, 183, 107), - "khaki" => array(240, 230, 140), - "pale goldenrod" => array(238, 232, 170), - "PaleGoldenrod" => array(238, 232, 170), - "light goldenrod yellow" => array(250, 250, 210), - "LightGoldenrodYellow" => array(250, 250, 210), - "light yellow" => array(255, 255, 224), - "LightYellow" => array(255, 255, 224), - "yellow" => array(255, 255, 0), - "gold" => array(255, 215, 0), - "light goldenrod" => array(238, 221, 130), - "LightGoldenrod" => array(238, 221, 130), - "goldenrod" => array(218, 165, 32), - "dark goldenrod" => array(184, 134, 11), - "DarkGoldenrod" => array(184, 134, 11), - "rosy brown" => array(188, 143, 143), - "RosyBrown" => array(188, 143, 143), - "indian red" => array(205, 92, 92), - "IndianRed" => array(205, 92, 92), - "saddle brown" => array(139, 69, 19), - "SaddleBrown" => array(139, 69, 19), - "sienna" => array(160, 82, 45), - "peru" => array(205, 133, 63), - "burlywood" => array(222, 184, 135), - "beige" => array(245, 245, 220), - "wheat" => array(245, 222, 179), - "sandy brown" => array(244, 164, 96), - "SandyBrown" => array(244, 164, 96), - "tan" => array(210, 180, 140), - "chocolate" => array(210, 105, 30), - "firebrick" => array(178, 34, 34), - "brown" => array(165, 42, 42), - "dark salmon" => array(233, 150, 122), - "DarkSalmon" => array(233, 150, 122), - "salmon" => array(250, 128, 114), - "light salmon" => array(255, 160, 122), - "LightSalmon" => array(255, 160, 122), - "orange" => array(255, 165, 0), - "dark orange" => array(255, 140, 0), - "DarkOrange" => array(255, 140, 0), - "coral" => array(255, 127, 80), - "light coral" => array(240, 128, 128), - "LightCoral" => array(240, 128, 128), - "tomato" => array(255, 99, 71), - "orange red" => array(255, 69, 0), - "OrangeRed" => array(255, 69, 0), - "red" => array(255, 0, 0), - "hot pink" => array(255, 105, 180), - "HotPink" => array(255, 105, 180), - "deep pink" => array(255, 20, 147), - "DeepPink" => array(255, 20, 147), - "pink" => array(255, 192, 203), - "light pink" => array(255, 182, 193), - "LightPink" => array(255, 182, 193), - "pale violet red" => array(219, 112, 147), - "PaleVioletRed" => array(219, 112, 147), - "maroon" => array(176, 48, 96), - "medium violet red" => array(199, 21, 133), - "MediumVioletRed" => array(199, 21, 133), - "violet red" => array(208, 32, 144), - "VioletRed" => array(208, 32, 144), - "magenta" => array(255, 0, 255), - "violet" => array(238, 130, 238), - "plum" => array(221, 160, 221), - "orchid" => array(218, 112, 214), - "medium orchid" => array(186, 85, 211), - "MediumOrchid" => array(186, 85, 211), - "dark orchid" => array(153, 50, 204), - "DarkOrchid" => array(153, 50, 204), - "dark violet" => array(148, 0, 211), - "DarkViolet" => array(148, 0, 211), - "blue violet" => array(138, 43, 226), - "BlueViolet" => array(138, 43, 226), - "purple" => array(160, 32, 240), - "medium purple" => array(147, 112, 219), - "MediumPurple" => array(147, 112, 219), - "thistle" => array(216, 191, 216), - "snow1" => array(255, 250, 250), - "snow2" => array(238, 233, 233), - "snow3" => array(205, 201, 201), - "snow4" => array(139, 137, 137), - "seashell1" => array(255, 245, 238), - "seashell2" => array(238, 229, 222), - "seashell3" => array(205, 197, 191), - "seashell4" => array(139, 134, 130), - "AntiqueWhite1" => array(255, 239, 219), - "AntiqueWhite2" => array(238, 223, 204), - "AntiqueWhite3" => array(205, 192, 176), - "AntiqueWhite4" => array(139, 131, 120), - "bisque1" => array(255, 228, 196), - "bisque2" => array(238, 213, 183), - "bisque3" => array(205, 183, 158), - "bisque4" => array(139, 125, 107), - "PeachPuff1" => array(255, 218, 185), - "PeachPuff2" => array(238, 203, 173), - "PeachPuff3" => array(205, 175, 149), - "PeachPuff4" => array(139, 119, 101), - "NavajoWhite1" => array(255, 222, 173), - "NavajoWhite2" => array(238, 207, 161), - "NavajoWhite3" => array(205, 179, 139), - "NavajoWhite4" => array(139, 121, 94), - "LemonChiffon1" => array(255, 250, 205), - "LemonChiffon2" => array(238, 233, 191), - "LemonChiffon3" => array(205, 201, 165), - "LemonChiffon4" => array(139, 137, 112), - "cornsilk1" => array(255, 248, 220), - "cornsilk2" => array(238, 232, 205), - "cornsilk3" => array(205, 200, 177), - "cornsilk4" => array(139, 136, 120), - "ivory1" => array(255, 255, 240), - "ivory2" => array(238, 238, 224), - "ivory3" => array(205, 205, 193), - "ivory4" => array(139, 139, 131), - "honeydew1" => array(240, 255, 240), - "honeydew2" => array(224, 238, 224), - "honeydew3" => array(193, 205, 193), - "honeydew4" => array(131, 139, 131), - "LavenderBlush1" => array(255, 240, 245), - "LavenderBlush2" => array(238, 224, 229), - "LavenderBlush3" => array(205, 193, 197), - "LavenderBlush4" => array(139, 131, 134), - "MistyRose1" => array(255, 228, 225), - "MistyRose2" => array(238, 213, 210), - "MistyRose3" => array(205, 183, 181), - "MistyRose4" => array(139, 125, 123), - "azure1" => array(240, 255, 255), - "azure2" => array(224, 238, 238), - "azure3" => array(193, 205, 205), - "azure4" => array(131, 139, 139), - "SlateBlue1" => array(131, 111, 255), - "SlateBlue2" => array(122, 103, 238), - "SlateBlue3" => array(105, 89, 205), - "SlateBlue4" => array( 71, 60, 139), - "RoyalBlue1" => array( 72, 118, 255), - "RoyalBlue2" => array( 67, 110, 238), - "RoyalBlue3" => array( 58, 95, 205), - "RoyalBlue4" => array( 39, 64, 139), - "blue1" => array( 0, 0, 255), - "blue2" => array( 0, 0, 238), - "blue3" => array( 0, 0, 205), - "blue4" => array( 0, 0, 139), - "DodgerBlue1" => array( 30, 144, 255), - "DodgerBlue2" => array( 28, 134, 238), - "DodgerBlue3" => array( 24, 116, 205), - "DodgerBlue4" => array( 16, 78, 139), - "SteelBlue1" => array( 99, 184, 255), - "SteelBlue2" => array( 92, 172, 238), - "SteelBlue3" => array( 79, 148, 205), - "SteelBlue4" => array( 54, 100, 139), - "DeepSkyBlue1" => array( 0, 191, 255), - "DeepSkyBlue2" => array( 0, 178, 238), - "DeepSkyBlue3" => array( 0, 154, 205), - "DeepSkyBlue4" => array( 0, 104, 139), - "SkyBlue1" => array(135, 206, 255), - "SkyBlue2" => array(126, 192, 238), - "SkyBlue3" => array(108, 166, 205), - "SkyBlue4" => array( 74, 112, 139), - "LightSkyBlue1" => array(176, 226, 255), - "LightSkyBlue2" => array(164, 211, 238), - "LightSkyBlue3" => array(141, 182, 205), - "LightSkyBlue4" => array( 96, 123, 139), - "SlateGray1" => array(198, 226, 255), - "SlateGray2" => array(185, 211, 238), - "SlateGray3" => array(159, 182, 205), - "SlateGray4" => array(108, 123, 139), - "LightSteelBlue1" => array(202, 225, 255), - "LightSteelBlue2" => array(188, 210, 238), - "LightSteelBlue3" => array(162, 181, 205), - "LightSteelBlue4" => array(110, 123, 139), - "LightBlue1" => array(191, 239, 255), - "LightBlue2" => array(178, 223, 238), - "LightBlue3" => array(154, 192, 205), - "LightBlue4" => array(104, 131, 139), - "LightCyan1" => array(224, 255, 255), - "LightCyan2" => array(209, 238, 238), - "LightCyan3" => array(180, 205, 205), - "LightCyan4" => array(122, 139, 139), - "PaleTurquoise1" => array(187, 255, 255), - "PaleTurquoise2" => array(174, 238, 238), - "PaleTurquoise3" => array(150, 205, 205), - "PaleTurquoise4" => array(102, 139, 139), - "CadetBlue1" => array(152, 245, 255), - "CadetBlue2" => array(142, 229, 238), - "CadetBlue3" => array(122, 197, 205), - "CadetBlue4" => array( 83, 134, 139), - "turquoise1" => array( 0, 245, 255), - "turquoise2" => array( 0, 229, 238), - "turquoise3" => array( 0, 197, 205), - "turquoise4" => array( 0, 134, 139), - "cyan1" => array( 0, 255, 255), - "cyan2" => array( 0, 238, 238), - "cyan3" => array( 0, 205, 205), - "cyan4" => array( 0, 139, 139), - "DarkSlateGray1" => array(151, 255, 255), - "DarkSlateGray2" => array(141, 238, 238), - "DarkSlateGray3" => array(121, 205, 205), - "DarkSlateGray4" => array( 82, 139, 139), - "aquamarine1" => array(127, 255, 212), - "aquamarine2" => array(118, 238, 198), - "aquamarine3" => array(102, 205, 170), - "aquamarine4" => array( 69, 139, 116), - "DarkSeaGreen1" => array(193, 255, 193), - "DarkSeaGreen2" => array(180, 238, 180), - "DarkSeaGreen3" => array(155, 205, 155), - "DarkSeaGreen4" => array(105, 139, 105), - "SeaGreen1" => array( 84, 255, 159), - "SeaGreen2" => array( 78, 238, 148), - "SeaGreen3" => array( 67, 205, 128), - "SeaGreen4" => array( 46, 139, 87), - "PaleGreen1" => array(154, 255, 154), - "PaleGreen2" => array(144, 238, 144), - "PaleGreen3" => array(124, 205, 124), - "PaleGreen4" => array( 84, 139, 84), - "SpringGreen1" => array( 0, 255, 127), - "SpringGreen2" => array( 0, 238, 118), - "SpringGreen3" => array( 0, 205, 102), - "SpringGreen4" => array( 0, 139, 69), - "green1" => array( 0, 255, 0), - "green2" => array( 0, 238, 0), - "green3" => array( 0, 205, 0), - "green4" => array( 0, 139, 0), - "chartreuse1" => array(127, 255, 0), - "chartreuse2" => array(118, 238, 0), - "chartreuse3" => array(102, 205, 0), - "chartreuse4" => array( 69, 139, 0), - "OliveDrab1" => array(192, 255, 62), - "OliveDrab2" => array(179, 238, 58), - "OliveDrab3" => array(154, 205, 50), - "OliveDrab4" => array(105, 139, 34), - "DarkOliveGreen1" => array(202, 255, 112), - "DarkOliveGreen2" => array(188, 238, 104), - "DarkOliveGreen3" => array(162, 205, 90), - "DarkOliveGreen4" => array(110, 139, 61), - "khaki1" => array(255, 246, 143), - "khaki2" => array(238, 230, 133), - "khaki3" => array(205, 198, 115), - "khaki4" => array(139, 134, 78), - "LightGoldenrod1" => array(255, 236, 139), - "LightGoldenrod2" => array(238, 220, 130), - "LightGoldenrod3" => array(205, 190, 112), - "LightGoldenrod4" => array(139, 129, 76), - "LightYellow1" => array(255, 255, 224), - "LightYellow2" => array(238, 238, 209), - "LightYellow3" => array(205, 205, 180), - "LightYellow4" => array(139, 139, 122), - "yellow1" => array(255, 255, 0), - "yellow2" => array(238, 238, 0), - "yellow3" => array(205, 205, 0), - "yellow4" => array(139, 139, 0), - "gold1" => array(255, 215, 0), - "gold2" => array(238, 201, 0), - "gold3" => array(205, 173, 0), - "gold4" => array(139, 117, 0), - "goldenrod1" => array(255, 193, 37), - "goldenrod2" => array(238, 180, 34), - "goldenrod3" => array(205, 155, 29), - "goldenrod4" => array(139, 105, 20), - "DarkGoldenrod1" => array(255, 185, 15), - "DarkGoldenrod2" => array(238, 173, 14), - "DarkGoldenrod3" => array(205, 149, 12), - "DarkGoldenrod4" => array(139, 101, 8), - "RosyBrown1" => array(255, 193, 193), - "RosyBrown2" => array(238, 180, 180), - "RosyBrown3" => array(205, 155, 155), - "RosyBrown4" => array(139, 105, 105), - "IndianRed1" => array(255, 106, 106), - "IndianRed2" => array(238, 99, 99), - "IndianRed3" => array(205, 85, 85), - "IndianRed4" => array(139, 58, 58), - "sienna1" => array(255, 130, 71), - "sienna2" => array(238, 121, 66), - "sienna3" => array(205, 104, 57), - "sienna4" => array(139, 71, 38), - "burlywood1" => array(255, 211, 155), - "burlywood2" => array(238, 197, 145), - "burlywood3" => array(205, 170, 125), - "burlywood4" => array(139, 115, 85), - "wheat1" => array(255, 231, 186), - "wheat2" => array(238, 216, 174), - "wheat3" => array(205, 186, 150), - "wheat4" => array(139, 126, 102), - "tan1" => array(255, 165, 79), - "tan2" => array(238, 154, 73), - "tan3" => array(205, 133, 63), - "tan4" => array(139, 90, 43), - "chocolate1" => array(255, 127, 36), - "chocolate2" => array(238, 118, 33), - "chocolate3" => array(205, 102, 29), - "chocolate4" => array(139, 69, 19), - "firebrick1" => array(255, 48, 48), - "firebrick2" => array(238, 44, 44), - "firebrick3" => array(205, 38, 38), - "firebrick4" => array(139, 26, 26), - "brown1" => array(255, 64, 64), - "brown2" => array(238, 59, 59), - "brown3" => array(205, 51, 51), - "brown4" => array(139, 35, 35), - "salmon1" => array(255, 140, 105), - "salmon2" => array(238, 130, 98), - "salmon3" => array(205, 112, 84), - "salmon4" => array(139, 76, 57), - "LightSalmon1" => array(255, 160, 122), - "LightSalmon2" => array(238, 149, 114), - "LightSalmon3" => array(205, 129, 98), - "LightSalmon4" => array(139, 87, 66), - "orange1" => array(255, 165, 0), - "orange2" => array(238, 154, 0), - "orange3" => array(205, 133, 0), - "orange4" => array(139, 90, 0), - "DarkOrange1" => array(255, 127, 0), - "DarkOrange2" => array(238, 118, 0), - "DarkOrange3" => array(205, 102, 0), - "DarkOrange4" => array(139, 69, 0), - "coral1" => array(255, 114, 86), - "coral2" => array(238, 106, 80), - "coral3" => array(205, 91, 69), - "coral4" => array(139, 62, 47), - "tomato1" => array(255, 99, 71), - "tomato2" => array(238, 92, 66), - "tomato3" => array(205, 79, 57), - "tomato4" => array(139, 54, 38), - "OrangeRed1" => array(255, 69, 0), - "OrangeRed2" => array(238, 64, 0), - "OrangeRed3" => array(205, 55, 0), - "OrangeRed4" => array(139, 37, 0), - "red1" => array(255, 0, 0), - "red2" => array(238, 0, 0), - "red3" => array(205, 0, 0), - "red4" => array(139, 0, 0), - "DeepPink1" => array(255, 20, 147), - "DeepPink2" => array(238, 18, 137), - "DeepPink3" => array(205, 16, 118), - "DeepPink4" => array(139, 10, 80), - "HotPink1" => array(255, 110, 180), - "HotPink2" => array(238, 106, 167), - "HotPink3" => array(205, 96, 144), - "HotPink4" => array(139, 58, 98), - "pink1" => array(255, 181, 197), - "pink2" => array(238, 169, 184), - "pink3" => array(205, 145, 158), - "pink4" => array(139, 99, 108), - "LightPink1" => array(255, 174, 185), - "LightPink2" => array(238, 162, 173), - "LightPink3" => array(205, 140, 149), - "LightPink4" => array(139, 95, 101), - "PaleVioletRed1" => array(255, 130, 171), - "PaleVioletRed2" => array(238, 121, 159), - "PaleVioletRed3" => array(205, 104, 137), - "PaleVioletRed4" => array(139, 71, 93), - "maroon1" => array(255, 52, 179), - "maroon2" => array(238, 48, 167), - "maroon3" => array(205, 41, 144), - "maroon4" => array(139, 28, 98), - "VioletRed1" => array(255, 62, 150), - "VioletRed2" => array(238, 58, 140), - "VioletRed3" => array(205, 50, 120), - "VioletRed4" => array(139, 34, 82), - "magenta1" => array(255, 0, 255), - "magenta2" => array(238, 0, 238), - "magenta3" => array(205, 0, 205), - "magenta4" => array(139, 0, 139), - "orchid1" => array(255, 131, 250), - "orchid2" => array(238, 122, 233), - "orchid3" => array(205, 105, 201), - "orchid4" => array(139, 71, 137), - "plum1" => array(255, 187, 255), - "plum2" => array(238, 174, 238), - "plum3" => array(205, 150, 205), - "plum4" => array(139, 102, 139), - "MediumOrchid1" => array(224, 102, 255), - "MediumOrchid2" => array(209, 95, 238), - "MediumOrchid3" => array(180, 82, 205), - "MediumOrchid4" => array(122, 55, 139), - "DarkOrchid1" => array(191, 62, 255), - "DarkOrchid2" => array(178, 58, 238), - "DarkOrchid3" => array(154, 50, 205), - "DarkOrchid4" => array(104, 34, 139), - "purple1" => array(155, 48, 255), - "purple2" => array(145, 44, 238), - "purple3" => array(125, 38, 205), - "purple4" => array( 85, 26, 139), - "MediumPurple1" => array(171, 130, 255), - "MediumPurple2" => array(159, 121, 238), - "MediumPurple3" => array(137, 104, 205), - "MediumPurple4" => array( 93, 71, 139), - "thistle1" => array(255, 225, 255), - "thistle2" => array(238, 210, 238), - "thistle3" => array(205, 181, 205), - "thistle4" => array(139, 123, 139), - "gray0" => array( 0, 0, 0), - "grey0" => array( 0, 0, 0), - "gray1" => array( 3, 3, 3), - "grey1" => array( 3, 3, 3), - "gray2" => array( 5, 5, 5), - "grey2" => array( 5, 5, 5), - "gray3" => array( 8, 8, 8), - "grey3" => array( 8, 8, 8), - "gray4" => array( 10, 10, 10), - "grey4" => array( 10, 10, 10), - "gray5" => array( 13, 13, 13), - "grey5" => array( 13, 13, 13), - "gray6" => array( 15, 15, 15), - "grey6" => array( 15, 15, 15), - "gray7" => array( 18, 18, 18), - "grey7" => array( 18, 18, 18), - "gray8" => array( 20, 20, 20), - "grey8" => array( 20, 20, 20), - "gray9" => array( 23, 23, 23), - "grey9" => array( 23, 23, 23), - "gray10" => array( 26, 26, 26), - "grey10" => array( 26, 26, 26), - "gray11" => array( 28, 28, 28), - "grey11" => array( 28, 28, 28), - "gray12" => array( 31, 31, 31), - "grey12" => array( 31, 31, 31), - "gray13" => array( 33, 33, 33), - "grey13" => array( 33, 33, 33), - "gray14" => array( 36, 36, 36), - "grey14" => array( 36, 36, 36), - "gray15" => array( 38, 38, 38), - "grey15" => array( 38, 38, 38), - "gray16" => array( 41, 41, 41), - "grey16" => array( 41, 41, 41), - "gray17" => array( 43, 43, 43), - "grey17" => array( 43, 43, 43), - "gray18" => array( 46, 46, 46), - "grey18" => array( 46, 46, 46), - "gray19" => array( 48, 48, 48), - "grey19" => array( 48, 48, 48), - "gray20" => array( 51, 51, 51), - "grey20" => array( 51, 51, 51), - "gray21" => array( 54, 54, 54), - "grey21" => array( 54, 54, 54), - "gray22" => array( 56, 56, 56), - "grey22" => array( 56, 56, 56), - "gray23" => array( 59, 59, 59), - "grey23" => array( 59, 59, 59), - "gray24" => array( 61, 61, 61), - "grey24" => array( 61, 61, 61), - "gray25" => array( 64, 64, 64), - "grey25" => array( 64, 64, 64), - "gray26" => array( 66, 66, 66), - "grey26" => array( 66, 66, 66), - "gray27" => array( 69, 69, 69), - "grey27" => array( 69, 69, 69), - "gray28" => array( 71, 71, 71), - "grey28" => array( 71, 71, 71), - "gray29" => array( 74, 74, 74), - "grey29" => array( 74, 74, 74), - "gray30" => array( 77, 77, 77), - "grey30" => array( 77, 77, 77), - "gray31" => array( 79, 79, 79), - "grey31" => array( 79, 79, 79), - "gray32" => array( 82, 82, 82), - "grey32" => array( 82, 82, 82), - "gray33" => array( 84, 84, 84), - "grey33" => array( 84, 84, 84), - "gray34" => array( 87, 87, 87), - "grey34" => array( 87, 87, 87), - "gray35" => array( 89, 89, 89), - "grey35" => array( 89, 89, 89), - "gray36" => array( 92, 92, 92), - "grey36" => array( 92, 92, 92), - "gray37" => array( 94, 94, 94), - "grey37" => array( 94, 94, 94), - "gray38" => array( 97, 97, 97), - "grey38" => array( 97, 97, 97), - "gray39" => array( 99, 99, 99), - "grey39" => array( 99, 99, 99), - "gray40" => array(102, 102, 102), - "grey40" => array(102, 102, 102), - "gray41" => array(105, 105, 105), - "grey41" => array(105, 105, 105), - "gray42" => array(107, 107, 107), - "grey42" => array(107, 107, 107), - "gray43" => array(110, 110, 110), - "grey43" => array(110, 110, 110), - "gray44" => array(112, 112, 112), - "grey44" => array(112, 112, 112), - "gray45" => array(115, 115, 115), - "grey45" => array(115, 115, 115), - "gray46" => array(117, 117, 117), - "grey46" => array(117, 117, 117), - "gray47" => array(120, 120, 120), - "grey47" => array(120, 120, 120), - "gray48" => array(122, 122, 122), - "grey48" => array(122, 122, 122), - "gray49" => array(125, 125, 125), - "grey49" => array(125, 125, 125), - "gray50" => array(127, 127, 127), - "grey50" => array(127, 127, 127), - "gray51" => array(130, 130, 130), - "grey51" => array(130, 130, 130), - "gray52" => array(133, 133, 133), - "grey52" => array(133, 133, 133), - "gray53" => array(135, 135, 135), - "grey53" => array(135, 135, 135), - "gray54" => array(138, 138, 138), - "grey54" => array(138, 138, 138), - "gray55" => array(140, 140, 140), - "grey55" => array(140, 140, 140), - "gray56" => array(143, 143, 143), - "grey56" => array(143, 143, 143), - "gray57" => array(145, 145, 145), - "grey57" => array(145, 145, 145), - "gray58" => array(148, 148, 148), - "grey58" => array(148, 148, 148), - "gray59" => array(150, 150, 150), - "grey59" => array(150, 150, 150), - "gray60" => array(153, 153, 153), - "grey60" => array(153, 153, 153), - "gray61" => array(156, 156, 156), - "grey61" => array(156, 156, 156), - "gray62" => array(158, 158, 158), - "grey62" => array(158, 158, 158), - "gray63" => array(161, 161, 161), - "grey63" => array(161, 161, 161), - "gray64" => array(163, 163, 163), - "grey64" => array(163, 163, 163), - "gray65" => array(166, 166, 166), - "grey65" => array(166, 166, 166), - "gray66" => array(168, 168, 168), - "grey66" => array(168, 168, 168), - "gray67" => array(171, 171, 171), - "grey67" => array(171, 171, 171), - "gray68" => array(173, 173, 173), - "grey68" => array(173, 173, 173), - "gray69" => array(176, 176, 176), - "grey69" => array(176, 176, 176), - "gray70" => array(179, 179, 179), - "grey70" => array(179, 179, 179), - "gray71" => array(181, 181, 181), - "grey71" => array(181, 181, 181), - "gray72" => array(184, 184, 184), - "grey72" => array(184, 184, 184), - "gray73" => array(186, 186, 186), - "grey73" => array(186, 186, 186), - "gray74" => array(189, 189, 189), - "grey74" => array(189, 189, 189), - "gray75" => array(191, 191, 191), - "grey75" => array(191, 191, 191), - "gray76" => array(194, 194, 194), - "grey76" => array(194, 194, 194), - "gray77" => array(196, 196, 196), - "grey77" => array(196, 196, 196), - "gray78" => array(199, 199, 199), - "grey78" => array(199, 199, 199), - "gray79" => array(201, 201, 201), - "grey79" => array(201, 201, 201), - "gray80" => array(204, 204, 204), - "grey80" => array(204, 204, 204), - "gray81" => array(207, 207, 207), - "grey81" => array(207, 207, 207), - "gray82" => array(209, 209, 209), - "grey82" => array(209, 209, 209), - "gray83" => array(212, 212, 212), - "grey83" => array(212, 212, 212), - "gray84" => array(214, 214, 214), - "grey84" => array(214, 214, 214), - "gray85" => array(217, 217, 217), - "grey85" => array(217, 217, 217), - "gray86" => array(219, 219, 219), - "grey86" => array(219, 219, 219), - "gray87" => array(222, 222, 222), - "grey87" => array(222, 222, 222), - "gray88" => array(224, 224, 224), - "grey88" => array(224, 224, 224), - "gray89" => array(227, 227, 227), - "grey89" => array(227, 227, 227), - "gray90" => array(229, 229, 229), - "grey90" => array(229, 229, 229), - "gray91" => array(232, 232, 232), - "grey91" => array(232, 232, 232), - "gray92" => array(235, 235, 235), - "grey92" => array(235, 235, 235), - "gray93" => array(237, 237, 237), - "grey93" => array(237, 237, 237), - "gray94" => array(240, 240, 240), - "grey94" => array(240, 240, 240), - "gray95" => array(242, 242, 242), - "grey95" => array(242, 242, 242), - "gray96" => array(245, 245, 245), - "grey96" => array(245, 245, 245), - "gray97" => array(247, 247, 247), - "grey97" => array(247, 247, 247), - "gray98" => array(250, 250, 250), - "grey98" => array(250, 250, 250), - "gray99" => array(252, 252, 252), - "grey99" => array(252, 252, 252), - "gray100" => array(255, 255, 255) -); -?> diff --git a/gui/bacula-web/external_packages/smarty/COPYING.lib b/gui/bacula-web/external_packages/smarty/COPYING.lib deleted file mode 100644 index 3b204400cf..0000000000 --- a/gui/bacula-web/external_packages/smarty/COPYING.lib +++ /dev/null @@ -1,458 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS diff --git a/gui/bacula-web/external_packages/smarty/Config_File.class.php b/gui/bacula-web/external_packages/smarty/Config_File.class.php deleted file mode 100644 index a8cc755167..0000000000 --- a/gui/bacula-web/external_packages/smarty/Config_File.class.php +++ /dev/null @@ -1,389 +0,0 @@ - - * @access public - * @package Smarty - */ - -/* $Id$ */ - -/** - * Config file reading class - * @package Smarty - */ -class Config_File { - /**#@+ - * Options - * @var boolean - */ - /** - * Controls whether variables with the same name overwrite each other. - */ - var $overwrite = true; - - /** - * Controls whether config values of on/true/yes and off/false/no get - * converted to boolean values automatically. - */ - var $booleanize = true; - - /** - * Controls whether hidden config sections/vars are read from the file. - */ - var $read_hidden = true; - - /** - * Controls whether or not to fix mac or dos formatted newlines. - * If set to true, \r or \r\n will be changed to \n. - */ - var $fix_newlines = true; - /**#@-*/ - - /** @access private */ - var $_config_path = ""; - var $_config_data = array(); - /**#@-*/ - - /** - * Constructs a new config file class. - * - * @param string $config_path (optional) path to the config files - */ - function Config_File($config_path = NULL) - { - if (isset($config_path)) - $this->set_path($config_path); - } - - - /** - * Set the path where configuration files can be found. - * - * @param string $config_path path to the config files - */ - function set_path($config_path) - { - if (!empty($config_path)) { - if (!is_string($config_path) || !file_exists($config_path) || !is_dir($config_path)) { - $this->_trigger_error_msg("Bad config file path '$config_path'"); - return; - } - if(substr($config_path, -1) != DIRECTORY_SEPARATOR) { - $config_path .= DIRECTORY_SEPARATOR; - } - - $this->_config_path = $config_path; - } - } - - - /** - * Retrieves config info based on the file, section, and variable name. - * - * @param string $file_name config file to get info for - * @param string $section_name (optional) section to get info for - * @param string $var_name (optional) variable to get info for - * @return string|array a value or array of values - */ - function get($file_name, $section_name = NULL, $var_name = NULL) - { - if (empty($file_name)) { - $this->_trigger_error_msg('Empty config file name'); - return; - } else { - $file_name = $this->_config_path . $file_name; - if (!isset($this->_config_data[$file_name])) - $this->load_file($file_name, false); - } - - if (!empty($var_name)) { - if (empty($section_name)) { - return $this->_config_data[$file_name]["vars"][$var_name]; - } else { - if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name])) - return $this->_config_data[$file_name]["sections"][$section_name]["vars"][$var_name]; - else - return array(); - } - } else { - if (empty($section_name)) { - return (array)$this->_config_data[$file_name]["vars"]; - } else { - if(isset($this->_config_data[$file_name]["sections"][$section_name]["vars"])) - return (array)$this->_config_data[$file_name]["sections"][$section_name]["vars"]; - else - return array(); - } - } - } - - - /** - * Retrieves config info based on the key. - * - * @param $file_name string config key (filename/section/var) - * @return string|array same as get() - * @uses get() retrieves information from config file and returns it - */ - function &get_key($config_key) - { - list($file_name, $section_name, $var_name) = explode('/', $config_key, 3); - $result = &$this->get($file_name, $section_name, $var_name); - return $result; - } - - /** - * Get all loaded config file names. - * - * @return array an array of loaded config file names - */ - function get_file_names() - { - return array_keys($this->_config_data); - } - - - /** - * Get all section names from a loaded file. - * - * @param string $file_name config file to get section names from - * @return array an array of section names from the specified file - */ - function get_section_names($file_name) - { - $file_name = $this->_config_path . $file_name; - if (!isset($this->_config_data[$file_name])) { - $this->_trigger_error_msg("Unknown config file '$file_name'"); - return; - } - - return array_keys($this->_config_data[$file_name]["sections"]); - } - - - /** - * Get all global or section variable names. - * - * @param string $file_name config file to get info for - * @param string $section_name (optional) section to get info for - * @return array an array of variables names from the specified file/section - */ - function get_var_names($file_name, $section = NULL) - { - if (empty($file_name)) { - $this->_trigger_error_msg('Empty config file name'); - return; - } else if (!isset($this->_config_data[$file_name])) { - $this->_trigger_error_msg("Unknown config file '$file_name'"); - return; - } - - if (empty($section)) - return array_keys($this->_config_data[$file_name]["vars"]); - else - return array_keys($this->_config_data[$file_name]["sections"][$section]["vars"]); - } - - - /** - * Clear loaded config data for a certain file or all files. - * - * @param string $file_name file to clear config data for - */ - function clear($file_name = NULL) - { - if ($file_name === NULL) - $this->_config_data = array(); - else if (isset($this->_config_data[$file_name])) - $this->_config_data[$file_name] = array(); - } - - - /** - * Load a configuration file manually. - * - * @param string $file_name file name to load - * @param boolean $prepend_path whether current config path should be - * prepended to the filename - */ - function load_file($file_name, $prepend_path = true) - { - if ($prepend_path && $this->_config_path != "") - $config_file = $this->_config_path . $file_name; - else - $config_file = $file_name; - - ini_set('track_errors', true); - $fp = @fopen($config_file, "r"); - if (!is_resource($fp)) { - $this->_trigger_error_msg("Could not open config file '$config_file'"); - return false; - } - - $contents = ($size = filesize($config_file)) ? fread($fp, $size) : ''; - fclose($fp); - - $this->_config_data[$config_file] = $this->parse_contents($contents); - return true; - } - - /** - * Store the contents of a file manually. - * - * @param string $config_file file name of the related contents - * @param string $contents the file-contents to parse - */ - function set_file_contents($config_file, $contents) - { - $this->_config_data[$config_file] = $this->parse_contents($contents); - return true; - } - - /** - * parse the source of a configuration file manually. - * - * @param string $contents the file-contents to parse - */ - function parse_contents($contents) - { - if($this->fix_newlines) { - // fix mac/dos formatted newlines - $contents = preg_replace('!\r\n?!', "\n", $contents); - } - - $config_data = array(); - $config_data['sections'] = array(); - $config_data['vars'] = array(); - - /* reference to fill with data */ - $vars =& $config_data['vars']; - - /* parse file line by line */ - preg_match_all('!^.*\r?\n?!m', $contents, $match); - $lines = $match[0]; - for ($i=0, $count=count($lines); $i<$count; $i++) { - $line = $lines[$i]; - if (empty($line)) continue; - - if ( $line{0} == '[' && preg_match('!^\[(.*?)\]!', $line, $match) ) { - /* section found */ - if ($match[1]{0} == '.') { - /* hidden section */ - if ($this->read_hidden) { - $section_name = substr($match[1], 1); - } else { - /* break reference to $vars to ignore hidden section */ - unset($vars); - $vars = array(); - continue; - } - } else { - $section_name = $match[1]; - } - if (!isset($config_data['sections'][$section_name])) - $config_data['sections'][$section_name] = array('vars' => array()); - $vars =& $config_data['sections'][$section_name]['vars']; - continue; - } - - if (preg_match('/^\s*(\.?\w+)\s*=\s*(.*)/s', $line, $match)) { - /* variable found */ - $var_name = rtrim($match[1]); - if (strpos($match[2], '"""') === 0) { - /* handle multiline-value */ - $lines[$i] = substr($match[2], 3); - $var_value = ''; - while ($i<$count) { - if (($pos = strpos($lines[$i], '"""')) === false) { - $var_value .= $lines[$i++]; - } else { - /* end of multiline-value */ - $var_value .= substr($lines[$i], 0, $pos); - break; - } - } - $booleanize = false; - - } else { - /* handle simple value */ - $var_value = preg_replace('/^([\'"])(.*)\1$/', '\2', rtrim($match[2])); - $booleanize = $this->booleanize; - - } - $this->_set_config_var($vars, $var_name, $var_value, $booleanize); - } - /* else unparsable line / means it is a comment / means ignore it */ - } - return $config_data; - } - - /**#@+ @access private */ - /** - * @param array &$container - * @param string $var_name - * @param mixed $var_value - * @param boolean $booleanize determines whether $var_value is converted to - * to true/false - */ - function _set_config_var(&$container, $var_name, $var_value, $booleanize) - { - if ($var_name{0} == '.') { - if (!$this->read_hidden) - return; - else - $var_name = substr($var_name, 1); - } - - if (!preg_match("/^[a-zA-Z_]\w*$/", $var_name)) { - $this->_trigger_error_msg("Bad variable name '$var_name'"); - return; - } - - if ($booleanize) { - if (preg_match("/^(on|true|yes)$/i", $var_value)) - $var_value = true; - else if (preg_match("/^(off|false|no)$/i", $var_value)) - $var_value = false; - } - - if (!isset($container[$var_name]) || $this->overwrite) - $container[$var_name] = $var_value; - else { - settype($container[$var_name], 'array'); - $container[$var_name][] = $var_value; - } - } - - /** - * @uses trigger_error() creates a PHP warning/error - * @param string $error_msg - * @param integer $error_type one of - */ - function _trigger_error_msg($error_msg, $error_type = E_USER_WARNING) - { - trigger_error("Config_File error: $error_msg", $error_type); - } - /**#@-*/ -} - -?> diff --git a/gui/bacula-web/external_packages/smarty/Smarty.class.php b/gui/bacula-web/external_packages/smarty/Smarty.class.php deleted file mode 100644 index ebc04c02b3..0000000000 --- a/gui/bacula-web/external_packages/smarty/Smarty.class.php +++ /dev/null @@ -1,1934 +0,0 @@ - - * @author Andrei Zmievski - * @package Smarty - * @version 2.6.10 - */ - -/* $Id$ */ - -/** - * DIR_SEP isn't used anymore, but third party apps might - */ -if(!defined('DIR_SEP')) { - define('DIR_SEP', DIRECTORY_SEPARATOR); -} - -/** - * set SMARTY_DIR to absolute path to Smarty library files. - * if not defined, include_path will be used. Sets SMARTY_DIR only if user - * application has not already defined it. - */ - -if (!defined('SMARTY_DIR')) { - define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR); -} - -if (!defined('SMARTY_CORE_DIR')) { - define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR); -} - -define('SMARTY_PHP_PASSTHRU', 0); -define('SMARTY_PHP_QUOTE', 1); -define('SMARTY_PHP_REMOVE', 2); -define('SMARTY_PHP_ALLOW', 3); - -/** - * @package Smarty - */ -class Smarty -{ - /**#@+ - * Smarty Configuration Section - */ - - /** - * The name of the directory where templates are located. - * - * @var string - */ - var $template_dir = 'templates'; - - /** - * The directory where compiled templates are located. - * - * @var string - */ - var $compile_dir = 'templates_c'; - - /** - * The directory where config files are located. - * - * @var string - */ - var $config_dir = 'configs'; - - /** - * An array of directories searched for plugins. - * - * @var array - */ - var $plugins_dir = array('plugins'); - - /** - * If debugging is enabled, a debug console window will display - * when the page loads (make sure your browser allows unrequested - * popup windows) - * - * @var boolean - */ - var $debugging = false; - - /** - * When set, smarty does uses this value as error_reporting-level. - * - * @var boolean - */ - var $error_reporting = null; - - /** - * This is the path to the debug console template. If not set, - * the default one will be used. - * - * @var string - */ - var $debug_tpl = ''; - - /** - * This determines if debugging is enable-able from the browser. - *

      - *
    • NONE => no debugging control allowed
    • - *
    • URL => enable debugging when SMARTY_DEBUG is found in the URL.
    • - *
    - * @link http://www.foo.dom/index.php?SMARTY_DEBUG - * @var string - */ - var $debugging_ctrl = 'NONE'; - - /** - * This tells Smarty whether to check for recompiling or not. Recompiling - * does not need to happen unless a template or config file is changed. - * Typically you enable this during development, and disable for - * production. - * - * @var boolean - */ - var $compile_check = true; - - /** - * This forces templates to compile every time. Useful for development - * or debugging. - * - * @var boolean - */ - var $force_compile = false; - - /** - * This enables template caching. - *
      - *
    • 0 = no caching
    • - *
    • 1 = use class cache_lifetime value
    • - *
    • 2 = use cache_lifetime in cache file
    • - *
    - * @var integer - */ - var $caching = 0; - - /** - * The name of the directory for cache files. - * - * @var string - */ - var $cache_dir = 'cache'; - - /** - * This is the number of seconds cached content will persist. - *
      - *
    • 0 = always regenerate cache
    • - *
    • -1 = never expires
    • - *
    - * - * @var integer - */ - var $cache_lifetime = 3600; - - /** - * Only used when $caching is enabled. If true, then If-Modified-Since headers - * are respected with cached content, and appropriate HTTP headers are sent. - * This way repeated hits to a cached page do not send the entire page to the - * client every time. - * - * @var boolean - */ - var $cache_modified_check = false; - - /** - * This determines how Smarty handles "" tags in templates. - * possible values: - *
      - *
    • SMARTY_PHP_PASSTHRU -> print tags as plain text
    • - *
    • SMARTY_PHP_QUOTE -> escape tags as entities
    • - *
    • SMARTY_PHP_REMOVE -> remove php tags
    • - *
    • SMARTY_PHP_ALLOW -> execute php tags
    • - *
    - * - * @var integer - */ - var $php_handling = SMARTY_PHP_PASSTHRU; - - /** - * This enables template security. When enabled, many things are restricted - * in the templates that normally would go unchecked. This is useful when - * untrusted parties are editing templates and you want a reasonable level - * of security. (no direct execution of PHP in templates for example) - * - * @var boolean - */ - var $security = false; - - /** - * This is the list of template directories that are considered secure. This - * is used only if {@link $security} is enabled. One directory per array - * element. {@link $template_dir} is in this list implicitly. - * - * @var array - */ - var $secure_dir = array(); - - /** - * These are the security settings for Smarty. They are used only when - * {@link $security} is enabled. - * - * @var array - */ - var $security_settings = array( - 'PHP_HANDLING' => false, - 'IF_FUNCS' => array('array', 'list', - 'isset', 'empty', - 'count', 'sizeof', - 'in_array', 'is_array', - 'true', 'false', 'null'), - 'INCLUDE_ANY' => false, - 'PHP_TAGS' => false, - 'MODIFIER_FUNCS' => array('count'), - 'ALLOW_CONSTANTS' => false - ); - - /** - * This is an array of directories where trusted php scripts reside. - * {@link $security} is disabled during their inclusion/execution. - * - * @var array - */ - var $trusted_dir = array(); - - /** - * The left delimiter used for the template tags. - * - * @var string - */ - var $left_delimiter = '{'; - - /** - * The right delimiter used for the template tags. - * - * @var string - */ - var $right_delimiter = '}'; - - /** - * The order in which request variables are registered, similar to - * variables_order in php.ini E = Environment, G = GET, P = POST, - * C = Cookies, S = Server - * - * @var string - */ - var $request_vars_order = 'EGPCS'; - - /** - * Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false) - * are uses as request-vars or $_*[]-vars. note: if - * request_use_auto_globals is true, then $request_vars_order has - * no effect, but the php-ini-value "gpc_order" - * - * @var boolean - */ - var $request_use_auto_globals = true; - - /** - * Set this if you want different sets of compiled files for the same - * templates. This is useful for things like different languages. - * Instead of creating separate sets of templates per language, you - * set different compile_ids like 'en' and 'de'. - * - * @var string - */ - var $compile_id = null; - - /** - * This tells Smarty whether or not to use sub dirs in the cache/ and - * templates_c/ directories. sub directories better organized, but - * may not work well with PHP safe mode enabled. - * - * @var boolean - * - */ - var $use_sub_dirs = false; - - /** - * This is a list of the modifiers to apply to all template variables. - * Put each modifier in a separate array element in the order you want - * them applied. example: array('escape:"htmlall"'); - * - * @var array - */ - var $default_modifiers = array(); - - /** - * This is the resource type to be used when not specified - * at the beginning of the resource path. examples: - * $smarty->display('file:index.tpl'); - * $smarty->display('db:index.tpl'); - * $smarty->display('index.tpl'); // will use default resource type - * {include file="file:index.tpl"} - * {include file="db:index.tpl"} - * {include file="index.tpl"} {* will use default resource type *} - * - * @var array - */ - var $default_resource_type = 'file'; - - /** - * The function used for cache file handling. If not set, built-in caching is used. - * - * @var null|string function name - */ - var $cache_handler_func = null; - - /** - * This indicates which filters are automatically loaded into Smarty. - * - * @var array array of filter names - */ - var $autoload_filters = array(); - - /**#@+ - * @var boolean - */ - /** - * This tells if config file vars of the same name overwrite each other or not. - * if disabled, same name variables are accumulated in an array. - */ - var $config_overwrite = true; - - /** - * This tells whether or not to automatically booleanize config file variables. - * If enabled, then the strings "on", "true", and "yes" are treated as boolean - * true, and "off", "false" and "no" are treated as boolean false. - */ - var $config_booleanize = true; - - /** - * This tells whether hidden sections [.foobar] are readable from the - * tempalates or not. Normally you would never allow this since that is - * the point behind hidden sections: the application can access them, but - * the templates cannot. - */ - var $config_read_hidden = false; - - /** - * This tells whether or not automatically fix newlines in config files. - * It basically converts \r (mac) or \r\n (dos) to \n - */ - var $config_fix_newlines = true; - /**#@-*/ - - /** - * If a template cannot be found, this PHP function will be executed. - * Useful for creating templates on-the-fly or other special action. - * - * @var string function name - */ - var $default_template_handler_func = ''; - - /** - * The file that contains the compiler class. This can a full - * pathname, or relative to the php_include path. - * - * @var string - */ - var $compiler_file = 'Smarty_Compiler.class.php'; - - /** - * The class used for compiling templates. - * - * @var string - */ - var $compiler_class = 'Smarty_Compiler'; - - /** - * The class used to load config vars. - * - * @var string - */ - var $config_class = 'Config_File'; - -/**#@+ - * END Smarty Configuration Section - * There should be no need to touch anything below this line. - * @access private - */ - /** - * where assigned template vars are kept - * - * @var array - */ - var $_tpl_vars = array(); - - /** - * stores run-time $smarty.* vars - * - * @var null|array - */ - var $_smarty_vars = null; - - /** - * keeps track of sections - * - * @var array - */ - var $_sections = array(); - - /** - * keeps track of foreach blocks - * - * @var array - */ - var $_foreach = array(); - - /** - * keeps track of tag hierarchy - * - * @var array - */ - var $_tag_stack = array(); - - /** - * configuration object - * - * @var Config_file - */ - var $_conf_obj = null; - - /** - * loaded configuration settings - * - * @var array - */ - var $_config = array(array('vars' => array(), 'files' => array())); - - /** - * md5 checksum of the string 'Smarty' - * - * @var string - */ - var $_smarty_md5 = 'f8d698aea36fcbead2b9d5359ffca76f'; - - /** - * Smarty version number - * - * @var string - */ - var $_version = '2.6.10'; - - /** - * current template inclusion depth - * - * @var integer - */ - var $_inclusion_depth = 0; - - /** - * for different compiled templates - * - * @var string - */ - var $_compile_id = null; - - /** - * text in URL to enable debug mode - * - * @var string - */ - var $_smarty_debug_id = 'SMARTY_DEBUG'; - - /** - * debugging information for debug console - * - * @var array - */ - var $_smarty_debug_info = array(); - - /** - * info that makes up a cache file - * - * @var array - */ - var $_cache_info = array(); - - /** - * default file permissions - * - * @var integer - */ - var $_file_perms = 0644; - - /** - * default dir permissions - * - * @var integer - */ - var $_dir_perms = 0771; - - /** - * registered objects - * - * @var array - */ - var $_reg_objects = array(); - - /** - * table keeping track of plugins - * - * @var array - */ - var $_plugins = array( - 'modifier' => array(), - 'function' => array(), - 'block' => array(), - 'compiler' => array(), - 'prefilter' => array(), - 'postfilter' => array(), - 'outputfilter' => array(), - 'resource' => array(), - 'insert' => array()); - - - /** - * cache serials - * - * @var array - */ - var $_cache_serials = array(); - - /** - * name of optional cache include file - * - * @var string - */ - var $_cache_include = null; - - /** - * indicate if the current code is used in a compiled - * include - * - * @var string - */ - var $_cache_including = false; - - /**#@-*/ - /** - * The class constructor. - */ - function Smarty() - { - $this->assign('SCRIPT_NAME', isset($_SERVER['SCRIPT_NAME']) ? $_SERVER['SCRIPT_NAME'] - : @$GLOBALS['HTTP_SERVER_VARS']['SCRIPT_NAME']); - } - - /** - * assigns values to template variables - * - * @param array|string $tpl_var the template variable name(s) - * @param mixed $value the value to assign - */ - function assign($tpl_var, $value = null) - { - if (is_array($tpl_var)){ - foreach ($tpl_var as $key => $val) { - if ($key != '') { - $this->_tpl_vars[$key] = $val; - } - } - } else { - if ($tpl_var != '') - $this->_tpl_vars[$tpl_var] = $value; - } - } - - /** - * assigns values to template variables by reference - * - * @param string $tpl_var the template variable name - * @param mixed $value the referenced value to assign - */ - function assign_by_ref($tpl_var, &$value) - { - if ($tpl_var != '') - $this->_tpl_vars[$tpl_var] = &$value; - } - - /** - * appends values to template variables - * - * @param array|string $tpl_var the template variable name(s) - * @param mixed $value the value to append - */ - function append($tpl_var, $value=null, $merge=false) - { - if (is_array($tpl_var)) { - // $tpl_var is an array, ignore $value - foreach ($tpl_var as $_key => $_val) { - if ($_key != '') { - if(!@is_array($this->_tpl_vars[$_key])) { - settype($this->_tpl_vars[$_key],'array'); - } - if($merge && is_array($_val)) { - foreach($_val as $_mkey => $_mval) { - $this->_tpl_vars[$_key][$_mkey] = $_mval; - } - } else { - $this->_tpl_vars[$_key][] = $_val; - } - } - } - } else { - if ($tpl_var != '' && isset($value)) { - if(!@is_array($this->_tpl_vars[$tpl_var])) { - settype($this->_tpl_vars[$tpl_var],'array'); - } - if($merge && is_array($value)) { - foreach($value as $_mkey => $_mval) { - $this->_tpl_vars[$tpl_var][$_mkey] = $_mval; - } - } else { - $this->_tpl_vars[$tpl_var][] = $value; - } - } - } - } - - /** - * appends values to template variables by reference - * - * @param string $tpl_var the template variable name - * @param mixed $value the referenced value to append - */ - function append_by_ref($tpl_var, &$value, $merge=false) - { - if ($tpl_var != '' && isset($value)) { - if(!@is_array($this->_tpl_vars[$tpl_var])) { - settype($this->_tpl_vars[$tpl_var],'array'); - } - if ($merge && is_array($value)) { - foreach($value as $_key => $_val) { - $this->_tpl_vars[$tpl_var][$_key] = &$value[$_key]; - } - } else { - $this->_tpl_vars[$tpl_var][] = &$value; - } - } - } - - - /** - * clear the given assigned template variable. - * - * @param string $tpl_var the template variable to clear - */ - function clear_assign($tpl_var) - { - if (is_array($tpl_var)) - foreach ($tpl_var as $curr_var) - unset($this->_tpl_vars[$curr_var]); - else - unset($this->_tpl_vars[$tpl_var]); - } - - - /** - * Registers custom function to be used in templates - * - * @param string $function the name of the template function - * @param string $function_impl the name of the PHP function to register - */ - function register_function($function, $function_impl, $cacheable=true, $cache_attrs=null) - { - $this->_plugins['function'][$function] = - array($function_impl, null, null, false, $cacheable, $cache_attrs); - - } - - /** - * Unregisters custom function - * - * @param string $function name of template function - */ - function unregister_function($function) - { - unset($this->_plugins['function'][$function]); - } - - /** - * Registers object to be used in templates - * - * @param string $object name of template object - * @param object &$object_impl the referenced PHP object to register - * @param null|array $allowed list of allowed methods (empty = all) - * @param boolean $smarty_args smarty argument format, else traditional - * @param null|array $block_functs list of methods that are block format - */ - function register_object($object, &$object_impl, $allowed = array(), $smarty_args = true, $block_methods = array()) - { - settype($allowed, 'array'); - settype($smarty_args, 'boolean'); - $this->_reg_objects[$object] = - array(&$object_impl, $allowed, $smarty_args, $block_methods); - } - - /** - * Unregisters object - * - * @param string $object name of template object - */ - function unregister_object($object) - { - unset($this->_reg_objects[$object]); - } - - - /** - * Registers block function to be used in templates - * - * @param string $block name of template block - * @param string $block_impl PHP function to register - */ - function register_block($block, $block_impl, $cacheable=true, $cache_attrs=null) - { - $this->_plugins['block'][$block] = - array($block_impl, null, null, false, $cacheable, $cache_attrs); - } - - /** - * Unregisters block function - * - * @param string $block name of template function - */ - function unregister_block($block) - { - unset($this->_plugins['block'][$block]); - } - - /** - * Registers compiler function - * - * @param string $function name of template function - * @param string $function_impl name of PHP function to register - */ - function register_compiler_function($function, $function_impl, $cacheable=true) - { - $this->_plugins['compiler'][$function] = - array($function_impl, null, null, false, $cacheable); - } - - /** - * Unregisters compiler function - * - * @param string $function name of template function - */ - function unregister_compiler_function($function) - { - unset($this->_plugins['compiler'][$function]); - } - - /** - * Registers modifier to be used in templates - * - * @param string $modifier name of template modifier - * @param string $modifier_impl name of PHP function to register - */ - function register_modifier($modifier, $modifier_impl) - { - $this->_plugins['modifier'][$modifier] = - array($modifier_impl, null, null, false); - } - - /** - * Unregisters modifier - * - * @param string $modifier name of template modifier - */ - function unregister_modifier($modifier) - { - unset($this->_plugins['modifier'][$modifier]); - } - - /** - * Registers a resource to fetch a template - * - * @param string $type name of resource - * @param array $functions array of functions to handle resource - */ - function register_resource($type, $functions) - { - if (count($functions)==4) { - $this->_plugins['resource'][$type] = - array($functions, false); - - } elseif (count($functions)==5) { - $this->_plugins['resource'][$type] = - array(array(array(&$functions[0], $functions[1]) - ,array(&$functions[0], $functions[2]) - ,array(&$functions[0], $functions[3]) - ,array(&$functions[0], $functions[4])) - ,false); - - } else { - $this->trigger_error("malformed function-list for '$type' in register_resource"); - - } - } - - /** - * Unregisters a resource - * - * @param string $type name of resource - */ - function unregister_resource($type) - { - unset($this->_plugins['resource'][$type]); - } - - /** - * Registers a prefilter function to apply - * to a template before compiling - * - * @param string $function name of PHP function to register - */ - function register_prefilter($function) - { - $_name = (is_array($function)) ? $function[1] : $function; - $this->_plugins['prefilter'][$_name] - = array($function, null, null, false); - } - - /** - * Unregisters a prefilter function - * - * @param string $function name of PHP function - */ - function unregister_prefilter($function) - { - unset($this->_plugins['prefilter'][$function]); - } - - /** - * Registers a postfilter function to apply - * to a compiled template after compilation - * - * @param string $function name of PHP function to register - */ - function register_postfilter($function) - { - $_name = (is_array($function)) ? $function[1] : $function; - $this->_plugins['postfilter'][$_name] - = array($function, null, null, false); - } - - /** - * Unregisters a postfilter function - * - * @param string $function name of PHP function - */ - function unregister_postfilter($function) - { - unset($this->_plugins['postfilter'][$function]); - } - - /** - * Registers an output filter function to apply - * to a template output - * - * @param string $function name of PHP function - */ - function register_outputfilter($function) - { - $_name = (is_array($function)) ? $function[1] : $function; - $this->_plugins['outputfilter'][$_name] - = array($function, null, null, false); - } - - /** - * Unregisters an outputfilter function - * - * @param string $function name of PHP function - */ - function unregister_outputfilter($function) - { - unset($this->_plugins['outputfilter'][$function]); - } - - /** - * load a filter of specified type and name - * - * @param string $type filter type - * @param string $name filter name - */ - function load_filter($type, $name) - { - switch ($type) { - case 'output': - $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false))); - require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); - smarty_core_load_plugins($_params, $this); - break; - - case 'pre': - case 'post': - if (!isset($this->_plugins[$type . 'filter'][$name])) - $this->_plugins[$type . 'filter'][$name] = false; - break; - } - } - - /** - * clear cached content for the given template and cache id - * - * @param string $tpl_file name of template file - * @param string $cache_id name of cache_id - * @param string $compile_id name of compile_id - * @param string $exp_time expiration time - * @return boolean - */ - function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null) - { - - if (!isset($compile_id)) - $compile_id = $this->compile_id; - - if (!isset($tpl_file)) - $compile_id = null; - - $_auto_id = $this->_get_auto_id($cache_id, $compile_id); - - if (!empty($this->cache_handler_func)) { - return call_user_func_array($this->cache_handler_func, - array('clear', &$this, &$dummy, $tpl_file, $cache_id, $compile_id, $exp_time)); - } else { - $_params = array('auto_base' => $this->cache_dir, - 'auto_source' => $tpl_file, - 'auto_id' => $_auto_id, - 'exp_time' => $exp_time); - require_once(SMARTY_CORE_DIR . 'core.rm_auto.php'); - return smarty_core_rm_auto($_params, $this); - } - - } - - - /** - * clear the entire contents of cache (all templates) - * - * @param string $exp_time expire time - * @return boolean results of {@link smarty_core_rm_auto()} - */ - function clear_all_cache($exp_time = null) - { - return $this->clear_cache(null, null, null, $exp_time); - } - - - /** - * test to see if valid cache exists for this template - * - * @param string $tpl_file name of template file - * @param string $cache_id - * @param string $compile_id - * @return string|false results of {@link _read_cache_file()} - */ - function is_cached($tpl_file, $cache_id = null, $compile_id = null) - { - if (!$this->caching) - return false; - - if (!isset($compile_id)) - $compile_id = $this->compile_id; - - $_params = array( - 'tpl_file' => $tpl_file, - 'cache_id' => $cache_id, - 'compile_id' => $compile_id - ); - require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php'); - return smarty_core_read_cache_file($_params, $this); - } - - - /** - * clear all the assigned template variables. - * - */ - function clear_all_assign() - { - $this->_tpl_vars = array(); - } - - /** - * clears compiled version of specified template resource, - * or all compiled template files if one is not specified. - * This function is for advanced use only, not normally needed. - * - * @param string $tpl_file - * @param string $compile_id - * @param string $exp_time - * @return boolean results of {@link smarty_core_rm_auto()} - */ - function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null) - { - if (!isset($compile_id)) { - $compile_id = $this->compile_id; - } - $_params = array('auto_base' => $this->compile_dir, - 'auto_source' => $tpl_file, - 'auto_id' => $compile_id, - 'exp_time' => $exp_time, - 'extensions' => array('.inc', '.php')); - require_once(SMARTY_CORE_DIR . 'core.rm_auto.php'); - return smarty_core_rm_auto($_params, $this); - } - - /** - * Checks whether requested template exists. - * - * @param string $tpl_file - * @return boolean - */ - function template_exists($tpl_file) - { - $_params = array('resource_name' => $tpl_file, 'quiet'=>true, 'get_source'=>false); - return $this->_fetch_resource_info($_params); - } - - /** - * Returns an array containing template variables - * - * @param string $name - * @param string $type - * @return array - */ - function &get_template_vars($name=null) - { - if(!isset($name)) { - return $this->_tpl_vars; - } - if(isset($this->_tpl_vars[$name])) { - return $this->_tpl_vars[$name]; - } - } - - /** - * Returns an array containing config variables - * - * @param string $name - * @param string $type - * @return array - */ - function &get_config_vars($name=null) - { - if(!isset($name) && is_array($this->_config[0])) { - return $this->_config[0]['vars']; - } else if(isset($this->_config[0]['vars'][$name])) { - return $this->_config[0]['vars'][$name]; - } - } - - /** - * trigger Smarty error - * - * @param string $error_msg - * @param integer $error_type - */ - function trigger_error($error_msg, $error_type = E_USER_WARNING) - { - trigger_error("Smarty error: $error_msg", $error_type); - } - - - /** - * executes & displays the template results - * - * @param string $resource_name - * @param string $cache_id - * @param string $compile_id - */ - function display($resource_name, $cache_id = null, $compile_id = null) - { - $this->fetch($resource_name, $cache_id, $compile_id, true); - } - - /** - * executes & returns or displays the template results - * - * @param string $resource_name - * @param string $cache_id - * @param string $compile_id - * @param boolean $display - */ - function fetch($resource_name, $cache_id = null, $compile_id = null, $display = false) - { - static $_cache_info = array(); - - $_smarty_old_error_level = $this->debugging ? error_reporting() : error_reporting(isset($this->error_reporting) - ? $this->error_reporting : error_reporting() & ~E_NOTICE); - - if (!$this->debugging && $this->debugging_ctrl == 'URL') { - $_query_string = $this->request_use_auto_globals ? $_SERVER['QUERY_STRING'] : $GLOBALS['HTTP_SERVER_VARS']['QUERY_STRING']; - if (@strstr($_query_string, $this->_smarty_debug_id)) { - if (@strstr($_query_string, $this->_smarty_debug_id . '=on')) { - // enable debugging for this browser session - @setcookie('SMARTY_DEBUG', true); - $this->debugging = true; - } elseif (@strstr($_query_string, $this->_smarty_debug_id . '=off')) { - // disable debugging for this browser session - @setcookie('SMARTY_DEBUG', false); - $this->debugging = false; - } else { - // enable debugging for this page - $this->debugging = true; - } - } else { - $this->debugging = (bool)($this->request_use_auto_globals ? @$_COOKIE['SMARTY_DEBUG'] : @$GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG']); - } - } - - if ($this->debugging) { - // capture time for debugging info - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $_debug_start_time = smarty_core_get_microtime($_params, $this); - $this->_smarty_debug_info[] = array('type' => 'template', - 'filename' => $resource_name, - 'depth' => 0); - $_included_tpls_idx = count($this->_smarty_debug_info) - 1; - } - - if (!isset($compile_id)) { - $compile_id = $this->compile_id; - } - - $this->_compile_id = $compile_id; - $this->_inclusion_depth = 0; - - if ($this->caching) { - // save old cache_info, initialize cache_info - array_push($_cache_info, $this->_cache_info); - $this->_cache_info = array(); - $_params = array( - 'tpl_file' => $resource_name, - 'cache_id' => $cache_id, - 'compile_id' => $compile_id, - 'results' => null - ); - require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php'); - if (smarty_core_read_cache_file($_params, $this)) { - $_smarty_results = $_params['results']; - if (!empty($this->_cache_info['insert_tags'])) { - $_params = array('plugins' => $this->_cache_info['insert_tags']); - require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); - smarty_core_load_plugins($_params, $this); - $_params = array('results' => $_smarty_results); - require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php'); - $_smarty_results = smarty_core_process_cached_inserts($_params, $this); - } - if (!empty($this->_cache_info['cache_serials'])) { - $_params = array('results' => $_smarty_results); - require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php'); - $_smarty_results = smarty_core_process_compiled_include($_params, $this); - } - - - if ($display) { - if ($this->debugging) - { - // capture time for debugging info - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time; - require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); - $_smarty_results .= smarty_core_display_debug_console($_params, $this); - } - if ($this->cache_modified_check) { - $_server_vars = ($this->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; - $_last_modified_date = @substr($_server_vars['HTTP_IF_MODIFIED_SINCE'], 0, strpos($_server_vars['HTTP_IF_MODIFIED_SINCE'], 'GMT') + 3); - $_gmt_mtime = gmdate('D, d M Y H:i:s', $this->_cache_info['timestamp']).' GMT'; - if (@count($this->_cache_info['insert_tags']) == 0 - && !$this->_cache_serials - && $_gmt_mtime == $_last_modified_date) { - if (php_sapi_name()=='cgi') - header('Status: 304 Not Modified'); - else - header('HTTP/1.1 304 Not Modified'); - - } else { - header('Last-Modified: '.$_gmt_mtime); - echo $_smarty_results; - } - } else { - echo $_smarty_results; - } - error_reporting($_smarty_old_error_level); - // restore initial cache_info - $this->_cache_info = array_pop($_cache_info); - return true; - } else { - error_reporting($_smarty_old_error_level); - // restore initial cache_info - $this->_cache_info = array_pop($_cache_info); - return $_smarty_results; - } - } else { - $this->_cache_info['template'][$resource_name] = true; - if ($this->cache_modified_check && $display) { - header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT'); - } - } - } - - // load filters that are marked as autoload - if (count($this->autoload_filters)) { - foreach ($this->autoload_filters as $_filter_type => $_filters) { - foreach ($_filters as $_filter) { - $this->load_filter($_filter_type, $_filter); - } - } - } - - $_smarty_compile_path = $this->_get_compile_path($resource_name); - - // if we just need to display the results, don't perform output - // buffering - for speed - $_cache_including = $this->_cache_including; - $this->_cache_including = false; - if ($display && !$this->caching && count($this->_plugins['outputfilter']) == 0) { - if ($this->_is_compiled($resource_name, $_smarty_compile_path) - || $this->_compile_resource($resource_name, $_smarty_compile_path)) - { - include($_smarty_compile_path); - } - } else { - ob_start(); - if ($this->_is_compiled($resource_name, $_smarty_compile_path) - || $this->_compile_resource($resource_name, $_smarty_compile_path)) - { - include($_smarty_compile_path); - } - $_smarty_results = ob_get_contents(); - ob_end_clean(); - - foreach ((array)$this->_plugins['outputfilter'] as $_output_filter) { - $_smarty_results = call_user_func_array($_output_filter[0], array($_smarty_results, &$this)); - } - } - - if ($this->caching) { - $_params = array('tpl_file' => $resource_name, - 'cache_id' => $cache_id, - 'compile_id' => $compile_id, - 'results' => $_smarty_results); - require_once(SMARTY_CORE_DIR . 'core.write_cache_file.php'); - smarty_core_write_cache_file($_params, $this); - require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php'); - $_smarty_results = smarty_core_process_cached_inserts($_params, $this); - - if ($this->_cache_serials) { - // strip nocache-tags from output - $_smarty_results = preg_replace('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!s' - ,'' - ,$_smarty_results); - } - // restore initial cache_info - $this->_cache_info = array_pop($_cache_info); - } - $this->_cache_including = $_cache_including; - - if ($display) { - if (isset($_smarty_results)) { echo $_smarty_results; } - if ($this->debugging) { - // capture time for debugging info - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time); - require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); - echo smarty_core_display_debug_console($_params, $this); - } - error_reporting($_smarty_old_error_level); - return; - } else { - error_reporting($_smarty_old_error_level); - if (isset($_smarty_results)) { return $_smarty_results; } - } - } - - /** - * load configuration values - * - * @param string $file - * @param string $section - * @param string $scope - */ - function config_load($file, $section = null, $scope = 'global') - { - require_once($this->_get_plugin_filepath('function', 'config_load')); - smarty_function_config_load(array('file' => $file, 'section' => $section, 'scope' => $scope), $this); - } - - /** - * return a reference to a registered object - * - * @param string $name - * @return object - */ - function &get_registered_object($name) { - if (!isset($this->_reg_objects[$name])) - $this->_trigger_fatal_error("'$name' is not a registered object"); - - if (!is_object($this->_reg_objects[$name][0])) - $this->_trigger_fatal_error("registered '$name' is not an object"); - - return $this->_reg_objects[$name][0]; - } - - /** - * clear configuration values - * - * @param string $var - */ - function clear_config($var = null) - { - if(!isset($var)) { - // clear all values - $this->_config = array(array('vars' => array(), - 'files' => array())); - } else { - unset($this->_config[0]['vars'][$var]); - } - } - - /** - * get filepath of requested plugin - * - * @param string $type - * @param string $name - * @return string|false - */ - function _get_plugin_filepath($type, $name) - { - $_params = array('type' => $type, 'name' => $name); - require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php'); - return smarty_core_assemble_plugin_filepath($_params, $this); - } - - /** - * test if resource needs compiling - * - * @param string $resource_name - * @param string $compile_path - * @return boolean - */ - function _is_compiled($resource_name, $compile_path) - { - if (!$this->force_compile && file_exists($compile_path)) { - if (!$this->compile_check) { - // no need to check compiled file - return true; - } else { - // get file source and timestamp - $_params = array('resource_name' => $resource_name, 'get_source'=>false); - if (!$this->_fetch_resource_info($_params)) { - return false; - } - if ($_params['resource_timestamp'] <= filemtime($compile_path)) { - // template not expired, no recompile - return true; - } else { - // compile template - return false; - } - } - } else { - // compiled template does not exist, or forced compile - return false; - } - } - - /** - * compile the template - * - * @param string $resource_name - * @param string $compile_path - * @return boolean - */ - function _compile_resource($resource_name, $compile_path) - { - - $_params = array('resource_name' => $resource_name); - if (!$this->_fetch_resource_info($_params)) { - return false; - } - - $_source_content = $_params['source_content']; - $_cache_include = substr($compile_path, 0, -4).'.inc'; - - if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) { - // if a _cache_serial was set, we also have to write an include-file: - if ($this->_cache_include_info) { - require_once(SMARTY_CORE_DIR . 'core.write_compiled_include.php'); - smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content, 'resource_name'=>$resource_name)), $this); - } - - $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content); - require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php'); - smarty_core_write_compiled_resource($_params, $this); - - return true; - } else { - return false; - } - - } - - /** - * compile the given source - * - * @param string $resource_name - * @param string $source_content - * @param string $compiled_content - * @return boolean - */ - function _compile_source($resource_name, &$source_content, &$compiled_content, $cache_include_path=null) - { - if (file_exists(SMARTY_DIR . $this->compiler_file)) { - require_once(SMARTY_DIR . $this->compiler_file); - } else { - // use include_path - require_once($this->compiler_file); - } - - - $smarty_compiler = new $this->compiler_class; - - $smarty_compiler->template_dir = $this->template_dir; - $smarty_compiler->compile_dir = $this->compile_dir; - $smarty_compiler->plugins_dir = $this->plugins_dir; - $smarty_compiler->config_dir = $this->config_dir; - $smarty_compiler->force_compile = $this->force_compile; - $smarty_compiler->caching = $this->caching; - $smarty_compiler->php_handling = $this->php_handling; - $smarty_compiler->left_delimiter = $this->left_delimiter; - $smarty_compiler->right_delimiter = $this->right_delimiter; - $smarty_compiler->_version = $this->_version; - $smarty_compiler->security = $this->security; - $smarty_compiler->secure_dir = $this->secure_dir; - $smarty_compiler->security_settings = $this->security_settings; - $smarty_compiler->trusted_dir = $this->trusted_dir; - $smarty_compiler->use_sub_dirs = $this->use_sub_dirs; - $smarty_compiler->_reg_objects = &$this->_reg_objects; - $smarty_compiler->_plugins = &$this->_plugins; - $smarty_compiler->_tpl_vars = &$this->_tpl_vars; - $smarty_compiler->default_modifiers = $this->default_modifiers; - $smarty_compiler->compile_id = $this->_compile_id; - $smarty_compiler->_config = $this->_config; - $smarty_compiler->request_use_auto_globals = $this->request_use_auto_globals; - - if (isset($cache_include_path) && isset($this->_cache_serials[$cache_include_path])) { - $smarty_compiler->_cache_serial = $this->_cache_serials[$cache_include_path]; - } - $smarty_compiler->_cache_include = $cache_include_path; - - - $_results = $smarty_compiler->_compile_file($resource_name, $source_content, $compiled_content); - - if ($smarty_compiler->_cache_serial) { - $this->_cache_include_info = array( - 'cache_serial'=>$smarty_compiler->_cache_serial - ,'plugins_code'=>$smarty_compiler->_plugins_code - ,'include_file_path' => $cache_include_path); - - } else { - $this->_cache_include_info = null; - - } - - return $_results; - } - - /** - * Get the compile path for this resource - * - * @param string $resource_name - * @return string results of {@link _get_auto_filename()} - */ - function _get_compile_path($resource_name) - { - return $this->_get_auto_filename($this->compile_dir, $resource_name, - $this->_compile_id) . '.php'; - } - - /** - * fetch the template info. Gets timestamp, and source - * if get_source is true - * - * sets $source_content to the source of the template, and - * $resource_timestamp to its time stamp - * @param string $resource_name - * @param string $source_content - * @param integer $resource_timestamp - * @param boolean $get_source - * @param boolean $quiet - * @return boolean - */ - - function _fetch_resource_info(&$params) - { - if(!isset($params['get_source'])) { $params['get_source'] = true; } - if(!isset($params['quiet'])) { $params['quiet'] = false; } - - $_return = false; - $_params = array('resource_name' => $params['resource_name']) ; - if (isset($params['resource_base_path'])) - $_params['resource_base_path'] = $params['resource_base_path']; - else - $_params['resource_base_path'] = $this->template_dir; - - if ($this->_parse_resource_name($_params)) { - $_resource_type = $_params['resource_type']; - $_resource_name = $_params['resource_name']; - switch ($_resource_type) { - case 'file': - if ($params['get_source']) { - $params['source_content'] = $this->_read_file($_resource_name); - } - $params['resource_timestamp'] = filemtime($_resource_name); - $_return = is_file($_resource_name); - break; - - default: - // call resource functions to fetch the template source and timestamp - if ($params['get_source']) { - $_source_return = isset($this->_plugins['resource'][$_resource_type]) && - call_user_func_array($this->_plugins['resource'][$_resource_type][0][0], - array($_resource_name, &$params['source_content'], &$this)); - } else { - $_source_return = true; - } - - $_timestamp_return = isset($this->_plugins['resource'][$_resource_type]) && - call_user_func_array($this->_plugins['resource'][$_resource_type][0][1], - array($_resource_name, &$params['resource_timestamp'], &$this)); - - $_return = $_source_return && $_timestamp_return; - break; - } - } - - if (!$_return) { - // see if we can get a template with the default template handler - if (!empty($this->default_template_handler_func)) { - if (!is_callable($this->default_template_handler_func)) { - $this->trigger_error("default template handler function \"$this->default_template_handler_func\" doesn't exist."); - } else { - $_return = call_user_func_array( - $this->default_template_handler_func, - array($_params['resource_type'], $_params['resource_name'], &$params['source_content'], &$params['resource_timestamp'], &$this)); - } - } - } - - if (!$_return) { - if (!$params['quiet']) { - $this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"'); - } - } else if ($_return && $this->security) { - require_once(SMARTY_CORE_DIR . 'core.is_secure.php'); - if (!smarty_core_is_secure($_params, $this)) { - if (!$params['quiet']) - $this->trigger_error('(secure mode) accessing "' . $params['resource_name'] . '" is not allowed'); - $params['source_content'] = null; - $params['resource_timestamp'] = null; - return false; - } - } - return $_return; - } - - - /** - * parse out the type and name from the resource - * - * @param string $resource_base_path - * @param string $resource_name - * @param string $resource_type - * @param string $resource_name - * @return boolean - */ - - function _parse_resource_name(&$params) - { - - // split tpl_path by the first colon - $_resource_name_parts = explode(':', $params['resource_name'], 2); - - if (count($_resource_name_parts) == 1) { - // no resource type given - $params['resource_type'] = $this->default_resource_type; - $params['resource_name'] = $_resource_name_parts[0]; - } else { - if(strlen($_resource_name_parts[0]) == 1) { - // 1 char is not resource type, but part of filepath - $params['resource_type'] = $this->default_resource_type; - $params['resource_name'] = $params['resource_name']; - } else { - $params['resource_type'] = $_resource_name_parts[0]; - $params['resource_name'] = $_resource_name_parts[1]; - } - } - - if ($params['resource_type'] == 'file') { - if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $params['resource_name'])) { - // relative pathname to $params['resource_base_path'] - // use the first directory where the file is found - foreach ((array)$params['resource_base_path'] as $_curr_path) { - $_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name']; - if (file_exists($_fullpath) && is_file($_fullpath)) { - $params['resource_name'] = $_fullpath; - return true; - } - // didn't find the file, try include_path - $_params = array('file_path' => $_fullpath); - require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); - if(smarty_core_get_include_path($_params, $this)) { - $params['resource_name'] = $_params['new_file_path']; - return true; - } - } - return false; - } else { - /* absolute path */ - return file_exists($params['resource_name']); - } - } elseif (empty($this->_plugins['resource'][$params['resource_type']])) { - $_params = array('type' => $params['resource_type']); - require_once(SMARTY_CORE_DIR . 'core.load_resource_plugin.php'); - smarty_core_load_resource_plugin($_params, $this); - } - - return true; - } - - - /** - * Handle modifiers - * - * @param string|null $modifier_name - * @param array|null $map_array - * @return string result of modifiers - */ - function _run_mod_handler() - { - $_args = func_get_args(); - list($_modifier_name, $_map_array) = array_splice($_args, 0, 2); - list($_func_name, $_tpl_file, $_tpl_line) = - $this->_plugins['modifier'][$_modifier_name]; - - $_var = $_args[0]; - foreach ($_var as $_key => $_val) { - $_args[0] = $_val; - $_var[$_key] = call_user_func_array($_func_name, $_args); - } - return $_var; - } - - /** - * Remove starting and ending quotes from the string - * - * @param string $string - * @return string - */ - function _dequote($string) - { - if (($string{0} == "'" || $string{0} == '"') && - $string{strlen($string)-1} == $string{0}) - return substr($string, 1, -1); - else - return $string; - } - - - /** - * read in a file - * - * @param string $filename - * @return string - */ - function _read_file($filename) - { - if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) { - $contents = ($size = filesize($filename)) ? fread($fd, $size) : ''; - fclose($fd); - return $contents; - } else { - return false; - } - } - - /** - * get a concrete filename for automagically created content - * - * @param string $auto_base - * @param string $auto_source - * @param string $auto_id - * @return string - * @staticvar string|null - * @staticvar string|null - */ - function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null) - { - $_compile_dir_sep = $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^'; - $_return = $auto_base . DIRECTORY_SEPARATOR; - - if(isset($auto_id)) { - // make auto_id safe for directory names - $auto_id = str_replace('%7C',$_compile_dir_sep,(urlencode($auto_id))); - // split into separate directories - $_return .= $auto_id . $_compile_dir_sep; - } - - if(isset($auto_source)) { - // make source name safe for filename - $_filename = urlencode(basename($auto_source)); - $_crc32 = sprintf('%08X', crc32($auto_source)); - // prepend %% to avoid name conflicts with - // with $params['auto_id'] names - $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep . - substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32; - $_return .= '%%' . $_crc32 . '%%' . $_filename; - } - - return $_return; - } - - /** - * unlink a file, possibly using expiration time - * - * @param string $resource - * @param integer $exp_time - */ - function _unlink($resource, $exp_time = null) - { - if(isset($exp_time)) { - if(time() - @filemtime($resource) >= $exp_time) { - return @unlink($resource); - } - } else { - return @unlink($resource); - } - } - - /** - * returns an auto_id for auto-file-functions - * - * @param string $cache_id - * @param string $compile_id - * @return string|null - */ - function _get_auto_id($cache_id=null, $compile_id=null) { - if (isset($cache_id)) - return (isset($compile_id)) ? $cache_id . '|' . $compile_id : $cache_id; - elseif(isset($compile_id)) - return $compile_id; - else - return null; - } - - /** - * trigger Smarty plugin error - * - * @param string $error_msg - * @param string $tpl_file - * @param integer $tpl_line - * @param string $file - * @param integer $line - * @param integer $error_type - */ - function _trigger_fatal_error($error_msg, $tpl_file = null, $tpl_line = null, - $file = null, $line = null, $error_type = E_USER_ERROR) - { - if(isset($file) && isset($line)) { - $info = ' ('.basename($file).", line $line)"; - } else { - $info = ''; - } - if (isset($tpl_line) && isset($tpl_file)) { - $this->trigger_error('[in ' . $tpl_file . ' line ' . $tpl_line . "]: $error_msg$info", $error_type); - } else { - $this->trigger_error($error_msg . $info, $error_type); - } - } - - - /** - * callback function for preg_replace, to call a non-cacheable block - * @return string - */ - function _process_compiled_include_callback($match) { - $_func = '_smarty_tplfunc_'.$match[2].'_'.$match[3]; - ob_start(); - $_func($this); - $_ret = ob_get_contents(); - ob_end_clean(); - return $_ret; - } - - - /** - * called for included templates - * - * @param string $_smarty_include_tpl_file - * @param string $_smarty_include_vars - */ - - // $_smarty_include_tpl_file, $_smarty_include_vars - - function _smarty_include($params) - { - if ($this->debugging) { - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $debug_start_time = smarty_core_get_microtime($_params, $this); - $this->_smarty_debug_info[] = array('type' => 'template', - 'filename' => $params['smarty_include_tpl_file'], - 'depth' => ++$this->_inclusion_depth); - $included_tpls_idx = count($this->_smarty_debug_info) - 1; - } - - $this->_tpl_vars = array_merge($this->_tpl_vars, $params['smarty_include_vars']); - - // config vars are treated as local, so push a copy of the - // current ones onto the front of the stack - array_unshift($this->_config, $this->_config[0]); - - $_smarty_compile_path = $this->_get_compile_path($params['smarty_include_tpl_file']); - - - if ($this->_is_compiled($params['smarty_include_tpl_file'], $_smarty_compile_path) - || $this->_compile_resource($params['smarty_include_tpl_file'], $_smarty_compile_path)) - { - include($_smarty_compile_path); - } - - // pop the local vars off the front of the stack - array_shift($this->_config); - - $this->_inclusion_depth--; - - if ($this->debugging) { - // capture time for debugging info - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time; - } - - if ($this->caching) { - $this->_cache_info['template'][$params['smarty_include_tpl_file']] = true; - } - } - - - /** - * get or set an array of cached attributes for function that is - * not cacheable - * @return array - */ - function &_smarty_cache_attrs($cache_serial, $count) { - $_cache_attrs =& $this->_cache_info['cache_attrs'][$cache_serial][$count]; - - if ($this->_cache_including) { - /* return next set of cache_attrs */ - $_return = current($_cache_attrs); - next($_cache_attrs); - return $_return; - - } else { - /* add a reference to a new set of cache_attrs */ - $_cache_attrs[] = array(); - return $_cache_attrs[count($_cache_attrs)-1]; - - } - - } - - - /** - * wrapper for include() retaining $this - * @return mixed - */ - function _include($filename, $once=false, $params=null) - { - if ($once) { - return include_once($filename); - } else { - return include($filename); - } - } - - - /** - * wrapper for eval() retaining $this - * @return mixed - */ - function _eval($code, $params=null) - { - return eval($code); - } - /**#@-*/ - -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/Smarty_Compiler.class.php b/gui/bacula-web/external_packages/smarty/Smarty_Compiler.class.php deleted file mode 100644 index 1b7217270f..0000000000 --- a/gui/bacula-web/external_packages/smarty/Smarty_Compiler.class.php +++ /dev/null @@ -1,2311 +0,0 @@ - - * @author Andrei Zmievski - * @version 2.6.10 - * @copyright 2001-2005 New Digital Group, Inc. - * @package Smarty - */ - -/* $Id$ */ - -/** - * Template compiling class - * @package Smarty - */ -class Smarty_Compiler extends Smarty { - - // internal vars - /**#@+ - * @access private - */ - var $_folded_blocks = array(); // keeps folded template blocks - var $_current_file = null; // the current template being compiled - var $_current_line_no = 1; // line number for error messages - var $_capture_stack = array(); // keeps track of nested capture buffers - var $_plugin_info = array(); // keeps track of plugins to load - var $_init_smarty_vars = false; - var $_permitted_tokens = array('true','false','yes','no','on','off','null'); - var $_db_qstr_regexp = null; // regexps are setup in the constructor - var $_si_qstr_regexp = null; - var $_qstr_regexp = null; - var $_func_regexp = null; - var $_reg_obj_regexp = null; - var $_var_bracket_regexp = null; - var $_num_const_regexp = null; - var $_dvar_guts_regexp = null; - var $_dvar_regexp = null; - var $_cvar_regexp = null; - var $_svar_regexp = null; - var $_avar_regexp = null; - var $_mod_regexp = null; - var $_var_regexp = null; - var $_parenth_param_regexp = null; - var $_func_call_regexp = null; - var $_obj_ext_regexp = null; - var $_obj_start_regexp = null; - var $_obj_params_regexp = null; - var $_obj_call_regexp = null; - var $_cacheable_state = 0; - var $_cache_attrs_count = 0; - var $_nocache_count = 0; - var $_cache_serial = null; - var $_cache_include = null; - - var $_strip_depth = 0; - var $_additional_newline = "\n"; - - /**#@-*/ - /** - * The class constructor. - */ - function Smarty_Compiler() - { - // matches double quoted strings: - // "foobar" - // "foo\"bar" - $this->_db_qstr_regexp = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"'; - - // matches single quoted strings: - // 'foobar' - // 'foo\'bar' - $this->_si_qstr_regexp = '\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\''; - - // matches single or double quoted strings - $this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')'; - - // matches bracket portion of vars - // [0] - // [foo] - // [$bar] - $this->_var_bracket_regexp = '\[\$?[\w\.]+\]'; - - // matches numerical constants - // 30 - // -12 - // 13.22 - $this->_num_const_regexp = '(?:\-?\d+(?:\.\d+)?)'; - - // matches $ vars (not objects): - // $foo - // $foo.bar - // $foo.bar.foobar - // $foo[0] - // $foo[$bar] - // $foo[5][blah] - // $foo[5].bar[$foobar][4] - $this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))'; - $this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]'; - $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp - . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?'; - $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp; - - // matches config vars: - // #foo# - // #foobar123_foo# - $this->_cvar_regexp = '\#\w+\#'; - - // matches section vars: - // %foo.bar% - $this->_svar_regexp = '\%\w+\.\w+\%'; - - // matches all valid variables (no quotes, no modifiers) - $this->_avar_regexp = '(?:' . $this->_dvar_regexp . '|' - . $this->_cvar_regexp . '|' . $this->_svar_regexp . ')'; - - // matches valid variable syntax: - // $foo - // $foo - // #foo# - // #foo# - // "text" - // "text" - $this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_qstr_regexp . ')'; - - // matches valid object call (one level of object nesting allowed in parameters): - // $foo->bar - // $foo->bar() - // $foo->bar("text") - // $foo->bar($foo, $bar, "text") - // $foo->bar($foo, "foo") - // $foo->bar->foo() - // $foo->bar->foo->bar() - // $foo->bar($foo->bar) - // $foo->bar($foo->bar()) - // $foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar)) - $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')'; - $this->_obj_restricted_param_regexp = '(?:' - . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')' - . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)'; - $this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|' - . $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)'; - $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp - . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)'; - $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)'; - $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)'; - - // matches valid modifier syntax: - // |foo - // |@foo - // |foo:"bar" - // |foo:$bar - // |foo:"bar":$foobar - // |foo|bar - // |foo:$foo->bar - $this->_mod_regexp = '(?:\|@?\w+(?::(?:\w+|' . $this->_num_const_regexp . '|' - . $this->_obj_call_regexp . '|' . $this->_avar_regexp . '|' . $this->_qstr_regexp .'))*)'; - - // matches valid function name: - // foo123 - // _foo_bar - $this->_func_regexp = '[a-zA-Z_]\w*'; - - // matches valid registered object: - // foo->bar - $this->_reg_obj_regexp = '[a-zA-Z_]\w*->[a-zA-Z_]\w*'; - - // matches valid parameter values: - // true - // $foo - // $foo|bar - // #foo# - // #foo#|bar - // "text" - // "text"|bar - // $foo->bar - $this->_param_regexp = '(?:\s*(?:' . $this->_obj_call_regexp . '|' - . $this->_var_regexp . '|' . $this->_num_const_regexp . '|\w+)(?>' . $this->_mod_regexp . '*)\s*)'; - - // matches valid parenthesised function parameters: - // - // "text" - // $foo, $bar, "text" - // $foo|bar, "foo"|bar, $foo->bar($foo)|bar - $this->_parenth_param_regexp = '(?:\((?:\w+|' - . $this->_param_regexp . '(?:\s*,\s*(?:(?:\w+|' - . $this->_param_regexp . ')))*)?\))'; - - // matches valid function call: - // foo() - // foo_bar($foo) - // _foo_bar($foo,"bar") - // foo123($foo,$foo->bar(),"foo") - $this->_func_call_regexp = '(?:' . $this->_func_regexp . '\s*(?:' - . $this->_parenth_param_regexp . '))'; - } - - /** - * compile a resource - * - * sets $compiled_content to the compiled source - * @param string $resource_name - * @param string $source_content - * @param string $compiled_content - * @return true - */ - function _compile_file($resource_name, $source_content, &$compiled_content) - { - - if ($this->security) { - // do not allow php syntax to be executed unless specified - if ($this->php_handling == SMARTY_PHP_ALLOW && - !$this->security_settings['PHP_HANDLING']) { - $this->php_handling = SMARTY_PHP_PASSTHRU; - } - } - - $this->_load_filters(); - - $this->_current_file = $resource_name; - $this->_current_line_no = 1; - $ldq = preg_quote($this->left_delimiter, '~'); - $rdq = preg_quote($this->right_delimiter, '~'); - - // run template source through prefilter functions - if (count($this->_plugins['prefilter']) > 0) { - foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) { - if ($prefilter === false) continue; - if ($prefilter[3] || is_callable($prefilter[0])) { - $source_content = call_user_func_array($prefilter[0], - array($source_content, &$this)); - $this->_plugins['prefilter'][$filter_name][3] = true; - } else { - $this->_trigger_fatal_error("[plugin] prefilter '$filter_name' is not implemented"); - } - } - } - - /* fetch all special blocks */ - $search = "~{$ldq}\*(.*?)\*{$rdq}|{$ldq}\s*literal\s*{$rdq}(.*?){$ldq}\s*/literal\s*{$rdq}|{$ldq}\s*php\s*{$rdq}(.*?){$ldq}\s*/php\s*{$rdq}~s"; - - preg_match_all($search, $source_content, $match, PREG_SET_ORDER); - $this->_folded_blocks = $match; - reset($this->_folded_blocks); - - /* replace special blocks by "{php}" */ - $source_content = preg_replace($search.'e', "'" - . $this->_quote_replace($this->left_delimiter) . 'php' - . "' . str_repeat(\"\n\", substr_count('\\0', \"\n\")) .'" - . $this->_quote_replace($this->right_delimiter) - . "'" - , $source_content); - - /* Gather all template tags. */ - preg_match_all("~{$ldq}\s*(.*?)\s*{$rdq}~s", $source_content, $_match); - $template_tags = $_match[1]; - /* Split content by template tags to obtain non-template content. */ - $text_blocks = preg_split("~{$ldq}.*?{$rdq}~s", $source_content); - - /* loop through text blocks */ - for ($curr_tb = 0, $for_max = count($text_blocks); $curr_tb < $for_max; $curr_tb++) { - /* match anything resembling php tags */ - if (preg_match_all('~(<\?(?:\w+|=)?|\?>|language\s*=\s*[\"\']?php[\"\']?)~is', $text_blocks[$curr_tb], $sp_match)) { - /* replace tags with placeholders to prevent recursive replacements */ - $sp_match[1] = array_unique($sp_match[1]); - usort($sp_match[1], '_smarty_sort_length'); - for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) { - $text_blocks[$curr_tb] = str_replace($sp_match[1][$curr_sp],'%%%SMARTYSP'.$curr_sp.'%%%',$text_blocks[$curr_tb]); - } - /* process each one */ - for ($curr_sp = 0, $for_max2 = count($sp_match[1]); $curr_sp < $for_max2; $curr_sp++) { - if ($this->php_handling == SMARTY_PHP_PASSTHRU) { - /* echo php contents */ - $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', ''."\n", $text_blocks[$curr_tb]); - } else if ($this->php_handling == SMARTY_PHP_QUOTE) { - /* quote php tags */ - $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', htmlspecialchars($sp_match[1][$curr_sp]), $text_blocks[$curr_tb]); - } else if ($this->php_handling == SMARTY_PHP_REMOVE) { - /* remove php tags */ - $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', '', $text_blocks[$curr_tb]); - } else { - /* SMARTY_PHP_ALLOW, but echo non php starting tags */ - $sp_match[1][$curr_sp] = preg_replace('~(<\?(?!php|=|$))~i', ''."\n", $sp_match[1][$curr_sp]); - $text_blocks[$curr_tb] = str_replace('%%%SMARTYSP'.$curr_sp.'%%%', $sp_match[1][$curr_sp], $text_blocks[$curr_tb]); - } - } - } - } - - /* Compile the template tags into PHP code. */ - $compiled_tags = array(); - for ($i = 0, $for_max = count($template_tags); $i < $for_max; $i++) { - $this->_current_line_no += substr_count($text_blocks[$i], "\n"); - $compiled_tags[] = $this->_compile_tag($template_tags[$i]); - $this->_current_line_no += substr_count($template_tags[$i], "\n"); - } - if (count($this->_tag_stack)>0) { - list($_open_tag, $_line_no) = end($this->_tag_stack); - $this->_syntax_error("unclosed tag \{$_open_tag} (opened line $_line_no).", E_USER_ERROR, __FILE__, __LINE__); - return; - } - - /* Reformat $text_blocks between 'strip' and '/strip' tags, - removing spaces, tabs and newlines. */ - $strip = false; - for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) { - if ($compiled_tags[$i] == '{strip}') { - $compiled_tags[$i] = ''; - $strip = true; - /* remove leading whitespaces */ - $text_blocks[$i + 1] = ltrim($text_blocks[$i + 1]); - } - if ($strip) { - /* strip all $text_blocks before the next '/strip' */ - for ($j = $i + 1; $j < $for_max; $j++) { - /* remove leading and trailing whitespaces of each line */ - $text_blocks[$j] = preg_replace('![\t ]*[\r\n]+[\t ]*!', '', $text_blocks[$j]); - if ($compiled_tags[$j] == '{/strip}') { - /* remove trailing whitespaces from the last text_block */ - $text_blocks[$j] = rtrim($text_blocks[$j]); - } - $text_blocks[$j] = ""\'", "\\"=>"\\\\")) . "'; ?>"; - if ($compiled_tags[$j] == '{/strip}') { - $compiled_tags[$j] = "\n"; /* slurped by php, but necessary - if a newline is following the closing strip-tag */ - $strip = false; - $i = $j; - break; - } - } - } - } - $compiled_content = ''; - - /* Interleave the compiled contents and text blocks to get the final result. */ - for ($i = 0, $for_max = count($compiled_tags); $i < $for_max; $i++) { - if ($compiled_tags[$i] == '') { - // tag result empty, remove first newline from following text block - $text_blocks[$i+1] = preg_replace('~^(\r\n|\r|\n)~', '', $text_blocks[$i+1]); - } - $compiled_content .= $text_blocks[$i].$compiled_tags[$i]; - } - $compiled_content .= $text_blocks[$i]; - - // remove \n from the end of the file, if any - if (($_len=strlen($compiled_content)) && ($compiled_content{$_len - 1} == "\n" )) { - $compiled_content = substr($compiled_content, 0, -1); - } - - if (!empty($this->_cache_serial)) { - $compiled_content = "_cache_serials['".$this->_cache_include."'] = '".$this->_cache_serial."'; ?>" . $compiled_content; - } - - // remove unnecessary close/open tags - $compiled_content = preg_replace('~\?>\n?<\?php~', '', $compiled_content); - - // run compiled template through postfilter functions - if (count($this->_plugins['postfilter']) > 0) { - foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) { - if ($postfilter === false) continue; - if ($postfilter[3] || is_callable($postfilter[0])) { - $compiled_content = call_user_func_array($postfilter[0], - array($compiled_content, &$this)); - $this->_plugins['postfilter'][$filter_name][3] = true; - } else { - $this->_trigger_fatal_error("Smarty plugin error: postfilter '$filter_name' is not implemented"); - } - } - } - - // put header at the top of the compiled template - $template_header = "_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n"; - $template_header .= " compiled from ".strtr(urlencode($resource_name), array('%2F'=>'/', '%3A'=>':'))." */ ?>\n"; - - /* Emit code to load needed plugins. */ - $this->_plugins_code = ''; - if (count($this->_plugin_info)) { - $_plugins_params = "array('plugins' => array("; - foreach ($this->_plugin_info as $plugin_type => $plugins) { - foreach ($plugins as $plugin_name => $plugin_info) { - $_plugins_params .= "array('$plugin_type', '$plugin_name', '" . strtr($plugin_info[0], array("'" => "\\'", "\\" => "\\\\")) . "', $plugin_info[1], "; - $_plugins_params .= $plugin_info[2] ? 'true),' : 'false),'; - } - } - $_plugins_params .= '))'; - $plugins_code = "\n"; - $template_header .= $plugins_code; - $this->_plugin_info = array(); - $this->_plugins_code = $plugins_code; - } - - if ($this->_init_smarty_vars) { - $template_header .= "\n"; - $this->_init_smarty_vars = false; - } - - $compiled_content = $template_header . $compiled_content; - return true; - } - - /** - * Compile a template tag - * - * @param string $template_tag - * @return string - */ - function _compile_tag($template_tag) - { - /* Matched comment. */ - if ($template_tag{0} == '*' && $template_tag{strlen($template_tag) - 1} == '*') - return ''; - - /* Split tag into two three parts: command, command modifiers and the arguments. */ - if(! preg_match('~^(?:(' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp - . '|\/?' . $this->_reg_obj_regexp . '|\/?' . $this->_func_regexp . ')(' . $this->_mod_regexp . '*)) - (?:\s+(.*))?$ - ~xs', $template_tag, $match)) { - $this->_syntax_error("unrecognized tag: $template_tag", E_USER_ERROR, __FILE__, __LINE__); - } - - $tag_command = $match[1]; - $tag_modifier = isset($match[2]) ? $match[2] : null; - $tag_args = isset($match[3]) ? $match[3] : null; - - if (preg_match('~^' . $this->_num_const_regexp . '|' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '$~', $tag_command)) { - /* tag name is a variable or object */ - $_return = $this->_parse_var_props($tag_command . $tag_modifier); - return "" . $this->_additional_newline; - } - - /* If the tag name is a registered object, we process it. */ - if (preg_match('~^\/?' . $this->_reg_obj_regexp . '$~', $tag_command)) { - return $this->_compile_registered_object_tag($tag_command, $this->_parse_attrs($tag_args), $tag_modifier); - } - - switch ($tag_command) { - case 'include': - return $this->_compile_include_tag($tag_args); - - case 'include_php': - return $this->_compile_include_php_tag($tag_args); - - case 'if': - $this->_push_tag('if'); - return $this->_compile_if_tag($tag_args); - - case 'else': - list($_open_tag) = end($this->_tag_stack); - if ($_open_tag != 'if' && $_open_tag != 'elseif') - $this->_syntax_error('unexpected {else}', E_USER_ERROR, __FILE__, __LINE__); - else - $this->_push_tag('else'); - return ''; - - case 'elseif': - list($_open_tag) = end($this->_tag_stack); - if ($_open_tag != 'if' && $_open_tag != 'elseif') - $this->_syntax_error('unexpected {elseif}', E_USER_ERROR, __FILE__, __LINE__); - if ($_open_tag == 'if') - $this->_push_tag('elseif'); - return $this->_compile_if_tag($tag_args, true); - - case '/if': - $this->_pop_tag('if'); - return ''; - - case 'capture': - return $this->_compile_capture_tag(true, $tag_args); - - case '/capture': - return $this->_compile_capture_tag(false); - - case 'ldelim': - return $this->left_delimiter; - - case 'rdelim': - return $this->right_delimiter; - - case 'section': - $this->_push_tag('section'); - return $this->_compile_section_start($tag_args); - - case 'sectionelse': - $this->_push_tag('sectionelse'); - return ""; - break; - - case '/section': - $_open_tag = $this->_pop_tag('section'); - if ($_open_tag == 'sectionelse') - return ""; - else - return ""; - - case 'foreach': - $this->_push_tag('foreach'); - return $this->_compile_foreach_start($tag_args); - break; - - case 'foreachelse': - $this->_push_tag('foreachelse'); - return ""; - - case '/foreach': - $_open_tag = $this->_pop_tag('foreach'); - if ($_open_tag == 'foreachelse') - return ""; - else - return ""; - break; - - case 'strip': - case '/strip': - if ($tag_command{0}=='/') { - $this->_pop_tag('strip'); - if (--$this->_strip_depth==0) { /* outermost closing {/strip} */ - $this->_additional_newline = "\n"; - return '{' . $tag_command . '}'; - } - } else { - $this->_push_tag('strip'); - if ($this->_strip_depth++==0) { /* outermost opening {strip} */ - $this->_additional_newline = ""; - return '{' . $tag_command . '}'; - } - } - return ''; - - case 'php': - /* handle folded tags replaced by {php} */ - list(, $block) = each($this->_folded_blocks); - $this->_current_line_no += substr_count($block[0], "\n"); - /* the number of matched elements in the regexp in _compile_file() - determins the type of folded tag that was found */ - switch (count($block)) { - case 2: /* comment */ - return ''; - - case 3: /* literal */ - return ""\'", "\\"=>"\\\\")) . "'; ?>" . $this->_additional_newline; - - case 4: /* php */ - if ($this->security && !$this->security_settings['PHP_TAGS']) { - $this->_syntax_error("(secure mode) php tags not permitted", E_USER_WARNING, __FILE__, __LINE__); - return; - } - return ''; - } - break; - - case 'insert': - return $this->_compile_insert_tag($tag_args); - - default: - if ($this->_compile_compiler_tag($tag_command, $tag_args, $output)) { - return $output; - } else if ($this->_compile_block_tag($tag_command, $tag_args, $tag_modifier, $output)) { - return $output; - } else if ($this->_compile_custom_tag($tag_command, $tag_args, $tag_modifier, $output)) { - return $output; - } else { - $this->_syntax_error("unrecognized tag '$tag_command'", E_USER_ERROR, __FILE__, __LINE__); - } - - } - } - - - /** - * compile the custom compiler tag - * - * sets $output to the compiled custom compiler tag - * @param string $tag_command - * @param string $tag_args - * @param string $output - * @return boolean - */ - function _compile_compiler_tag($tag_command, $tag_args, &$output) - { - $found = false; - $have_function = true; - - /* - * First we check if the compiler function has already been registered - * or loaded from a plugin file. - */ - if (isset($this->_plugins['compiler'][$tag_command])) { - $found = true; - $plugin_func = $this->_plugins['compiler'][$tag_command][0]; - if (!is_callable($plugin_func)) { - $message = "compiler function '$tag_command' is not implemented"; - $have_function = false; - } - } - /* - * Otherwise we need to load plugin file and look for the function - * inside it. - */ - else if ($plugin_file = $this->_get_plugin_filepath('compiler', $tag_command)) { - $found = true; - - include_once $plugin_file; - - $plugin_func = 'smarty_compiler_' . $tag_command; - if (!is_callable($plugin_func)) { - $message = "plugin function $plugin_func() not found in $plugin_file\n"; - $have_function = false; - } else { - $this->_plugins['compiler'][$tag_command] = array($plugin_func, null, null, null, true); - } - } - - /* - * True return value means that we either found a plugin or a - * dynamically registered function. False means that we didn't and the - * compiler should now emit code to load custom function plugin for this - * tag. - */ - if ($found) { - if ($have_function) { - $output = call_user_func_array($plugin_func, array($tag_args, &$this)); - if($output != '') { - $output = '_push_cacheable_state('compiler', $tag_command) - . $output - . $this->_pop_cacheable_state('compiler', $tag_command) . ' ?>'; - } - } else { - $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__); - } - return true; - } else { - return false; - } - } - - - /** - * compile block function tag - * - * sets $output to compiled block function tag - * @param string $tag_command - * @param string $tag_args - * @param string $tag_modifier - * @param string $output - * @return boolean - */ - function _compile_block_tag($tag_command, $tag_args, $tag_modifier, &$output) - { - if ($tag_command{0} == '/') { - $start_tag = false; - $tag_command = substr($tag_command, 1); - } else - $start_tag = true; - - $found = false; - $have_function = true; - - /* - * First we check if the block function has already been registered - * or loaded from a plugin file. - */ - if (isset($this->_plugins['block'][$tag_command])) { - $found = true; - $plugin_func = $this->_plugins['block'][$tag_command][0]; - if (!is_callable($plugin_func)) { - $message = "block function '$tag_command' is not implemented"; - $have_function = false; - } - } - /* - * Otherwise we need to load plugin file and look for the function - * inside it. - */ - else if ($plugin_file = $this->_get_plugin_filepath('block', $tag_command)) { - $found = true; - - include_once $plugin_file; - - $plugin_func = 'smarty_block_' . $tag_command; - if (!function_exists($plugin_func)) { - $message = "plugin function $plugin_func() not found in $plugin_file\n"; - $have_function = false; - } else { - $this->_plugins['block'][$tag_command] = array($plugin_func, null, null, null, true); - - } - } - - if (!$found) { - return false; - } else if (!$have_function) { - $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__); - return true; - } - - /* - * Even though we've located the plugin function, compilation - * happens only once, so the plugin will still need to be loaded - * at runtime for future requests. - */ - $this->_add_plugin('block', $tag_command); - - if ($start_tag) - $this->_push_tag($tag_command); - else - $this->_pop_tag($tag_command); - - if ($start_tag) { - $output = '_push_cacheable_state('block', $tag_command); - $attrs = $this->_parse_attrs($tag_args); - $arg_list = $this->_compile_arg_list('block', $tag_command, $attrs, $_cache_attrs=''); - $output .= "$_cache_attrs\$this->_tag_stack[] = array('$tag_command', array(".implode(',', $arg_list).')); '; - $output .= $this->_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], null, $this, $_block_repeat=true);'; - $output .= 'while ($_block_repeat) { ob_start(); ?>'; - } else { - $output = '_compile_plugin_call('block', $tag_command).'($this->_tag_stack[count($this->_tag_stack)-1][1], $_block_content, $this, $_block_repeat=false)'; - if ($tag_modifier != '') { - $this->_parse_modifiers($_out_tag_text, $tag_modifier); - } - $output .= 'echo '.$_out_tag_text.'; } '; - $output .= " array_pop(\$this->_tag_stack); " . $this->_pop_cacheable_state('block', $tag_command) . '?>'; - } - - return true; - } - - - /** - * compile custom function tag - * - * @param string $tag_command - * @param string $tag_args - * @param string $tag_modifier - * @return string - */ - function _compile_custom_tag($tag_command, $tag_args, $tag_modifier, &$output) - { - $found = false; - $have_function = true; - - /* - * First we check if the custom function has already been registered - * or loaded from a plugin file. - */ - if (isset($this->_plugins['function'][$tag_command])) { - $found = true; - $plugin_func = $this->_plugins['function'][$tag_command][0]; - if (!is_callable($plugin_func)) { - $message = "custom function '$tag_command' is not implemented"; - $have_function = false; - } - } - /* - * Otherwise we need to load plugin file and look for the function - * inside it. - */ - else if ($plugin_file = $this->_get_plugin_filepath('function', $tag_command)) { - $found = true; - - include_once $plugin_file; - - $plugin_func = 'smarty_function_' . $tag_command; - if (!function_exists($plugin_func)) { - $message = "plugin function $plugin_func() not found in $plugin_file\n"; - $have_function = false; - } else { - $this->_plugins['function'][$tag_command] = array($plugin_func, null, null, null, true); - - } - } - - if (!$found) { - return false; - } else if (!$have_function) { - $this->_syntax_error($message, E_USER_WARNING, __FILE__, __LINE__); - return true; - } - - /* declare plugin to be loaded on display of the template that - we compile right now */ - $this->_add_plugin('function', $tag_command); - - $_cacheable_state = $this->_push_cacheable_state('function', $tag_command); - $attrs = $this->_parse_attrs($tag_args); - $arg_list = $this->_compile_arg_list('function', $tag_command, $attrs, $_cache_attrs=''); - - $output = $this->_compile_plugin_call('function', $tag_command).'(array('.implode(',', $arg_list)."), \$this)"; - if($tag_modifier != '') { - $this->_parse_modifiers($output, $tag_modifier); - } - - if($output != '') { - $output = '_pop_cacheable_state('function', $tag_command) . "?>" . $this->_additional_newline; - } - - return true; - } - - /** - * compile a registered object tag - * - * @param string $tag_command - * @param array $attrs - * @param string $tag_modifier - * @return string - */ - function _compile_registered_object_tag($tag_command, $attrs, $tag_modifier) - { - if ($tag_command{0} == '/') { - $start_tag = false; - $tag_command = substr($tag_command, 1); - } else { - $start_tag = true; - } - - list($object, $obj_comp) = explode('->', $tag_command); - - $arg_list = array(); - if(count($attrs)) { - $_assign_var = false; - foreach ($attrs as $arg_name => $arg_value) { - if($arg_name == 'assign') { - $_assign_var = $arg_value; - unset($attrs['assign']); - continue; - } - if (is_bool($arg_value)) - $arg_value = $arg_value ? 'true' : 'false'; - $arg_list[] = "'$arg_name' => $arg_value"; - } - } - - if($this->_reg_objects[$object][2]) { - // smarty object argument format - $args = "array(".implode(',', (array)$arg_list)."), \$this"; - } else { - // traditional argument format - $args = implode(',', array_values($attrs)); - if (empty($args)) { - $args = 'null'; - } - } - - $prefix = ''; - $postfix = ''; - $newline = ''; - if(!is_object($this->_reg_objects[$object][0])) { - $this->_trigger_fatal_error("registered '$object' is not an object" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__); - } elseif(!empty($this->_reg_objects[$object][1]) && !in_array($obj_comp, $this->_reg_objects[$object][1])) { - $this->_trigger_fatal_error("'$obj_comp' is not a registered component of object '$object'", $this->_current_file, $this->_current_line_no, __FILE__, __LINE__); - } elseif(method_exists($this->_reg_objects[$object][0], $obj_comp)) { - // method - if(in_array($obj_comp, $this->_reg_objects[$object][3])) { - // block method - if ($start_tag) { - $prefix = "\$this->_tag_stack[] = array('$obj_comp', $args); "; - $prefix .= "\$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], null, \$this, \$_block_repeat=true); "; - $prefix .= "while (\$_block_repeat) { ob_start();"; - $return = null; - $postfix = ''; - } else { - $prefix = "\$_obj_block_content = ob_get_contents(); ob_end_clean(); "; - $return = "\$this->_reg_objects['$object'][0]->$obj_comp(\$this->_tag_stack[count(\$this->_tag_stack)-1][1], \$_obj_block_content, \$this, \$_block_repeat=false)"; - $postfix = "} array_pop(\$this->_tag_stack);"; - } - } else { - // non-block method - $return = "\$this->_reg_objects['$object'][0]->$obj_comp($args)"; - } - } else { - // property - $return = "\$this->_reg_objects['$object'][0]->$obj_comp"; - } - - if($return != null) { - if($tag_modifier != '') { - $this->_parse_modifiers($return, $tag_modifier); - } - - if(!empty($_assign_var)) { - $output = "\$this->assign('" . $this->_dequote($_assign_var) ."', $return);"; - } else { - $output = 'echo ' . $return . ';'; - $newline = $this->_additional_newline; - } - } else { - $output = ''; - } - - return '" . $newline; - } - - /** - * Compile {insert ...} tag - * - * @param string $tag_args - * @return string - */ - function _compile_insert_tag($tag_args) - { - $attrs = $this->_parse_attrs($tag_args); - $name = $this->_dequote($attrs['name']); - - if (empty($name)) { - $this->_syntax_error("missing insert name", E_USER_ERROR, __FILE__, __LINE__); - } - - if (!empty($attrs['script'])) { - $delayed_loading = true; - } else { - $delayed_loading = false; - } - - foreach ($attrs as $arg_name => $arg_value) { - if (is_bool($arg_value)) - $arg_value = $arg_value ? 'true' : 'false'; - $arg_list[] = "'$arg_name' => $arg_value"; - } - - $this->_add_plugin('insert', $name, $delayed_loading); - - $_params = "array('args' => array(".implode(', ', (array)$arg_list)."))"; - - return "" . $this->_additional_newline; - } - - /** - * Compile {include ...} tag - * - * @param string $tag_args - * @return string - */ - function _compile_include_tag($tag_args) - { - $attrs = $this->_parse_attrs($tag_args); - $arg_list = array(); - - if (empty($attrs['file'])) { - $this->_syntax_error("missing 'file' attribute in include tag", E_USER_ERROR, __FILE__, __LINE__); - } - - foreach ($attrs as $arg_name => $arg_value) { - if ($arg_name == 'file') { - $include_file = $arg_value; - continue; - } else if ($arg_name == 'assign') { - $assign_var = $arg_value; - continue; - } - if (is_bool($arg_value)) - $arg_value = $arg_value ? 'true' : 'false'; - $arg_list[] = "'$arg_name' => $arg_value"; - } - - $output = '_tpl_vars;\n"; - - - $_params = "array('smarty_include_tpl_file' => " . $include_file . ", 'smarty_include_vars' => array(".implode(',', (array)$arg_list)."))"; - $output .= "\$this->_smarty_include($_params);\n" . - "\$this->_tpl_vars = \$_smarty_tpl_vars;\n" . - "unset(\$_smarty_tpl_vars);\n"; - - if (isset($assign_var)) { - $output .= "\$this->assign(" . $assign_var . ", ob_get_contents()); ob_end_clean();\n"; - } - - $output .= ' ?>'; - - return $output; - - } - - /** - * Compile {include ...} tag - * - * @param string $tag_args - * @return string - */ - function _compile_include_php_tag($tag_args) - { - $attrs = $this->_parse_attrs($tag_args); - - if (empty($attrs['file'])) { - $this->_syntax_error("missing 'file' attribute in include_php tag", E_USER_ERROR, __FILE__, __LINE__); - } - - $assign_var = (empty($attrs['assign'])) ? '' : $this->_dequote($attrs['assign']); - $once_var = (empty($attrs['once']) || $attrs['once']=='false') ? 'false' : 'true'; - - $arg_list = array(); - foreach($attrs as $arg_name => $arg_value) { - if($arg_name != 'file' AND $arg_name != 'once' AND $arg_name != 'assign') { - if(is_bool($arg_value)) - $arg_value = $arg_value ? 'true' : 'false'; - $arg_list[] = "'$arg_name' => $arg_value"; - } - } - - $_params = "array('smarty_file' => " . $attrs['file'] . ", 'smarty_assign' => '$assign_var', 'smarty_once' => $once_var, 'smarty_include_vars' => array(".implode(',', $arg_list)."))"; - - return "" . $this->_additional_newline; - } - - - /** - * Compile {section ...} tag - * - * @param string $tag_args - * @return string - */ - function _compile_section_start($tag_args) - { - $attrs = $this->_parse_attrs($tag_args); - $arg_list = array(); - - $output = '_syntax_error("missing section name", E_USER_ERROR, __FILE__, __LINE__); - } - - $output .= "unset(\$this->_sections[$section_name]);\n"; - $section_props = "\$this->_sections[$section_name]"; - - foreach ($attrs as $attr_name => $attr_value) { - switch ($attr_name) { - case 'loop': - $output .= "{$section_props}['loop'] = is_array(\$_loop=$attr_value) ? count(\$_loop) : max(0, (int)\$_loop); unset(\$_loop);\n"; - break; - - case 'show': - if (is_bool($attr_value)) - $show_attr_value = $attr_value ? 'true' : 'false'; - else - $show_attr_value = "(bool)$attr_value"; - $output .= "{$section_props}['show'] = $show_attr_value;\n"; - break; - - case 'name': - $output .= "{$section_props}['$attr_name'] = $attr_value;\n"; - break; - - case 'max': - case 'start': - $output .= "{$section_props}['$attr_name'] = (int)$attr_value;\n"; - break; - - case 'step': - $output .= "{$section_props}['$attr_name'] = ((int)$attr_value) == 0 ? 1 : (int)$attr_value;\n"; - break; - - default: - $this->_syntax_error("unknown section attribute - '$attr_name'", E_USER_ERROR, __FILE__, __LINE__); - break; - } - } - - if (!isset($attrs['show'])) - $output .= "{$section_props}['show'] = true;\n"; - - if (!isset($attrs['loop'])) - $output .= "{$section_props}['loop'] = 1;\n"; - - if (!isset($attrs['max'])) - $output .= "{$section_props}['max'] = {$section_props}['loop'];\n"; - else - $output .= "if ({$section_props}['max'] < 0)\n" . - " {$section_props}['max'] = {$section_props}['loop'];\n"; - - if (!isset($attrs['step'])) - $output .= "{$section_props}['step'] = 1;\n"; - - if (!isset($attrs['start'])) - $output .= "{$section_props}['start'] = {$section_props}['step'] > 0 ? 0 : {$section_props}['loop']-1;\n"; - else { - $output .= "if ({$section_props}['start'] < 0)\n" . - " {$section_props}['start'] = max({$section_props}['step'] > 0 ? 0 : -1, {$section_props}['loop'] + {$section_props}['start']);\n" . - "else\n" . - " {$section_props}['start'] = min({$section_props}['start'], {$section_props}['step'] > 0 ? {$section_props}['loop'] : {$section_props}['loop']-1);\n"; - } - - $output .= "if ({$section_props}['show']) {\n"; - if (!isset($attrs['start']) && !isset($attrs['step']) && !isset($attrs['max'])) { - $output .= " {$section_props}['total'] = {$section_props}['loop'];\n"; - } else { - $output .= " {$section_props}['total'] = min(ceil(({$section_props}['step'] > 0 ? {$section_props}['loop'] - {$section_props}['start'] : {$section_props}['start']+1)/abs({$section_props}['step'])), {$section_props}['max']);\n"; - } - $output .= " if ({$section_props}['total'] == 0)\n" . - " {$section_props}['show'] = false;\n" . - "} else\n" . - " {$section_props}['total'] = 0;\n"; - - $output .= "if ({$section_props}['show']):\n"; - $output .= " - for ({$section_props}['index'] = {$section_props}['start'], {$section_props}['iteration'] = 1; - {$section_props}['iteration'] <= {$section_props}['total']; - {$section_props}['index'] += {$section_props}['step'], {$section_props}['iteration']++):\n"; - $output .= "{$section_props}['rownum'] = {$section_props}['iteration'];\n"; - $output .= "{$section_props}['index_prev'] = {$section_props}['index'] - {$section_props}['step'];\n"; - $output .= "{$section_props}['index_next'] = {$section_props}['index'] + {$section_props}['step'];\n"; - $output .= "{$section_props}['first'] = ({$section_props}['iteration'] == 1);\n"; - $output .= "{$section_props}['last'] = ({$section_props}['iteration'] == {$section_props}['total']);\n"; - - $output .= "?>"; - - return $output; - } - - - /** - * Compile {foreach ...} tag. - * - * @param string $tag_args - * @return string - */ - function _compile_foreach_start($tag_args) - { - $attrs = $this->_parse_attrs($tag_args); - $arg_list = array(); - - if (empty($attrs['from'])) { - return $this->_syntax_error("foreach: missing 'from' attribute", E_USER_ERROR, __FILE__, __LINE__); - } - $from = $attrs['from']; - - if (empty($attrs['item'])) { - return $this->_syntax_error("foreach: missing 'item' attribute", E_USER_ERROR, __FILE__, __LINE__); - } - $item = $this->_dequote($attrs['item']); - if (!preg_match('~^\w+$~', $item)) { - return $this->_syntax_error("'foreach: item' must be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__); - } - - if (isset($attrs['key'])) { - $key = $this->_dequote($attrs['key']); - if (!preg_match('~^\w+$~', $key)) { - return $this->_syntax_error("foreach: 'key' must to be a variable name (literal string)", E_USER_ERROR, __FILE__, __LINE__); - } - $key_part = "\$this->_tpl_vars['$key'] => "; - } else { - $key = null; - $key_part = ''; - } - - if (isset($attrs['name'])) { - $name = $attrs['name']; - } else { - $name = null; - } - - $output = '_foreach[$name]"; - $output .= "{$foreach_props} = array('total' => count(\$_from), 'iteration' => 0);\n"; - $output .= "if ({$foreach_props}['total'] > 0):\n"; - $output .= " foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n"; - $output .= " {$foreach_props}['iteration']++;\n"; - } else { - $output .= "if (count(\$_from)):\n"; - $output .= " foreach (\$_from as $key_part\$this->_tpl_vars['$item']):\n"; - } - $output .= '?>'; - - return $output; - } - - - /** - * Compile {capture} .. {/capture} tags - * - * @param boolean $start true if this is the {capture} tag - * @param string $tag_args - * @return string - */ - - function _compile_capture_tag($start, $tag_args = '') - { - $attrs = $this->_parse_attrs($tag_args); - - if ($start) { - if (isset($attrs['name'])) - $buffer = $attrs['name']; - else - $buffer = "'default'"; - - if (isset($attrs['assign'])) - $assign = $attrs['assign']; - else - $assign = null; - $output = ""; - $this->_capture_stack[] = array($buffer, $assign); - } else { - list($buffer, $assign) = array_pop($this->_capture_stack); - $output = "_smarty_vars['capture'][$buffer] = ob_get_contents(); "; - if (isset($assign)) { - $output .= " \$this->assign($assign, ob_get_contents());"; - } - $output .= "ob_end_clean(); ?>"; - } - - return $output; - } - - /** - * Compile {if ...} tag - * - * @param string $tag_args - * @param boolean $elseif if true, uses elseif instead of if - * @return string - */ - function _compile_if_tag($tag_args, $elseif = false) - { - - /* Tokenize args for 'if' tag. */ - preg_match_all('~(?> - ' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*)? | # valid object call - ' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)? | # var or quoted string - \-?0[xX][0-9a-fA-F]+|\-?\d+(?:\.\d+)?|\.\d+|!==|===|==|!=|<>|<<|>>|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|\&|\~|<|>|\||\%|\+|\-|\/|\*|\@ | # valid non-word token - \b\w+\b | # valid word token - \S+ # anything else - )~x', $tag_args, $match); - - $tokens = $match[0]; - - if(empty($tokens)) { - $_error_msg .= $elseif ? "'elseif'" : "'if'"; - $_error_msg .= ' statement requires arguments'; - $this->_syntax_error($_error_msg, E_USER_ERROR, __FILE__, __LINE__); - } - - - // make sure we have balanced parenthesis - $token_count = array_count_values($tokens); - if(isset($token_count['(']) && $token_count['('] != $token_count[')']) { - $this->_syntax_error("unbalanced parenthesis in if statement", E_USER_ERROR, __FILE__, __LINE__); - } - - $is_arg_stack = array(); - - for ($i = 0; $i < count($tokens); $i++) { - - $token = &$tokens[$i]; - - switch (strtolower($token)) { - case '!': - case '%': - case '!==': - case '==': - case '===': - case '>': - case '<': - case '!=': - case '<>': - case '<<': - case '>>': - case '<=': - case '>=': - case '&&': - case '||': - case '|': - case '^': - case '&': - case '~': - case ')': - case ',': - case '+': - case '-': - case '*': - case '/': - case '@': - break; - - case 'eq': - $token = '=='; - break; - - case 'ne': - case 'neq': - $token = '!='; - break; - - case 'lt': - $token = '<'; - break; - - case 'le': - case 'lte': - $token = '<='; - break; - - case 'gt': - $token = '>'; - break; - - case 'ge': - case 'gte': - $token = '>='; - break; - - case 'and': - $token = '&&'; - break; - - case 'or': - $token = '||'; - break; - - case 'not': - $token = '!'; - break; - - case 'mod': - $token = '%'; - break; - - case '(': - array_push($is_arg_stack, $i); - break; - - case 'is': - /* If last token was a ')', we operate on the parenthesized - expression. The start of the expression is on the stack. - Otherwise, we operate on the last encountered token. */ - if ($tokens[$i-1] == ')') - $is_arg_start = array_pop($is_arg_stack); - else - $is_arg_start = $i-1; - /* Construct the argument for 'is' expression, so it knows - what to operate on. */ - $is_arg = implode(' ', array_slice($tokens, $is_arg_start, $i - $is_arg_start)); - - /* Pass all tokens from next one until the end to the - 'is' expression parsing function. The function will - return modified tokens, where the first one is the result - of the 'is' expression and the rest are the tokens it - didn't touch. */ - $new_tokens = $this->_parse_is_expr($is_arg, array_slice($tokens, $i+1)); - - /* Replace the old tokens with the new ones. */ - array_splice($tokens, $is_arg_start, count($tokens), $new_tokens); - - /* Adjust argument start so that it won't change from the - current position for the next iteration. */ - $i = $is_arg_start; - break; - - default: - if(preg_match('~^' . $this->_func_regexp . '$~', $token) ) { - // function call - if($this->security && - !in_array($token, $this->security_settings['IF_FUNCS'])) { - $this->_syntax_error("(secure mode) '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__); - } - } elseif(preg_match('~^' . $this->_var_regexp . '$~', $token) && isset($tokens[$i+1]) && $tokens[$i+1] == '(') { - // variable function call - $this->_syntax_error("variable function call '$token' not allowed in if statement", E_USER_ERROR, __FILE__, __LINE__); - } elseif(preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*)$~', $token)) { - // object or variable - $token = $this->_parse_var_props($token); - } elseif(is_numeric($token)) { - // number, skip it - } else { - $this->_syntax_error("unidentified token '$token'", E_USER_ERROR, __FILE__, __LINE__); - } - break; - } - } - - if ($elseif) - return ''; - else - return ''; - } - - - function _compile_arg_list($type, $name, $attrs, &$cache_code) { - $arg_list = array(); - - if (isset($type) && isset($name) - && isset($this->_plugins[$type]) - && isset($this->_plugins[$type][$name]) - && empty($this->_plugins[$type][$name][4]) - && is_array($this->_plugins[$type][$name][5]) - ) { - /* we have a list of parameters that should be cached */ - $_cache_attrs = $this->_plugins[$type][$name][5]; - $_count = $this->_cache_attrs_count++; - $cache_code = "\$_cache_attrs =& \$this->_smarty_cache_attrs('$this->_cache_serial','$_count');"; - - } else { - /* no parameters are cached */ - $_cache_attrs = null; - } - - foreach ($attrs as $arg_name => $arg_value) { - if (is_bool($arg_value)) - $arg_value = $arg_value ? 'true' : 'false'; - if (is_null($arg_value)) - $arg_value = 'null'; - if ($_cache_attrs && in_array($arg_name, $_cache_attrs)) { - $arg_list[] = "'$arg_name' => (\$this->_cache_including) ? \$_cache_attrs['$arg_name'] : (\$_cache_attrs['$arg_name']=$arg_value)"; - } else { - $arg_list[] = "'$arg_name' => $arg_value"; - } - } - return $arg_list; - } - - /** - * Parse is expression - * - * @param string $is_arg - * @param array $tokens - * @return array - */ - function _parse_is_expr($is_arg, $tokens) - { - $expr_end = 0; - $negate_expr = false; - - if (($first_token = array_shift($tokens)) == 'not') { - $negate_expr = true; - $expr_type = array_shift($tokens); - } else - $expr_type = $first_token; - - switch ($expr_type) { - case 'even': - if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { - $expr_end++; - $expr_arg = $tokens[$expr_end++]; - $expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; - } else - $expr = "!(1 & $is_arg)"; - break; - - case 'odd': - if (isset($tokens[$expr_end]) && $tokens[$expr_end] == 'by') { - $expr_end++; - $expr_arg = $tokens[$expr_end++]; - $expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))"; - } else - $expr = "(1 & $is_arg)"; - break; - - case 'div': - if (@$tokens[$expr_end] == 'by') { - $expr_end++; - $expr_arg = $tokens[$expr_end++]; - $expr = "!($is_arg % " . $this->_parse_var_props($expr_arg) . ")"; - } else { - $this->_syntax_error("expecting 'by' after 'div'", E_USER_ERROR, __FILE__, __LINE__); - } - break; - - default: - $this->_syntax_error("unknown 'is' expression - '$expr_type'", E_USER_ERROR, __FILE__, __LINE__); - break; - } - - if ($negate_expr) { - $expr = "!($expr)"; - } - - array_splice($tokens, 0, $expr_end, $expr); - - return $tokens; - } - - - /** - * Parse attribute string - * - * @param string $tag_args - * @return array - */ - function _parse_attrs($tag_args) - { - - /* Tokenize tag attributes. */ - preg_match_all('~(?:' . $this->_obj_call_regexp . '|' . $this->_qstr_regexp . ' | (?>[^"\'=\s]+) - )+ | - [=] - ~x', $tag_args, $match); - $tokens = $match[0]; - - $attrs = array(); - /* Parse state: - 0 - expecting attribute name - 1 - expecting '=' - 2 - expecting attribute value (not '=') */ - $state = 0; - - foreach ($tokens as $token) { - switch ($state) { - case 0: - /* If the token is a valid identifier, we set attribute name - and go to state 1. */ - if (preg_match('~^\w+$~', $token)) { - $attr_name = $token; - $state = 1; - } else - $this->_syntax_error("invalid attribute name: '$token'", E_USER_ERROR, __FILE__, __LINE__); - break; - - case 1: - /* If the token is '=', then we go to state 2. */ - if ($token == '=') { - $state = 2; - } else - $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__); - break; - - case 2: - /* If token is not '=', we set the attribute value and go to - state 0. */ - if ($token != '=') { - /* We booleanize the token if it's a non-quoted possible - boolean value. */ - if (preg_match('~^(on|yes|true)$~', $token)) { - $token = 'true'; - } else if (preg_match('~^(off|no|false)$~', $token)) { - $token = 'false'; - } else if ($token == 'null') { - $token = 'null'; - } else if (preg_match('~^' . $this->_num_const_regexp . '|0[xX][0-9a-fA-F]+$~', $token)) { - /* treat integer literally */ - } else if (!preg_match('~^' . $this->_obj_call_regexp . '|' . $this->_var_regexp . '(?:' . $this->_mod_regexp . ')*$~', $token)) { - /* treat as a string, double-quote it escaping quotes */ - $token = '"'.addslashes($token).'"'; - } - - $attrs[$attr_name] = $token; - $state = 0; - } else - $this->_syntax_error("'=' cannot be an attribute value", E_USER_ERROR, __FILE__, __LINE__); - break; - } - $last_token = $token; - } - - if($state != 0) { - if($state == 1) { - $this->_syntax_error("expecting '=' after attribute name '$last_token'", E_USER_ERROR, __FILE__, __LINE__); - } else { - $this->_syntax_error("missing attribute value", E_USER_ERROR, __FILE__, __LINE__); - } - } - - $this->_parse_vars_props($attrs); - - return $attrs; - } - - /** - * compile multiple variables and section properties tokens into - * PHP code - * - * @param array $tokens - */ - function _parse_vars_props(&$tokens) - { - foreach($tokens as $key => $val) { - $tokens[$key] = $this->_parse_var_props($val); - } - } - - /** - * compile single variable and section properties token into - * PHP code - * - * @param string $val - * @param string $tag_attrs - * @return string - */ - function _parse_var_props($val) - { - $val = trim($val); - - if(preg_match('~^(' . $this->_obj_call_regexp . '|' . $this->_dvar_regexp . ')(' . $this->_mod_regexp . '*)$~', $val, $match)) { - // $ variable or object - $return = $this->_parse_var($match[1]); - $modifiers = $match[2]; - if (!empty($this->default_modifiers) && !preg_match('~(^|\|)smarty:nodefaults($|\|)~',$modifiers)) { - $_default_mod_string = implode('|',(array)$this->default_modifiers); - $modifiers = empty($modifiers) ? $_default_mod_string : $_default_mod_string . '|' . $modifiers; - } - $this->_parse_modifiers($return, $modifiers); - return $return; - } elseif (preg_match('~^' . $this->_db_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { - // double quoted text - preg_match('~^(' . $this->_db_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match); - $return = $this->_expand_quoted_text($match[1]); - if($match[2] != '') { - $this->_parse_modifiers($return, $match[2]); - } - return $return; - } - elseif(preg_match('~^' . $this->_num_const_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { - // numerical constant - preg_match('~^(' . $this->_num_const_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match); - if($match[2] != '') { - $this->_parse_modifiers($match[1], $match[2]); - return $match[1]; - } - } - elseif(preg_match('~^' . $this->_si_qstr_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { - // single quoted text - preg_match('~^(' . $this->_si_qstr_regexp . ')('. $this->_mod_regexp . '*)$~', $val, $match); - if($match[2] != '') { - $this->_parse_modifiers($match[1], $match[2]); - return $match[1]; - } - } - elseif(preg_match('~^' . $this->_cvar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { - // config var - return $this->_parse_conf_var($val); - } - elseif(preg_match('~^' . $this->_svar_regexp . '(?:' . $this->_mod_regexp . '*)$~', $val)) { - // section var - return $this->_parse_section_prop($val); - } - elseif(!in_array($val, $this->_permitted_tokens) && !is_numeric($val)) { - // literal string - return $this->_expand_quoted_text('"' . strtr($val, array('\\' => '\\\\', '"' => '\\"')) .'"'); - } - return $val; - } - - /** - * expand quoted text with embedded variables - * - * @param string $var_expr - * @return string - */ - function _expand_quoted_text($var_expr) - { - // if contains unescaped $, expand it - if(preg_match_all('~(?:\`(?_dvar_guts_regexp . '(?:' . $this->_obj_ext_regexp . ')*\`)|(?:(?_parse_var(str_replace('`','',$_var)) . ')."', $var_expr); - } - $_return = preg_replace('~\.""|(?_dvar_math_regexp.'|'.$this->_qstr_regexp.')~', $var_expr, -1, PREG_SPLIT_DELIM_CAPTURE); - - if(count($_math_vars) > 1) { - $_first_var = ""; - $_complete_var = ""; - $_output = ""; - // simple check if there is any math, to stop recursion (due to modifiers with "xx % yy" as parameter) - foreach($_math_vars as $_k => $_math_var) { - $_math_var = $_math_vars[$_k]; - - if(!empty($_math_var) || is_numeric($_math_var)) { - // hit a math operator, so process the stuff which came before it - if(preg_match('~^' . $this->_dvar_math_regexp . '$~', $_math_var)) { - $_has_math = true; - if(!empty($_complete_var) || is_numeric($_complete_var)) { - $_output .= $this->_parse_var($_complete_var); - } - - // just output the math operator to php - $_output .= $_math_var; - - if(empty($_first_var)) - $_first_var = $_complete_var; - - $_complete_var = ""; - } else { - $_complete_var .= $_math_var; - } - } - } - if($_has_math) { - if(!empty($_complete_var) || is_numeric($_complete_var)) - $_output .= $this->_parse_var($_complete_var); - - // get the modifiers working (only the last var from math + modifier is left) - $var_expr = $_complete_var; - } - } - - // prevent cutting of first digit in the number (we _definitly_ got a number if the first char is a digit) - if(is_numeric($var_expr{0})) - $_var_ref = $var_expr; - else - $_var_ref = substr($var_expr, 1); - - if(!$_has_math) { - - // get [foo] and .foo and ->foo and (...) pieces - preg_match_all('~(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\$?\w+|\.\$?\w+|\S+~', $_var_ref, $match); - - $_indexes = $match[0]; - $_var_name = array_shift($_indexes); - - /* Handle $smarty.* variable references as a special case. */ - if ($_var_name == 'smarty') { - /* - * If the reference could be compiled, use the compiled output; - * otherwise, fall back on the $smarty variable generated at - * run-time. - */ - if (($smarty_ref = $this->_compile_smarty_ref($_indexes)) !== null) { - $_output = $smarty_ref; - } else { - $_var_name = substr(array_shift($_indexes), 1); - $_output = "\$this->_smarty_vars['$_var_name']"; - } - } elseif(is_numeric($_var_name) && is_numeric($var_expr{0})) { - // because . is the operator for accessing arrays thru inidizes we need to put it together again for floating point numbers - if(count($_indexes) > 0) - { - $_var_name .= implode("", $_indexes); - $_indexes = array(); - } - $_output = $_var_name; - } else { - $_output = "\$this->_tpl_vars['$_var_name']"; - } - - foreach ($_indexes as $_index) { - if ($_index{0} == '[') { - $_index = substr($_index, 1, -1); - if (is_numeric($_index)) { - $_output .= "[$_index]"; - } elseif ($_index{0} == '$') { - if (strpos($_index, '.') !== false) { - $_output .= '[' . $this->_parse_var($_index) . ']'; - } else { - $_output .= "[\$this->_tpl_vars['" . substr($_index, 1) . "']]"; - } - } else { - $_var_parts = explode('.', $_index); - $_var_section = $_var_parts[0]; - $_var_section_prop = isset($_var_parts[1]) ? $_var_parts[1] : 'index'; - $_output .= "[\$this->_sections['$_var_section']['$_var_section_prop']]"; - } - } else if ($_index{0} == '.') { - if ($_index{1} == '$') - $_output .= "[\$this->_tpl_vars['" . substr($_index, 2) . "']]"; - else - $_output .= "['" . substr($_index, 1) . "']"; - } else if (substr($_index,0,2) == '->') { - if(substr($_index,2,2) == '__') { - $this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__); - } elseif($this->security && substr($_index, 2, 1) == '_') { - $this->_syntax_error('(secure) call to private object member is not allowed', E_USER_ERROR, __FILE__, __LINE__); - } elseif ($_index{2} == '$') { - if ($this->security) { - $this->_syntax_error('(secure) call to dynamic object member is not allowed', E_USER_ERROR, __FILE__, __LINE__); - } else { - $_output .= '->{(($_var=$this->_tpl_vars[\''.substr($_index,3).'\']) && substr($_var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$_var\\"")}'; - } - } else { - $_output .= $_index; - } - } elseif ($_index{0} == '(') { - $_index = $this->_parse_parenth_args($_index); - $_output .= $_index; - } else { - $_output .= $_index; - } - } - } - - return $_output; - } - - /** - * parse arguments in function call parenthesis - * - * @param string $parenth_args - * @return string - */ - function _parse_parenth_args($parenth_args) - { - preg_match_all('~' . $this->_param_regexp . '~',$parenth_args, $match); - $orig_vals = $match = $match[0]; - $this->_parse_vars_props($match); - $replace = array(); - for ($i = 0, $count = count($match); $i < $count; $i++) { - $replace[$orig_vals[$i]] = $match[$i]; - } - return strtr($parenth_args, $replace); - } - - /** - * parse configuration variable expression into PHP code - * - * @param string $conf_var_expr - */ - function _parse_conf_var($conf_var_expr) - { - $parts = explode('|', $conf_var_expr, 2); - $var_ref = $parts[0]; - $modifiers = isset($parts[1]) ? $parts[1] : ''; - - $var_name = substr($var_ref, 1, -1); - - $output = "\$this->_config[0]['vars']['$var_name']"; - - $this->_parse_modifiers($output, $modifiers); - - return $output; - } - - /** - * parse section property expression into PHP code - * - * @param string $section_prop_expr - * @return string - */ - function _parse_section_prop($section_prop_expr) - { - $parts = explode('|', $section_prop_expr, 2); - $var_ref = $parts[0]; - $modifiers = isset($parts[1]) ? $parts[1] : ''; - - preg_match('!%(\w+)\.(\w+)%!', $var_ref, $match); - $section_name = $match[1]; - $prop_name = $match[2]; - - $output = "\$this->_sections['$section_name']['$prop_name']"; - - $this->_parse_modifiers($output, $modifiers); - - return $output; - } - - - /** - * parse modifier chain into PHP code - * - * sets $output to parsed modified chain - * @param string $output - * @param string $modifier_string - */ - function _parse_modifiers(&$output, $modifier_string) - { - preg_match_all('~\|(@?\w+)((?>:(?:'. $this->_qstr_regexp . '|[^|]+))*)~', '|' . $modifier_string, $_match); - list(, $_modifiers, $modifier_arg_strings) = $_match; - - for ($_i = 0, $_for_max = count($_modifiers); $_i < $_for_max; $_i++) { - $_modifier_name = $_modifiers[$_i]; - - if($_modifier_name == 'smarty') { - // skip smarty modifier - continue; - } - - preg_match_all('~:(' . $this->_qstr_regexp . '|[^:]+)~', $modifier_arg_strings[$_i], $_match); - $_modifier_args = $_match[1]; - - if ($_modifier_name{0} == '@') { - $_map_array = false; - $_modifier_name = substr($_modifier_name, 1); - } else { - $_map_array = true; - } - - if (empty($this->_plugins['modifier'][$_modifier_name]) - && !$this->_get_plugin_filepath('modifier', $_modifier_name) - && function_exists($_modifier_name)) { - if ($this->security && !in_array($_modifier_name, $this->security_settings['MODIFIER_FUNCS'])) { - $this->_trigger_fatal_error("[plugin] (secure mode) modifier '$_modifier_name' is not allowed" , $this->_current_file, $this->_current_line_no, __FILE__, __LINE__); - } else { - $this->_plugins['modifier'][$_modifier_name] = array($_modifier_name, null, null, false); - } - } - $this->_add_plugin('modifier', $_modifier_name); - - $this->_parse_vars_props($_modifier_args); - - if($_modifier_name == 'default') { - // supress notifications of default modifier vars and args - if($output{0} == '$') { - $output = '@' . $output; - } - if(isset($_modifier_args[0]) && $_modifier_args[0]{0} == '$') { - $_modifier_args[0] = '@' . $_modifier_args[0]; - } - } - if (count($_modifier_args) > 0) - $_modifier_args = ', '.implode(', ', $_modifier_args); - else - $_modifier_args = ''; - - if ($_map_array) { - $output = "((is_array(\$_tmp=$output)) ? \$this->_run_mod_handler('$_modifier_name', true, \$_tmp$_modifier_args) : " . $this->_compile_plugin_call('modifier', $_modifier_name) . "(\$_tmp$_modifier_args))"; - - } else { - - $output = $this->_compile_plugin_call('modifier', $_modifier_name)."($output$_modifier_args)"; - - } - } - } - - - /** - * add plugin - * - * @param string $type - * @param string $name - * @param boolean? $delayed_loading - */ - function _add_plugin($type, $name, $delayed_loading = null) - { - if (!isset($this->_plugin_info[$type])) { - $this->_plugin_info[$type] = array(); - } - if (!isset($this->_plugin_info[$type][$name])) { - $this->_plugin_info[$type][$name] = array($this->_current_file, - $this->_current_line_no, - $delayed_loading); - } - } - - - /** - * Compiles references of type $smarty.foo - * - * @param string $indexes - * @return string - */ - function _compile_smarty_ref(&$indexes) - { - /* Extract the reference name. */ - $_ref = substr($indexes[0], 1); - foreach($indexes as $_index_no=>$_index) { - if ($_index{0} != '.' && $_index_no<2 || !preg_match('~^(\.|\[|->)~', $_index)) { - $this->_syntax_error('$smarty' . implode('', array_slice($indexes, 0, 2)) . ' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__); - } - } - - switch ($_ref) { - case 'now': - $compiled_ref = 'time()'; - $_max_index = 1; - break; - - case 'foreach': - array_shift($indexes); - $_var = $this->_parse_var_props(substr($indexes[0], 1)); - $_propname = substr($indexes[1], 1); - $_max_index = 1; - switch ($_propname) { - case 'index': - array_shift($indexes); - $compiled_ref = "(\$this->_foreach[$_var]['iteration']-1)"; - break; - - case 'first': - array_shift($indexes); - $compiled_ref = "(\$this->_foreach[$_var]['iteration'] <= 1)"; - break; - - case 'last': - array_shift($indexes); - $compiled_ref = "(\$this->_foreach[$_var]['iteration'] == \$this->_foreach[$_var]['total'])"; - break; - - case 'show': - array_shift($indexes); - $compiled_ref = "(\$this->_foreach[$_var]['total'] > 0)"; - break; - - default: - unset($_max_index); - $compiled_ref = "\$this->_foreach[$_var]"; - } - break; - - case 'section': - array_shift($indexes); - $_var = $this->_parse_var_props(substr($indexes[0], 1)); - $compiled_ref = "\$this->_sections[$_var]"; - break; - - case 'get': - $compiled_ref = ($this->request_use_auto_globals) ? '$_GET' : "\$GLOBALS['HTTP_GET_VARS']"; - break; - - case 'post': - $compiled_ref = ($this->request_use_auto_globals) ? '$_POST' : "\$GLOBALS['HTTP_POST_VARS']"; - break; - - case 'cookies': - $compiled_ref = ($this->request_use_auto_globals) ? '$_COOKIE' : "\$GLOBALS['HTTP_COOKIE_VARS']"; - break; - - case 'env': - $compiled_ref = ($this->request_use_auto_globals) ? '$_ENV' : "\$GLOBALS['HTTP_ENV_VARS']"; - break; - - case 'server': - $compiled_ref = ($this->request_use_auto_globals) ? '$_SERVER' : "\$GLOBALS['HTTP_SERVER_VARS']"; - break; - - case 'session': - $compiled_ref = ($this->request_use_auto_globals) ? '$_SESSION' : "\$GLOBALS['HTTP_SESSION_VARS']"; - break; - - /* - * These cases are handled either at run-time or elsewhere in the - * compiler. - */ - case 'request': - if ($this->request_use_auto_globals) { - $compiled_ref = '$_REQUEST'; - break; - } else { - $this->_init_smarty_vars = true; - } - return null; - - case 'capture': - return null; - - case 'template': - $compiled_ref = "'$this->_current_file'"; - $_max_index = 1; - break; - - case 'version': - $compiled_ref = "'$this->_version'"; - $_max_index = 1; - break; - - case 'const': - if ($this->security && !$this->security_settings['ALLOW_CONSTANTS']) { - $this->_syntax_error("(secure mode) constants not permitted", - E_USER_WARNING, __FILE__, __LINE__); - return; - } - array_shift($indexes); - if (preg_match('!^\.\w+$!', $indexes[0])) { - $compiled_ref = '@' . substr($indexes[0], 1); - } else { - $_val = $this->_parse_var_props(substr($indexes[0], 1)); - $compiled_ref = '@constant(' . $_val . ')'; - } - $_max_index = 1; - break; - - case 'config': - $compiled_ref = "\$this->_config[0]['vars']"; - $_max_index = 3; - break; - - case 'ldelim': - $compiled_ref = "'$this->left_delimiter'"; - break; - - case 'rdelim': - $compiled_ref = "'$this->right_delimiter'"; - break; - - default: - $this->_syntax_error('$smarty.' . $_ref . ' is an unknown reference', E_USER_ERROR, __FILE__, __LINE__); - break; - } - - if (isset($_max_index) && count($indexes) > $_max_index) { - $this->_syntax_error('$smarty' . implode('', $indexes) .' is an invalid reference', E_USER_ERROR, __FILE__, __LINE__); - } - - array_shift($indexes); - return $compiled_ref; - } - - /** - * compiles call to plugin of type $type with name $name - * returns a string containing the function-name or method call - * without the paramter-list that would have follow to make the - * call valid php-syntax - * - * @param string $type - * @param string $name - * @return string - */ - function _compile_plugin_call($type, $name) { - if (isset($this->_plugins[$type][$name])) { - /* plugin loaded */ - if (is_array($this->_plugins[$type][$name][0])) { - return ((is_object($this->_plugins[$type][$name][0][0])) ? - "\$this->_plugins['$type']['$name'][0][0]->" /* method callback */ - : (string)($this->_plugins[$type][$name][0][0]).'::' /* class callback */ - ). $this->_plugins[$type][$name][0][1]; - - } else { - /* function callback */ - return $this->_plugins[$type][$name][0]; - - } - } else { - /* plugin not loaded -> auto-loadable-plugin */ - return 'smarty_'.$type.'_'.$name; - - } - } - - /** - * load pre- and post-filters - */ - function _load_filters() - { - if (count($this->_plugins['prefilter']) > 0) { - foreach ($this->_plugins['prefilter'] as $filter_name => $prefilter) { - if ($prefilter === false) { - unset($this->_plugins['prefilter'][$filter_name]); - $_params = array('plugins' => array(array('prefilter', $filter_name, null, null, false))); - require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); - smarty_core_load_plugins($_params, $this); - } - } - } - if (count($this->_plugins['postfilter']) > 0) { - foreach ($this->_plugins['postfilter'] as $filter_name => $postfilter) { - if ($postfilter === false) { - unset($this->_plugins['postfilter'][$filter_name]); - $_params = array('plugins' => array(array('postfilter', $filter_name, null, null, false))); - require_once(SMARTY_CORE_DIR . 'core.load_plugins.php'); - smarty_core_load_plugins($_params, $this); - } - } - } - } - - - /** - * Quote subpattern references - * - * @param string $string - * @return string - */ - function _quote_replace($string) - { - return strtr($string, array('\\' => '\\\\', '$' => '\\$')); - } - - /** - * display Smarty syntax error - * - * @param string $error_msg - * @param integer $error_type - * @param string $file - * @param integer $line - */ - function _syntax_error($error_msg, $error_type = E_USER_ERROR, $file=null, $line=null) - { - $this->_trigger_fatal_error("syntax error: $error_msg", $this->_current_file, $this->_current_line_no, $file, $line, $error_type); - } - - - /** - * check if the compilation changes from cacheable to - * non-cacheable state with the beginning of the current - * plugin. return php-code to reflect the transition. - * @return string - */ - function _push_cacheable_state($type, $name) { - $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4]; - if ($_cacheable - || 0<$this->_cacheable_state++) return ''; - if (!isset($this->_cache_serial)) $this->_cache_serial = md5(uniqid('Smarty')); - $_ret = 'if ($this->caching && !$this->_cache_including) { echo \'{nocache:' - . $this->_cache_serial . '#' . $this->_nocache_count - . '}\';}'; - return $_ret; - } - - - /** - * check if the compilation changes from non-cacheable to - * cacheable state with the end of the current plugin return - * php-code to reflect the transition. - * @return string - */ - function _pop_cacheable_state($type, $name) { - $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4]; - if ($_cacheable - || --$this->_cacheable_state>0) return ''; - return 'if ($this->caching && !$this->_cache_including) { echo \'{/nocache:' - . $this->_cache_serial . '#' . ($this->_nocache_count++) - . '}\';}'; - } - - - /** - * push opening tag-name, file-name and line-number on the tag-stack - * @param string the opening tag's name - */ - function _push_tag($open_tag) - { - array_push($this->_tag_stack, array($open_tag, $this->_current_line_no)); - } - - /** - * pop closing tag-name - * raise an error if this stack-top doesn't match with the closing tag - * @param string the closing tag's name - * @return string the opening tag's name - */ - function _pop_tag($close_tag) - { - $message = ''; - if (count($this->_tag_stack)>0) { - list($_open_tag, $_line_no) = array_pop($this->_tag_stack); - if ($close_tag == $_open_tag) { - return $_open_tag; - } - if ($close_tag == 'if' && ($_open_tag == 'else' || $_open_tag == 'elseif' )) { - return $this->_pop_tag($close_tag); - } - if ($close_tag == 'section' && $_open_tag == 'sectionelse') { - $this->_pop_tag($close_tag); - return $_open_tag; - } - if ($close_tag == 'foreach' && $_open_tag == 'foreachelse') { - $this->_pop_tag($close_tag); - return $_open_tag; - } - if ($_open_tag == 'else' || $_open_tag == 'elseif') { - $_open_tag = 'if'; - } elseif ($_open_tag == 'sectionelse') { - $_open_tag = 'section'; - } elseif ($_open_tag == 'foreachelse') { - $_open_tag = 'foreach'; - } - $message = " expected {/$_open_tag} (opened line $_line_no)."; - } - $this->_syntax_error("mismatched tag {/$close_tag}.$message", - E_USER_ERROR, __FILE__, __LINE__); - } - -} - -/** - * compare to values by their string length - * - * @access private - * @param string $a - * @param string $b - * @return 0|-1|1 - */ -function _smarty_sort_length($a, $b) -{ - if($a == $b) - return 0; - - if(strlen($a) == strlen($b)) - return ($a > $b) ? -1 : 1; - - return (strlen($a) > strlen($b)) ? -1 : 1; -} - - -/* vim: set et: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/debug.tpl b/gui/bacula-web/external_packages/smarty/debug.tpl deleted file mode 100644 index 7f1c9d4258..0000000000 --- a/gui/bacula-web/external_packages/smarty/debug.tpl +++ /dev/null @@ -1,64 +0,0 @@ -{* Smarty *} - -{* debug.tpl, last updated version 2.0.1 *} - -{assign_debug_info} - -{if isset($_smarty_debug_output) and $_smarty_debug_output eq "html"} - - - - {section name=templates loop=$_debug_tpls} - - {sectionelse} - - {/section} - - {section name=vars loop=$_debug_keys} - - {sectionelse} - - {/section} - - {section name=config_vars loop=$_debug_config_keys} - - {sectionelse} - - {/section} -
    Smarty Debug Console
    included templates & config files (load time in seconds):
    {section name=indent loop=$_debug_tpls[templates].depth}   {/section}{$_debug_tpls[templates].filename|escape:html}{if isset($_debug_tpls[templates].exec_time)} ({$_debug_tpls[templates].exec_time|string_format:"%.5f"}){if %templates.index% eq 0} (total){/if}{/if}
    no templates included
    assigned template variables:
    {ldelim}${$_debug_keys[vars]}{rdelim}{$_debug_vals[vars]|@debug_print_var}
    no template variables assigned
    assigned config file variables (outer template scope):
    {ldelim}#{$_debug_config_keys[config_vars]}#{rdelim}{$_debug_config_vals[config_vars]|@debug_print_var}
    no config vars assigned
    - -{else} - -{/if} diff --git a/gui/bacula-web/external_packages/smarty/internals/core.assemble_plugin_filepath.php b/gui/bacula-web/external_packages/smarty/internals/core.assemble_plugin_filepath.php deleted file mode 100644 index 690d3ddbc2..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.assemble_plugin_filepath.php +++ /dev/null @@ -1,67 +0,0 @@ -plugins_dir as $_plugin_dir) { - - $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; - - // see if path is relative - if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { - $_relative_paths[] = $_plugin_dir; - // relative path, see if it is in the SMARTY_DIR - if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { - $_return = SMARTY_DIR . $_plugin_filepath; - break; - } - } - // try relative to cwd (or absolute) - if (@is_readable($_plugin_filepath)) { - $_return = $_plugin_filepath; - break; - } - } - - if($_return === false) { - // still not found, try PHP include_path - if(isset($_relative_paths)) { - foreach ((array)$_relative_paths as $_plugin_dir) { - - $_plugin_filepath = $_plugin_dir . DIRECTORY_SEPARATOR . $_plugin_filename; - - $_params = array('file_path' => $_plugin_filepath); - require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); - if(smarty_core_get_include_path($_params, $smarty)) { - $_return = $_params['new_file_path']; - break; - } - } - } - } - $_filepaths_cache[$_plugin_filename] = $_return; - return $_return; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.assign_smarty_interface.php b/gui/bacula-web/external_packages/smarty/internals/core.assign_smarty_interface.php deleted file mode 100644 index 7e65a73ec2..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.assign_smarty_interface.php +++ /dev/null @@ -1,43 +0,0 @@ - - * Name: assign_smarty_interface
    - * Purpose: assign the $smarty interface variable - * @param array Format: null - * @param Smarty - */ -function smarty_core_assign_smarty_interface($params, &$smarty) -{ - if (isset($smarty->_smarty_vars) && isset($smarty->_smarty_vars['request'])) { - return; - } - - $_globals_map = array('g' => 'HTTP_GET_VARS', - 'p' => 'HTTP_POST_VARS', - 'c' => 'HTTP_COOKIE_VARS', - 's' => 'HTTP_SERVER_VARS', - 'e' => 'HTTP_ENV_VARS'); - - $_smarty_vars_request = array(); - - foreach (preg_split('!!', strtolower($smarty->request_vars_order)) as $_c) { - if (isset($_globals_map[$_c])) { - $_smarty_vars_request = array_merge($_smarty_vars_request, $GLOBALS[$_globals_map[$_c]]); - } - } - $_smarty_vars_request = @array_merge($_smarty_vars_request, $GLOBALS['HTTP_SESSION_VARS']); - - $smarty->_smarty_vars['request'] = $_smarty_vars_request; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.create_dir_structure.php b/gui/bacula-web/external_packages/smarty/internals/core.create_dir_structure.php deleted file mode 100644 index 999cf59302..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.create_dir_structure.php +++ /dev/null @@ -1,79 +0,0 @@ -_dir_perms) && !is_dir($_new_dir)) { - $smarty->trigger_error("problem creating directory '" . $_new_dir . "'"); - return false; - } - $_new_dir .= '/'; - } - } -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.display_debug_console.php b/gui/bacula-web/external_packages/smarty/internals/core.display_debug_console.php deleted file mode 100644 index 1a80f39096..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.display_debug_console.php +++ /dev/null @@ -1,61 +0,0 @@ - - * Name: display_debug_console
    - * Purpose: display the javascript debug console window - * @param array Format: null - * @param Smarty - */ -function smarty_core_display_debug_console($params, &$smarty) -{ - // we must force compile the debug template in case the environment - // changed between separate applications. - - if(empty($smarty->debug_tpl)) { - // set path to debug template from SMARTY_DIR - $smarty->debug_tpl = SMARTY_DIR . 'debug.tpl'; - if($smarty->security && is_file($smarty->debug_tpl)) { - $smarty->secure_dir[] = realpath($smarty->debug_tpl); - } - $smarty->debug_tpl = 'file:' . SMARTY_DIR . 'debug.tpl'; - } - - $_ldelim_orig = $smarty->left_delimiter; - $_rdelim_orig = $smarty->right_delimiter; - - $smarty->left_delimiter = '{'; - $smarty->right_delimiter = '}'; - - $_compile_id_orig = $smarty->_compile_id; - $smarty->_compile_id = null; - - $_compile_path = $smarty->_get_compile_path($smarty->debug_tpl); - if ($smarty->_compile_resource($smarty->debug_tpl, $_compile_path)) - { - ob_start(); - $smarty->_include($_compile_path); - $_results = ob_get_contents(); - ob_end_clean(); - } else { - $_results = ''; - } - - $smarty->_compile_id = $_compile_id_orig; - - $smarty->left_delimiter = $_ldelim_orig; - $smarty->right_delimiter = $_rdelim_orig; - - return $_results; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.get_include_path.php b/gui/bacula-web/external_packages/smarty/internals/core.get_include_path.php deleted file mode 100644 index 43432412b8..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.get_include_path.php +++ /dev/null @@ -1,44 +0,0 @@ - diff --git a/gui/bacula-web/external_packages/smarty/internals/core.get_microtime.php b/gui/bacula-web/external_packages/smarty/internals/core.get_microtime.php deleted file mode 100644 index f1a28e0425..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.get_microtime.php +++ /dev/null @@ -1,23 +0,0 @@ - diff --git a/gui/bacula-web/external_packages/smarty/internals/core.get_php_resource.php b/gui/bacula-web/external_packages/smarty/internals/core.get_php_resource.php deleted file mode 100644 index 786d4e78e8..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.get_php_resource.php +++ /dev/null @@ -1,80 +0,0 @@ -trusted_dir; - $smarty->_parse_resource_name($params, $smarty); - - /* - * Find out if the resource exists. - */ - - if ($params['resource_type'] == 'file') { - $_readable = false; - if(file_exists($params['resource_name']) && is_readable($params['resource_name'])) { - $_readable = true; - } else { - // test for file in include_path - $_params = array('file_path' => $params['resource_name']); - require_once(SMARTY_CORE_DIR . 'core.get_include_path.php'); - if(smarty_core_get_include_path($_params, $smarty)) { - $_include_path = $_params['new_file_path']; - $_readable = true; - } - } - } else if ($params['resource_type'] != 'file') { - $_template_source = null; - $_readable = is_callable($smarty->_plugins['resource'][$params['resource_type']][0][0]) - && call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][0], - array($params['resource_name'], &$_template_source, &$smarty)); - } - - /* - * Set the error function, depending on which class calls us. - */ - if (method_exists($smarty, '_syntax_error')) { - $_error_funcc = '_syntax_error'; - } else { - $_error_funcc = 'trigger_error'; - } - - if ($_readable) { - if ($smarty->security) { - require_once(SMARTY_CORE_DIR . 'core.is_trusted.php'); - if (!smarty_core_is_trusted($params, $smarty)) { - $smarty->$_error_funcc('(secure mode) ' . $params['resource_type'] . ':' . $params['resource_name'] . ' is not trusted'); - return false; - } - } - } else { - $smarty->$_error_funcc($params['resource_type'] . ':' . $params['resource_name'] . ' is not readable'); - return false; - } - - if ($params['resource_type'] == 'file') { - $params['php_resource'] = $params['resource_name']; - } else { - $params['php_resource'] = $_template_source; - } - return true; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.is_secure.php b/gui/bacula-web/external_packages/smarty/internals/core.is_secure.php deleted file mode 100644 index 9bec5c21ef..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.is_secure.php +++ /dev/null @@ -1,59 +0,0 @@ -security || $smarty->security_settings['INCLUDE_ANY']) { - return true; - } - - if ($params['resource_type'] == 'file') { - $_rp = realpath($params['resource_name']); - if (isset($params['resource_base_path'])) { - foreach ((array)$params['resource_base_path'] as $curr_dir) { - if ( ($_cd = realpath($curr_dir)) !== false && - strncmp($_rp, $_cd, strlen($_cd)) == 0 && - $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR ) { - return true; - } - } - } - if (!empty($smarty->secure_dir)) { - foreach ((array)$smarty->secure_dir as $curr_dir) { - if ( ($_cd = realpath($curr_dir)) !== false) { - if( strncmp($_rp, $_cd, strlen($_cd)) == 0 && - $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR ) { - return true; - } elseif ($_cd == $_rp) { - return true; - } - } - } - } - } else { - // resource is not on local file system - return call_user_func_array( - $smarty->_plugins['resource'][$params['resource_type']][0][2], - array($params['resource_name'], &$smarty)); - } - - return false; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.is_trusted.php b/gui/bacula-web/external_packages/smarty/internals/core.is_trusted.php deleted file mode 100644 index f0bd2fb8c9..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.is_trusted.php +++ /dev/null @@ -1,47 +0,0 @@ -trusted_dir)) { - $_rp = realpath($params['resource_name']); - foreach ((array)$smarty->trusted_dir as $curr_dir) { - if (!empty($curr_dir) && is_readable ($curr_dir)) { - $_cd = realpath($curr_dir); - if (strncmp($_rp, $_cd, strlen($_cd)) == 0 - && $_rp{strlen($_cd)} == DIRECTORY_SEPARATOR ) { - $_smarty_trusted = true; - break; - } - } - } - } - - } else { - // resource is not on local file system - $_smarty_trusted = call_user_func_array($smarty->_plugins['resource'][$params['resource_type']][0][3], - array($params['resource_name'], $smarty)); - } - - return $_smarty_trusted; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.load_plugins.php b/gui/bacula-web/external_packages/smarty/internals/core.load_plugins.php deleted file mode 100644 index 6db1dc51d2..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.load_plugins.php +++ /dev/null @@ -1,125 +0,0 @@ -_plugins[$_type][$_name]; - - /* - * We do not load plugin more than once for each instance of Smarty. - * The following code checks for that. The plugin can also be - * registered dynamically at runtime, in which case template file - * and line number will be unknown, so we fill them in. - * - * The final element of the info array is a flag that indicates - * whether the dynamically registered plugin function has been - * checked for existence yet or not. - */ - if (isset($_plugin)) { - if (empty($_plugin[3])) { - if (!is_callable($_plugin[0])) { - $smarty->_trigger_fatal_error("[plugin] $_type '$_name' is not implemented", $_tpl_file, $_tpl_line, __FILE__, __LINE__); - } else { - $_plugin[1] = $_tpl_file; - $_plugin[2] = $_tpl_line; - $_plugin[3] = true; - if (!isset($_plugin[4])) $_plugin[4] = true; /* cacheable */ - } - } - continue; - } else if ($_type == 'insert') { - /* - * For backwards compatibility, we check for insert functions in - * the symbol table before trying to load them as a plugin. - */ - $_plugin_func = 'insert_' . $_name; - if (function_exists($_plugin_func)) { - $_plugin = array($_plugin_func, $_tpl_file, $_tpl_line, true, false); - continue; - } - } - - $_plugin_file = $smarty->_get_plugin_filepath($_type, $_name); - - if (! $_found = ($_plugin_file != false)) { - $_message = "could not load plugin file '$_type.$_name.php'\n"; - } - - /* - * If plugin file is found, it -must- provide the properly named - * plugin function. In case it doesn't, simply output the error and - * do not fall back on any other method. - */ - if ($_found) { - include_once $_plugin_file; - - $_plugin_func = 'smarty_' . $_type . '_' . $_name; - if (!function_exists($_plugin_func)) { - $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", $_tpl_file, $_tpl_line, __FILE__, __LINE__); - continue; - } - } - /* - * In case of insert plugins, their code may be loaded later via - * 'script' attribute. - */ - else if ($_type == 'insert' && $_delayed_loading) { - $_plugin_func = 'smarty_' . $_type . '_' . $_name; - $_found = true; - } - - /* - * Plugin specific processing and error checking. - */ - if (!$_found) { - if ($_type == 'modifier') { - /* - * In case modifier falls back on using PHP functions - * directly, we only allow those specified in the security - * context. - */ - if ($smarty->security && !in_array($_name, $smarty->security_settings['MODIFIER_FUNCS'])) { - $_message = "(secure mode) modifier '$_name' is not allowed"; - } else { - if (!function_exists($_name)) { - $_message = "modifier '$_name' is not implemented"; - } else { - $_plugin_func = $_name; - $_found = true; - } - } - } else if ($_type == 'function') { - /* - * This is a catch-all situation. - */ - $_message = "unknown tag - '$_name'"; - } - } - - if ($_found) { - $smarty->_plugins[$_type][$_name] = array($_plugin_func, $_tpl_file, $_tpl_line, true, true); - } else { - // output error - $smarty->_trigger_fatal_error('[plugin] ' . $_message, $_tpl_file, $_tpl_line, __FILE__, __LINE__); - } - } -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.load_resource_plugin.php b/gui/bacula-web/external_packages/smarty/internals/core.load_resource_plugin.php deleted file mode 100644 index a7d37d1afc..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.load_resource_plugin.php +++ /dev/null @@ -1,74 +0,0 @@ -_plugins['resource'][$params['type']]; - if (isset($_plugin)) { - if (!$_plugin[1] && count($_plugin[0])) { - $_plugin[1] = true; - foreach ($_plugin[0] as $_plugin_func) { - if (!is_callable($_plugin_func)) { - $_plugin[1] = false; - break; - } - } - } - - if (!$_plugin[1]) { - $smarty->_trigger_fatal_error("[plugin] resource '" . $params['type'] . "' is not implemented", null, null, __FILE__, __LINE__); - } - - return; - } - - $_plugin_file = $smarty->_get_plugin_filepath('resource', $params['type']); - $_found = ($_plugin_file != false); - - if ($_found) { /* - * If the plugin file is found, it -must- provide the properly named - * plugin functions. - */ - include_once($_plugin_file); - - /* - * Locate functions that we require the plugin to provide. - */ - $_resource_ops = array('source', 'timestamp', 'secure', 'trusted'); - $_resource_funcs = array(); - foreach ($_resource_ops as $_op) { - $_plugin_func = 'smarty_resource_' . $params['type'] . '_' . $_op; - if (!function_exists($_plugin_func)) { - $smarty->_trigger_fatal_error("[plugin] function $_plugin_func() not found in $_plugin_file", null, null, __FILE__, __LINE__); - return; - } else { - $_resource_funcs[] = $_plugin_func; - } - } - - $smarty->_plugins['resource'][$params['type']] = array($_resource_funcs, true); - } -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.process_cached_inserts.php b/gui/bacula-web/external_packages/smarty/internals/core.process_cached_inserts.php deleted file mode 100644 index 29cb007eb1..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.process_cached_inserts.php +++ /dev/null @@ -1,71 +0,0 @@ -_smarty_md5.'{insert_cache (.*)}'.$smarty->_smarty_md5.'!Uis', - $params['results'], $match); - list($cached_inserts, $insert_args) = $match; - - for ($i = 0, $for_max = count($cached_inserts); $i < $for_max; $i++) { - if ($smarty->debugging) { - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $debug_start_time = smarty_core_get_microtime($_params, $smarty); - } - - $args = unserialize($insert_args[$i]); - $name = $args['name']; - - if (isset($args['script'])) { - $_params = array('resource_name' => $smarty->_dequote($args['script'])); - require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); - if(!smarty_core_get_php_resource($_params, $smarty)) { - return false; - } - $resource_type = $_params['resource_type']; - $php_resource = $_params['php_resource']; - - - if ($resource_type == 'file') { - $smarty->_include($php_resource, true); - } else { - $smarty->_eval($php_resource); - } - } - - $function_name = $smarty->_plugins['insert'][$name][0]; - if (empty($args['assign'])) { - $replace = $function_name($args, $smarty); - } else { - $smarty->assign($args['assign'], $function_name($args, $smarty)); - $replace = ''; - } - - $params['results'] = str_replace($cached_inserts[$i], $replace, $params['results']); - if ($smarty->debugging) { - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $smarty->_smarty_debug_info[] = array('type' => 'insert', - 'filename' => 'insert_'.$name, - 'depth' => $smarty->_inclusion_depth, - 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $debug_start_time); - } - } - - return $params['results']; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.process_compiled_include.php b/gui/bacula-web/external_packages/smarty/internals/core.process_compiled_include.php deleted file mode 100644 index d539423bf7..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.process_compiled_include.php +++ /dev/null @@ -1,37 +0,0 @@ -_cache_including; - $smarty->_cache_including = true; - - $_return = $params['results']; - - foreach ($smarty->_cache_info['cache_serials'] as $_include_file_path=>$_cache_serial) { - $smarty->_include($_include_file_path, true); - } - - foreach ($smarty->_cache_serials as $_include_file_path=>$_cache_serial) { - $_return = preg_replace_callback('!(\{nocache\:('.$_cache_serial.')#(\d+)\})!s', - array(&$smarty, '_process_compiled_include_callback'), - $_return); - } - $smarty->_cache_including = $_cache_including; - return $_return; -} - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.read_cache_file.php b/gui/bacula-web/external_packages/smarty/internals/core.read_cache_file.php deleted file mode 100644 index c60e113a71..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.read_cache_file.php +++ /dev/null @@ -1,101 +0,0 @@ -force_compile) { - // force compile enabled, always regenerate - return false; - } - - if (isset($content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']])) { - list($params['results'], $smarty->_cache_info) = $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']]; - return true; - } - - if (!empty($smarty->cache_handler_func)) { - // use cache_handler function - call_user_func_array($smarty->cache_handler_func, - array('read', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null)); - } else { - // use local cache file - $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); - $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); - $params['results'] = $smarty->_read_file($_cache_file); - } - - if (empty($params['results'])) { - // nothing to parse (error?), regenerate cache - return false; - } - - $_contents = $params['results']; - $_info_start = strpos($_contents, "\n") + 1; - $_info_len = (int)substr($_contents, 0, $_info_start - 1); - $_cache_info = unserialize(substr($_contents, $_info_start, $_info_len)); - $params['results'] = substr($_contents, $_info_start + $_info_len); - - if ($smarty->caching == 2 && isset ($_cache_info['expires'])){ - // caching by expiration time - if ($_cache_info['expires'] > -1 && (time() > $_cache_info['expires'])) { - // cache expired, regenerate - return false; - } - } else { - // caching by lifetime - if ($smarty->cache_lifetime > -1 && (time() - $_cache_info['timestamp'] > $smarty->cache_lifetime)) { - // cache expired, regenerate - return false; - } - } - - if ($smarty->compile_check) { - $_params = array('get_source' => false, 'quiet'=>true); - foreach (array_keys($_cache_info['template']) as $_template_dep) { - $_params['resource_name'] = $_template_dep; - if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) { - // template file has changed, regenerate cache - return false; - } - } - - if (isset($_cache_info['config'])) { - $_params = array('resource_base_path' => $smarty->config_dir, 'get_source' => false, 'quiet'=>true); - foreach (array_keys($_cache_info['config']) as $_config_dep) { - $_params['resource_name'] = $_config_dep; - if (!$smarty->_fetch_resource_info($_params) || $_cache_info['timestamp'] < $_params['resource_timestamp']) { - // config file has changed, regenerate cache - return false; - } - } - } - } - - $content_cache[$params['tpl_file'].','.$params['cache_id'].','.$params['compile_id']] = array($params['results'], $_cache_info); - - $smarty->_cache_info = $_cache_info; - return true; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.rm_auto.php b/gui/bacula-web/external_packages/smarty/internals/core.rm_auto.php deleted file mode 100644 index b251f64911..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.rm_auto.php +++ /dev/null @@ -1,71 +0,0 @@ - $params['auto_base'], - 'level' => 0, - 'exp_time' => $params['exp_time'] - ); - require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); - $_res = smarty_core_rmdir($_params, $smarty); - } else { - $_tname = $smarty->_get_auto_filename($params['auto_base'], $params['auto_source'], $params['auto_id']); - - if(isset($params['auto_source'])) { - if (isset($params['extensions'])) { - $_res = false; - foreach ((array)$params['extensions'] as $_extension) - $_res |= $smarty->_unlink($_tname.$_extension, $params['exp_time']); - } else { - $_res = $smarty->_unlink($_tname, $params['exp_time']); - } - } elseif ($smarty->use_sub_dirs) { - $_params = array( - 'dirname' => $_tname, - 'level' => 1, - 'exp_time' => $params['exp_time'] - ); - require_once(SMARTY_CORE_DIR . 'core.rmdir.php'); - $_res = smarty_core_rmdir($_params, $smarty); - } else { - // remove matching file names - $_handle = opendir($params['auto_base']); - $_res = true; - while (false !== ($_filename = readdir($_handle))) { - if($_filename == '.' || $_filename == '..') { - continue; - } elseif (substr($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, 0, strlen($_tname)) == $_tname) { - $_res &= (bool)$smarty->_unlink($params['auto_base'] . DIRECTORY_SEPARATOR . $_filename, $params['exp_time']); - } - } - } - } - - return $_res; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.rmdir.php b/gui/bacula-web/external_packages/smarty/internals/core.rmdir.php deleted file mode 100644 index 2166c44d28..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.rmdir.php +++ /dev/null @@ -1,54 +0,0 @@ - keep root) - * WARNING: no tests, it will try to remove what you tell it! - * - * @param string $dirname - * @param integer $level - * @param integer $exp_time - * @return boolean - */ - -// $dirname, $level = 1, $exp_time = null - -function smarty_core_rmdir($params, &$smarty) -{ - if(!isset($params['level'])) { $params['level'] = 1; } - if(!isset($params['exp_time'])) { $params['exp_time'] = null; } - - if($_handle = @opendir($params['dirname'])) { - - while (false !== ($_entry = readdir($_handle))) { - if ($_entry != '.' && $_entry != '..') { - if (@is_dir($params['dirname'] . DIRECTORY_SEPARATOR . $_entry)) { - $_params = array( - 'dirname' => $params['dirname'] . DIRECTORY_SEPARATOR . $_entry, - 'level' => $params['level'] + 1, - 'exp_time' => $params['exp_time'] - ); - smarty_core_rmdir($_params, $smarty); - } - else { - $smarty->_unlink($params['dirname'] . DIRECTORY_SEPARATOR . $_entry, $params['exp_time']); - } - } - } - closedir($_handle); - } - - if ($params['level']) { - return @rmdir($params['dirname']); - } - return (bool)$_handle; - -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.run_insert_handler.php b/gui/bacula-web/external_packages/smarty/internals/core.run_insert_handler.php deleted file mode 100644 index 71c3845080..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.run_insert_handler.php +++ /dev/null @@ -1,71 +0,0 @@ -debugging) { - $_params = array(); - $_debug_start_time = smarty_core_get_microtime($_params, $smarty); - } - - if ($smarty->caching) { - $_arg_string = serialize($params['args']); - $_name = $params['args']['name']; - if (!isset($smarty->_cache_info['insert_tags'][$_name])) { - $smarty->_cache_info['insert_tags'][$_name] = array('insert', - $_name, - $smarty->_plugins['insert'][$_name][1], - $smarty->_plugins['insert'][$_name][2], - !empty($params['args']['script']) ? true : false); - } - return $smarty->_smarty_md5."{insert_cache $_arg_string}".$smarty->_smarty_md5; - } else { - if (isset($params['args']['script'])) { - $_params = array('resource_name' => $smarty->_dequote($params['args']['script'])); - require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); - if(!smarty_core_get_php_resource($_params, $smarty)) { - return false; - } - - if ($_params['resource_type'] == 'file') { - $smarty->_include($_params['php_resource'], true); - } else { - $smarty->_eval($_params['php_resource']); - } - unset($params['args']['script']); - } - - $_funcname = $smarty->_plugins['insert'][$params['args']['name']][0]; - $_content = $_funcname($params['args'], $smarty); - if ($smarty->debugging) { - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $smarty->_smarty_debug_info[] = array('type' => 'insert', - 'filename' => 'insert_'.$params['args']['name'], - 'depth' => $smarty->_inclusion_depth, - 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); - } - - if (!empty($params['args']["assign"])) { - $smarty->assign($params['args']["assign"], $_content); - } else { - return $_content; - } - } -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.smarty_include_php.php b/gui/bacula-web/external_packages/smarty/internals/core.smarty_include_php.php deleted file mode 100644 index 30c6e76549..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.smarty_include_php.php +++ /dev/null @@ -1,50 +0,0 @@ - $params['smarty_file']); - require_once(SMARTY_CORE_DIR . 'core.get_php_resource.php'); - smarty_core_get_php_resource($_params, $smarty); - $_smarty_resource_type = $_params['resource_type']; - $_smarty_php_resource = $_params['php_resource']; - - if (!empty($params['smarty_assign'])) { - ob_start(); - if ($_smarty_resource_type == 'file') { - $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); - } else { - $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); - } - $smarty->assign($params['smarty_assign'], ob_get_contents()); - ob_end_clean(); - } else { - if ($_smarty_resource_type == 'file') { - $smarty->_include($_smarty_php_resource, $params['smarty_once'], $params['smarty_include_vars']); - } else { - $smarty->_eval($_smarty_php_resource, $params['smarty_include_vars']); - } - } -} - - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.write_cache_file.php b/gui/bacula-web/external_packages/smarty/internals/core.write_cache_file.php deleted file mode 100644 index 72f785b74e..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.write_cache_file.php +++ /dev/null @@ -1,96 +0,0 @@ -_cache_info['timestamp'] = time(); - if ($smarty->cache_lifetime > -1){ - // expiration set - $smarty->_cache_info['expires'] = $smarty->_cache_info['timestamp'] + $smarty->cache_lifetime; - } else { - // cache will never expire - $smarty->_cache_info['expires'] = -1; - } - - // collapse nocache.../nocache-tags - if (preg_match_all('!\{(/?)nocache\:[0-9a-f]{32}#\d+\}!', $params['results'], $match, PREG_PATTERN_ORDER)) { - // remove everything between every pair of outermost noache.../nocache-tags - // and replace it by a single nocache-tag - // this new nocache-tag will be replaced by dynamic contents in - // smarty_core_process_compiled_includes() on a cache-read - - $match_count = count($match[0]); - $results = preg_split('!(\{/?nocache\:[0-9a-f]{32}#\d+\})!', $params['results'], -1, PREG_SPLIT_DELIM_CAPTURE); - - $level = 0; - $j = 0; - for ($i=0, $results_count = count($results); $i < $results_count && $j < $match_count; $i++) { - if ($results[$i] == $match[0][$j]) { - // nocache tag - if ($match[1][$j]) { // closing tag - $level--; - unset($results[$i]); - } else { // opening tag - if ($level++ > 0) unset($results[$i]); - } - $j++; - } elseif ($level > 0) { - unset($results[$i]); - } - } - $params['results'] = implode('', $results); - } - $smarty->_cache_info['cache_serials'] = $smarty->_cache_serials; - - // prepend the cache header info into cache file - $_cache_info = serialize($smarty->_cache_info); - $params['results'] = strlen($_cache_info) . "\n" . $_cache_info . $params['results']; - - if (!empty($smarty->cache_handler_func)) { - // use cache_handler function - call_user_func_array($smarty->cache_handler_func, - array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null)); - } else { - // use local cache file - - if(!@is_writable($smarty->cache_dir)) { - // cache_dir not writable, see if it exists - if(!@is_dir($smarty->cache_dir)) { - $smarty->trigger_error('the $cache_dir \'' . $smarty->cache_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); - return false; - } - $smarty->trigger_error('unable to write to $cache_dir \'' . realpath($smarty->cache_dir) . '\'. Be sure $cache_dir is writable by the web server user.', E_USER_ERROR); - return false; - } - - $_auto_id = $smarty->_get_auto_id($params['cache_id'], $params['compile_id']); - $_cache_file = $smarty->_get_auto_filename($smarty->cache_dir, $params['tpl_file'], $_auto_id); - $_params = array('filename' => $_cache_file, 'contents' => $params['results'], 'create_dirs' => true); - require_once(SMARTY_CORE_DIR . 'core.write_file.php'); - smarty_core_write_file($_params, $smarty); - return true; - } -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.write_compiled_include.php b/gui/bacula-web/external_packages/smarty/internals/core.write_compiled_include.php deleted file mode 100644 index 5e0b2e0dde..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.write_compiled_include.php +++ /dev/null @@ -1,91 +0,0 @@ -caching && \!\$this->_cache_including\) \{ echo \'\{nocache\:('.$params['cache_serial'].')#(\d+)\}\';\}'; - $_tag_end = 'if \(\$this->caching && \!\$this->_cache_including\) \{ echo \'\{/nocache\:(\\2)#(\\3)\}\';\}'; - - preg_match_all('!('.$_tag_start.'(.*)'.$_tag_end.')!Us', - $params['compiled_content'], $_match_source, PREG_SET_ORDER); - - // no nocache-parts found: done - if (count($_match_source)==0) return; - - // convert the matched php-code to functions - $_include_compiled = "_version.", created on ".strftime("%Y-%m-%d %H:%M:%S")."\n"; - $_include_compiled .= " compiled from " . strtr(urlencode($params['resource_name']), array('%2F'=>'/', '%3A'=>':')) . " */\n\n"; - - $_compile_path = $params['include_file_path']; - - $smarty->_cache_serials[$_compile_path] = $params['cache_serial']; - $_include_compiled .= "\$this->_cache_serials['".$_compile_path."'] = '".$params['cache_serial']."';\n\n?>"; - - $_include_compiled .= $params['plugins_code']; - $_include_compiled .= "= 5.0) ? '_smarty' : 'this'; - for ($_i = 0, $_for_max = count($_match_source); $_i < $_for_max; $_i++) { - $_match =& $_match_source[$_i]; - $source = $_match[4]; - if ($this_varname == '_smarty') { - /* rename $this to $_smarty in the sourcecode */ - $tokens = token_get_all('\n"; - - $_params = array('filename' => $_compile_path, - 'contents' => $_include_compiled, 'create_dirs' => true); - - require_once(SMARTY_CORE_DIR . 'core.write_file.php'); - smarty_core_write_file($_params, $smarty); - return true; -} - - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.write_compiled_resource.php b/gui/bacula-web/external_packages/smarty/internals/core.write_compiled_resource.php deleted file mode 100644 index b902eff3cb..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.write_compiled_resource.php +++ /dev/null @@ -1,35 +0,0 @@ -compile_dir)) { - // compile_dir not writable, see if it exists - if(!@is_dir($smarty->compile_dir)) { - $smarty->trigger_error('the $compile_dir \'' . $smarty->compile_dir . '\' does not exist, or is not a directory.', E_USER_ERROR); - return false; - } - $smarty->trigger_error('unable to write to $compile_dir \'' . realpath($smarty->compile_dir) . '\'. Be sure $compile_dir is writable by the web server user.', E_USER_ERROR); - return false; - } - - $_params = array('filename' => $params['compile_path'], 'contents' => $params['compiled_content'], 'create_dirs' => true); - require_once(SMARTY_CORE_DIR . 'core.write_file.php'); - smarty_core_write_file($_params, $smarty); - return true; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/internals/core.write_file.php b/gui/bacula-web/external_packages/smarty/internals/core.write_file.php deleted file mode 100644 index 09e1698403..0000000000 --- a/gui/bacula-web/external_packages/smarty/internals/core.write_file.php +++ /dev/null @@ -1,54 +0,0 @@ - $_dirname); - require_once(SMARTY_CORE_DIR . 'core.create_dir_structure.php'); - smarty_core_create_dir_structure($_params, $smarty); - } - - // write to tmp file, then rename it to avoid - // file locking race condition - $_tmp_file = tempnam($_dirname, 'wrt'); - - if (!($fd = @fopen($_tmp_file, 'wb'))) { - $_tmp_file = $_dirname . DIRECTORY_SEPARATOR . uniqid('wrt'); - if (!($fd = @fopen($_tmp_file, 'wb'))) { - $smarty->trigger_error("problem writing temporary file '$_tmp_file'"); - return false; - } - } - - fwrite($fd, $params['contents']); - fclose($fd); - - // Delete the file if it allready exists (this is needed on Win, - // because it cannot overwrite files with rename() - if (file_exists($params['filename'])) { - @unlink($params['filename']); - } - @rename($_tmp_file, $params['filename']); - @chmod($params['filename'], $smarty->_file_perms); - - return true; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/block.textformat.php b/gui/bacula-web/external_packages/smarty/plugins/block.textformat.php deleted file mode 100644 index aaebab2f51..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/block.textformat.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Name: textformat
    - * Purpose: format text a certain way with preset styles - * or custom wrap/indent settings
    - * @link http://smarty.php.net/manual/en/language.function.textformat.php {textformat} - * (Smarty online manual) - * @param array - *
    - * Params:   style: string (email)
    - *           indent: integer (0)
    - *           wrap: integer (80)
    - *           wrap_char string ("\n")
    - *           indent_char: string (" ")
    - *           wrap_boundary: boolean (true)
    - * 
    - * @param string contents of the block - * @param Smarty clever simulation of a method - * @return string string $content re-formatted - */ -function smarty_block_textformat($params, $content, &$smarty) -{ - if (is_null($content)) { - return; - } - - $style = null; - $indent = 0; - $indent_first = 0; - $indent_char = ' '; - $wrap = 80; - $wrap_char = "\n"; - $wrap_cut = false; - $assign = null; - - foreach ($params as $_key => $_val) { - switch ($_key) { - case 'style': - case 'indent_char': - case 'wrap_char': - case 'assign': - $$_key = (string)$_val; - break; - - case 'indent': - case 'indent_first': - case 'wrap': - $$_key = (int)$_val; - break; - - case 'wrap_cut': - $$_key = (bool)$_val; - break; - - default: - $smarty->trigger_error("textformat: unknown attribute '$_key'"); - } - } - - if ($style == 'email') { - $wrap = 72; - } - - // split into paragraphs - $_paragraphs = preg_split('![\r\n][\r\n]!',$content); - $_output = ''; - - for($_x = 0, $_y = count($_paragraphs); $_x < $_y; $_x++) { - if ($_paragraphs[$_x] == '') { - continue; - } - // convert mult. spaces & special chars to single space - $_paragraphs[$_x] = preg_replace(array('!\s+!','!(^\s+)|(\s+$)!'), array(' ',''), $_paragraphs[$_x]); - // indent first line - if($indent_first > 0) { - $_paragraphs[$_x] = str_repeat($indent_char, $indent_first) . $_paragraphs[$_x]; - } - // wordwrap sentences - $_paragraphs[$_x] = wordwrap($_paragraphs[$_x], $wrap - $indent, $wrap_char, $wrap_cut); - // indent lines - if($indent > 0) { - $_paragraphs[$_x] = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraphs[$_x]); - } - } - $_output = implode($wrap_char . $wrap_char, $_paragraphs); - - return $assign ? $smarty->assign($assign, $_output) : $_output; - -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/compiler.assign.php b/gui/bacula-web/external_packages/smarty/plugins/compiler.assign.php deleted file mode 100644 index 2e02017796..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/compiler.assign.php +++ /dev/null @@ -1,38 +0,0 @@ - - * Name: assign
    - * Purpose: assign a value to a template variable - * @link http://smarty.php.net/manual/en/language.custom.functions.php#LANGUAGE.FUNCTION.ASSIGN {assign} - * (Smarty online manual) - * @param string containing var-attribute and value-attribute - * @param Smarty_Compiler - */ -function smarty_compiler_assign($tag_attrs, &$compiler) -{ - $_params = $compiler->_parse_attrs($tag_attrs); - - if (!isset($_params['var'])) { - $compiler->_syntax_error("assign: missing 'var' parameter", E_USER_WARNING); - return; - } - - if (!isset($_params['value'])) { - $compiler->_syntax_error("assign: missing 'value' parameter", E_USER_WARNING); - return; - } - - return "\$this->assign({$_params['var']}, {$_params['value']});"; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.assign_debug_info.php b/gui/bacula-web/external_packages/smarty/plugins/function.assign_debug_info.php deleted file mode 100644 index 8015624b1f..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.assign_debug_info.php +++ /dev/null @@ -1,39 +0,0 @@ - - * Name: assign_debug_info
    - * Purpose: assign debug info to the template
    - * @param array unused in this plugin, this plugin uses {@link Smarty::$_config}, - * {@link Smarty::$_tpl_vars} and {@link Smarty::$_smarty_debug_info} - * @param Smarty - */ -function smarty_function_assign_debug_info($params, &$smarty) -{ - $assigned_vars = $smarty->_tpl_vars; - ksort($assigned_vars); - if (@is_array($smarty->_config[0])) { - $config_vars = $smarty->_config[0]; - ksort($config_vars); - $smarty->assign("_debug_config_keys", array_keys($config_vars)); - $smarty->assign("_debug_config_vals", array_values($config_vars)); - } - - $included_templates = $smarty->_smarty_debug_info; - - $smarty->assign("_debug_keys", array_keys($assigned_vars)); - $smarty->assign("_debug_vals", array_values($assigned_vars)); - - $smarty->assign("_debug_tpls", $included_templates); -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.config_load.php b/gui/bacula-web/external_packages/smarty/plugins/function.config_load.php deleted file mode 100644 index db7f8f6b9b..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.config_load.php +++ /dev/null @@ -1,140 +0,0 @@ - - * Name: config_load
    - * Purpose: load config file vars - * @link http://smarty.php.net/manual/en/language.function.config.load.php {config_load} - * (Smarty online manual) - * @param array Format: - *
    - * array('file' => required config file name,
    - *       'section' => optional config file section to load
    - *       'scope' => local/parent/global
    - *       'global' => overrides scope, setting to parent if true)
    - * 
    - * @param Smarty - */ -function smarty_function_config_load($params, &$smarty) -{ - if ($smarty->debugging) { - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $_debug_start_time = smarty_core_get_microtime($_params, $smarty); - } - - $_file = isset($params['file']) ? $smarty->_dequote($params['file']) : null; - $_section = isset($params['section']) ? $smarty->_dequote($params['section']) : null; - $_scope = isset($params['scope']) ? $smarty->_dequote($params['scope']) : 'global'; - $_global = isset($params['global']) ? $smarty->_dequote($params['global']) : false; - - if (!isset($_file) || strlen($_file) == 0) { - $smarty->trigger_error("missing 'file' attribute in config_load tag", E_USER_ERROR, __FILE__, __LINE__); - } - - if (isset($_scope)) { - if ($_scope != 'local' && - $_scope != 'parent' && - $_scope != 'global') { - $smarty->trigger_error("invalid 'scope' attribute value", E_USER_ERROR, __FILE__, __LINE__); - } - } else { - if ($_global) { - $_scope = 'parent'; - } else { - $_scope = 'local'; - } - } - - $_params = array('resource_name' => $_file, - 'resource_base_path' => $smarty->config_dir, - 'get_source' => false); - $smarty->_parse_resource_name($_params); - $_file_path = $_params['resource_type'] . ':' . $_params['resource_name']; - if (isset($_section)) - $_compile_file = $smarty->_get_compile_path($_file_path.'|'.$_section); - else - $_compile_file = $smarty->_get_compile_path($_file_path); - - if($smarty->force_compile || !file_exists($_compile_file)) { - $_compile = true; - } elseif ($smarty->compile_check) { - $_params = array('resource_name' => $_file, - 'resource_base_path' => $smarty->config_dir, - 'get_source' => false); - $_compile = $smarty->_fetch_resource_info($_params) && - $_params['resource_timestamp'] > filemtime($_compile_file); - } else { - $_compile = false; - } - - if($_compile) { - // compile config file - if(!is_object($smarty->_conf_obj)) { - require_once SMARTY_DIR . $smarty->config_class . '.class.php'; - $smarty->_conf_obj = new $smarty->config_class(); - $smarty->_conf_obj->overwrite = $smarty->config_overwrite; - $smarty->_conf_obj->booleanize = $smarty->config_booleanize; - $smarty->_conf_obj->read_hidden = $smarty->config_read_hidden; - $smarty->_conf_obj->fix_newlines = $smarty->config_fix_newlines; - } - - $_params = array('resource_name' => $_file, - 'resource_base_path' => $smarty->config_dir, - $_params['get_source'] = true); - if (!$smarty->_fetch_resource_info($_params)) { - return; - } - $smarty->_conf_obj->set_file_contents($_file, $_params['source_content']); - $_config_vars = array_merge($smarty->_conf_obj->get($_file), - $smarty->_conf_obj->get($_file, $_section)); - if(function_exists('var_export')) { - $_output = ''; - } else { - $_output = ''\\\'', '\\'=>'\\\\')) . '\'); ?>'; - } - $_params = (array('compile_path' => $_compile_file, 'compiled_content' => $_output, 'resource_timestamp' => $_params['resource_timestamp'])); - require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php'); - smarty_core_write_compiled_resource($_params, $smarty); - } else { - include($_compile_file); - } - - if ($smarty->caching) { - $smarty->_cache_info['config'][$_file] = true; - } - - $smarty->_config[0]['vars'] = @array_merge($smarty->_config[0]['vars'], $_config_vars); - $smarty->_config[0]['files'][$_file] = true; - - if ($_scope == 'parent') { - $smarty->_config[1]['vars'] = @array_merge($smarty->_config[1]['vars'], $_config_vars); - $smarty->_config[1]['files'][$_file] = true; - } else if ($_scope == 'global') { - for ($i = 1, $for_max = count($smarty->_config); $i < $for_max; $i++) { - $smarty->_config[$i]['vars'] = @array_merge($smarty->_config[$i]['vars'], $_config_vars); - $smarty->_config[$i]['files'][$_file] = true; - } - } - - if ($smarty->debugging) { - $_params = array(); - require_once(SMARTY_CORE_DIR . 'core.get_microtime.php'); - $smarty->_smarty_debug_info[] = array('type' => 'config', - 'filename' => $_file.' ['.$_section.'] '.$_scope, - 'depth' => $smarty->_inclusion_depth, - 'exec_time' => smarty_core_get_microtime($_params, $smarty) - $_debug_start_time); - } - -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.counter.php b/gui/bacula-web/external_packages/smarty/plugins/function.counter.php deleted file mode 100644 index cfe5dd886f..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.counter.php +++ /dev/null @@ -1,79 +0,0 @@ - - * Name: counter
    - * Purpose: print out a counter value - * @link http://smarty.php.net/manual/en/language.function.counter.php {counter} - * (Smarty online manual) - * @param array parameters - * @param Smarty - * @return string|null - */ -function smarty_function_counter($params, &$smarty) -{ - static $counters = array(); - - $name = (isset($params['name'])) ? $params['name'] : 'default'; - if (!isset($counters[$name])) { - $counters[$name] = array( - 'start'=>1, - 'skip'=>1, - 'direction'=>'up', - 'count'=>1 - ); - } - $counter =& $counters[$name]; - - if (isset($params['start'])) { - $counter['start'] = $counter['count'] = (int)$params['start']; - } - - if (!empty($params['assign'])) { - $counter['assign'] = $params['assign']; - } - - if (isset($counter['assign'])) { - $smarty->assign($counter['assign'], $counter['count']); - } - - if (isset($params['print'])) { - $print = (bool)$params['print']; - } else { - $print = empty($counter['assign']); - } - - if ($print) { - $retval = $counter['count']; - } else { - $retval = null; - } - - if (isset($params['skip'])) { - $counter['skip'] = $params['skip']; - } - - if (isset($params['direction'])) { - $counter['direction'] = $params['direction']; - } - - if ($counter['direction'] == "down") - $counter['count'] -= $counter['skip']; - else - $counter['count'] += $counter['skip']; - - return $retval; - -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.cycle.php b/gui/bacula-web/external_packages/smarty/plugins/function.cycle.php deleted file mode 100644 index fe78bb87da..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.cycle.php +++ /dev/null @@ -1,102 +0,0 @@ - - * Name: cycle
    - * Date: May 3, 2002
    - * Purpose: cycle through given values
    - * Input: - * - name = name of cycle (optional) - * - values = comma separated list of values to cycle, - * or an array of values to cycle - * (this can be left out for subsequent calls) - * - reset = boolean - resets given var to true - * - print = boolean - print var or not. default is true - * - advance = boolean - whether or not to advance the cycle - * - delimiter = the value delimiter, default is "," - * - assign = boolean, assigns to template var instead of - * printed. - * - * Examples:
    - *
    - * {cycle values="#eeeeee,#d0d0d0d"}
    - * {cycle name=row values="one,two,three" reset=true}
    - * {cycle name=row}
    - * 
    - * @link http://smarty.php.net/manual/en/language.function.cycle.php {cycle} - * (Smarty online manual) - * @author Monte Ohrt - * @author credit to Mark Priatel - * @author credit to Gerard - * @author credit to Jason Sweat - * @version 1.3 - * @param array - * @param Smarty - * @return string|null - */ -function smarty_function_cycle($params, &$smarty) -{ - static $cycle_vars; - - $name = (empty($params['name'])) ? 'default' : $params['name']; - $print = (isset($params['print'])) ? (bool)$params['print'] : true; - $advance = (isset($params['advance'])) ? (bool)$params['advance'] : true; - $reset = (isset($params['reset'])) ? (bool)$params['reset'] : false; - - if (!in_array('values', array_keys($params))) { - if(!isset($cycle_vars[$name]['values'])) { - $smarty->trigger_error("cycle: missing 'values' parameter"); - return; - } - } else { - if(isset($cycle_vars[$name]['values']) - && $cycle_vars[$name]['values'] != $params['values'] ) { - $cycle_vars[$name]['index'] = 0; - } - $cycle_vars[$name]['values'] = $params['values']; - } - - $cycle_vars[$name]['delimiter'] = (isset($params['delimiter'])) ? $params['delimiter'] : ','; - - if(is_array($cycle_vars[$name]['values'])) { - $cycle_array = $cycle_vars[$name]['values']; - } else { - $cycle_array = explode($cycle_vars[$name]['delimiter'],$cycle_vars[$name]['values']); - } - - if(!isset($cycle_vars[$name]['index']) || $reset ) { - $cycle_vars[$name]['index'] = 0; - } - - if (isset($params['assign'])) { - $print = false; - $smarty->assign($params['assign'], $cycle_array[$cycle_vars[$name]['index']]); - } - - if($print) { - $retval = $cycle_array[$cycle_vars[$name]['index']]; - } else { - $retval = null; - } - - if($advance) { - if ( $cycle_vars[$name]['index'] >= count($cycle_array) -1 ) { - $cycle_vars[$name]['index'] = 0; - } else { - $cycle_vars[$name]['index']++; - } - } - - return $retval; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.debug.php b/gui/bacula-web/external_packages/smarty/plugins/function.debug.php deleted file mode 100644 index 43452307bc..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.debug.php +++ /dev/null @@ -1,35 +0,0 @@ - - * Name: debug
    - * Date: July 1, 2002
    - * Purpose: popup debug window - * @link http://smarty.php.net/manual/en/language.function.debug.php {debug} - * (Smarty online manual) - * @author Monte Ohrt - * @version 1.0 - * @param array - * @param Smarty - * @return string output from {@link Smarty::_generate_debug_output()} - */ -function smarty_function_debug($params, &$smarty) -{ - if (isset($params['output'])) { - $smarty->assign('_smarty_debug_output', $params['output']); - } - require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php'); - return smarty_core_display_debug_console(null, $smarty); -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.eval.php b/gui/bacula-web/external_packages/smarty/plugins/function.eval.php deleted file mode 100644 index 3a4b8b2b8c..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.eval.php +++ /dev/null @@ -1,48 +0,0 @@ - - * Name: eval
    - * Purpose: evaluate a template variable as a template
    - * @link http://smarty.php.net/manual/en/language.function.eval.php {eval} - * (Smarty online manual) - * @param array - * @param Smarty - */ -function smarty_function_eval($params, &$smarty) -{ - - if (!isset($params['var'])) { - $smarty->trigger_error("eval: missing 'var' parameter"); - return; - } - - if($params['var'] == '') { - return; - } - - $smarty->_compile_source('evaluated template', $params['var'], $_var_compiled); - - ob_start(); - $smarty->_eval('?>' . $_var_compiled); - $_contents = ob_get_contents(); - ob_end_clean(); - - if (!empty($params['assign'])) { - $smarty->assign($params['assign'], $_contents); - } else { - return $_contents; - } -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.fetch.php b/gui/bacula-web/external_packages/smarty/plugins/function.fetch.php deleted file mode 100644 index f5a6987a90..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.fetch.php +++ /dev/null @@ -1,220 +0,0 @@ - - * Name: fetch
    - * Purpose: fetch file, web or ftp data and display results - * @link http://smarty.php.net/manual/en/language.function.fetch.php {fetch} - * (Smarty online manual) - * @param array - * @param Smarty - * @return string|null if the assign parameter is passed, Smarty assigns the - * result to a template variable - */ -function smarty_function_fetch($params, &$smarty) -{ - if (empty($params['file'])) { - $smarty->_trigger_fatal_error("[plugin] parameter 'file' cannot be empty"); - return; - } - - $content = ''; - if ($smarty->security && !preg_match('!^(http|ftp)://!i', $params['file'])) { - $_params = array('resource_type' => 'file', 'resource_name' => $params['file']); - require_once(SMARTY_CORE_DIR . 'core.is_secure.php'); - if(!smarty_core_is_secure($_params, $smarty)) { - $smarty->_trigger_fatal_error('[plugin] (secure mode) fetch \'' . $params['file'] . '\' is not allowed'); - return; - } - - // fetch the file - if($fp = @fopen($params['file'],'r')) { - while(!feof($fp)) { - $content .= fgets ($fp,4096); - } - fclose($fp); - } else { - $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] . '\''); - return; - } - } else { - // not a local file - if(preg_match('!^http://!i',$params['file'])) { - // http fetch - if($uri_parts = parse_url($params['file'])) { - // set defaults - $host = $server_name = $uri_parts['host']; - $timeout = 30; - $accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*"; - $agent = "Smarty Template Engine ".$smarty->_version; - $referer = ""; - $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; - $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; - $_is_proxy = false; - if(empty($uri_parts['port'])) { - $port = 80; - } else { - $port = $uri_parts['port']; - } - if(!empty($uri_parts['user'])) { - $user = $uri_parts['user']; - } - if(!empty($uri_parts['pass'])) { - $pass = $uri_parts['pass']; - } - // loop through parameters, setup headers - foreach($params as $param_key => $param_value) { - switch($param_key) { - case "file": - case "assign": - case "assign_headers": - break; - case "user": - if(!empty($param_value)) { - $user = $param_value; - } - break; - case "pass": - if(!empty($param_value)) { - $pass = $param_value; - } - break; - case "accept": - if(!empty($param_value)) { - $accept = $param_value; - } - break; - case "header": - if(!empty($param_value)) { - if(!preg_match('![\w\d-]+: .+!',$param_value)) { - $smarty->_trigger_fatal_error("[plugin] invalid header format '".$param_value."'"); - return; - } else { - $extra_headers[] = $param_value; - } - } - break; - case "proxy_host": - if(!empty($param_value)) { - $proxy_host = $param_value; - } - break; - case "proxy_port": - if(!preg_match('!\D!', $param_value)) { - $proxy_port = (int) $param_value; - } else { - $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); - return; - } - break; - case "agent": - if(!empty($param_value)) { - $agent = $param_value; - } - break; - case "referer": - if(!empty($param_value)) { - $referer = $param_value; - } - break; - case "timeout": - if(!preg_match('!\D!', $param_value)) { - $timeout = (int) $param_value; - } else { - $smarty->_trigger_fatal_error("[plugin] invalid value for attribute '".$param_key."'"); - return; - } - break; - default: - $smarty->_trigger_fatal_error("[plugin] unrecognized attribute '".$param_key."'"); - return; - } - } - if(!empty($proxy_host) && !empty($proxy_port)) { - $_is_proxy = true; - $fp = fsockopen($proxy_host,$proxy_port,$errno,$errstr,$timeout); - } else { - $fp = fsockopen($server_name,$port,$errno,$errstr,$timeout); - } - - if(!$fp) { - $smarty->_trigger_fatal_error("[plugin] unable to fetch: $errstr ($errno)"); - return; - } else { - if($_is_proxy) { - fputs($fp, 'GET ' . $params['file'] . " HTTP/1.0\r\n"); - } else { - fputs($fp, "GET $uri HTTP/1.0\r\n"); - } - if(!empty($host)) { - fputs($fp, "Host: $host\r\n"); - } - if(!empty($accept)) { - fputs($fp, "Accept: $accept\r\n"); - } - if(!empty($agent)) { - fputs($fp, "User-Agent: $agent\r\n"); - } - if(!empty($referer)) { - fputs($fp, "Referer: $referer\r\n"); - } - if(isset($extra_headers) && is_array($extra_headers)) { - foreach($extra_headers as $curr_header) { - fputs($fp, $curr_header."\r\n"); - } - } - if(!empty($user) && !empty($pass)) { - fputs($fp, "Authorization: BASIC ".base64_encode("$user:$pass")."\r\n"); - } - - fputs($fp, "\r\n"); - while(!feof($fp)) { - $content .= fgets($fp,4096); - } - fclose($fp); - $csplit = split("\r\n\r\n",$content,2); - - $content = $csplit[1]; - - if(!empty($params['assign_headers'])) { - $smarty->assign($params['assign_headers'],split("\r\n",$csplit[0])); - } - } - } else { - $smarty->_trigger_fatal_error("[plugin] unable to parse URL, check syntax"); - return; - } - } else { - // ftp fetch - if($fp = @fopen($params['file'],'r')) { - while(!feof($fp)) { - $content .= fgets ($fp,4096); - } - fclose($fp); - } else { - $smarty->_trigger_fatal_error('[plugin] fetch cannot read file \'' . $params['file'] .'\''); - return; - } - } - - } - - - if (!empty($params['assign'])) { - $smarty->assign($params['assign'],$content); - } else { - return $content; - } -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.html_checkboxes.php b/gui/bacula-web/external_packages/smarty/plugins/function.html_checkboxes.php deleted file mode 100644 index ed8ad7f33d..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.html_checkboxes.php +++ /dev/null @@ -1,143 +0,0 @@ - - * Type: function
    - * Name: html_checkboxes
    - * Date: 24.Feb.2003
    - * Purpose: Prints out a list of checkbox input types
    - * Input:
    - * - name (optional) - string default "checkbox" - * - values (required) - array - * - options (optional) - associative array - * - checked (optional) - array default not set - * - separator (optional) - ie
    or   - * - output (optional) - the output next to each checkbox - * - assign (optional) - assign the output as an array to this variable - * Examples: - *
    - * {html_checkboxes values=$ids output=$names}
    - * {html_checkboxes values=$ids name='box' separator='
    ' output=$names} - * {html_checkboxes values=$ids checked=$checked separator='
    ' output=$names} - *
    - * @link http://smarty.php.net/manual/en/language.function.html.checkboxes.php {html_checkboxes} - * (Smarty online manual) - * @author Christopher Kvarme - * @author credits to Monte Ohrt - * @version 1.0 - * @param array - * @param Smarty - * @return string - * @uses smarty_function_escape_special_chars() - */ -function smarty_function_html_checkboxes($params, &$smarty) -{ - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); - - $name = 'checkbox'; - $values = null; - $options = null; - $selected = null; - $separator = ''; - $labels = true; - $output = null; - - $extra = ''; - - foreach($params as $_key => $_val) { - switch($_key) { - case 'name': - case 'separator': - $$_key = $_val; - break; - - case 'labels': - $$_key = (bool)$_val; - break; - - case 'options': - $$_key = (array)$_val; - break; - - case 'values': - case 'output': - $$_key = array_values((array)$_val); - break; - - case 'checked': - case 'selected': - $selected = array_map('strval', array_values((array)$_val)); - break; - - case 'checkboxes': - $smarty->trigger_error('html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead', E_USER_WARNING); - $options = (array)$_val; - break; - - case 'assign': - break; - - default: - if(!is_array($_val)) { - $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; - } else { - $smarty->trigger_error("html_checkboxes: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } - break; - } - } - - if (!isset($options) && !isset($values)) - return ''; /* raise error here? */ - - settype($selected, 'array'); - $_html_result = array(); - - if (isset($options)) { - - foreach ($options as $_key=>$_val) - $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); - - - } else { - foreach ($values as $_i=>$_key) { - $_val = isset($output[$_i]) ? $output[$_i] : ''; - $_html_result[] = smarty_function_html_checkboxes_output($name, $_key, $_val, $selected, $extra, $separator, $labels); - } - - } - - if(!empty($params['assign'])) { - $smarty->assign($params['assign'], $_html_result); - } else { - return implode("\n",$_html_result); - } - -} - -function smarty_function_html_checkboxes_output($name, $value, $output, $selected, $extra, $separator, $labels) { - $_output = ''; - if ($labels) $_output .= ''; - $_output .= $separator; - - return $_output; -} - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.html_image.php b/gui/bacula-web/external_packages/smarty/plugins/function.html_image.php deleted file mode 100644 index c62b0fea69..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.html_image.php +++ /dev/null @@ -1,139 +0,0 @@ - - * Name: html_image
    - * Date: Feb 24, 2003
    - * Purpose: format HTML tags for the image
    - * Input:
    - * - file = file (and path) of image (required) - * - height = image height (optional, default actual height) - * - width = image width (optional, default actual width) - * - basedir = base directory for absolute paths, default - * is environment variable DOCUMENT_ROOT - * - * Examples: {html_image file="images/masthead.gif"} - * Output: - * @link http://smarty.php.net/manual/en/language.function.html.image.php {html_image} - * (Smarty online manual) - * @author Monte Ohrt - * @author credits to Duda - wrote first image function - * in repository, helped with lots of functionality - * @version 1.0 - * @param array - * @param Smarty - * @return string - * @uses smarty_function_escape_special_chars() - */ -function smarty_function_html_image($params, &$smarty) -{ - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); - - $alt = ''; - $file = ''; - $height = ''; - $width = ''; - $extra = ''; - $prefix = ''; - $suffix = ''; - $server_vars = ($smarty->request_use_auto_globals) ? $_SERVER : $GLOBALS['HTTP_SERVER_VARS']; - $basedir = isset($server_vars['DOCUMENT_ROOT']) ? $server_vars['DOCUMENT_ROOT'] : ''; - foreach($params as $_key => $_val) { - switch($_key) { - case 'file': - case 'height': - case 'width': - case 'dpi': - case 'basedir': - $$_key = $_val; - break; - - case 'alt': - if(!is_array($_val)) { - $$_key = smarty_function_escape_special_chars($_val); - } else { - $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } - break; - - case 'link': - case 'href': - $prefix = ''; - $suffix = ''; - break; - - default: - if(!is_array($_val)) { - $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; - } else { - $smarty->trigger_error("html_image: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } - break; - } - } - - if (empty($file)) { - $smarty->trigger_error("html_image: missing 'file' parameter", E_USER_NOTICE); - return; - } - - if (substr($file,0,1) == '/') { - $_image_path = $basedir . $file; - } else { - $_image_path = $file; - } - - if(!isset($params['width']) || !isset($params['height'])) { - if ($smarty->security && - ($_params = array('resource_type' => 'file', 'resource_name' => $_image_path)) && - (require_once(SMARTY_CORE_DIR . 'core.is_secure.php')) && - (!smarty_core_is_secure($_params, $smarty)) ) { - $smarty->trigger_error("html_image: (secure) '$_image_path' not in secure directory", E_USER_NOTICE); - - } elseif (!$_image_data = @getimagesize($_image_path)) { - if(!file_exists($_image_path)) { - $smarty->trigger_error("html_image: unable to find '$_image_path'", E_USER_NOTICE); - return; - } else if(!is_readable($_image_path)) { - $smarty->trigger_error("html_image: unable to read '$_image_path'", E_USER_NOTICE); - return; - } else { - $smarty->trigger_error("html_image: '$_image_path' is not a valid image file", E_USER_NOTICE); - return; - } - } - - if(!isset($params['width'])) { - $width = $_image_data[0]; - } - if(!isset($params['height'])) { - $height = $_image_data[1]; - } - - } - - if(isset($params['dpi'])) { - if(strstr($server_vars['HTTP_USER_AGENT'], 'Mac')) { - $dpi_default = 72; - } else { - $dpi_default = 96; - } - $_resize = $dpi_default/$params['dpi']; - $width = round($width * $_resize); - $height = round($height * $_resize); - } - - return $prefix . ''.$alt.'' . $suffix; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.html_options.php b/gui/bacula-web/external_packages/smarty/plugins/function.html_options.php deleted file mode 100644 index ae864f7327..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.html_options.php +++ /dev/null @@ -1,121 +0,0 @@ - - * Name: html_options
    - * Input:
    - * - name (optional) - string default "select" - * - values (required if no options supplied) - array - * - options (required if no values supplied) - associative array - * - selected (optional) - string default not set - * - output (required if not options supplied) - array - * Purpose: Prints the list of ' . "\n"; - foreach ($values as $key => $value) { - $optgroup_html .= smarty_function_html_options_optoutput($key, $value, $selected); - } - $optgroup_html .= "\n"; - return $optgroup_html; -} - -/* vim: set expandtab: */ - -?> diff --git a/gui/bacula-web/external_packages/smarty/plugins/function.html_radios.php b/gui/bacula-web/external_packages/smarty/plugins/function.html_radios.php deleted file mode 100644 index 7503cfaca8..0000000000 --- a/gui/bacula-web/external_packages/smarty/plugins/function.html_radios.php +++ /dev/null @@ -1,156 +0,0 @@ - - * Type: function
    - * Name: html_radios
    - * Date: 24.Feb.2003
    - * Purpose: Prints out a list of radio input types
    - * Input:
    - * - name (optional) - string default "radio" - * - values (required) - array - * - options (optional) - associative array - * - checked (optional) - array default not set - * - separator (optional) - ie
    or   - * - output (optional) - the output next to each radio button - * - assign (optional) - assign the output as an array to this variable - * Examples: - *
    - * {html_radios values=$ids output=$names}
    - * {html_radios values=$ids name='box' separator='
    ' output=$names} - * {html_radios values=$ids checked=$checked separator='
    ' output=$names} - *
    - * @link http://smarty.php.net/manual/en/language.function.html.radios.php {html_radios} - * (Smarty online manual) - * @author Christopher Kvarme - * @author credits to Monte Ohrt - * @version 1.0 - * @param array - * @param Smarty - * @return string - * @uses smarty_function_escape_special_chars() - */ -function smarty_function_html_radios($params, &$smarty) -{ - require_once $smarty->_get_plugin_filepath('shared','escape_special_chars'); - - $name = 'radio'; - $values = null; - $options = null; - $selected = null; - $separator = ''; - $labels = true; - $label_ids = false; - $output = null; - $extra = ''; - - foreach($params as $_key => $_val) { - switch($_key) { - case 'name': - case 'separator': - $$_key = (string)$_val; - break; - - case 'checked': - case 'selected': - if(is_array($_val)) { - $smarty->trigger_error('html_radios: the "' . $_key . '" attribute cannot be an array', E_USER_WARNING); - } else { - $selected = (string)$_val; - } - break; - - case 'labels': - case 'label_ids': - $$_key = (bool)$_val; - break; - - case 'options': - $$_key = (array)$_val; - break; - - case 'values': - case 'output': - $$_key = array_values((array)$_val); - break; - - case 'radios': - $smarty->trigger_error('html_radios: the use of the "radios" attribute is deprecated, use "options" instead', E_USER_WARNING); - $options = (array)$_val; - break; - - case 'assign': - break; - - default: - if(!is_array($_val)) { - $extra .= ' '.$_key.'="'.smarty_function_escape_special_chars($_val).'"'; - } else { - $smarty->trigger_error("html_radios: extra attribute '$_key' cannot be an array", E_USER_NOTICE); - } - break; - } - } - - if (!isset($options) && !isset($values)) - return ''; /* raise error here? */ - - $_html_result = array(); - - if (isset($options)) { - - foreach ($options as $_key=>$_val) - $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids); - - } else { - - foreach ($values as $_i=>$_key) { - $_val = isset($output[$_i]) ? $output[$_i] : ''; - $_html_result[] = smarty_function_html_radios_output($name, $_key, $_val, $selected, $extra, $separator, $labels, $label_ids); - } - - } - - if(!empty($params['assign'])) { - $smarty->assign($params['assign'], $_html_result); - } else { - return implode("\n",$_html_result); - } - -} - -function smarty_function_html_radios_output($name, $value, $output, $selected, $extra, $separator, $labels, $label_ids) { - $_output = ''; - if ($labels) { - if($label_ids) { - $_id = smarty_function_escape_special_chars(preg_replace('![^\w\-\.]!', '_', $name . '_' . $value)); - $_output .= '