modifyTimestamp on samba-3.0.3

Jianliang Lu j.lu at tiesse.com
Fri May 7 06:53:58 GMT 2004


Jim McDonough wrote:
> >We cannot remove the \"modifyTimestamop\" from atrrib_map_v30[], because
> this
> I haven't yet verified that this is the source of your problems, but the
> patch you included breaks all systems where you don't have "ldap delete dn
> = yes", because we will try to delete all the attributes rather than the
> entire dn, and you can _never_ delete an operation attribute.
> 
> This patch as submitted must not be included until the code is modified to
> handle not deleting certain attributes.
> 

Now in ldapsam_delete_entry, which I think that the only function that does 
the delete entry, I don't delete the operational attribute "modifyTimestamp".

cheers,
Jianliang

-> NEW-FIX:

--- passdb/pdb_ldap.c   Wed May  5 16:07:04 2004
+++ passdb/pdb_ldap.c.fix   Fri May  7 08:17:12 2004
@@ -81,7 +81,6 @@
#define SAM_ACCOUNT struct sam_passwd
#endif

-#define MODIFY_TIMESTAMP_STRING "modifyTimestamp"

#include "smbldap.h"

@@ -301,7 +300,8 @@
          really exist. */

       for (attrib = attrs; *attrib != NULL; attrib++) {
-           if (StrCaseCmp(*attrib, name) == 0) {
+           if ((StrCaseCmp(*attrib, name) == 0) &&
+           !(StrCaseCmp(*attrib, get_userattr_key2string(ldap_state-
>schema_ver
, LDAP_ATTR_MOD_TIMESTAMP)))) {
               DEBUG(10, ("ldapsam_delete_entry: deleting attribute %s\n", 
name
));
               smbldap_set_mod(&mods, LDAP_MOD_DELETE, name, NULL);
           }
@@ -400,8 +400,11 @@
   pstring temp;
   struct tm tm;

-   if (!smbldap_get_single_pstring(ldap_state->smbldap_state->ldap_struct,
-                   entry, MODIFY_TIMESTAMP_STRING, temp))
+   if (!smbldap_get_single_pstring(
+               ldap_state->smbldap_state->ldap_struct, entry,
+               get_userattr_key2string(ldap_state->schema_ver,
+                LDAP_ATTR_MOD_TIMESTAMP),
+                temp))
       return (time_t) 0;

   strptime(temp, "%Y%m%d%H%M%SZ", &tm);
--- include/smbldap.h   Thu May  6 08:37:25 2004
+++ include/smbldap.h.fix   Thu May  6 08:38:21 2004
@@ -94,8 +94,8 @@
#define LDAP_ATTR_MUNGED_DIAL      37
#define LDAP_ATTR_BAD_PASSWORD_TIME    38
-
#define LDAP_ATTR_SID_LIST              40
+#define LDAP_ATTR_MOD_TIMESTAMP     41

typedef struct _attrib_map_entry {
   int     attrib;
--- lib/smbldap.c   Wed May  5 18:06:15 2004
+++ lib/smbldap.c.fix   Thu May  6 08:44:09 2004
@@ -101,6 +101,7 @@
   { LDAP_ATTR_BAD_PASSWORD_COUNT, "sambaBadPasswordCount" },
   { LDAP_ATTR_BAD_PASSWORD_TIME,  "sambaBadPasswordTime"  },
+   { LDAP_ATTR_MOD_TIMESTAMP,  "modifyTimestamp"   },
   { LDAP_ATTR_LIST_END,       NULL            }
};


Jianliang Lu
TieSse s.p.a.     Ivrea (To) - Italy
j.lu at tiesse.com   luj at libero.it
http://www.tiesse.com


More information about the samba-technical mailing list