Closed Bug 143300 Opened 24 years ago Closed 24 years ago

LDAP command line tools won't open large files

Categories

(Directory Graveyard :: LDAP Tools, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcs, Assigned: janidarshan)

Details

Attachments

(1 file, 3 obsolete files)

The LDAP command line tools do not support large files (-f option). For example: % ls -al /export/large.ldif -rw-r--r-- 1 mcs staff 4811269261 May 5 14:28 /export/large.ldif % ldapmodify -a -c -D "cn=directory manager" -w secret12 -f /export/large.ldif /export/large.ldif: File too large The code in common.c just uses fopen() but it needs to arrange to use fopen64() on the platforms that support large files (most platforms do now). Or maybe we should switch to NSPR APIs. Workaround: redirect from standard input, e.g., ldapmodify -a -c -D "cn=directory manager" -w secret12 < /export/large.ldif
Priority: -- → P2
Darshan is working on this one. -> djani
Assignee: mcs → djani
o Added a function ldaptool_open_file() in common.c which uses fopen()/fopen64() according to _LARGEFILE64_SOURCE definition. o Added the definition of _LARGEFILE64_SOURCE in corrosponding makefiles o changed all the occurances of fopen() to ldaptool_open_file() Please review. Thanks, - Darshan
Attached file corrected erros (obsolete) —
Oops. ldaptool_open_file() code was commented out in the previous diff. Here's the new diff.
Comment on attachment 86641 [details] added a function ldaptool_open_file in common.c and the _LARGEFILE64_SOURCE in makefiles. You can't call ldaptool_ functions from libldap. Maybe use a macro in ldap/include/portable.h instead, e.g., #ifdef _LARGEFILE64_SOURCE #define NSLDAPI_FOPEN( filename, mode ) fopen64( filename, mode ) #else #define NSLDAPI_FOPEN( filename, mode ) fopen( filename, mode ) #endif Also, the parameter names for ldaptool_open_file() are strange (optarg and oflag?)
Attachment #86641 - Flags: needs-work+
Attached file incorporated Mark's suggestions (obsolete) —
Attachment #86641 - Attachment is obsolete: true
Attachment #86642 - Attachment is patch: true
Attachment #86642 - Attachment is obsolete: true
Attachment #86642 - Attachment is patch: false
Comment on attachment 86664 [details] incorporated Mark's suggestions Why the change to libldap/Makefile.client? That does not seem related to this bug. Also, make sure test.c compiles -- I don't see where it includes portable.h. You can do: gmake -f Makefile.client HAVE_CCONF=1 ltest to build ltest (which needs test.c)
Attachment #86664 - Flags: needs-work+
Removed the Makefile.client change under libldap directory and added portable.h in test.c and compiled it successfully.
Attachment #86664 - Attachment is obsolete: true
Comment on attachment 86717 [details] latest changes incorporated r=mcs (looks good to me). You have check in privileges now, right? Please commit to the trunk.
Attachment #86717 - Flags: review+
Fix committed to the trunk. Thanks Mark for the review. Checking in config/AIX.mk; /cvsroot/mozilla/directory/c-sdk/config/AIX.mk,v <-- AIX.mk new revision: 5.1; previous revision: 5.0 done Checking in config/Linux.mk; /cvsroot/mozilla/directory/c-sdk/config/Linux.mk,v <-- Linux.mk new revision: 5.1; previous revision: 5.0 done Checking in config/SunOS5.mk; /cvsroot/mozilla/directory/c-sdk/config/SunOS5.mk,v <-- SunOS5.mk new revision: 5.2; previous revision: 5.1 done Checking in ldap/clients/tools/common.c; /cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/common.c,v <-- common.c new revision: 5.3; previous revision: 5.2 done Checking in ldap/clients/tools/fileurl.c; /cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/fileurl.c,v <-- fileurl.c new revision: 5.1; previous revision: 5.0 done Checking in ldap/clients/tools/ldapcmp.c; /cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/ldapcmp.c,v <-- ldapcmp.c new revision: 5.2; previous revision: 5.1 done Checking in ldap/clients/tools/ldapmodify.c; /cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/ldapmodify.c,v <-- ldapmodify.c new revision: 5.1; previous revision: 5.0 done Checking in ldap/clients/tools/ldapsearch.c; /cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/ldapsearch.c,v <-- ldapsearch.c new revision: 5.3; previous revision: 5.2 done Checking in ldap/clients/tools/ldaptool.h; /cvsroot/mozilla/directory/c-sdk/ldap/clients/tools/ldaptool.h,v <-- ldaptool.h new revision: 5.4; previous revision: 5.3 done Checking in ldap/include/portable.h; /cvsroot/mozilla/directory/c-sdk/ldap/include/portable.h,v <-- portable.h new revision: 5.5; previous revision: 5.4 done Checking in ldap/libraries/libldap/disptmpl.c; /cvsroot/mozilla/directory/c-sdk/ldap/libraries/libldap/disptmpl.c,v <-- disptmpl.c new revision: 5.1; previous revision: 5.0 done Checking in ldap/libraries/libldap/friendly.c; /cvsroot/mozilla/directory/c-sdk/ldap/libraries/libldap/friendly.c,v <-- friendly.c new revision: 5.1; previous revision: 5.0 done Checking in ldap/libraries/libldap/getfilter.c; /cvsroot/mozilla/directory/c-sdk/ldap/libraries/libldap/getfilter.c,v <-- getfilter.c new revision: 5.1; previous revision: 5.0 done Checking in ldap/libraries/libldap/srchpref.c; /cvsroot/mozilla/directory/c-sdk/ldap/libraries/libldap/srchpref.c,v <-- srchpref.c new revision: 5.1; previous revision: 5.0 done Checking in ldap/libraries/libldap/test.c; /cvsroot/mozilla/directory/c-sdk/ldap/libraries/libldap/test.c,v <-- test.c new revision: 5.1; previous revision: 5.0 done
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Spam for bug 129472
QA Contact: nobody → nobody
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: