OSSP CVS Repository

ossp - Difference in ossp-pkg/lmtp2nntp/lmtp2nntp_config.c versions 1.72 and 1.73
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/lmtp2nntp/lmtp2nntp_config.c 1.72 -> 1.73

--- lmtp2nntp_config.c   2002/04/18 15:38:59     1.72
+++ lmtp2nntp_config.c   2002/05/27 15:09:50     1.73
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/stat.h>
+#include <sys/utsname.h>
 #include <errno.h>
 #include <pwd.h>
 
@@ -733,11 +734,16 @@
         logbook(ctx->l2, L2_LEVEL_TRACE, "--nodename = \"%s\"", ov->data.s);
 
         if (ov->ndata == 1) {
-            if (strlen(ov->data.s) > sizeof(ctx->uname.nodename)-1) {
-                logbook(ctx->l2, L2_LEVEL_ERROR, "option --nodename, name (%s) too long", ov->data.s);
+            ctx->option_nodename = strdupex(ov->data.s);
+        }
+        else {
+            struct utsname name;
+
+            if (uname(&name) == -1) {
+                logbook(ctx->l2, L2_LEVEL_ERROR, "option --nodename, uname() failed %m");
                 throw(0,0,0);
             }
-            strcpy(ctx->uname.nodename, ov->data.s);
+            ctx->option_nodename = strdupex(name.nodename);
         }
     }
     catch (ex)
@@ -1106,7 +1112,8 @@
                     msg_rc_t rc;
 
                     try {
-                        if ((msg = msg_create()) == NULL) throw(0, 0, "msg_create");
+                        ctx->msgcount++;
+                        if ((msg = msg_create(ctx->prival)) == NULL) throw(0, 0, "msg_create");
                         msg->l2 = ctx->l2;
                         msg->cpMsg = cpBuf;
                         if ((rc = msg_split((msg_t *)msg)) != MSG_OK) {

CVSTrac 2.0.1