Changeset 528 for trunk/client/src


Ignore:
Timestamp:
Jan 24, 2011, 12:04:13 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Client 2.1: more errno fixes

Location:
trunk/client/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/client/src/Config.km_

    r521 r528  
    1010# adjust also the date please
    1111#
    12 VERSION = 1.6.0
     12VERSION = 2.1.x
    1313BUILD   = beta-date
    1414SAMBA   = ../../samba-33
  • trunk/client/src/ndpsmb.c

    r521 r528  
    966966                                }
    967967                        }
    968                         else
    969                         {
     968                       
     969                        if (rc == NO_ERROR)                     {
    970970                                finfo.easize = -1;
    971971                                getfindinfoL(pConn, plist, &finfo, 0, NULL);
    972972                        }
    973                         if (rc == ERROR_FILE_NOT_FOUND)
     973                        else if (rc == ERROR_FILE_NOT_FOUND)
    974974                        {
    975975                                // now try the upper path
    976                                 char * p = ph->fsphStrChr(finfo.fname, '\\');
     976                                char * p = ph->fsphStrRChr(finfo.fname, '\\');
    977977                                if (p && p > finfo.fname)
    978978                                {
    979979                                        *p = 0;
    980980                                        rc = smbwrp_getattr( &pRes->srv, pConn->cli, &finfo);
    981                                         if (rc)
     981                                        debuglocal(9,"NdpQueryPathInfo upper path in <%s>, rc = %d\n",  finfo.fname, rc);
     982                                        if (rc == NO_ERROR)
    982983                                        {       
    983                                             debuglocal(9,"NdpQueryPathInfo upper path in <%s>, retry = %d\n",  finfo.fname, retry);
    984                                             rc = rc ? ERROR_PATH_NOT_FOUND : ERROR_INVALID_PARAMETER;
     984                                            rc = (finfo.attr & FILE_DIRECTORY) !=0 ?
     985                                                ERROR_PATH_NOT_FOUND :
     986                                                ERROR_INVALID_PARAMETER;
     987                                        }
     988                                        else if (rc != ERROR_REM_NOT_LIST)
     989                                        {
     990                                              rc = ERROR_PATH_NOT_FOUND;
    985991                                        }
    986992                                }
  • trunk/client/src/smbwrp.c

    r521 r528  
    174174
    175175        if (!lp_load(get_dyn_CONFIGFILE(),true,false,false,true)) {
    176                 debuglocal(0,("The initial smb.conf is missing, please reinstall the plugin!"));
    177         }
    178 
     176                debuglocal(0,("The initial smb.conf is missing, defaults are used!\n"));
     177        }
    179178
    180179        load_interfaces();
     
    959958        if (cli->capabilities & CAP_NT_SMBS && !(cli->capabilities & CAP_NOPATHINFO2))
    960959        {
    961                 int rc = os2cli_errno(cli);
     960                int ret = cli_errno(cli);
    962961                // cli_qpathinfo* reports EINVAL when path of given file not exists
    963962                // thus there is no real situation when EINVAL should be returned to
    964963                // client at this point, we just replace it to ENOTDIR
    965                 if (rc == EINVAL)
    966                 {
    967                         rc = maperror(ENOTDIR);
    968                 }
    969                 return rc;
     964                if (ret == EINVAL)
     965                {
     966                        ret = ENOTDIR;
     967                }
     968                return maperror(ret);
    970969        }
    971970
     
    10311030        {
    10321031                filelist_state * st  = (filelist_state *)state;
    1033                 char fullname[ _MAX_PATH];
     1032                char fullname[ _MAX_PATH] = {0};
    10341033                debuglocal(8,"adding <%s> %d %d %d\n", finfo->fname, sizeof(st->finfo), st->datalen, sizeof(st->finfo.fname));
    10351034                memcpy(&st->finfo, finfo, sizeof(st->finfo));
     
    10991098****************************************************************************/
    11001099// YD from libsmb\clilist.c
    1101 // @todo who frees fname, as clistr_pull_talloc allocs it
    11021100static size_t _os2_interpret_long_filename(TALLOC_CTX *ctx, struct cli_state *cli,
    11031101                                   int level,const char *p, const char *pdata_end, smbwrp_fileinfo *finfo,
     
    12491247                        }
    12501248                        strncpy(finfo->fname, fname, sizeof(finfo->fname) -1);
     1249
    12511250                        /* To be robust in the face of unicode conversion failures
    12521251                           we need to copy the raw bytes of the last name seen here.
Note: See TracChangeset for help on using the changeset viewer.