From patchwork Wed Dec 21 18:21:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Iooss X-Patchwork-Id: 9483611 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D7FE601D2 for ; Wed, 21 Dec 2016 18:23:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 150AC28458 for ; Wed, 21 Dec 2016 18:23:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08E3E2847B; Wed, 21 Dec 2016 18:23:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (emsm-gh1-uea11.nsa.gov [8.44.101.9]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2990128458 for ; Wed, 21 Dec 2016 18:23:42 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.33,384,1477958400"; d="scan'208";a="1768223" IronPort-PHdr: =?us-ascii?q?9a23=3AwSiL9hHiubrCHqf/be3ycp1GYnF86YWxBRYc798d?= =?us-ascii?q?s5kLTJ79pMu6bnLW6fgltlLVR4KTs6sC0LuN9fC6Ej1fqb+681k6OKRWUBEEjc?= =?us-ascii?q?hE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i764jEdAAjwOhRo?= =?us-ascii?q?LerpBIHSk9631+ev8JHPfglEnjSwbLd8IRmsrgjdqMYajI9gJ60s1hbHv3xEdv?= =?us-ascii?q?hMy2h1P1yThRH85smx/J5n7Stdvu8q+tBDX6vnYak2VKRUAzs6PW874s3rrgTD?= =?us-ascii?q?QhCU5nQASGUWkwFHDBbD4RrnQ5r+qCr6tu562CmHIc37SK0/VDq+46t3ThLjlS?= =?us-ascii?q?kINyQ98GrKlMJ+iqxVqw+lqxBm3oLYfISZOfxjda3fYNwaX3JMUMZPWSJcDI2y?= =?us-ascii?q?bIwBAOgPPeZArYTxulUDohSiCgejGuzv0SRFhmP00KAgz+gsCx3K0BImEtkTsH?= =?us-ascii?q?rUttL1NKIKXO6tzanH0TLDb/dM1jfm9YPGcRchofaXXbJrbMHczk8vFwLZgVWX?= =?us-ascii?q?rYzqJSiV2v4Ms2ic6OpgTvmvhnUiqwx+rTmj3MAsipPGho8MzF3P6CZ3wJ4tKN?= =?us-ascii?q?GlR0N2bsSoHZtNuy2AKYd7Td0uT3t1tCoiyLALu4S3cDUExZkp3RLTdeCLfomS?= =?us-ascii?q?7h/tSuqcJypzimh/d7KlnRmy9FCtyuj7VsapzllHtjFFktzQtnAV0BzT99SHRu?= =?us-ascii?q?N9/ki/3TaP0Bje6v1eLkAulKrbNoUhzqQslpsTrUvDHij2lF/wjKCKbUUr5vKk?= =?us-ascii?q?6+HmYrXivpOcNol0hR/iMqk2h8CyDus1PhIOUmSG4+iwyrLu8VPjTLlXlvE2l7?= =?us-ascii?q?PWsJHeJcQVvK65BApV35446xmhCzem0dIYnWQILV5cYx2HiJXpO1fSL//mFvey?= =?us-ascii?q?mEiskTd3yPDGOb3tGJPNLmPZn7v7crZ97FBcxBIpzd9D/5JUFq0BIPXrV07xtd?= =?us-ascii?q?3YCRk5Phexw+bjEdl914UeVXiJAqCDKqPSsl6I5vwxLOWWYo8apir9IeA/5/Hy?= =?us-ascii?q?lX85hUMdfa6x0JQJcHC3BO5mI0SCYXf3mtcOC30KvgslTOzyjF2NSyJcaGioU6?= =?us-ascii?q?I7/DE7B5qsDZ3fSYC1nLyBwCC7E4VYZmBcEF+MF2vnd4SfW/oXbSKSOs5hniUf?= =?us-ascii?q?VbmvUI8tzxautBX1y7B/NOrb5jUYtY7/1Nhy/+DTlgs99T9zD8SAyGyNTHt7nm?= =?us-ascii?q?APRz8rxqx/plZ9ylib26hin/NYDcBT5+9OUgoiL5HT0vZ6C9HsVQLbZdqGUkqp?= =?us-ascii?q?QtC8DTE2VNIxzMcEY1xhFNW6khDDwy2qDqcVl7OVAJw09qXc0mP1J8Zg13bG06?= =?us-ascii?q?whgEM8TstIL22mibZ19xLPCI7Rj0WZi6GqeLwH3C7D7meDynGOvF1DXQ5rV6XF?= =?us-ascii?q?Wn4eZk7MotT//E/CSaGhCag/OAtb1cGCMrdKasHujVheSvbsItDeY36vlGeqHh?= =?us-ascii?q?aF3a2MY5Twe2oGwSXdDVIIkwcJ/XaJLQI+HDuuo3rCDDxyElLie1/s/vRjp3O6?= =?us-ascii?q?VEA0yxqHYFFm17qw5hEan+ecS+8J0rICpighty1+HEyh0NLOF9qAuw1hcb1aYd?= =?us-ascii?q?M85FdH0XzWtxdmM5O6Ma9inFkefx5wv0P02BV9Ep9AntQyrHM20ApyLrqV305b?= =?us-ascii?q?eDOEx5//JLPXK2bp8R+za67ZwEve0MqI9acV8vg4rUvsvB2xHEo473pny8VV02?= =?us-ascii?q?eb5pjSEgoSUI7+Ulow9xhgvb3Vfik954TS1X1jKqS0tj7C29QzC+s/zRasZdBf?= =?us-ascii?q?MLmLFAXqCc0VG9CuKPA2m1iudh8EOOFS9LUoP8+/bPuJxqqrPOdmnDK7gmVK+5?= =?us-ascii?q?t90lqN9yp6S+7Hw40Fz+ue3gSZSzf2lE2hvdzvmYBYeTESGXKyyTLjBI5VYq19?= =?us-ascii?q?Y5wLBnupI8y53dh+nIPtVGJD9FK5AFMGwsCpcwKIb1PhxQ1QyVgXoXu/lCug1T?= =?us-ascii?q?N0jjUporCF0yDU2Ovicx4HOnJMRGlkllrsJJS4j9YdXEe0dQQpkgWq5VrizahB?= =?us-ascii?q?uKt/N3XTQVtPfyXuKmFiVrK8uaSEY8NU9pMnryFXUOCiblCAULL9pQUV0z/7FW?= =?us-ascii?q?tE2D87by2quon+nxFii2KSMnBzrGHCdMFz2xjf4sfcRfhP0ToaXiV4jiPXBlek?= =?us-ascii?q?Ndmz4dqUj4vDsvy5V2+5SJ1TdzTkwJietCu9+GJqAQezn/atld37CQI6yzP018?= =?us-ascii?q?F2VSXUqxbxepHr2L6nMeJjZURnGF7869Z6G41nnIs/npcQ1WIdhpWP8noNiX3z?= =?us-ascii?q?PslD2aLicHoNQiYGw8TI7wf4w0BjIXeJxo3jWnWb3MRhe8GwYnkK1SIl88BKFK?= =?us-ascii?q?CU4aRcnSRvv1q4qRzeYeBnkTcb1fsh9mQajvoUuAo20CqdGKsSEVNDPSzrihSI?= =?us-ascii?q?9cyxo7tZZGaoa7iw21RxkcqnDL6cvgFWQGz5dYs6HS9s8sV/N0rB0HPp5YHiZN?= =?us-ascii?q?nQatcTuwaakxjekudVL4gxmeAShSp9PmL9v2MqxPInjRB02pG6poeHIX13/K2l?= =?us-ascii?q?Gh5YKiH1Z8QL9zHijaZRgtyW3oC3HpV9HTUGR53oQuy0EDIJqfvoLR6OHyMmpn?= =?us-ascii?q?edB7XfAReV6F16oHLXD5CrK3aXKWEczdp4QBmdIFJQgBwIXDoghJE0DQaqy9L9?= =?us-ascii?q?cEdi+j8e/Eb4pQVWxuJuKRb/Tn/VpB20ZTcsVJifMB1W4xlY50vPP82S9OdzED?= =?us-ascii?q?tc/p2mrA2AMXaUaBhNDW0TXUyEHV/jNKG05dbc6+iYGva+L/zWbLWIs+xRTe+I?= =?us-ascii?q?xYq034to/jaMLN6PPmVsD/063EpMR3Z5FNjYmzoVTywbjSXNb9SUpB2k4C14st?= =?us-ascii?q?i/8Oj3WALo/YaPE6VdPs5x9BCwgKeDK+mQiT14KTlGyJwD22XEyL8F3F4dkytu?= =?us-ascii?q?bSWiEawctS7RS6LdgrJYDwUFZCxpO8tI9bgz3hdWNM7AkNz11aN4juQvBFtfUV?= =?us-ascii?q?zhh8epatYQI22kKFPHA0WLNbSB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mdD09ajg+d6KrQEqd8yaFD6GQ75Px2QF+AQynecmnGzYqm?= =?us-ascii?q?DdhDxSFwrnD4z8DUpPxiNKNGp4FlB1cHGSB2Jtfb/TBFSmz03RW9sAu1HDSZOj?= =?us-ascii?q?IW/CgEKTYDdulr0+8o+CrPI83M7UKWqrIJtFqgCQHNDKG9npNMFJLHzwK9PA9K?= =?us-ascii?q?ejKvHos+i/FKj81aNaUmbo+6CkuHLw/5FRmwvnwcsh/wreL4XoJx3mwCn/B0e5?= =?us-ascii?q?nSVI4QAIychWl1?= X-IPAS-Result: =?us-ascii?q?A2HWBAA0yFpY/wHyM5BbAhwBAQQBAQoBARcBAQQBAQoBAYM?= =?us-ascii?q?KAQEBAQEfgWSOQ6YjhlEmh2NTAQEBAQEBAQECAQJfKIIzGoIcBgECNxQgDgMJA?= =?us-ascii?q?QEXIQgICAMBLRURDgsFGASISwQBqmMqAoNohyKGNoYogkMRAWQLhQ4BBJp3gXq?= =?us-ascii?q?PMopGhhhJkWpXaB9Rg2UcgV5xhiqCLgEBAQ?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 21 Dec 2016 18:23:41 +0000 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id uBLINdQF021456; Wed, 21 Dec 2016 13:23:39 -0500 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id uBLIMNF4034186 for ; Wed, 21 Dec 2016 13:22:23 -0500 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id uBLIMCXm021001 for ; Wed, 21 Dec 2016 13:22:22 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1AyAAAeyFpYhyIeaIFbAhwBAQQBAQoBAYM1AQEBAQGCA45DpiOCP4Qzh2hTAQIBAQEBAQITAQEBCgsJCR2FGQaBCTkYVxmIbAQBqmOEFIcihjaGKIM5C4UOBZp3gXqPMpBeSZFqgV1RgxMMRhyBXnGGKoIuAQEB X-IPAS-Result: A1AyAAAeyFpYhyIeaIFbAhwBAQQBAQoBAYM1AQEBAQGCA45DpiOCP4Qzh2hTAQIBAQEBAQITAQEBCgsJCR2FGQaBCTkYVxmIbAQBqmOEFIcihjaGKIM5C4UOBZp3gXqPMpBeSZFqgV1RgxMMRhyBXnGGKoIuAQEB X-IronPort-AV: E=Sophos;i="5.33,384,1477972800"; d="scan'208";a="5887167" Received: from emsm-gh1-uea10.corp.nsa.gov (HELO emsm-gh1-uea10.nsa.gov) ([10.208.41.36]) by goalie.tycho.ncsc.mil with ESMTP; 21 Dec 2016 13:22:22 -0500 IronPort-PHdr: =?us-ascii?q?9a23=3AnRLwKB8mapaITv9uRHKM819IXTAuvvDOBiVQ1KB4?= =?us-ascii?q?2uocTK2v8tzYMVDF4r011RmSDN6du6gP2rWempujcFRI2YyGvnEGfc4EfD4+ou?= =?us-ascii?q?JSoTYdBtWYA1bwNv/gYn9yNs1DUFh44yPzahANS47xaFLIv3K98yMZFAnhOgpp?= =?us-ascii?q?POT1HZPZg9iq2+yo9ZDeZwtFiCC+bL9sIxm7qQfcvdQKjIV/Lao81gHHqWZSde?= =?us-ascii?q?RMwmNoK1OTnxLi6cq14ZVu7Sdete8/+sBZSan1cLg2QrJeDDQ9LmA6/9brugXZ?= =?us-ascii?q?TQuO/XQTTGMbmQdVDgff7RH6WpDxsjbmtud4xSKXM9H6QawyVD+/6apgVR3mhz?= =?us-ascii?q?odNzMh8G/ZlNF+gqxYrhympRN/zZXZbJ2JOPdkYq/QZ88WSXZHU81MVyJBGIS8?= =?us-ascii?q?b44XAuQZPOZXs479p18UohulGAKiB+TvyjhThn/twKY31OIhEQDa0wwnG9IBqm?= =?us-ascii?q?/UoM/0NKcVVuC117LIwC7Gb/5Z1jbx8o/IcgouofyVW797bMnfyVE3Gg/YkFmd?= =?us-ascii?q?rZbpMy6J2ukCqWSW4fZsWfihhmMosw18oDqiyt0xhoTHiI8Z0E7I+Tl4zYovK9?= =?us-ascii?q?C0Vkh2asO+HpRKrSGVLY52T9siQ252vCY6zaULuZu0fSQX0pgn3xnfa/iHcoiU?= =?us-ascii?q?/B3sSOaRITF5hHJ8ZbKwmQy+8U+6yu3zTsW00VBKoTRZktTUq3wByRje5tKaRv?= =?us-ascii?q?dh8UqtwziC2xzJ5uxKLk04ja/bJIQgwr40mJoTq0PDHirulUvrkKGYa1ko9/Cz?= =?us-ascii?q?6+npY7vmuIeROI17hAzmN6QjlcO+Df4/MggUUGiW4eK81Lz/8k3+RLVFlOY2nr?= =?us-ascii?q?PYsJDdIsQbvbW5DhRO3YYk9ha/CSup38oDnXUdKVJIdx2Gg5LuO1HUL/D0Fe2/?= =?us-ascii?q?jEi0kDd32/DGOaXsAo7TIXjHkbfhe6t96kFHxQovzdFQ+5JUCrYbLPL1QU/+rs?= =?us-ascii?q?bUDhA+MwyqkK7bD4Bm24cfX3+fKrOIO6PV91mT76QgJPffSpUSvWPbKvMi4/f1?= =?us-ascii?q?xV4+nkQGNf2v3JAQbHmjWPVhJF6CSX+wkpEGC2hc7Vl2d/DjlFDXCW0bXH21Ra?= =?us-ascii?q?9pvjw=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0GOAAA0yFpYhyIeaIFbAhwBAQQBAQoBA?= =?us-ascii?q?RcBAQQBAQoBAYMKAQEBAQGCA45DpiOCP4Qzh2hTAQEBAQEBAQECAQIQAQEBCgs?= =?us-ascii?q?JCR0wgjMYgh4GgQk5GFcZiGwEAapjhBSHIoY2hiiDOQuFDgWad4F6jzKQXkmRa?= =?us-ascii?q?oFeUYMTDEYcgV5xhiqCLgEBAQ?= X-IPAS-Result: =?us-ascii?q?A0GOAAA0yFpYhyIeaIFbAhwBAQQBAQoBARcBAQQBAQoBAYM?= =?us-ascii?q?KAQEBAQGCA45DpiOCP4Qzh2hTAQEBAQEBAQECAQIQAQEBCgsJCR0wgjMYgh4Gg?= =?us-ascii?q?Qk5GFcZiGwEAapjhBSHIoY2hiiDOQuFDgWad4F6jzKQXkmRaoFeUYMTDEYcgV5?= =?us-ascii?q?xhiqCLgEBAQ?= X-IronPort-AV: E=Sophos;i="5.33,384,1477958400"; d="scan'208";a="2187933" Received: from mx1.polytechnique.org ([129.104.30.34]) by emsm-gh1-uea10.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Dec 2016 18:22:14 +0000 Received: from localhost.localdomain (32.206.133.77.rev.sfr.net [77.133.206.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 220695647EF for ; Wed, 21 Dec 2016 19:22:13 +0100 (CET) From: Nicolas Iooss To: selinux@tycho.nsa.gov Subject: [PATCH v2 5/7] libsemanage: add semanage_str_replace() utility function Date: Wed, 21 Dec 2016 19:21:02 +0100 Message-Id: <20161221182104.16967-6-nicolas.iooss@m4x.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161221182104.16967-1-nicolas.iooss@m4x.org> References: <20161221182104.16967-1-nicolas.iooss@m4x.org> X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Wed Dec 21 19:22:13 2016 +0100 (CET)) X-Org-Mail: nicolas.iooss.2010@polytechnique.org X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Virus-Scanned: ClamAV using ClamSMTP This function will be used in the next commit. Signed-off-by: Nicolas Iooss --- libsemanage/src/utilities.c | 55 ++++++++++++++++++++++++++++++++++++++ libsemanage/src/utilities.h | 10 +++++++ libsemanage/tests/test_utilities.c | 34 +++++++++++++++++++++++ 3 files changed, 99 insertions(+) diff --git a/libsemanage/src/utilities.c b/libsemanage/src/utilities.c index fa86cc77dc56..0d50d99026db 100644 --- a/libsemanage/src/utilities.c +++ b/libsemanage/src/utilities.c @@ -230,6 +230,61 @@ void semanage_rtrim(char *str, char trim_to) } } +char *semanage_str_replace(const char *search, const char *replace, + const char *src, size_t lim) +{ + size_t count = 0, slen, rlen, newsize; + char *p, *pres, *result; + const char *psrc; + + slen = strlen(search); + rlen = strlen(replace); + + /* Do not support empty search strings */ + if (slen == 0) + return NULL; + + /* Count the occurences of search in src and compute the new size */ + for (p = strstr(src, search); p != NULL; p = strstr(p + slen, search)) { + count++; + if (lim && count >= lim) + break; + } + if (!count) + return strdup(src); + + /* Allocate the result string */ + newsize = strlen(src) + 1 + count * (rlen - slen); + result = malloc(newsize); + if (!result) + return NULL; + + /* Fill the result */ + psrc = src; + pres = result; + for (p = strstr(src, search); p != NULL; p = strstr(psrc, search)) { + /* Copy the part which has not been modified */ + if (p != psrc) { + size_t length = (size_t)(p - psrc); + memcpy(pres, psrc, length); + pres += length; + } + /* Copy the replacement part */ + if (rlen != 0) { + memcpy(pres, replace, rlen); + pres += rlen; + } + psrc = p + slen; + count--; + if (!count) + break; + } + /* Copy the last part, after doing a sanity check */ + assert(pres + strlen(psrc) + 1 == result + newsize); + strcpy(pres, psrc); + return result; +} + /* list_addafter_controlmem does *NOT* duplicate the data argument * use at your own risk, I am building a list out of malloc'd memory and * it is only going to get stored into this list, thus when I destroy it diff --git a/libsemanage/src/utilities.h b/libsemanage/src/utilities.h index 5fa15efd08d0..f2ff31f0f5b6 100644 --- a/libsemanage/src/utilities.h +++ b/libsemanage/src/utilities.h @@ -116,6 +116,16 @@ int semanage_str_count(char *data, char what); void semanage_rtrim(char *str, char trim_to); /** + * @param value being searched for + * @param replacement value that replaces found search values + * @param string being searched and replaced on + * @param maximum number of value occurences (zero for unlimited) + * @return newly-allocated string with the replaced values + */ +char *semanage_str_replace(const char *search, const char *replace, + const char *src, size_t lim); + +/** * @param data some string * @return modifies the string such that the first whitespace char becomes * '\0', ending the string. diff --git a/libsemanage/tests/test_utilities.c b/libsemanage/tests/test_utilities.c index b46f18db2a99..30ac7f5823e6 100644 --- a/libsemanage/tests/test_utilities.c +++ b/libsemanage/tests/test_utilities.c @@ -40,6 +40,7 @@ void test_semanage_split(void); void test_semanage_list(void); void test_semanage_str_count(void); void test_semanage_rtrim(void); +void test_semanage_str_replace(void); void test_semanage_findval(void); void test_slurp_file_filter(void); @@ -101,6 +102,10 @@ int semanage_utilities_add_tests(CU_pSuite suite) if (NULL == CU_add_test(suite, "semanage_rtrim", test_semanage_rtrim)) { goto err; } + if (NULL == CU_add_test(suite, "semanage_str_replace", + test_semanage_str_replace)) { + goto err; + } if (NULL == CU_add_test(suite, "semanage_findval", test_semanage_findval)) { goto err; @@ -257,6 +262,35 @@ void test_semanage_rtrim(void) free(str); } +void test_semanage_str_replace(void) +{ + const char *test_str = "Hello, I am %{USERNAME} and my id is %{USERID}"; + char *str1, *str2; + + str1 = semanage_str_replace("%{USERNAME}", "root", test_str, 0); + CU_ASSERT_STRING_EQUAL(str1, "Hello, I am root and my id is %{USERID}"); + + str2 = semanage_str_replace("%{USERID}", "0", str1, 1); + CU_ASSERT_STRING_EQUAL(str2, "Hello, I am root and my id is 0"); + free(str1); + free(str2); + + str1 = semanage_str_replace(":(", ";)", "Test :( :) ! :(:(:))(:(", 0); + CU_ASSERT_STRING_EQUAL(str1, "Test ;) :) ! ;);):))(;)"); + free(str1); + + str1 = semanage_str_replace(":(", ";)", "Test :( :) ! :(:(:))(:(", 3); + CU_ASSERT_STRING_EQUAL(str1, "Test ;) :) ! ;);):))(:("); + free(str1); + + str1 = semanage_str_replace("", "empty search string", "test", 0); + CU_ASSERT_EQUAL(str1, NULL); + + str1 = semanage_str_replace("a", "", "abracadabra", 0); + CU_ASSERT_STRING_EQUAL(str1, "brcdbr"); + free(str1); +} + void test_semanage_findval(void) { char *tok;