bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new coreutil? shuffle - randomize file contents


From: Frederik Eaton
Subject: Re: new coreutil? shuffle - randomize file contents
Date: Fri, 15 Jul 2005 08:19:54 -0700
User-agent: Mutt/1.5.9i

Hi,

Attached is a third patch.

Is there a script for making a patch with all the right files excluded
by the way? "cvs diff" produces a huge amount of unrelated output
because of files that are both in the repository and touched by
"configure", and it doesn't list new files. And "diff" doesn't seem to
have an --include option to match its --exclude...

> > Attached is a second patch, which contains a ChangeLog entry and some
> > formatting changes as requested by Jim.
> 
> Can you update your patch to be relative to coreutils-CVS,
>   <http://savannah.gnu.org/cvs/?group=coreutils>
> rather than to the aging 5.2.1?

Done.

> Also, formatting should adhere to the gnu coding standards.
> A good way to start is by using GNU indent with the default
> settings.

I did this for some things. Maybe if you see other problems you could
run GNU indent before running 'cvs commit'?

> shred also tries to obtain a random seed.
> It'd be nice (eventually) to have both programs
> use the same mechanism.

I did not realize this. Yes, perhaps it would.

> Please use FIXME rather than XXX to mark bits of
> code that need more attention.
> 
> Regarding this:
>    error (SORT_FAILURE, 0, _("%s: invalid field specification `%s'"),
>             _(msgid), spec);
> -  abort ();
> +  abort (); // XXX is this ever reached? need comment if it is
> 
> That code is never reached, because the preceding error
> call invokes `exit (SORT_FAILURE)'.  The abort is to pacify
> gcc -Wall.
> 
> Regarding this:
> +  char *randseed = 0;
> please use `NULL', instead:
>   char *randseed = NULL;
> 
> I've just noticed that this would make sort
> use a file in $HOME (~/.gnupg/entropy).  That
> dependency on $HOME would be a first for coreutils.
> I'm reluctant to pull in all of that EGD-related code
> just to get a default seed in some environments.
> Do any of you have a feel for how important (or how
> widely available) EGD support is in practice?

I do not have any idea, but it would be good to have random seed
functionality somewhere standard-ish. It would be nice if it were in
libc but that's an area I don't want to tackle.

Also, I didn't personally think it was necessary to do anything but
look at the time and process ID for a default seed - I only added the
"/dev/random" stuff because Paul Eggert seems to think that security
is very important here - and once "/dev/random" is referenced then I
figured compatibility with other kinds of systems would become an
issue so I just copied the whole bit from libgcrypt. If you want to
change that stuff, go ahead.

I would like not to spend much more time on this, by the way, it's
been about 7 months now, I would like for us to try to at least figure
out what should be in a preliminary version, make sure that the
command line interface is suitable, etc., somewhat soon. For instance,
if the random stuff stays, then I'll need some guidance on what is the
best way to update configure.ac (unless you want to do it). Also, I'm
not sure what kind of documentation will need to be updated. I was
hoping for more of this kind of feedback, so we can minimize the
number of email back-and-forths.

Thanks,

Frederik

Attachment: rand-patch-6.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]