<div dir="ltr">The problem with using eaccess is that it doesn't build on Android as eaccess isn't implemented.<div><br></div><div>I vote for mapping useradd exit code 1 to TCONF. Sure there are some very unlikely cases where useradd might fail with 1 when the file system is writable. Excluding that corner case if it means being able to run on a lot of Android devices seems like a good compromise.</div><div><br></div><div>-Saravana</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 19, 2019 at 4:28 AM Petr Vorel <<a href="mailto:pvorel@suse.cz">pvorel@suse.cz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
> > > > > I still think v1 is the right approach. But if you want TCONF for only<br>
> > > > > for cases like Android where useradd itself isn't present, then v2 would<br>
> > > > > be the right patch.<br>
> > > > Agree with it, but waiting for Cyril approval to merge it.<br>
<br>
> > > As far as I can tell this patch still removes the read-only rootfs check<br>
> > > introduced in:<br>
> > Good catch, eaccess check should stay in.<br>
> > I'll put it back again and push, ok?<br>
<br>
> Or we can check the return value 1 from useradd and map it to TCONF as<br>
> suggested by Saravana.<br>
Probably. According to useradd sources, exit 1 (E_PW_UPDATE) also happen when<br>
problems to lock /etc/passwd, which could theoretically on different<br>
circumstance than read-only /, but I guess we can ignore it.<br>
<br>
Or we could use statvfs to detect read-only / ("can't update password file" does<br>
can be for different purposes), but I wouldn't bother and user return value 1.<br>
<br>
Kind regards,<br>
Petr<br>
<br>
[1] <a href="https://github.com/shadow-maint/shadow/blob/master/src/useradd.c#L1626" rel="noreferrer" target="_blank">https://github.com/shadow-maint/shadow/blob/master/src/useradd.c#L1626</a><br>
<br>
-- <br>
You received this message because you are subscribed to the Google Groups "kernel-team" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="mailto:kernel-team%2Bunsubscribe@android.com" target="_blank">kernel-team+unsubscribe@android.com</a>.<br>
<br>
</blockquote></div>