fmII
Fri, Jul 04th home | browse | articles | contact | chat | submit | faq | newsletter | about | stats | scoop 21:00 UTC
in
Section
login «
register «
recover password «
[Project] add release | add branch | add screenshot | broken links | change owner | email subscribers | update project | update branch (urls) [Project]

 ldapdiff - Default branch
Section: Unix

 

Added: Fri, Jun 1st 2001 07:54 UTC (7 years, 1 month ago) Updated: Wed, Sep 26th 2007 15:41 UTC (9 months, 12 days ago)


About:
ldapdiff compares ldif files with a running LDAP server and does an appropriate add/delete/update for every different entry/attribute.

Author:
Thomas Reith <Thomas (dot) Reith (at) rhoen (dot) de> [contact developer]

Rating:
(not rated)

Homepage:
http://webtomware.rhoen.de/
Tar/GZ:
http://webtomware.rhoen.de/ldapdiff-1.3.0.tgz

Trove categories: [change]
[Environment]  Console (Text Based)
[Intended Audience]  System Administrators
[License]  OSI Approved :: GNU General Public License (GPL), OSI Approved :: GNU General Public License v3
[Operating System]  POSIX
[Programming Language]  C
[Topic]  System :: Systems Administration

Dependencies: [change]
libiconv (required)
OpenLDAP (recommended)
[download links]

 
Project admins: [change]
» Thomas Reith (Owner)

» Rating: (not rated)
» Vitality: 0.02% (Rank 3042)
» Popularity: 1.37% (Rank 4015)

project statsdownload stats
(click to enlarge graphs)
   Record hits: 9,978
   URL hits: 3,732
   Subscribers: 51

Other projects from the same categories:
rsyncrypto
rpm-analyzer
LDAPfs
FreeDup
tinyCMS

Users who subscribed to this project also subscribed to:
Less
Python IRC library
CuteFlow
Anyterm
FreeIPMI


Add comment · Rate this project · Subscribe to new releases · Ignore this project · Email this project to a friend · Project record in XML

 Branches

Branch Version Last release License URLs
Default 1.3.0 26-Sep-2007 GNU General Public License v3 Homepage Tar/GZ

 Comments

[»] Bug that prevents streaming operations
by Enzo Michelangeli - Mar 16th 2007 04:40:58

If the "-f" option is not given, ldapdiff reads the LDIF data from stdin. Unfortunately, in ldapread.c there is code calling ftell() and fseek(), which fails (without warnings) if stdin is not seekable (e.g., it's a pipe). I reported the bug to the author two weeks ago, but I haven't heard from him, so here is the code for the fix, which replaces ftell()/fseek() with the pipe-friendly getc()/ungetc():

 
[...]
#if 0 /* old code if'd out */
   filepos = ftell(f);
   while(fgets(folderline,sizeof(folderline),f) != NULL){
    /* strip \n */
    if((pstrip = strchr(folderline,'\n')) != NULL){
     *pstrip = '\0';
    }
    /* strip \r\n */
    if((pstrip = strstr(folderline,"\r\n")) != NULL){
     *pstrip = '\0';
    }
    if(folderline[0] == ' ' || folderline[0] == '\t'){
     clines++;
     if(strlen(line) + strlen(folderline+1) > MAXATTRLEN){
      ldiflog(LOG0,
       "attribute size to big file:%s line:%d",__FILE__,__LINE__);
      exit(EXITLDERROR);
     }
     pline = realloc(pline,strlen(pline)+1 + strlen(folderline));
     strcat(pline,folderline+1);
     filepos = ftell(f);
    }else{
     break;
    }
   }
   fseek(f,filepos,SEEK_SET);
#else    /* new code */
   for(;;) {
    char nextch = getc(f);
    ungetc(nextch, f);
    if(nextch != ' ' && nextch != '\t')
     break;
    if(fgets(folderline,sizeof(folderline),f) == NULL)
     break;
    if((pstrip = strchr(folderline,'\n')) != NULL){
     *pstrip = '\0';
    }
    /* strip \r\n */
    if((pstrip = strstr(folderline,"\r\n")) != NULL){
     *pstrip = '\0';
    }
    clines++;
    if(strlen(line) + strlen(folderline+1) > MAXATTRLEN){
     ldiflog(LOG0,
      "attribute size too big file:%s line:%d",__FILE__,__LINE__);
     exit(EXITLDERROR);
    }
    pline = realloc(pline,strlen(pline)+1 + strlen(folderline));
    strcat(pline,folderline+1);
   }
#endif
[...]

[reply] [top]


    [»] Re: Bug that prevents streaming operations
    by Thomas Reith - May 9th 2007 13:12:07

    Thanks Enzo,

    your patch has been applied to "ldapdiff-1.2.3" available at http://webtomware.rhoen.de.

    regards

    Thomas

    --
    -------------------------------------- http://webtomware.rhoen.de mailto:Thomas.Reith@rhoen.de

    [reply] [top]




© Copyright 2008 SourceForge, Inc., All Rights Reserved.
About freshmeat.net •  Privacy Statement •  Terms of Use •  Trademark Guidelines •  Advertise •  Contact Us • 
ThinkGeek •  Slashdot  •  ITMJ •  Linux.com •  NewsForge  •  SourceForge.net  •  Surveys •  Jobs •  PriceGrabber