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)
Directory Graveyard
LDAP Tools
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
| Reporter | ||
Updated•24 years ago
|
Priority: -- → P2
| Assignee | ||
Comment 2•24 years ago
|
||
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
| Assignee | ||
Comment 3•24 years ago
|
||
Oops. ldaptool_open_file() code was commented out in the previous diff. Here's
the new diff.
| Reporter | ||
Comment 4•24 years ago
|
||
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+
| Assignee | ||
Comment 5•24 years ago
|
||
| Reporter | ||
Updated•24 years ago
|
Attachment #86641 -
Attachment is obsolete: true
| Reporter | ||
Updated•24 years ago
|
Attachment #86642 -
Attachment is patch: true
| Reporter | ||
Updated•24 years ago
|
Attachment #86642 -
Attachment is obsolete: true
Attachment #86642 -
Attachment is patch: false
| Reporter | ||
Comment 6•24 years ago
|
||
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+
| Assignee | ||
Comment 7•24 years ago
|
||
Removed the Makefile.client change under libldap directory and added portable.h
in test.c and compiled it successfully.
| Reporter | ||
Updated•24 years ago
|
Attachment #86664 -
Attachment is obsolete: true
| Reporter | ||
Comment 8•24 years ago
|
||
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+
| Assignee | ||
Comment 9•24 years ago
|
||
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
You need to log in
before you can comment on or make changes to this bug.
Description
•