]> git.sur5r.net Git - openldap/commitdiff
Try to discourage editing back-ldif files
authorHoward Chu <hyc@openldap.org>
Fri, 10 Jun 2011 00:59:08 +0000 (17:59 -0700)
committerHoward Chu <hyc@openldap.org>
Fri, 10 Jun 2011 00:59:08 +0000 (17:59 -0700)
servers/slapd/back-ldif/ldif.c

index 8c731105e1e92338e4c1d70acd24c9705bdd727c..3af0580a1a060d451072be66a71181e72e5952dd 100644 (file)
@@ -395,8 +395,10 @@ ldif_read_file( const char *path, char **datap )
 static int
 spew_file( int fd, const char *spew, int len, int *save_errno )
 {
-       int writeres = 0;
+       int writeres;
+#define HEADER "# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.\n"
 
+       writeres = write(fd, HEADER, sizeof(HEADER));
        while(len > 0) {
                writeres = write(fd, spew, len);
                if(writeres == -1) {