Changeset 65


Ignore:
Timestamp:
Aug 21, 2007, 10:25:01 PM (13 years ago)
Author:
Yuri Dario
Message:

Do not add C: to share path if drive letter already exists. Fixes ticket:24.
Do not strip drive letter from path when adding/changing a share.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/rpc_server/srv_srvsvc_nt.c

    r22 r65  
    157157               
    158158                if ( strcmp( fname, "." ) == 0 ) {
    159                         pstr_sprintf( fullpath, "C:%s", sharepath );
     159                        pstr_sprintf( fullpath, "%s%s",
     160                                (strchr( sharepath,':')) ? "" : "C:", sharepath );
    160161                } else {
    161                         pstr_sprintf( fullpath, "C:%s/%s", sharepath, fname );
     162                        pstr_sprintf( fullpath, "%s%s/%s",
     163                                (strchr( sharepath,':')) ? "" : "C:", sharepath, fname );
    162164                }
    163165                string_replace( fullpath, '/', '\\' );
     
    266268        pstrcpy(remark, lp_comment(snum));
    267269        standard_sub_conn(p->conn, remark,sizeof(remark));
    268         pstrcpy(path, "C:");
     270        if (strchr( lp_pathname(snum), ':'))
     271                pstrcpy(path, "");
     272        else
     273                pstrcpy(path, "C:");
    269274        pstrcat(path, lp_pathname(snum));
    270275
     
    346351        pstrcpy(remark, lp_comment(snum));
    347352        standard_sub_conn(p->conn, remark,sizeof(remark));
    348         pstrcpy(path, "C:");
     353        if (strchr( lp_pathname(snum), ':'))
     354                pstrcpy(path, "");
     355        else
     356                pstrcpy(path, "C:");
    349357        pstrcat(path, lp_pathname(snum));
    350358
     
    14471455        /* NT is braindead - it wants a C: prefix to a pathname ! So strip it. */
    14481456        ptr = dos_pathname;
     1457
     1458#ifdef __OS2__
     1459
     1460        /* Only absolute paths allowed. */
     1461        if (strlen(dos_pathname) < 2 || ptr[1] != ':')
     1462                return NULL;
     1463#else
     1464
    14491465        if (strlen(dos_pathname) > 2 && ptr[1] == ':' && ptr[0] != '/')
    14501466                ptr += 2;
     
    14531469        if (*ptr != '/')
    14541470                return NULL;
     1471#endif
    14551472
    14561473        return ptr;
     
    21752192***********************************************************************************/
    21762193
    2177 static const char *server_disks[] = {"C:"};
     2194static const char *server_disks[] = {"C:"
     2195#ifdef __OS2__
     2196        // YD we can use a better implementation (real time scan or above idea)
     2197        ,"D:","E:","F:","G:","H:","I:","J:","K:","L:","M:","N:","O:"
     2198        ,"P:","Q:","R:","S:","T:","U:","V:","W:","X:","Y:","Z:"
     2199#endif
     2200};
    21782201
    21792202static uint32 get_server_disk_count(void)
Note: See TracChangeset for help on using the changeset viewer.