Changeset 928 for branches


Ignore:
Timestamp:
Jul 24, 2016, 11:34:45 AM (9 years ago)
Author:
Paul Smedley
Message:

Apply changes from changeset 892 to client-3.0 branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/client-3.0/src/ndpsmb.c

    r818 r928  
    163163#define LEAVE() do { /* nothing */ } while (0)
    164164#endif
     165
     166int helperEASet (cli_state *cli, FEALIST *pFEAList, char *path)
     167{
     168        int rc = 0;
     169
     170        if (!path || !pFEAList || pFEAList->cbList <= sizeof(long))
     171        {
     172                return ERROR_EAS_NOT_SUPPORTED;
     173        }
     174
     175        ENTER();
     176
     177        do {
     178                // got FEA there
     179                FEA * pfea;
     180                unsigned long done = sizeof(long);
     181                pfea = pFEAList->list;
     182                while (done < pFEAList->cbList)
     183                {
     184                        rc = smbwrp_setea(cli, path, (char*)(pfea + 1), pfea->cbValue ? (char *)(pfea + 1) + pfea->cbName + 1: NULL, pfea->cbValue);
     185                        if (rc)
     186                        {
     187                                break;
     188                        }
     189                        pfea = (FEA *)((char *)(pfea + 1) + pfea->cbName + 1 + pfea->cbValue);
     190                        done += sizeof(FEA) + pfea->cbName + 1 + pfea->cbValue;
     191                }
     192        } while (0);
     193        LEAVE();
     194        return rc;
     195}
    165196
    166197int APIENTRY NdpPluginLoad (PLUGINHELPERTABLE2L *pPHT)
     
    13581389        debuglocal(9,"NdpEASet in [%p]\n", pConn);
    13591390
    1360         if (!pfi || !pfi->pszName || !pFEAList || pFEAList->cbList <= sizeof(long))
     1391        if (!pfi || !pfi->pszName)
    13611392        {
    13621393                return ERROR_EAS_NOT_SUPPORTED;
     
    13741405        }
    13751406
    1376         ENTER();
    1377 
    13781407        finfo = (smbwrp_fileinfo *)fdata.pData;
    13791408        path = finfo->fname;
    13801409
    1381         do {
    1382                 // got FEA there
    1383                 FEA * pfea;
    1384                 unsigned long done = sizeof(long);
    1385                 pfea = pFEAList->list;
    1386                 while (done < pFEAList->cbList)
    1387                 {
    1388                         rc = smbwrp_setea(pConn->cli, path, (char*)(pfea + 1), pfea->cbValue ? (char *)(pfea + 1) + pfea->cbName + 1: NULL, pfea->cbValue);
    1389                         if (rc)
    1390                         {
    1391                                 break;
    1392                         }
    1393                         pfea = (FEA *)((char *)(pfea + 1) + pfea->cbName + 1 + pfea->cbValue);
    1394                         done += sizeof(FEA) + pfea->cbName + 1 + pfea->cbValue;
    1395                 }
    1396         } while (0);
     1410        rc = helperEASet(pConn->cli, pFEAList, path);
    13971411        debuglocal(9,"NdpEASet %d\n", rc);
    1398         LEAVE();
    13991412        return rc;
    14001413}
     
    15541567        Resource *pRes = pConn->pRes;
    15551568        int rc = 0;
     1569        int rcEASet = 0;
    15561570        unsigned long action;
    15571571        char path[CCHMAXPATH+1] = {0};
     
    15721586                rc = smbwrp_mkdir(pConn->cli, path);
    15731587        } while (0);
    1574         debuglocal(9,"NdpCreateDir <%s> (%s) %d\n", szDirName, path, rc);
    1575         LEAVE();
     1588        LEAVE();
     1589
     1590        if (path && pRes->easupport)
     1591        {
     1592                rcEASet = helperEASet(pConn->cli, pFEAList, path);
     1593        }
     1594        debuglocal(9,"NdpCreateDir <%s> (%s) rc=%d, EASupport=%s rc=%d\n", szDirName, path, rc, pRes->easupport?"yes":"no", rcEASet);
     1595
    15761596        return rc;
    15771597}
Note: See TracChangeset for help on using the changeset viewer.