[Toybox] New toy: login

Elie De Brauwer eliedebrauwer at gmail.com
Sat Apr 28 06:35:11 PDT 2012


On 04/25/2012 04:18 AM, Rob Landley wrote:
> Specifically, you add three new headers, one of which is in susv4
> (syslog.h) and two of which aren't (crypt.h and shadow.h).
>
> This implies we should have another config time probe in
> scripts/genconfig.sh to go with the unshare() probe, setting some kind
> of symbol (TOYBOX_CSHADOW) that login can depend on the way unshare does
> now. We can do one probe for both crypt and shadow, I'm not sure making
> shadow configurable in 2012 buys us much. World readable /etc/passwd is
> obsolete.
>
> Probably also good to make the new --as-needed stanza be conditionally
> added to some sort of $AS_NEEDED evironment variable, and used through
> that on the compiler command line.  (I dunno what the compiler does on
> systems that haven't got -lcrypt, I thin even with --as-needed that's a
> build break if the library isn't found. I know glibc and uClibc can
> provide this, not sure about musl, who knows about macosx and I still
> haven't got a bionic test environment set up. So yeah, not in susv4 or
> implies a probe when it comes to headers.)
>

Attached is a patch which make login depend on probing crypt.h and 
shadow.h following the unshare example.  I turned these into two probes, 
just to keep things a bit more understandable, and i suspect that some 
future toys might depend on either shadow or crypt.

Regarding the --as-needed. I can update make.sh to contain something as 
  -Wl,--as-needed,${REQUIRED_LIBS},--no-as-needed but what would be a 
sensible way to populate the $REQUIRED_LIBS variable ? I think that a 
toy should actually be able to tell whether or not it requires linking 
with a certain library or not, but I don't know/think anything like that 
is already foreseen/in place ?

my 2 cents
E.

-- 
Elie De Brauwer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: login_probe.patch
Type: text/x-patch
Size: 2215 bytes
Desc: not available
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20120428/c774c02c/attachment-0007.bin>


More information about the Toybox mailing list