PDA

View Full Version : permission error with mydnsimport


thewebbie
6th February 2007, 07:38
When I import a zone using the following command

mydnsimport --axfr=1.2.3.4 -r domaname.net

I get the following when trying to view the record.
Error:
You don't have the permission to view this record or this record does not exist!

I have dropped the database and reinstalled everything with the same result. Any ideas?

thewebbie
7th February 2007, 04:38
ok.. I have figured out that I need to manually edit the tables to get the zones viewable. My next question is.

1. How can I automate this while importing 10,000 domains?
2. How can I set permissions when the zone is added by a regular user?
example.. bob is a reseller and has his own login to add domains. I only want bob and the admin user to view his zones.

falko
7th February 2007, 19:17
1. How can I automate this while importing 10,000 domains?
You could write a script (e.g. in PHP) for it.

thewebbie
8th February 2007, 06:04
You could write a script (e.g. in PHP) for it.


If anyone interested. (note.. I am not a programmer nor do I play one on TV) It pulls all the zones and adjusts the data so the zones work after import.

<?php
$dbhost = 'localhost';
$dbuser = '*******';
$dbpass = '*******';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'mydns';
mysql_select_db($dbname);

$query = "SELECT origin FROM soa";

$result = mysql_query($query) or die('Error, query failed');

while($row = mysql_fetch_array($result, MYSQL_NUM))
{
$soa = $row[0];
print "Done with $soa \n";

mysql_query("UPDATE soa SET sys_perm_user='riud',sys_perm_group='riud',sys_use rid='1',sys_groupid='1' WHERE origin='$soa'") or die(mysql_error());

}

mysql_close($conn);
?>


This one fixes the rr records

<?php
$dbhost = 'localhost';
$dbuser = '*******';
$dbpass = '*******';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'mydns';
mysql_select_db($dbname);

$query = "SELECT id FROM rr";

$result = mysql_query($query) or die('Error, query failed');

while($row = mysql_fetch_array($result, MYSQL_NUM))
{
$rr = $row[0];
print "Record ID $rr \n";
mysql_query("UPDATE rr SET sys_perm_user='riud',sys_perm_group='riud',sys_use rid='1',sys_groupid='1' WHERE id='$rr'") or die(mysql_error());

}

mysql_close($conn);
?>