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

« back to all changes in this revision

Viewing changes to sockd/serverconfig.c

  • Committer: Bazaar Package Importer
  • Author(s): Adrian Bridgett
  • Date: 2003-11-15 18:59:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20031115185933-vkxgk8f226ovwmrh
Tags: 1.1.14-2
improve extended descriptions (closes: #209510, #210116)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (c) 1997, 1998, 1999, 2000, 2001
 
2
 * Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003
3
3
 *      Inferno Nettverk A/S, Norway.  All rights reserved.
4
4
 *
5
5
 * Redistribution and use in source and binary forms, with or without
45
45
#include "config_parse.h"
46
46
 
47
47
static const char rcsid[] =
48
 
"$Id: serverconfig.c,v 1.178 2002/01/01 15:47:11 michaels Exp $";
 
48
"$Id: serverconfig.c,v 1.182 2003/07/01 13:21:41 michaels Exp $";
49
49
 
50
50
__BEGIN_DECLS
51
51
 
460
460
        slog(LOG_DEBUG, "userid:\n%s",
461
461
        userids2string(&sockscf->uid, "", buf, sizeof(buf)));
462
462
 
 
463
        slog(LOG_DEBUG, "child.maxidlenumber: %d",
 
464
        sockscf->child.maxidlenumber);
 
465
 
463
466
        bufused = snprintfn(buf, sizeof(buf), "method(s): ");
464
467
        for (i = 0; (size_t)i < sockscf->methodc; ++i)
465
468
                bufused += snprintfn(&buf[bufused], sizeof(buf) - bufused, "%s%s",
578
581
 
579
582
        /* uid, read from configfile. */
580
583
        bzero(&sockscf.uid, sizeof(sockscf.uid));
 
584
 
 
585
        /* childstate, some read from configfile, some not. */
 
586
        sockscf.child.maxidlenumber = 0;
581
587
}
582
588
 
583
589
void
625
631
                        if (rule->log.disconnect || rule->log.error)
626
632
                                slog(LOG_INFO, "%s ]: %s -> %s: %s",
627
633
                                rulecommand, srcstring, dststring,
628
 
                                data == NULL ? strerror(errno) : data);
 
634
                                (data == NULL || *data == NUL) ? strerror(errno) : data);
629
635
                        break;
630
636
 
631
637
                case OPERATION_ERROR:
632
638
                        if (rule->log.error)
633
639
                                slog(LOG_INFO, "%s ]: %s -> %s: %s",
634
640
                                rulecommand, srcstring, dststring,
635
 
                                data == NULL ? strerror(errno) : data);
 
641
                                (data == NULL || *data == NUL) ? strerror(errno) : data);
636
642
                        break;
637
643
 
638
644
                case OPERATION_IO:
1079
1085
                        sockshost2sockaddr(ruleaddress2sockshost(addr, &host, SOCKS_TCP),
1080
1086
                        &saddr);
1081
1087
 
1082
 
                        if (sockd_bind(s, &saddr, 0) != 0) {
 
1088
                        if (bind(s, &saddr, sizeof(saddr)) != 0) {
1083
1089
                                swarn("%s: can't bind address: %s",
1084
1090
                                function, sockaddr2string(&saddr, saddrs, sizeof(saddrs)));
1085
1091
                                close(s);
1095
1101
                                return 0;
1096
1102
                        }
1097
1103
 
1098
 
                        if (sockd_bind(s, &saddr, 0) != 0) {
 
1104
                        if (bind(s, &saddr, sizeof(saddr)) != 0) {
1099
1105
                                swarn("%s: can't bind address %s of interface %s",
1100
1106
                                function, sockaddr2string(&saddr, saddrs, sizeof(saddrs)),
1101
1107
                                addr->addr.ifname);