On Monday 08 November 2010 00:50:01 you wrote:
> On Monday 08 November 2010 00:42, Tito wrote:
> > > > I think I can demostrate it does:
> > > > 
> > > > /etc/passwd:prova:x:1004:1006:,,,:/home/prova:/bin/bash
> > > > /etc/passwd:prova2:x:1005:1006:,,,:/home/prova2:/bin/bash
> > > > /etc/group:prova:x:1006:
> > > 
> > > In order to check my theory, you should add (say, by hand)
> > > another line to /etc/group:
> > > 
> > > prova2:x:1234:
> > > 
> > > and _then_ run "deluser prova2".
> > > 
> > > 
> > > > Now let's remove user prova2:
> > > > 
> > > > deluser prova2
> > > > Removing user `prova2' ...
> > > > Warning: group `prova' has no more members.
> > > > Done.
> > > > 
> > > > And check:
> > > > 
> > > > /etc/passwd:prova:x:1004:1006:,,,:/home/prova:/bin/bash
> > > > /etc/group:prova:x:1006:
> > > > 
> > > > group was not removed as not matching username.
> > > 
> > > I think that group was not removed because another user
> > > (prova2) exists who has primary GID=<primary GID of prova2>.
> > > 
> > > Can you repeat the experiment, but with artificially added
> > > prova2 group, as described above?
> > 
> > 
> > Hi,
> > so here we go:
> > 
> > adduser prova
> > Adding user `prova' ...
> > Adding new group `prova' (1006) ...
> > Adding new user `prova' (1004) with group `prova' ...
> > adduser prova2 --ingroup prova
> > Adding user `prova2' ...
> > Adding new user `prova2' (1005) with group `prova' ...
> > echo "prova2:x:1234:" >> /etc/group
> > 
> > grep prova /etc/passwd /etc/group
> > /etc/passwd:prova:x:1004:1006:,,,:/home/prova:/bin/bash
> > /etc/passwd:prova2:x:1005:1006:,,,:/home/prova2:/bin/bash
> > /etc/group:prova:x:1006:
> > /etc/group:prova2:x:1234:
> > 
> > deluser prova2
> > Removing user `prova2' ...
> > Warning: group `prova' has no more members.
> > Done.
> > 
> > grep prova /etc/passwd /etc/group
> > /etc/passwd:prova:x:1004:1006:,,,:/home/prova:/bin/bash
> > /etc/group:prova:x:1006:
> > 
> > Looks to me it is removed by name
> 
> Ok, you are right about this.
> I am still puzzled why "Warning: group `prova' has no more members"
> message appears.
> 
> Can you do another experiment: as above, but delete user prova's
> record in /etc/passwd by hand:
> 
> adduser prova
> adduser prova2 --ingroup prova
> echo "prova2:x:1234:" >> /etc/group
> sed '/^prova:/d' -i /etc/passwd
> 
> grep prova /etc/passwd /etc/group
> 
> deluser prova2
> 
> grep prova /etc/passwd /etc/group
> 
> 

adduser prova
Adding user `prova' ...
Adding new group `prova' (1006) ...
Adding new user `prova' (1004) with group `prova' ...

adduser prova2 --ingroup prova
Adding user `prova2' ...
Adding new user `prova2' (1005) with group `prova' ...

debian:/home/tito/Desktop# nano /etc/passwd
debian:/home/tito/Desktop# nano /etc/shadow

/etc/passwd:prova2:x:1005:1006:,,,:/home/prova2:/bin/bash
/etc/group:prova:x:1006:

deluser prova2
Removing user `prova2' ...
Warning: group `prova' has no more members.
Done.

/etc/group:prova:x:1006:


Ciao,
Tito




_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to