Ignore:
Timestamp:
Jan 10, 2011, 1:31:33 PM (15 years ago)
Author:
Silvan Scherrer
Message:

Samba Client 2.0: sigpipe crash, cosmetic and text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/client-2.0/src/smbwrp.c

    r497 r515  
    178178        }
    179179*/
     180        /*
     181         * Block SIGPIPE (from lib/util_sock.c: write())
     182         * It is not needed and should not stop execution
     183         */
     184        BlockSignals(True, SIGPIPE);
     185
    180186        return 0;
    181187
     
    574580        if (!cli || !file || !*file->fname)
    575581        {
    576                 return EINVAL;
     582                return maperror(EINVAL);
    577583        }
    578584        if (file->denymode < DENY_ALL || file->denymode > DENY_NONE)
     
    611617        if (!cli || !file || !buf || !result)
    612618        {
    613                 return EINVAL;
     619                return maperror(EINVAL);
    614620        }
    615621       
     
    637643        if (!cli || !file || !buf || !result)
    638644        {
    639                 return EINVAL;
     645                return maperror(EINVAL);
    640646        }
    641647       
     
    661667        if (!cli || !file)
    662668        {
    663                 return EINVAL;
     669                return maperror(EINVAL);
    664670        }
    665671
     
    728734        if (!cli || !file)
    729735        {
    730                 return EINVAL;
     736                return maperror(EINVAL);
    731737        }
    732738
     
    764770        if (!cli || !oldname || !newname)
    765771        {
    766                 return EINVAL;
     772                return maperror(EINVAL);
    767773        }
    768774
     
    785791        if (!cli || !finfo || !*finfo->fname)
    786792        {
    787                 return EINVAL;
     793                return maperror(EINVAL);
    788794        }
    789795
     
    804810        if (!cli || !fname)
    805811        {
    806                 return EINVAL;
     812                return maperror(EINVAL);
    807813        }
    808814#if 0
     
    835841        if (!cli || !file)
    836842        {
    837                 return EINVAL;
     843                return maperror(EINVAL);
    838844        }
    839845
     
    844850                if (offset < 0)
    845851                {
    846                         return EINVAL;
     852                        return maperror(EINVAL);
    847853                }
    848854                file->offset = offset;
     
    854860                if (offset > 0)
    855861                {
    856                         return EINVAL;
     862                        return maperror(EINVAL);
    857863                }
    858864                if (!cli_qfileinfo3(cli, file->fd,
     
    866872                file->offset = size + offset;
    867873                break;
    868         default: return EINVAL;
     874        default: return maperror(EINVAL);
    869875        }
    870876
     
    881887        if (!cli || !finfo || !*finfo->fname)
    882888        {
    883                 return EINVAL;
     889                return maperror(EINVAL);
    884890        }
    885891        debuglocal(4,"getattr %d %d <%s>\n", cli->capabilities & CAP_NOPATHINFO2, cli->capabilities & CAP_NT_SMBS, finfo->fname);
     
    927933                if (rc == EINVAL)
    928934                {
    929                         rc = ENOTDIR;
     935                        rc = maperror(ENOTDIR);
    930936                }
    931937                return rc;
     
    953959        if (!cli || !file || !finfo)
    954960        {
    955                 return EINVAL;
     961                return maperror(EINVAL);
    956962        }
    957963
     
    14601466        if (!srv || !cli || !state || !*state->mask)
    14611467        {
    1462                 return EINVAL;
     1468                return maperror(EINVAL);
    14631469        }
    14641470        debuglocal(1,"Filelist <%s> on master <%s> wgrp <%s> server <%s> share <%s> clidev <%s>\n", state->mask, srv->master, srv->workgroup, srv->server_name, srv->share_name, cli->dev);
     
    15301536        if (!cli || !fname)
    15311537        {
    1532                 return EINVAL;
     1538                return maperror(EINVAL);
    15331539        }
    15341540
     
    15401546
    15411547        if (!(finfo.attr & aDIR)) {
    1542                 return ENOTDIR;
     1548                return maperror(ENOTDIR);
    15431549        }
    15441550
     
    15541560        if (!cli || !fname)
    15551561        {
    1556                 return EINVAL;
     1562                return maperror(EINVAL);
    15571563        }
    15581564
     
    15711577        if (!cli || !fname)
    15721578        {
    1573                 return EINVAL;
     1579                return maperror(EINVAL);
    15741580        }
    15751581
     
    15881594        if (!cli || !fname || !name)
    15891595        {
    1590                 return EINVAL;
     1596                return maperror(EINVAL);
    15911597        }
    15921598        if (!cli_set_ea_path(cli, fname, name, value, size))
     
    16041610        if (!cli || !file || !name)
    16051611        {
    1606                 return EINVAL;
     1612                return maperror(EINVAL);
    16071613        }
    16081614        if (!cli_set_ea_fnum(cli, file->fd, name, value, size))
     
    17031709        if (!cli || !fname || !buffer)
    17041710        {
    1705                 return EINVAL;
     1711                return maperror(EINVAL);
    17061712        }
    17071713
     
    17171723        if (!cli || !file || !buffer)
    17181724        {
    1719                 return EINVAL;
     1725                return maperror(EINVAL);
    17201726        }
    17211727
     
    17331739        if (!cli || !pfsa)
    17341740        {
    1735                 return EINVAL;
     1741                return maperror(EINVAL);
    17361742        }
    17371743
Note: See TracChangeset for help on using the changeset viewer.