diff -u memcached-1.4.0.orig/ChangeLog memcached-1.4.0/ChangeLog
--- memcached-1.4.0.orig/ChangeLog	2009-06-21 06:24:18.000000000 +0000
+++ memcached-1.4.0/ChangeLog	2009-07-24 16:09:21.000000000 +0000
@@ -1,3 +1,6 @@
+2009-07-24
+	* Feature: -F option for disabling flush_all command (aotto)
+
 2009-04-10
 
 	* *critical bugfix*. In 1.2.7 under multithreaded mode, memcached
Common subdirectories: memcached-1.4.0.orig/doc and memcached-1.4.0/doc
Only in memcached-1.4.0: memcached-1.4.0.tar.gz
diff -u memcached-1.4.0.orig/memcached.c memcached-1.4.0/memcached.c
--- memcached-1.4.0.orig/memcached.c	2009-07-09 17:16:24.000000000 +0000
+++ memcached-1.4.0/memcached.c	2009-07-24 18:48:44.000000000 +0000
@@ -193,6 +193,7 @@
     settings.reqs_per_event = 20;
     settings.backlog = 1024;
     settings.binding_protocol = negotiating_prot;
+    settings.flush_all_disabled = false;
 }
 
 /*
@@ -2731,6 +2732,12 @@
         process_stat(c, tokens, ntokens);
 
     } else if (ntokens >= 2 && ntokens <= 4 && (strcmp(tokens[COMMAND_TOKEN].value, "flush_all") == 0)) {
+
+        if(settings.flush_all_disabled == true) {
+            out_string(c, "SERVER_ERROR flush_all command disabled");
+            return;
+        }
+
         time_t exptime = 0;
         set_current_time();
 
@@ -3782,6 +3789,7 @@
     printf("-C            Disable use of CAS\n");
     printf("-b            Set the backlog queue limit (default: 1024)\n");
     printf("-B            Binding protocol - one of ascii, binary, or auto (default)\n");
+    printf("-F            Disable the flush_all command\n");
     return;
 }
 
@@ -3992,6 +4000,7 @@
           "C"   /* Disable use of CAS */
           "b:"  /* backlog queue limit */
           "B:"  /* Binding protocol */
+          "F"   /* Disable flush_all */
         ))) {
         switch (c) {
         case 'a':
@@ -4106,6 +4115,9 @@
                 exit(EX_USAGE);
             }
             break;
+        case 'F' :
+            settings.flush_all_disabled = true;
+            break;
         default:
             fprintf(stderr, "Illegal argument \"%c\"\n", c);
             return 1;
diff -u memcached-1.4.0.orig/memcached.h memcached-1.4.0/memcached.h
--- memcached-1.4.0.orig/memcached.h	2009-07-09 17:16:24.000000000 +0000
+++ memcached-1.4.0/memcached.h	2009-07-24 18:24:48.000000000 +0000
@@ -262,6 +262,7 @@
     bool use_cas;
     enum protocol binding_protocol;
     int backlog;
+    bool flush_all_disabled; /* true if we're ignoring flush_all cmds */
 };
 
 extern struct stats stats;
diff -u memcached-1.4.0.orig/memcached.spec memcached-1.4.0/memcached.spec
--- memcached-1.4.0.orig/memcached.spec	2009-06-21 06:24:18.000000000 +0000
+++ memcached-1.4.0/memcached.spec	2009-07-24 18:43:13.000000000 +0000
@@ -1,5 +1,5 @@
 Name:           memcached
-Version:        1.3.2
+Version:        1.4.0
 Release:        1%{?dist}
 Summary:        High Performance, Distributed Memory Object Cache
 
@@ -93,6 +93,10 @@
 
 
 %changelog
+* Wed Jul 24 2009 Adrian Otto <aotto@aotto.com> - 1.4.0-1
+- Updated for 1.4.0
+- Added /usr/include/memcached/protocol_binary.h to %files
+
 * Wed Jul  4 2007 Paul Lindner <lindner@inuus.com> - 1.2.2-5
 - Use /var/run/memcached/ directory to hold PID file
 
Common subdirectories: memcached-1.4.0.orig/scripts and memcached-1.4.0/scripts
Common subdirectories: memcached-1.4.0.orig/t and memcached-1.4.0/t
diff -u memcached-1.4.0.orig/testapp.c memcached-1.4.0/testapp.c
--- memcached-1.4.0.orig/testapp.c	2009-07-09 16:43:42.000000000 +0000
+++ memcached-1.4.0/testapp.c	2009-07-24 16:36:11.000000000 +0000
@@ -234,7 +234,7 @@
     char pidfile[80];
     char buffer[256];
     sprintf(pidfile, "/tmp/memcached.%d", getpid());
-    sprintf(buffer, "./memcached-debug -p 0 -P %s -d", pidfile);
+    sprintf(buffer, "./memcached-debug -p 0 -P %s -d -u nobody", pidfile);
     assert(system(buffer) == 0);
     sleep(1);
     FILE *fp = fopen(pidfile, "r");