[Mew-dist 10193] Re: imget --src:nntpでの、user/passwdの指定方法はありますか?

SAKAI Kiyotaka ksakai at example.com
1999年 8月 18日 (水) 16:48:53 JST


>> In article <19990428112055U.yashi at example.com>, Yasushi Shoji <yashi at example.com> writes:

> subject通りなのですが、newsを imgetで取り込むときの
> user/passwdの設定方法はありますか?

> im-115を取ってきて imget --helpしてみたのですが
> 見つけられませんでした。

> # Nntp.pmの中の nntp_command()で、user/passwdを扱ってますか?

これをサポートするためのパッチです。
-- 
酒井 清隆 (E-mail: ksakai at example.com)
-------------- next part --------------
Index: Nntp.pm
===================================================================
RCS file: /home/ksakai/cvsroot/im-122/IM/Nntp.pm,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 Nntp.pm
--- Nntp.pm	1999/08/18 05:39:31	1.1.1.1
+++ Nntp.pm	1999/08/18 07:44:34
@@ -364,14 +364,22 @@
     return -1 if ($rc < 0);
     if ($rc > 0) {
 	my ($res) = &command_response();
-	my ($user, $pass) = ('nouser', 'nopass');	# XXX
 	if ($res =~ /^480/) {
+	    require IM::GetPass && import IM::GetPass;
+
+	    print "Username: ";
+	    my $user = <STDIN>;
+	    chomp($user);
+	    my $host = get_cur_server();
+	    my ($pass, $agtfound, $interact)
+		= getpass('nntp', 'PASS', $host, $user);
+
 	    # authenticate for posting
 	    return $rc
 	      if ($rc = &tcp_command(\*NNTPd, "AUTHINFO USER $user", ''));
 	    return $rc
 	      if ($rc = &tcp_command(\*NNTPd, "AUTHINFO PASS $pass",
-		'AUTHINFO PASS ********'));
+		"AUTHINFO PASS " . "*" x length($pass)));
 	    $rc = &tcp_command(\*NNTPd, $cmd, '');
 	    return -1 if ($rc < 0);
 	}


Mew-dist メーリングリストの案内