~ubuntu-branches/ubuntu/karmic/dante/karmic

« back to all changes in this revision

Viewing changes to sockd/sockd_negotiate.c

  • Committer: Bazaar Package Importer
  • Author(s): Thijs Kinkhorst
  • Date: 2006-10-19 12:09:39 UTC
  • mfrom: (3.1.1 dapper)
  • Revision ID: james.westby@ubuntu.com-20061019120939-t818x24e2tn8be5k
Tags: 1.1.18-2.1
* Non-maintainer upload for RC bug.
* Make sure changelogs are installed into all packages (Closes: #393568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
#include "common.h"
45
45
 
46
46
static const char rcsid[] =
47
 
"$Id: sockd_negotiate.c,v 1.84 2003/07/01 13:21:46 michaels Exp $";
 
47
"$Id: sockd_negotiate.c,v 1.87 2005/05/05 11:18:47 michaels Exp $";
48
48
 
49
49
__BEGIN_DECLS
50
50
 
395
395
        /* find a free slot. */
396
396
        for (i = 0, neg = NULL; i < negc; ++i)
397
397
                if (!negv[i].allocated) {
 
398
                        /* don't allocate it yet, so siginfo() doesn't print before ready. */
398
399
                        neg = &negv[i];
399
400
                        break;
400
401
                }
415
416
        len = sizeof(from);
416
417
        if (getpeername(neg->s, &from, &len) != 0) {
417
418
                slog(LOG_DEBUG, "%s: getpeername(): %s", function, strerror(errno));
 
419
                delete_negotiate(mother, neg);
418
420
                return 1;
419
421
        }
420
422
        sockaddr2sockshost(&from, &neg->src);
422
424
        len = sizeof(to);
423
425
        if (getsockname(neg->s, &to, &len) != 0) {
424
426
                slog(LOG_DEBUG, "%s: getsockname(): %s", function, strerror(errno));
 
427
                delete_negotiate(mother, neg);
425
428
                return 1;
426
429
        }
427
430
        sockaddr2sockshost(&to, &neg->dst);
440
443
        iolog(&neg->rule, &neg->state, OPERATION_ACCEPT, &neg->src, &neg->state.auth,
441
444
        &neg->dst, NULL, ruleinfo, 0);
442
445
 
443
 
        neg->allocated = 1;
444
 
 
445
446
        if (!permit) {
446
447
                delete_negotiate(mother, neg);
447
448
                return 0;
448
449
        }
449
450
 
450
451
        time(&neg->state.time.negotiate_start);
451
 
 
 
452
        neg->allocated = 1;
452
453
        proctitleupdate();
453
454
 
454
455
        return 0;
463
464
        static const struct sockd_negotiate_t neginit;
464
465
        const char command = SOCKD_FREESLOT;
465
466
 
466
 
        SASSERTX(neg->allocated);
467
 
 
468
467
        close(neg->s);
469
468
 
470
469
        *neg = neginit;