Re: amiga-fdisk 0.4 and debian/potato boot floppies.
- To: Stefan Reinauer <stepan@elvis.informatik.uni-freiburg.de>
 
- Cc: Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>,  debian-68k@lists.debian.org, debian-boot@lists.debian.org,  debian-powerpc@lists.debian.org, stepan@linux.de,  Frank.Neumann@informatik.uni-oldenburg.de
 
- Subject: Re: amiga-fdisk 0.4 and debian/potato boot floppies.
 
- From: Sven LUTHER <luther@dpt-info.u-strasbg.fr>
 
- Date: Wed, 26 Jan 2000 11:09:11 +0100
 
- Message-id: <[🔎] 20000126110911.A19837@dpt-info.u-strasbg.fr>
 
- Mail-followup-to: Stefan Reinauer <stepan@elvis.informatik.uni-freiburg.de>,	Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de>,	debian-68k@lists.debian.org, debian-boot@lists.debian.org,	debian-powerpc@lists.debian.org, stepan@linux.de,	Frank.Neumann@informatik.uni-oldenburg.de
 
- Reply-to: luther@dpt-info.u-strasbg.fr
 
- In-reply-to: <[🔎] Pine.LNX.4.00.10001252035530.5579-100000@wesley.informatik.uni-freiburg.de>; from stepan@elvis.informatik.uni-freiburg.de on Tue, Jan 25, 2000 at 08:39:13PM +0100
 
- References: <[🔎] 200001251439.PAA14396@faui22c.informatik.uni-erlangen.de> <[🔎] Pine.LNX.4.00.10001252035530.5579-100000@wesley.informatik.uni-freiburg.de>
 
On Tue, Jan 25, 2000 at 08:39:13PM +0100, Stefan Reinauer wrote:
> 
> On Tue, 25 Jan 2000, Roman Hodek wrote:
> 
> > Yes, gets() is dangerous because it doesn't check the bounds of the
> > input buffer. One should use fgets() instead, e.g.:
> > 
> > +#ifdef DONT_USE_READLINE
> > +char *readline (const char *prompt)
> > +{
> > +       char buffer[1024];
> > +       char *s;
> > +       int size;
> > +       printf ("%s",prompt);
> > +       fflush (stdout);
> > +       fgets (buffer, sizeof(buffer), stdin);
> > +       size = strlen (buffer);
> > +       s = malloc ((size+1)*sizeof(char));
> > +       s = strcpy (s, buffer);
> > +       fflush (stdin);
> > +       return s;
> > +}
> > +#endif
> > 
> > This is sufficiently safe.
> > 
> > > So i guess best would be to have two binary package from amiga
> > > fdisk, one called amiga-fdisk is to be used by everyone, the other,
> > > called amiga-fdisk-boot-floppies, or something such is to be used by
> > > the boot floppies folk.
> > 
> > Makes sense.
> 
> Isn't fdisk/amiga only used to get the partition data of the disks? In
> this case, we could just make a very small version that does just this.
> 
> I like the above solution for readline. If there's no argument against it,
> I will put it in and release a new version the next days.
> 
> I lost some old mails describing bugs in amiga-fdisk. If you have some
> unfixed bugs left, you're welcome to tell me.
Hello, ...
If you want, i can mail you (this afternoon) a patch about it. For the debian
package, it is needed to be able to build both version one after another also,
but i can always fix it in the debian version so it works.
Also, after discution with roman, maybe a way of doing the same thing with
fgets should be more appropriate than using scanf and fflush.
And for the debian people, I modified the amiga-fdisk makefile to build
amiga-fdisk-boot-floppies, how can i manage to put it in the
amiga-fdisk-boot-floppies package ? nothing about multi binaries package was
found in the debian packaging docs i have installed on my system.
Friendly,
Sven LUTHER
Reply to: