Вопрос

I am planning to use a GitHub public repository for building a small application that works only on some specific hardware; it's for personal use only in my PC: if used on other hardware it may cause issues or maybe even hardware damage (I don't know). I don't mind if some one find my code useful and use for their needs, but I don't want anyone blaming me or suing me because it didn't work or caused issue.

Which license can I use to prevent such issues?

I have looked at few like Apache v2, MIT, GPL, etc, but I feel very confused. I don't really understand the legal implications. Is it better just keep my code with me and not use GitHub?

Some users may feel Stack Overflow is not the best place for this question but I think because everyone here is a programmer, maybe I'll get useful information and that may help clear another person's doubts as well.

Это было полезно?

Решение

Most Open Source licenses include a warranty disclaimer and liability limitation language. To the extent that your jurisdiction allows you to disclaim warranty and liability, any of them are likely to be usable.

For instance, the MIT license includes:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

And from the Apache License:

7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.

8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.

And from the GNU General Public License:

15. Disclaimer of Warranty.

THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

16. Limitation of Liability.

IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

So any of the licenses you mentioned already have the type of language you're after.

Другие советы

What about going for a well respected open source license and creating a README file, with a line, like:

The author is not responsible for the consequences of use of this software.

and also adding this to every file you have so that the one using it has to see it.

You can add following to your sources header and readme file:

IN NO EVENT SHALL AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". AUTHOR HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

Disclaimer: This is not a legal Advice

Of the licences you listed, use MIT. It contains the protective clause you need but lets anyone do just about anything with your code (except pretend it's theirs).

Why MIT? Because it's really short and you just include it in your source code. if you don't know what else you need pick this one because it's all you need.

I'm a lawyer (and a programmer). The best advice is not roll your own licence - I would use the OSI (Open Source Initiative) licence resource available here. The MIT licence would be appropriate as it contains exclusions of all warranties and disavows all liability for use of the code. So does (for example) the Apache 2.0 licence. The exclusion of warranties and all liability is a common feature in open source licences, and there's not much to distinguish the one from the other insofar as warranties and liability are concerned, so I would tend to the shorter of them, which is the MIT licence.

I agree with James Henstridge's answer above where he writes "To the extent that your jurisdiction allows you to disclaim warranty and liability, any of them are likely to be usable."

Which jurisdiction (country) are you in?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top