[hamradio-commits] [uronode] 01/04: New upstream version 2.7

Dave Hibberd hibby-guest at moszumanska.debian.org
Mon Oct 9 21:56:10 UTC 2017


This is an automated email from the git hooks/post-receive script.

hibby-guest pushed a commit to branch master
in repository uronode.

commit fa52d5a18565982a092210a52709077fdb108447
Author: Hibby <d at vehibberd.com>
Date:   Tue Aug 22 13:54:39 2017 +0100

    New upstream version 2.7
---
 CHANGES.3            | 69 +++++++++++++++++++++++++++++++++++++++++-----------
 Makefile.in          |  3 +++
 command.c            | 29 ++++++++++++++++------
 config.c             |  6 +++--
 config.h.in          |  1 +
 etc/uronode.announce |  2 ++
 gateway.c            | 39 ++++++++++++++++++-----------
 jheard.c             | 23 +++++++++---------
 man/uronode.8        |  5 ++++
 node.c               |  2 +-
 node.h               |  4 +--
 11 files changed, 131 insertions(+), 52 deletions(-)

diff --git a/CHANGES.3 b/CHANGES.3
index 713a302..e380bbf 100644
--- a/CHANGES.3
+++ b/CHANGES.3
@@ -220,20 +220,6 @@ robot scripts such as PBBS mail forwarding sessions. While other systems
 may wish to continue to violate the NetRom protocol (and others) I will
 do everything in my power NOT to.
 
-An anonymous user from sourceforge had a compiler warning on the
-do_prompt cycle in config.c and provided a fix for it. I don't know if
-the user is even a ham but their alias is dcb314, and we thank them. Their
-report and fix which is included:
-config.c:407:35: warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op]
-Source code is
-if ((User.ul_type != AF_NETROM) || (User.ul_type != AF_INET) || 
-(User.ul_type != AF_INET6)) {
-Maybe better code
-if ((User.ul_type != AF_NETROM) && (User.ul_type != AF_INET) && 
-(User.ul_type != AF_INET6)) {
-While I don't get the warning he had, the logistics seem to be fine. Thanks
-again to dcb314 at sourceforge for their report.
-
 I have made a diff file for JNOS2.0K that makes it a bit more user 
 compatible with URONode, and other linux-based nodes. For almost 30 years
 TCP port 3694 has been used for inbound telnet for linux-based nodes, and
@@ -257,6 +243,61 @@ yes, a sysop could require a password on an ax25/NetRom/Rose interface which
 would be exposed. Now, if a sysop mistakenly tries to force a password
 on RF, it will be ignored by the node so it's not exposed.
 
+25/05/2017 - v2.7
+
+Added an "A"nnouncements command. Sysops can use this to give users a chance
+to read any announcements you and/or your club may have. I figured that I 
+would segment this from the "I"nformation command since a lot of guys tend
+to post their system specs in the uronode.info file. If a user is seeking any
+news or announcements they won't have to sort through the other information
+contained within the system.info file and vice versa. A new file called
+uronode.announce now needs to be with your other uronode.* files.
+
+Added a trying state display for telnet where before there was none. Actually
+there was a whole bunch of info but I had it commented out. This I did after
+a recent user poll was in support of such and other "trying" state messages.
+Such messages are still filtered for netrom connects.
+
+Removed uronode.service file from the systemd group. Only uronode.socket and
+uronode at service needs to be placed and engaged. This was discovered by SP2L 
+on his systems and I verified this on my Fedora test system (which is systemd).
+Thanks to Tomasz for finding this and pointing it out to me. Without the
+uronode at .service file, the uronode.socket file won't properly engage upon
+a connection request via IP. Without uronode at .service your systemd will
+report an error in loading the uronode.socket file:
+root at vbfc25:~# systemctl status uronode.socket
+● uronode.socket - URONode Server Activation Socket
+   Loaded: loaded (/usr/lib/systemd/system/uronode.socket; enabled; vendor preset:
+   Active: failed (Result: resources) since Sat 2016-12-31 11:30:54 CET; 45s ago
+   Listen: 0.0.0.0:3694 (Stream)
+   Accepted: 4; Connected: 0
+
+   Dec 31 12:18:11 vbfc25 systemd[1]: Listening on URONode Server Activation Socket.
+   Dec 31 11:30:54 vbfc25 systemd[1]: uronode.socket: Failed to queue service startup
+   Dec 31 11:30:54 vbfc25 systemd[1]: uronode.socket: Unit entered failed state.
+   lines 1-9/9 (END)
+
+Fixed a bug in JHeard and JLong in regards to flagging an interface that
+has existed I'll guess since the beginning of time. This bug was found and
+reported to me by Han PE1FAM. I was considering removing this feature
+however I can understand it's usage in the way Han is using it. In the way
+I have it now, the "Hidden" interface now will lock an end user from trying
+to attempt connects out an interface a sysop doesn't want users connecting
+out from such as an APRS interface. The interface in an "int' will not be
+displayed as to be a subtle message that the interface is not usable, however
+it will be displayed in a NetRom "Routes" list and in J/JL request. 
+If an attempt to connect out a "hidden port" is made the user is shown an error:
+n1uro-15 at n1uro.ampr.org:/uronode$ c ax1 foo
+Not a user interface.
+The reason I did this was so that you may see propagation in a heard list
+in the event of ducting for some VHF/UHF "dx"ing so to speak.
+**Note: do NOT flag a L4 protocol interface such as a NetRom interface
+as a locked interface or the node will not deliberately load.
+Thanks to Han for reporting this.
+
+While working on new node W1WCG, I noticed some code clean up in node.c
+There's still a lot more to do especially with ANSI.
+
 ----------- Note on SystemD --------
 In uronode.socket, you'll notice the line:
 ListenStream=0.0.0.0:3694
diff --git a/Makefile.in b/Makefile.in
index 768058c..a549299 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -48,6 +48,7 @@ installhelp:
 
 installconf: installhelp
 	install -b -m 755    -D -d		 $(ETC_DIR)
+	install -b -m 600    -p etc/uronode.announce  $(ETC_DIR)
 	install -b -m 600    -p etc/uronode.conf  $(ETC_DIR)
 	install -b -m 600    -p etc/uronode.perms $(ETC_DIR)
 	install -b -m 600    -p etc/uronode.info  $(ETC_DIR)
@@ -68,11 +69,13 @@ installman:
 	install -m 644	  -p man/flexd.8	 $(MAN_DIR)/man8
 
 upgrade: installman installhelp
+	install -b -m 600    -p etc/uronode.announce  $(ETC_DIR)
 	install -m 755 -p uronode       $(SBIN_DIR)
 	install -m 755 -p nodeusers     $(SBIN_DIR)
 	install -m 755 -p calibrate	$(SBIN_DIR)
 @IN@	install -m 755 -p flexd		$(SBIN_DIR)
 	install -m 755 -p axdigi	$(SBIN_DIR)
+
  
 clean:
 	rm -f *.o *~ *.bak *.orig make.debug nodeusers uronode flexd axdigi calibrate
diff --git a/command.c b/command.c
index d8778b6..572e338 100644
--- a/command.c
+++ b/command.c
@@ -30,6 +30,7 @@ struct cmd *Nodecmds = NULL;
 void init_nodecmds(void)
 {
   add_internal_cmd(&Nodecmds, "?",        1, do_help);
+  add_internal_cmd(&Nodecmds, "Announce", 1, do_help);
   add_internal_cmd(&Nodecmds, "Bye",      1, do_bye);
   add_internal_cmd(&Nodecmds, "Escape",   1, do_escape);
   if (User.ul_type == AF_INET) {
@@ -125,9 +126,9 @@ void node_logout(char *reason)
       if (check_perms(PERM_ANSI, 0L) != -1) {
       axio_printf(NodeIo, "\e[03;36m");
     }   
-    axio_printf(NodeIo, "%s, thank you for connecting to the %s\nURONode ROSE network node. Come back again soon, 73!\r ", User.call, RoseId);
+    axio_printf(NodeIo, "%s, thank you for connecting to the %s\nURONode ROSE network node. Come back again soon, 73!\n", User.call, RoseId);
     if (check_perms(PERM_ANSI, 0L) != -1) {
-      axio_printf(NodeIo, "\e[0;m\b");
+      axio_printf(NodeIo, "\e[0;m");
     }
   } else 
   if ((User.ul_type == AF_FLEXNET) || (User.ul_type == AF_AX25)) {
@@ -136,7 +137,7 @@ void node_logout(char *reason)
     } 
     axio_printf(NodeIo, "%s de %s\n73! ", User.call, FlexId);
     if (check_perms(PERM_ANSI, 0L) != -1) {
-      axio_printf(NodeIo, "\e[0;m\b");
+      axio_printf(NodeIo, "\e[0;m");
     }
   }
 #endif
@@ -242,18 +243,28 @@ int do_help(int argc, char **argv)
   }
   if (*argv[0] == 'i') {                          /* "info"       */
     strcpy(fname, CONF_NODE_INFO_FILE);
+    } else if (*argv[0] == 'a') {		/* announcements */
+    strcpy(fname, CONF_NODE_ANN_FILE);
+
     if (User.ul_type == AF_NETROM) {
 
-      axio_printf(NodeIo,"%s} ", NodeId);
+//      axio_printf(NodeIo,"%s} ", NodeId);
     }
     if (check_perms(PERM_ANSI, 0L) != -1) {
       axio_printf(NodeIo, "\e[01;37m");
     }
+    if (*argv[0] == 'i') {
+//    axio_printf(NodeIo,"%s - %s \n", VERSION, COMPILING);
     axio_printf(NodeIo,"System Information:\n");
+    } else if (*argv[0] == 'a') {
+//    axio_printf(NodeIo,"%s - %s \n", VERSION, COMPILING);
+//    axio_printf(NodeIo,"System Announcements/News:\n");
+    axio_printf(NodeIo,"    NEWS & ANNOUNCEMENTS   NEWS & ANNOUNCEMENTS   NEWS & ANNOUNCEMENTS\n");
+    axio_printf(NodeIo,"    --------------------   --------------------   --------------------\n");
+    }
     if (check_perms(PERM_ANSI, 0L) != -1) {
       axio_printf(NodeIo, "\e[0;m");
     }
-    axio_printf(NodeIo,"%s - %s \n", VERSION, COMPILING);
   } else if (!argv[1]) {                 /* "help"       */
     strcpy(fname, DATA_NODE_HELP_DIR "help.hlp");
   } else {                               /* "help <cmd>" */
@@ -262,7 +273,7 @@ int do_help(int argc, char **argv)
     fname[sizeof(fname) - 1] = 0;
   }
   if ((fp = fopen(fname, "r")) == NULL) {
-    if (*argv[0] != 'i')
+    if ((*argv[0] != 'a') || (*argv[0] != 'i'))
       if (User.ul_type == AF_NETROM) {
 	axio_printf(NodeIo,"%s} ", NodeId);
       }
@@ -273,9 +284,11 @@ int do_help(int argc, char **argv)
     return 0;
   }
   if (User.ul_type == AF_NETROM) {
-    axio_printf(NodeIo,"%s} ", NodeId);
+//    axio_printf(NodeIo,"%s} ", NodeId);
   }
-  if (*argv[0] != 'i')
+  if ((*argv[0] != 'a') || (*argv[0] != 'i')) 
+    axio_printf(NodeIo,"");
+    else
     node_msg("Help for command %s", argv[1] ? argv[1] : "help"); 
   while (fgets(line, 256, fp) != NULL)
     axio_puts(line,NodeIo);
diff --git a/config.c b/config.c
index dde3208..a7dd78f 100644
--- a/config.c
+++ b/config.c
@@ -40,7 +40,8 @@ static char *HiddenPorts[32]		= {0};
 
 /*
  * Return non-zero if `port' is a hidden port.
- */
+*/ 
+
 int is_hidden(const char *port)
 {
   int i;
@@ -54,6 +55,7 @@ int is_hidden(const char *port)
 /*
  * Return non-zero if peer is on "local" or loopback network.
  */
+
 static int is_local(unsigned long peer)
 {
   return ((peer & LocalMask) == LocalNet) || ((peer & 0xff) == 127);
@@ -404,7 +406,7 @@ static int do_roseid(int argc, char **argv)
 
 static int do_prompt(int argc, char **argv)
 {
-  if ((User.ul_type != AF_NETROM) && (User.ul_type != AF_INET) && (User.ul_type != AF_INET6)) {
+  if ((User.ul_type != AF_NETROM) || (User.ul_type != AF_INET) || (User.ul_type != AF_INET6)) {
     if (argc < 2) {
       return -1;
       Prompt = strdup(argv[1]);
diff --git a/config.h.in b/config.h.in
index 6f8845d..5d488af 100644
--- a/config.h.in
+++ b/config.h.in
@@ -21,6 +21,7 @@
 #define	CONF_NODE_PERMS_FILE	"@ETC_DIR@/uronode.perms"
 @HAVEMOTD@		@MOTDPATH@
 #define	CONF_NODE_INFO_FILE	"@ETC_DIR@/uronode.info"
+#define CONF_NODE_ANN_FILE	"@ETC_DIR@/uronode.announce"
 #define AX_ROUTES_FILE          "@ETC_DIR@/uronode.routes"
 #define CONF_USERS_FILE         "@ETC_DIR@/uronode.users"
 #define FLEXD_CONF_FILE         "@ETC_DIR@/flexd.conf"
diff --git a/etc/uronode.announce b/etc/uronode.announce
new file mode 100644
index 0000000..719a43f
--- /dev/null
+++ b/etc/uronode.announce
@@ -0,0 +1,2 @@
+Place your news/announcements in here. Good place for announcing 
+club meetings, club announcements, area flea markets, etc.
diff --git a/gateway.c b/gateway.c
index e035c07..06c3383 100644
--- a/gateway.c
+++ b/gateway.c
@@ -24,6 +24,7 @@
 #include <netax25/rsconfig.h>
 #include <netax25/procutils.h>
 
+#include "sysinfo.h"
 #include "procinfo.h"
 #include "node.h"
 
@@ -138,9 +139,10 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
     /* Uncomment the below if you wish to have the node show a 'Trying' state */
 	if (check_perms(PERM_ANSI, 0L) != -1) {
           axio_printf(NodeIo, "\e[01;35m");
-	}
-        axio_printf(NodeIo,"Trying %s... press <Enter> to abort", User.dl_name); 
-	
+	} 
+        if (User.ul_type != AF_NETROM) {
+        axio_printf(NodeIo,"Trying %s... <Enter> aborts. ", User.dl_name); 
+	  }
     break;
 #endif		
 #ifdef HAVE_NETROM
@@ -189,8 +191,8 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
     if (check_perms(PERM_ANSI, 0L) != -1) {
       if (User.ul_type == AF_NETROM) {
 	break;
-      }
-      node_msg("\e[01;36mTrying %s... hit <Enter> to abort", User.dl_name);
+      } if (User.ul_type != AF_NETROM) {
+      node_msg("\e[01;36mTrying %s... <Enter> aborts. ", User.dl_name);
     }
     break;
 #endif
@@ -199,7 +201,7 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
   case AF_AX25:
     if (aliascmd==0) {    
       if (check_perms(PERM_AX25, 0L) == -1 || (is_hidden(addr[0]) && check_perms(PERM_HIDDEN, 0L) == -1)) {
-	axio_printf(NodeIo,"Permission denied");
+	axio_printf(NodeIo,"Not a user interface.");
 	if (User.ul_type == AF_NETROM) {
 	  node_msg("");
 	}
@@ -328,13 +330,19 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
 	return NULL;
       }
     }
-    /*    if ((check_perms(PERM_ANSI, 0L) != -1) && (family == AF_NETROM)) {
-	  axio_printf(NodeIo,"\e[01;36m%s Trying %s... Type <RETURN> to abort. (Escape: %s%c) \n",NodeId,
-	  User.dl_name,
-	  escape < 32 ? "CTRL-" : "",
-	  escape < 32 ? (escape + 'A' - 1) : escape);
+         if (check_perms(PERM_ANSI, 0L) != -1) {
+		axio_printf(NodeIo,"\e[01;36m");
+		} 
+	if (User.ul_type != AF_NETROM) {
+ 	  axio_printf(NodeIo,"Trying %s:%s... <Enter> aborts. ", User.dl_name, User.dl_port);
+//	  escape < 32 ? "CTRL-" : "",
+//	  escape < 32 ? (escape + 'A' - 1) : escape);
 	  axio_flush(NodeIo);
-	  } */
+	      }
+	 } 
+	         if (check_perms(PERM_ANSI, 0L) != -1) {
+                axio_printf(NodeIo,"\e[0m");
+                }
     break;
   default:
     if (User.ul_type == AF_NETROM) {
@@ -448,8 +456,11 @@ static ax25io *connect_to(char **addr, int family, int escape, int compr)
     }
     if (check_perms(PERM_ANSI, 0L) != -1) {
       axio_printf(NodeIo,"\e[01;32m");
-    }
-    node_msg("Socket established to %s:%s", User.dl_name, User.dl_port);
+    } if (User.ul_type != AF_NETROM) {
+    node_msg("\nSocket established to %s:%s", User.dl_name, User.dl_port);
+        }  else { 
+	node_msg("Socket established to %s:%s", User.dl_name, User.dl_port);
+      }
     if (check_perms(PERM_ANSI, 0L) != -1) {
       axio_printf(NodeIo,"\e[0;m");
     }
diff --git a/jheard.c b/jheard.c
index 9ab5b89..04507b3 100644
--- a/jheard.c
+++ b/jheard.c
@@ -36,9 +36,10 @@ int do_jheard (int argc,char **argv) {
     axio_printf(NodeIo,"%s} ",NodeId);
 
   if(argc > 0) {
-    if(ax25_config_get_dev(argv[1]) == NULL
-       || (check_perms(PERM_HIDDEN, 0) == -1
-	   && is_hidden(argv[1]))) {
+    if(ax25_config_get_dev(argv[1]) == NULL)
+//       || (check_perms(PERM_HIDDEN, 0) == -1
+//	   && is_hidden(argv[1]))) {
+	{
       axio_printf(NodeIo,"Invalid interface: %s", argv[1]);
 
       if(User.ul_type == AF_NETROM)
@@ -57,8 +58,8 @@ int do_jheard (int argc,char **argv) {
       if(strcmp(argv[1],mh.portname))
 	continue;
     }
-    if(check_perms(PERM_HIDDEN,0) == -1 && is_hidden(mh.portname))
-      continue;
+//    if(check_perms(PERM_HIDDEN,0) == -1 && is_hidden(mh.portname))
+//      continue;
 
     if((new = calloc(1,sizeof(struct mheard_list))) == NULL) {
       node_perror("do_mheard: calloc",errno);
@@ -163,11 +164,11 @@ int do_jlong (int argc,char **argv) {
     axio_printf(NodeIo,"%s} ",NodeId);
 
   if(argc > 0) {
-    if(ax25_config_get_dev(argv[1]) == NULL
-       || (check_perms(PERM_HIDDEN, 0) == -1
-           && is_hidden(argv[1]))) {
+    if(ax25_config_get_dev(argv[1]) == NULL )
+//       || (check_perms(PERM_HIDDEN, 0) == -1
+//           && is_hidden(argv[1]))) 
+	{
       axio_printf(NodeIo,"Invalid interface: %s", argv[1]);
-
       if(User.ul_type == AF_NETROM)
         node_msg("");
 
@@ -184,8 +185,8 @@ int do_jlong (int argc,char **argv) {
       if(strcmp(argv[1],mh.portname))
         continue;
     }
-    if(check_perms(PERM_HIDDEN,0) == -1 && is_hidden(mh.portname))
-      continue;
+//    if(check_perms(PERM_HIDDEN,0) == -1 && is_hidden(mh.portname))
+//      continue;
 
     if((new = calloc(1,sizeof(struct mheard_list))) == NULL) {
       node_perror("do_mheard: calloc",errno);
diff --git a/man/uronode.8 b/man/uronode.8
index 099459f..d7176aa 100644
--- a/man/uronode.8
+++ b/man/uronode.8
@@ -15,6 +15,11 @@ The following commands are supported for users of
 .BI ?
 Give short list of available commands.
 .TP 13
+.BI Announce
+Reads the file uronode.announce. This is like a local announcement wall
+where you can give your locals connecting into your node a chance to see
+the local activities going on like a cork board with posted announcements.
+.TP 13
 .BI Bye
 Disconnect user from the node.
 .TP 13
diff --git a/node.c b/node.c
index 45fba2c..7ac8d50 100644
--- a/node.c
+++ b/node.c
@@ -402,7 +402,7 @@ int main(int argc, char *argv[])
 	}
 	else 	{
 	  if (User.ul_type == AF_NETROM) {
-	    node_msg("%s Too many invalid commands. Disconnecting...", NodeId);
+	    node_msg("%s} Too many invalid commands. Disconnecting...", NodeId);
 	    node_logout("Too many invalid commands");
 	  } else {
 	    node_msg("Too many invalid commands, disconnecting you...");
diff --git a/node.h b/node.h
index d2c73eb..57850a4 100644
--- a/node.h
+++ b/node.h
@@ -1,5 +1,5 @@
-#define VERSION                "URONode v2.6"
-#define COMPILING	       "November 25, 2016"
+#define VERSION                "URONode v2.7"
+#define COMPILING	       "June 1, 2017"
 
 #define STATE_IDLE	0
 #define STATE_TRYING	1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/uronode.git



More information about the pkg-hamradio-commits mailing list