aboutsummaryrefslogtreecommitdiffstats
path: root/www/smb2www
diff options
context:
space:
mode:
authordwcjr <dwcjr@FreeBSD.org>2001-08-12 11:43:03 +0800
committerdwcjr <dwcjr@FreeBSD.org>2001-08-12 11:43:03 +0800
commitc51c8165e863b1cec6ee0a3fab99436186fad275 (patch)
tree6de76a376a8c40667126d971a7691c1cd95b4445 /www/smb2www
parent76de1d45e7aa0ca7e9560784912433430712de25 (diff)
downloadfreebsd-ports-gnome-c51c8165e863b1cec6ee0a3fab99436186fad275.tar.gz
freebsd-ports-gnome-c51c8165e863b1cec6ee0a3fab99436186fad275.tar.zst
freebsd-ports-gnome-c51c8165e863b1cec6ee0a3fab99436186fad275.zip
system() calls eliminated.
new samba behavior fixes. Modified patch-smb2www.pm to patch against correct location. PR: 29217 Submitted by: maintainer
Diffstat (limited to 'www/smb2www')
-rw-r--r--www/smb2www/Makefile1
-rw-r--r--www/smb2www/files/patch-smb2www.pm73
2 files changed, 66 insertions, 8 deletions
diff --git a/www/smb2www/Makefile b/www/smb2www/Makefile
index ba4e55556d99..c5b30e03dae4 100644
--- a/www/smb2www/Makefile
+++ b/www/smb2www/Makefile
@@ -7,6 +7,7 @@
PORTNAME= smb2www
PORTVERSION= 0.0.980804
+PORTREVISION= 1
CATEGORIES= www
MASTER_SITES= http://us1.samba.org/samba/smb2www/ \
http://us2.samba.org/samba/smb2www/ \
diff --git a/www/smb2www/files/patch-smb2www.pm b/www/smb2www/files/patch-smb2www.pm
index 60c879e9c855..f27665c3b4c4 100644
--- a/www/smb2www/files/patch-smb2www.pm
+++ b/www/smb2www/files/patch-smb2www.pm
@@ -1,6 +1,57 @@
---- cgi-bin/smb2www.pm.orig Thu May 25 11:07:02 2000
-+++ cgi-bin/smb2www.pm Tue Jul 18 12:30:44 2000
-@@ -371,7 +371,7 @@
+--- cgi-bin/smb2www.pm.orig Wed Jul 25 14:22:50 2001
++++ cgi-bin/smb2www.pm Wed Jul 25 15:49:02 2001
+@@ -26,6 +26,7 @@
+ package smb2www;
+ use Exporter ();
+
++use POSIX ":sys_wait_h";
+ use MIME::Base64;
+ use Time::Local; # for lmtime
+ use strict;
+@@ -289,6 +290,7 @@
+ if ( $target eq "") { $target = "-" };
+ $file =~ s/^(.*)\/([^\/]*)$/$1$2/ ;
+ if ( $user ne "" ) { $user="-U$user"; }
++ else { $user = "-Uguest"; }
+ if ( $pass ne "") {
+ if ( $user eq "" ) {
+ $user = "-Uguest";
+@@ -296,9 +298,14 @@
+ } else {
+ $pass = "-N";
+ }
+- my @args = ("$cfg{bindir}/smbclient", "//$host/$share", "$pass", "$user", "-d
+- 0", "-c", "get \"$file\" $target");
+- return system (@args);
++ my @args = ("$cfg{bindir}/smbclient", "//$host/$share", "$pass", "$user", "-d0", "-c", "get $file $target");
++ my $pid=fork();
++ if (!$pid) {
++ exec (@args);
++ return 1;
++ }
++ waitpid(-1, &WNOHANG);
++ return 0;
+ }
+
+ # Makes a TAR of //$host/$share/$dir, using $user and $pass, to $target.
+@@ -317,8 +324,14 @@
+ } else {
+ $pass = "-N";
+ }
+- my @args = ("$cfg{bindir}/smbclient", "//$host/$share", "$pass", "$user", "-d0 ", "-D", "$dir", "-Tc", "$target");
+- return system (@args);
++ my @args = ("$cfg{bindir}/smbclient", "//$host/$share", "$pass", "$user", "-d0", "-D", "$dir", "-Tc", "$target");
++ my $pid=fork();
++ if (!$pid) {
++ exec (@args);
++ return 1;
++ }
++ waitpid(-1, &WNOHANG);
++ return 0;
+ }
+
+ # Return an array with sorted dir and filelisting
+@@ -371,7 +384,7 @@
sub GetSMBShr {
my $share = $_[0];
my @ret = ();
@@ -9,7 +60,7 @@
my @out = `$lookup`;
my $line = shift @out;
while ( (not $line =~ /^\s+Sharename/) and ($#out >= -1) ) {
-@@ -406,13 +406,14 @@
+@@ -406,18 +419,16 @@
sub GetSMBHosts {
my ($workgroup,$host) = @_;
my @ret = ();
@@ -19,14 +70,20 @@
my $line = shift @out;
- while ((not $line =~ /^This machine has a browse list/) and ($#out >= -1) ) {
-+ while ((not $line =~ /^\s+Server\s+Comment/) and ($#out >= -1) ) {
++ while ((not $line =~ /^\tServer\s+Comment$/) and ($#out >= -1) ) {
$line = shift @out;
}
+ shift @out;
++ $line = shift @out;
if ($#out >= -1) {
- $line = shift @out;
- $line = shift @out;
-@@ -437,16 +438,14 @@
+- $line = shift @out;
+- $line = shift @out;
+- $line = shift @out;
+- $line = shift @out;
+ while ((not $line =~ /^$/) and ($#out >= -1)) {
+ if ( $line =~ /^\t([\S ]*\S) {5,}(\S[\S ]*|\S|)$/ ) {
+ my $rec = {};
+@@ -437,16 +448,14 @@
sub GetSMBGroups {
my @ret = ();