Hi Darren,

Darren J Moffat wrote:
> Daniel Hain wrote:
>> Exported Interfaces:
>>
>>         SUNWpwgen        Uncommited        Package name
>>     /usr/bin/pwgen        Commited        Executable location
>>     /usr/bin/amd64/pwgen    Commited        Executable location
>>     /usr/bin/sparcv9/pwgen    Commited        Executable location
> 
> What is the rationale for having a 32 and 64 bit version of this program ?
> 
> Can this be built as a library (say libpwgen) so that we can implement a 
> PAM module around this ?  I see value in it being a standalone program 
> but even more value in also having a PAM module (this would be used 
> instead of or stacked above pam_authtok_get in some configurations).

I think it is possible after slight code modification.

I have found that pwgen.c containing main() function just parses command 
line, sets up few variables indicating modes and conditions under which 
passwords will be generated and calls pwgen() function which finally 
does the work. I can imagine to make a library from objects. This 
library on one hand can be used to build a tool and to be ready for 
general use on the other hand. It would be necessary to update manual 
(man page) to document the interface.

This is how it gets compiled so far:
<snip>
ligi at marvin ~/doc/project/sun/oss/wrk/pwgen/pwgen-2.06 $ make
gcc -c  -DHAVE_DRAND48=1 -DHAVE_GETOPT_LONG=1 -DHAVE_GETOPT_H=1  -g -O2 
  pwgen.c -o pwgen.o
gcc -c  -DHAVE_DRAND48=1 -DHAVE_GETOPT_LONG=1 -DHAVE_GETOPT_H=1  -g -O2 
  pw_phonemes.c -o pw_phonemes.o
...
gcc -c  -DHAVE_DRAND48=1 -DHAVE_GETOPT_LONG=1 -DHAVE_GETOPT_H=1  -g -O2 
  sha1num.c -o sha1num.o
gcc  -o pwgen pwgen.o pw_phonemes.o pw_rand.o randnum.o sha1.o sha1num.o
</snip>

This is how the worker function gets called:
<snip>
                 pwgen(buf, pw_length, pwgen_flags);
</snip>
where buf is a buffer to which passwords will be generated and pw_length 
and pwgen_flags specifies the generation mode.

Would it usable?

Regards
Martin

> 
> -- 
> Darren J Moffat
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: martin_rehak.vcf
Type: text/x-vcard
Size: 182 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/opensolaris-arc/attachments/20080717/312ebd07/attachment.vcf>

Reply via email to