On Wed, 27 Dec 2006 22:35:07 -0700, Darren Spruell wrote:

> These invocations work here (OpenBSD 4.0-current):
> 
> $ sudo adduser -batch test1 staff,wheel 'Test User 1' \
> '$2a$06$kaLk/lPsfDpSibjO4frBf.WyoWOGY98illmMOL/bo6QsPTBmovsoC'
> 
> (password crypt generated using 'encrypt -b 6').
> 
> $ sudo adduser -unencrypted -batch test2 staff,wheel 'Test User 2' 'test2'
> 
> Correct password settings verified using security/john.

Thanks, Darren,

but these work here just as well. The crux is the group. Like in that
example, 

> Create user ``falken'' and login group ``falken''.  Invite user
> ``falken'' into groups ``guest'', ``staff'', and ``beer''.  Realname
> (fullname) is ``Prof. Falken''.  Password is ``joshua'' [...]
> # adduser -batch falken guest,staff,beer 'Prof. Falken' joshua

you put your test1 into an existing group; in your case staff,wheel; in
the example guest,staff,beer. It does work here, if I put nobody. But I
don't want nobody; since after some hundred it will complain of being too
long, and I did the whole thing ('nobody') originally only, to get it
working. In your case, I'd like
> $ sudo adduser -batch test1 test1 'Test User 1' \
> '$2a$06$kaLk/lPsfDpSibjO4frBf.WyoWOGY98illmMOL/bo6QsPTBmovsoC'
, if you understand what I mean. That is: test1 into its own group and
only into its own group. And I read man adduser surely 30 times up and
down; this is why I tried all those -group veriations, of which none
worked here (see original thread).

I take the example for more clarity:
adduser -batch falken nobody 'Prof. Falken' joshua
(is okay, like in man adduser)
adduser -batch falken falken 'Prof. Falken' joshua
Group ``falken'' does not exist
adduser -batch falken -group falken 'Prof. Falken' joshua
Group ``-group'' does not exist
adduser -batch falken -group USER 'Prof. Falken' joshua
Group ``-group'' does not exist

I hope, this points out what I want with more clarity.

Remarkable to me is, that the first, working version, does this:
# cat /etc/group | grep falken                                                 
falken:*:1002:
nobody:*:32767:falken
That means the single lines creates the group falken and puts falken in
nobody. So the group is being created as stated in the man page.
*And* falken is allocated to that group (/etc/passwd:)
falken:*:1002:1002:Prof. Falken:/home/falken:/bin/ksh
So this is exactly what I want. But when I remove the *extra* group, it
fails miserably:
# adduser -batch falken 'Prof. Falken' joshua             
Group ``Prof.'' does not exist
Group ``Falken'' does not exist
This, again, shows that it waits for a group. Group falken should do
(adduser -batch falken falken 'Prof. Falken' joshua), but obviously the
group is created too late to be considered.
Plus, it seems to *need* an extra group, which, when entered, will
overflow the maximal length of a fixed group.

To me all this either lacks logic or I need a serious hint on where
my logic is flawed.

Uwe

Reply via email to