1/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-only */ 2 3Unless otherwise *explicitly* stated, the following text describes the 4licensed conditions under which the contents of this libcap release 5may be used and distributed. 6 7The licensed conditions are one or the other of these two Licenses: 8 9 - BSD 3-clause 10 - GPL v2.0 11 12------------------------------------------------------------------------- 13BSD 3-clause: 14------------- 15 16Redistribution and use in source and binary forms of libcap, with 17or without modification, are permitted provided that the following 18conditions are met: 19 201. Redistributions of source code must retain any existing copyright 21 notice, and this entire permission notice in its entirety, 22 including the disclaimer of warranties. 23 242. Redistributions in binary form must reproduce all prior and current 25 copyright notices, this list of conditions, and the following 26 disclaimer in the documentation and/or other materials provided 27 with the distribution. 28 293. The name of any author may not be used to endorse or promote 30 products derived from this software without their specific prior 31 written permission. 32 33THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 34WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 35MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 36IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, 37INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 38BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 39OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 40ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 41TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 42USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 43DAMAGE. 44 45------------------------------------------------------------------------- 46GPL v2.0: 47--------- 48 49ALTERNATIVELY, this product may be distributed under the terms of the 50GNU General Public License (v2.0 - see below), in which case the 51provisions of the GNU GPL are required INSTEAD OF the above 52restrictions. 53 54------------------------- 55Full text of gpl-2.0.txt: 56------------------------- 57 58 GNU GENERAL PUBLIC LICENSE 59 Version 2, June 1991 60 61 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 62 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 63 Everyone is permitted to copy and distribute verbatim copies 64 of this license document, but changing it is not allowed. 65 66 Preamble 67 68 The licenses for most software are designed to take away your 69freedom to share and change it. By contrast, the GNU General Public 70License is intended to guarantee your freedom to share and change free 71software--to make sure the software is free for all its users. This 72General Public License applies to most of the Free Software 73Foundation's software and to any other program whose authors commit to 74using it. (Some other Free Software Foundation software is covered by 75the GNU Lesser General Public License instead.) You can apply it to 76your programs, too. 77 78 When we speak of free software, we are referring to freedom, not 79price. Our General Public Licenses are designed to make sure that you 80have the freedom to distribute copies of free software (and charge for 81this service if you wish), that you receive source code or can get it 82if you want it, that you can change the software or use pieces of it 83in new free programs; and that you know you can do these things. 84 85 To protect your rights, we need to make restrictions that forbid 86anyone to deny you these rights or to ask you to surrender the rights. 87These restrictions translate to certain responsibilities for you if you 88distribute copies of the software, or if you modify it. 89 90 For example, if you distribute copies of such a program, whether 91gratis or for a fee, you must give the recipients all the rights that 92you have. You must make sure that they, too, receive or can get the 93source code. And you must show them these terms so they know their 94rights. 95 96 We protect your rights with two steps: (1) copyright the software, and 97(2) offer you this license which gives you legal permission to copy, 98distribute and/or modify the software. 99 100 Also, for each author's protection and ours, we want to make certain 101that everyone understands that there is no warranty for this free 102software. If the software is modified by someone else and passed on, we 103want its recipients to know that what they have is not the original, so 104that any problems introduced by others will not reflect on the original 105authors' reputations. 106 107 Finally, any free program is threatened constantly by software 108patents. We wish to avoid the danger that redistributors of a free 109program will individually obtain patent licenses, in effect making the 110program proprietary. To prevent this, we have made it clear that any 111patent must be licensed for everyone's free use or not licensed at all. 112 113 The precise terms and conditions for copying, distribution and 114modification follow. 115 116 GNU GENERAL PUBLIC LICENSE 117 TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 118 119 0. This License applies to any program or other work which contains 120a notice placed by the copyright holder saying it may be distributed 121under the terms of this General Public License. The "Program", below, 122refers to any such program or work, and a "work based on the Program" 123means either the Program or any derivative work under copyright law: 124that is to say, a work containing the Program or a portion of it, 125either verbatim or with modifications and/or translated into another 126language. (Hereinafter, translation is included without limitation in 127the term "modification".) Each licensee is addressed as "you". 128 129Activities other than copying, distribution and modification are not 130covered by this License; they are outside its scope. The act of 131running the Program is not restricted, and the output from the Program 132is covered only if its contents constitute a work based on the 133Program (independent of having been made by running the Program). 134Whether that is true depends on what the Program does. 135 136 1. You may copy and distribute verbatim copies of the Program's 137source code as you receive it, in any medium, provided that you 138conspicuously and appropriately publish on each copy an appropriate 139copyright notice and disclaimer of warranty; keep intact all the 140notices that refer to this License and to the absence of any warranty; 141and give any other recipients of the Program a copy of this License 142along with the Program. 143 144You may charge a fee for the physical act of transferring a copy, and 145you may at your option offer warranty protection in exchange for a fee. 146 147 2. You may modify your copy or copies of the Program or any portion 148of it, thus forming a work based on the Program, and copy and 149distribute such modifications or work under the terms of Section 1 150above, provided that you also meet all of these conditions: 151 152 a) You must cause the modified files to carry prominent notices 153 stating that you changed the files and the date of any change. 154 155 b) You must cause any work that you distribute or publish, that in 156 whole or in part contains or is derived from the Program or any 157 part thereof, to be licensed as a whole at no charge to all third 158 parties under the terms of this License. 159 160 c) If the modified program normally reads commands interactively 161 when run, you must cause it, when started running for such 162 interactive use in the most ordinary way, to print or display an 163 announcement including an appropriate copyright notice and a 164 notice that there is no warranty (or else, saying that you provide 165 a warranty) and that users may redistribute the program under 166 these conditions, and telling the user how to view a copy of this 167 License. (Exception: if the Program itself is interactive but 168 does not normally print such an announcement, your work based on 169 the Program is not required to print an announcement.) 170 171These requirements apply to the modified work as a whole. If 172identifiable sections of that work are not derived from the Program, 173and can be reasonably considered independent and separate works in 174themselves, then this License, and its terms, do not apply to those 175sections when you distribute them as separate works. But when you 176distribute the same sections as part of a whole which is a work based 177on the Program, the distribution of the whole must be on the terms of 178this License, whose permissions for other licensees extend to the 179entire whole, and thus to each and every part regardless of who wrote it. 180 181Thus, it is not the intent of this section to claim rights or contest 182your rights to work written entirely by you; rather, the intent is to 183exercise the right to control the distribution of derivative or 184collective works based on the Program. 185 186In addition, mere aggregation of another work not based on the Program 187with the Program (or with a work based on the Program) on a volume of 188a storage or distribution medium does not bring the other work under 189the scope of this License. 190 191 3. You may copy and distribute the Program (or a work based on it, 192under Section 2) in object code or executable form under the terms of 193Sections 1 and 2 above provided that you also do one of the following: 194 195 a) Accompany it with the complete corresponding machine-readable 196 source code, which must be distributed under the terms of Sections 197 1 and 2 above on a medium customarily used for software interchange; or, 198 199 b) Accompany it with a written offer, valid for at least three 200 years, to give any third party, for a charge no more than your 201 cost of physically performing source distribution, a complete 202 machine-readable copy of the corresponding source code, to be 203 distributed under the terms of Sections 1 and 2 above on a medium 204 customarily used for software interchange; or, 205 206 c) Accompany it with the information you received as to the offer 207 to distribute corresponding source code. (This alternative is 208 allowed only for noncommercial distribution and only if you 209 received the program in object code or executable form with such 210 an offer, in accord with Subsection b above.) 211 212The source code for a work means the preferred form of the work for 213making modifications to it. For an executable work, complete source 214code means all the source code for all modules it contains, plus any 215associated interface definition files, plus the scripts used to 216control compilation and installation of the executable. However, as a 217special exception, the source code distributed need not include 218anything that is normally distributed (in either source or binary 219form) with the major components (compiler, kernel, and so on) of the 220operating system on which the executable runs, unless that component 221itself accompanies the executable. 222 223If distribution of executable or object code is made by offering 224access to copy from a designated place, then offering equivalent 225access to copy the source code from the same place counts as 226distribution of the source code, even though third parties are not 227compelled to copy the source along with the object code. 228 229 4. You may not copy, modify, sublicense, or distribute the Program 230except as expressly provided under this License. Any attempt 231otherwise to copy, modify, sublicense or distribute the Program is 232void, and will automatically terminate your rights under this License. 233However, parties who have received copies, or rights, from you under 234this License will not have their licenses terminated so long as such 235parties remain in full compliance. 236 237 5. You are not required to accept this License, since you have not 238signed it. However, nothing else grants you permission to modify or 239distribute the Program or its derivative works. These actions are 240prohibited by law if you do not accept this License. Therefore, by 241modifying or distributing the Program (or any work based on the 242Program), you indicate your acceptance of this License to do so, and 243all its terms and conditions for copying, distributing or modifying 244the Program or works based on it. 245 246 6. Each time you redistribute the Program (or any work based on the 247Program), the recipient automatically receives a license from the 248original licensor to copy, distribute or modify the Program subject to 249these terms and conditions. You may not impose any further 250restrictions on the recipients' exercise of the rights granted herein. 251You are not responsible for enforcing compliance by third parties to 252this License. 253 254 7. If, as a consequence of a court judgment or allegation of patent 255infringement or for any other reason (not limited to patent issues), 256conditions are imposed on you (whether by court order, agreement or 257otherwise) that contradict the conditions of this License, they do not 258excuse you from the conditions of this License. If you cannot 259distribute so as to satisfy simultaneously your obligations under this 260License and any other pertinent obligations, then as a consequence you 261may not distribute the Program at all. For example, if a patent 262license would not permit royalty-free redistribution of the Program by 263all those who receive copies directly or indirectly through you, then 264the only way you could satisfy both it and this License would be to 265refrain entirely from distribution of the Program. 266 267If any portion of this section is held invalid or unenforceable under 268any particular circumstance, the balance of the section is intended to 269apply and the section as a whole is intended to apply in other 270circumstances. 271 272It is not the purpose of this section to induce you to infringe any 273patents or other property right claims or to contest validity of any 274such claims; this section has the sole purpose of protecting the 275integrity of the free software distribution system, which is 276implemented by public license practices. Many people have made 277generous contributions to the wide range of software distributed 278through that system in reliance on consistent application of that 279system; it is up to the author/donor to decide if he or she is willing 280to distribute software through any other system and a licensee cannot 281impose that choice. 282 283This section is intended to make thoroughly clear what is believed to 284be a consequence of the rest of this License. 285 286 8. If the distribution and/or use of the Program is restricted in 287certain countries either by patents or by copyrighted interfaces, the 288original copyright holder who places the Program under this License 289may add an explicit geographical distribution limitation excluding 290those countries, so that distribution is permitted only in or among 291countries not thus excluded. In such case, this License incorporates 292the limitation as if written in the body of this License. 293 294 9. The Free Software Foundation may publish revised and/or new versions 295of the General Public License from time to time. Such new versions will 296be similar in spirit to the present version, but may differ in detail to 297address new problems or concerns. 298 299Each version is given a distinguishing version number. If the Program 300specifies a version number of this License which applies to it and "any 301later version", you have the option of following the terms and conditions 302either of that version or of any later version published by the Free 303Software Foundation. If the Program does not specify a version number of 304this License, you may choose any version ever published by the Free Software 305Foundation. 306 307 10. If you wish to incorporate parts of the Program into other free 308programs whose distribution conditions are different, write to the author 309to ask for permission. For software which is copyrighted by the Free 310Software Foundation, write to the Free Software Foundation; we sometimes 311make exceptions for this. Our decision will be guided by the two goals 312of preserving the free status of all derivatives of our free software and 313of promoting the sharing and reuse of software generally. 314 315 NO WARRANTY 316 317 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 318FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 319OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 320PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 321OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 322MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 323TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 324PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 325REPAIR OR CORRECTION. 326 327 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 328WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 329REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 330INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 331OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 332TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 333YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 334PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 335POSSIBILITY OF SUCH DAMAGES. 336 337 END OF TERMS AND CONDITIONS 338 339 How to Apply These Terms to Your New Programs 340 341 If you develop a new program, and you want it to be of the greatest 342possible use to the public, the best way to achieve this is to make it 343free software which everyone can redistribute and change under these terms. 344 345 To do so, attach the following notices to the program. It is safest 346to attach them to the start of each source file to most effectively 347convey the exclusion of warranty; and each file should have at least 348the "copyright" line and a pointer to where the full notice is found. 349 350 <one line to give the program's name and a brief idea of what it does.> 351 Copyright (C) <year> <name of author> 352 353 This program is free software; you can redistribute it and/or modify 354 it under the terms of the GNU General Public License as published by 355 the Free Software Foundation; either version 2 of the License, or 356 (at your option) any later version. 357 358 This program is distributed in the hope that it will be useful, 359 but WITHOUT ANY WARRANTY; without even the implied warranty of 360 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 361 GNU General Public License for more details. 362 363 You should have received a copy of the GNU General Public License along 364 with this program; if not, write to the Free Software Foundation, Inc., 365 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 366 367Also add information on how to contact you by electronic and paper mail. 368 369If the program is interactive, make it output a short notice like this 370when it starts in an interactive mode: 371 372 Gnomovision version 69, Copyright (C) year name of author 373 Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 374 This is free software, and you are welcome to redistribute it 375 under certain conditions; type `show c' for details. 376 377The hypothetical commands `show w' and `show c' should show the appropriate 378parts of the General Public License. Of course, the commands you use may 379be called something other than `show w' and `show c'; they could even be 380mouse-clicks or menu items--whatever suits your program. 381 382You should also get your employer (if you work as a programmer) or your 383school, if any, to sign a "copyright disclaimer" for the program, if 384necessary. Here is a sample; alter the names: 385 386 Yoyodyne, Inc., hereby disclaims all copyright interest in the program 387 `Gnomovision' (which makes passes at compilers) written by James Hacker. 388 389 <signature of Ty Coon>, 1 April 1989 390 Ty Coon, President of Vice 391 392This General Public License does not permit incorporating your program into 393proprietary programs. If your program is a subroutine library, you may 394consider it more useful to permit linking proprietary applications with the 395library. If this is what you want to do, use the GNU Lesser General 396Public License instead of this License. 397