]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/modify.c
Don't include portable.h. Headers can and should assume portable.h
[openldap] / servers / slapd / modify.c
index 75e2224a2c2404cf2893e01224857e71599094ff..235acc536b0aa90e72648be87495c12b742c6a60 100644 (file)
  * is provided ``as is'' without express or implied warranty.
  */
 
+#include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/socket.h>
+
+#include <ac/socket.h>
+#include <ac/string.h>
+#include <ac/time.h>
+
 #include "slap.h"
 
 extern Backend *select_backend();
@@ -27,6 +29,8 @@ extern int            global_lastmod;
 
 static void    modlist_free();
 static void    add_lastmods();
+extern char     *suffixAlias();
+
 
 void
 do_modify(
@@ -147,6 +151,9 @@ do_modify(
                return;
        }
 
+        /* alias suffix if approp */
+        dn = suffixAlias ( dn, op, be );
+
        /*
         * do the modify if 1 && (2 || 3)
         * 1) there is a modify function implemented in this backend;
@@ -200,7 +207,7 @@ modlist_free(
 static void
 add_lastmods( Operation *op, LDAPMod **mods )
 {
-       char            buf[20];
+       char            buf[22];
        struct berval   bv;
        struct berval   *bvals[2];
        LDAPMod         **m;
@@ -251,8 +258,13 @@ add_lastmods( Operation *op, LDAPMod **mods )
        *mods = tmp;
 
        pthread_mutex_lock( &currenttime_mutex );
-        ltm = localtime( &currenttime );
-        strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
+#ifndef LDAP_LOCALTIME
+       ltm = gmtime( &currenttime );
+       strftime( buf, sizeof(buf), "%Y%m%d%H%M%SZ", ltm );
+#else
+       ltm = localtime( &currenttime );
+       strftime( buf, sizeof(buf), "%y%m%d%H%M%SZ", ltm );
+#endif
        pthread_mutex_unlock( &currenttime_mutex );
        bv.bv_val = buf;
        bv.bv_len = strlen( bv.bv_val );