Apiize CtdlIsPublicClient()
authorWilfried Goesgens <dothebart@citadel.org>
Sat, 14 Sep 2013 17:33:19 +0000 (19:33 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sat, 14 Sep 2013 17:33:19 +0000 (19:33 +0200)
citadel/citserver.c
citadel/citserver.h
citadel/modules/ctdlproto/serv_session.c

index e7374205da18f033568ce4c00b3d668b03b7328f..3f3739e274b85ae4ec3fb84216368b96b83e5856 100644 (file)
@@ -60,7 +60,6 @@
 #include "support.h"
 #include "locate_host.h"
 #include "room_ops.h"
-#include "file_ops.h"
 #include "control.h"
 #include "euidindex.h"
 #include "context.h"
@@ -273,7 +272,7 @@ char CtdlCheckExpress(void) {
  * (for example, to show the location of the user rather than the location
  * of the client).
  */
-int is_public_client(void)
+int CtdlIsPublicClient(void)
 {
        char buf[1024];
        char addrbuf[1024];
index 37028a7496e6b6dbd2cab569c78c9aceb4fc47d0..3e616b19fb9b3065d3171c466e5392e16d030098 100644 (file)
@@ -53,5 +53,6 @@ void help_subst (char *strbuf, char *source, char *dest);
 
 extern int panic_fd;
 char CtdlCheckExpress(void);
+int CtdlIsPublicClient(void);
 extern time_t server_startup_time;
 extern int openid_level_supported;
index 8fbda5ca78a6135a70027d2a3e3471924242e573..c829fca07a8e5863d848121fb554d912128115ab 100644 (file)
@@ -49,7 +49,7 @@
 #include "sysdep_decls.h"
 #include "support.h"
 #include "room_ops.h"
-#include "file_ops.h"
+#include "svn_revision.h"
 #include "control.h"
 #include "msgbase.h"
 #include "config.h"
@@ -167,6 +167,7 @@ void cmd_more(char *argbuf) {
  */
 void cmd_iden(char *argbuf)
 {
+        CitContext *CCC = MyContext();
        int dev_code;
        int cli_code;
        int rev_level;
@@ -187,17 +188,17 @@ void cmd_iden(char *argbuf)
        from_host[sizeof from_host - 1] = 0;
        if (num_parms(argbuf)>=5) extract_token(from_host, argbuf, 4, '|', sizeof from_host);
 
-       CC->cs_clientdev = dev_code;
-       CC->cs_clienttyp = cli_code;
-       CC->cs_clientver = rev_level;
-       safestrncpy(CC->cs_clientname, desc, sizeof CC->cs_clientname);
-       CC->cs_clientname[31] = 0;
+       CCC->cs_clientdev = dev_code;
+       CCC->cs_clienttyp = cli_code;
+       CCC->cs_clientver = rev_level;
+       safestrncpy(CCC->cs_clientname, desc, sizeof CCC->cs_clientname);
+       CCC->cs_clientname[31] = 0;
 
        /* For local sockets and public clients, trust the hostname supplied by the client */
-       if ( (CC->is_local_socket) || (is_public_client()) ) {
-               safestrncpy(CC->cs_host, from_host, sizeof CC->cs_host);
-               CC->cs_host[sizeof CC->cs_host - 1] = 0;
-               CC->cs_addr[0] = 0;
+       if ( (CCC->is_local_socket) || (CtdlIsPublicClient()) ) {
+               safestrncpy(CCC->cs_host, from_host, sizeof CCC->cs_host);
+               CCC->cs_host[sizeof CCC->cs_host - 1] = 0;
+               CCC->cs_addr[0] = 0;
        }
 
        syslog(LOG_NOTICE, "Client %d/%d/%01d.%02d (%s) from %s\n",
@@ -206,7 +207,7 @@ void cmd_iden(char *argbuf)
                (rev_level / 100),
                (rev_level % 100),
                desc,
-               CC->cs_host
+               CCC->cs_host
        );
        cprintf("%d Ok\n",CIT_OK);
 }