get_access_permission: returning 1 at /usr/lib/perl5/site_perl/5.8.5/NicToolServer.pm line 772.

Started by shaun, April 07, 2005, 02:06:42 AM

Previous topic - Next topic

shaun

Nobody really seams to be alive on this forum but i'll give it a shot anyway....

Anybody know why i'm seeing this error in my apache error logs.  The errors appear when my export script that uses the API runs.


==> /var/log/httpd/error_log <==
get_access_permission:  returning 1 at /usr/lib/perl5/site_perl/5.8.5/NicToolServer.pm line 772.
get_access_permission:  returning 1 at /usr/lib/perl5/site_perl/5.8.5/NicToolServer.pm line 772.
get_access_permission:  returning 1 at /usr/lib/perl5/site_perl/5.8.5/NicToolServer.pm line 772.
get_access_permission:  returning 1 at /usr/lib/perl5/site_perl/5.8.5/NicToolServer.pm line 772.



Looks like this part of my code is causing the problem...

              $cz = $nt->send_request(
                       action => 'edit_zone',
                       nt_user_session => $nt_user->{'nt_user_session'},
                       nt_zone_id => $nt_group_zones->{'zones'}->[0]->{'nt_zone_id'},
                       nt_group_id => $nt_user->{'nt_group_id'},,
                       zone => $zone,
                       ttl => $zone_soa->{'ttl'},
                       nameservers => $nt_user->{'nameserver_list'},
                       mailaddr => $zone_soa->{'email'},
                       refresh => $zone_soa->{'refresh'},
                       retry => $zone_soa->{'retry'},
                       expire => $zone_soa->{'expire'},
                       minimum => $zone_soa->{'minimumTTL'},
                       );


A print Dumper($cz) returns....
$VAR1 = {
         'error_msg' => 'OK',
         'error_code' => '200'
       };


anybody know whats going on?

also, i had to use a if-then-else for this section of my script.  According to the API i can use newzone to modify a zone also but everytime i tryed to do that i got a error saying the zone existed and i was providing the nt_zone_id.  I now have to use a if-then-else to either create the zone if it doesnt exist or edit it if it does... any idea where i'm going wrong with that also...

shaun

oh ya, also, the user the script is using has full permissions on everything for his subgroup.  The nameservers are not in his subgroup but a 2 levels up the tree.

matt

Nobody has responsed to you because you haven't posed a question that can be answered. There are a few guys that read this regularly (myself included) that are extremely knowledgable and helpful.  If you ask a good question, it will almost certainly get an answer:

http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html


LogicX

Now that you've learned people are alive here -- write us a story.

I admit -- I read your post yesterday, and got excited about helping you (since you thought we weren't alive) and then you lost me right about at the pasting of your code. (why am I looking at random code, and being expected to parse and debug it?)


Tell us a story --
What are you trying to do
What steps have you taken to debug it, research it, etc.
What Is the expected behavior, and whats your proof (reference API Docs)
What do you think is going on? anything?
Have you googled for things? Read the Source?
Is this error preventing it from functioning or just a random error not causing any problems?
What does your print dumper output mean to you? Anything? How does that tie in with your problem?


These are just a few of the questions you've failed to address for us to effectively help you.

Matt isn't really trying to be a jerk (though I know I use to be intimidated by his responses Wink) -- hes trying to save yourself and us our valuable time.  Matt charges $75/hr for support through TNPI -- If you want his time for free, I'd suggest you fully read the document hes referenced, and prove to us you've made an effort to solve the problem before consulting.
--- May this post be indexed by spiders, and archived for all to see as my internet epitaph.
http://fpux.com" target="_blank">http://fpux.com

shaun

i've been digging through the code, to me it looks like the function is not erroring out.  It almost looks as if somebody was using this for debuging and forgot to comment out the warn or add a if $self->debug ?



--[SNIP FROM /usr/lib/perl5/site_perl/5.8.5/NicToolServer.pm]--
# return 1 if user has $access permissions on the object $id of type $type, else 0
sub get_access_permission{
   my ($self,$type,$id,$access)=@_;

   warn "##############################\nget_access_permission (".join(",",caller).")\n##############################\n "
        #"      params: ".Data::Dumper::Dumper($params).""
        if $self->debug_permissions;
   my @error= $self->check_permission('',$id,$access,$type);
   warn "get_access_permission: @error returning ".($error[0]?0:1);
   return $error[0]?0:1;
}