Bug#447320: boinc-manager: Failed to create a new account with "missing or bad parameter: user_name" on certain condition.

Morita Sho morita-pub-en-debian at inz.sakura.ne.jp
Sat Oct 20 01:21:34 UTC 2007


Package: boinc-manager
Version: 5.10.8-2
Severity: normal

Hi,

I was try to create a new account by following steps:
1) Open "Attach to project" dialog,
2) Select "Rosetta at Home" and click "Next",
3) Input an E-mail and password and click "Next",
4) An error "missing or bad parameter: user_name" occurs.

I have used Wireshark to see what data boinc-manager sent, and here is a HTTP request:
  GET /rosetta/create_account.php?email_addr=<...snip...>&passwd_hash=<...snip...>&user_name= HTTP/1.1
  User-Agent: BOINC client (i686-pc-linux-gnu 5.10.8)
  Host: boinc.bakerlab.org
  Accept: */*
  Accept-Encoding: deflate, gzip
  Content-Type: application/x-www-form-urlencoded

Note that the user_name parameter is empty.
I have looking for how to change the user_name parameter, but I can't find anything.
There is no inputbox for the user_name in "Attach to project" dialog nor Setting dialog in boinc-manager.

I have looked up the source code of boinc-manager and found following code:
boinc-5.10.8/clientgui/ProjectProcessingPage.cpp
                ai->user_name = (const char*)::wxGetUserName().mb_str();

The function wxGetUserName is a function of wxwidgets.
According to the manual of wxwidgets, wxGetUserName returns "Full User Name".
  http://www.wxwidgets.org/manuals/stable/wx_networkfunctions.html#wxgetusername

I have looked up source code of wxwidgets.
Here is a wxGetUserName defined in wxwidgets2.6-2.6.3.2.2/src/unix/utilsunx.cpp:
bool wxGetUserName(wxChar *buf, int sz)
{
    struct passwd *who;

    *buf = wxT('\0');
    if ((who = getpwuid (getuid ())) != NULL)
    {
        // pw_gecos field in struct passwd is not standard
#ifdef HAVE_PW_GECOS
       char *comma = strchr(who->pw_gecos, ',');
       if (comma)
           *comma = '\0'; // cut off non-name comment fields
       wxStrncpy (buf, wxSafeConvertMB2WX(who->pw_gecos), sz - 1);
#else // !HAVE_PW_GECOS
       wxStrncpy (buf, wxSafeConvertMB2WX(who->pw_name), sz - 1);
#endif // HAVE_PW_GECOS/!HAVE_PW_GECOS
       return true;
    }

    return false;
}

Actually, this function retrieves 5th field (pw_gecos) in /etc/passwd entry for the current user.

My 5th field in /etc/passwd was ",,,", it means empty because wxGetUserName will
cut off after first comma, so I changed it to "abc,,,".
And I tried to create a new account in boinc-manager.
As result, it succeeded with no error.

Here is a HTTP request sent in that situation:
  GET /rosetta/create_account.php?email_addr=<...snip...>&passwd_hash=<...snip...>&user_name=abc HTTP/1.1
  User-Agent: BOINC client (i686-pc-linux-gnu 5.10.8)
  Host: boinc.bakerlab.org
  Accept: */*
  Accept-Encoding: deflate, gzip
  Content-Type: application/x-www-form-urlencoded

Note that user_name parameter have "abc".
I know user_name parameter is taken from 5th field in /etc/passwd,
and if user_name parameter is empty, "missing or bad parameter: user_name" error will occurs.

Since 5th field in /etc/passwd is optional, boinc-manager should not assumes it is non-empty.
I have some idea to fix (or mitigate) this problem.
 * Add inputbox for user_name to the "Attach to project" dialog and
   use wxGetUserName() as its default value.
 * Use other non-empty value if wxGetUserName() returns ""


Regards,

-- 
Morita Sho

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.22-2-k7 (SMP w/1 CPU core)
Locale: LANG=ja_JP.UTF-8, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages boinc-manager depends on:
ii  libc6                 2.6.1-6            GNU C Library: Shared libraries
ii  libcurl3              7.17.0-1           Multi-protocol file transfer libra
ii  libgcc1               1:4.2.2-3          GCC support library
ii  libidn11              1.1-1              GNU libidn library, implementation
ii  libkrb53              1.6.dfsg.3~beta1-1 MIT Kerberos runtime libraries
ii  libldap2              2.1.30.dfsg-13.5   OpenLDAP libraries
ii  libssh2-1             0.17-1             SSH2 client-side library
ii  libssl0.9.8           0.9.8f-1           SSL shared libraries
ii  libstdc++6            4.2.2-3            The GNU Standard C++ Library v3
ii  libwxbase2.6-0        2.6.3.2.2-1        wxBase library (runtime) - non-GUI
ii  libwxgtk2.6-0         2.6.3.2.2-1        wxWidgets Cross-platform C++ GUI t
ii  zlib1g                1:1.2.3.3.dfsg-6   compression library - runtime

Versions of packages boinc-manager recommends:
ii  boinc-client                  5.10.8-2   core client for the BOINC distribu

-- no debconf information





More information about the pkg-boinc-devel mailing list