Author Topic: ldapsearch no wrap ไม่จำกัดขนาด ไม่ตัดบันทัด  (Read 9564 times)

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
ldapsearch no wrap ไม่จำกัดขนาด ไม่ตัดบันทัด
« on: กุมภาพันธ์ 15, 2011, 06:29:01 PM »
##openldap no wrap บน Centos

ปัญหาคือ มี application 1 ตัว เวลาสั่ง ldapsearch แล้วมันตัดบันทัด

ตามที่หาอ่านดู command ของ ldapsearch ใน openldap ไม่สามารถทำได้

OpenLDAP does not define these:

    * LDIF_OPT_NOWRAP - implemented in SLAPI as an option around the OpenLDAP function - will "unwrap" the buffer formatted by OpenLDAP - other apps will need to do something similar

แก้ปัญหาโดยลง module ของ mozldap ไปซึ่งมีชุดคำสั่งใน การ nowrap คือ

parameter "-T"  don't fold (wrap) long lines (default is to fold)

ลงโดย

#yum -y install mozldap-tools
#updatedb

แล้ว test โดย
/usr/lib64/mozldap/ldapsearch -LLL -x -T -h "localhost" -D "cn=xxxx,o=xxx,dc=xx,dc=com" -w "xx" -b "o=xxx,dc=xx,dc=com" "(mail=golf@xxx.com)" vacationStart vacationEnd

ก็จะสามารถแก้ปัญหาได้ครับ อิอิ   ;)



Special Thank :
http://directory.fedoraproject.org/wiki/Use_OpenLDAP_Clients_In_389
http://www.ldapguru.com/

« Last Edit: กุมภาพันธ์ 15, 2011, 06:39:10 PM by golfreeze »

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
#yum -y install openldap-client_x86-64

จะทำให้มองเห็น

command "/usr/bin/ldapsearch"


golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ldapsearch no wrap ไม่จำกัดขนาด ไม่ตัดบันทัด
« Reply #2 on: กรกฎาคม 08, 2014, 10:50:58 AM »
ldapsearch ดูเพิ่มเติม  => http://docs.oracle.com/cd/E19450-01/820-6169/ldapsearch-examples.html


$ ldapsearch --hostname localhost --port 1389 --bindDN "cn=Directory Manager" --bindPassword password --baseDN dc=example,dc=com "(&(sn=jensen)(l=Cupertino))

$ ldapsearch --hostname localhost --port 1389 --bindDN "cn=Directory Manager" \
--bindPassword password --baseDN dc=example,dc=com --filename myfilter.txt

$ ldapsearch --hostname localhost --port 1389 -b "dc=example,dc=com" \
  --sizeLimit 5 "objectclass=*" 1.1

golfreeze

  • Administrator
  • Hero Member
  • *****
  • Posts: 2140
    • View Profile
    • นั่งสมาธิ สติปัฏฐานสี่ พาเที่ยววัด แนะนำวัด แจกcd ธรรมะฟรี
    • Email
Re: ldapsearch no wrap ไม่จำกัดขนาด ไม่ตัดบันทัด
« Reply #3 on: กุมภาพันธ์ 11, 2021, 03:22:51 PM »
ถ้าในกรณีใช้งานเป็น ldapsearch บน openldap 2.4.4 แล้วจะให้ search ออกมาเกิน limit ที่ตั้งไว้ 
เราสามารถใช้ "-E pr=1000/noprompt -x" ไปด้วยครับดังนี้

ldapsearch -E pr=1000/noprompt -x

 8)