]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Enable data encryption code.
authorKern Sibbald <kern@sibbald.com>
Mon, 4 Dec 2006 09:39:26 +0000 (09:39 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 4 Dec 2006 09:39:26 +0000 (09:39 +0000)
kes  Add gigaslam.c to src/tools. It creates a 1GB file that contains
     only two blocks -- i.e. it is a real sparse file.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3743 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/util.c
bacula/src/stored/read_record.c
bacula/src/tools/.cvsignore
bacula/src/tools/Makefile.in
bacula/src/tools/gigaslam.c [new file with mode: 0644]
bacula/src/version.h
bacula/technotes-1.39

index b457f0a3963f3b38683e37b02e754a07880a9e6f..9cb5e07755540c0cb762e43eff19a001b0d1af41 100644 (file)
@@ -76,8 +76,9 @@ bool is_buf_zero(char *buf, int len)
 void lcase(char *str)
 {
    while (*str) {
-      if (B_ISUPPER(*str))
+      if (B_ISUPPER(*str)) {
          *str = tolower((int)(*str));
+       }
        str++;
    }
 }
index b2dc3113f12fd7bda1afefb7ddd38a15917b118f..cc555c4d24e1c113909405fe5c16a816dad92325 100644 (file)
@@ -145,7 +145,7 @@ bool read_records(DCR *dcr,
             display_tape_error_status(jcr, dev);
             if (forge_on || jcr->ignore_label_errors) {
                dev->fsr(1);       /* try skipping bad record */
-               Pmsg0(000, _("Did fsr\n"));
+               Pmsg0(000, _("Did fsr in attemp to skip bad record.\n"));
                continue;              /* try to continue */
             }
             ok = false;               /* stop everything */
index 4fb9b68d235988d60396faaf4cb554e4f8d2519e..dce368b7b1fbca0f205b47fca2bd7c5340665e4e 100644 (file)
@@ -9,3 +9,4 @@ bsmtp
 testfind
 fstype
 drivetype
+gigaslam
index 15502f3ec59ce3d05c0d9198445391474e1d4efc..441896dbadec56a0e96dcf5ee3b58286e06aa8e1 100644 (file)
@@ -55,7 +55,7 @@ INSTOOLS = $(INS@DIR_TOOLS@)
        @echo "Compiling $<"
        $(NO_ECHO)$(CXX) $(DEFS) $(DEBUG) -c $(CPPFLAGS) $(PYTHON_INC) -I$(srcdir) -I$(basedir) $(DINCLUDE) $(CFLAGS) $<
 #-------------------------------------------------------------------------
-all: Makefile $(TOOLS) 
+all: Makefile $(TOOLS) gigaslam
        @echo "==== Make of tools is good ===="
        @echo " "
 
@@ -96,6 +96,11 @@ bwild:       ../findlib/libfind.a ../lib/libbac.a bwild.o
        $(CXX) -g $(LDFLAGS) -L. -L../lib -o $@ bwild.o \
          $(DLIB) -lbac -lm $(LIBS) $(GETTEXT_LIBS) $(OPENSSL_LIBS)
 
+gigaslam.o: gigaslam.c
+       $(CC) -c $<  
+
+gigaslam: gigaslam.o
+       $(CC) -o $@ gigaslam.o
 
 
 Makefile: $(srcdir)/Makefile.in $(topdir)/config.status
diff --git a/bacula/src/tools/gigaslam.c b/bacula/src/tools/gigaslam.c
new file mode 100644 (file)
index 0000000..42dc6f9
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+    By John Walker written ages ago.
+
+    Create a sparse file.
+
+    Beat denial of service floggers to death by persuading
+    them to download a HOW_BIG pseudo GIF file which is actually
+    a holey file occupying trivial space on our server.
+
+    Make:  make gigaslam            
+    Run:   ./gigaslam
+    Output: a file named gigaslam.gif that contains something like
+            16K bytes (i.e. 2-8K blocks), but appears to be 1GB in 
+            length because the second block is written at a 1GB 
+            address.
+
+    Be careful what you do with this file as not all programs know
+    how to deal with sparse files.
+    
+*/
+
+#define HOW_BIG   1000000000ll
+
+#ifdef __GNUC__
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+int main(void)
+{
+    FILE *fp = fopen("gigaslam.gif", "w");
+    char header[] = "<html>\n<table>\n<tr><td>\n";
+    char trailer[] = "</html>\n";
+    off_t howBig = HOW_BIG;
+    
+    fwrite(header, sizeof header, 1, fp);
+    fseeko(fp, howBig - strlen(trailer), 0);
+    fwrite(trailer, strlen(trailer), 1, fp);
+    fclose(fp);
+    return 0;
+    
+}
index 362944af0bb9bd08f28c93923d17e945c460d0a3..369efec56389a1e8b7bd67988bcbb94f1dedec21 100644 (file)
@@ -4,8 +4,8 @@
 
 #undef  VERSION
 #define VERSION "1.39.29"
-#define BDATE   "02 December 2006"
-#define LSMDATE "02Dec06"
+#define BDATE   "04 December 2006"
+#define LSMDATE "04Dec06"
 
 #define PROG_COPYRIGHT "Copyright (C) %d-2006 Free Software Foundation Europe e.V.\n"
 #define BYEAR "2006"       /* year for copyright messages in progs */
@@ -49,7 +49,7 @@
 /* If this is set stdout will not be closed on startup */
 #define DEVELOPER 1
 
-/* #define DATA_ENCRYPTION 1 */
+#define DATA_ENCRYPTION 1
 
 #define USE_BSNPRINTF 1
 
index 8265b4e17420df71b49e134f0d8e4e502970aa61..a609f9044cb90f714d10e3a7aebcc93e43cffebc 100644 (file)
@@ -1,6 +1,10 @@
               Technical notes on version 1.39  
 
 General:
+04Dec06
+kes  Enable data encryption code.
+kes  Add gigaslam.c to src/tools. It creates a 1GB file that contains
+     only two blocks -- i.e. it is a real sparse file.
 03Dec06
 kes  Enable disk seeking on restore.
 kes  Implement the SD 'Block Positioning = yes|no' directive. This