openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/shadow/4.6-r0/shadow-4.6/src/groupmod.c
static void close_files(void)
{
    if (gr_close() == 0)
    {
        fprintf(stderr, _("%s: failure while writing changes to %s\n"), Prog,
                gr_dbname());
        exit(E_GRP_UPDATE);
    }
#ifdef WITH_AUDIT
    audit_logger(AUDIT_USER_ACCT, Prog, info_group.audit_msg, group_name,
                 AUDIT_NO_ID, SHADOW_AUDIT_SUCCESS);
#endif
    SYSLOG(
        (LOG_INFO, "group changed in %s (%s)", gr_dbname(), info_group.action));
    del_cleanup(cleanup_report_mod_group);

    cleanup_unlock_group(NULL);
    del_cleanup(cleanup_unlock_group);

#ifdef SHADOWGRP
    if (is_shadow_grp && (pflg || nflg))
    {
        if (sgr_close() == 0)
        {
            fprintf(stderr, _("%s: failure while writing changes to %s\n"),
                    Prog, sgr_dbname());
            exit(E_GRP_UPDATE);
        }
#ifdef WITH_AUDIT
        audit_logger(AUDIT_USER_ACCT, Prog, info_gshadow.audit_msg, group_name,
                     AUDIT_NO_ID, SHADOW_AUDIT_SUCCESS);
#endif
        SYSLOG((LOG_INFO, "group changed in %s (%s)", sgr_dbname(),
                info_gshadow.action));
        del_cleanup(cleanup_report_mod_gshadow);

        cleanup_unlock_gshadow(NULL);
        del_cleanup(cleanup_unlock_gshadow);
    }
#endif /* SHADOWGRP */

    if (gflg)
    {
        if (pw_close() == 0)
        {
            fprintf(stderr, _("%s: failure while writing changes to %s\n"),
                    Prog, pw_dbname());
            exit(E_GRP_UPDATE);
        }
#ifdef WITH_AUDIT
        audit_logger(AUDIT_USER_ACCT, Prog, info_passwd.audit_msg, group_name,
                     AUDIT_NO_ID, SHADOW_AUDIT_SUCCESS);
#endif
        SYSLOG((LOG_INFO, "group changed in %s (%s)", pw_dbname(),
                info_passwd.action));
        del_cleanup(cleanup_report_mod_passwd);

        cleanup_unlock_passwd(NULL);
        del_cleanup(cleanup_unlock_passwd);
    }

#ifdef WITH_AUDIT
    audit_logger(AUDIT_USER_ACCT, Prog, "modifying group", group_name,
                 AUDIT_NO_ID, SHADOW_AUDIT_SUCCESS);
#endif
}
/*
 * close_files - close all of the files that were opened
 *
 *	close_files() closes all of the files that were opened for this new
 *	group. This causes any modified entries to be written out.
 */
close all of the files that were opened
close_files() closes all of the files that were opened for this new
group. This causes any modified entries to be written out.
close all of the files that were opened close_files () closes all of the files that were opened for this new group . This causes any modified entries to be written out .
static void close_files(void)
{
    if (gr_close() == 0)
    {
        fprintf(stderr, _("%s: failure while writing changes to %s\n"), Prog,
                gr_dbname());
        exit(E_GRP_UPDATE);
    }
#ifdef WITH_AUDIT
    audit_logger(AUDIT_USER_ACCT, Prog, info_group.audit_msg, group_name,
                 AUDIT_NO_ID, SHADOW_AUDIT_SUCCESS);
#endif
    SYSLOG(
        (LOG_INFO, "group changed in %s (%s)", gr_dbname(), info_group.action));
    del_cleanup(cleanup_report_mod_group);
    cleanup_unlock_group(NULL);
    del_cleanup(cleanup_unlock_group);
#ifdef SHADOWGRP
    if (is_shadow_grp && (pflg || nflg))
    {
        if (sgr_close() == 0)
        {
            fprintf(stderr, _("%s: failure while writing changes to %s\n"),
                    Prog, sgr_dbname());
            exit(E_GRP_UPDATE);
        }
#ifdef WITH_AUDIT
        audit_logger(AUDIT_USER_ACCT, Prog, info_gshadow.audit_msg, group_name,
                     AUDIT_NO_ID, SHADOW_AUDIT_SUCCESS);
#endif
        SYSLOG((LOG_INFO, "group changed in %s (%s)", sgr_dbname(),
                info_gshadow.action));
        del_cleanup(cleanup_report_mod_gshadow);
        cleanup_unlock_gshadow(NULL);
        del_cleanup(cleanup_unlock_gshadow);
    }
#endif 
    if (gflg)
    {
        if (pw_close() == 0)
        {
            fprintf(stderr, _("%s: failure while writing changes to %s\n"),
                    Prog, pw_dbname());
            exit(E_GRP_UPDATE);
        }
#ifdef WITH_AUDIT
        audit_logger(AUDIT_USER_ACCT, Prog, info_passwd.audit_msg, group_name,
                     AUDIT_NO_ID, SHADOW_AUDIT_SUCCESS);
#endif
        SYSLOG((LOG_INFO, "group changed in %s (%s)", pw_dbname(),
                info_passwd.action));
        del_cleanup(cleanup_report_mod_passwd);
        cleanup_unlock_passwd(NULL);
        del_cleanup(cleanup_unlock_passwd);
    }
#ifdef WITH_AUDIT
    audit_logger(AUDIT_USER_ACCT, Prog, "modifying group", group_name,
                 AUDIT_NO_ID, SHADOW_AUDIT_SUCCESS);
#endif
}
static void close_files ( void ) { if ( gr_close ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , gr_dbname ( ) ) ; exit ( E_GRP_UPDATE ) ; } #ifdef WITH_AUDIT audit_logger ( AUDIT_USER_ACCT , Prog , info_group . audit_msg , group_name , AUDIT_NO_ID , SHADOW_AUDIT_SUCCESS ) ; #endif SYSLOG ( ( LOG_INFO , " " , gr_dbname ( ) , info_group . action ) ) ; del_cleanup ( cleanup_report_mod_group ) ; cleanup_unlock_group ( NULL ) ; del_cleanup ( cleanup_unlock_group ) ; #ifdef SHADOWGRP if ( is_shadow_grp && ( pflg || nflg ) ) { if ( sgr_close ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , sgr_dbname ( ) ) ; exit ( E_GRP_UPDATE ) ; } #ifdef WITH_AUDIT audit_logger ( AUDIT_USER_ACCT , Prog , info_gshadow . audit_msg , group_name , AUDIT_NO_ID , SHADOW_AUDIT_SUCCESS ) ; #endif SYSLOG ( ( LOG_INFO , " " , sgr_dbname ( ) , info_gshadow . action ) ) ; del_cleanup ( cleanup_report_mod_gshadow ) ; cleanup_unlock_gshadow ( NULL ) ; del_cleanup ( cleanup_unlock_gshadow ) ; } #endif if ( gflg ) { if ( pw_close ( ) == 0 ) { fprintf ( stderr , _ ( " \n " ) , Prog , pw_dbname ( ) ) ; exit ( E_GRP_UPDATE ) ; } #ifdef WITH_AUDIT audit_logger ( AUDIT_USER_ACCT , Prog , info_passwd . audit_msg , group_name , AUDIT_NO_ID , SHADOW_AUDIT_SUCCESS ) ; #endif SYSLOG ( ( LOG_INFO , " " , pw_dbname ( ) , info_passwd . action ) ) ; del_cleanup ( cleanup_report_mod_passwd ) ; cleanup_unlock_passwd ( NULL ) ; del_cleanup ( cleanup_unlock_passwd ) ; } #ifdef WITH_AUDIT audit_logger ( AUDIT_USER_ACCT , Prog , " " , group_name , AUDIT_NO_ID , SHADOW_AUDIT_SUCCESS ) ; #endif }
close_files - close all of the files that were opened
      close_files() closes all of the files that were opened for this new
      group.
close_files - close all of the files that were opened close_files () closes all of the files that were opened for this new group .
/* SHADOWGRP */