~registry/ngircd/testing

« back to all changes in this revision

Viewing changes to src/ngircd/login.c

  • Committer: DNS
  • Date: 2013-08-27 14:48:36 UTC
  • mfrom: (2671.5.8)
  • Revision ID: git-v1:bdb2850b399a7fac6a70fe24bd1f58dbd78cc307
Merge branch 'master' into testing

· Remove Conf_PreventLocalChans and Conf_PreventMLChans, obsolete now
· Remove RPL_HELP_MSG

Fixed conflicts with:
        doc/sample-ngircd.conf.tmpl
        man/ngircd.conf.5.tmpl
        src/ngircd/conf.c
        src/ngircd/irc-channel.c
        src/ngircd/irc-info.c
        src/ngircd/messages.h

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include "imp.h"
20
20
#include <assert.h>
21
21
#include <stdlib.h>
 
22
#include <stdio.h>
22
23
#include <string.h>
23
24
#include <strings.h>
24
25
#include <unistd.h>
37
38
#include "ngircd.h"
38
39
#include "pam.h"
39
40
#include "irc-info.h"
 
41
#include "irc-mode.h"
40
42
#include "irc-write.h"
41
43
 
42
44
#include "exp.h"
90
92
#ifdef PAM
91
93
        if (!Conf_PAM) {
92
94
                /* Don't do any PAM authentication at all, instead emulate
93
 
                 * the beahiour of the daemon compiled without PAM support:
 
95
                 * the behavior of the daemon compiled without PAM support:
94
96
                 * because there can't be any "server password", all
95
97
                 * passwords supplied are classified as "wrong". */
96
98
                if(Conn_Password(conn)[0] == '\0')
151
153
GLOBAL bool
152
154
Login_User_PostAuth(CLIENT *Client)
153
155
{
 
156
        REQUEST Req;
 
157
        char modes[CLIENT_MODE_LEN + 1];
 
158
 
154
159
        assert(Client != NULL);
155
160
 
156
161
        if (Class_HandleServerBans(Client) != CONNECTED)
185
190
        if (!IRC_Show_MOTD(Client))
186
191
                return DISCONNECTED;
187
192
 
188
 
        /* Suspend the client for a second ... */
189
 
        IRC_SetPenalty(Client, 1);
 
193
        /* Set default user modes */
 
194
        if (Conf_DefaultUserModes[0]) {
 
195
                snprintf(modes, sizeof(modes), "+%s", Conf_DefaultUserModes);
 
196
                Req.prefix = Client_ThisServer();
 
197
                Req.command = "MODE";
 
198
                Req.argc = 2;
 
199
                Req.argv[0] = Client_ID(Client);
 
200
                Req.argv[1] = modes;
 
201
                IRC_MODE(Client, &Req);
 
202
        } else
 
203
                IRC_SetPenalty(Client, 1);
190
204
 
191
205
        return CONNECTED;
192
206
}
194
208
#ifdef PAM
195
209
 
196
210
/**
197
 
 * Read result of the authenticatior sub-process from pipe
 
211
 * Read result of the authenticator sub-process from pipe
198
212
 *
199
213
 * @param r_fd          File descriptor of the pipe.
200
214
 * @param events        (ignored IO specification)