Changeset 849


Ignore:
Timestamp:
Feb 17, 2014, 3:26:00 PM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba Server 3.6: fix EA problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/lib/os2helper.c

    r745 r849  
    4141#include <string.h>
    4242#include <sys/socket.h>
    43 //YD for tmalloc
    4443#include <malloc.h>
    4544
     
    5251#define aARCH (1L<<5)           /* 0x20 */
    5352
    54 #ifndef TESTING
    55 
    5653// Samba DEBUG() needs the following includes and defines
    5754#include <stdbool.h>
     
    6158#include "../lib/util/xfile.h"
    6259#include "../lib/util/debug.h"
    63 #else
    64 
    65 #define DEBUG(a,b) (0)
    66 #endif
    6760
    6861#ifndef ENOATTR
     
    159152}
    160153
    161 // we search with the exe name if we are in client mode
    162 /* not needed atm, as done with lp_is_in_client()
    163 bool os2_isClient()
    164 {
    165         char sExeName [_MAX_PATH];
    166         char sDrive [_MAX_PATH], sDir [_MAX_DIR], sName[_MAX_PATH];
    167 
    168         if (!os2_GetExeName(sExeName, sizeof(sExeName)))
    169                 return false;
    170 
    171         // we split to the different values
    172         _splitpath(sExeName, sDrive, sDir, sName, NULL);
    173         if ( (stricmp(sName, "NDCTL") == 0) || (stricmp(sName, "EVFSCTL") == 0) )
    174         {
    175                 return true;
    176         } else  {
    177                 return false;
    178         }
    179 }
    180 */
    181 
    182154/* OS/2 specific pipe implementation, we have to use socketpair as select on
    183 filehandle is not working. */
     155   filehandle is not working. */
    184156int os2_pipe(int fds[2])
    185157{
     
    189161        return rc;
    190162}
    191 
    192 #if 0
    193 // OS/2 specific connect() implementation, as it only works in low mem
    194 int os2_connect(int fd, const struct sockaddr *address, int address_len)
    195 {
    196         struct sockaddr *addresslow;
    197         int rc;
    198         addresslow = (struct sockaddr*) _lmalloc(address_len);
    199         if (!addresslow)
    200                 return -1;
    201 
    202         memcpy(addresslow, address, address_len);
    203         rc = connect(fd, addresslow, address_len);
    204 
    205         free(addresslow);
    206 
    207         return rc;
    208 }
    209 #endif
    210163
    211164/* OS/2-specific random functions. these functions used to be based on APR
    212165   random code, but we discovered some nasty problems with it on fast hardware
    213166   (especially on quadcore) and decided to rewrite it with libc random() */
    214  
    215167void os2_randget(char * buffer, int length)
    216168{
     
    339291                free(pfea2list);
    340292        }
    341         DEBUG(4,("unigetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, rc));
     293
     294        DEBUG(5,("unigetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, rc));
     295
    342296        return rc;
    343297}
     
    373327        if (rc)
    374328        {
    375                 DEBUG(4,("unilistxattr1 : (%s:%d) %d\n", path ? path : "null", file, rc));
     329                DEBUG(4,("unilistxattr1 : (%s:%d) %d\n", path ? npath : "null", file, rc));
    376330                maperrno(rc);
    377331                return -1;             
     
    384338        //YD DosEnumAttribute doesn't like high-mem buffers, get a low one.
    385339        buf = (char *)_tmalloc(stat.cbList * 2);
    386         rc = DosEnumAttribute(path ? 1 : 0, path ? (PVOID)path : (PVOID)&file, 1, (PVOID)buf, stat.cbList * 2, &ulCount, 1);
     340        rc = DosEnumAttribute(path ? 1 : 0, path ? (PVOID)npath : (PVOID)&file, 1, (PVOID)buf, stat.cbList * 2, &ulCount, 1);
    387341        if (rc)
    388342        {
    389                 DEBUG(4,("unilistxattr2 : (%s:%d) %d\n", path ? path : "null", file, rc));
     343                DEBUG(4,("unilistxattr2 : (%s:%d) %d\n", path ? npath : "null", file, rc));
    390344                maperrno(rc);
    391345                _tfree(buf);
     
    408362                if (pfea->oNextEntryOffset > 0x10000)
    409363                {
    410                         // DEBUG(0, ("Broken Extended Attributes detected for: %s:%d\n", path ? path : "null", file));
    411                         DEBUG(0, ("Broken Extended Attributes detected for: %s:%d, Last EA:%s\n", path ? path : "null", file, pfea->szName));
     364                        DEBUG(4, ("Broken Extended Attributes detected for: %s:%d, Last EA:%s\n", path ? path : "null", file, pfea->szName));
    412365                        break;
    413366                }
     
    418371        }
    419372        _tfree(buf);
    420         DEBUG(4,("unilistxattr : (%s:%d) %d\n", path ? path : "null", file, gotsize));
     373
     374        DEBUG(5,("unilistxattr : (%s:%d) %d\n", path ? path : "null", file, gotsize));
     375
    421376        if (gotsize > size)
    422377        {
     
    492447        char * p;
    493448       
     449        DEBUG(5,("unisetxattr : (%s:%d) %s %d\n", path ? path : "null", file, name, size));
     450
    494451        if ((!path && !file) || !name || (!value && size))
    495452        {
Note: See TracChangeset for help on using the changeset viewer.