specifing policy on kadm5_create_principal()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vongodric
Forum Newbie
Posts: 6
Joined: Wed Oct 04, 2006 4:22 am

specifing policy on kadm5_create_principal()

Post by vongodric »

Anyone else has this problem? How to fix it?

Description:
Basically same code as php.net manual example gives error:
Warning: No policy specified for blaah...; assigning "default" .

Reproduce code:

Code: Select all

$attributes=KRB5_KDB_REQUIRES_PRE_AUTH|KRB5_KDB_DISALLOW_PROXIABLE;
$options = array(KADM5_PRINC_EXPIRE_TIME => 0,
                            KADM5_PW_EXPIRATION => 0,
                            KADM5_POLICY => "default",
                            KADM5_ATTRIBUTES => $attributes);

return kadm5_modify_principal($this->krb_con,"principal/default@EXAMPLE.COM",$options);
Expected result:
no errors

Actual result:
warning, that no policy was specified and a default policy was assigned
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://pecl.php.net/bugs/bug.php?id=8334 ;)
Actual result:
warning, that no policy was specified and a default policy was assigned
is it one of those

Code: Select all

php_error(E_WARNING, "No policy specified for %s; assigning \"default\"", princstr);
...
php_error(E_WARNING, "No policy specified for %s; defaulting to no policy", princstr);
?
I find such an error message only in PHP_FUNCTION(kadm5_create_principal), http://viewcvs.php.net/viewvc.cgi/pecl/ ... notate=1.2
not in PHP_FUNCTION(kadm5_modify_principal).
vongodric
Forum Newbie
Posts: 6
Joined: Wed Oct 04, 2006 4:22 am

Post by vongodric »

Yes I know this post. The guy who made it is like two rooms away from me. But no one responded and developer of the package hasn't replyed to emails either.

I believe it's on line 621 or 626. I'v looked at the source myself too, but don't really know hot to compile it. So I thought to ask if someone else had this problem and have solved it somehow. But if someone can help me to compile it I'm sure I could figure out the problem myself with some experimenting.

There is few odd things in the source: like line nr: 619 where it checks for flags

Code: Select all

if ((! (mask & KADM5_POLICY)) && (! (mask & KADM5_POLICY_CLR))) { ...
the thing is -mask is inited to 0 prior and is not modified till this point.
vongodric
Forum Newbie
Posts: 6
Joined: Wed Oct 04, 2006 4:22 am

Post by vongodric »

volka wrote:I find such an error message only in PHP_FUNCTION(kadm5_create_principal), http://viewcvs.php.net/viewvc.cgi/pecl/ ... notate=1.2
not in PHP_FUNCTION(kadm5_modify_principal).
Sry my mistake there. The correct is create of course. So sick of trying to solve it...
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

This

Code: Select all

if ((! (mask & KADM5_POLICY)) && (! (mask & KADM5_POLICY_CLR))) {
is before the

Code: Select all

/* parsing options */
block.
Taking into account that dummybuf in modify_principle is initialized but never used I guess the code is incomplete or was in a state of flux until the developer lost interest...
vongodric
Forum Newbie
Posts: 6
Joined: Wed Oct 04, 2006 4:22 am

Post by vongodric »

yes I noticed that too.

But I can't figure out how to compile it... I'm on linux but not a linux used and have little knowledge of autotools or php module development. So if someone could direct me in the right way so I could compile maybe I can then fix the problems too.

tnx in advance
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Which version of php do you use and where did you get it (shipped with distribution, compiled from php.net source, ....)?
And the KADM5 extension?
Which linux distribution?

maybe of interest:
http://livedocs.phpdoc.info/index.php?l ... stall.pecl
http://www.php.net/manual/en/install.unix.php
http://www.zend.com/php/internals/exten ... iting1.php
vongodric
Forum Newbie
Posts: 6
Joined: Wed Oct 04, 2006 4:22 am

Post by vongodric »

I use Suse 10.1 and have the php5 (included with distribution. 5.1.2) also I have downloaded and builded the kerberos (latest)
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

vongodric wrote:also I have downloaded and builded the kerberos (latest)
Does this relate to the keberos server or to the PECL extension for php?
anyway, http://livedocs.phpdoc.info/index.php?l ... stall.pecl should give you a start
vongodric
Forum Newbie
Posts: 6
Joined: Wed Oct 04, 2006 4:22 am

Post by vongodric »

I believe it's the server. It has also the header files needed by the extension.

Anyway big tnx to you volka. I'll try to dig myself through this now.
Post Reply