linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry McVoy <lm@bitmover.com>
To: Dave Jones <davej@suse.de>, Pavel Machek <pavel@suse.cz>,
	kernel list <linux-kernel@vger.kernel.org>
Subject: Re: Bitkeeper licence issues
Date: Mon, 18 Mar 2002 18:02:33 -0800	[thread overview]
Message-ID: <20020318180233.D10086@work.bitmover.com> (raw)
In-Reply-To: <20020318212617.GA498@elf.ucw.cz> <20020318144255.Y10086@work.bitmover.com> <20020318231427.GF1740@atrey.karlin.mff.cuni.cz> <20020319002241.K17410@suse.de>

On Tue, Mar 19, 2002 at 12:22:41AM +0100, Dave Jones wrote:
> On Tue, Mar 19, 2002 at 12:14:28AM +0100, Pavel Machek wrote:
> 
>  > > Pavel, the problem here is your fundamental distrust.  
>  > By giving me binary-only installer you ask me to trust you. You ask me
>  > to trust you without good reason [it only generates .tar.gz and
>  > shellscript, why should it be binary? Was not shar designed to handle
>  > that?], and that's pretty suspect.
> 
>  Bitmover doing anything remotely suspect in an executable installer
>  would be commercial suicide, do you distrust realplayer too?

And all our installer does, and I will give you the code if you want it,
I'd be happy to even have Pavel audit it, is make two arrays, 

extern unsigned int installer_size;
extern unsigned char installer_data[];
extern unsigned int data_size;
extern unsigned char data_data[];

which we do some magic on to make sure they are preallocated (HPUX decided
that static global data should be allocated and bzeroed at runtime, so
we preinitialize them with garbage if I remember correctly).

Then the thing that makes the installer mmaps the object, looks for these
arrays (we stick some magic numbers in front of them), and files them in
with a .tar.gz and the real installer, which is a shell script.

The reason we didn't use shar, Pavel, is that we are shipping a binary.
If we used shar that would increase the size of the image that you download
and we wanted downloads to be fast.  As it is, I think it's a couple of MB.

Anyway, then the actual binary which runs is generated from the following 
program which is hardly worth all the fuss.

main()
{
        char    installer_name[200];
        char    data_name[200];
        char    cmd[2048];
        int     fd;

        fprintf(stderr, "Please wait while we unpack the installer...");
        sprintf(installer_name, "/tmp/installer%d", getpid());
        fd = creat(installer_name, 0777);
        if (fd == -1) {
                perror(installer_name);
                exit(1);
        }
        if (write(fd, installer_data, installer_size) != installer_size) {
                perror("write on installer");
                unlink(installer_name);
                exit(1);
        }
        close(fd);
        sprintf(data_name, "/tmp/data%d", getpid());
        fd = creat(data_name, 0777);
        if (fd == -1) {
                perror(data_name);
                exit(1);
        }
        sprintf(installer_name, "/tmp/installer%d", getpid());
        if (write(fd, data_data, data_size) != data_size) {
                perror("write on data");
                unlink(data_name);
                exit(1);
        }
        close(fd);
        fprintf(stderr, "done.\n");
        sprintf(cmd, "%s %s %s", installer_name, installer_name, data_name);
        system(cmd);
        exit(0);
}
-- 
---
Larry McVoy            	 lm at bitmover.com           http://www.bitmover.com/lm 

  parent reply	other threads:[~2002-03-19  2:02 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-18 21:26 Bitkeeper licence issues Pavel Machek
2002-03-18 22:42 ` Larry McVoy
2002-03-18 23:14   ` Pavel Machek
2002-03-18 23:22     ` Dave Jones
2002-03-18 23:43       ` Pavel Machek
2002-03-19  8:35         ` Rik van Riel
2002-03-19  2:02       ` Larry McVoy [this message]
2002-03-19  8:21         ` Gerd Knorr
2002-03-19 15:11           ` Larry McVoy
2002-03-19 21:58         ` Pavel Machek
2002-03-19 22:04           ` Larry McVoy
     [not found]         ` <20020319215800.GN12260@atrey.karlin.m__.cuni.cz>
2002-03-20 22:42           ` Ton Hospel
2002-03-19 22:06       ` Pavel Machek
2002-03-19 23:25         ` Larry McVoy
2002-03-19 23:27           ` David S. Miller
2002-03-19 23:44             ` Larry McVoy
2002-03-19 23:45               ` David S. Miller
2002-03-19 23:54                 ` Matthew Kirkwood
2002-03-19 23:56               ` Ben Collins
2002-03-20 17:23               ` Martin Dalecki
2002-03-20 17:51                 ` Alan Cox
2002-03-20 18:04                   ` Martin Dalecki
2002-03-20 20:34                     ` Neil Booth
2002-03-19 23:34           ` Tom Rini
2002-03-20  0:09             ` Alan Cox
2002-03-24 11:44             ` Thunder from the hill
2002-03-20  7:57           ` Alexander Viro
2002-03-19  0:00     ` yodaiken
2002-03-19  1:29       ` David S. Miller
2002-03-19  1:18   ` Roman Zippel
2002-03-19  1:37     ` David S. Miller
2002-03-19 18:42       ` Roman Zippel
2002-03-19 19:09         ` Alan Cox
2002-03-19 20:01           ` Shane Nay
2002-03-19 23:08           ` Rik van Riel
2002-03-19 23:19             ` Robert Love
2002-03-19 23:26               ` Rik van Riel
2002-03-19 23:42                 ` Davide Libenzi
2002-03-19 23:31             ` yodaiken
2002-03-19 23:47               ` Larry McVoy
2002-03-20  0:02                 ` Thomas Dodd
2002-03-20  0:19                 ` Theodore Tso
2002-03-20  0:57                   ` Petko Manolov
2002-03-21 19:44                 ` Mark H. Wood
2002-03-21 20:29                   ` Shane Nay
2002-03-27 14:40                 ` Henning P. Schmiedehausen
2002-03-20  0:05               ` James Simmons
2002-03-19 20:35                 ` Andreas Dilger
2002-03-20  0:14                 ` Kurt Ferreira
2002-03-20  2:16                   ` Greg Hennessy
2002-03-20  0:57             ` Richard Gooch
2002-03-21 19:14           ` Roman Zippel
2002-03-21 20:54             ` Alan Cox
2002-03-22  0:02               ` Roman Zippel
2002-03-19  1:44     ` Anton Altaparmakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020318180233.D10086@work.bitmover.com \
    --to=lm@bitmover.com \
    --cc=davej@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).