~ubuntu-branches/ubuntu/lucid/vino/lucid

« back to all changes in this revision

Viewing changes to server/libvncserver/auth.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastian Dröge
  • Date: 2008-05-27 09:06:36 UTC
  • mfrom: (1.1.21 upstream) (2.1.31 hardy)
  • Revision ID: james.westby@ubuntu.com-20080527090636-lg1whxlkub1wtsw7
Tags: 2.22.2-1
New upstream bugfix release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
void
195
195
rfbAuthNewClient(rfbClientPtr cl)
196
196
{
197
 
    if (cl->minorVersion == rfbProtocolMinorVersion7)
 
197
    if (cl->minorVersion >= rfbProtocolMinorVersion7)
198
198
        rfbAuthNewClient3_7(cl);
199
199
    else
200
200
        rfbAuthNewClient3_3(cl);
281
281
        cl->state = RFB_AUTHENTICATION;
282
282
        break;
283
283
    case rfbNoAuth:
284
 
        cl->state = RFB_INITIALISATION;
285
 
        if (rfbAuthClientAuthenticated(cl))
286
 
            rfbProcessClientInitMessage(cl);
 
284
 
 
285
        if (cl->minorVersion >= rfbProtocolMinorVersion8)
 
286
            rfbAuthPasswordChecked(cl, RFB_CLIENT_ACCEPT);
 
287
        else {
 
288
            cl->state = RFB_INITIALISATION;
 
289
            if (rfbAuthClientAuthenticated(cl))
 
290
                rfbProcessClientInitMessage(cl);
 
291
        }
287
292
        break;
288
293
    default:
289
294
        /* can't be reached */
423
428
            return;
424
429
        }
425
430
 
 
431
        if (cl->minorVersion >= rfbProtocolMinorVersion8) {
 
432
            /* We can't really localize this string, since it has to
 
433
             * be iso8859-1 encoded. However, the string will only be
 
434
             * returned when we're using protocol version 3.8, and we
 
435
             * only advertise support for 3.7, so this only gets used
 
436
             * at all if you have a broken client.
 
437
             */
 
438
            const char errmsg[] = "Password incorrect";
 
439
            uint32_t len, wireLen;
 
440
 
 
441
            len = sizeof(errmsg) - 1;
 
442
            wireLen = Swap32IfLE(len);
 
443
            if (WriteExact(cl, (char *)&wireLen, 4) < 0 ||
 
444
                WriteExact(cl, errmsg, len) < 0) {
 
445
                rfbLogPerror("rfbAuthPasswordChecked: write");
 
446
                rfbCloseClient(cl);
 
447
                return;
 
448
            }
 
449
        }
 
450
 
426
451
        rfbCloseClient(cl);
427
452
        break;
428
453
    }