]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Merge branch 'bug113-SrvPrefix'
authorAlexander Barton <alex@barton.de>
Tue, 9 Aug 2011 08:16:56 +0000 (10:16 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 9 Aug 2011 08:16:56 +0000 (10:16 +0200)
* bug113-SrvPrefix:
  Slightly change (and document!) IRC_KILL() calling convention
  Spoofed prefixes: close connection on non-server links only

contrib/MacOSX/config.h
contrib/MacOSX/ngIRCd.xcodeproj/.gitignore
contrib/MacOSX/ngIRCd.xcodeproj/project.pbxproj
contrib/ngindent
doc/Platforms.txt
src/ngircd/irc-login.c
src/ngircd/ngircd.c
src/testsuite/getpid.sh

index af0a34c2f2c383ab830b926f12b81a4e12ebb6e2..86b460b159fceccc9201b8a18dcced65548da37d 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton (alex@barton.de).
+ * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #ifdef PAM
 /* Define to 1 if you have the `pam_authenticate' function. */
 #define HAVE_PAM_AUTHENTICATE 1
+#if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1060)
 /* Define to 1 if you have the <pam/pam_appl.h> header file. */
 #define HAVE_PAM_PAM_APPL_H 1
 /* Mac OS X <10.6 doesn't have pam_fail_delay() */
 #define NO_PAM_FAIL_DELAY 1
+#else
+/* Define to 1 if you have the <security/pam_appl.h> header file. */
+#define HAVE_SECURITY_PAM_APPL_H 1
+#endif
 #endif
 
 /* -eof- */
index d82a5e47def52cce2467649612ca36ad79f40a63..d6d065a79b427d0abf94437073b2222b0697d5ee 100644 (file)
@@ -1,2 +1,4 @@
+project.xcworkspace
+xcuserdata
 *.mode1v3
 *.pbxuser
index 2f9124e46c34c3368a8dbd412e873a9e28d098bb..42ddbf264b67649c7c17d1f0d9ae6aa6ea9129fd 100644 (file)
@@ -3,7 +3,7 @@
        archiveVersion = 1;
        classes = {
        };
-       objectVersion = 44;
+       objectVersion = 46;
        objects = {
 
 /* Begin PBXBuildFile section */
                FA322D8E0CEF7523001761B3 /* ngIRCd.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = ngIRCd.xcodeproj; sourceTree = "<group>"; };
                FA322D910CEF7523001761B3 /* Makefile.am */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = Makefile.am; sourceTree = "<group>"; };
                FA322D920CEF7523001761B3 /* ngindent */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = ngindent; sourceTree = "<group>"; };
-               FA322D930CEF7523001761B3 /* ngircd.sh */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text.script.sh; path = ngircd.sh; sourceTree = "<group>"; };
                FA322D940CEF7523001761B3 /* ngircd.spec */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = ngircd.spec; sourceTree = "<group>"; };
                FA322D950CEF7523001761B3 /* README */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
                FA322D960CEF7523001761B3 /* systrace.policy */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = systrace.policy; sourceTree = "<group>"; };
                FA407F2C0DB159F400271AF1 /* ng_ipaddr.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; name = ng_ipaddr.c; path = ipaddr/ng_ipaddr.c; sourceTree = "<group>"; };
                FA407F2D0DB159F400271AF1 /* ng_ipaddr.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; name = ng_ipaddr.h; path = ipaddr/ng_ipaddr.h; sourceTree = "<group>"; };
                FA407F380DB15AC700271AF1 /* GIT.txt */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = text; path = GIT.txt; sourceTree = "<group>"; };
+               FA4B08E513E7F8FB00765BA3 /* ngircd-bsd.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "ngircd-bsd.sh"; sourceTree = "<group>"; };
+               FA4B08E613E7F91700765BA3 /* ngIRCd-Logo.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "ngIRCd-Logo.gif"; sourceTree = "<group>"; };
+               FA4B08E713E7F91700765BA3 /* ngircd-redhat.init */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "ngircd-redhat.init"; sourceTree = "<group>"; };
+               FA4B08E813E7F91C00765BA3 /* platformtest.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = platformtest.sh; sourceTree = "<group>"; };
                FA77849A133FB9FF00740057 /* sample-ngircd.conf.tmpl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "sample-ngircd.conf.tmpl"; sourceTree = "<group>"; };
                FA85178A0FA061EC006A1F5A /* op.h */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.h; path = op.h; sourceTree = "<group>"; };
                FA85178B0FA061EC006A1F5A /* op.c */ = {isa = PBXFileReference; fileEncoding = 5; lastKnownFileType = sourcecode.c.c; path = op.c; sourceTree = "<group>"; };
                                FA322D730CEF7523001761B3 /* MacOSX */,
                                FA322D910CEF7523001761B3 /* Makefile.am */,
                                FA322D920CEF7523001761B3 /* ngindent */,
-                               FA322D930CEF7523001761B3 /* ngircd.sh */,
+                               FA4B08E513E7F8FB00765BA3 /* ngircd-bsd.sh */,
+                               FA4B08E613E7F91700765BA3 /* ngIRCd-Logo.gif */,
+                               FA4B08E713E7F91700765BA3 /* ngircd-redhat.init */,
                                FA322D940CEF7523001761B3 /* ngircd.spec */,
+                               FA4B08E813E7F91C00765BA3 /* platformtest.sh */,
                                FA322D950CEF7523001761B3 /* README */,
                                FA322D960CEF7523001761B3 /* systrace.policy */,
                        );
 /* Begin PBXProject section */
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
+                       attributes = {
+                               LastUpgradeCheck = 0410;
+                       };
                        buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "ngIRCd" */;
-                       compatibilityVersion = "Xcode 3.0";
+                       compatibilityVersion = "Xcode 3.2";
                        developmentRegion = English;
                        hasScannedForEncodings = 1;
                        knownRegions = (
                1DEB928B08733DD80010E9CD /* Default */ = {
                        isa = XCBuildConfiguration;
                        buildSettings = {
-                               ARCHS = "$(ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1)";
-                               ARCHS_STANDARD_32_64_BIT_PRE_XCODE_3_1 = "x86_64 i386 ppc";
-                               GCC_VERSION = 4.0;
+                               ARCHS = "$(ARCHS_STANDARD_32_64_BIT)";
+                               GCC_VERSION = 4.2;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
-                               PREBINDING = NO;
-                               SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
+                               SDKROOT = macosx10.6;
                        };
                        name = Default;
                };
                                ARCHS = "$(NATIVE_ARCH_ACTUAL)";
                                GCC_DEBUGGING_SYMBOLS = full;
                                GCC_OPTIMIZATION_LEVEL = 0;
-                               GCC_VERSION = 4.0;
+                               GCC_VERSION = 4.2;
                                GCC_WARN_ABOUT_RETURN_TYPE = YES;
                                GCC_WARN_UNUSED_VARIABLE = YES;
                                ONLY_ACTIVE_ARCH = YES;
-                               PREBINDING = NO;
                                SDKROOT = "";
                        };
                        name = Debug;
index 73537a6d6d07664ecac76e487aa8aaf6f03e5b7a..2ce1a26ac261ea41bbbbac9a6287f44f42943d08 100755 (executable)
@@ -4,6 +4,7 @@ INDENTARGS="-kr -i8 -ts8 -l80 -c3 -cd41 -ss -ncs -psl"
 
 # check if indent(1) is available
 type indent >/dev/null 2>&1 && INDENT="indent"
+type gindent >/dev/null 2>&1 && INDENT="gindent"
 type gnuindent >/dev/null 2>&1 && INDENT="gnuindent"
 
 if [ -z "$INDENT" ]; then
index 460719f927cdc501e402e3f30e06d49923d1f806..0346ac680048a2ea63e999045780afbe058a57d3 100644 (file)
@@ -59,6 +59,7 @@ m68k/apple/aux3.1.1         Orig. A/UX   18         11-07-02 alex   Y Y N Y (2)
 m68k/hp/hp-ux9.10           Orig. HPUX   0.7.x-CVS  03-04-30 goetz  Y Y Y Y
 m88k/dg/dgux5.4R3.10        gcc 2.5.8    CVSHEAD    04-03-15 alex   Y Y ? ?
 mipsel/unknown/linux-gnu    gcc 4.1.2    18         11-07-05 goetz  Y Y N Y (1)
+mipsel/unknown/linux-gnu    gcc 4.4.5    18         11-07-30 goetz  Y Y Y Y (1)
 powerpc/apple/darwin6.5     gcc 3.1      0.7.x-CVS  03-04-23 alex   Y Y Y Y
 powerpc/apple/darwin7.9.0   gcc 3.3      CVSHEAD    06-05-07 fw     Y Y Y Y (3)
 powerpc/apple/darwin8.11.0  gcc 4.0.1    18         11-07-02 goetz  Y Y Y Y (3)
index c90a7c1c835db59727c9f2081c48d44f9063a147..edaefd61cfc119fbd26de3a26d55eb65bc0146d0 100644 (file)
@@ -653,32 +653,37 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req )
        CLIENT *target;
        char quitmsg[LINE_LEN];
 
-       assert( Client != NULL );
-       assert( Req != NULL );
+       assert(Client != NULL);
+       assert(Req != NULL);
 
        /* Wrong number of arguments? */
-       if( Req->argc > 1 )
-               return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
+       if (Req->argc > 1)
+               return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
+                                         Client_ID(Client), Req->command);
 
        if (Req->argc == 1)
                strlcpy(quitmsg, Req->argv[0], sizeof quitmsg);
 
-       if ( Client_Type( Client ) == CLIENT_SERVER )
-       {
+       if (Client_Type(Client) == CLIENT_SERVER) {
                /* Server */
-               target = Client_Search( Req->prefix );
-               if( ! target )
-               {
-                       Log( LOG_WARNING, "Got QUIT from %s for unknown client!?", Client_ID( Client ));
+               target = Client_Search(Req->prefix);
+               if (!target) {
+                       Log(LOG_WARNING,
+                           "Got QUIT from %s for unknown client!?",
+                           Client_ID(Client));
                        return CONNECTED;
                }
 
-               Client_Destroy( target, "Got QUIT command.", Req->argc == 1 ? quitmsg : NULL, true);
-
-               return CONNECTED;
-       }
-       else
-       {
+               if (target != Client) {
+                       Client_Destroy(target, "Got QUIT command.",
+                                      Req->argc == 1 ? quitmsg : NULL, true);
+                       return CONNECTED;
+               } else {
+                       Conn_Close(Client_Conn(Client), "Got QUIT command.",
+                                  Req->argc == 1 ? quitmsg : NULL, true);
+                       return DISCONNECTED;
+               }
+       } else {
                if (Req->argc == 1 && quitmsg[0] != '\"') {
                        /* " " to avoid confusion */
                        strlcpy(quitmsg, "\"", sizeof quitmsg);
@@ -687,7 +692,8 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req )
                }
 
                /* User, Service, or not yet registered */
-               Conn_Close( Client_Conn( Client ), "Got QUIT command.", Req->argc == 1 ? quitmsg : NULL, true);
+               Conn_Close(Client_Conn(Client), "Got QUIT command.",
+                          Req->argc == 1 ? quitmsg : NULL, true);
 
                return DISCONNECTED;
        }
index 500d1288efccf80ef8eeb3bc0a64a91e6fb2b974..2135ec4d708ab72eed7141237725c56300423b95 100644 (file)
@@ -593,7 +593,7 @@ Random_Init(void)
                return;
        if (Random_Init_Kern("/dev/arandom"))
                return;
-       srand(rand() ^ getpid() ^ time(NULL));
+       srand(rand() ^ (unsigned)getpid() ^ (unsigned)time(NULL));
 }
 
 
index 5e169175295d53d9d02549937827151a4225983d..fd3b3422b1e5c90b85ceb0d672efce2d7719290a 100755 (executable)
@@ -16,7 +16,7 @@ elif [ $UNAME = "GNU" ]; then
 elif [ $UNAME = "SunOS" ]; then
   PS_FLAGS="-af"; PS_PIDCOL=2; HEAD_FLAGS="-n 1"
 else
-  PS_FLAGS="-f"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
+  PS_FLAGS="-af"; PS_PIDCOL="2"; HEAD_FLAGS="-n 1"
   ps $PS_FLAGS > /dev/null 2>&1
   if [ $? -ne 0 ]; then PS_FLAGS="a"; PS_PIDCOL="1"; fi
 fi