Changeset 483


Ignore:
Timestamp:
Aug 16, 2010, 1:18:20 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.5: fixed ticket 144

Location:
trunk/server/source3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/dynconfig.c

    r481 r483  
    297297        if (!*buffer)
    298298        {
    299                 snprintf(buffer, 260, "%s/samba/lock", getenv("ETC"));
     299                if (os2_isClient())
     300                {
     301                        snprintf(buffer, 260, "%s/samba/lock/client", getenv("ETC"));
     302                } else {
     303                        snprintf(buffer, 260, "%s/samba/lock", getenv("ETC"));
     304                }
    300305        }
    301306        if (dyn_LOCKDIR == NULL) {
  • trunk/server/source3/lib/os2helper.c

    r463 r483  
    9696}
    9797
    98 // we search the path of the .exe and return it
    99 int os2_GetExePath(char *buff)
     98// get the exe name (including path)
     99bool os2_GetExeName(char *sExeName)
    100100{
    101101        APIRET rc = NO_ERROR;
    102         PPIB ppib = NULL;
    103         char sExePath [_MAX_PATH];
    104         char sDrive [_MAX_PATH], sDir [_MAX_DIR];
     102        PPIB ppib = NULL;
    105103
    106104        // we search for the infoblock to get the module name
     
    108106        if (rc != NO_ERROR)
    109107        {
    110                 return -1;
     108                return false;
    111109        }
    112110
    113111        // with the module name we get the path (including the exe name)
    114         rc = DosQueryModuleName(ppib->pib_hmte, sizeof(sExePath), sExePath);
     112        rc = DosQueryModuleName(ppib->pib_hmte, sizeof(sExeName), sExeName);
    115113        if (rc != NO_ERROR)
    116114        {
    117                 return -1;
    118         }
     115                return false;
     116        }
     117        return true;
     118}
     119
     120// we search the path of the .exe and return it
     121int os2_GetExePath(char *buff)
     122{
     123        char sExeName [_MAX_PATH];
     124        char sDrive [_MAX_PATH], sDir [_MAX_DIR];
     125
     126        if (!os2_GetExeName(sExeName))
     127                return false;
    119128
    120129        // we split to the different values
    121         _splitpath(sExePath, sDrive, sDir, NULL, NULL);
     130        _splitpath(sExeName, sDrive, sDir, NULL, NULL);
    122131        // strcat(sDrive, sDir);
    123132        strncat(sDrive, sDir, strlen(sDir) -1);
     
    125134
    126135        return 0;
     136}
     137
     138// we search with the exe name if we are in client mode
     139bool os2_isClient()
     140{
     141        char sExeName [_MAX_PATH];
     142        char sDrive [_MAX_PATH], sDir [_MAX_DIR], sName[_MAX_PATH];
     143
     144        if (!os2_GetExeName(sExeName))
     145                return false;
     146
     147        // we split to the different values
     148        _splitpath(sExeName, sDrive, sDir, sName, NULL);
     149        if ( (stricmp(sName, "NDCTL") == 0) || (stricmp(sName, "EVFSCTL") == 0) )
     150        {
     151                return true;
     152        } else  {
     153                return false;
     154        }
    127155}
    128156
Note: See TracChangeset for help on using the changeset viewer.