diff --git a/ChangeLog b/ChangeLog index d63ebd8f..9ab298b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-11-17 Nicolas François + + * src/userdel.c, src/usermod.c, src/useradd.c: Inform the user if + out of memory while updating a group database. + 2007-11-17 Nicolas François * NEWS, src/usermod.c: Update the group database before flushing diff --git a/src/useradd.c b/src/useradd.c index 77f30dd3..882ce431 100644 --- a/src/useradd.c +++ b/src/useradd.c @@ -727,6 +727,9 @@ static void grp_update (void) */ ngrp = __gr_dup (grp); if (!ngrp) { + fprintf (stderr, + _("%s: Out of memory. Cannot update the group database.\n"), + Prog); fail_exit (E_GRP_UPDATE); /* XXX */ } @@ -775,6 +778,9 @@ static void grp_update (void) */ nsgrp = __sgr_dup (sgrp); if (!nsgrp) { + fprintf (stderr, + _("%s: Out of memory. Cannot update the shadow group database.\n"), + Prog); fail_exit (E_GRP_UPDATE); /* XXX */ } diff --git a/src/userdel.c b/src/userdel.c index f0766cfd..d357c74f 100644 --- a/src/userdel.c +++ b/src/userdel.c @@ -150,6 +150,9 @@ static void update_groups (void) */ ngrp = __gr_dup (grp); if (!ngrp) { + fprintf (stderr, + _("%s: Out of memory. Cannot update the group database.\n"), + Prog); exit (13); /* XXX */ } ngrp->gr_mem = del_list (ngrp->gr_mem, user_name); @@ -245,6 +248,9 @@ static void update_groups (void) nsgrp = __sgr_dup (sgrp); if (!nsgrp) { + fprintf (stderr, + _("%s: Out of memory. Cannot update the shadow group database.\n"), + Prog); exit (13); /* XXX */ } diff --git a/src/usermod.c b/src/usermod.c index c67ad599..6d14fe30 100644 --- a/src/usermod.c +++ b/src/usermod.c @@ -574,7 +574,7 @@ static int update_group (void) ngrp = __gr_dup (grp); if (!ngrp) { fprintf (stderr, - _("%s: out of memory in update_group\n"), + _("%s: Out of memory. Cannot update the group database.\n"), Prog); gr_unlock (); return -1; @@ -696,8 +696,7 @@ static int update_gshadow (void) nsgrp = __sgr_dup (sgrp); if (!nsgrp) { fprintf (stderr, - _ - ("%s: out of memory in update_gshadow\n"), + _("%s: Out of memory. Cannot update the shadow group database.\n"), Prog); sgr_unlock (); return -1;