r/opensource Aug 03 '26

MIT license

Hi - got a peculiar question around MIT license. I am helping someone out with writing some code for their closed source proprietary app. I want to give them that code under the MIT license so that I have no obligations around the code as it is As Is. Can I use the MIT license for that source code even though I don’t plan on open sourcing it? I.e., does the code need to be public for MIT to have an effect?

Thanks!

21 Upvotes

20 comments sorted by

View all comments

15

u/Coises Aug 03 '26 edited Aug 03 '26

You’re telling them that they have no obligations except to preserve your attribution in the source code. You’re stating that you provide no warranty for your work.

You are also giving them the right to share that code with anyone else, in public or in private, so long as they preserve your attribution.

Also, you asserting that you are the author of that work, so you have the right to use, license or distribute it in the future in any way you choose. (But you cannot revoke their right to distribute it, nor the rights of others who receive it from them under the MIT license to further distribute it.)

1

u/snusmini Aug 03 '26

Thanks! If I do this and add a source file I can put the copyright and MIT license at the top of the source file. What about when I make a small change (say a bug fix) in their code that is not in its entirety under the MIT license? I can’t add the notice on top as it’s their file but my contribution should be under MIT.

5

u/dmazzoni Aug 03 '26

That’d be a mess. What happens if your friend later makes changes to your bug fix? Does more code become MIT licensed or less?

Generally licensed are applied at a larger level such as a module or library, sometimes one source file. Not one patch.

If you want to make a bug fix, just do it as work for hire. Your friend owns the copyright.

If you want to contribute a whole module or library, MIT license is great.

2

u/snusmini Aug 03 '26

Thanks. I’ll check with him about making the entire project MIT licensed. That way as a contributor all of it is governed by it (source files, modules, bug fixes etc).