* src/groupdel.c: Harmonize error & syslog messages.
This commit is contained in:
parent
bc8456425d
commit
9ddc88dd9d
@ -3,6 +3,7 @@
|
|||||||
* src/groupadd.c: Harmonize error & syslog messages.
|
* src/groupadd.c: Harmonize error & syslog messages.
|
||||||
* src/groupadd.c: Add logging to syslog in some error cases.
|
* src/groupadd.c: Add logging to syslog in some error cases.
|
||||||
* src/groupmod.c: Harmonize error & syslog messages.
|
* src/groupmod.c: Harmonize error & syslog messages.
|
||||||
|
* src/groupdel.c: Harmonize error & syslog messages.
|
||||||
|
|
||||||
2008-08-01 Nicolas François <nicolas.francois@centraliens.net>
|
2008-08-01 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ static void fail_exit (int code)
|
|||||||
static void grp_update (void)
|
static void grp_update (void)
|
||||||
{
|
{
|
||||||
if (gr_remove (group_name) == 0) {
|
if (gr_remove (group_name) == 0) {
|
||||||
fprintf (stderr, _("%s: error removing group entry\n"), Prog);
|
fprintf (stderr, _("%s: cannot remove group '%s' from the group database\n"), Prog, group_name);
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
@ -126,8 +126,8 @@ static void grp_update (void)
|
|||||||
if (is_shadow_grp && (sgr_locate (group_name) != NULL)) {
|
if (is_shadow_grp && (sgr_locate (group_name) != NULL)) {
|
||||||
if (sgr_remove (group_name) == 0) {
|
if (sgr_remove (group_name) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: error removing shadow group entry\n"),
|
_("%s: cannot remove group '%s' from the shadow group database\n"),
|
||||||
Prog);
|
Prog, group_name);
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -151,14 +151,14 @@ static void close_files (void)
|
|||||||
SYSLOG ((LOG_INFO, "remove group '%s'\n", group_name));
|
SYSLOG ((LOG_INFO, "remove group '%s'\n", group_name));
|
||||||
|
|
||||||
if (gr_close () == 0) {
|
if (gr_close () == 0) {
|
||||||
fprintf (stderr, _("%s: cannot rewrite group file\n"), Prog);
|
fprintf (stderr, _("%s: cannot rewrite the group file\n"), Prog);
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
gr_unlock ();
|
gr_unlock ();
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp && (sgr_close () == 0)) {
|
if (is_shadow_grp && (sgr_close () == 0)) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: cannot rewrite shadow group file\n"), Prog);
|
_("%s: cannot rewrite the shadow group file\n"), Prog);
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
if (is_shadow_grp)
|
if (is_shadow_grp)
|
||||||
@ -174,22 +174,22 @@ static void close_files (void)
|
|||||||
static void open_files (void)
|
static void open_files (void)
|
||||||
{
|
{
|
||||||
if (gr_lock () == 0) {
|
if (gr_lock () == 0) {
|
||||||
fprintf (stderr, _("%s: unable to lock group file\n"), Prog);
|
fprintf (stderr, _("%s: cannot lock the group file\n"), Prog);
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
if (gr_open (O_RDWR) == 0) {
|
if (gr_open (O_RDWR) == 0) {
|
||||||
fprintf (stderr, _("%s: unable to open group file\n"), Prog);
|
fprintf (stderr, _("%s: cannot open the group file\n"), Prog);
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
if (is_shadow_grp && (sgr_lock () == 0)) {
|
if (is_shadow_grp && (sgr_lock () == 0)) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: unable to lock shadow group file\n"), Prog);
|
_("%s: cannot lock the shadow group file\n"), Prog);
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
if (is_shadow_grp && (sgr_open (O_RDWR) == 0)) {
|
if (is_shadow_grp && (sgr_open (O_RDWR) == 0)) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: unable to open shadow group file\n"), Prog);
|
_("%s: cannot open the shadow group file\n"), Prog);
|
||||||
fail_exit (E_GRP_UPDATE);
|
fail_exit (E_GRP_UPDATE);
|
||||||
}
|
}
|
||||||
#endif /* SHADOWGRP */
|
#endif /* SHADOWGRP */
|
||||||
@ -226,7 +226,7 @@ static void group_busy (gid_t gid)
|
|||||||
/*
|
/*
|
||||||
* Can't remove the group.
|
* Can't remove the group.
|
||||||
*/
|
*/
|
||||||
fprintf (stderr, _("%s: cannot remove user's primary group.\n"), Prog);
|
fprintf (stderr, _("%s: cannot remove the primary group of user '%s'\n"), Prog, pwd->pw_name);
|
||||||
fail_exit (E_GROUP_BUSY);
|
fail_exit (E_GROUP_BUSY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ int main (int argc, char **argv)
|
|||||||
char *nis_domain;
|
char *nis_domain;
|
||||||
char *nis_master;
|
char *nis_master;
|
||||||
|
|
||||||
fprintf (stderr, _("%s: group %s is a NIS group\n"),
|
fprintf (stderr, _("%s: group '%s' is a NIS group\n"),
|
||||||
Prog, group_name);
|
Prog, group_name);
|
||||||
|
|
||||||
#ifdef WITH_AUDIT
|
#ifdef WITH_AUDIT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user