warning fixes on sparc-sun-solaris2.8 with gcc 3.0.4, mostly for *printf
authorNathan Bryant <loanshark@uncensored.citadel.org>
Mon, 11 Mar 2002 04:16:21 +0000 (04:16 +0000)
committerNathan Bryant <loanshark@uncensored.citadel.org>
Mon, 11 Mar 2002 04:16:21 +0000 (04:16 +0000)
format strings

citadel/ChangeLog
citadel/client_crypto.c
citadel/serv_crypto.c
citadel/serv_network.c
citadel/serv_vandelay.c
citadel/server_main.c
citadel/user_ops.c

index bb92fdac65b814677a725feb1b80bd61930a57ed..42fc5bae36082de32dedfbe8ca4883e19fd24e6b 100644 (file)
@@ -1,4 +1,8 @@
  $Log$
+ Revision 590.136  2002/03/11 04:16:20  nbryant
+ warning fixes on sparc-sun-solaris2.8 with gcc 3.0.4, mostly for *printf
+ format strings
+
  Revision 590.135  2002/03/11 03:55:24  nbryant
   - fixes for building without OpenSSL
   - setenv doesn't exist on all systems, use putenv instead
@@ -3420,3 +3424,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index cede2835a8237b15c858de94ebc79d5ec089b111..94daf2fbfcc0e4ddcc3368d32048d47223eb54d9 100644 (file)
@@ -128,6 +128,11 @@ void ssl_lock(int mode, int n, const char *file, int line)
 }
 #endif /* HAVE_OPENSSL */
 
+#if defined(THREADED_CLIENT) && defined(HAVE_OPENSSL)
+static unsigned long id_callback(void) {
+       return pthread_self();
+}
+#endif
 
 /*
  * starttls() starts SSL/TLS if possible
@@ -200,7 +205,7 @@ int starttls(void)
 #ifdef THREADED_CLIENT
        /* OpenSSL requires callbacks for threaded clients */
        CRYPTO_set_locking_callback(ssl_lock);
-       CRYPTO_set_id_callback(pthread_self);
+       CRYPTO_set_id_callback(id_callback);
 
        /* OpenSSL requires us to do semaphores for threaded clients */
        Critters = malloc(CRYPTO_num_locks() * sizeof (pthread_mutex_t *));
index 317457de81b4e928796d4bc3e572acaba020f26c..05f84dba260c787acd40853a1272255ed64a0c8b 100644 (file)
@@ -1,5 +1,6 @@
 /* $Id$ */
 
+#include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
 #include "sysdep.h"
@@ -40,6 +41,9 @@
 SSL_CTX *ssl_ctx;                              /* SSL context */
 pthread_mutex_t **SSLCritters;                 /* Things needing locking */
 
+static unsigned long id_callback(void) {
+       return pthread_self();
+}
 
 void init_ssl(void)
 {
@@ -93,7 +97,7 @@ void init_ssl(void)
 #endif
 #endif
        CRYPTO_set_locking_callback(ssl_lock);
-       CRYPTO_set_id_callback(pthread_self);
+       CRYPTO_set_id_callback(id_callback);
 
        /* Load DH parameters into the context */
        dh = DH_new();
@@ -300,7 +304,7 @@ void cmd_gtls(char *params)
  */
 void endtls(void)
 {
-       lprintf(7, "Ending SSL/TLS%s\n");
+       lprintf(7, "Ending SSL/TLS\n");
 
        if (!CC->ssl) {
                CC->redirect_ssl = 0;
index 02dc5e2357e5d0d8fe6636cbb304e2e619674333..e8c5256152be100225373debe343d80f0e4bbfb2 100644 (file)
@@ -718,8 +718,8 @@ void network_bounce(struct CtdlMessage *msg, char *reason) {
        if (msg->cm_fields['I'] != NULL) {
                phree(msg->cm_fields['I']);
        }
-       sprintf(buf, "%ld.%04x.%04x@%s",
-               (long)time(NULL), getpid(), ++serialnum, config.c_fqdn);
+       sprintf(buf, "%ld.%04lx.%04x@%s",
+               (long)time(NULL), (long)getpid(), ++serialnum, config.c_fqdn);
        msg->cm_fields['I'] = strdoop(buf);
 
        /*
index fee34851ad877de7f3afab1fef617dfc88bada7a..469612eaf47379727d49ec8085104632f9027fa6 100644 (file)
@@ -53,7 +53,7 @@ FILE *artv_global_message_list;
 void artv_export_users_backend(struct usersupp *usbuf, void *data) {
        cprintf("user\n");
        cprintf("%d\n", usbuf->version);
-       cprintf("%d\n", usbuf->uid);
+       cprintf("%ld\n", (long)usbuf->uid);
        cprintf("%s\n", usbuf->password);
        cprintf("%u\n", usbuf->flags);
        cprintf("%ld\n", usbuf->timescalled);
@@ -256,7 +256,7 @@ void artv_do_export(void) {
        cprintf("%s\n", config.c_fqdn);
        cprintf("%s\n", config.c_humannode);
        cprintf("%s\n", config.c_phonenum);
-       cprintf("%d\n", config.c_bbsuid);
+       cprintf("%ld\n", (long)config.c_bbsuid);
        cprintf("%d\n", config.c_creataide);
        cprintf("%d\n", config.c_sleeping);
        cprintf("%d\n", config.c_initax);
index d5a6a8eba5f27f503931b4be8c4071921d0449a1..bc330df66e4f70c5147ed166f646c7acc38ba3fc 100644 (file)
@@ -195,16 +195,16 @@ int main(int argc, char **argv)
         */
        if (drop_root_perms) {
                if ((pw = getpwuid(BBSUID)) == NULL)
-                       lprintf(1, "WARNING: getpwuid(%d): %s\n"
-                                  "Group IDs will be incorrect.\n", BBSUID,
+                       lprintf(1, "WARNING: getpwuid(%ld): %s\n"
+                                  "Group IDs will be incorrect.\n", (long)BBSUID,
                                strerror(errno));
                else {
                        initgroups(pw->pw_name, pw->pw_gid);
                        if (setgid(pw->pw_gid))
-                               lprintf(3, "setgid(%d): %s\n", pw->pw_gid,
+                               lprintf(3, "setgid(%ld): %s\n", (long)pw->pw_gid,
                                        strerror(errno));
                }
-               lprintf(7, "Changing uid to %d\n", BBSUID);
+               lprintf(7, "Changing uid to %ld\n", (long)BBSUID);
                if (setuid(BBSUID) != 0) {
                        lprintf(3, "setuid() failed: %s\n", strerror(errno));
                }
index cf355cba450dad362e169b5d67445cca6b9b0b9e..836fce4fc512ea6b177eb65c8089e0453b28f949 100644 (file)
@@ -479,13 +479,13 @@ static int validpw(uid_t uid, const char *pass)
 
        if (pipe(pipev)) {
                lprintf(1, "pipe failed (%s): denying autologin access for "
-                       "uid %u\n", strerror(errno), uid);
+                       "uid %ld\n", strerror(errno), (long)uid);
                return 0;
        }
        switch (pid = fork()) {
        case -1:
                lprintf(1, "fork failed (%s): denying autologin access for "
-                       "uid %u\n", strerror(errno), uid);
+                       "uid %ld\n", strerror(errno), (long)uid);
                close(pipev[0]);
                close(pipev[1]);
                return 0;
@@ -512,8 +512,8 @@ static int validpw(uid_t uid, const char *pass)
        while (waitpid(pid, &status, 0) == -1)
                if (errno != EINTR) {
                        lprintf(1, "waitpid failed (%s): denying autologin "
-                               "access for uid %u\n",
-                               strerror(errno), uid);
+                               "access for uid %ld\n",
+                               strerror(errno), (long)uid);
                        return 0;
                }
        if (WIFEXITED(status) && !WEXITSTATUS(status))