<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<blockquote cite="mid:4C65B05B.5070202@redhat.com" type="cite">
  <blockquote cite="mid:4C65AA16.1090204@redhat.com" type="cite"> <br>
Here's my version, that just calls the parameter prior to updating the
attr.  I tested it with: <br>
    <br>
[root@ipa ~]# ipa user-mod --setattr uidnumber=555 kfrog <br>
--------------------- <br>
Modified user "kfrog" <br>
--------------------- <br>
  User login: kfrog <br>
  First name: Kermit <br>
  Last name: Frog <br>
  Home directory: /home/kfrog <br>
  Login shell: /bin/sh <br>
  UID: 555 <br>
  Groups: ipausers <br>
[root@ipa ~]# ipa user-mod --setattr uidnumber=frog kfrog <br>
ipa: ERROR: invalid 'uidnumber': must be an integer <br>
    <br>
    <br>
    <br>
    <pre wrap=""><fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Freeipa-devel mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated"
 href="mailto:Freeipa-devel@redhat.com">Freeipa-devel@redhat.com</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext"
 href="https://www.redhat.com/mailman/listinfo/">https://www.redhat.com/mailman/listinfo/</a></pre>
  </blockquote>
Pushed to Master.  ACKed in IRC by rcrit, and based on a pzuna patch
reviewd by both myself and rcrit<br>
  <br>
  <blockquote cite="mid:4C65AA16.1090204@redhat.com" type="cite">
    <pre wrap="">freeipa-devel</pre>
  </blockquote>
Since this was a diff to a Patch ACK<br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Freeipa-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Freeipa-devel@redhat.com">Freeipa-devel@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/freeipa-devel">https://www.redhat.com/mailman/listinfo/freeipa-devel</a></pre>
</blockquote>
<br>
Just ran the details patch on top of this, and the user details page
does not work with it.<br>
<br>
If you submit the page even with a minor edit to the full name you get
an error: 'login' is required.<br>
<br>
I've tested it out with the JSON and CURL:  Here is the JSON it is
sending:<br>
<br>
{"method":"user_mod","params":[["zoe"],{"all":true,"setattr":["cn=Zoe
MacLeod","gidnumber=1044896486","title=","displayname=","initials=","uid=","mail=","street=","location=","postalcode=","ou=","carlicense="],"addattr":[],"givenname":"Zoe","sn":"MacPhearson","uidnumber":"1044896486","homedirectory":"/home/zoe","sizelimit":100}],"id":4}<br>
<br>
<br>
The message 'login' is required is coming from the call I added to<br>
    value = self.params[attr](value)<br>
As it is the message inside RequirementError, which gets called from
parameters.py, specifically:<br>
<br>
def validate(self, value):<br>
        """<br>
        Check validity of ``value``.<br>
<br>
        :param value: A proposed value for this parameter.<br>
        """<br>
        if value is None:<br>
            if self.required:<br>
                raise RequirementError(name=self.cli_name)<br>
<br>
<br>
My guess is the correct change is to skip this call if  value is null,
which seems to be what is happening.  But I suspect we are sending in
bogus values to setattr.  Notice this part of the JSON<br>
<br>
"setattr":["cn=Zoe
MacLeod","gidnumber=1044896486","title=","displayname=","initials=","uid=","mail=","street=","location=","postalcode=","ou=","carlicense="]<br>
<br>
<br>
My guess is that the details page shouldn't send any unset values. 
"uid=" in particular is probably a mistake.  REmoving that from the
JSON gets us to: an internal error has occurred.<br>
<br>
Here's the stack trace:<br>
<br>
ipa: ERROR: non-public: TypeError: 'NoneType' object is not iterable<br>
Traceback (most recent call last):<br>
  File "/home/ayoung/devel/freeipa/ipaserver/rpcserver.py", line 206,
in wsgi_execute<br>
    result = self.Command[name](*args, **options)<br>
  File "/home/ayoung/devel/freeipa/ipalib/frontend.py", line 401, in
__call__<br>
    ret = self.run(*args, **options)<br>
  File "/home/ayoung/devel/freeipa/ipalib/frontend.py", line 674, in run<br>
    return self.execute(*args, **options)<br>
  File "/home/ayoung/devel/freeipa/ipalib/plugins/baseldap.py", line
431, in execute<br>
    addset = set(get_attributes(options.get('addattr', [])))<br>
  File "/home/ayoung/devel/freeipa/ipalib/plugins/baseldap.py", line
52, in get_attributes<br>
    for attr in attrs:<br>
<br>
<br>
Again, this is from the __call__ code, which means it is from the code
I added, although now I'm not sure which parameter, if any is tripped
the code. <br>
<br>
<br>
I ran the full body of unit tests on the code as commited, and they all
pass, as did the set of tests that Rob cobbled up (reminder: Lets get
those added) so I don't think the call to self.params[attr](value) is
wrong, but that it catches input errors that would have bitten us.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>