Changeset 75


Ignore:
Timestamp:
Sep 28, 2007, 11:19:31 AM (18 years ago)
Author:
Paul Smedley
Message:

return generated path info for workgroups and servers instead of an error code.

Location:
trunk/samba/source/ndpsmb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/samba/source/ndpsmb/smbcd.c

    r70 r75  
    437437                                break;
    438438                        }
    439                         callrc = smbwrp_getattr(cli, (smbwrp_fileinfo *)req->param);
     439                        callrc = smbwrp_getattr(srv, cli, (smbwrp_fileinfo *)req->param);
    440440                        res->rc = maperror(callrc);
    441441                } break;
     
    542542                                break;
    543543                        }
    544                         callrc = smbwrp_chdir(cli, req->param);
     544                        callrc = smbwrp_chdir(srv, cli, req->param);
    545545                        res->rc = maperror(callrc);
    546546                } break;
  • TabularUnified trunk/samba/source/ndpsmb/smbwrp.c

    r69 r75  
    807807this is needed because win95 sometimes refuses the qpathinfo
    808808*******************************************************/
    809 int _System smbwrp_getattr(cli_state * cli, smbwrp_fileinfo *finfo)
     809int _System smbwrp_getattr(smbwrp_server *srv, cli_state * cli, smbwrp_fileinfo *finfo)
    810810{
    811811        SMB_INO_T ino = 0;
     
    828828//debuglocal(2,("getattr rc1 %d\n", os2cli_errno(cli)));
    829829
     830        /* If the path is not on a share (it is a workgroup or a server),
     831         * then cli_qpathinfo3 obviously fails. Return some fake information
     832         * about the directory.
     833         */
     834        if (   *srv->server_name == 0
     835            || (strcmp(cli->dev,"IPC") == 0)
     836            || *srv->share_name == 0
     837            || (stricmp(srv->share_name,"IPC$") == 0)
     838            || (strncmp(cli->dev,"LPT",3) == 0)
     839           )
     840        {
     841            debuglocal(4,"getattr not a share.\n");
     842            *(time_t *)&finfo->ctime = time (NULL);
     843            *(time_t *)&finfo->atime = time (NULL);
     844            *(time_t *)&finfo->mtime = time (NULL);
     845            finfo->size = 0;
     846            finfo->easize = 0;
     847            finfo->attr = aDIR;
     848            return 0;
     849        }
     850       
    830851        /* if this is NT then don't bother with the getatr */
    831852        if (cli->capabilities & CAP_NT_SMBS && !(cli->capabilities & CAP_NOPATHINFO2))
     
    14311452a wrapper for chdir()
    14321453*******************************************************/
    1433 int _System smbwrp_chdir(cli_state * cli, char *fname)
     1454int _System smbwrp_chdir(smbwrp_server *srv, cli_state * cli, char *fname)
    14341455{
    14351456        unsigned short mode = aDIR;
     
    14411462
    14421463        strncpy(finfo.fname, fname, sizeof(finfo.fname) - 1);
    1443         if (smbwrp_getattr(cli, &finfo))
     1464        if (smbwrp_getattr(srv, cli, &finfo))
    14441465        {
    14451466                return os2cli_errno(cli);
  • TabularUnified trunk/samba/source/ndpsmb/smbwrp.h

    r69 r75  
    129129int _System smbwrp_close(cli_state * cli, smbwrp_file * file);
    130130int _System smbwrp_setattr(cli_state * cli, smbwrp_fileinfo *finfo);
    131 int _System smbwrp_getattr(cli_state * cli, smbwrp_fileinfo *finfo);
     131int _System smbwrp_getattr(smbwrp_server *srv, cli_state * cli, smbwrp_fileinfo *finfo);
    132132int _System smbwrp_fgetattr(cli_state * cli, smbwrp_file *file, smbwrp_fileinfo *finfo);
    133133int _System smbwrp_filelist(smbwrp_server *srv, cli_state * cli, filelist_state * state);
    134134int _System smbwrp_rename(cli_state * cli, char *oldname, char *newname);
    135 int _System smbwrp_chdir(cli_state * cli, char *fname);
     135int _System smbwrp_chdir(smbwrp_server *srv, cli_state * cli, char *fname);
    136136int _System smbwrp_mkdir(cli_state * cli, char *fname);
    137137int _System smbwrp_rmdir(cli_state * cli, char *fname);
Note: See TracChangeset for help on using the changeset viewer.