Bugzilla – Attachment 363017 Details for
Bug 606584
sigsegv in libcom_err
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
perl script
co.pm (text/plain), 1.58 KB, created by
michel munnix
on 2010-05-18 18:13:05 UTC
(
hide
)
Description:
perl script
Filename:
MIME Type:
Creator:
michel munnix
Created:
2010-05-18 18:13:05 UTC
Size:
1.58 KB
patch
obsolete
>#!/usr/bin/perl -w >use strict; > >package fileserver; > >my $error = ""; > >my $ldap = ""; >my $sasl = ""; >my $sasl_conn = ""; >my $ad_domain = "CROIX-ROUGE.PRV"; >my $ad_name = "CROIX-ROUGE"; >my $ad_user = 'scriptFS'; >my $ad_pass = ""; >my $ad_server = 'dc02.croix-rouge.prv'; > >use Net::hostent; >use Socket; >use Net::LDAP; >use Authen::SASL; >use Authen::SASL::XS; >use Authen::SASL::Cyrus; > >#============================================================================ > >sub access_ad { > >my $h; >unless ($h = gethost($ad_domain)) { $error="no such host: $ad_domain\n"; return 0; } >print inet_ntoa($h->addr) . "\n"; > >use Authen::Krb5::Easy qw(kinit kdestroy kerror); > >my $keytab = '/tmp/filer.keytab'; >my $ccache = '/tmp/krb5cc_1000'; >$ENV{KRB5CCNAME} = $ccache; > >kinit($keytab, $ad_user."@".$ad_domain) || die kerror(); > >my $mesg; >unless ($ldap = Net::LDAP->new($ad_server, scheme => 'ldap', version => 3, > onerror => 'warn')) { $error="could not connect LDAP: $ad_server\n"; return 0; } > #onerror => 'warn', debug => 3)) { $error="could not connect LDAP: $ad_server\n"; return 0; } > >$mesg = $ldap->bind (); >if ($mesg->is_error()) { $error = $mesg->error; return 0; } > >$sasl = Authen::SASL->new( > mechanism => 'GSSAPI', > debug => 15, >); > >$sasl_conn = $sasl->client_new("ldap",$ad_server); > >if ($sasl_conn->code != 0) { $error = "Negotiation failed"; return 0; } > >$mesg = $ldap->bind ('cn=Backup,dc=croix-rouge,dc=prv', sasl => $sasl_conn); >if ($mesg->is_error()) { $error = $mesg->error; return 0; } > >return 1; > >} > ># main > >print "access ad\n"; >unless (access_ad) { print $error . "\n"; } >exit;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
Attachments on
bug 606584
:
363016
| 363017