New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing source code - GPL compliance? #107

Closed
Manouchehri opened this Issue Apr 10, 2016 · 24 comments

Comments

Projects
None yet
8 participants
@Manouchehri
Contributor

Manouchehri commented Apr 10, 2016

As far as I can tell, bash.exe is under the GPLv3 license.

C:\Users\VM>bash.exe --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
root@localhost:~# bash --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.

I wasn't able to locate the source code; if the file(s) or link could be shared here that would be appreciated.

@mchristen

This comment has been minimized.

mchristen commented Apr 10, 2016

Bash.exe is different from the GNU bash command you are running inside of bash.exe.

Bash.exe looks to be a Win32 launcher for the real bash binary, that unfortunately shares the same name.

The source code for the bash program you are running above in the code sample is available here

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 10, 2016

Running bash.exe --version shows as GPLv3 too.

C:\Users\VM>bash.exe --version
GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Even if it's not intentional, bash.exe claims it's under the GPL, so I expect it to be under the GPL.

@mchristen

This comment has been minimized.

mchristen commented Apr 10, 2016

That really doesn't mean anything, bash.exe could be simply passing through command line arguments(like a sane launcher should do) to GNU bash.

The bash.exe binary is only 64K, whereas the GNU bash installed in /bin/bash is 998K. I think it is safe to say that bash.exe located in C:\Windows\system32 is not GNU bash.

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 10, 2016

@mchristen Removing /bin/bash results in bash.exe outputting nothing. The only license I can see as a user with bash.exe is the GPL. Even if the launcher is 'accidentally' showing the wrong license, I'm not sure if that's a valid excuse?

@mhall119

This comment has been minimized.

mhall119 commented Apr 10, 2016

bash.exe could be simply passing through command line arguments(like a sane launcher should do)

That may be sane in general, but it would be a good idea to at least catch --version and present accurate information about bash.exe itself.

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 10, 2016

Since removing /bin/bash results in bash.exe not functioning, I think it's fair to say that bash.exe depends is derived on /bin/bash? By the GPLv3 license, that means bash.exe must be under the GPL?

@mhall119

This comment has been minimized.

mhall119 commented Apr 10, 2016

Depends != Derived, only derived code is subject to the GPL

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 10, 2016

Running bash on a non-UNIX seems feels derived to me, not sure though.

@mchristen

This comment has been minimized.

mchristen commented Apr 10, 2016

That's my point though, you are running the real GNU bash, it is not derived in any shape or form.

Just because you happen to run a program called bash.exe that makes a Windows system call to execute the GNU bash binary(I'm guessing at how this actually works) does not mean that bash.exe is derived from GNU bash.

If MSFT were taking GNU bash, recompiling it for Win32 ala Cygwin, then yes, they would need to publish the source code for it, but as it stands all the source code for all the Linux binaries being executed are available directly from the upstream Ubuntu.

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 10, 2016

Putting the technical details aside, bash.exe --version does say it's under the GPLv3 license.

Even if that's a mistake, don't they have to comply with the license? It seems like a slippery slope for users to be expected to know that the vendor meant to use another license.

@dethoma

This comment has been minimized.

dethoma commented Apr 10, 2016

bash.exe is a simple wrapper that directly invokes the Canonical provided binaries. There is no GPL code in the bash.exe wrapper.

@dethoma dethoma closed this Apr 10, 2016

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 10, 2016

@dethoma So what is the license for bash.exe?

@dethoma

This comment has been minimized.

dethoma commented Apr 10, 2016

Standard license for Windows binaries. It is covered by the Windows EULA.

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 10, 2016

@dethoma But when I run bash.exe --version, it doesn't give me the Windows EULA.

@dethoma

This comment has been minimized.

dethoma commented Apr 10, 2016

That is argument redirection in action as other users have noticed above.

@mchristen

This comment has been minimized.

mchristen commented Apr 10, 2016

Imagine this scenario, as a Linux user you create a shell script in your home directory and you name it 'bash'.

The source code is as follows,

#!/bin/sh

bash $@

If I publish my shell script am I also required to publish the source code of GNU bash?

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 10, 2016

@mchristen You haven't modified GNU bash and the shell script is already in source code form. So in that example, you've already published the sources.

@bitcrazed

This comment has been minimized.

Collaborator

bitcrazed commented Apr 12, 2016

@Manouchehri. The Windows Subsystem for Linux (WSL) doesn't modify or derive any GPL code: It runs native, unmodified ELF binaries by loading them into a lightweight process created by the Windows Kernel, binding the ELF binary's imports to our syscall implementation and then executing as normal.

Bash.exe is a simple Windows app that binds a console (i.e. terminal) window to a process that loads and runs the native /bin/bash from the Ubuntu image you downloaded when you first enabled the WSL. Bash.exe performs no other significant actions, and, in fact, passes all command-line parameters, unmodified, to /bin/bash, which is why, when you run bash --help, you see the help text generated by /bin/bash:

C:\Users\richturn>bash --help
GNU bash, version 4.3.11(1)-release-(x86_64-pc-linux-gnu)
Usage:  /bin/bash [GNU long option] [option] ...
        /bin/bash [GNU long option] [option] script-file ...
GNU long options:
        --debug
        --debugger
        --dump-po-strings
        --dump-strings
        --help
        --init-file
        --login
        --noediting
        --noprofile
        --norc
        --posix
        --rcfile
        --restricted
        --verbose
        --version
Shell options:
        -ilrsD or -c command or -O shopt_option         (invocation only)
        -abefhkmnptuvxBCHP or -o option
Type `/bin/bash -c "help set"' for more information about shell options.
Type `/bin/bash -c help' for more information about shell builtin commands.
Use the `bashbug' command to report bugs.

It was named Bash.exe as a convenience since, in end-user testing, most users expected bash to run when bash was entered into the command-line or start menu.

HTH.

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 14, 2016

@bitcrazed Is it possible to use the WSL without bash.exe?

@benhillis

This comment has been minimized.

Member

benhillis commented Apr 14, 2016

@Manouchehri currently bash.exe is the only publicly documented entrypoint. We are working on others. If you have ideas or opinions on the topic please share feedback on our user voice page: http://aka.ms/winbashuv

@tkelman

This comment has been minimized.

tkelman commented Apr 15, 2016

Would it be feasible to have bash.exe released as open source on its own, even if the rest of WSL is still being decided upon?

@Manouchehri

This comment has been minimized.

Contributor

Manouchehri commented Apr 15, 2016

@immibis

This comment has been minimized.

immibis commented Apr 18, 2018

Is the source code for /bin/bash provided?

@bitcrazed

This comment has been minimized.

Collaborator

bitcrazed commented Apr 18, 2018

Since WSL doesn't ship any distro binaries, you find/view the sources via the distro publisher themselves - i.e. Canonical/Ubuntu, SUSE, Debian, Kali, etc.

Here's Ubuntu's bash package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment