[w3m-dev 03639] Re: smb.cgi
* Bonus/2ch.cgi: change password handling * Bonus/README: update * Bonus/README.eng: ditto
This commit is contained in:
11
Bonus/README
11
Bonus/README
@@ -15,9 +15,14 @@ smb.cgi
|
|||||||
SMB <20>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> local CGI <20>Ǥ<EFBFBD><C7A4><EFBFBD>
|
SMB <20>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> local CGI <20>Ǥ<EFBFBD><C7A4><EFBFBD>
|
||||||
nmblookup,smbclient <20><><EFBFBD>Ȥ<EFBFBD><C8A4>Τ<EFBFBD> sabma <20><><EFBFBD><EFBFBD><EFBFBD>ȡ<F3A5B9A5><C8A1>뤵<EFBFBD><EBA4B5><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD>
|
nmblookup,smbclient <20><><EFBFBD>Ȥ<EFBFBD><C8A4>Τ<EFBFBD> sabma <20><><EFBFBD><EFBFBD><EFBFBD>ȡ<F3A5B9A5><C8A1>뤵<EFBFBD><EBA4B5><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD>
|
||||||
ɬ<>פ<EFBFBD><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
ɬ<>פ<EFBFBD><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
||||||
<20>ѥ<EFBFBD><D1A5><EFBFBD>ɤϡ<C9A4>smbclient <20><> -A <20><><EFBFBD>ץ<EFBFBD><D7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>ʤ顢
|
<20>ѥ<EFBFBD><D1A5><EFBFBD>ɤϡ<C9A4>
|
||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:/cgi-bin/2ch.cgi?http://pc.2ch.net/test/read.cgi/unix/1035755937/
|
||||||
|
|
||||||
it uses wget -c
|
It uses wget -c.
|
||||||
dat is recorded under ~/w3m2ch/
|
`dat' files are recorded under ~/w3m2ch/.
|
||||||
You can post
|
You can not post.
|
||||||
|
|
||||||
smb.cgi
|
smb.cgi
|
||||||
|
|
||||||
[w3m-dev 03634] smb.cgi
|
[w3m-dev 03634] smb.cgi
|
||||||
localcgi to access SMB.
|
localcgi to access SMB.
|
||||||
Since it uses nmblookup, smbclient, you should install samba.
|
Since it uses nmblookup, smbclient, you should install samba.
|
||||||
Password can be configured in ~/.w3m/smb:
|
Password can be passed to smbclient:
|
||||||
when -A option available smbclient -A ~/.w3m/smb
|
1) When the password is set by contents of ~/.w3m/smb and
|
||||||
otherwise, environment variable PASSWD
|
-A option available, `smbclient -A ~/.w3m/smb' is used.
|
||||||
that is set by contents of ~/.w3m/smb
|
2) When the environment variable PASSWD_FILE, it is used.
|
||||||
|
3) When the password is set by contents of ~/.w3m/smb,
|
||||||
|
the password is passed via standrad I/O using
|
||||||
|
the environment variable PASSWD_FD.
|
||||||
|
|
||||||
google.cgi
|
google.cgi
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,17 @@
|
|||||||
#
|
#
|
||||||
# ----- ~/.w3m/smb -----
|
# ----- ~/.w3m/smb -----
|
||||||
# workgroup = <workgroup>
|
# workgroup = <workgroup>
|
||||||
# username = <username>
|
# [ username = <username> ]
|
||||||
# password = <password>
|
# [ password = <password> ]
|
||||||
|
# [ password_file = <password_file> ]
|
||||||
# ----------------------
|
# ----------------------
|
||||||
|
# --- <password_file> ---
|
||||||
|
# <password>
|
||||||
|
# -----------------------
|
||||||
|
# default:
|
||||||
|
# <username> = $USER
|
||||||
|
# <password> = $PASSWD (Don't use!)
|
||||||
|
# <password_file> = $PASSWD_FILE
|
||||||
|
|
||||||
$DEBUG = 1;
|
$DEBUG = 1;
|
||||||
|
|
||||||
@@ -22,18 +30,35 @@ $AUTH_FILE =~ s@^~/@$ENV{"HOME"}/@;
|
|||||||
$WORKGROUP = "-";
|
$WORKGROUP = "-";
|
||||||
$USER = $ENV{"USER"};
|
$USER = $ENV{"USER"};
|
||||||
$PASSWD = $ENV{"PASSWD"};
|
$PASSWD = $ENV{"PASSWD"};
|
||||||
|
$PASSWD_FILE = $ENV{"PASSWD_FILE"};
|
||||||
&load_auth_file($AUTH_FILE);
|
&load_auth_file($AUTH_FILE);
|
||||||
|
|
||||||
$NMBLOOKUP = "nmblookup";
|
$NMBLOOKUP = "nmblookup";
|
||||||
$SMBCLIENT = "smbclient";
|
$SMBCLIENT = "smbclient";
|
||||||
@NMBLOOKUP_OPT = ("-T");
|
@NMBLOOKUP_OPT = ("-T");
|
||||||
@SMBCLIENT_OPT = ("-N");
|
@SMBCLIENT_OPT = ("-N");
|
||||||
$USE_OPT_A = &check_opt_a();
|
$USE_OPT_A = defined($PASSWD) && (-f $AUTH_FILE) && &check_opt_a();
|
||||||
if ($USE_OPT_A) {
|
if ($USE_OPT_A) {
|
||||||
undef $USER;
|
|
||||||
undef $PASSWD;
|
|
||||||
push(@SMBCLIENT_OPT, "-A", $AUTH_FILE);
|
push(@SMBCLIENT_OPT, "-A", $AUTH_FILE);
|
||||||
|
} elsif (-f $PASSWD_FILE) {
|
||||||
|
$USE_PASSWD_FILE = 1;
|
||||||
|
} elsif (defined($PASSWD)) {
|
||||||
|
$USE_PASSWD_FD = 1;
|
||||||
|
$PASSWD_FD = 0;
|
||||||
}
|
}
|
||||||
|
if (defined($PASSWD)) {
|
||||||
|
$passwd = "*" x 8;
|
||||||
|
}
|
||||||
|
$DEBUG && print <<EOF;
|
||||||
|
DEBUG: NMBLOOKUP=$NMBLOOKUP @NMBLOOKUP_OPT
|
||||||
|
DEBUG: SMBCLIENT=$SMBCLIENT @SMBCLIENT_OPT
|
||||||
|
DEBUG: WORKGROUP=$WORKGROUP
|
||||||
|
DEBUG: USER=$USER
|
||||||
|
DEBUG: PASSWD=$passwd
|
||||||
|
DEBUG: PASSWD_FILE=$PASSWD_FILE
|
||||||
|
DEBUG: PASSWD_FD=$PASSWD_FD
|
||||||
|
EOF
|
||||||
|
|
||||||
$PAGER = "cat";
|
$PAGER = "cat";
|
||||||
$FILE = "F000";
|
$FILE = "F000";
|
||||||
|
|
||||||
@@ -44,6 +69,10 @@ $_ = &file_decode($QUERY);
|
|||||||
$DEBUG && print "DEBUG: QUERY_STRING=\"$_\"\n";
|
$DEBUG && print "DEBUG: QUERY_STRING=\"$_\"\n";
|
||||||
if (s@^//([^/]+)@@) {
|
if (s@^//([^/]+)@@) {
|
||||||
$server = $1;
|
$server = $1;
|
||||||
|
# if (!$USE_OPT_A && !defined($PASSWD)) {
|
||||||
|
# &print_form("//$server$_");
|
||||||
|
# exit;
|
||||||
|
# }
|
||||||
if (s@^/([^/]+)@@) {
|
if (s@^/([^/]+)@@) {
|
||||||
&file_list("//$server/$1", &cleanup($_));
|
&file_list("//$server/$1", &cleanup($_));
|
||||||
} else {
|
} else {
|
||||||
@@ -250,9 +279,11 @@ sub get_list {
|
|||||||
@cmd = ($SMBCLIENT, @SMBCLIENT_OPT, "-L", $server);
|
@cmd = ($SMBCLIENT, @SMBCLIENT_OPT, "-L", $server);
|
||||||
$F = &open_pipe($passwd, @cmd);
|
$F = &open_pipe($passwd, @cmd);
|
||||||
while (<$F>) {
|
while (<$F>) {
|
||||||
/^\s*$header/ && last;
|
if (/^\s*$header/) {
|
||||||
}
|
|
||||||
$DEBUG && print "DEBUG: $_";
|
$DEBUG && print "DEBUG: $_";
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
}
|
||||||
while (<$F>) {
|
while (<$F>) {
|
||||||
/^\s*$/ && last;
|
/^\s*$/ && last;
|
||||||
$DEBUG && print "DEBUG: $_";
|
$DEBUG && print "DEBUG: $_";
|
||||||
@@ -277,9 +308,18 @@ sub exec_cmd {
|
|||||||
local($passwd, @cmd) = @_;
|
local($passwd, @cmd) = @_;
|
||||||
|
|
||||||
$ENV{"LC_ALL"} = "C";
|
$ENV{"LC_ALL"} = "C";
|
||||||
if (!$USE_OPT_A && $passwd) {
|
$ENV{"USER"} = $USER;
|
||||||
$ENV{"USER"} = $USER if $USER;
|
if ($passwd && !$USE_OPT_A) {
|
||||||
$ENV{"PASSWD"} = $PASSWD if $PASSWD;
|
if ($USE_PASSWD_FILE) {
|
||||||
|
$ENV{"PASSWD_FILE"} = $PASSWD_FILE;
|
||||||
|
} elsif ($USE_PASSWD_FD) {
|
||||||
|
$ENV{"PASSWD_FD"} = $PASSWD_FD;
|
||||||
|
if (open(W, "|-")) {
|
||||||
|
print W $PASSWD;
|
||||||
|
close(W);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
open(STDERR, ">/dev/null");
|
open(STDERR, ">/dev/null");
|
||||||
exec @cmd;
|
exec @cmd;
|
||||||
@@ -287,8 +327,15 @@ sub exec_cmd {
|
|||||||
}
|
}
|
||||||
|
|
||||||
sub print_form {
|
sub print_form {
|
||||||
|
local($_) = @_;
|
||||||
|
local($q) = &html_quote($_);
|
||||||
|
$_ = &file_encode($_);
|
||||||
|
|
||||||
print <<EOF;
|
print <<EOF;
|
||||||
<form action="$CGI" method=POST>
|
Content-Type: text/html
|
||||||
|
|
||||||
|
<h1>$q</h1>
|
||||||
|
<form action="$CGI?$_" method=POST>
|
||||||
<table>
|
<table>
|
||||||
<tr><td>Workgroup <td>User <td>Password
|
<tr><td>Workgroup <td>User <td>Password
|
||||||
<tr><td><input type=text size=8 name=group value="$WORKGROUP">
|
<tr><td><input type=text size=8 name=group value="$WORKGROUP">
|
||||||
@@ -315,6 +362,8 @@ sub load_auth_file {
|
|||||||
$USER = $_;
|
$USER = $_;
|
||||||
} elsif (s/^passw(or)?d\s*=\s*//i) {
|
} elsif (s/^passw(or)?d\s*=\s*//i) {
|
||||||
$PASSWD = $_;
|
$PASSWD = $_;
|
||||||
|
} elsif (s/^passw(or)?d_file\s*=\s*//i) {
|
||||||
|
$PASSWD_FILE = $_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
close(F);
|
close(F);
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
2003-01-16 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
|
||||||
|
|
||||||
|
* [w3m-dev 03639] Re: smb.cgi
|
||||||
|
* Bonus/2ch.cgi: change password handling
|
||||||
|
* Bonus/README: update
|
||||||
|
* Bonus/README.eng: ditto
|
||||||
|
|
||||||
2003-01-12 qhwt@myrealbox.com
|
2003-01-12 qhwt@myrealbox.com
|
||||||
|
|
||||||
* [w3m-dev 03636] segfault in main.c
|
* [w3m-dev 03636] segfault in main.c
|
||||||
@@ -6403,4 +6410,4 @@ a * [w3m-dev 03276] compile error on EWS4800
|
|||||||
* release-0-2-1
|
* release-0-2-1
|
||||||
* import w3m-0.2.1
|
* import w3m-0.2.1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.679 2003/01/11 16:17:43 ukai Exp $
|
$Id: ChangeLog,v 1.680 2003/01/15 15:51:29 ukai Exp $
|
||||||
|
|||||||
Reference in New Issue
Block a user