Saturday, April 11, 2009

How to modify client scheduled scan in Symantec Antivirus

I found that to modify client scheduled scan in Symantec Antivirus Corporate Edition (the client is not controlled by any server), one needs to edit the registry.The key to edit is HKEY_LOCAL_MACHINE\SOFTWARE\Intel\LanDesk\VirusProtect6\CurrentVersion\LocalScans\clientscheduledscan_?\schedule(? is a number).

I simply deleted the key HKEY_LOCAL_MACHINE\SOFTWARE\Intel\LanDesk\VirusProtect6\CurrentVersion\LocalScans\clientscheduledscan_1 to disable the client scheduled scan. And the result is shown below:

Friday, April 3, 2009

Use LDAP EXOP to change userpassword in PHP

It seems to me I couldn't do LDAP EXOP directly in PHP 5. However, the CPAN module Net::LDAP::Extension::SetPassword can do it and I can use Perl Code from PHP. I installed the Net::LDAP in CPAN and php-perl by urpmi. Then the following PHP code is what I have to change LDAP UserPassword by EXOP (connection is by ldapi):


$perl = new Perl();

try {
$perl->eval('
use Net::LDAP;
use Net::LDAP::Extension::SetPassword;
$errtxt="";

sub changepass {
my $server=shift @_;
my $dn=shift @_;
my $oldpass=shift @_;
my $newpass=shift @_;

$ENV{LDAPI_SOCK}="/var/run/ldap/ldapi";
$ldap = Net::LDAP->new( $server, onerror => "warn" );
$ldap->bind($dn , password => $oldpass);
$mesg = $ldap->set_password( oldpasswd => $oldpass, newpasswd => $newpass);
$errtxt=$mesg->error();
return $mesg->code();
}
');

$server='ldapi://';
$dn='uid=user,ou=People,dc=example,dc=com';
$oldpass='oldsecret';
$newpass='newsecret';

$errno=$perl->changepass($server,$dn,$oldpass,$newpass);
$error=$perl->errtxt;

}

catch (PerlException $exception) {
echo "Perl error: " . $exception->getMessage() . " ";
}

if ($errno) {
echo "Error $errno: $error";
}