git: 9front

Download patch

ref: f7ef9fd676fc360ca8f606ec234b416be37b0e7f
parent: 5ff1ec275223dc782ec8be5d219d7d3c7f53c2a9
author: noodle <noodle@pastanoggin.com>
date: Sat Nov 29 22:42:55 EST 2025

ircrc: enable TLS by default and use factotum for server password

Make TLS and port 6697 the default, change -T to no-op, and add -u as a flag for disabling TLS. Remove -P and instead get the server password via factotum with server=ircsrv.

--- a/rc/bin/ircrc
+++ b/rc/bin/ircrc
@@ -3,13 +3,13 @@
 rfork ne
 
 server=irc.oftc.net
-port=6667
+port=6697
 realname='<nil>'
 target=''
 netdir=()
 nick=$user
 pass=()
-tls=0
+tls=1
 serverpass=()
 
 fn sighup {
@@ -31,12 +31,12 @@
 }
 
 fn work {
-        if(~ $#serverpass 1)
-                echo PASS $serverpass
+	if(~ $#serverpass 1)
+		echo PASS $serverpass
 	echo USER $user foo bar :$realname
 	echo NICK $nick
 	if (~ $#pass 1)
-		echo PRIVMSG 'nickserv :'identify $"pass
+		echo PRIVMSG NickServ :IDENTIFY $pass
 	if(! ~ $target ''){
 		title
 		echo JOIN $target
@@ -202,9 +202,6 @@
 	case -p
 		port=$2
 		shift
-        case -P
-                serverpass=$2
-                shift
 	case -r
 		realname=$2
 		shift
@@ -212,9 +209,10 @@
 		target=$2
 		shift
 	case -T
-		tls=1
+	case -u
+		tls=0
 	case -*
-		echo 'usage: ircrc  [-p port] [-P server password] [-r realname] [-t target] [-n nick] [-T] [server]' >[1=2]
+		echo 'usage: ircrc  [-p port] [-r realname] [-t target] [-n nick] [-u] [server]' >[1=2]
 		exit 'usage'	
 	}
 	shift
@@ -232,11 +230,12 @@
 }
 
 title
-userpass=`{auth/userpasswd 'server='^$server^' service=irc user='^$nick >[2]/dev/null}
-if(~ $#userpass 2) {
-	nick=$userpass(1)
+userpass=`{auth/userpasswd -n 'server='^$server^' service=irc user='^$nick >[2]/dev/null}
+if(~ $#userpass 2)
 	pass=$userpass(2)
-}
+userpass=`{auth/userpasswd -n 'server='^$server^' service=ircsrv user='^$nick >[2]/dev/null}
+if(~ $#userpass 2)
+	serverpass=$userpass(2)
 
 p='/n/ircrc'
 bind '#|' $p
--- a/sys/man/1/ircrc
+++ b/sys/man/1/ircrc
@@ -8,10 +8,6 @@
 .I port
 ]
 [
-.B -P
-.I server password
-]
-[
 .B -r
 .I realname
 ]
@@ -24,7 +20,7 @@
 .I nick
 ]
 [
-.B -T
+.B -u
 ] [
 .I server
 ]
@@ -34,7 +30,9 @@
 Messages are sent from standard input and
 received from standard output.
 The default server is
-.BR irc.oftc.net .
+.BR irc.oftc.net ,
+and tls is used by default through
+.IR tlssrv (8).
 The arguments
 .B bitlbee
 and
@@ -44,15 +42,24 @@
 and
 .BR irc.oftc.net ,
 respectively.
+.PP
+The NickServ and server passwords are read if
+available via the authentication agent
+.IR factotum (4)
+and are searched for using the following keyspecs,
+respectively:
+.IP
+.EX
+proto=pass server=$server service=irc user=$nick
+proto=pass server=$server service=ircsrv user=$nick
+.EE
+.PP
 The options are:
 .TP
 .BI -p " port
 Change the default port
-.RB ( 6667 ).
+.RB ( 6697 ).
 .TP
-.BI -P " server password
-Specify a password for the remote server.
-.TP
 .BI -r " realname
 Change the default name
 .RB ( <nil> ).
@@ -70,10 +77,9 @@
 Change the default nickname
 .RB ( $user ).
 .TP
-.BI -T
+.BI -u
 .br
-Use tls through
-.IR tlssrv (8).
+Disable tls.
 .SS Commands
 .I Ircrc
 commands begin with a slash.
@@ -177,6 +183,8 @@
 .SH SOURCE
 .B /rc/bin/ircrc
 .SH SEE ALSO
+.IR factotum (4)
+.br
 .B http://tools.ietf.org/html/rfc1459
 .br
 .B http://tools.ietf.org/html/rfc2812
--