Changeset 481 for trunk/src/sh_tools.c
- Timestamp:
- Jul 18, 2015, 5:06:52 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_tools.c
r472 r481 109 109 p = (_("Key passed is not valid")); 110 110 else if (err_num == BAD_CIPHER_MODE) 111 p = (_("Params struct passed to cipherInit invalid"));111 p = (_("Params struct passed to rijndael_cipherInit invalid")); 112 112 else if (err_num == BAD_CIPHER_STATE) 113 113 p = (_("Cipher in wrong state")); … … 1371 1371 #if defined (SH_WITH_CLIENT) || defined (SH_WITH_SERVER) 1372 1372 1373 #if defined (SH_WITH_CLIENT) 1374 1375 static int probe_done = S_FALSE; 1376 static unsigned char probe_flag = '\0'; 1377 1378 void sh_tools_probe_reset() 1379 { 1380 probe_done = S_FALSE; 1381 probe_flag = '\0'; 1382 return; 1383 } 1384 1385 static int probe_ok(int flag) 1386 { 1387 (void) flag; 1388 if ((probe_flag & SH_PROTO_IVA) != 0) 1389 return S_TRUE; 1390 return S_FALSE; 1391 } 1392 1393 static unsigned char probe_header_set(unsigned char protocol) 1394 { 1395 if (probe_done || (protocol & SH_PROTO_SRP) == 0) 1396 return 0; 1397 1398 return (char) SH_PROTO_IVA; 1399 } 1400 1401 static void probe_header_get(unsigned char protocol) 1402 { 1403 if (probe_done || (protocol & SH_PROTO_SRP) == 0) 1404 return; 1405 1406 /* If the server doesn't know about it, 1407 * it will simply mirror it back. */ 1408 1409 if ((protocol & SH_PROTO_IVA) != 0) 1410 { 1411 /* probe was mirrored */; 1412 } 1413 else 1414 { 1415 /* probe was UNset */ 1416 probe_flag |= SH_PROTO_IVA; 1417 } 1418 probe_done = S_TRUE; 1419 return; 1420 } 1421 1422 #else 1423 static unsigned char probe_header_set(unsigned char protocol) { 1424 (void) protocol; return 0; } 1425 static void probe_header_get(unsigned char protocol) { 1426 (void) protocol; return; } 1427 void sh_tools_probe_reset() { return; } 1428 1429 unsigned char sh_tools_probe_store(unsigned char protocol, int * probe_flag) 1430 { 1431 if ((protocol & SH_PROTO_SRP) == 0) 1432 return protocol; 1433 1434 if ((protocol & SH_PROTO_IVA) != 0) 1435 { 1436 /* probe received */ 1437 *probe_flag |= SH_PROTO_IVA; 1438 protocol &= ~SH_PROTO_IVA; 1439 } 1440 return protocol; 1441 } 1442 1443 static int probe_ok(int flag) 1444 { 1445 if ((flag & SH_PROTO_IVA) != 0) 1446 return S_TRUE; 1447 return S_FALSE; 1448 } 1449 #endif 1450 1451 1373 1452 void get_header (unsigned char * head, unsigned long * bytes, char * u) 1374 1453 { 1375 1454 SL_ENTER(_("get_header")); 1455 1456 probe_header_get(head[0]); 1376 1457 1377 1458 *bytes = … … 1393 1474 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 1394 1475 1395 #ifdef SH_ENCRYPT _21476 #ifdef SH_ENCRYPT 1396 1477 #define TRANS_BYTES 65120 1397 1478 #else … … 1399 1480 #endif 1400 1481 1401 void put_header (unsigned char * head, int protocol,1482 void put_header (unsigned char * head, const int protocol, 1402 1483 unsigned long * length, char * u) 1403 1484 { 1485 unsigned char probe = probe_header_set(protocol); 1404 1486 1405 1487 /* static long transfer_limit = (8 * SH_BUFSIZE); V0.8 */ … … 1408 1490 SL_ENTER(_("put_header")); 1409 1491 1410 head[0] = protocol ;1492 head[0] = protocol|probe; 1411 1493 1412 1494 ASSERT((*length < transfer_limit), _("*length < transfer_limit")) … … 1434 1516 SL_RET0(_("put_header")); 1435 1517 } 1436 #endif1437 1518 1438 1519 /* ------------------------------------------ … … 1453 1534 * only SH_V2_FULLSIZE is used, and only once 1454 1535 */ 1455 #if 0 1456 #ifdef SH_WITH_SERVER 1457 #define SH_V2_FULLSIZE 240 1458 #define SH_V2_PAYLOAD 224 1459 #define SH_V2_MESSAGE 176 1460 #else 1461 #define SH_V2_FULLSIZE 1024 1462 #define SH_V2_PAYLOAD 1008 1463 #define SH_V2_MESSAGE 960 1464 #endif 1465 #endif 1536 1466 1537 #define SH_V2_FULLSIZE 1024 1467 1538 … … 1508 1579 1509 1580 #ifdef SH_ENCRYPT 1581 1510 1582 /* 1511 1583 * #define DEBUG_EN2 … … 1514 1586 * last 4 bytes of outgoing header are set to dummy value 1515 1587 */ 1516 char * sh_tools_makePack (unsigned char * header, 1588 char * sh_tools_makePack (unsigned char * header, int flag, 1517 1589 char * payload, unsigned long payload_size, 1518 1590 keyInstance * keyInstE) 1519 1591 { 1520 UINT32 rpad[3]; 1592 BYTE inBlock[B_SIZ]; 1593 BYTE outBlock[B_SIZ]; 1594 char ivBlock[B_SIZ]; 1595 1596 UINT32 rpad[3]; 1521 1597 unsigned char head[16]; 1522 double epad; 1523 unsigned long i_epad = 0; 1524 unsigned long i_blk = payload_size / 16; 1525 unsigned long i_blkmax = SH_V2_FULLSIZE / 16; 1526 unsigned long pads = 0; 1527 size_t full_size; 1528 char * full_ret; 1529 1530 char * p; 1531 RIJ_BYTE inBlock[B_SIZ]; 1532 RIJ_BYTE outBlock[B_SIZ]; 1533 int j; 1534 cipherInstance cipherInst; 1535 int err_num; 1536 int blkfac; 1537 int oflow = 0; 1598 double epad; 1599 unsigned long i_epad = 0; 1600 unsigned long i_blk = payload_size / 16; 1601 unsigned long i_blkmax = SH_V2_FULLSIZE / 16; 1602 unsigned long pads = 0; 1603 size_t full_size; 1604 char * full_ret; 1605 1606 unsigned char * p; 1607 int j; 1608 cipherInstance cipherInst; 1609 int err_num; 1610 int blkfac; 1611 int oflow = 0; 1612 char expbuf[SH_ERRBUF_SIZE]; 1538 1613 1539 1614 /* … … 1541 1616 */ 1542 1617 if ((i_blk * 16) != payload_size) ++i_blk; 1543 #ifdef DEBUG_EN2 1544 fprintf(stderr, "SEND <%d> blocks <%d>\n", payload_size, i_blk); 1545 #endif 1618 1546 1619 /* random_pad 1547 1620 */ … … 1553 1626 memcpy (&head[8], &rpad[2], 4); 1554 1627 1555 /* protocol1556 */1557 /* memcpy (&head[8], &header[3], 4); */1558 1559 1628 /* size (payload) 1560 1629 */ … … 1566 1635 if (i_blk < i_blkmax) 1567 1636 { 1568 pads = i_blkmax - i_blk; 1569 /* memcpy((char *) &rpad[2], &head[12], 4); */ 1570 epad = taus_get_double (&rpad); 1571 #ifdef DEBUG_EN2 1572 fprintf(stderr, "PAD1 <%d> <%f>\n", pads, epad); 1573 #endif 1637 pads = i_blkmax - i_blk; 1638 epad = taus_get_double (&rpad); 1574 1639 i_epad = (unsigned long) (pads * epad); 1575 #ifdef DEBUG_EN21576 fprintf(stderr, "PAD2 <%d> <%d>\n", i_epad, (i_epad*16));1577 #endif1578 1640 } 1579 1641 … … 1596 1658 1597 1659 full_ret = SH_ALLOC(full_size); 1660 1598 1661 memcpy(full_ret, head, 16); 1599 1662 if (payload != NULL && !oflow) 1600 { 1601 memcpy(&full_ret[16], payload, payload_size); 1602 } 1663 memcpy(&full_ret[16], payload, payload_size); 1664 1603 1665 if ((i_blk*16) > payload_size && !oflow) 1604 1666 { 1605 #ifdef DEBUG_EN21606 fprintf(stderr, "SEN2 <%d>\n", (i_blk*16) - payload_size);1607 #endif1608 1667 memset(&full_ret[16+payload_size], '\0', (i_blk*16) - payload_size); 1609 1668 payload_size = i_blk * 16; 1610 1669 } 1611 1670 memset(&full_ret[16+payload_size], '\0', i_epad*16); 1612 #ifdef DEBUG_EN21613 fprintf(stderr, "SEN3 <%d> <%d>\n", full_size, i_epad*16);1614 #endif1615 1671 1616 1672 /* rewrite header … … 1618 1674 header[1] = (unsigned int)(full_size/256); 1619 1675 header[2] = (unsigned int)(full_size - (256 * header[1])); 1620 /* don't erase protocol from header 1621 memset(&header[3], '\0', 4); 1622 */ 1623 p = full_ret; blkfac = full_size / 16; 1624 1625 err_num = cipherInit (&cipherInst, MODE_CBC, NULL); 1676 1677 p = (unsigned char *) full_ret; 1678 blkfac = full_size / B_SIZ; 1679 1680 err_num = rijndael_cipherInit (&cipherInst, MODE_CBC, NULL); 1626 1681 1627 if (err_num < 0) 1628 { 1629 char expbuf[SH_ERRBUF_SIZE]; 1630 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN, 1631 errorExplain(err_num, expbuf, sizeof(expbuf)), 1632 _("sh_tools_makePack: cipherInit")); 1633 } 1634 for (j = 0; j < blkfac; ++j) 1635 { 1682 if (err_num < 0) { 1683 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN, 1684 errorExplain(err_num, expbuf, sizeof(expbuf)), 1685 _("sh_tools_makePack: rijndael_cipherInit")); } 1686 1687 if (probe_ok(flag)) { 1688 memcpy(inBlock, p, B_SIZ); 1689 err_num = rijndael_blockEncrypt(&cipherInst, keyInstE, 1690 inBlock, 128, outBlock); 1691 if (err_num >= 0) { 1692 memcpy(p, outBlock, B_SIZ); p += B_SIZ; 1693 memcpy(ivBlock, outBlock, sizeof(ivBlock)); 1694 err_num = rijndael_cipherInit (&cipherInst, MODE_CBC, ivBlock); 1695 if (err_num >= 0) { 1696 err_num = rijndael_blockEncrypt(&cipherInst, keyInstE, 1697 p, 128*(blkfac-1), p); 1698 } 1699 } 1700 } 1701 1702 else { 1703 for (j = 0; j < blkfac; ++j) { 1636 1704 memcpy(inBlock, p, B_SIZ); 1637 err_num = blockEncrypt(&cipherInst, keyInstE,1638 inBlock, 128 * BNUM, outBlock);1639 if (err_num < 0)1640 1641 char expbuf[SH_ERRBUF_SIZE];1642 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN,1643 errorExplain(err_num, expbuf, sizeof(expbuf)),1644 _("sh_tools_makePack: blockEncrypt"));1645 } 1705 err_num = rijndael_blockEncrypt(&cipherInst, keyInstE, 1706 inBlock, 128, outBlock); 1707 1708 if (err_num < 0) { 1709 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN, 1710 errorExplain(err_num, expbuf, sizeof(expbuf)), 1711 _("sh_tools_makePack: rijndael_blockEncrypt")); 1712 break; } 1713 1646 1714 memcpy(p, outBlock, B_SIZ); 1647 1715 p += B_SIZ; 1648 1716 } 1717 } 1649 1718 1650 1719 return full_ret; … … 1654 1723 * last 4 bytes of incoming header are dummy 1655 1724 */ 1656 char * sh_tools_revertPack (unsigned char * header, char * message,1725 char * sh_tools_revertPack (unsigned char * header, int flag, char * message, 1657 1726 keyInstance * keyInstD, 1658 1727 unsigned long message_size) 1659 1728 { 1729 BYTE inBlock[B_SIZ]; 1730 BYTE outBlock[B_SIZ]; 1731 char ivBlock[B_SIZ]; 1660 1732 unsigned long msg_size; 1661 1733 char * msg_ret; 1662 1734 1663 char * p; 1664 RIJ_BYTE inBlock[B_SIZ]; 1665 RIJ_BYTE outBlock[B_SIZ]; 1735 unsigned char * p; 1666 1736 int j; 1667 1737 cipherInstance cipherInst; … … 1671 1741 1672 1742 msg_size = (256 * (unsigned int)header[1] + (unsigned int)header[2]); 1673 #ifdef DEBUG_EN2 1674 fprintf(stderr, "RECV <%lu>\n", msg_size); 1675 #endif 1676 if (msg_size > message_size) { 1743 if (msg_size > message_size) 1677 1744 msg_size = message_size; 1678 #ifdef DEBUG_EN2 1679 fprintf(stderr, "RECV TRUNC1 <%lu>\n", msg_size); 1680 #endif 1681 } 1682 1683 p = message; blkfac = msg_size / 16; 1684 1685 err_num = cipherInit (&cipherInst, MODE_CBC, NULL); 1745 1746 p = (unsigned char *) message; blkfac = msg_size / 16; 1747 1748 err_num = rijndael_cipherInit (&cipherInst, MODE_CBC, NULL); 1686 1749 1687 1750 if (err_num < 0) … … 1689 1752 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN, 1690 1753 errorExplain(err_num, expbuf, sizeof(expbuf)), 1691 _("sh_tools_revertPack: cipherInit")); 1692 } 1693 for (j = 0; j < blkfac; ++j) 1694 { 1754 _("sh_tools_revertPack: rijndael_cipherInit")); 1755 } 1756 1757 if (probe_ok(flag)) { 1758 memcpy(inBlock, p, B_SIZ); 1759 err_num = rijndael_blockDecrypt(&cipherInst, keyInstD, 1760 inBlock, 128, outBlock); 1761 if (err_num >= 0) { 1762 memcpy(p, outBlock, B_SIZ); p += B_SIZ; 1763 memcpy(ivBlock, inBlock, sizeof(ivBlock)); 1764 err_num = rijndael_cipherInit (&cipherInst, MODE_CBC, ivBlock); 1765 if (err_num >= 0) { 1766 err_num = rijndael_blockDecrypt(&cipherInst, keyInstD, 1767 p, 128*(blkfac-1), p); 1768 } 1769 } 1770 } 1771 1772 else { 1773 for (j = 0; j < blkfac; ++j) { 1695 1774 memcpy(inBlock, p, B_SIZ); 1696 err_num = blockDecrypt(&cipherInst, keyInstD, 1697 inBlock, 128 * BNUM, outBlock); 1698 if (err_num < 0) 1699 { 1700 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN, 1701 errorExplain(err_num, expbuf, sizeof(expbuf)), 1702 _("sh_tools_revertPack: blockDecrypt")); 1703 } 1775 err_num = rijndael_blockDecrypt(&cipherInst, keyInstD, 1776 inBlock, 128, outBlock); 1777 1778 if (err_num < 0) { 1779 sh_error_handle((-1), FIL__, __LINE__, -1, MSG_E_SUBGEN, 1780 errorExplain(err_num, expbuf, sizeof(expbuf)), 1781 _("sh_tools_revertPack: rijndael_blockDecrypt")); 1782 break; } 1783 1704 1784 memcpy(p, outBlock, B_SIZ); 1705 1785 p += B_SIZ; 1706 1786 } 1707 1787 } 1788 1708 1789 /* rewrite size in header 1709 1790 */ … … 1717 1798 header[1] = (unsigned int)(msg_size/256); 1718 1799 header[2] = (unsigned int)(msg_size - (256 * header[1])); 1719 #ifdef DEBUG_EN2 1720 fprintf(stderr, "RECV TRUNC2 <%lu>\n", msg_size); 1721 #endif 1722 } 1723 #ifdef DEBUG_EN2 1724 fprintf(stderr, "REC2 <%lu>\n", msg_size); 1725 #endif 1726 /* protocol 1727 */ 1728 /* memcpy(&header[3], &message[8], 4); */ 1800 } 1729 1801 1730 1802 /* payload … … 1732 1804 msg_ret = SH_ALLOC(msg_size+1); 1733 1805 if (msg_size > 0) 1734 { 1735 memcpy(msg_ret, &message[16], msg_size); 1736 } 1806 memcpy(msg_ret, &message[16], msg_size); 1737 1807 msg_ret[msg_size] = '\0'; 1738 #ifdef DEBUG_EN2 1739 fprintf(stderr, "REC3 <%lu>\n", msg_size); 1740 #endif 1808 1741 1809 SH_FREE(message); 1742 1743 1810 return msg_ret; 1744 1811 } 1745 #endif 1812 #endif /* #ifdef SH_ENCRYPT */ 1746 1813 1747 1814 int sh_tools_hash_add(char * key, char * buf, int buflen) … … 1781 1848 SL_RETURN((1), _("sh_tools_hash_vfy")); 1782 1849 } 1850 1851 #endif /* defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) */ 1852 1783 1853 1784 1854 /* ------------------------------------------ */ … … 1868 1938 #if defined (SH_WITH_SERVER) 1869 1939 1870 char * get_client_conf_file (c har * peer, unsigned long * length)1940 char * get_client_conf_file (const char * peer, unsigned long * length) 1871 1941 { 1872 1942 char * ret; … … 1874 1944 struct stat buf; 1875 1945 char * base; 1876 size_t size;1877 1946 1878 1947 SL_ENTER(_("get_client_conf_file")); 1879 1948 1880 1949 base = sh_util_strdup(DEFAULT_DATAROOT); 1881 1882 size = sl_strlen(base); 1883 if (sl_ok_adds(size, sl_strlen(peer))) 1884 size += sl_strlen(peer); 1885 if (sl_ok_adds(size, 6)) 1886 size += 6; 1887 1888 ret = SH_ALLOC(size); 1889 sl_strlcpy(ret, base, size); 1890 sl_strlcat(ret, _("/rc."), size); 1891 sl_strlcat(ret, peer, size); 1892 1950 ret = sh_util_strconcat(base, _("/rc."), peer, NULL); 1951 if (!ret) 1952 { SH_FREE(base); *length = 0; SL_RETURN(NULL, _("get_client_conf_file")); } 1953 1893 1954 status = retry_stat (FIL__, __LINE__, ret, &buf); 1894 1895 1955 if (status == 0) 1896 1956 goto lab_end; … … 1899 1959 (long) sh.effective.uid, ret); 1900 1960 1901 sl_strlcpy(ret, base, size); 1902 sl_strlcat(ret, "/rc", size); 1961 SH_FREE(ret); ret = sh_util_strconcat(base, _("/rc"), NULL); 1962 if (!ret) 1963 { SH_FREE(base); *length = 0; SL_RETURN(NULL, _("get_client_conf_file")); } 1903 1964 1904 1965 status = retry_stat (FIL__, __LINE__, ret, &buf); 1905 1906 1966 if (status == 0) 1907 1967 goto lab_end; … … 1910 1970 (long) sh.effective.uid, ret); 1911 1971 1912 SH_FREE(base); 1913 SH_FREE(ret); 1914 *length=0; 1972 SH_FREE(base); SH_FREE(ret); *length=0; 1915 1973 SL_RETURN(NULL, _("get_client_conf_file")); 1916 1974 … … 1920 1978 sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGEN, 1921 1979 _("File too large"), _("get_client_conf_file")); 1922 SH_FREE(base); 1980 SH_FREE(base); SH_FREE(ret); *length = 0; 1923 1981 SL_RETURN(NULL, _("get_client_conf_file")); 1924 1982 } 1925 *length = (unsigned long) buf.st_size; 1926 SH_FREE(base); 1983 1984 SH_FREE(base); *length = (unsigned long) buf.st_size; 1927 1985 SL_RETURN(ret, _("get_client_conf_file")); 1928 1986 } 1929 1987 1930 char * get_client_data_file (c har * peer, unsigned long * length)1988 char * get_client_data_file (const char * peer, unsigned long * length) 1931 1989 { 1932 1990 char * ret; 1933 1991 int status; 1934 1992 struct stat buf; 1935 1936 1993 char * base; 1937 size_t size;1938 1994 1939 1995 SL_ENTER(_("get_client_data_file")); 1940 1996 1941 1997 base = sh_util_strdup(DEFAULT_DATAROOT); 1942 1943 size = sl_strlen(base); 1944 if (sl_ok_adds(size, sl_strlen(peer))) 1945 size += sl_strlen(peer); 1946 if (sl_ok_adds(size, 8)) 1947 size += 8; 1948 1949 ret = SH_ALLOC(size); 1950 sl_strlcpy(ret, base, size); 1951 sl_strlcat(ret, _("/file."), size); 1952 sl_strlcat(ret, peer, size); 1953 1998 ret = sh_util_strconcat(base, _("/file."), peer, NULL); 1999 if (!ret) 2000 { SH_FREE(base); *length = 0; SL_RETURN(NULL, _("get_client_data_file")); } 2001 1954 2002 status = retry_stat (FIL__, __LINE__, ret, &buf); 1955 1956 2003 if (status == 0) 1957 2004 goto lab1_end; … … 1960 2007 (long) sh.effective.uid, ret); 1961 2008 1962 1963 sl_strlcpy(ret, base, size); 1964 sl_strlcat(ret, _("/file"), size); 1965 2009 SH_FREE(ret); 2010 ret = sh_util_strconcat(base, _("/file"), NULL); 2011 if (!ret) 2012 { SH_FREE(base); *length = 0; SL_RETURN(NULL, _("get_client_data_file")); } 2013 1966 2014 status = retry_stat (FIL__, __LINE__, ret, &buf); 1967 1968 2015 if (status == 0) 1969 2016 goto lab1_end; … … 1972 2019 (long) sh.effective.uid, ret); 1973 2020 1974 1975 *length = 0; 1976 SH_FREE(base); 1977 SH_FREE(ret); 2021 *length = 0; SH_FREE(base); SH_FREE(ret); 1978 2022 SL_RETURN(NULL, _("get_client_data_file")); 1979 2023 … … 1983 2027 sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGEN, 1984 2028 _("File too large"), _("get_client_data_file")); 1985 SH_FREE(base); 2029 SH_FREE(base); SH_FREE(ret); *length = 0; 1986 2030 SL_RETURN(NULL, _("get_client_data_file")); 1987 2031 } 2032 2033 *length = (unsigned long) buf.st_size; SH_FREE(base); 2034 SL_RETURN(ret, _("get_client_data_file")); 2035 } 2036 2037 char * get_client_uuid_file (const char * peer, unsigned long * length, const char * uuid) 2038 { 2039 char * ret; 2040 int status; 2041 struct stat buf; 2042 char * base; 2043 2044 SL_ENTER(_("get_client_uuid_file")); 2045 2046 base = sh_util_strdup(DEFAULT_DATAROOT); 2047 ret = sh_util_strconcat(base, _("/file."), peer, ".", uuid, NULL); 2048 SH_FREE(base); 2049 if (!ret) 2050 { *length = 0; SL_RETURN(NULL, _("get_client_uuid_file")); } 2051 2052 status = retry_stat (FIL__, __LINE__, ret, &buf); 2053 if (status != 0) 2054 { 2055 sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_ACCESS, 2056 (long) sh.effective.uid, ret); 2057 SH_FREE(ret); *length = 0; 2058 SL_RETURN(NULL, _("get_client_uuid_file")); 2059 } 2060 else if (buf.st_size > 0x7fffffff) 2061 { 2062 sh_error_handle(SH_ERR_ERR, FIL__, __LINE__, status, MSG_E_SUBGEN, 2063 _("File too large"), _("get_client_uuid_file")); 2064 SH_FREE(ret); *length = 0; 2065 SL_RETURN(NULL, _("get_client_data_file")); 2066 } 2067 1988 2068 *length = (unsigned long) buf.st_size; 1989 SH_FREE(base); 1990 SL_RETURN(ret, _("get_client_data_file")); 1991 1992 } 2069 SL_RETURN(ret, _("get_client_uuid_file")); 2070 } 2071 1993 2072 #endif 1994 2073 … … 2091 2170 if (SL_ISERROR(fd)) 2092 2171 { 2093 sh_error_handle( SH_ERR_ALL, FIL__, __LINE__, fd, MSG_E_SUBGEN,2172 sh_error_handle((-1), FIL__, __LINE__, fd, MSG_E_SUBGEN, 2094 2173 _("Error opening temporary file"), _("open_tmp")); 2095 2174 TPT(( 0, FIL__, __LINE__, _("msg=<Error %d temporary file %s>\n"), 2096 2175 fd, file)); 2097 2176 } 2098 2099 2177 2100 2178 SH_FREE (file);
Note:
See TracChangeset
for help on using the changeset viewer.