The /bin/true Command and Copyright
trillian.mit.edu
trillian.mit.edu
REPORTING BUGS
Report false bugs to bug-coreutils@gnu.org
I love commands with pesky names.The source code is in this Daily WTF thread: http://forums.thedailywtf.com/forums/t/3779.aspx
First, copyright does not protect ideas--it only protects the way an author expressed the idea. The closer the expression is to the minimal way to express the idea, the less likely it is to be copyrightable. In the case of the simple implementations of /bin/true and /bin/false, they are pretty darned close to minimal.
Second, if you have author X who produces a copyrightable work, and author Y who later independently produces a work that happens to be identical to X's work, but Y did not copy elements from X, Y is not infringing X's copyright.
This second case doesn't happen often. If someone were to decide to write a novel about boy wizards, and produced something identical to the first Harry Potter book, no one would believe that they did this without copying from Rowling. However, if the work is small enough, an identical independent work is believable.
In the case of the simple /bin/true and /bin/false, a defense that you didn't copy from AT&T would be believable. Even if you admitted you looked at the AT&T source or had it described to you, it would be believable that you produced your own expression of the idea of "a do nothing shell script" and a "shell script that exits with status 255".
$ cat /usr/bin/false
#!/usr/bin/sh
# Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T
# All Rights Reserved
# THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
# The copyright notice above does not evidence any
# actual or intended publication of such source code.
#ident "@(#)false.sh 1.6 93/01/11 SMI" /* SVr4.0 1.3 */
exit 255
You'll notice the slight difference with `true`. An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.That's pretty clearly a non-trivial source file. Obviously a pointless one, but copyrightable. And it has the standard GNU copyleft blurb at the top.
;)
ltrace gives a better view of what the program itself (as opposed to the runtime) is doing.
For a lot of my time there, I was more operations than development. A lot of piddly-ass configuration files and other things no copyright could possibly exist for got copyright strings added just so I wouldn't have to remember to type "NO ACME COPYRIGHT" into every bloody commit message to bypass the hook.
# (c) 2012 me
#
# The following comment is tried to be copyrighted
# by me. Do not misue!
#
awesomeYeah, super awesome!!
As many know the #ident tag in 'C' code was used with SCCS (pre-cursor to git/svn/cvs/etc) to create a string in the 'binary' which identified the code. In shell scripts it just sat there.
The change in the ident string where it gets the 'SMI' is when the version was from 'Sun Microsystems Inc' (aka SMI).
The reason Solaris included it was because it was part of the 'merge' between SunOS and System V and Sun had permission to all of the AT&T copyrights with respect to UNIX once they became 'partners' (AT&T invested essentially a billion dollars in Sun).
But in reality, couldn't one argue that the copyright covers the name '/bin/true' and the empty file contents?
Or that the whole work is copyrighted, with a stamp on each file to remind you of that fact?
(f recall correctly...)
WRONG!
codesign -d -v /usr/bin/true $ ls -la /usr/bin/true /usr/bin/false
-r-xr-xr-x 1 root wheel 34240 Jul 20 2011 /usr/bin/false
-r-xr-xr-x 1 root wheel 34240 Jul 20 2011 /usr/bin/true
$ cmp -l /usr/bin/true /usr/bin/false |wc
8194 24582 114716
and CentOS 6: $ ls -la /bin/true /bin/false
-rwxr-xr-x. 1 root root 25144 Dec 7 14:51 /bin/false
-rwxr-xr-x. 1 root root 25144 Dec 7 14:51 /bin/true
$ cmp -l /bin/true /bin/false |wc
355 1065 4970
The signature size explains (part of) the larger delta on OS X, but left me wondering, so: ~/coreutils/src]$ ls -alrth true.c false.c
-rw-r--r-- 1 dvd staff 2.2K Jan 30 09:31 true.c
-rw-r--r-- 1 dvd staff 51B Jan 30 09:31 false.c
Curious! ~/coreutils/src]$ cat false.c
#define EXIT_STATUS EXIT_FAILURE
#include "true.c"
And figuring out why that still results in such a large binary delta is over my head.On OS X these binaries are fat binaries:
$ file /usr/bin/true
/usr/bin/true: Mach-O universal binary with 2 architectures
/usr/bin/true (for architecture x86_64): Mach-O 64-bit executable x86_64
/usr/bin/true (for architecture i386): Mach-O executable i386