* libmisc/audit_help.c: Added audit_logger_message() to log
messages not related to an account. * lib/prototypes.h, libmisc/cleanup.c, libmisc/cleanup_group.c, libmisc/cleanup_user.c, libmisc/Makefile.am: Added stack of cleanup functions to be executed on exit. * NEWS, src/groupadd.c, src/groupdel.c, src/groupmod.c: Only report success to audit and syslog when the changes are committed to the system. Do not log failure for on-memory changes to audit or syslog. Make sure failures and inconsistencies will be reported in case of unexpected failures (e.g. malloc failures). Only specify an audit message if it is not implicitly implied by the type argument. Removed fail_exit (replaced by atexit(do_cleanups)).
This commit is contained in:
@ -78,6 +78,37 @@ extern int chown_tree (const char *, uid_t, uid_t, gid_t, gid_t);
|
||||
/* chowntty.c */
|
||||
extern void chown_tty (const struct passwd *);
|
||||
|
||||
/* cleanup.c */
|
||||
typedef void (*cleanup_function) (void *arg);
|
||||
void add_cleanup (cleanup_function pcf, void *arg);
|
||||
void del_cleanup (cleanup_function pcf);
|
||||
void do_cleanups (void);
|
||||
|
||||
/* cleanup_group.c */
|
||||
struct cleanup_info_mod {
|
||||
char *audit_msg;
|
||||
char *action;
|
||||
char *name;
|
||||
};
|
||||
void cleanup_report_add_group (void *group_name);
|
||||
void cleanup_report_add_group_group (void *group_name);
|
||||
#ifdef SHADOWGRP
|
||||
void cleanup_report_add_group_gshadow (void *group_name);
|
||||
#endif
|
||||
void cleanup_report_del_group (void *group_name);
|
||||
void cleanup_report_del_group_group (void *group_name);
|
||||
#ifdef SHADOWGRP
|
||||
void cleanup_report_del_group_gshadow (void *group_name);
|
||||
#endif
|
||||
void cleanup_report_mod_passwd (void *cleanup_info);
|
||||
void cleanup_report_mod_group (void *cleanup_info);
|
||||
void cleanup_report_mod_gshadow (void *cleanup_info);
|
||||
void cleanup_unlock_group (void *unused);
|
||||
#ifdef SHADOWGRP
|
||||
void cleanup_unlock_gshadow (void *unused);
|
||||
#endif
|
||||
void cleanup_unlock_passwd (void *unused);
|
||||
|
||||
/* console.c */
|
||||
extern bool console (const char *);
|
||||
|
||||
@ -144,6 +175,7 @@ typedef enum {
|
||||
extern void audit_logger (int type, const char *pgname, const char *op,
|
||||
const char *name, unsigned int id,
|
||||
shadow_audit_result result);
|
||||
void audit_logger_message (const char *message, shadow_audit_result result);
|
||||
#endif
|
||||
|
||||
/* limits.c */
|
||||
|
Reference in New Issue
Block a user