Re: smbwrapper/smbsh is now working for Linux 2.4

2002-12-10 Thread Derrell . Lipman
Steve Langasek <[EMAIL PROTECTED]> writes:

> I suspect the key change in the Debian build is enabling of LFS support;

Could be, but I have reimplemented each of the LFS functions that were in
there originally in a manner that they should work with the current C library.
I have discovered missing ones since posting my patches (e.g. readdir64_r()...
actually readdir_r() was missing as well).  I suspect there are numerous
filesystem functions which should be wrapped but aren't.

> I'll scare up some time to try out your patch, and see if I can figure
> out what's special about the calls that are failing.

Ok, let me know when you're starting and I'll give you a dump of any changes
I've made since today's set of patches.

Derrell



Re: smbwrapper/smbsh is now working for Linux 2.4

2002-12-10 Thread Steve Langasek
On Tue, Dec 10, 2002 at 01:54:52PM -0500, [EMAIL PROTECTED] wrote:

> > On Tue, Dec 10, 2002 at 01:27:07PM -0500, [EMAIL PROTECTED]
> > wrote:

> >> I have smbwrapper and smbsh working on Debian/woody with the Linux 2.4
> >> kernel and the default C library: libc-2.2.5.so.

> > Yes, I'm interested - please post patches. Pressure of other things has made
> > this a low priority but I'm really happy to apply patches that work for
> > people !

> Ok.  The patch is attached.  This became a high priority for me when smbmount
> used with automount turned out to be way too slow.  This seems substantially
> faster in terms of connection establishment.

> The problems I have encountered with smbsh so far pertain to something that
> Debian is doing in their build process.  smbsh works well with bash if bash is
> built from source with nothing other than "./configure;make".  Using Debian's
> build process or their bash binary, however, bash crashes after reading the
> .bash_history file.  (Debian modifies the default build process and I haven't
> spent the time to determine which change they make causes this.)  Similarly,
> the program "hostname" crashes using the default binary.  (I haven't tried
> rebuilding that one to see if a simple recompile fixes it.)  In both cases,
> they're getting segmentation violations, and I believe there's a function
> pointer not getting resolved properly with the various wrappers provided by
> smbwrapper.so.  I'm sure there are other apps which will crash as well, but I
> did a bunch of stuff today in bash in smbsh and it was generally working well.

Hmm -- perhaps that's why I never got anywhere with my own efforts, bash
was the only program I ever tested with. :)

I suspect the key change in the Debian build is enabling of LFS support;
IIRC, it was in an LFS-related call that I saw segfaults happen.  LFS is
definitely something that smbsh needs to be able to handle cleanly to be
a viable option to smbmount: it's one thing to be on a filesystem (such
as some version of smbfs) that can't handle large files, and quite
another for the application to crash whenever you run one of the growing
number of applications that use the LFS userspace calls.

I'll scare up some time to try out your patch, and see if I can figure
out what's special about the calls that are failing.

Cheers,
-- 
Steve Langasek
postmodern programmer



msg04872/pgp0.pgp
Description: PGP signature


Re: smbwrapper/smbsh is now working for Linux 2.4

2002-12-10 Thread Derrell . Lipman
Dan Kegel <[EMAIL PROTECTED]> writes:

> As a user, I welcome alternatives to smbfs.

Patch has been posted.

> (I'm also looking forward to trying out
> http://us1.samba.org/samba/Linux_CIFS_client.html)

I did minimal testing of it.  It seems to work fine, as long as you don't need
to access anything older than Win2000.  NT4.0, WinME, and older version. do
not seem to be accessible through that client since they apprently don't quite
implement CIFS per standard.

Derrell



Re: smbwrapper/smbsh is now working for Linux 2.4

2002-12-10 Thread Derrell . Lipman
[EMAIL PROTECTED] writes:

> On Tue, Dec 10, 2002 at 01:27:07PM -0500, [EMAIL PROTECTED]
> wrote:
>> 
>> I have smbwrapper and smbsh working on Debian/woody with the Linux 2.4
>> kernel and the default C library: libc-2.2.5.so.

> Yes, I'm interested - please post patches. Pressure of other things has made
> this a low priority but I'm really happy to apply patches that work for
> people !

Ok.  The patch is attached.  This became a high priority for me when smbmount
used with automount turned out to be way too slow.  This seems substantially
faster in terms of connection establishment.

The problems I have encountered with smbsh so far pertain to something that
Debian is doing in their build process.  smbsh works well with bash if bash is
built from source with nothing other than "./configure;make".  Using Debian's
build process or their bash binary, however, bash crashes after reading the
.bash_history file.  (Debian modifies the default build process and I haven't
spent the time to determine which change they make causes this.)  Similarly,
the program "hostname" crashes using the default binary.  (I haven't tried
rebuilding that one to see if a simple recompile fixes it.)  In both cases,
they're getting segmentation violations, and I believe there's a function
pointer not getting resolved properly with the various wrappers provided by
smbwrapper.so.  I'm sure there are other apps which will crash as well, but I
did a bunch of stuff today in bash in smbsh and it was generally working well.

If anyone fixes the above problems, please let me know about it.  I'm not
normally subscribed to samba-technical.

Jeremy, someone who knows automake/configure building may want to look at this
patch to determine which portions should be in #ifdefs for autoconfiguring for
other than Linux.

Cheers,

Derrell

--

diff -u /var/tmp/samba-2.2.3a/source/smbwrapper/realcalls.c 
samba-2.2.3a/source/smbwrapper/realcalls.c
--- /var/tmp/samba-2.2.3a/source/smbwrapper/realcalls.c Wed Oct  7 06:58:12 1998
+++ samba-2.2.3a/source/smbwrapper/realcalls.c  Tue Dec 10 13:02:03 2002
@@ -22,6 +22,81 @@
 #include "includes.h"
 #include "realcalls.h"
 
+#include 
+
+/*
+ * Pointers to functions in the standard C library
+ */
+static struct
+{
+void *  (* readdir64)(void * dir);
+void *  (* llseek)(int fd,
+   unsigned long offset_high,
+   unsigned long offset_low,
+   loff_t * result,
+   unsigned int whence);
+int (* lstat64)(int ver,
+char *name,
+void *st64);
+int (* fstat64)(int ver,
+int fd,
+void *st64);
+int (* stat64)(int ver,
+   char *name,
+   void *st64);
+ssize_t (* pwrite)(int fd,
+   void *buf,
+   size_t size,
+   off_t ofs);
+ssize_t (* pread)(int fd,
+  void *buf,
+  size_t size,
+  off_t ofs);
+void *  (* opendir)(const char *name);
+int (* closedir)(void *dir);
+off_t   (* telldir)(void *dir);
+int (* seekdir)(void *dir,
+off_t offset);
+} libc;
+
+int real_init(void)
+{
+static void *lib = NULL;
+char *error;
+
+if ((lib = dlopen("/lib/libc.so.6", RTLD_NOW | RTLD_GLOBAL)) == NULL)
+return -1;
+
+#define GETSYM(symname, symstring)  \
+libc.symname = dlsym(lib, symstring);   \
+if ((error = dlerror()) != NULL)\
+break;
+
+/*
+ * Get pointers to each of the symbols we'll need, from the C library
+ */
+do {
+GETSYM(readdir64, "readdir64");
+GETSYM(llseek, "llseek");
+GETSYM(lstat64, "__lxstat64");
+GETSYM(fstat64, "__fxstat64");
+GETSYM(stat64, "__xstat64");
+GETSYM(pwrite, "pwrite");
+GETSYM(pread, "pread");
+GETSYM(opendir, "opendir");
+GETSYM(closedir, "closedir");
+GETSYM(telldir, "telldir");
+GETSYM(seekdir, "seekdir");
+} while (0);
+
+dlclose(lib);
+
+if (error != NULL)
+return -1;
+
+return 0;
+}
+
 #ifdef REPLACE_UTIME
 int r

Re: smbwrapper/smbsh is now working for Linux 2.4

2002-12-10 Thread Dan Kegel
[EMAIL PROTECTED] wrote:

On Tue, Dec 10, 2002 at 01:27:07PM -0500, [EMAIL PROTECTED] wrote:


I have smbwrapper and smbsh working on Debian/woody with the Linux 2.4 kernel
and the default C library: libc-2.2.5.so.  ...

Based on search results that I've found, there's been almost no work on
getting smbwrapper and smbsh working on Linux 2.4 with glibc during the past
couple of years, so I don't know if there's anyone actually interested in
this.  If anyone is interested, let me know and I'll post the patches and the
list of known problems.



Yes, I'm interested - please post patches. Pressure of other things has made
this a low priority but I'm really happy to apply patches that work for people !


As a user, I welcome alternatives to smbfs.
(I'm also looking forward to trying out
http://us1.samba.org/samba/Linux_CIFS_client.html)
- Dan





Re: smbwrapper/smbsh is now working for Linux 2.4

2002-12-10 Thread jra
On Tue, Dec 10, 2002 at 01:27:07PM -0500, [EMAIL PROTECTED] wrote:
> 
> I have smbwrapper and smbsh working on Debian/woody with the Linux 2.4 kernel
> and the default C library: libc-2.2.5.so.  There is a problem that rears its
> ugly head with a few programs (segmentation violation, presumably due to some
> function which is not wrapped properly) but in general, and with most
> programs, it's working great.
> 
> Based on search results that I've found, there's been almost no work on
> getting smbwrapper and smbsh working on Linux 2.4 with glibc during the past
> couple of years, so I don't know if there's anyone actually interested in
> this.  If anyone is interested, let me know and I'll post the patches and the
> list of known problems.

Yes, I'm interested - please post patches. Pressure of other things has made
this a low priority but I'm really happy to apply patches that work for people !

Jeremy.



smbwrapper/smbsh is now working for Linux 2.4

2002-12-10 Thread Derrell . Lipman

I have smbwrapper and smbsh working on Debian/woody with the Linux 2.4 kernel
and the default C library: libc-2.2.5.so.  There is a problem that rears its
ugly head with a few programs (segmentation violation, presumably due to some
function which is not wrapped properly) but in general, and with most
programs, it's working great.

Based on search results that I've found, there's been almost no work on
getting smbwrapper and smbsh working on Linux 2.4 with glibc during the past
couple of years, so I don't know if there's anyone actually interested in
this.  If anyone is interested, let me know and I'll post the patches and the
list of known problems.

Derrell