--start-id not respected when --zone is passed and named.conf not used in zone2sql #332

Closed
Habbie opened this Issue Apr 26, 2013 · 4 comments

Projects

None yet

1 participant

@Habbie
Member
Habbie commented Apr 26, 2013

The sample command:

zone2sql --start-id=10 --zone=/var/cache/bind/test.ps.db

does not respect the --start-id option, and sets it to 0 !! this is not documented either, also their is a minor spelling mistake in the man page ( Use as the forst domain_id generated (defaults to 0).) , i assume its "first".

running pdns-server 2.9.21.2-1 on debian 5.0.4

relevant really old posts on the mailing list:

http://mailman.powerdns.com/pipermail/pdns-users/2006-June/003545.html

@Habbie Habbie was assigned Apr 26, 2013
@Habbie Habbie closed this Apr 26, 2013
@Habbie
Member
Habbie commented Apr 26, 2013

Author: anon
after looking at the src code, in the function "callback", lastsoa_domain_id is static and initialized by -1 ! this is fine as long as the the first zone id passed is stored in dirty_hack_num and static value of lastsoa_domain_id is incremented accordingly, thus the correct value is used. but what happens when there is no previous zones/domains? which is the case of passing --zone on command line? the desired value is the start-id (which we default to zero), the code sets it to -1 to act as if this is a new zone in a series of zones (from the callback function perspective) it increments and starts at -1 ++, i belive here is the problem ! the value of lastsoa_domain_id initialisation should be start-id minus one , and outputting first soa should be triggered by doing so too (setting dirty_hack_num to start-id minus one) ... im not sure this is the exact meaning of code ... hope it helps!

@Habbie
Member
Habbie commented Apr 26, 2013

Author: anon
A reference to a possible solution:

http://mailman.powerdns.com/pipermail/pdns-dev/2009-March/000798.html

@Habbie
Member
Habbie commented Apr 26, 2013

Author: peter
--start-id has been obsoleted by autoincrement behaviour in all supported databases. I will remove start-id from zone2sql shortly.

@Habbie
Member
Habbie commented Apr 26, 2013

Author: ahu
The --start-id feature is no longer supported in 3.0, so it should have been removed. It might come back later. Removed in 2387.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment