Merge sshkeys check with the alioth userdir-ldap-common
authorJoerg Jaspert <joerg@ganneff.de>
Wed, 14 May 2008 14:56:04 +0000 (16:56 +0200)
committerJoerg Jaspert <joerg@ganneff.de>
Wed, 14 May 2008 14:56:04 +0000 (16:56 +0200)
TODO
ud-generate
ud-info
ud-mailgate
userdir-ldap.schema

diff --git a/TODO b/TODO
index 0ddb9b6..2e26cfd 100644 (file)
--- a/TODO
+++ b/TODO
@@ -12,3 +12,5 @@
 - get rid of openssh patch requirement
 - use --delete in ud-replicate's rsync?
 - fix ud-useradd emails with non-ascii in subject
+- allow to keep further auth tokens in the LDAP, for example for SMTP AUTH or
+  SIP stuff. Or OpenID. Or whatever.
index b5594fe..d2f00ab 100755 (executable)
@@ -718,12 +718,23 @@ def GenSSHKnown(l,File):
          x[1].has_key("sshRSAHostKey") == 0:
          continue;
       Host = GetAttr(x,"hostname");
+      HostNames = [ Host ]
       SHost = Host.find(".")
+      if SHost != None: HostNames += [Host[0:SHost]]
+
+      IPAdressesT = None
+      IPAdresses = []
+      # get IP adresses back as "proto adress" to distinguish between v4 and v6
+      try:
+         IPAdressesT = set([ (a[0],a[4][0]) for a in socket.getaddrinfo(Host, None)])
+      except:
+         if code[0] != -2: raise
+      for addr in IPAdressesT:
+         if addr[0] == socket.AF_INET: IPAdresses += [addr[1], "::ffff:"+addr[1]]
+        else: IPAdresses += [addr[1]]
+
       for I in x[1]["sshRSAHostKey"]:
-         if SHost == None:
-            Line = "%s,%s %s" %(Host,socket.gethostbyname(Host),I);
-         else:
-            Line = "%s,%s,%s %s" %(Host,Host[0:SHost],socket.gethostbyname(Host),I);
+         Line = "%s,%s %s" %(",".join(HostNames + IPAdresses), I);
          Line = Sanitize(Line) + "\n";
          F.write(Line);
   # Oops, something unspeakable happened.
diff --git a/ud-info b/ud-info
index 8fde99a..e533a9e 100755 (executable)
--- a/ud-info
+++ b/ud-info
@@ -55,7 +55,8 @@ AttrInfo = {"cn": ["First Name", 101],
             "mailWhitelist": ["Mail Whitelist",24],
            "comment": ["Comment",116],
            "userPassword": ["Crypted Password",117],
-            "dnsZoneEntry": ["d.net Entry",118]};
+            "dnsZoneEntry": ["d.net Entry",118],
+            "VoIP": ["VoIP Address",119]}; 
 
 AttrPrompt = {"cn": ["Common name or first name"],
               "mn": ["Middle name (or initial if it ends in a dot)"],
@@ -89,7 +90,8 @@ AttrPrompt = {"cn": ["Common name or first name"],
              "dnsZoneEntry": ["DNS Zone fragment associated this this user"],
               "labeledURI": ["Web home page"],
               "jabberJID": ["Jabber ID"],
-              "icqUin": ["ICQ UIN Number"]};
+              "icqUin": ["ICQ UIN Number"],
+              "VoIP": ["VoIP Address"]};
 
 # Create a map of IDs to desc,value,attr
 OrderedIndex = {};
index 48a38a1..51942f1 100755 (executable)
@@ -48,6 +48,7 @@ ArbChanges = {"c": "..",
               "mailDisableMessage": ".*",
              "mailGreylisting": "^(TRUE|FALSE)$",
              "mailCallout": "^(TRUE|FALSE)$",
+             "VoIP": ".*",
 };
 
 DelItems = {"c": None,
@@ -75,6 +76,7 @@ DelItems = {"c": None,
             "mailRHSBL": None,
             "mailWhitelist": None,
             "mailDisableMessage": None,
+            "VoIP": None,
             };
 
 # Decode a GPS location from some common forms
index d089f0b..d31d0e7 100644 (file)
@@ -3,6 +3,7 @@
 # XXX
 #   - [PP] Now version controlled in db.d.o bzr repository - 2007-12-25
 #   - [HE] Add 'purpose', 'physicalHost' to debianServer - 2007-12-25
+#   - [zobel] Add 'VoIP' - 2008-05-10
 #
 # 0.7 [RM]
 #   - Add 'gender' and 'birthDate' to debianDeveloper
@@ -96,6 +97,7 @@
 #   .32 - mailDisableMessage
 #   .33 - purpose
 #   .34 - physicalHost
+#   .35 - VoIP
 #
 # .3 - experimental LDAP objectClasses
 #   .1 - debianDeveloper
@@ -350,6 +352,13 @@ attributetype ( 1.3.6.1.4.1.9586.100.4.2.34
        SINGLE-VALUE
        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
 
+attributetype ( 1.3.6.1.4.1.9586.100.4.2.35
+       NAME 'VoIP'
+       DESC 'VoIP URL to communicate with that person'
+       EQUALITY caseIgnoreIA5Match
+       SUBSTR caseIgnoreIA5SubstringsMatch
+       SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+
 # Public object classes
 
 objectclass ( 1.3.6.1.4.1.9586.100.4.1.1