The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

passwdpop function (cPanel API2) question

Discussion in 'cPanel Developers' started by Serge SX, Jan 13, 2016.

  1. Serge SX

    Serge SX Registered

    Joined:
    Jun 17, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ukraine
    cPanel Access Level:
    DataCenter Provider
    Hello!

    Can anyone explain me a strange behavior of API processor? Here is the thing: I was changing passwords for mailboxes on server using passwdpop function, everything went well until I got an exception:

    Code:
    <style type="text/css">.cpanel_internal_message { border: 1px solid #fff; outline-style: solid; outline-width: 1px; outline-color: #aaa; padding: 5px; } .cpanel_internal_error_warn { background-color: #FFF6CF; } .cpanel_internal_error_error { background-color: #F8E7E6; }</style>
    <div class="cjt-pagenotice-container cjt-notice-container" style="float: left; margin: 10px; width: auto;">
            <div class="yui-module cjt-notice cjt-pagenotice cjt-notice-warn">
                    <div class="cpanel_internal_message cpanel_internal_error_warn bd">
                            <div class="cjt-notice-content" style="width: 420px;">
                                    <span>
                                            A warning occurred while processing this directive.
                                            <a
                                                    class="error"
                                                    style="cursor:hand;cursor:pointer;"
                                                    onClick="document.getElementById('cpanel_internal_error_1').style.display='';this.style.display='none'; return false;">
                                                    [show]
                                            </a>
                                    </span>
                                    <div id="cpanel_internal_error_1" style="display:none;">
                                            <textarea class="cpanel_internal_error_warn" style="font-weight:900; height:200px; width:410px;">utf8 &quot;\xDE&quot; does not map to Unicode at /usr/local/cpanel/Cpanel/JSON.pm line 155.
    at /usr/local/cpanel/Cpanel/JSON.pm line 155.
            Cpanel::JSON::LoadFile(GLOB(0x4985240), undef, 1) called at /usr/local/cpanel/Cpanel/AdminBin/Serializer.pm line 48
            Cpanel::AdminBin::Serializer::LoadFile(GLOB(0x4985240)) called at cpanel.pl line 812
            eval {...} called at cpanel.pl line 812
    </textarea>
                                    </div>
                            </div>
                    </div>
            </div>
    </div>
            {"cpanelresult":{"apiversion":"2","data":{"reason":"Failed to read valid json data in json fast mode: illegal backslash escape sequence in string, at character offset 37 (before \"\\\\xDELiKJ*0\",\"domain...\") at /usr/local/cpanel/Cpanel/JSON.pm line 120, <STDIN> line 1.\n","result":"0"},"type":"text"}}
    
    
    I discovered that it happened with the following password:

    ^@qZAX3Ca%dELiKJ*0

    Furthermore, there will be no exception if you replace % character in it to another position or just even add one more near it.

    So what is wrong with % char? Is it about combination with "d" or "a" near it?
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,461
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    '%' often has special meaning. Does the problem go away when you URI encode % (replace % with %25)?
     
  3. Serge SX

    Serge SX Registered

    Joined:
    Jun 17, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ukraine
    cPanel Access Level:
    DataCenter Provider
    Yes, I suspected that. In order to make process simpler, I just removed "%" from the pool of characters for password generation - much easier than find and encode it every time.

    But thank you for the reply and advice!
     
Loading...

Share This Page