aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilman Keskinoz <arved@FreeBSD.org>2003-04-16 11:44:55 +0000
committerTilman Keskinoz <arved@FreeBSD.org>2003-04-16 11:44:55 +0000
commit5bb835f4399e06e5879477c3973888d3f7224e56 (patch)
treeb3a7c4ee956c064163f12047dec7162f6f75ed2c
parent90d5fa84215110fdb8a8787babdf5ba2aa80ed6a (diff)
downloadports-5bb835f4399e06e5879477c3973888d3f7224e56.tar.gz
ports-5bb835f4399e06e5879477c3973888d3f7224e56.zip
Notes
-rw-r--r--net/linneighborhood/Makefile30
-rw-r--r--net/linneighborhood/distinfo1
-rw-r--r--net/linneighborhood/files/mntent.h35
-rw-r--r--net/linneighborhood/files/mntent_compat.c107
-rw-r--r--net/linneighborhood/files/patch-Makefile.in29
-rw-r--r--net/linneighborhood/files/patch-configure32
-rw-r--r--net/linneighborhood/files/patch-data.c12
-rw-r--r--net/linneighborhood/files/patch-gtk_dialog.c55
-rw-r--r--net/linneighborhood/files/patch-gtk_mountdlg.c103
-rw-r--r--net/linneighborhood/files/patch-gtk_tree.c19
-rw-r--r--net/linneighborhood/files/patch-io.c18
-rw-r--r--net/linneighborhood/files/patch-lmhosts.c10
-rw-r--r--net/linneighborhood/files/patch-preferences.c22
-rw-r--r--net/linneighborhood/files/patch-smbbrowse.c78
-rw-r--r--net/linneighborhood/files/patch-smbmount.c483
-rw-r--r--net/linneighborhood/files/patch-utility.c22
-rw-r--r--net/linneighborhood/pkg-descr11
-rw-r--r--net/linneighborhood/pkg-message9
-rw-r--r--net/linneighborhood/pkg-plist15
-rw-r--r--sysutils/Makefile1
-rw-r--r--sysutils/linneighborhood/Makefile30
-rw-r--r--sysutils/linneighborhood/distinfo1
-rw-r--r--sysutils/linneighborhood/files/mntent.h35
-rw-r--r--sysutils/linneighborhood/files/mntent_compat.c107
-rw-r--r--sysutils/linneighborhood/files/patch-Makefile.in29
-rw-r--r--sysutils/linneighborhood/files/patch-configure32
-rw-r--r--sysutils/linneighborhood/files/patch-data.c12
-rw-r--r--sysutils/linneighborhood/files/patch-gtk_dialog.c55
-rw-r--r--sysutils/linneighborhood/files/patch-gtk_mountdlg.c103
-rw-r--r--sysutils/linneighborhood/files/patch-gtk_tree.c19
-rw-r--r--sysutils/linneighborhood/files/patch-io.c18
-rw-r--r--sysutils/linneighborhood/files/patch-lmhosts.c10
-rw-r--r--sysutils/linneighborhood/files/patch-preferences.c22
-rw-r--r--sysutils/linneighborhood/files/patch-smbbrowse.c78
-rw-r--r--sysutils/linneighborhood/files/patch-smbmount.c483
-rw-r--r--sysutils/linneighborhood/files/patch-utility.c22
-rw-r--r--sysutils/linneighborhood/pkg-descr11
-rw-r--r--sysutils/linneighborhood/pkg-message9
-rw-r--r--sysutils/linneighborhood/pkg-plist15
39 files changed, 2183 insertions, 0 deletions
diff --git a/net/linneighborhood/Makefile b/net/linneighborhood/Makefile
new file mode 100644
index 000000000000..cbc0645e7731
--- /dev/null
+++ b/net/linneighborhood/Makefile
@@ -0,0 +1,30 @@
+# New ports collection makefile for: LinNeighborhood
+# Please read files/porters-note!
+# Date created: 2003/04/06
+# Whom: Heiner <h.eichmann@gmx.de>
+#
+# $FreeBSD$
+#
+
+PORTNAME= LinNeighborhood
+PORTVERSION= 0.6.5
+CATEGORIES= sysutils
+MASTER_SITES= http://www.bnro.de/~schmidjo/download/
+
+MAINTAINER= h.eichmann@gmx.de
+COMMENT= GTK+ gui for browsing and mounting SMB filesystems
+
+LIB_DEPENDS= intl.4:${PORTSDIR}/devel/gettext
+RUN_DEPENDS= smbclient:${PORTSDIR}/net/samba
+
+GNU_CONFIGURE= yes
+USE_GMAKE= yes
+USE_GNOME= gtk12
+
+pre-configure:
+ ${CP} ${FILESDIR}/mntent* ${WRKSRC}/src
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/net/linneighborhood/distinfo b/net/linneighborhood/distinfo
new file mode 100644
index 000000000000..102d0a481c04
--- /dev/null
+++ b/net/linneighborhood/distinfo
@@ -0,0 +1 @@
+MD5 (LinNeighborhood-0.6.5.tar.gz) = 5e50c9cef403164aca22be9ade0a7dbf
diff --git a/net/linneighborhood/files/mntent.h b/net/linneighborhood/files/mntent.h
new file mode 100644
index 000000000000..1e37778b2178
--- /dev/null
+++ b/net/linneighborhood/files/mntent.h
@@ -0,0 +1,35 @@
+#ifdef HAVE_MNTENT_H
+#include <mntent.h>
+#else
+
+#ifndef mntent_h_
+#define mntent_h_
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
+
+#define MOUNTED "mounted"
+#define MNTTYPE_NFS "nfs"
+
+//#define MOPTSLEN (256 - (MNAMELEN * 2 + MFSNAMELEN + 2 * sizeof(int)))
+
+struct mntent {
+ char *mnt_fsname; /* file system name */
+ char *mnt_dir; /* file system path prefix */
+ char *mnt_type; /* dbg, efs, nfs */
+ char *mnt_opts; /* ro, hide, etc. */
+ int mnt_freq; /* dump frequency, in days */
+ int mnt_passno; /* pass number on parallel fsck */
+};
+
+FILE * setmntent(char * filep, char * type);
+struct mntent *getmntent(FILE * filep);
+//char * hasmntopt(struct mntent * mnt, char * opt);
+int endmntent(FILE * filep);
+
+#endif /* mntent_h_ */
+#endif /* not HAVE_MNTENT_H */
diff --git a/net/linneighborhood/files/mntent_compat.c b/net/linneighborhood/files/mntent_compat.c
new file mode 100644
index 000000000000..d8e6f9b32b94
--- /dev/null
+++ b/net/linneighborhood/files/mntent_compat.c
@@ -0,0 +1,107 @@
+#include "mntent.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+
+char mntent_global_mnt_fsname[1024];
+char mntent_global_mnt_dir[1024];
+char mntent_global_mnt_type[1024];
+char mntent_global_mnt_opts[1024];
+
+struct mntent mntent_global_mntent;
+
+FILE * setmntent(char * filep, char * type)
+{
+ char * tempFileName = tmpnam(0);
+ FILE * tempFile = 0;
+ char s[256];
+ int i;
+
+ sprintf(s, "mount -p > %s", tempFileName);
+ i = system(s);
+ if (i == 127 || i == -1 || !WIFEXITED(i) || WEXITSTATUS(i))
+ {
+ unlink(tempFileName);
+ return 0;
+ }
+ tempFile = fopen(tempFileName, type);
+ unlink(tempFileName);
+ return tempFile;
+}
+
+struct mntent *getmntent(FILE * filep)
+{
+ char *p, c, tmp[32];
+ int field = 0;
+ mntent_global_mntent.mnt_fsname = mntent_global_mnt_fsname;
+ mntent_global_mntent.mnt_dir = mntent_global_mnt_dir;
+ mntent_global_mntent.mnt_type = mntent_global_mnt_type;
+ mntent_global_mntent.mnt_opts = mntent_global_mnt_opts;
+ mntent_global_mntent.mnt_freq = 0;
+ mntent_global_mntent.mnt_passno = 0;
+ *mntent_global_mnt_fsname = 0;
+ *mntent_global_mnt_dir = 0;
+ *mntent_global_mnt_type = 0;
+ *mntent_global_mnt_opts = 0;
+
+ if (feof(filep))
+ return 0;
+ p = mntent_global_mnt_fsname;
+ while (!feof(filep))
+ {
+ c = fgetc(filep);
+ if (c == ' ' || c == '\t' || c == '\n')
+ {
+ *p = 0;
+ switch (field)
+ {
+ case 0:
+ case 2:
+ case 4:
+ case 6:
+ ++field;
+ break;
+ case 8:
+ mntent_global_mntent.mnt_freq = atoi(tmp);
+ ++field;
+ break;
+ case 10:
+ mntent_global_mntent.mnt_passno = atoi(tmp);
+ ++field;
+ break;
+ }
+ p = 0;
+ if (c == '\n')
+ return & mntent_global_mntent;
+ continue;
+ }
+ if (!p)
+ {
+ switch (field)
+ {
+ case 1:
+ p = mntent_global_mnt_dir;
+ break;
+ case 3:
+ p = mntent_global_mnt_type;
+ break;
+ case 5:
+ p = mntent_global_mnt_opts;
+ break;
+ case 7:
+ case 9:
+ p = tmp;
+ break;
+ }
+ ++field;
+ }
+ *p++ = c;
+ }
+
+ return 0;
+}
+
+//char * hasmntopt(struct mntent * mnt, char * opt);
+int endmntent(FILE * filep)
+{
+ return fclose(filep);
+}
diff --git a/net/linneighborhood/files/patch-Makefile.in b/net/linneighborhood/files/patch-Makefile.in
new file mode 100644
index 000000000000..4f666cbaac08
--- /dev/null
+++ b/net/linneighborhood/files/patch-Makefile.in
@@ -0,0 +1,29 @@
+--- src/Makefile.in.orig Sun Jun 9 09:58:47 2002
++++ src/Makefile.in Thu Feb 13 09:05:55 2003
+@@ -88,14 +88,14 @@
+ localedir = @localedir@
+
+ bin_PROGRAMS = LinNeighborhood
+-LinNeighborhood_SOURCES = browsewrap.c data.c filesystem.c gtk_dialog.c gtk_gui.c gtk_mountdlg.c gtk_sharewindow.c gtk_tree.c guiwrap.c io.c libsmb.c lmhosts.c main.c preferences.c smbbrowse.c smbmount.c utility.c
++LinNeighborhood_SOURCES = browsewrap.c data.c filesystem.c gtk_dialog.c gtk_gui.c gtk_mountdlg.c gtk_sharewindow.c gtk_tree.c guiwrap.c io.c libsmb.c lmhosts.c main.c preferences.c smbbrowse.c smbmount.c utility.c mntent_compat.c
+
+-noinst_HEADERS = browsewrap.h data.h define.h filesystem.h gtk_dialog.h gtk_gui.h gtk_mountdlg.h gtk_sharewindow.h gtk_tree.h guiwrap.h io.h libsmb.h preferences.h samba.h smbif.h utility.h
++noinst_HEADERS = browsewrap.h data.h define.h filesystem.h gtk_dialog.h gtk_gui.h gtk_mountdlg.h gtk_sharewindow.h gtk_tree.h guiwrap.h io.h libsmb.h preferences.h samba.h smbif.h utility.h mntent.h
+
+
+ LinNeighborhood_LDADD = @GTK_LIBS@
+ INCLUDES = @GTK_CFLAGS@ -DLIBDIR=\"$(libdir)\" -DDATADIR=\"$(datadir)\"
+-LIBS = @GTK_LIBS@ -lpthread
++LIBS = @GTK_LIBS@ -lc_r -lutil
+
+ EXTRA_DIST = picture
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+@@ -110,7 +110,7 @@
+ LinNeighborhood_OBJECTS = browsewrap.o data.o filesystem.o gtk_dialog.o \
+ gtk_gui.o gtk_mountdlg.o gtk_sharewindow.o gtk_tree.o guiwrap.o io.o \
+ libsmb.o lmhosts.o main.o preferences.o smbbrowse.o smbmount.o \
+-utility.o
++utility.o mntent_compat.o
+ LinNeighborhood_DEPENDENCIES =
+ LinNeighborhood_LDFLAGS =
+ CFLAGS = @CFLAGS@
diff --git a/net/linneighborhood/files/patch-configure b/net/linneighborhood/files/patch-configure
new file mode 100644
index 000000000000..145bad4a5e06
--- /dev/null
+++ b/net/linneighborhood/files/patch-configure
@@ -0,0 +1,32 @@
+--- configure.orig Sun Jun 9 09:58:45 2002
++++ configure Thu Feb 13 07:53:13 2003
+@@ -4800,13 +4800,13 @@
+ { (exit 1); exit 1; }; }
+ fi
+
+-echo "$as_me:4803: checking for pthread_exit in -lpthread" >&5
+-echo $ECHO_N "checking for pthread_exit in -lpthread... $ECHO_C" >&6
++echo "$as_me:4803: checking for pthread_exit in -lc_r" >&5
++echo $ECHO_N "checking for pthread_exit in -lc_r... $ECHO_C" >&6
+ if test "${ac_cv_lib_pthread_pthread_exit+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lpthread $LIBS"
++LIBS="-lc_r $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line 4811 "configure"
+ #include "confdefs.h"
+@@ -4857,10 +4857,10 @@
+
+ if test "x$lib_pthread" = "xno" ; then
+ { { echo "$as_me:4859: error:
+- *** libpthread.so: posix thread library no found ***
++ *** libc_r.so: posix thread library no found ***
+ " >&5
+ echo "$as_me: error:
+- *** libpthread.so: posix thread library no found ***
++ *** libc_r.so: posix thread library no found ***
+ " >&2;}
+ { (exit 1); exit 1; }; }
+ fi
diff --git a/net/linneighborhood/files/patch-data.c b/net/linneighborhood/files/patch-data.c
new file mode 100644
index 000000000000..7138363dbe20
--- /dev/null
+++ b/net/linneighborhood/files/patch-data.c
@@ -0,0 +1,12 @@
+--- src/data.c.orig Thu Apr 10 21:59:12 2003
++++ src/data.c Thu Apr 10 22:45:59 2003
+@@ -171,6 +171,9 @@
+ {
+ if ( mount )
+ {
++ char *c = strchr(mount->machine, '@'); // remove user name from smb name
++ if (c)
++ memmove(mount->machine, c+1, strlen(c)+1);
+ if ( mount_list_search_by_mountpoint(mount->mountpoint) == NULL )
+ {
+ mountlist = g_slist_append(mountlist, mount);
diff --git a/net/linneighborhood/files/patch-gtk_dialog.c b/net/linneighborhood/files/patch-gtk_dialog.c
new file mode 100644
index 000000000000..357795ad7b26
--- /dev/null
+++ b/net/linneighborhood/files/patch-gtk_dialog.c
@@ -0,0 +1,55 @@
+--- src/gtk_dialog.c.orig Sun Apr 6 13:07:13 2003
++++ src/gtk_dialog.c Sun Apr 6 13:10:50 2003
+@@ -2039,34 +2039,34 @@
+ gtk_widget_show(button);
+
+ frame = gtk_frame_new(_(" smbmount version "));
+- gtk_container_border_width(GTK_CONTAINER(frame), 3);
+- gtk_box_pack_start(GTK_BOX(frame_vbox), frame, FALSE, TRUE, 0);
+- gtk_widget_show(frame);
++// gtk_container_border_width(GTK_CONTAINER(frame), 3);
++// gtk_box_pack_start(GTK_BOX(frame_vbox), frame, FALSE, TRUE, 0);
++// gtk_widget_show(frame);
+
+ frame_vbox = gtk_vbox_new(FALSE, 0);
+- gtk_container_border_width(GTK_CONTAINER(frame_vbox), 5);
+- gtk_container_add(GTK_CONTAINER(frame), frame_vbox);
+- gtk_widget_show(frame_vbox);
++// gtk_container_border_width(GTK_CONTAINER(frame_vbox), 5);
++// gtk_container_add(GTK_CONTAINER(frame), frame_vbox);
++// gtk_widget_show(frame_vbox);
+
+ smbmount_204_radio = gtk_radio_button_new_with_label(NULL, _("version <= 2.0.4"));
+- if ( globals.linux_version < LINUX_2_2 )
+- gtk_widget_set_sensitive(smbmount_204_radio, FALSE);
+- gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_204_radio, FALSE, TRUE, 0);
+- gtk_widget_show(smbmount_204_radio);
++// if ( globals.linux_version < LINUX_2_2 )
++// gtk_widget_set_sensitive(smbmount_204_radio, FALSE);
++// gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_204_radio, FALSE, TRUE, 0);
++// gtk_widget_show(smbmount_204_radio);
+
+ smbmount_205_radio = gtk_radio_button_new_with_label(
+ gtk_radio_button_group(GTK_RADIO_BUTTON(smbmount_204_radio)), _("version = 2.0.5"));
+- if ( globals.linux_version < LINUX_2_2 )
+- gtk_widget_set_sensitive(smbmount_205_radio, FALSE);
+- gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_205_radio, FALSE, TRUE, 0);
+- gtk_widget_show(smbmount_205_radio);
++// if ( globals.linux_version < LINUX_2_2 )
++// gtk_widget_set_sensitive(smbmount_205_radio, FALSE);
++// gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_205_radio, FALSE, TRUE, 0);
++// gtk_widget_show(smbmount_205_radio);
+
+ smbmount_206_radio = gtk_radio_button_new_with_label(
+ gtk_radio_button_group(GTK_RADIO_BUTTON(smbmount_205_radio)), _("version >= 2.0.6"));
+- if ( globals.linux_version < LINUX_2_2 )
+- gtk_widget_set_sensitive(smbmount_206_radio, FALSE);
+- gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_206_radio, FALSE, TRUE, 0);
+- gtk_widget_show(smbmount_206_radio);
++// if ( globals.linux_version < LINUX_2_2 )
++// gtk_widget_set_sensitive(smbmount_206_radio, FALSE);
++// gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_206_radio, FALSE, TRUE, 0);
++// gtk_widget_show(smbmount_206_radio);
+
+ switch ( pref.v.smbmount_version )
+ {
diff --git a/net/linneighborhood/files/patch-gtk_mountdlg.c b/net/linneighborhood/files/patch-gtk_mountdlg.c
new file mode 100644
index 000000000000..39a88713af63
--- /dev/null
+++ b/net/linneighborhood/files/patch-gtk_mountdlg.c
@@ -0,0 +1,103 @@
+--- src/gtk_mountdlg.c.orig Wed Apr 9 19:51:41 2003
++++ src/gtk_mountdlg.c Wed Apr 9 20:18:14 2003
+@@ -726,65 +726,65 @@
+
+ /*root password */
+ frame = gtk_frame_new(_("Mount as Root"));
+- gtk_box_pack_start(GTK_BOX (GTK_DIALOG (mount_dlg)->vbox), frame, TRUE, TRUE, 5);
+- gtk_widget_show(frame);
++// gtk_box_pack_start(GTK_BOX (GTK_DIALOG (mount_dlg)->vbox), frame, TRUE, TRUE, 5);
++// gtk_widget_show(frame);
+
+ vbox=gtk_vbox_new(FALSE,0);
+- gtk_container_border_width(GTK_CONTAINER(vbox), 3);
+- gtk_container_add(GTK_CONTAINER(frame),vbox);
+- gtk_widget_show(vbox);
++// gtk_container_border_width(GTK_CONTAINER(vbox), 3);
++// gtk_container_add(GTK_CONTAINER(frame),vbox);
++// gtk_widget_show(vbox);
+
+ hbox=gtk_hbox_new(FALSE,0);
+ /* gtk_box_pack_start(GTK_BOX (GTK_DIALOG (mount_dlg)->vbox),
+ hbox, TRUE, TRUE, 5);
+ gtk_container_border_width(GTK_CONTAINER(hbox), 3);
+ gtk_container_add(GTK_CONTAINER(frame),hbox); */
+- gtk_box_pack_start(GTK_BOX (vbox),hbox, TRUE, TRUE, 0);
+- gtk_widget_show(hbox);
++// gtk_box_pack_start(GTK_BOX (vbox),hbox, TRUE, TRUE, 0);
++// gtk_widget_show(hbox);
+
+ sumountcheckbox = gtk_check_button_new_with_label(_("OK"));
+ /* gtk_widget_set_usize(sumountcheckbox,120,-1); */
+- if (geteuid()==0) /*No root password if you are root*/
+- gtk_widget_set_sensitive(sumountcheckbox,FALSE);
+- gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sumountcheckbox),cachesupwd & sumount);
+- gtk_box_pack_start (GTK_BOX (hbox), sumountcheckbox, FALSE, TRUE, 0);
+- gtk_widget_show (sumountcheckbox);
++// if (geteuid()==0) /*No root password if you are root*/
++// gtk_widget_set_sensitive(sumountcheckbox,FALSE);
++// gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sumountcheckbox),cachesupwd & sumount);
++// gtk_box_pack_start (GTK_BOX (hbox), sumountcheckbox, FALSE, TRUE, 0);
++// gtk_widget_show (sumountcheckbox);
+
+ label=gtk_label_new(_("Password:"));
+- gtk_box_pack_start(GTK_BOX (hbox),label, FALSE, TRUE, 0);
++// gtk_box_pack_start(GTK_BOX (hbox),label, FALSE, TRUE, 0);
+ /* gtk_widget_set_usize(label,100,-1); */
+- gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_LEFT);
+- gtk_widget_show(label);
++// gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_LEFT);
++// gtk_widget_show(label);
+
+ supasswdentry= gtk_entry_new_with_max_length(MASTER_LEN);
+- gtk_entry_set_visibility(GTK_ENTRY(supasswdentry), 0);
++// gtk_entry_set_visibility(GTK_ENTRY(supasswdentry), 0);
+
+- if (sumount && cachesupwd)
+- gtk_entry_set_text (GTK_ENTRY (supasswdentry), supasswd);
+- else
+- gtk_entry_set_text (GTK_ENTRY (supasswdentry), "");
++// if (sumount && cachesupwd)
++// gtk_entry_set_text (GTK_ENTRY (supasswdentry), supasswd);
++// else
++// gtk_entry_set_text (GTK_ENTRY (supasswdentry), "");
+
+- gtk_widget_set_sensitive(supasswdentry,sumount&cachesupwd);
+- gtk_signal_connect_object(GTK_OBJECT(supasswdentry), "key_press_event",
+- GTK_SIGNAL_FUNC(smb_mount_key_press_callback), NULL);
+- gtk_box_pack_start (GTK_BOX (hbox), supasswdentry, TRUE, TRUE, 5);
+- gtk_widget_show (supasswdentry);
+- gtk_signal_connect (GTK_OBJECT(sumountcheckbox), "toggled",
+- GTK_SIGNAL_FUNC(supwentry_toggle_sensitive),supasswdentry);
++// gtk_widget_set_sensitive(supasswdentry,sumount&cachesupwd);
++// gtk_signal_connect_object(GTK_OBJECT(supasswdentry), "key_press_event",
++// GTK_SIGNAL_FUNC(smb_mount_key_press_callback), NULL);
++// gtk_box_pack_start (GTK_BOX (hbox), supasswdentry, TRUE, TRUE, 5);
++// gtk_widget_show (supasswdentry);
++// gtk_signal_connect (GTK_OBJECT(sumountcheckbox), "toggled",
++// GTK_SIGNAL_FUNC(supwentry_toggle_sensitive),supasswdentry);
+
+ hbox=gtk_hbox_new(FALSE,0);
+- gtk_box_pack_start(GTK_BOX (vbox),hbox, TRUE, TRUE, 0);
+- gtk_widget_show(hbox);
++// gtk_box_pack_start(GTK_BOX (vbox),hbox, TRUE, TRUE, 0);
++// gtk_widget_show(hbox);
+
+ sucachepwdcheckbox = gtk_check_button_new_with_label(_("Cache Root Password"));
+
+ /* gtk_widget_set_usize(sumountcheckbox,120,-1); */
+- if (geteuid()==0)
+- gtk_widget_set_sensitive(sumountcheckbox,FALSE);
+- gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sucachepwdcheckbox),cachesupwd &sumount);
+- gtk_widget_set_sensitive(sucachepwdcheckbox,sumount);
+- gtk_box_pack_start (GTK_BOX (hbox), sucachepwdcheckbox, FALSE, TRUE, 0);
+- gtk_widget_show (sucachepwdcheckbox);
++// if (geteuid()==0)
++// gtk_widget_set_sensitive(sumountcheckbox,FALSE);
++// gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sucachepwdcheckbox),cachesupwd &sumount);
++// gtk_widget_set_sensitive(sucachepwdcheckbox,sumount);
++// gtk_box_pack_start (GTK_BOX (hbox), sucachepwdcheckbox, FALSE, TRUE, 0);
++// gtk_widget_show (sucachepwdcheckbox);
+
+ /*-action_area*/
+ mount_button = gtk_button_new_with_label(_("Mount"));
diff --git a/net/linneighborhood/files/patch-gtk_tree.c b/net/linneighborhood/files/patch-gtk_tree.c
new file mode 100644
index 000000000000..f0f78a24942c
--- /dev/null
+++ b/net/linneighborhood/files/patch-gtk_tree.c
@@ -0,0 +1,19 @@
+--- src/gtk_tree.c.orig Wed Apr 9 20:32:53 2003
++++ src/gtk_tree.c Wed Apr 9 20:48:24 2003
+@@ -2011,7 +2011,7 @@
+ if ( GTK_IS_TREE_ITEM(item) )
+ {
+ box = GTK_BIN(item)->child;
+-
++ if (!box) return itemtype;
+ step_list = GTK_BOX(box)->children->next; /* type entry */
+ child = step_list->data;
+ label = GTK_LABEL(child->widget);
+@@ -2033,7 +2033,6 @@
+ static unsigned int tree_item_count (GtkTreeItem *item)
+ {
+ unsigned int ireturn;
+-
+ if ( item != NULL )
+ {
+ if ( item->subtree )
diff --git a/net/linneighborhood/files/patch-io.c b/net/linneighborhood/files/patch-io.c
new file mode 100644
index 000000000000..6bc1993370ec
--- /dev/null
+++ b/net/linneighborhood/files/patch-io.c
@@ -0,0 +1,18 @@
+--- src/io.c.orig Fri Apr 11 16:58:15 2003
++++ src/io.c Fri Apr 11 17:03:11 2003
+@@ -130,12 +130,12 @@
+ /* save only 'not root' mounts -> plain password */
+ if ( (mount != NULL) && (mount->type != mem_mount_root) )
+ {
+- string_ncopy(str, pref.v.smbmount_exe, MAXMACHNAMEL+MAXSHRNAMEL+PATH_LEN+19);
++ *str = 0;
+ temp = str;
+- temp += strlen(str);
+ merge_mount(&temp, mount, MAXMACHNAMEL+MAXSHRNAMEL+PATH_LEN+19 - strlen(str), 1);
+ string_ncat(str, "\n", MAXMACHNAMEL+MAXSHRNAMEL+PATH_LEN+19);
+- fwrite(str, 1, strlen(str), fd);
++ if (*temp == ' ') ++temp;
++ fwrite(temp, 1, strlen(temp), fd);
+ }
+ }
+ }
diff --git a/net/linneighborhood/files/patch-lmhosts.c b/net/linneighborhood/files/patch-lmhosts.c
new file mode 100644
index 000000000000..9fad8a3005b6
--- /dev/null
+++ b/net/linneighborhood/files/patch-lmhosts.c
@@ -0,0 +1,10 @@
+--- src/lmhosts.c.orig Thu Feb 13 08:48:40 2003
++++ src/lmhosts.c Thu Feb 13 08:49:05 2003
+@@ -31,6 +31,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
diff --git a/net/linneighborhood/files/patch-preferences.c b/net/linneighborhood/files/patch-preferences.c
new file mode 100644
index 000000000000..3addda166a3d
--- /dev/null
+++ b/net/linneighborhood/files/patch-preferences.c
@@ -0,0 +1,22 @@
+--- src/preferences.c.orig Sun Jun 9 09:58:43 2002
++++ src/preferences.c Sun Apr 6 13:03:32 2003
+@@ -29,6 +29,8 @@
+ #include "data.h"
+ #include "utility.h"
+ #include "samba.h"
++#include <sys/types.h>
++#include <netinet/in.h>
+
+
+ #define LVERSION(major,minor,patch) (((((major)<<8)+(minor))<<8)+(patch))
+@@ -359,8 +361,8 @@
+ strcpy(pref->v.filemanager_exe, "xterm -e mc $MOUNTPOINT");
+ strcpy(pref->v.smbclient_exe, "smbclient");
+ strcpy(pref->v.nmblookup_exe, "nmblookup");
+- strcpy(pref->v.smbmount_exe, "smbmount");
+- strcpy(pref->v.smbumount_exe, "smbumount");
++ strcpy(pref->v.smbmount_exe, "mount_smbfs");
++ strcpy(pref->v.smbumount_exe, "umount");
+ pref->v.smbclient_arg[0] = 0;
+ pref->v.nmblookup_arg[0] = 0;
+ pref->v.smbmount_arg[0] = 0;
diff --git a/net/linneighborhood/files/patch-smbbrowse.c b/net/linneighborhood/files/patch-smbbrowse.c
new file mode 100644
index 000000000000..fd2f35d1fdfc
--- /dev/null
+++ b/net/linneighborhood/files/patch-smbbrowse.c
@@ -0,0 +1,78 @@
+--- src/smbbrowse.c.orig Sun Jun 9 09:58:43 2002
++++ src/smbbrowse.c Thu Apr 10 15:39:19 2003
+@@ -716,8 +716,8 @@
+ browsedat->browse_state=search_head;
+ browsedat->lasttab=0;
+ if (*user==0){
+- strcpy(browsedat->userpasswdstr,"-U%");
+- strcpy(browsedat->userdummystr,"-U%");
++ strcpy(browsedat->userpasswdstr,"-N");
++ strcpy(browsedat->userdummystr,"-N");
+ }
+ else
+ {
+@@ -829,6 +829,12 @@
+ dup2(browsedat->fd[1],STDOUT_FILENO);
+
+ cArg[argcount++] = "nmblookup";
++ cArg[argcount++] = "-S";
++ cArg[argcount++] = "-d1";
++ for ( loop = 0; loop < add_argcount; loop++ )
++ {
++ cArg[argcount++] = cAddArg[loop];
++ }
+ if ( *wins_name )
+ {
+ cArg[argcount++] = "-U";
+@@ -841,12 +847,6 @@
+ cArg[argcount++] = "-M";
+ cArg[argcount++] = group_name;
+ }
+- cArg[argcount++] = "-S";
+- cArg[argcount++] = "-d1";
+- for ( loop = 0; loop < add_argcount; loop++ )
+- {
+- cArg[argcount++] = cAddArg[loop];
+- }
+ cArg[argcount++] = NULL;
+
+ execvp(pref_get_nmblookup_exe(), cArg);
+@@ -870,15 +870,16 @@
+ }
+ else
+ {
+- if (*wins_name)
+- sprintf(logstr,"GetSMBGroups:%s -U %s -R %s -S -d1",pref_get_nmblookup_exe(),wins_name,group_type);
+- else
+- sprintf(logstr,"GetSMBGroups:%s -M %s -S -d1",pref_get_nmblookup_exe(),group_name);
++ sprintf(logstr,"GetSMBGroups:%s -S -d1",pref_get_nmblookup_exe());
+ for ( loop = 0; loop < add_argcount; loop++ )
+ {
+ string_ncat(logstr, " ", MAXLOGSTRLEN);
+ string_ncat(logstr, cAddArg[loop], MAXLOGSTRLEN);
+ }
++ if (*wins_name)
++ sprintf(logstr+strlen(logstr)," -U %s -R %s",wins_name,group_type);
++ else
++ sprintf(logstr+strlen(logstr)," -M %s",group_name);
+ gui_log_window_insert_string(logstr,1);
+ close(browsedat->fd[1]);
+ browsedat->group_master.group_name[MAXGROUPNAMEL]=0;
+@@ -1028,7 +1029,7 @@
+ }
+ browsedat=g_malloc(sizeof(HBROWSE_STRUCT));
+ if (*user==0)
+- strcpy(commandstr,"-U%");
++ strcpy(commandstr,"-N");
+ else
+ sprintf(commandstr,"-U%s%%%s",user,passwd);
+
+@@ -1274,7 +1275,7 @@
+ }
+
+ if (*user==0)
+- strcpy(commandstr,"-U%");
++ strcpy(commandstr,"-N");
+ else
+ sprintf(commandstr,"-U%s%%%s",user,passwd);
+ argv[++argnr]="smbclient";
diff --git a/net/linneighborhood/files/patch-smbmount.c b/net/linneighborhood/files/patch-smbmount.c
new file mode 100644
index 000000000000..7d28983c406a
--- /dev/null
+++ b/net/linneighborhood/files/patch-smbmount.c
@@ -0,0 +1,483 @@
+--- src/smbmount.c.orig Sun Jun 9 09:58:43 2002
++++ src/smbmount.c Fri Apr 11 16:55:26 2003
+@@ -16,6 +16,9 @@
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
++#include <sys/param.h>
++#include <errno.h>
++#include <poll.h>
+ #include <string.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -70,6 +73,9 @@
+ } UMOUNT_STRUCT;
+ static GSList *umountlist = NULL;
+
++void split_arguments(char * arguments, char * argv[], int * argnr, GSList ** strlist);
++char * storeInBuffer(const char * s, GSList ** strlist);
++void execvp_with_password(const char * path, char * const argv[], const char * passwd, GSList * strlist);
+
+ char suprompt[] = "Passw";
+
+@@ -322,6 +328,7 @@
+ int pipe2_nok,pipe3_nok=1;
+ int sumount,argnr=-1,passw_lf;
+ char commandstr[MAXMNTCOMMANDL],commandstr1[MAXMNTCOMMANDL];
++ char num1[10], num2[10], num3[10], num4[10], tmp[MAXMNTCOMMANDL];
+ char opt_group[MAXMNTCOMMANDL];
+ char dummysmbpasswd[64];
+ /*#ifdef LINUX2_0 */
+@@ -345,6 +352,7 @@
+ sumount=(supasswd!=NULL);
+ passw_lf=(*smbpasswd==0) && !linux2_0; /*smbmount 2.0.3 always waits for password,
+ even if called with -Uuser% or -N if server is in user level security*/
++ passw_lf=1;
+ if (sumount|| passw_lf)
+ if (pipe(fdstdin))
+ {
+@@ -418,96 +426,53 @@
+ else
+ {
+ /* no sumount */
+- if(linux2_0)
+ {
+- argv[++argnr]="smbmount";
+- argv[++argnr]=servicename;
+- argv[++argnr]=mount_point;
+- argv[++argnr]="-c";
+- argv[++argnr]=clientname;
+- argv[++argnr]="-I";
+- argv[++argnr]=ipaddr;
+- if (*group_name)
++ // bugfix: mount command might consist of more than one word (example: sudo mount_smbfs)
++ split_arguments(pref_get_smbmount_exe(), argv, &argnr, &strlist);
+ {
+- argv[++argnr]="-D";
+- argv[++argnr]=group_name;
+- }
+- argv[++argnr]="-U";
+- argv[++argnr]=smbuser;
+- argv[++argnr]="-f";sprintf(filemodestr,"%d",filemode);
+- argv[++argnr]=filemodestr;
+- argv[++argnr]="-d";sprintf(dirmodestr,"%d",dirmode);
+- argv[++argnr]=dirmodestr;
+- argv[++argnr]="-u";sprintf(uidstr,"%d",uid);
+- argv[++argnr]=uidstr;
+- argv[++argnr]="-g";sprintf(gidstr,"%d",gid);
+- argv[++argnr]=gidstr;
+- if (*smbpasswd==0)
+- argv[++argnr]="-n";
+- else
+- {
+- argv[++argnr]="-P";
+- argv[++argnr]=smbpasswd;
+- }
+- argv[++argnr]=NULL;
+- }
+- else
+- {
+- /* linux 2.2/2.4 */
+- argv[++argnr]=pref_get_smbmount_exe();
+- argv[++argnr]=servicename;
+- if (pref.v.smbmount_version>SMBMOUNT_204) argv[++argnr]=mount_point;
+- if (pref.v.smbmount_version<SMBMOUNT_206)
+- {
+- /* 2.04/2.05 */
++ sprintf(num1,"%d", filemode);
++ sprintf(num2,"%d", dirmode);
++ sprintf(num3,"%d", uid);
++ sprintf(num4,"%d", gid);
++ strcpy(commandstr1, "//");
++ if (strlen(smbuser))
++ {
++ strcat(commandstr1, smbuser);
++ strcat(commandstr1, "@");
++ }
++ if (strlen(servicename) > 2)
++ strcat(commandstr1, servicename+2);
++ argv[++argnr]="-f";
++ argv[++argnr]=num1;
++ argv[++argnr]="-d";
++ argv[++argnr]=num2;
++ argv[++argnr]="-u";
++ argv[++argnr]=num3;
++ argv[++argnr]="-g";
++ argv[++argnr]=num4;
+ argv[++argnr]="-I";
+- argv[++argnr]=ipaddr;
++ strcpy(tmp, ipaddr);
++ argv[++argnr]=tmp;
+ if (*group_name)
+ {
+ argv[++argnr]="-W";
+- argv[++argnr]=group_name;
+- }
+- sprintf(userpasswd,"-U%s%%%s",smbuser,smbpasswd);
+- argv[++argnr]=userpasswd;
+- argv[++argnr]="-d0";
+- if (pref.v.smbmount_version <SMBMOUNT_205)
+- {
+- argv[++argnr]="-c";
+- argv[++argnr]=commandstr;
+- sprintf(commandstr,"mount %s -f %d -d %d -u %d -g %d",
+- /*escape_str_smbmnt(*/mount_point/*,&strlist)*/,filemode,dirmode,uid,gid);
+- }
+- if ( !is_empty_string(pref.v.smbmount_arg) )
+- {
+- }
+- }
+- else /*>=SMBMOUNT_206*/
+- {
+- argv[++argnr]="-o";
+- argv[++argnr]=commandstr;
+- sprintf(commandstr,"username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,ip=%s,debug=0",
+- smbuser,smbpasswd,filemode,dirmode,uid,gid,ipaddr);
+- if (*group_name)
+- {
+- strcat(commandstr,",workgroup=");
+- strcat(commandstr,escape_str(group_name,&strlist));
++ argv[++argnr]= escape_str(group_name,&strlist);
+ }
+ if ( (port >= 0) && (port < 65536) )
+ {
+- string_ncat(commandstr, ",port=", MAXMNTCOMMANDL);
+- string_ncat(commandstr, port_str, MAXMNTCOMMANDL);
++ strcat(tmp, ":");
++ strcat(tmp, port_str);
+ }
+ if ( !is_empty_string(pref.v.smbmount_arg) )
+ {
+- if ( pref.v.smbmount_arg[0] != ',' )
+- string_ncat(commandstr, ",", MAXMNTCOMMANDL);
+- string_ncat(commandstr, escape_str(pref.v.smbmount_arg,&strlist), MAXMNTCOMMANDL);
++ split_arguments(pref.v.smbmount_arg, argv, &argnr, &strlist);
+ }
+ }
++ argv[++argnr]=commandstr1;
++ argv[++argnr]=mount_point;
+ argv[++argnr]=NULL;
+ }
+ }
+- slist_free_with_data(&strlist);
+ mountdat=g_malloc(sizeof(MOUNT_STRUCT));
+ if((pipe2_nok=pipe(fdstdout))|| (pipe3_nok=pipe(fdstderr))||
+ (mountdat->childpid =fork())== -1)
+@@ -521,7 +486,6 @@
+ g_print(_("smbmount pipe,fork error\n"));
+ return;
+ }
+-
+ if (!mountdat->childpid)
+ {
+ close(fdstdout[0]);
+@@ -536,7 +500,7 @@
+ if (sumount)
+ execvp("su",argv);
+ else
+- execvp(pref_get_smbmount_exe(),argv);
++ execvp_with_password(argv[0], argv, smbpasswd, strlist);
+ write(STDERR_FILENO,notfound,sizeof(notfound)-1);
+ _exit(0);
+ }
+@@ -547,9 +511,9 @@
+ else
+ {
+ i=0;
+- while(argv[i+1])
++ while(argv[i])
+ {
+- mountdat->arglist[i]=g_strdup(argv[i+1]);
++ mountdat->arglist[i]=g_strdup(argv[i]);
+ i++;
+ }
+ mountdat->arglist[i]=NULL;
+@@ -611,46 +575,9 @@
+ }
+ else
+ {
+- if(linux2_0)
+- {
+- if (*smbpasswd!=0) argv[argnr-1]=dummysmbpasswd;
+- }
+- else
+- {
+- if (pref.v.smbmount_version<SMBMOUNT_206)
+- sprintf(userpasswd,"-U%s%%%s",smbuser,dummysmbpasswd);
+- else
+- {
+- sprintf(commandstr,"username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,ip=%s,debug=0",
+- smbuser,dummysmbpasswd,filemode,dirmode,uid,gid,ipaddr);
+- if (*group_name){
+- strcat(commandstr,",workgroup=");
+- strcat(commandstr,group_name);
+- }
+- if ( (port >= 0) && (port < 65536) )
+- {
+- string_ncat(commandstr, ",port=", MAXMNTCOMMANDL);
+- string_ncat(commandstr, port_str, MAXMNTCOMMANDL);
+- }
+- if ( !is_empty_string(pref.v.smbmount_arg) )
+- {
+- if ( pref.v.smbmount_arg[0] != ',' )
+- string_ncat(commandstr, ",", MAXMNTCOMMANDL);
+- string_ncat(commandstr, escape_str(pref.v.smbmount_arg,&strlist), MAXMNTCOMMANDL);
+- }
+- }
+- if (passw_lf)
+- {
+- usleep(50000);
+- close(fdstdin[0]);
+- if (!waitpid(mountdat->childpid,NULL,WNOHANG))
+- write(fdstdin[1], "\n",1);
++ log_execvp_str(argv[0],argv);
+ close(fdstdin[1]);
+ }
+- }
+-
+- log_execvp_str(pref_get_smbmount_exe(),argv);
+- }
+ mountlist=g_slist_append(mountlist,mountdat);
+ mountdat->linepos=0; mountdat->linepos2=0;
+ mountdat->linenum=0;
+@@ -901,17 +828,13 @@
+ }
+ else
+ {
+- argv[0]=smb ? "smbumount":"umount";
+- argv[1]=mount_point;
++ // bugfix: mount command might consist of more than one word (example: sudo mount_smbfs)
++ int argnr = -1;
++ split_arguments(pref_get_smbumount_exe(), argv, &argnr, &strlist);
+ if ( !is_empty_string(pref.v.smbumount_arg) )
+- {
+- argv[2] = pref.v.smbumount_arg;
+- argv[3] = NULL;
+- }
+- else
+- {
+- argv[2]=NULL;
+- }
++ split_arguments(pref.v.smbumount_arg, argv, &argnr, &strlist);
++ argv[++argnr]=mount_point;
++ argv[++argnr] = NULL;
+ }
+ if((pipe2_nok=pipe(fdstdout))|| (pipe3_nok=pipe(fdstderr))||
+ (childpid =fork())== -1)
+@@ -938,7 +861,7 @@
+ execvp("su",argv);
+ }
+ else
+- execvp(smb ? pref_get_smbumount_exe():"umount",argv);
++ execvp_with_password(argv[0], argv, "", strlist);
+ write(STDERR_FILENO,notfound,sizeof(notfound)-1);
+ _exit(0);
+ }
+@@ -958,7 +881,7 @@
+ gui_log_window_insert_string("*",0);
+ }
+ else
+- log_execvp_str(smb ? pref_get_smbumount_exe():"umount",argv);
++ log_execvp_str(argv[0], argv);
+ mountdat=g_malloc(sizeof(UMOUNT_STRUCT));
+ umountlist=g_slist_append(umountlist,mountdat);
+ mountdat->childpid=childpid;
+@@ -1015,6 +938,198 @@
+ slist_free_with_data(&umountlist);
+ }
+
++void split_arguments(char * arguments, char * argv[], int * argnr, GSList ** strlist)
++{
++ char * c = argv[++*argnr] = storeInBuffer(arguments, strlist);
++ while(c = strchr(c, ' '))
++ {
++ char *d = c+1;
++ while(*d && *d == ' ')
++ d++;
++ *c = 0;
++ c = d;
++ if (!*c)
++ break;
++ argv[++*argnr] = storeInBuffer(c, strlist);
++ }
++}
++
++char * storeInBuffer(const char * s, GSList ** strlist)
++{
++ int n;
++ char * ss;
++
++ if (*s==0) return 0;
++ n = strlen(s);
++ ss=g_malloc(n+1);
++ strcpy(ss, s);
++ *strlist=g_slist_append(*strlist,ss);
++ return ss;
++}
++
++
++// this looks like a global variable. But each forked execvp_with_password
++// process has one copy of it. So it as a process local varible storing the
++// process ID of the forked child process, which actaully execs mount_smbfs
++int _childPid = 0;
++
++// called, if the child proces is killed. Kills its child process as well
++void stopMountSignalHandler (int sig)
++{
++ kill(_childPid, SIGINT);
++ waitpid(_childPid, 0, WUNTRACED);
++ _exit(0);
++}
++
++// replaces execvp to call mount_smbfs. If mount smbfs asks for a password, it is provided.
++// This can not be sent to stdin, because BSD gets the password directly from the terminal.
++// Therfore another process with a pseudo terminal is created.
++void execvp_with_password(const char * path, char * const argv[], const char * passwd, GSList *strlist)
++{
++ int master, i;
++ char terminal[MAXPATHLEN] = "";
++ char * pw = NULL;
++ int slave;
++ char password[1024], result[1024];
++ char * passwordText = "password:";
++ int passwordTextLen = strlen(passwordText);
++ char * resp_pos = result;
++ int fdstderr[2];
++
++ // create a pipe to the child process for stderr. For stdout the pseudo terminal is used
++ if(pipe(fdstderr))
++ {
++ fdstderr[0] = 0;
++ fdstderr[1] = 0;
++ }
++
++ // create the child process and the pseudo terminal
++ _childPid = forkpty(&master, terminal, NULL, NULL);
++
++ if (_childPid < 0)
++ {
++ if (errno == ENOENT)
++ printf("Error: Out of ptys\n");
++ else
++ printf(result, "Error: Forkpty\n");
++ _exit(1);
++ }
++ else if (_childPid == 0)
++ {
++ // prepare stderr pipe
++ if (fdstderr[0])
++ {
++ close(fdstderr[0]);
++ dup2(fdstderr[1], STDERR_FILENO);
++ }
++
++ // prepare the pseudo terminal
++ close(master);
++ slave = open(terminal, O_RDWR);
++ if (slave < 0)
++ {
++ printf("open() failed: %s", strerror(errno));
++ kill(_childPid, SIGINT);
++ waitpid(_childPid, 0, WUNTRACED);
++ _exit(1);
++ }
+
++ // launch application (mount_smbfs)
++ execvp(path, argv);
++ printf("error: %d (%s)\n", errno, strerror(errno));
++ }
++ else
++ {
++ // prepare the stderr pipe
++ if (fdstderr[1])
++ close(fdstderr[1]);
+
++ // install the SIGIN (ctrl-c) handler
++ if (signal(SIGINT, stopMountSignalHandler) == SIG_ERR)
++ printf("error: can not install SIGINT handler\n");
++ errno = 0;
++ *resp_pos = 0;
++
++ // main loop: wait for childs response
++ while (!errno)
++ {
++ // prepare a poll, wich waits for output from the pseudo terminal and from stderr
++ int pollnum = 1;
++ struct pollfd polldat[2];
++ polldat[0].fd = master;
++ polldat[0].events = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI;
++ if (fdstderr[0])
++ {
++ pollnum = 2;
++ polldat[1].fd = fdstderr[0];
++ polldat[1].events = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI;
++ }
++
++ // sleep until the child terminates or sends something
++ if (poll(polldat, pollnum, 1000) < 0)
++ break;
+
++ // response from childs stderr?
++ if (pollnum == 2 && polldat[1].revents)
++ {
++ // read response and send it to this process' stderr. It is connected
++ // with another pipe with the main process!
++ char s[1024];
++ int i = read(fdstderr[0], s, 1024);
++ if (errno)
++ break;
++ if (i > 0)
++ {
++ s[i] = 0;
++ write(STDERR_FILENO, s, i);
++ }
++ }
++
++ // response from childs stdout?
++ if (polldat[0].revents)
++ {
++ // read response and send it to this process' stdout. It is connected
++ // with another pipe with the main process. If the string 'password'
++ // was send, provide the password
++ char c;
++ if (read(master, &c, 1) <= 0 || errno)
++ break;
++ if (resp_pos - result < sizeof(result))
++ *resp_pos++ = c;
++ *resp_pos = 0;
++ if (c == '\n')
++ {
++ printf("%s", result);
++ resp_pos = result;
++ }
++ *resp_pos = 0;
++ if (resp_pos - result >= passwordTextLen && !strcasecmp(resp_pos-passwordTextLen, passwordText))
++ {
++ // prepare the password and send it through the pseudo terminal
++ strcpy(password, passwd);
++ strcat(password, "\n");
++ resp_pos = result;
++ *resp_pos = 0;
++ write(master, password, strlen(password));
++ }
++ }
++ // if the child is dead, end main loop
++ if (waitpid(_childPid,NULL,WNOHANG))
++ break;
++ }
++
++ // if there is unsend response, send it to the main process
++ printf("%s", result);
++
++ // free resources
++ if (fdstderr[0])
++ close(fdstderr[0]);
++ close(master);
++ slist_free_with_data(&strlist);
++
++ // get childs return code to avoid zombies
++ waitpid(_childPid, 0, WUNTRACED);
++ _exit(0);
++ }
++ _exit(-1); // can not be reached
++}
diff --git a/net/linneighborhood/files/patch-utility.c b/net/linneighborhood/files/patch-utility.c
new file mode 100644
index 000000000000..8ce3d9582a6b
--- /dev/null
+++ b/net/linneighborhood/files/patch-utility.c
@@ -0,0 +1,22 @@
+--- src/utility.c.orig Sun Jun 9 09:58:43 2002
++++ src/utility.c Thu Feb 13 09:56:06 2003
+@@ -16,6 +16,7 @@
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -421,9 +422,9 @@
+ unsigned char path_exist (char *path)
+ {
+ DIR *dir;
+-
+ dir = opendir(path);
+- closedir(dir);
++ if (dir)
++ closedir(dir);
+ return ( dir != NULL ) ? 1 : 0;
+ }
+
diff --git a/net/linneighborhood/pkg-descr b/net/linneighborhood/pkg-descr
new file mode 100644
index 000000000000..085bd06e29c0
--- /dev/null
+++ b/net/linneighborhood/pkg-descr
@@ -0,0 +1,11 @@
+LinNeighborhood is a Xwindow graphical port of Network Neighborhood,
+running over Samba utilities and the smbfs.
+
+It permits to browse an SMB (CIFS) network consisting of Samba,
+Windows (WfWg, 95, 98, NT) and probably (not tested) OS/2, LanManager
+for DOS and others. It also offers an interface to mount the found shares.
+
+WWW: http://www.bnro.de/~schmidjo/index.html
+
+--
+h.eichmann@gmx.de
diff --git a/net/linneighborhood/pkg-message b/net/linneighborhood/pkg-message
new file mode 100644
index 000000000000..e42459682b08
--- /dev/null
+++ b/net/linneighborhood/pkg-message
@@ -0,0 +1,9 @@
+To mount shares with LinNeighborhood, there are the following possibilities:
+ - run it as root. (not recommended)
+ - give LinNeighborhood the suid flag (not recommended)
+ - give mount_smbfs and umount the suid flag (very bad!)
+ - install and configure sudo correctly and replace mount_smbfs and umount
+ in the preferences by "sudo mount_smbfs" and "sudo umount" (recommended).
+ Make sure, that all sudo rules concerning mount and umount have the
+ NOPASSWD flag. Otherwise two password questions might occur (one
+ from sudo and one from mount_smbfs) which will definitely go wrong.
diff --git a/net/linneighborhood/pkg-plist b/net/linneighborhood/pkg-plist
new file mode 100644
index 000000000000..33f102cb00a7
--- /dev/null
+++ b/net/linneighborhood/pkg-plist
@@ -0,0 +1,15 @@
+bin/LinNeighborhood
+lib/charset.alias
+share/locale/de/LC_MESSAGES/LinNeighborhood.mo
+share/locale/sv/LC_MESSAGES/LinNeighborhood.mo
+share/locale/locale.alias
+share/locale/ja/LC_MESSAGES/LinNeighborhood.mo
+share/locale/fr/LC_MESSAGES/LinNeighborhood.mo
+share/locale/ru/LC_MESSAGES/LinNeighborhood.mo
+share/locale/es/LC_MESSAGES/LinNeighborhood.mo
+share/locale/pt_BR/LC_MESSAGES/LinNeighborhood.mo
+share/locale/tr/LC_MESSAGES/LinNeighborhood.mo
+share/locale/pl/LC_MESSAGES/LinNeighborhood.mo
+share/locale/it/LC_MESSAGES/LinNeighborhood.mo
+share/locale/zh_TW/LC_MESSAGES/LinNeighborhood.mo
+share/icons/LinNeighborhood.xpm
diff --git a/sysutils/Makefile b/sysutils/Makefile
index d59570581e0d..1b7ecc3b8280 100644
--- a/sysutils/Makefile
+++ b/sysutils/Makefile
@@ -127,6 +127,7 @@
SUBDIR += lfm
SUBDIR += libchk
SUBDIR += libretto-config
+ SUBDIR += linneighborhood
SUBDIR += linux-acu
SUBDIR += linux-e2fsprogs
SUBDIR += lire
diff --git a/sysutils/linneighborhood/Makefile b/sysutils/linneighborhood/Makefile
new file mode 100644
index 000000000000..cbc0645e7731
--- /dev/null
+++ b/sysutils/linneighborhood/Makefile
@@ -0,0 +1,30 @@
+# New ports collection makefile for: LinNeighborhood
+# Please read files/porters-note!
+# Date created: 2003/04/06
+# Whom: Heiner <h.eichmann@gmx.de>
+#
+# $FreeBSD$
+#
+
+PORTNAME= LinNeighborhood
+PORTVERSION= 0.6.5
+CATEGORIES= sysutils
+MASTER_SITES= http://www.bnro.de/~schmidjo/download/
+
+MAINTAINER= h.eichmann@gmx.de
+COMMENT= GTK+ gui for browsing and mounting SMB filesystems
+
+LIB_DEPENDS= intl.4:${PORTSDIR}/devel/gettext
+RUN_DEPENDS= smbclient:${PORTSDIR}/net/samba
+
+GNU_CONFIGURE= yes
+USE_GMAKE= yes
+USE_GNOME= gtk12
+
+pre-configure:
+ ${CP} ${FILESDIR}/mntent* ${WRKSRC}/src
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/sysutils/linneighborhood/distinfo b/sysutils/linneighborhood/distinfo
new file mode 100644
index 000000000000..102d0a481c04
--- /dev/null
+++ b/sysutils/linneighborhood/distinfo
@@ -0,0 +1 @@
+MD5 (LinNeighborhood-0.6.5.tar.gz) = 5e50c9cef403164aca22be9ade0a7dbf
diff --git a/sysutils/linneighborhood/files/mntent.h b/sysutils/linneighborhood/files/mntent.h
new file mode 100644
index 000000000000..1e37778b2178
--- /dev/null
+++ b/sysutils/linneighborhood/files/mntent.h
@@ -0,0 +1,35 @@
+#ifdef HAVE_MNTENT_H
+#include <mntent.h>
+#else
+
+#ifndef mntent_h_
+#define mntent_h_
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/ucred.h>
+#include <sys/mount.h>
+
+#define MOUNTED "mounted"
+#define MNTTYPE_NFS "nfs"
+
+//#define MOPTSLEN (256 - (MNAMELEN * 2 + MFSNAMELEN + 2 * sizeof(int)))
+
+struct mntent {
+ char *mnt_fsname; /* file system name */
+ char *mnt_dir; /* file system path prefix */
+ char *mnt_type; /* dbg, efs, nfs */
+ char *mnt_opts; /* ro, hide, etc. */
+ int mnt_freq; /* dump frequency, in days */
+ int mnt_passno; /* pass number on parallel fsck */
+};
+
+FILE * setmntent(char * filep, char * type);
+struct mntent *getmntent(FILE * filep);
+//char * hasmntopt(struct mntent * mnt, char * opt);
+int endmntent(FILE * filep);
+
+#endif /* mntent_h_ */
+#endif /* not HAVE_MNTENT_H */
diff --git a/sysutils/linneighborhood/files/mntent_compat.c b/sysutils/linneighborhood/files/mntent_compat.c
new file mode 100644
index 000000000000..d8e6f9b32b94
--- /dev/null
+++ b/sysutils/linneighborhood/files/mntent_compat.c
@@ -0,0 +1,107 @@
+#include "mntent.h"
+#include <sys/types.h>
+#include <sys/wait.h>
+
+char mntent_global_mnt_fsname[1024];
+char mntent_global_mnt_dir[1024];
+char mntent_global_mnt_type[1024];
+char mntent_global_mnt_opts[1024];
+
+struct mntent mntent_global_mntent;
+
+FILE * setmntent(char * filep, char * type)
+{
+ char * tempFileName = tmpnam(0);
+ FILE * tempFile = 0;
+ char s[256];
+ int i;
+
+ sprintf(s, "mount -p > %s", tempFileName);
+ i = system(s);
+ if (i == 127 || i == -1 || !WIFEXITED(i) || WEXITSTATUS(i))
+ {
+ unlink(tempFileName);
+ return 0;
+ }
+ tempFile = fopen(tempFileName, type);
+ unlink(tempFileName);
+ return tempFile;
+}
+
+struct mntent *getmntent(FILE * filep)
+{
+ char *p, c, tmp[32];
+ int field = 0;
+ mntent_global_mntent.mnt_fsname = mntent_global_mnt_fsname;
+ mntent_global_mntent.mnt_dir = mntent_global_mnt_dir;
+ mntent_global_mntent.mnt_type = mntent_global_mnt_type;
+ mntent_global_mntent.mnt_opts = mntent_global_mnt_opts;
+ mntent_global_mntent.mnt_freq = 0;
+ mntent_global_mntent.mnt_passno = 0;
+ *mntent_global_mnt_fsname = 0;
+ *mntent_global_mnt_dir = 0;
+ *mntent_global_mnt_type = 0;
+ *mntent_global_mnt_opts = 0;
+
+ if (feof(filep))
+ return 0;
+ p = mntent_global_mnt_fsname;
+ while (!feof(filep))
+ {
+ c = fgetc(filep);
+ if (c == ' ' || c == '\t' || c == '\n')
+ {
+ *p = 0;
+ switch (field)
+ {
+ case 0:
+ case 2:
+ case 4:
+ case 6:
+ ++field;
+ break;
+ case 8:
+ mntent_global_mntent.mnt_freq = atoi(tmp);
+ ++field;
+ break;
+ case 10:
+ mntent_global_mntent.mnt_passno = atoi(tmp);
+ ++field;
+ break;
+ }
+ p = 0;
+ if (c == '\n')
+ return & mntent_global_mntent;
+ continue;
+ }
+ if (!p)
+ {
+ switch (field)
+ {
+ case 1:
+ p = mntent_global_mnt_dir;
+ break;
+ case 3:
+ p = mntent_global_mnt_type;
+ break;
+ case 5:
+ p = mntent_global_mnt_opts;
+ break;
+ case 7:
+ case 9:
+ p = tmp;
+ break;
+ }
+ ++field;
+ }
+ *p++ = c;
+ }
+
+ return 0;
+}
+
+//char * hasmntopt(struct mntent * mnt, char * opt);
+int endmntent(FILE * filep)
+{
+ return fclose(filep);
+}
diff --git a/sysutils/linneighborhood/files/patch-Makefile.in b/sysutils/linneighborhood/files/patch-Makefile.in
new file mode 100644
index 000000000000..4f666cbaac08
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-Makefile.in
@@ -0,0 +1,29 @@
+--- src/Makefile.in.orig Sun Jun 9 09:58:47 2002
++++ src/Makefile.in Thu Feb 13 09:05:55 2003
+@@ -88,14 +88,14 @@
+ localedir = @localedir@
+
+ bin_PROGRAMS = LinNeighborhood
+-LinNeighborhood_SOURCES = browsewrap.c data.c filesystem.c gtk_dialog.c gtk_gui.c gtk_mountdlg.c gtk_sharewindow.c gtk_tree.c guiwrap.c io.c libsmb.c lmhosts.c main.c preferences.c smbbrowse.c smbmount.c utility.c
++LinNeighborhood_SOURCES = browsewrap.c data.c filesystem.c gtk_dialog.c gtk_gui.c gtk_mountdlg.c gtk_sharewindow.c gtk_tree.c guiwrap.c io.c libsmb.c lmhosts.c main.c preferences.c smbbrowse.c smbmount.c utility.c mntent_compat.c
+
+-noinst_HEADERS = browsewrap.h data.h define.h filesystem.h gtk_dialog.h gtk_gui.h gtk_mountdlg.h gtk_sharewindow.h gtk_tree.h guiwrap.h io.h libsmb.h preferences.h samba.h smbif.h utility.h
++noinst_HEADERS = browsewrap.h data.h define.h filesystem.h gtk_dialog.h gtk_gui.h gtk_mountdlg.h gtk_sharewindow.h gtk_tree.h guiwrap.h io.h libsmb.h preferences.h samba.h smbif.h utility.h mntent.h
+
+
+ LinNeighborhood_LDADD = @GTK_LIBS@
+ INCLUDES = @GTK_CFLAGS@ -DLIBDIR=\"$(libdir)\" -DDATADIR=\"$(datadir)\"
+-LIBS = @GTK_LIBS@ -lpthread
++LIBS = @GTK_LIBS@ -lc_r -lutil
+
+ EXTRA_DIST = picture
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+@@ -110,7 +110,7 @@
+ LinNeighborhood_OBJECTS = browsewrap.o data.o filesystem.o gtk_dialog.o \
+ gtk_gui.o gtk_mountdlg.o gtk_sharewindow.o gtk_tree.o guiwrap.o io.o \
+ libsmb.o lmhosts.o main.o preferences.o smbbrowse.o smbmount.o \
+-utility.o
++utility.o mntent_compat.o
+ LinNeighborhood_DEPENDENCIES =
+ LinNeighborhood_LDFLAGS =
+ CFLAGS = @CFLAGS@
diff --git a/sysutils/linneighborhood/files/patch-configure b/sysutils/linneighborhood/files/patch-configure
new file mode 100644
index 000000000000..145bad4a5e06
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-configure
@@ -0,0 +1,32 @@
+--- configure.orig Sun Jun 9 09:58:45 2002
++++ configure Thu Feb 13 07:53:13 2003
+@@ -4800,13 +4800,13 @@
+ { (exit 1); exit 1; }; }
+ fi
+
+-echo "$as_me:4803: checking for pthread_exit in -lpthread" >&5
+-echo $ECHO_N "checking for pthread_exit in -lpthread... $ECHO_C" >&6
++echo "$as_me:4803: checking for pthread_exit in -lc_r" >&5
++echo $ECHO_N "checking for pthread_exit in -lc_r... $ECHO_C" >&6
+ if test "${ac_cv_lib_pthread_pthread_exit+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+-LIBS="-lpthread $LIBS"
++LIBS="-lc_r $LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+ #line 4811 "configure"
+ #include "confdefs.h"
+@@ -4857,10 +4857,10 @@
+
+ if test "x$lib_pthread" = "xno" ; then
+ { { echo "$as_me:4859: error:
+- *** libpthread.so: posix thread library no found ***
++ *** libc_r.so: posix thread library no found ***
+ " >&5
+ echo "$as_me: error:
+- *** libpthread.so: posix thread library no found ***
++ *** libc_r.so: posix thread library no found ***
+ " >&2;}
+ { (exit 1); exit 1; }; }
+ fi
diff --git a/sysutils/linneighborhood/files/patch-data.c b/sysutils/linneighborhood/files/patch-data.c
new file mode 100644
index 000000000000..7138363dbe20
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-data.c
@@ -0,0 +1,12 @@
+--- src/data.c.orig Thu Apr 10 21:59:12 2003
++++ src/data.c Thu Apr 10 22:45:59 2003
+@@ -171,6 +171,9 @@
+ {
+ if ( mount )
+ {
++ char *c = strchr(mount->machine, '@'); // remove user name from smb name
++ if (c)
++ memmove(mount->machine, c+1, strlen(c)+1);
+ if ( mount_list_search_by_mountpoint(mount->mountpoint) == NULL )
+ {
+ mountlist = g_slist_append(mountlist, mount);
diff --git a/sysutils/linneighborhood/files/patch-gtk_dialog.c b/sysutils/linneighborhood/files/patch-gtk_dialog.c
new file mode 100644
index 000000000000..357795ad7b26
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-gtk_dialog.c
@@ -0,0 +1,55 @@
+--- src/gtk_dialog.c.orig Sun Apr 6 13:07:13 2003
++++ src/gtk_dialog.c Sun Apr 6 13:10:50 2003
+@@ -2039,34 +2039,34 @@
+ gtk_widget_show(button);
+
+ frame = gtk_frame_new(_(" smbmount version "));
+- gtk_container_border_width(GTK_CONTAINER(frame), 3);
+- gtk_box_pack_start(GTK_BOX(frame_vbox), frame, FALSE, TRUE, 0);
+- gtk_widget_show(frame);
++// gtk_container_border_width(GTK_CONTAINER(frame), 3);
++// gtk_box_pack_start(GTK_BOX(frame_vbox), frame, FALSE, TRUE, 0);
++// gtk_widget_show(frame);
+
+ frame_vbox = gtk_vbox_new(FALSE, 0);
+- gtk_container_border_width(GTK_CONTAINER(frame_vbox), 5);
+- gtk_container_add(GTK_CONTAINER(frame), frame_vbox);
+- gtk_widget_show(frame_vbox);
++// gtk_container_border_width(GTK_CONTAINER(frame_vbox), 5);
++// gtk_container_add(GTK_CONTAINER(frame), frame_vbox);
++// gtk_widget_show(frame_vbox);
+
+ smbmount_204_radio = gtk_radio_button_new_with_label(NULL, _("version <= 2.0.4"));
+- if ( globals.linux_version < LINUX_2_2 )
+- gtk_widget_set_sensitive(smbmount_204_radio, FALSE);
+- gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_204_radio, FALSE, TRUE, 0);
+- gtk_widget_show(smbmount_204_radio);
++// if ( globals.linux_version < LINUX_2_2 )
++// gtk_widget_set_sensitive(smbmount_204_radio, FALSE);
++// gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_204_radio, FALSE, TRUE, 0);
++// gtk_widget_show(smbmount_204_radio);
+
+ smbmount_205_radio = gtk_radio_button_new_with_label(
+ gtk_radio_button_group(GTK_RADIO_BUTTON(smbmount_204_radio)), _("version = 2.0.5"));
+- if ( globals.linux_version < LINUX_2_2 )
+- gtk_widget_set_sensitive(smbmount_205_radio, FALSE);
+- gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_205_radio, FALSE, TRUE, 0);
+- gtk_widget_show(smbmount_205_radio);
++// if ( globals.linux_version < LINUX_2_2 )
++// gtk_widget_set_sensitive(smbmount_205_radio, FALSE);
++// gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_205_radio, FALSE, TRUE, 0);
++// gtk_widget_show(smbmount_205_radio);
+
+ smbmount_206_radio = gtk_radio_button_new_with_label(
+ gtk_radio_button_group(GTK_RADIO_BUTTON(smbmount_205_radio)), _("version >= 2.0.6"));
+- if ( globals.linux_version < LINUX_2_2 )
+- gtk_widget_set_sensitive(smbmount_206_radio, FALSE);
+- gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_206_radio, FALSE, TRUE, 0);
+- gtk_widget_show(smbmount_206_radio);
++// if ( globals.linux_version < LINUX_2_2 )
++// gtk_widget_set_sensitive(smbmount_206_radio, FALSE);
++// gtk_box_pack_start(GTK_BOX(frame_vbox), smbmount_206_radio, FALSE, TRUE, 0);
++// gtk_widget_show(smbmount_206_radio);
+
+ switch ( pref.v.smbmount_version )
+ {
diff --git a/sysutils/linneighborhood/files/patch-gtk_mountdlg.c b/sysutils/linneighborhood/files/patch-gtk_mountdlg.c
new file mode 100644
index 000000000000..39a88713af63
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-gtk_mountdlg.c
@@ -0,0 +1,103 @@
+--- src/gtk_mountdlg.c.orig Wed Apr 9 19:51:41 2003
++++ src/gtk_mountdlg.c Wed Apr 9 20:18:14 2003
+@@ -726,65 +726,65 @@
+
+ /*root password */
+ frame = gtk_frame_new(_("Mount as Root"));
+- gtk_box_pack_start(GTK_BOX (GTK_DIALOG (mount_dlg)->vbox), frame, TRUE, TRUE, 5);
+- gtk_widget_show(frame);
++// gtk_box_pack_start(GTK_BOX (GTK_DIALOG (mount_dlg)->vbox), frame, TRUE, TRUE, 5);
++// gtk_widget_show(frame);
+
+ vbox=gtk_vbox_new(FALSE,0);
+- gtk_container_border_width(GTK_CONTAINER(vbox), 3);
+- gtk_container_add(GTK_CONTAINER(frame),vbox);
+- gtk_widget_show(vbox);
++// gtk_container_border_width(GTK_CONTAINER(vbox), 3);
++// gtk_container_add(GTK_CONTAINER(frame),vbox);
++// gtk_widget_show(vbox);
+
+ hbox=gtk_hbox_new(FALSE,0);
+ /* gtk_box_pack_start(GTK_BOX (GTK_DIALOG (mount_dlg)->vbox),
+ hbox, TRUE, TRUE, 5);
+ gtk_container_border_width(GTK_CONTAINER(hbox), 3);
+ gtk_container_add(GTK_CONTAINER(frame),hbox); */
+- gtk_box_pack_start(GTK_BOX (vbox),hbox, TRUE, TRUE, 0);
+- gtk_widget_show(hbox);
++// gtk_box_pack_start(GTK_BOX (vbox),hbox, TRUE, TRUE, 0);
++// gtk_widget_show(hbox);
+
+ sumountcheckbox = gtk_check_button_new_with_label(_("OK"));
+ /* gtk_widget_set_usize(sumountcheckbox,120,-1); */
+- if (geteuid()==0) /*No root password if you are root*/
+- gtk_widget_set_sensitive(sumountcheckbox,FALSE);
+- gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sumountcheckbox),cachesupwd & sumount);
+- gtk_box_pack_start (GTK_BOX (hbox), sumountcheckbox, FALSE, TRUE, 0);
+- gtk_widget_show (sumountcheckbox);
++// if (geteuid()==0) /*No root password if you are root*/
++// gtk_widget_set_sensitive(sumountcheckbox,FALSE);
++// gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sumountcheckbox),cachesupwd & sumount);
++// gtk_box_pack_start (GTK_BOX (hbox), sumountcheckbox, FALSE, TRUE, 0);
++// gtk_widget_show (sumountcheckbox);
+
+ label=gtk_label_new(_("Password:"));
+- gtk_box_pack_start(GTK_BOX (hbox),label, FALSE, TRUE, 0);
++// gtk_box_pack_start(GTK_BOX (hbox),label, FALSE, TRUE, 0);
+ /* gtk_widget_set_usize(label,100,-1); */
+- gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_LEFT);
+- gtk_widget_show(label);
++// gtk_label_set_justify(GTK_LABEL(label),GTK_JUSTIFY_LEFT);
++// gtk_widget_show(label);
+
+ supasswdentry= gtk_entry_new_with_max_length(MASTER_LEN);
+- gtk_entry_set_visibility(GTK_ENTRY(supasswdentry), 0);
++// gtk_entry_set_visibility(GTK_ENTRY(supasswdentry), 0);
+
+- if (sumount && cachesupwd)
+- gtk_entry_set_text (GTK_ENTRY (supasswdentry), supasswd);
+- else
+- gtk_entry_set_text (GTK_ENTRY (supasswdentry), "");
++// if (sumount && cachesupwd)
++// gtk_entry_set_text (GTK_ENTRY (supasswdentry), supasswd);
++// else
++// gtk_entry_set_text (GTK_ENTRY (supasswdentry), "");
+
+- gtk_widget_set_sensitive(supasswdentry,sumount&cachesupwd);
+- gtk_signal_connect_object(GTK_OBJECT(supasswdentry), "key_press_event",
+- GTK_SIGNAL_FUNC(smb_mount_key_press_callback), NULL);
+- gtk_box_pack_start (GTK_BOX (hbox), supasswdentry, TRUE, TRUE, 5);
+- gtk_widget_show (supasswdentry);
+- gtk_signal_connect (GTK_OBJECT(sumountcheckbox), "toggled",
+- GTK_SIGNAL_FUNC(supwentry_toggle_sensitive),supasswdentry);
++// gtk_widget_set_sensitive(supasswdentry,sumount&cachesupwd);
++// gtk_signal_connect_object(GTK_OBJECT(supasswdentry), "key_press_event",
++// GTK_SIGNAL_FUNC(smb_mount_key_press_callback), NULL);
++// gtk_box_pack_start (GTK_BOX (hbox), supasswdentry, TRUE, TRUE, 5);
++// gtk_widget_show (supasswdentry);
++// gtk_signal_connect (GTK_OBJECT(sumountcheckbox), "toggled",
++// GTK_SIGNAL_FUNC(supwentry_toggle_sensitive),supasswdentry);
+
+ hbox=gtk_hbox_new(FALSE,0);
+- gtk_box_pack_start(GTK_BOX (vbox),hbox, TRUE, TRUE, 0);
+- gtk_widget_show(hbox);
++// gtk_box_pack_start(GTK_BOX (vbox),hbox, TRUE, TRUE, 0);
++// gtk_widget_show(hbox);
+
+ sucachepwdcheckbox = gtk_check_button_new_with_label(_("Cache Root Password"));
+
+ /* gtk_widget_set_usize(sumountcheckbox,120,-1); */
+- if (geteuid()==0)
+- gtk_widget_set_sensitive(sumountcheckbox,FALSE);
+- gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sucachepwdcheckbox),cachesupwd &sumount);
+- gtk_widget_set_sensitive(sucachepwdcheckbox,sumount);
+- gtk_box_pack_start (GTK_BOX (hbox), sucachepwdcheckbox, FALSE, TRUE, 0);
+- gtk_widget_show (sucachepwdcheckbox);
++// if (geteuid()==0)
++// gtk_widget_set_sensitive(sumountcheckbox,FALSE);
++// gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(sucachepwdcheckbox),cachesupwd &sumount);
++// gtk_widget_set_sensitive(sucachepwdcheckbox,sumount);
++// gtk_box_pack_start (GTK_BOX (hbox), sucachepwdcheckbox, FALSE, TRUE, 0);
++// gtk_widget_show (sucachepwdcheckbox);
+
+ /*-action_area*/
+ mount_button = gtk_button_new_with_label(_("Mount"));
diff --git a/sysutils/linneighborhood/files/patch-gtk_tree.c b/sysutils/linneighborhood/files/patch-gtk_tree.c
new file mode 100644
index 000000000000..f0f78a24942c
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-gtk_tree.c
@@ -0,0 +1,19 @@
+--- src/gtk_tree.c.orig Wed Apr 9 20:32:53 2003
++++ src/gtk_tree.c Wed Apr 9 20:48:24 2003
+@@ -2011,7 +2011,7 @@
+ if ( GTK_IS_TREE_ITEM(item) )
+ {
+ box = GTK_BIN(item)->child;
+-
++ if (!box) return itemtype;
+ step_list = GTK_BOX(box)->children->next; /* type entry */
+ child = step_list->data;
+ label = GTK_LABEL(child->widget);
+@@ -2033,7 +2033,6 @@
+ static unsigned int tree_item_count (GtkTreeItem *item)
+ {
+ unsigned int ireturn;
+-
+ if ( item != NULL )
+ {
+ if ( item->subtree )
diff --git a/sysutils/linneighborhood/files/patch-io.c b/sysutils/linneighborhood/files/patch-io.c
new file mode 100644
index 000000000000..6bc1993370ec
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-io.c
@@ -0,0 +1,18 @@
+--- src/io.c.orig Fri Apr 11 16:58:15 2003
++++ src/io.c Fri Apr 11 17:03:11 2003
+@@ -130,12 +130,12 @@
+ /* save only 'not root' mounts -> plain password */
+ if ( (mount != NULL) && (mount->type != mem_mount_root) )
+ {
+- string_ncopy(str, pref.v.smbmount_exe, MAXMACHNAMEL+MAXSHRNAMEL+PATH_LEN+19);
++ *str = 0;
+ temp = str;
+- temp += strlen(str);
+ merge_mount(&temp, mount, MAXMACHNAMEL+MAXSHRNAMEL+PATH_LEN+19 - strlen(str), 1);
+ string_ncat(str, "\n", MAXMACHNAMEL+MAXSHRNAMEL+PATH_LEN+19);
+- fwrite(str, 1, strlen(str), fd);
++ if (*temp == ' ') ++temp;
++ fwrite(temp, 1, strlen(temp), fd);
+ }
+ }
+ }
diff --git a/sysutils/linneighborhood/files/patch-lmhosts.c b/sysutils/linneighborhood/files/patch-lmhosts.c
new file mode 100644
index 000000000000..9fad8a3005b6
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-lmhosts.c
@@ -0,0 +1,10 @@
+--- src/lmhosts.c.orig Thu Feb 13 08:48:40 2003
++++ src/lmhosts.c Thu Feb 13 08:49:05 2003
+@@ -31,6 +31,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <ctype.h>
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <sys/socket.h>
+ #include <arpa/inet.h>
diff --git a/sysutils/linneighborhood/files/patch-preferences.c b/sysutils/linneighborhood/files/patch-preferences.c
new file mode 100644
index 000000000000..3addda166a3d
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-preferences.c
@@ -0,0 +1,22 @@
+--- src/preferences.c.orig Sun Jun 9 09:58:43 2002
++++ src/preferences.c Sun Apr 6 13:03:32 2003
+@@ -29,6 +29,8 @@
+ #include "data.h"
+ #include "utility.h"
+ #include "samba.h"
++#include <sys/types.h>
++#include <netinet/in.h>
+
+
+ #define LVERSION(major,minor,patch) (((((major)<<8)+(minor))<<8)+(patch))
+@@ -359,8 +361,8 @@
+ strcpy(pref->v.filemanager_exe, "xterm -e mc $MOUNTPOINT");
+ strcpy(pref->v.smbclient_exe, "smbclient");
+ strcpy(pref->v.nmblookup_exe, "nmblookup");
+- strcpy(pref->v.smbmount_exe, "smbmount");
+- strcpy(pref->v.smbumount_exe, "smbumount");
++ strcpy(pref->v.smbmount_exe, "mount_smbfs");
++ strcpy(pref->v.smbumount_exe, "umount");
+ pref->v.smbclient_arg[0] = 0;
+ pref->v.nmblookup_arg[0] = 0;
+ pref->v.smbmount_arg[0] = 0;
diff --git a/sysutils/linneighborhood/files/patch-smbbrowse.c b/sysutils/linneighborhood/files/patch-smbbrowse.c
new file mode 100644
index 000000000000..fd2f35d1fdfc
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-smbbrowse.c
@@ -0,0 +1,78 @@
+--- src/smbbrowse.c.orig Sun Jun 9 09:58:43 2002
++++ src/smbbrowse.c Thu Apr 10 15:39:19 2003
+@@ -716,8 +716,8 @@
+ browsedat->browse_state=search_head;
+ browsedat->lasttab=0;
+ if (*user==0){
+- strcpy(browsedat->userpasswdstr,"-U%");
+- strcpy(browsedat->userdummystr,"-U%");
++ strcpy(browsedat->userpasswdstr,"-N");
++ strcpy(browsedat->userdummystr,"-N");
+ }
+ else
+ {
+@@ -829,6 +829,12 @@
+ dup2(browsedat->fd[1],STDOUT_FILENO);
+
+ cArg[argcount++] = "nmblookup";
++ cArg[argcount++] = "-S";
++ cArg[argcount++] = "-d1";
++ for ( loop = 0; loop < add_argcount; loop++ )
++ {
++ cArg[argcount++] = cAddArg[loop];
++ }
+ if ( *wins_name )
+ {
+ cArg[argcount++] = "-U";
+@@ -841,12 +847,6 @@
+ cArg[argcount++] = "-M";
+ cArg[argcount++] = group_name;
+ }
+- cArg[argcount++] = "-S";
+- cArg[argcount++] = "-d1";
+- for ( loop = 0; loop < add_argcount; loop++ )
+- {
+- cArg[argcount++] = cAddArg[loop];
+- }
+ cArg[argcount++] = NULL;
+
+ execvp(pref_get_nmblookup_exe(), cArg);
+@@ -870,15 +870,16 @@
+ }
+ else
+ {
+- if (*wins_name)
+- sprintf(logstr,"GetSMBGroups:%s -U %s -R %s -S -d1",pref_get_nmblookup_exe(),wins_name,group_type);
+- else
+- sprintf(logstr,"GetSMBGroups:%s -M %s -S -d1",pref_get_nmblookup_exe(),group_name);
++ sprintf(logstr,"GetSMBGroups:%s -S -d1",pref_get_nmblookup_exe());
+ for ( loop = 0; loop < add_argcount; loop++ )
+ {
+ string_ncat(logstr, " ", MAXLOGSTRLEN);
+ string_ncat(logstr, cAddArg[loop], MAXLOGSTRLEN);
+ }
++ if (*wins_name)
++ sprintf(logstr+strlen(logstr)," -U %s -R %s",wins_name,group_type);
++ else
++ sprintf(logstr+strlen(logstr)," -M %s",group_name);
+ gui_log_window_insert_string(logstr,1);
+ close(browsedat->fd[1]);
+ browsedat->group_master.group_name[MAXGROUPNAMEL]=0;
+@@ -1028,7 +1029,7 @@
+ }
+ browsedat=g_malloc(sizeof(HBROWSE_STRUCT));
+ if (*user==0)
+- strcpy(commandstr,"-U%");
++ strcpy(commandstr,"-N");
+ else
+ sprintf(commandstr,"-U%s%%%s",user,passwd);
+
+@@ -1274,7 +1275,7 @@
+ }
+
+ if (*user==0)
+- strcpy(commandstr,"-U%");
++ strcpy(commandstr,"-N");
+ else
+ sprintf(commandstr,"-U%s%%%s",user,passwd);
+ argv[++argnr]="smbclient";
diff --git a/sysutils/linneighborhood/files/patch-smbmount.c b/sysutils/linneighborhood/files/patch-smbmount.c
new file mode 100644
index 000000000000..7d28983c406a
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-smbmount.c
@@ -0,0 +1,483 @@
+--- src/smbmount.c.orig Sun Jun 9 09:58:43 2002
++++ src/smbmount.c Fri Apr 11 16:55:26 2003
+@@ -16,6 +16,9 @@
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
++#include <sys/param.h>
++#include <errno.h>
++#include <poll.h>
+ #include <string.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -70,6 +73,9 @@
+ } UMOUNT_STRUCT;
+ static GSList *umountlist = NULL;
+
++void split_arguments(char * arguments, char * argv[], int * argnr, GSList ** strlist);
++char * storeInBuffer(const char * s, GSList ** strlist);
++void execvp_with_password(const char * path, char * const argv[], const char * passwd, GSList * strlist);
+
+ char suprompt[] = "Passw";
+
+@@ -322,6 +328,7 @@
+ int pipe2_nok,pipe3_nok=1;
+ int sumount,argnr=-1,passw_lf;
+ char commandstr[MAXMNTCOMMANDL],commandstr1[MAXMNTCOMMANDL];
++ char num1[10], num2[10], num3[10], num4[10], tmp[MAXMNTCOMMANDL];
+ char opt_group[MAXMNTCOMMANDL];
+ char dummysmbpasswd[64];
+ /*#ifdef LINUX2_0 */
+@@ -345,6 +352,7 @@
+ sumount=(supasswd!=NULL);
+ passw_lf=(*smbpasswd==0) && !linux2_0; /*smbmount 2.0.3 always waits for password,
+ even if called with -Uuser% or -N if server is in user level security*/
++ passw_lf=1;
+ if (sumount|| passw_lf)
+ if (pipe(fdstdin))
+ {
+@@ -418,96 +426,53 @@
+ else
+ {
+ /* no sumount */
+- if(linux2_0)
+ {
+- argv[++argnr]="smbmount";
+- argv[++argnr]=servicename;
+- argv[++argnr]=mount_point;
+- argv[++argnr]="-c";
+- argv[++argnr]=clientname;
+- argv[++argnr]="-I";
+- argv[++argnr]=ipaddr;
+- if (*group_name)
++ // bugfix: mount command might consist of more than one word (example: sudo mount_smbfs)
++ split_arguments(pref_get_smbmount_exe(), argv, &argnr, &strlist);
+ {
+- argv[++argnr]="-D";
+- argv[++argnr]=group_name;
+- }
+- argv[++argnr]="-U";
+- argv[++argnr]=smbuser;
+- argv[++argnr]="-f";sprintf(filemodestr,"%d",filemode);
+- argv[++argnr]=filemodestr;
+- argv[++argnr]="-d";sprintf(dirmodestr,"%d",dirmode);
+- argv[++argnr]=dirmodestr;
+- argv[++argnr]="-u";sprintf(uidstr,"%d",uid);
+- argv[++argnr]=uidstr;
+- argv[++argnr]="-g";sprintf(gidstr,"%d",gid);
+- argv[++argnr]=gidstr;
+- if (*smbpasswd==0)
+- argv[++argnr]="-n";
+- else
+- {
+- argv[++argnr]="-P";
+- argv[++argnr]=smbpasswd;
+- }
+- argv[++argnr]=NULL;
+- }
+- else
+- {
+- /* linux 2.2/2.4 */
+- argv[++argnr]=pref_get_smbmount_exe();
+- argv[++argnr]=servicename;
+- if (pref.v.smbmount_version>SMBMOUNT_204) argv[++argnr]=mount_point;
+- if (pref.v.smbmount_version<SMBMOUNT_206)
+- {
+- /* 2.04/2.05 */
++ sprintf(num1,"%d", filemode);
++ sprintf(num2,"%d", dirmode);
++ sprintf(num3,"%d", uid);
++ sprintf(num4,"%d", gid);
++ strcpy(commandstr1, "//");
++ if (strlen(smbuser))
++ {
++ strcat(commandstr1, smbuser);
++ strcat(commandstr1, "@");
++ }
++ if (strlen(servicename) > 2)
++ strcat(commandstr1, servicename+2);
++ argv[++argnr]="-f";
++ argv[++argnr]=num1;
++ argv[++argnr]="-d";
++ argv[++argnr]=num2;
++ argv[++argnr]="-u";
++ argv[++argnr]=num3;
++ argv[++argnr]="-g";
++ argv[++argnr]=num4;
+ argv[++argnr]="-I";
+- argv[++argnr]=ipaddr;
++ strcpy(tmp, ipaddr);
++ argv[++argnr]=tmp;
+ if (*group_name)
+ {
+ argv[++argnr]="-W";
+- argv[++argnr]=group_name;
+- }
+- sprintf(userpasswd,"-U%s%%%s",smbuser,smbpasswd);
+- argv[++argnr]=userpasswd;
+- argv[++argnr]="-d0";
+- if (pref.v.smbmount_version <SMBMOUNT_205)
+- {
+- argv[++argnr]="-c";
+- argv[++argnr]=commandstr;
+- sprintf(commandstr,"mount %s -f %d -d %d -u %d -g %d",
+- /*escape_str_smbmnt(*/mount_point/*,&strlist)*/,filemode,dirmode,uid,gid);
+- }
+- if ( !is_empty_string(pref.v.smbmount_arg) )
+- {
+- }
+- }
+- else /*>=SMBMOUNT_206*/
+- {
+- argv[++argnr]="-o";
+- argv[++argnr]=commandstr;
+- sprintf(commandstr,"username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,ip=%s,debug=0",
+- smbuser,smbpasswd,filemode,dirmode,uid,gid,ipaddr);
+- if (*group_name)
+- {
+- strcat(commandstr,",workgroup=");
+- strcat(commandstr,escape_str(group_name,&strlist));
++ argv[++argnr]= escape_str(group_name,&strlist);
+ }
+ if ( (port >= 0) && (port < 65536) )
+ {
+- string_ncat(commandstr, ",port=", MAXMNTCOMMANDL);
+- string_ncat(commandstr, port_str, MAXMNTCOMMANDL);
++ strcat(tmp, ":");
++ strcat(tmp, port_str);
+ }
+ if ( !is_empty_string(pref.v.smbmount_arg) )
+ {
+- if ( pref.v.smbmount_arg[0] != ',' )
+- string_ncat(commandstr, ",", MAXMNTCOMMANDL);
+- string_ncat(commandstr, escape_str(pref.v.smbmount_arg,&strlist), MAXMNTCOMMANDL);
++ split_arguments(pref.v.smbmount_arg, argv, &argnr, &strlist);
+ }
+ }
++ argv[++argnr]=commandstr1;
++ argv[++argnr]=mount_point;
+ argv[++argnr]=NULL;
+ }
+ }
+- slist_free_with_data(&strlist);
+ mountdat=g_malloc(sizeof(MOUNT_STRUCT));
+ if((pipe2_nok=pipe(fdstdout))|| (pipe3_nok=pipe(fdstderr))||
+ (mountdat->childpid =fork())== -1)
+@@ -521,7 +486,6 @@
+ g_print(_("smbmount pipe,fork error\n"));
+ return;
+ }
+-
+ if (!mountdat->childpid)
+ {
+ close(fdstdout[0]);
+@@ -536,7 +500,7 @@
+ if (sumount)
+ execvp("su",argv);
+ else
+- execvp(pref_get_smbmount_exe(),argv);
++ execvp_with_password(argv[0], argv, smbpasswd, strlist);
+ write(STDERR_FILENO,notfound,sizeof(notfound)-1);
+ _exit(0);
+ }
+@@ -547,9 +511,9 @@
+ else
+ {
+ i=0;
+- while(argv[i+1])
++ while(argv[i])
+ {
+- mountdat->arglist[i]=g_strdup(argv[i+1]);
++ mountdat->arglist[i]=g_strdup(argv[i]);
+ i++;
+ }
+ mountdat->arglist[i]=NULL;
+@@ -611,46 +575,9 @@
+ }
+ else
+ {
+- if(linux2_0)
+- {
+- if (*smbpasswd!=0) argv[argnr-1]=dummysmbpasswd;
+- }
+- else
+- {
+- if (pref.v.smbmount_version<SMBMOUNT_206)
+- sprintf(userpasswd,"-U%s%%%s",smbuser,dummysmbpasswd);
+- else
+- {
+- sprintf(commandstr,"username=%s%%%s,fmask=%d,dmask=%d,uid=%d,gid=%d,ip=%s,debug=0",
+- smbuser,dummysmbpasswd,filemode,dirmode,uid,gid,ipaddr);
+- if (*group_name){
+- strcat(commandstr,",workgroup=");
+- strcat(commandstr,group_name);
+- }
+- if ( (port >= 0) && (port < 65536) )
+- {
+- string_ncat(commandstr, ",port=", MAXMNTCOMMANDL);
+- string_ncat(commandstr, port_str, MAXMNTCOMMANDL);
+- }
+- if ( !is_empty_string(pref.v.smbmount_arg) )
+- {
+- if ( pref.v.smbmount_arg[0] != ',' )
+- string_ncat(commandstr, ",", MAXMNTCOMMANDL);
+- string_ncat(commandstr, escape_str(pref.v.smbmount_arg,&strlist), MAXMNTCOMMANDL);
+- }
+- }
+- if (passw_lf)
+- {
+- usleep(50000);
+- close(fdstdin[0]);
+- if (!waitpid(mountdat->childpid,NULL,WNOHANG))
+- write(fdstdin[1], "\n",1);
++ log_execvp_str(argv[0],argv);
+ close(fdstdin[1]);
+ }
+- }
+-
+- log_execvp_str(pref_get_smbmount_exe(),argv);
+- }
+ mountlist=g_slist_append(mountlist,mountdat);
+ mountdat->linepos=0; mountdat->linepos2=0;
+ mountdat->linenum=0;
+@@ -901,17 +828,13 @@
+ }
+ else
+ {
+- argv[0]=smb ? "smbumount":"umount";
+- argv[1]=mount_point;
++ // bugfix: mount command might consist of more than one word (example: sudo mount_smbfs)
++ int argnr = -1;
++ split_arguments(pref_get_smbumount_exe(), argv, &argnr, &strlist);
+ if ( !is_empty_string(pref.v.smbumount_arg) )
+- {
+- argv[2] = pref.v.smbumount_arg;
+- argv[3] = NULL;
+- }
+- else
+- {
+- argv[2]=NULL;
+- }
++ split_arguments(pref.v.smbumount_arg, argv, &argnr, &strlist);
++ argv[++argnr]=mount_point;
++ argv[++argnr] = NULL;
+ }
+ if((pipe2_nok=pipe(fdstdout))|| (pipe3_nok=pipe(fdstderr))||
+ (childpid =fork())== -1)
+@@ -938,7 +861,7 @@
+ execvp("su",argv);
+ }
+ else
+- execvp(smb ? pref_get_smbumount_exe():"umount",argv);
++ execvp_with_password(argv[0], argv, "", strlist);
+ write(STDERR_FILENO,notfound,sizeof(notfound)-1);
+ _exit(0);
+ }
+@@ -958,7 +881,7 @@
+ gui_log_window_insert_string("*",0);
+ }
+ else
+- log_execvp_str(smb ? pref_get_smbumount_exe():"umount",argv);
++ log_execvp_str(argv[0], argv);
+ mountdat=g_malloc(sizeof(UMOUNT_STRUCT));
+ umountlist=g_slist_append(umountlist,mountdat);
+ mountdat->childpid=childpid;
+@@ -1015,6 +938,198 @@
+ slist_free_with_data(&umountlist);
+ }
+
++void split_arguments(char * arguments, char * argv[], int * argnr, GSList ** strlist)
++{
++ char * c = argv[++*argnr] = storeInBuffer(arguments, strlist);
++ while(c = strchr(c, ' '))
++ {
++ char *d = c+1;
++ while(*d && *d == ' ')
++ d++;
++ *c = 0;
++ c = d;
++ if (!*c)
++ break;
++ argv[++*argnr] = storeInBuffer(c, strlist);
++ }
++}
++
++char * storeInBuffer(const char * s, GSList ** strlist)
++{
++ int n;
++ char * ss;
++
++ if (*s==0) return 0;
++ n = strlen(s);
++ ss=g_malloc(n+1);
++ strcpy(ss, s);
++ *strlist=g_slist_append(*strlist,ss);
++ return ss;
++}
++
++
++// this looks like a global variable. But each forked execvp_with_password
++// process has one copy of it. So it as a process local varible storing the
++// process ID of the forked child process, which actaully execs mount_smbfs
++int _childPid = 0;
++
++// called, if the child proces is killed. Kills its child process as well
++void stopMountSignalHandler (int sig)
++{
++ kill(_childPid, SIGINT);
++ waitpid(_childPid, 0, WUNTRACED);
++ _exit(0);
++}
++
++// replaces execvp to call mount_smbfs. If mount smbfs asks for a password, it is provided.
++// This can not be sent to stdin, because BSD gets the password directly from the terminal.
++// Therfore another process with a pseudo terminal is created.
++void execvp_with_password(const char * path, char * const argv[], const char * passwd, GSList *strlist)
++{
++ int master, i;
++ char terminal[MAXPATHLEN] = "";
++ char * pw = NULL;
++ int slave;
++ char password[1024], result[1024];
++ char * passwordText = "password:";
++ int passwordTextLen = strlen(passwordText);
++ char * resp_pos = result;
++ int fdstderr[2];
++
++ // create a pipe to the child process for stderr. For stdout the pseudo terminal is used
++ if(pipe(fdstderr))
++ {
++ fdstderr[0] = 0;
++ fdstderr[1] = 0;
++ }
++
++ // create the child process and the pseudo terminal
++ _childPid = forkpty(&master, terminal, NULL, NULL);
++
++ if (_childPid < 0)
++ {
++ if (errno == ENOENT)
++ printf("Error: Out of ptys\n");
++ else
++ printf(result, "Error: Forkpty\n");
++ _exit(1);
++ }
++ else if (_childPid == 0)
++ {
++ // prepare stderr pipe
++ if (fdstderr[0])
++ {
++ close(fdstderr[0]);
++ dup2(fdstderr[1], STDERR_FILENO);
++ }
++
++ // prepare the pseudo terminal
++ close(master);
++ slave = open(terminal, O_RDWR);
++ if (slave < 0)
++ {
++ printf("open() failed: %s", strerror(errno));
++ kill(_childPid, SIGINT);
++ waitpid(_childPid, 0, WUNTRACED);
++ _exit(1);
++ }
+
++ // launch application (mount_smbfs)
++ execvp(path, argv);
++ printf("error: %d (%s)\n", errno, strerror(errno));
++ }
++ else
++ {
++ // prepare the stderr pipe
++ if (fdstderr[1])
++ close(fdstderr[1]);
+
++ // install the SIGIN (ctrl-c) handler
++ if (signal(SIGINT, stopMountSignalHandler) == SIG_ERR)
++ printf("error: can not install SIGINT handler\n");
++ errno = 0;
++ *resp_pos = 0;
++
++ // main loop: wait for childs response
++ while (!errno)
++ {
++ // prepare a poll, wich waits for output from the pseudo terminal and from stderr
++ int pollnum = 1;
++ struct pollfd polldat[2];
++ polldat[0].fd = master;
++ polldat[0].events = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI;
++ if (fdstderr[0])
++ {
++ pollnum = 2;
++ polldat[1].fd = fdstderr[0];
++ polldat[1].events = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI;
++ }
++
++ // sleep until the child terminates or sends something
++ if (poll(polldat, pollnum, 1000) < 0)
++ break;
+
++ // response from childs stderr?
++ if (pollnum == 2 && polldat[1].revents)
++ {
++ // read response and send it to this process' stderr. It is connected
++ // with another pipe with the main process!
++ char s[1024];
++ int i = read(fdstderr[0], s, 1024);
++ if (errno)
++ break;
++ if (i > 0)
++ {
++ s[i] = 0;
++ write(STDERR_FILENO, s, i);
++ }
++ }
++
++ // response from childs stdout?
++ if (polldat[0].revents)
++ {
++ // read response and send it to this process' stdout. It is connected
++ // with another pipe with the main process. If the string 'password'
++ // was send, provide the password
++ char c;
++ if (read(master, &c, 1) <= 0 || errno)
++ break;
++ if (resp_pos - result < sizeof(result))
++ *resp_pos++ = c;
++ *resp_pos = 0;
++ if (c == '\n')
++ {
++ printf("%s", result);
++ resp_pos = result;
++ }
++ *resp_pos = 0;
++ if (resp_pos - result >= passwordTextLen && !strcasecmp(resp_pos-passwordTextLen, passwordText))
++ {
++ // prepare the password and send it through the pseudo terminal
++ strcpy(password, passwd);
++ strcat(password, "\n");
++ resp_pos = result;
++ *resp_pos = 0;
++ write(master, password, strlen(password));
++ }
++ }
++ // if the child is dead, end main loop
++ if (waitpid(_childPid,NULL,WNOHANG))
++ break;
++ }
++
++ // if there is unsend response, send it to the main process
++ printf("%s", result);
++
++ // free resources
++ if (fdstderr[0])
++ close(fdstderr[0]);
++ close(master);
++ slist_free_with_data(&strlist);
++
++ // get childs return code to avoid zombies
++ waitpid(_childPid, 0, WUNTRACED);
++ _exit(0);
++ }
++ _exit(-1); // can not be reached
++}
diff --git a/sysutils/linneighborhood/files/patch-utility.c b/sysutils/linneighborhood/files/patch-utility.c
new file mode 100644
index 000000000000..8ce3d9582a6b
--- /dev/null
+++ b/sysutils/linneighborhood/files/patch-utility.c
@@ -0,0 +1,22 @@
+--- src/utility.c.orig Sun Jun 9 09:58:43 2002
++++ src/utility.c Thu Feb 13 09:56:06 2003
+@@ -16,6 +16,7 @@
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
++#include <sys/types.h>
+ #include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <stdio.h>
+@@ -421,9 +422,9 @@
+ unsigned char path_exist (char *path)
+ {
+ DIR *dir;
+-
+ dir = opendir(path);
+- closedir(dir);
++ if (dir)
++ closedir(dir);
+ return ( dir != NULL ) ? 1 : 0;
+ }
+
diff --git a/sysutils/linneighborhood/pkg-descr b/sysutils/linneighborhood/pkg-descr
new file mode 100644
index 000000000000..085bd06e29c0
--- /dev/null
+++ b/sysutils/linneighborhood/pkg-descr
@@ -0,0 +1,11 @@
+LinNeighborhood is a Xwindow graphical port of Network Neighborhood,
+running over Samba utilities and the smbfs.
+
+It permits to browse an SMB (CIFS) network consisting of Samba,
+Windows (WfWg, 95, 98, NT) and probably (not tested) OS/2, LanManager
+for DOS and others. It also offers an interface to mount the found shares.
+
+WWW: http://www.bnro.de/~schmidjo/index.html
+
+--
+h.eichmann@gmx.de
diff --git a/sysutils/linneighborhood/pkg-message b/sysutils/linneighborhood/pkg-message
new file mode 100644
index 000000000000..e42459682b08
--- /dev/null
+++ b/sysutils/linneighborhood/pkg-message
@@ -0,0 +1,9 @@
+To mount shares with LinNeighborhood, there are the following possibilities:
+ - run it as root. (not recommended)
+ - give LinNeighborhood the suid flag (not recommended)
+ - give mount_smbfs and umount the suid flag (very bad!)
+ - install and configure sudo correctly and replace mount_smbfs and umount
+ in the preferences by "sudo mount_smbfs" and "sudo umount" (recommended).
+ Make sure, that all sudo rules concerning mount and umount have the
+ NOPASSWD flag. Otherwise two password questions might occur (one
+ from sudo and one from mount_smbfs) which will definitely go wrong.
diff --git a/sysutils/linneighborhood/pkg-plist b/sysutils/linneighborhood/pkg-plist
new file mode 100644
index 000000000000..33f102cb00a7
--- /dev/null
+++ b/sysutils/linneighborhood/pkg-plist
@@ -0,0 +1,15 @@
+bin/LinNeighborhood
+lib/charset.alias
+share/locale/de/LC_MESSAGES/LinNeighborhood.mo
+share/locale/sv/LC_MESSAGES/LinNeighborhood.mo
+share/locale/locale.alias
+share/locale/ja/LC_MESSAGES/LinNeighborhood.mo
+share/locale/fr/LC_MESSAGES/LinNeighborhood.mo
+share/locale/ru/LC_MESSAGES/LinNeighborhood.mo
+share/locale/es/LC_MESSAGES/LinNeighborhood.mo
+share/locale/pt_BR/LC_MESSAGES/LinNeighborhood.mo
+share/locale/tr/LC_MESSAGES/LinNeighborhood.mo
+share/locale/pl/LC_MESSAGES/LinNeighborhood.mo
+share/locale/it/LC_MESSAGES/LinNeighborhood.mo
+share/locale/zh_TW/LC_MESSAGES/LinNeighborhood.mo
+share/icons/LinNeighborhood.xpm