- fixed errno return in smbw_open()
authorAndrew Tridgell <tridge@samba.org>
Mon, 5 Oct 1998 13:51:19 +0000 (13:51 +0000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 5 Oct 1998 13:51:19 +0000 (13:51 +0000)
- updated README a bit
- fixed Linux compilation of utime()

source/smbwrapper/README
source/smbwrapper/smbw.c
source/smbwrapper/wrapped.c

index 19371269e7ee25eed649121bdba208229f7267ed..7f699dc8be55dc696e1a91c930594fc495949ca4 100644 (file)
@@ -6,9 +6,10 @@ Currently this code has only been tested on:
 
 - Linux 2.0 with glibc2 (RH5.1)
 - Linux 2.1 with glibc2
-- Solaris 2.5 with gcc
 - Solaris 2.5.1 with gcc
 - Solaris 2.6 with gcc
+- SunOS 4.1.3 with gcc
+- IRIX 6.4 with cc
 
 It probably won't run on other systems without some porting.
 
@@ -17,8 +18,15 @@ To use it you need to do this:
 1) build smbwrapper.so using the command "make smbwrapper"
 3) run smbsh
 
-then try to access /smb/SERVER for some SMB server name and see what
-happens.
+You will be asked for a username and password. After that you will be
+returned to a shell prompt. It is actually a subshell running with
+smbwrapper enabled. You can confirm this by checking if the SMBW_USER
+environment variable is defined.
+
+Now try to access /smb/SERVER for some SMB server name and see what
+happens. If you set SMBW_WORKGROUP to your workgroup or have workgroup
+set in yoru smb.conf then listing /smb/ should list all SMB servers in
+your workgroup.
 
 For debugging you can set SMBW_DEBUG to an integer debug level.
 
index 97beca9b1979e7586805d27335672eb6c8e791a2..33cadc48d934d833bcd28992185e7a0fd030f6e3 100644 (file)
@@ -531,13 +531,10 @@ int smbw_open(const char *fname, int flags, mode_t mode)
                /* it might be a directory. Maybe we should use chkpath? */
                eno = smbw_error(&srv->cli);
                fd = smbw_dir_open(fname);
+               if (fd == -1) errno = eno;
                smbw_busy--;
                return fd;
        }
-       if (fd == -1) {
-               errno = eno;
-               goto failed;
-       }
 
        file = (struct smbw_file *)malloc(sizeof(*file));
        if (!file) {
index e87bd5f1f2098d55076f4e3ecd9e5747d6f5b5da..a6a73346936f3535fd9ab94436c2f29b551b36fc 100644 (file)
 #endif
 
 #ifdef HAVE_UTIMES
+#if LINUX
+ /* glibc2 gets the prototype wrong */
+ int utimes(const char *name,struct timeval tvp[2])
+#else
  int utimes(const char *name,const struct timeval tvp[2])
+#endif
 {
        if (smbw_path(name)) {
                return smbw_utimes(name, tvp);