#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    6
    Rep Power
    0

    can't add to ldap, when run slapd returns an error


    HI ,
    i cant resolve some problems,i work with openldap-2.1.29 , mandrake 9.2, i really need your help.
    These are my slap.con ,ldif files an error messages that appears when runnig slapd,and when typng the search an add commands

    slapd.conf:
    include /usr/local/etc/openldap/schema/core.schema
    include /usr/local/etc/openldap/schema/cosine.schema
    pidfile /var/run/slapd.pid
    argsfile /var/run/slapd.args
    ####################################################################
    # ldbm database definitions
    #######################################################################
    database bdb
    suffix "dc=example,dc=com"
    rootdn "cn=root,dc=example,dc=com"
    rootpw secret
    directory /usr/local/var/openldap-data
    # Indices to maintain
    index objectClass eq

    file ex.ldif:
    dn: dc=example,dc=com
    objectclass: dcObject
    objectclass: organization
    o: example
    dc: example.com

    dn: ou=app,dc=example,dc=com
    objectclass: organizationalUnit
    ou: app

    dn: cn=barbara jensen,ou=app,dc=example,dc=com
    objectclass: top
    objectclass: person
    objectclass: organizationalPerson
    cn: barbara jensen
    sn: jensen
    title: madame
    description: employee du departement app

    ldapsearch:
    [root@localhost rc.d]# ldapsearch -x -b "dc=example,dc=com" "(objectclass=*)"
    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope sub
    # filter: (objectclass=*)
    # requesting: ALL
    #

    # search result
    search: 2
    result: 32 No such object

    # numResponses: 1

    SERVER:
    [root@localhost root]# /usr/local/libexec/slapd -d 256
    daemon: socket() failed errno=97 (Address family not supported by protocol)
    bdb_initialize: Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002)
    bdb_db_init: Initializing BDB database
    slapd starting

    AFTER TYPING LDAPSEARCH:
    conn=0 fd=12 ACCEPT from IP=127.0.0.1:1190 (IP=0.0.0.0:389)
    conn=0 op=0 BIND dn="" method=128
    conn=0 op=0 RESULT tag=97 err=0 text=
    conn=0 op=1 SRCH base="dc=example,dc=com" scope=2 filter="(objectClass=*)"
    conn=0 op=1 RESULT tag=101 err=32 text=
    conn=0 op=2 UNBIND
    conn=0 fd=12 closed

    LDAPADD:
    [root@localhost rc.d]# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f ex.ldif
    Enter LDAP Password:
    adding new entry "dc=example,dc=com"
    ldapadd: update failed: dc=example,dc=com
    ldap_add: Naming violation (64)
    additional info: value of naming attribute 'dc' is not present in entry

    SERVER AFTER TYPING LDAPADD:
    conn=1 fd=12 ACCEPT from IP=127.0.0.1:1191 (IP=0.0.0.0:389)
    conn=1 op=0 BIND dn="cn=root,dc=example,dc=com" method=128
    conn=1 op=0 BIND dn="cn=root,dc=example,dc=com" mech=SIMPLE ssf=0
    conn=1 op=0 RESULT tag=97 err=0 text=
    conn=1 op=1 ADD dn="dc=example,dc=com"
    conn=1 op=1 RESULT tag=105 err=64 text=value of naming attribute 'dc' is not present in entry
    conn=1 op=1 RESULT tag=105 err=64 text=value of naming attribute 'dc' is not present in entry
    conn=1 op=2 UNBIND
    conn=1 fd=12 closed

    i'm waiting for your help!
  2. #2
  3. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    First please please post a valid subject otherwise we have no idea of what the post is about.

    Originally Posted by abir
    SERVER:
    [root@localhost root]# /usr/local/libexec/slapd -d 256
    daemon: socket() failed errno=97 (Address family not supported by protocol)
    try /usr/local/libexec/slapd -d 255 (255 instead of 256)

    Originally Posted by abir
    ldapsearch:
    [root@localhost rc.d]# ldapsearch -x -b "dc=example,dc=com" "(objectclass=*)"
    # extended LDIF
    #
    # LDAPv3
    # base <dc=example,dc=com> with scope sub
    # filter: (objectclass=*)
    # requesting: ALL
    #

    # search result
    search: 2
    result: 32 No such object

    # numResponses: 1
    It appears your dn isn't correct
    change from -b "dc=example,dc=com" to
    -b "dc=example.com,dc=com"

    Originally Posted by abir
    LDAPADD:
    [root@localhost rc.d]# ldapadd -x -D "cn=root,dc=example,dc=com" -W -f ex.ldif
    Enter LDAP Password:
    adding new entry "dc=example,dc=com"
    ldapadd: update failed: dc=example,dc=com
    ldap_add: Naming violation (64)
    additional info: value of naming attribute 'dc' is not present in entry
    again your auth dn wouldn't exist (unless it already does)
    -D "cn=root,dc=example,dc=com"
    try chaning to -D "cn=root,dc=com" (or whatever is the correct one)

    This may not be the case and it could be something different but I tried your ldiff file and it worked fine for me no naming violation
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    6
    Rep Power
    0

    code php_ldap problem


    Hi all,
    i can't execute any php script,if anyone can help me i'll be greetful,these are he script and results i got:
    Script PHP:
    <?
    // Fichier de configuration pour l'interface PHP
    // de notre annuaire LDAP
    $server = "localhost";
    $port = "389";
    $racine = "dc=telecom, dc=tn";
    $rootdn = "cn=root,dc=telecom, dc=tn";
    $rootpw = "secret";
    echo "Connexion...<br>";

    $ds=ldap_connect($server);
    if ($ds==1)
    { // on s'authentifie en tant que super-utilisateur, ici, ldap_admin
    $r=ldap_bind($ds,$rootdn,$rootpw);
    // Ici les opérations à effectuer
    echo "Déconnexion...<br>";
    ldap_close($ds);
    }
    else {
    echo "Impossible de se connecter au serveur LDAP";
    }
    ?>

    [root@localhost root]# php /usr/local/connect.php -a
    Content-type: text/html
    X-Powered-By: PHP/4.3.5
    Connexion...<br><br />
    <b>Warning</b>: ldap_bind(): Unable to bind to server: Protocol error in <b>/usr/local/connect.php</b> on line <b>31</b><br />
    Déconnexion...<br>

    server:

    [root@localhost root]# /usr/local/libexec/slapd -f /etc/openldap/slapd.conf -d 256
    daemon: socket() failed errno=97 (Address family not supported by protocol)
    bdb_initialize: Sleepycat Software: Berkeley DB 4.1.25: (December 19, 2002)
    bdb_db_init: Initializing BDB database
    slapd starting
    conn=0 fd=12 ACCEPT from IP=127.0.0.1:1040 (IP=0.0.0.0:389)
    conn=0 op=0 BIND dn="cn=root,dc=telecom,dc=tn" method=128
    conn=0 op=0 RESULT tag=97 err=2 text=requested protocol version not allowed
    conn=0 op=1 UNBIND
    conn=0 fd=12 closed

    is the problem with socket ,(error when starting ldap) and how can i deal with
    i'm waiting for yor help(php4.3.5)
  6. #4
  7. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    try this /usr/local/libexec/slapd -d 255 I said this in my previous post try it first then let me know if it doesn't work

    as far as php if you can connect to your ldap with another program (like ldapsearch or ldapadmin) then php can connect otherwise it's an ldap problem
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    6
    Rep Power
    0
    i changed my ldif file and (ldapsearch,ldapadd..)work.only the php scripts does'nt work is it a dns problem? have to configure the dns or what? thx
  10. #6
  11. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    try this out and post what it says
    Code:
    <?php
    $host = 'localhost';
    $port = 389;
    
    $link = ldap_connect($host, $port);
    
    ldap_bind($link);
    if (ldap_error($link) == "Can't contact LDAP server") {
    	print "Could not connect to LDAP server '".$host."' on port '".$port."'");
    }
    if (ldap_bind($link, $userdn, $password) === false) {
    	print "ldap error: ".ldap_error($link)."<br>";
    }
    ?>
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Posts
    6
    Rep Power
    0

    programme php


    I Try this code:
    <br />
    <b>Warning</b>: ldap_bind(): Unable to bind to server: Can't contact LDAP server in <b>/root/dev.php</b> on line <b>7</b><br />
    Could not connect to LDAP server 'localhoast' on port '389'<br />
    <b>Warning</b>: ldap_bind(): Unable to bind to server: Can't contact LDAP server in <b>/root/dev.php</b> on line <b>11</b><br />
    ldap error: Can't contact LDAP server<br>
  14. #8
  15. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2010
    Location
    Cambodia
    Posts
    2
    Rep Power
    0

    What is the best video converter to use?


    Windows Movie Maker doesn't let me put videos from my digi cam because it's in the wrong format so what converter can I use?I want one that's pretty decent quality, doesn't cost anything, doesn't stick the logo on my videos and it converts all of the video, not just half of it.I used to have prism something but then my trial run ran out so yeah, I can't use that >.<And zamzar has a limit of 100MB :lHelp please?

IMN logo majestic logo threadwatch logo seochat tools logo