fprintf (log_get_logfd(),
_("Unable to change owner or mode of tty stdin: %s"),
strerror (err));
- SYSLOG ((LOG_WARN,
- "unable to change owner or mode of tty stdin for user `%s': %s\n",
- info->pw_name, strerror (err)));
+ SYSLOG(LOG_WARN,
+ "unable to change owner or mode of tty stdin for user `%s': %s\n",
+ info->pw_name, strerror(err));
if (EROFS != err) {
closelog ();
exit (EXIT_FAILURE);
{
const char *name = group_name;
- SYSLOG ((LOG_ERR, "failed to add group %s", name));
+ SYSLOG(LOG_ERR, "failed to add group %s", name);
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_GROUP,
"",
{
const char *name = group_name;
- SYSLOG ((LOG_ERR, "failed to remove group %s", name));
+ SYSLOG(LOG_ERR, "failed to remove group %s", name);
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_GROUP,
"",
const struct cleanup_info_mod *info;
info = (const struct cleanup_info_mod *)cleanup_info;
- SYSLOG ((LOG_ERR,
- "failed to change %s (%s)",
- gr_dbname (),
- info->action));
+ SYSLOG(LOG_ERR, "failed to change %s (%s)", gr_dbname(), info->action);
#ifdef WITH_AUDIT
audit_logger (AUDIT_GRP_MGMT,
info->audit_msg,
const struct cleanup_info_mod *info;
info = (const struct cleanup_info_mod *)cleanup_info;
- SYSLOG ((LOG_ERR,
- "failed to change %s (%s)",
- sgr_dbname (),
- info->action));
+ SYSLOG(LOG_ERR, "failed to change %s (%s)", sgr_dbname(), info->action);
#ifdef WITH_AUDIT
audit_logger (AUDIT_GRP_MGMT,
info->audit_msg,
{
const char *name = group_name;
- SYSLOG ((LOG_ERR, "failed to add group %s to %s", name, gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to add group %s to %s", name, gr_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_GROUP,
"adding-group",
{
const char *name = group_name;
- SYSLOG ((LOG_ERR, "failed to add group %s to %s", name, sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to add group %s to %s", name, sgr_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_GRP_MGMT,
"adding-shadow-group",
{
const char *name = group_name;
- SYSLOG ((LOG_ERR,
- "failed to remove group %s from %s",
- name, gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to remove group %s from %s", name, gr_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_GROUP,
"removing-group",
{
const char *name = group_name;
- SYSLOG ((LOG_ERR,
- "failed to remove group %s from %s",
- name, sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to remove group %s from %s", name, sgr_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_GRP_MGMT,
"removing-shadow-group",
fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"),
log_get_progname(), gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
#ifdef WITH_AUDIT
audit_logger_message ("unlocking-group",
SHADOW_AUDIT_FAILURE);
fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"),
log_get_progname(), sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
#ifdef WITH_AUDIT
audit_logger_message ("unlocking-gshadow",
SHADOW_AUDIT_FAILURE);
{
const char *name = user_name;
- SYSLOG ((LOG_ERR, "failed to add user %s", name));
+ SYSLOG(LOG_ERR, "failed to add user %s", name);
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER,
"",
const struct cleanup_info_mod *info;
info = (const struct cleanup_info_mod *)cleanup_info;
- SYSLOG ((LOG_ERR,
- "failed to change %s (%s)",
- pw_dbname (),
- info->action));
+ SYSLOG(LOG_ERR, "failed to change %s (%s)", pw_dbname(), info->action);
#ifdef WITH_AUDIT
audit_logger (AUDIT_USER_MGMT,
info->audit_msg,
{
const char *name = user_name;
- SYSLOG ((LOG_ERR, "failed to add user %s to %s", name, pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to add user %s to %s", name, pw_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER,
"adding-user",
{
const char *name = user_name;
- SYSLOG ((LOG_ERR, "failed to add user %s to %s", name, spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to add user %s to %s", name, spw_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_USER_MGMT,
"adding-shadow-user",
fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"),
log_get_progname(), pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
#ifdef WITH_AUDIT
audit_logger_message ("unlocking-passwd",
SHADOW_AUDIT_FAILURE);
fprintf (log_get_logfd(),
_("%s: failed to unlock %s\n"),
log_get_progname(), spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
#ifdef WITH_AUDIT
audit_logger_message ("unlocking-shadow",
SHADOW_AUDIT_FAILURE);
#endif
/* cleaner than lots of #ifdefs everywhere - use this as follows:
- SYSLOG((LOG_CRIT, "user %s cracked root", user)); */
+ SYSLOG(LOG_CRIT, "user %s cracked root", user); */
#ifdef ENABLE_NLS
/* Temporarily set LC_TIME to "C" to avoid strange dates in syslog.
This is a workaround for a more general syslog(d) design problem -
UDP) socket. -MM */
/* Avoid translated PAM error messages: set LC_ALL to "C".
* --Nekral */
-#define SYSLOG(x) \
+#define SYSLOG(...) \
do { \
char *old_locale = setlocale (LC_ALL, NULL); \
char *saved_locale = NULL; \
if (NULL != saved_locale) { \
(void) setlocale (LC_ALL, "C"); \
} \
- syslog x ; \
+ syslog(__VA_ARGS__); \
if (NULL != saved_locale) { \
(void) setlocale (LC_ALL, saved_locale); \
free (saved_locale); \
} \
} while (false)
#else /* !ENABLE_NLS */
-#define SYSLOG(x) syslog x
+#define SYSLOG(...) syslog(__VA_ARGS__)
#endif /* !ENABLE_NLS */
/* The default syslog settings can now be changed here,
fd = open (FAILLOG_FILE, O_RDWR);
if (fd < 0) {
- SYSLOG ((LOG_WARN,
- "Can't write faillog entry for UID %lu in %s: %m",
- (unsigned long) uid, FAILLOG_FILE));
+ SYSLOG(LOG_WARN,
+ "Can't write faillog entry for UID %lu in %s: %m",
+ (unsigned long) uid, FAILLOG_FILE);
return;
}
errno = saved_errno;
}
err_close:
- SYSLOG ((LOG_WARN,
- "Can't write faillog entry for UID %lu to %s: %m",
- (unsigned long) uid, FAILLOG_FILE));
+ SYSLOG(LOG_WARN,
+ "Can't write faillog entry for UID %lu to %s: %m",
+ (unsigned long) uid, FAILLOG_FILE);
}
static bool too_many_failures (const struct faillog *fl)
fd = open (FAILLOG_FILE, failed?O_RDONLY:O_RDWR);
if (fd < 0) {
- SYSLOG ((LOG_WARN,
- "Can't open the faillog file (%s) to check UID %lu: %m; "
- "User access authorized.",
- FAILLOG_FILE, (unsigned long) uid));
+ SYSLOG(LOG_WARN,
+ "Can't open the faillog file (%s) to check UID %lu: %m; "
+ "User access authorized.",
+ FAILLOG_FILE, (unsigned long) uid);
return 1;
}
errno = saved_errno;
}
err_close:
- SYSLOG ((LOG_WARN,
- "Can't reset faillog entry for UID %lu in %s: %m",
- (unsigned long) uid, FAILLOG_FILE));
+ SYSLOG(LOG_WARN,
+ "Can't reset faillog entry for UID %lu in %s: %m",
+ (unsigned long) uid, FAILLOG_FILE);
return 1;
}
_("%s: Can't get unique system GID (%s). "
"Suppressing additional messages.\n"),
log_get_progname(), strerror (result));
- SYSLOG ((LOG_ERR,
+ SYSLOG(LOG_ERR,
"Error checking available GIDs: %s",
- strerror (result)));
+ strerror(result));
nospam = 1;
}
/*
_("%s: Can't get unique system GID (%s). "
"Suppressing additional messages.\n"),
log_get_progname(), strerror (result));
- SYSLOG ((LOG_ERR,
+ SYSLOG(LOG_ERR,
"Error checking available GIDs: %s",
- strerror (result)));
+ strerror(result));
nospam = 1;
}
/*
_("%s: Can't get unique GID (%s). "
"Suppressing additional messages.\n"),
log_get_progname(), strerror (result));
- SYSLOG ((LOG_ERR,
+ SYSLOG(LOG_ERR,
"Error checking available GIDs: %s",
- strerror (result)));
+ strerror(result));
nospam = 1;
}
/*
_("%s: Can't get unique GID (%s). "
"Suppressing additional messages.\n"),
log_get_progname(), strerror (result));
- SYSLOG ((LOG_ERR,
+ SYSLOG(LOG_ERR,
"Error checking available GIDs: %s",
- strerror (result)));
+ strerror(result));
nospam = 1;
}
/*
fprintf (log_get_logfd(),
_("%s: Can't get unique GID (no more available GIDs)\n"),
log_get_progname());
- SYSLOG ((LOG_WARN, "no more available GIDs on the system"));
+ SYSLOG(LOG_WARN, "no more available GIDs on the system");
free (used_gids);
return -1;
}
fprintf (log_get_logfd(),
_("%s: Can't get unique subordinate GID range\n"),
log_get_progname());
- SYSLOG ((LOG_WARN, "no more available subordinate GIDs on the system"));
+ SYSLOG(LOG_WARN, "no more available subordinate GIDs on the system");
return -1;
}
*range_start = start;
fprintf (log_get_logfd(),
_("%s: Can't get unique subordinate UID range\n"),
log_get_progname());
- SYSLOG ((LOG_WARN, "no more available subordinate UIDs on the system"));
+ SYSLOG(LOG_WARN, "no more available subordinate UIDs on the system");
return -1;
}
*range_start = start;
_("%s: Can't get unique system UID (%s). "
"Suppressing additional messages.\n"),
log_get_progname(), strerror (result));
- SYSLOG ((LOG_ERR,
+ SYSLOG(LOG_ERR,
"Error checking available UIDs: %s",
- strerror (result)));
+ strerror(result));
nospam = 1;
}
/*
_("%s: Can't get unique system UID (%s). "
"Suppressing additional messages.\n"),
log_get_progname(), strerror (result));
- SYSLOG((LOG_ERR,
+ SYSLOG(LOG_ERR,
"Error checking available UIDs: %s",
- strerror (result)));
+ strerror(result));
nospam = 1;
}
/*
_("%s: Can't get unique UID (%s). "
"Suppressing additional messages.\n"),
log_get_progname(), strerror (result));
- SYSLOG ((LOG_ERR,
+ SYSLOG(LOG_ERR,
"Error checking available UIDs: %s",
- strerror (result)));
+ strerror(result));
nospam = 1;
}
/*
_("%s: Can't get unique UID (%s). "
"Suppressing additional messages.\n"),
log_get_progname(), strerror (result));
- SYSLOG ((LOG_ERR,
+ SYSLOG(LOG_ERR,
"Error checking available UIDs: %s",
- strerror (result)));
+ strerror(result));
nospam = 1;
}
/*
fprintf (log_get_logfd(),
_("%s: Can't get unique UID (no more available UIDs)\n"),
log_get_progname());
- SYSLOG ((LOG_WARN, "no more available UIDs on the system"));
+ SYSLOG(LOG_WARN, "no more available UIDs on the system");
free (used_uids);
return -1;
}
if (NULL == cp) {
(void) fputs (_("Could not allocate space for config info.\n"),
log_get_logfd());
- SYSLOG ((LOG_ERR, "could not allocate space for config info"));
+ SYSLOG(LOG_ERR, "could not allocate space for config info");
return -1;
}
_("configuration error - unknown item '%s' (notify administrator)\n"),
name);
if (srcfile != NULL)
- SYSLOG ((LOG_CRIT, "shadow: unknown configuration item '%s' in '%s'", name, srcfile));
+ SYSLOG(LOG_CRIT, "shadow: unknown configuration item '%s' in '%s'", name, srcfile);
out:
return NULL;
if (error == ECONF_NOFILE)
return;
- SYSLOG ((LOG_CRIT, "cannot open login definitions [%s]",
- econf_errString(error)));
+ SYSLOG(LOG_CRIT, "cannot open login definitions [%s]",
+ econf_errString(error));
exit (EXIT_FAILURE);
}
if ((error = econf_getKeys(defs_file, NULL, &key_number, &keys))) {
- SYSLOG ((LOG_CRIT, "cannot read login definitions [%s]",
- econf_errString(error)));
+ SYSLOG(LOG_CRIT, "cannot read login definitions [%s]",
+ econf_errString(error));
exit (EXIT_FAILURE);
}
error = econf_getStringValue(defs_file, NULL, keys[i], &value);
if (error) {
- SYSLOG ((LOG_CRIT, "failed reading key %zu from econf [%s]",
- i, econf_errString(error)));
+ SYSLOG(LOG_CRIT, "failed reading key %zu from econf [%s]",
+ i, econf_errString(error));
exit (EXIT_FAILURE);
}
return;
int err = errno;
- SYSLOG ((LOG_CRIT, "cannot open login definitions %s [%s]",
- def_fname, strerror (err)));
+ SYSLOG(LOG_CRIT, "cannot open login definitions %s [%s]",
+ def_fname, strerror(err));
exit (EXIT_FAILURE);
}
if (ferror (fp) != 0) {
int err = errno;
- SYSLOG ((LOG_CRIT, "cannot read login definitions %s [%s]",
- def_fname, strerror (err)));
+ SYSLOG(LOG_CRIT, "cannot read login definitions %s [%s]",
+ def_fname, strerror(err));
exit (EXIT_FAILURE);
}
if (str2ul(&limit, maxlogins) == -1) {
if (errno == ERANGE) {
- SYSLOG((LOG_WARN, "Invalid maxlogins value\n"));
+ SYSLOG(LOG_WARN, "Invalid maxlogins value\n");
return LOGIN_ERROR_LOGIN;
}
return 0;
}
if (0 == limit) { /* maximum 0 logins ? */
- SYSLOG ((LOG_WARN, "No logins allowed for `%s'\n", name));
+ SYSLOG(LOG_WARN, "No logins allowed for `%s'\n", name);
return LOGIN_ERROR_LOGIN;
}
count = active_sessions_count(name, limit);
if (count > limit) {
- SYSLOG ((LOG_WARN,
- "Too many logins (max %lu) for %s\n",
- limit, name));
+ SYSLOG(LOG_WARN, "Too many logins (max %lu) for %s\n", limit, name);
return LOGIN_ERROR_LOGIN;
}
return 0;
* is still processed
*/
if (!reported) {
- SYSLOG ((LOG_WARN,
- "Invalid limit string: '%s'",
- pp-1));
+ SYSLOG(LOG_WARN, "Invalid limit string: '%s'", pp-1);
reported = true;
retval |= LOGIN_ERROR_RLIMIT;
}
* one needs to add some mess for getgrnam_r. */
groupdata = getgrnam (gname);
if (NULL == groupdata) {
- SYSLOG ((LOG_WARN, "Nonexisting group `%s' in limits file.",
- gname));
+ SYSLOG(LOG_WARN, "Nonexisting group `%s' in limits file.", gname);
return false;
}
}
/* Failed to parse or failed to nice() */
- SYSLOG ((LOG_WARN,
- "Can't set the nice value for user %s",
- info->pw_name));
+ SYSLOG(LOG_WARN,
+ "Can't set the nice value for user %s",
+ info->pw_name);
continue;
}
if ( (str2si(&blocks, val) == -1)
|| (set_filesize_limit (blocks) != 0)) {
- SYSLOG ((LOG_WARN,
- "Can't set the ulimit for user %s",
- info->pw_name));
+ SYSLOG(LOG_WARN,
+ "Can't set the ulimit for user %s",
+ info->pw_name);
}
continue;
}
mode_t mask;
if (str2i(mode_t, &mask, val) == -1) {
- SYSLOG ((LOG_WARN,
- "Can't set umask value for user %s",
- info->pw_name));
+ SYSLOG(LOG_WARN,
+ "Can't set umask value for user %s",
+ info->pw_name);
} else {
(void) umask (mask);
}
offset = (off_t) pw->pw_uid * sizeof(newlog);
if (lseek (fd, offset, SEEK_SET) != offset) {
- SYSLOG ((LOG_WARN,
- "Can't read last lastlog entry for UID %lu in %s. Entry not updated.",
- (unsigned long) pw->pw_uid, _PATH_LASTLOG));
+ SYSLOG(LOG_WARN,
+ "Can't read last lastlog entry for UID %lu in %s. Entry not updated.",
+ (unsigned long) pw->pw_uid, _PATH_LASTLOG);
(void) close (fd);
return;
}
errno = saved_errno;
}
err_close:
- SYSLOG ((LOG_WARN,
- "Can't write lastlog entry for UID %lu in %s: %m",
- (unsigned long) pw->pw_uid, _PATH_LASTLOG));
+ SYSLOG(LOG_WARN,
+ "Can't write lastlog entry for UID %lu in %s: %m",
+ (unsigned long) pw->pw_uid, _PATH_LASTLOG);
}
passwd = sp->sp_pwdp;
}
if (pw_auth(passwd, user) != 0) {
- SYSLOG ((LOG_WARN, "incorrect password for `%s'", user));
+ SYSLOG(LOG_WARN, "incorrect password for `%s'", user);
(void) sleep (1);
fprintf (log_get_logfd(), _("Incorrect password for %s.\n"), user);
exit (EXIT_FAILURE);
(void) fputs (_("Cannot open audit interface.\n"),
log_get_logfd());
- SYSLOG ((LOG_WARN, "Cannot open audit interface."));
+ SYSLOG(LOG_WARN, "Cannot open audit interface.");
}
}
}
}
#endif
- SYSLOG ((LOG_WARN, "libselinux: %s", buf));
+ SYSLOG(LOG_WARN, "libselinux: %s", buf);
skip_syslog:
free (buf);
fprintf (log_get_logfd(),
_("%s: can not get previous SELinux process context: %s\n"),
log_get_progname(), strerrno());
- SYSLOG ((LOG_WARN,
- "can not get previous SELinux process context: %s",
- strerrno()));
+ SYSLOG(LOG_WARN,
+ "can not get previous SELinux process context: %s",
+ strerrno());
return (security_getenforce () != 0);
}
if (setgid (info->pw_gid) == -1) {
int err = errno;
perror ("setgid");
- SYSLOG ((LOG_ERR, "bad group ID `%d' for user `%s': %s\n",
- info->pw_gid, info->pw_name, strerror (err)));
+ SYSLOG(LOG_ERR, "bad group ID `%d' for user `%s': %s\n",
+ info->pw_gid, info->pw_name, strerror(err));
closelog ();
return -1;
}
if (initgroups (info->pw_name, info->pw_gid) == -1) {
int err = errno;
perror ("initgroups");
- SYSLOG ((LOG_ERR, "initgroups failed for user `%s': %s\n",
- info->pw_name, strerror (err)));
+ SYSLOG(LOG_ERR, "initgroups failed for user `%s': %s\n",
+ info->pw_name, strerror(err));
closelog ();
return -1;
}
if (setuid (info->pw_uid) != 0) {
int err = errno;
perror ("setuid");
- SYSLOG ((LOG_ERR, "bad user ID `%d' for user `%s': %s\n",
- (int) info->pw_uid, info->pw_name, strerror (err)));
+ SYSLOG(LOG_ERR, "bad user ID `%d' for user `%s': %s\n",
+ (int) info->pw_uid, info->pw_name, strerror(err));
closelog ();
return -1;
}
if (!getdef_bool ("DEFAULT_HOME") || chdir ("/") == -1) {
fprintf (log_get_logfd(), _("Unable to cd to '%s'\n"),
info->pw_dir);
- SYSLOG ((LOG_WARN,
- "unable to cd to `%s' for user `%s'\n",
- info->pw_dir, info->pw_name));
+ SYSLOG(LOG_WARN,
+ "unable to cd to `%s' for user `%s'\n",
+ info->pw_dir, info->pw_name);
closelog ();
exit (EXIT_FAILURE);
}
free(sss_cache_args);
if (rv != 0) {
/* run_command writes its own more detailed message. */
- SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, log_get_progname()));
+ SYSLOG(LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, log_get_progname());
return -1;
}
code = WEXITSTATUS (status);
if (!WIFEXITED (status)) {
- SYSLOG ((LOG_WARN, "%s: sss_cache did not terminate normally (signal %d)",
- log_get_progname(), WTERMSIG (status)));
+ SYSLOG(LOG_WARN, "%s: sss_cache did not terminate normally (signal %d)",
+ log_get_progname(), WTERMSIG(status));
return -1;
} else if (code == E_CMD_NOTFOUND) {
/* sss_cache is not installed, or it is installed but uses an
interpreter that is missing. Probably the former. */
return 0;
} else if (code != 0) {
- SYSLOG ((LOG_WARN, "%s: sss_cache exited with status %d", log_get_progname(), code));
- SYSLOG ((LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, log_get_progname()));
+ SYSLOG(LOG_WARN, "%s: sss_cache exited with status %d", log_get_progname(), code);
+ SYSLOG(LOG_WARN, MSG_SSSD_FLUSH_CACHE_FAILED, log_get_progname());
return -1;
}
*/
if (++depth > MAX_DEPTH) {
printf (_("Maximum subsystem depth reached\n"));
- SYSLOG ((LOG_WARN, MAX_SUBROOT2));
+ SYSLOG(LOG_WARN, MAX_SUBROOT2);
closelog ();
exit (EXIT_FAILURE);
}
if (pw->pw_dir[0] != '/') {
printf (_("Invalid root directory '%s'\n"), pw->pw_dir);
- SYSLOG ((LOG_WARN, BAD_SUBROOT2, pw->pw_dir, pw->pw_name));
+ SYSLOG(LOG_WARN, BAD_SUBROOT2, pw->pw_dir, pw->pw_name);
closelog ();
exit (EXIT_FAILURE);
}
|| (chdir ("/") != 0)) {
(void) printf (_("Can't change root directory to '%s'\n"),
pw->pw_dir);
- SYSLOG ((LOG_WARN, NO_SUBROOT2, pw->pw_dir, pw->pw_name));
+ SYSLOG(LOG_WARN, NO_SUBROOT2, pw->pw_dir, pw->pw_name);
closelog ();
exit (EXIT_FAILURE);
}
gid_t oldgid = 0;
if (success) {
- SYSLOG ((LOG_INFO,
- "Successful su for %s by %s",name,oldname));
+ SYSLOG(LOG_INFO, "Successful su for %s by %s", name, oldname);
} else {
- SYSLOG ((LOG_NOTICE,
- "FAILED su for %s by %s",name,oldname));
+ SYSLOG(LOG_NOTICE, "FAILED su for %s by %s", name, oldname);
}
sulog_file = getdef_str ("SULOG_FILE");
/* Switch to group root to avoid creating the sulog file with
* the wrong group ownership. */
if ((oldgid != 0) && (setgid (0) != 0)) {
- SYSLOG ((LOG_INFO,
- "su session not logged to %s", sulog_file));
+ SYSLOG(LOG_INFO, "su session not logged to %s", sulog_file);
/* Continue, but do not switch back to oldgid later */
oldgid = 0;
}
(void) umask (oldmask);
if ((oldgid != 0) && (setgid (oldgid) != 0)) {
perror ("setgid");
- SYSLOG ((LOG_ERR,
- "can't switch back to group `%d' in sulog",
- oldgid));
+ SYSLOG(LOG_ERR, "can't switch back to group `%d' in sulog", oldgid);
/* Do not return if the group permission were raised. */
exit (EXIT_FAILURE);
}
fd = open (ftmp, O_WRONLY | O_APPEND);
if (-1 == fd) {
if (errno != ENOENT) {
- SYSLOG ((LOG_WARN,
- "Can't append failure of user %s to %s: %m",
- username, ftmp));
+ SYSLOG(LOG_WARN,
+ "Can't append failure of user %s to %s: %m",
+ username, ftmp);
}
return;
}
errno = saved_errno;
}
err_close:
- SYSLOG ((LOG_WARN,
- "Can't append failure of user %s to %s: %m",
- username, ftmp));
+ SYSLOG(LOG_WARN, "Can't append failure of user %s to %s: %m", username, ftmp);
}
if (spw_locked) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
}
if (pw_open (readonly ? O_RDONLY: O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", pw_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", pw_dbname());
fail_exit (E_NOPERM, process_selinux);
}
if (spw_open (readonly ? O_RDONLY: O_CREAT | O_RDWR) == 0) {
fprintf (stderr,
_("%s: cannot open %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", spw_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", spw_dbname());
fail_exit (E_NOPERM, process_selinux);
}
}
if (spw_close (process_selinux) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", spw_dbname());
fail_exit (E_NOPERM, process_selinux);
}
*/
if (pw_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (E_NOPERM, process_selinux);
}
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
spw_locked = false;
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
pw_locked = false;
fprintf (stderr,
_("%s: the shadow password file is not present\n"),
Prog);
- SYSLOG ((LOG_WARN, "can't find the shadow password file"));
+ SYSLOG(LOG_WARN, "can't find the shadow password file");
closelog ();
exit (E_SHADOW_NOTFOUND);
}
close_files (&flags);
- SYSLOG ((LOG_INFO, "changed password expiry for %s", user_name));
+ SYSLOG(LOG_INFO, "changed password expiry for %s", user_name);
closelog ();
exit (E_SUCCESS);
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
if (PAM_SUCCESS != retval) {
fprintf (stderr, _("%s: PAM: %s\n"),
Prog, pam_strerror (pamh, retval));
- SYSLOG((LOG_ERR, "%s", pam_strerror (pamh, retval)));
+ SYSLOG(LOG_ERR, "%s", pam_strerror(pamh, retval));
if (NULL != pamh) {
(void) pam_end (pamh, retval);
}
*/
if (setuid (0) != 0) {
fputs (_("Cannot change ID to root.\n"), stderr);
- SYSLOG ((LOG_ERR, "can't setuid(0)"));
+ SYSLOG(LOG_ERR, "can't setuid(0)");
fail_exit (E_NOPERM, process_selinux);
}
pwd_init ();
*/
if (pw_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (E_NOPERM, process_selinux);
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
pw_locked = false;
fprintf (stderr,
_("%s: Cannot determine your user name.\n"),
Prog);
- SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
- (unsigned long) getuid ()));
+ SYSLOG(LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid());
fail_exit (E_NOPERM, process_selinux);
}
user = xstrdup (pw->pw_name);
/* Rewrite the user's gecos in the passwd file */
update_gecos (user, new_gecos, &flags);
- SYSLOG ((LOG_INFO, "changed user '%s' information", user));
+ SYSLOG(LOG_INFO, "changed user '%s' information", user);
nscd_flush_cache ("passwd");
sssd_flush_cache (SSSD_DB_PASSWD);
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sgr_dbname());
fail_exit (1, process_selinux);
}
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
sgr_locked = false;
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", gr_dbname());
fail_exit (1, process_selinux);
}
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
gr_locked = false;
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
if (spw_locked) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", spw_dbname());
fail_exit (1, process_selinux);
}
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
spw_locked = false;
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (1, process_selinux);
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
pw_locked = false;
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
* UID of the user matches the current real UID.
*/
if (!amroot && pw->pw_uid != getuid ()) {
- SYSLOG ((LOG_WARN, "can't change shell for '%s'", pw->pw_name));
+ SYSLOG(LOG_WARN, "can't change shell for '%s'", pw->pw_name);
fprintf (stderr,
_("You may not change the shell for '%s'.\n"),
pw->pw_name);
* is not a restricted one.
*/
if (!amroot && is_restricted_shell (pw->pw_shell, process_selinux)) {
- SYSLOG ((LOG_WARN, "can't change shell for '%s'", pw->pw_name));
+ SYSLOG(LOG_WARN, "can't change shell for '%s'", pw->pw_name);
fprintf (stderr,
_("You may not change the shell for '%s'.\n"),
pw->pw_name);
*/
if ((pw->pw_uid != getuid ())
&& (check_selinux_permit(Prog) != 0)) {
- SYSLOG ((LOG_WARN, "can't change shell for '%s'", pw->pw_name));
+ SYSLOG(LOG_WARN, "can't change shell for '%s'", pw->pw_name);
fprintf (stderr,
_("You may not change the shell for '%s'.\n"),
pw->pw_name);
if (PAM_SUCCESS != retval) {
fprintf (stderr, _("%s: PAM: %s\n"),
Prog, pam_strerror (pamh, retval));
- SYSLOG((LOG_ERR, "%s", pam_strerror (pamh, retval)));
+ SYSLOG(LOG_ERR, "%s", pam_strerror(pamh, retval));
if (NULL != pamh) {
(void) pam_end (pamh, retval);
}
* keyboard signals are set to be ignored.
*/
if (setuid (0) != 0) {
- SYSLOG ((LOG_ERR, "can't setuid(0)"));
+ SYSLOG(LOG_ERR, "can't setuid(0)");
fputs (_("Cannot change ID to root.\n"), stderr);
fail_exit (1, process_selinux);
}
pw_locked = true;
if (pw_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", pw_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", pw_dbname());
fail_exit (1, process_selinux);
}
*/
if (pw_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (1, process_selinux);
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
pw_locked= false;
fprintf (stderr,
_("%s: Cannot determine your user name.\n"),
Prog);
- SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
- (unsigned long) getuid ()));
+ SYSLOG(LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid());
fail_exit (1, process_selinux);
}
user = xstrdup (pw->pw_name);
update_shell (user, loginsh, &flags);
- SYSLOG ((LOG_INFO, "changed user '%s' shell to '%s'", user, loginsh));
+ SYSLOG(LOG_INFO, "changed user '%s' shell to '%s'", user, loginsh);
nscd_flush_cache ("passwd");
sssd_flush_cache (SSSD_DB_PASSWD);
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", gr_dbname());
exit (E_NOPERM);
}
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", sgr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", sgr_dbname());
exit (E_NOPERM);
}
add_cleanup (log_gpasswd_failure_gshadow, NULL);
static void log_gpasswd_failure (const char *suffix)
{
if (aflg) {
- SYSLOG ((LOG_ERR,
- "%s failed to add user %s to group %s%s",
- myname, user, group, suffix));
+ SYSLOG(LOG_ERR, "%s failed to add user %s to group %s%s",
+ myname, user, group, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_USER_MGMT,
"add-user-to-group",
SHADOW_AUDIT_FAILURE);
#endif
} else if (dflg) {
- SYSLOG ((LOG_ERR,
- "%s failed to remove user %s from group %s%s",
- myname, user, group, suffix));
+ SYSLOG(LOG_ERR, "%s failed to remove user %s from group %s%s",
+ myname, user, group, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_USER_MGMT,
"delete-user-from-group",
SHADOW_AUDIT_FAILURE);
#endif
} else if (rflg) {
- SYSLOG ((LOG_ERR,
- "%s failed to remove password of group %s%s",
- myname, group, suffix));
+ SYSLOG(LOG_ERR, "%s failed to remove password of group %s%s",
+ myname, group, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_GRP_CHAUTHTOK,
"delete-group-password",
SHADOW_AUDIT_FAILURE);
#endif
} else if (Rflg) {
- SYSLOG ((LOG_ERR,
- "%s failed to restrict access to group %s%s",
- myname, group, suffix));
+ SYSLOG(LOG_ERR, "%s failed to restrict access to group %s%s",
+ myname, group, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_GRP_MGMT,
"restrict-group",
} else if (Aflg || Mflg) {
#ifdef SHADOWGRP
if (Aflg) {
- SYSLOG ((LOG_ERR,
- "%s failed to set the administrators of group %s to %s%s",
- myname, group, admins, suffix));
+ SYSLOG(LOG_ERR,
+ "%s failed to set the administrators of group %s to %s%s",
+ myname, group, admins, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_GRP_MGMT,
"set-admins-of-group",
}
#endif /* SHADOWGRP */
if (Mflg) {
- SYSLOG ((LOG_ERR,
- "%s failed to set the members of group %s to %s%s",
- myname, group, members, suffix));
+ SYSLOG(LOG_ERR,
+ "%s failed to set the members of group %s to %s%s",
+ myname, group, members, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_USER_MGMT,
"add-users-to-group",
#endif
}
} else {
- SYSLOG ((LOG_ERR,
- "%s failed to change password of group %s%s",
- myname, group, suffix));
+ SYSLOG(LOG_ERR, "%s failed to change password of group %s%s",
+ myname, group, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_GRP_CHAUTHTOK,
"change-password",
#endif
if (aflg) {
- SYSLOG ((LOG_INFO,
- "user %s added by %s to group %s%s",
- user, myname, group, suffix));
+ SYSLOG(LOG_INFO, "user %s added by %s to group %s%s",
+ user, myname, group, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_USER_MGMT,
"add-user-to-group",
SHADOW_AUDIT_SUCCESS);
#endif
} else if (dflg) {
- SYSLOG ((LOG_INFO,
- "user %s removed by %s from group %s%s",
- user, myname, group, suffix));
+ SYSLOG(LOG_INFO, "user %s removed by %s from group %s%s",
+ user, myname, group, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_USER_MGMT,
"delete-user-from-group",
SHADOW_AUDIT_SUCCESS);
#endif
} else if (rflg) {
- SYSLOG ((LOG_INFO,
- "password of group %s removed by %s%s",
- group, myname, suffix));
+ SYSLOG(LOG_INFO, "password of group %s removed by %s%s",
+ group, myname, suffix);
#ifdef WITH_AUDIT
stprintf_a(buf, "password of group %s removed by %s%s",
group, myname, suffix);
SHADOW_AUDIT_SUCCESS);
#endif
} else if (Rflg) {
- SYSLOG ((LOG_INFO,
- "access to group %s restricted by %s%s",
- group, myname, suffix));
+ SYSLOG(LOG_INFO, "access to group %s restricted by %s%s",
+ group, myname, suffix);
#ifdef WITH_AUDIT
stprintf_a(buf, "access to group %s restricted by %s%s",
group, myname, suffix);
} else if (Aflg || Mflg) {
#ifdef SHADOWGRP
if (Aflg) {
- SYSLOG ((LOG_INFO,
- "administrators of group %s set by %s to %s%s",
- group, myname, admins, suffix));
+ SYSLOG(LOG_INFO, "administrators of group %s set by %s to %s%s",
+ group, myname, admins, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_GRP_MGMT,
"set-admins-of-group",
}
#endif /* SHADOWGRP */
if (Mflg) {
- SYSLOG ((LOG_INFO,
- "members of group %s set by %s to %s%s",
- group, myname, members, suffix));
+ SYSLOG(LOG_INFO, "members of group %s set by %s to %s%s",
+ group, myname, members, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_USER_MGMT,
"add-users-to-group",
#endif
}
} else {
- SYSLOG ((LOG_INFO,
- "password of group %s changed by %s%s",
- group, myname, suffix));
+ SYSLOG(LOG_INFO, "password of group %s changed by %s%s",
+ group, myname, suffix);
#ifdef WITH_AUDIT
audit_logger_with_group (AUDIT_GRP_CHAUTHTOK,
"change-password",
if (gr_open (O_RDONLY) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", gr_dbname());
exit (E_NOPERM);
}
fprintf (stderr,
_("%s: failure while closing read-only %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR,
- "failure while closing read-only %s",
- gr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while closing read-only %s", gr_dbname());
exit (E_NOPERM);
}
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", sgr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", sgr_dbname());
exit (E_NOPERM);
}
tmpsg = sgr_locate (group);
fprintf (stderr,
_("%s: failure while closing read-only %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR,
- "failure while closing read-only %s",
- sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while closing read-only %s",
+ sgr_dbname());
exit (E_NOPERM);
}
}
if (NULL == pw) {
fprintf (stderr, _("%s: Cannot determine your user name.\n"),
Prog);
- SYSLOG ((LOG_WARN,
- "Cannot determine the user name of the caller (UID %lu)",
- (unsigned long) getuid ()));
+ SYSLOG(LOG_WARN,
+ "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid());
exit (E_NOPERM);
}
myname = xstrdup (pw->pw_name);
output:
if (setuid (0) != 0) {
fputs (_("Cannot change ID to root.\n"), stderr);
- SYSLOG ((LOG_ERR, "can't setuid(0)"));
+ SYSLOG(LOG_ERR, "can't setuid(0)");
closelog ();
exit (E_NOPERM);
}
"add-group",
group_name, group_id, SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO, "group added to %s: name=%s, GID=%u",
- gr_dbname (), group_name, (unsigned int) group_id));
+ SYSLOG(LOG_INFO, "group added to %s: name=%s, GID=%u",
+ gr_dbname(), group_name, (unsigned int) group_id);
del_cleanup (cleanup_report_add_group_group);
cleanup_unlock_group (&process_selinux);
"add-shadow-group",
group_name, group_id, SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO, "group added to %s: name=%s",
- sgr_dbname (), group_name));
+ SYSLOG(LOG_INFO, "group added to %s: name=%s",
+ sgr_dbname(), group_name);
del_cleanup (cleanup_report_add_group_gshadow);
cleanup_unlock_gshadow (&process_selinux);
#endif /* SHADOWGRP */
/* Report success at the system level */
- SYSLOG ((LOG_INFO, "new group: name=%s, GID=%u",
- group_name, (unsigned int) group_id));
+ SYSLOG(LOG_INFO, "new group: name=%s, GID=%u",
+ group_name, (unsigned int) group_id);
del_cleanup (cleanup_report_add_group);
}
/* And now open the databases */
if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf(stderr, _("%s: cannot open %s: %s\n"), Prog, gr_dbname(), strerrno());
- SYSLOG((LOG_WARN, "cannot open %s: %s", gr_dbname(), strerrno()));
+ SYSLOG(LOG_WARN, "cannot open %s: %s", gr_dbname(), strerrno());
fail_exit (E_GRP_UPDATE);
}
fprintf (stderr,
_("%s: cannot open %s: %s\n"),
Prog, sgr_dbname(), strerrno());
- SYSLOG((LOG_WARN, "cannot open %s: %s", sgr_dbname(), strerrno()));
+ SYSLOG(LOG_WARN, "cannot open %s: %s", sgr_dbname(), strerrno());
fail_exit (E_GRP_UPDATE);
}
}
"delete-group",
group_name, group_id, SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "group '%s' removed from %s",
- group_name, gr_dbname ()));
+ SYSLOG(LOG_INFO, "group '%s' removed from %s", group_name, gr_dbname());
del_cleanup (cleanup_report_del_group_group);
cleanup_unlock_group (&process_selinux);
"delete-shadow-group",
group_name, group_id, SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "group '%s' removed from %s",
- group_name, sgr_dbname ()));
+ SYSLOG(LOG_INFO, "group '%s' removed from %s", group_name, sgr_dbname());
del_cleanup (cleanup_report_del_group_gshadow);
cleanup_unlock_gshadow (&process_selinux);
}
#endif /* SHADOWGRP */
- SYSLOG ((LOG_INFO, "group '%s' removed\n", group_name));
+ SYSLOG(LOG_INFO, "group '%s' removed\n", group_name);
del_cleanup (cleanup_report_del_group);
}
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", gr_dbname());
fail_exit (E_GRP_UPDATE);
}
#ifdef SHADOWGRP
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", sgr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", sgr_dbname());
fail_exit (E_GRP_UPDATE);
}
}
if (PAM_SUCCESS != retval) {
fprintf (stderr, _("%s: PAM: %s\n"),
Prog, pam_strerror (pamh, retval));
- SYSLOG((LOG_ERR, "%s", pam_strerror (pamh, retval)));
+ SYSLOG(LOG_ERR, "%s", pam_strerror(pamh, retval));
if (NULL != pamh) {
(void) pam_end (pamh, retval);
}
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
if ((gr_close (process_selinux) == 0) && !list) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", gr_dbname());
fail_exit (EXIT_GROUP_FILE, process_selinux);
}
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
gr_locked = false;
if (is_shadowgrp) {
if ((sgr_close (process_selinux) == 0) && !list) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sgr_dbname());
fail_exit (EXIT_GROUP_FILE, process_selinux);
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
sgr_locked = false;
group_name, AUDIT_NO_ID,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "group changed in %s (%s)",
- gr_dbname (), info_group.action));
+ SYSLOG(LOG_INFO, "group changed in %s (%s)", gr_dbname(), info_group.action);
del_cleanup (cleanup_report_mod_group);
cleanup_unlock_group (&process_selinux);
group_name, AUDIT_NO_ID,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "group changed in %s (%s)",
- sgr_dbname (), info_gshadow.action));
+ SYSLOG(LOG_INFO, "group changed in %s (%s)",
+ sgr_dbname(), info_gshadow.action);
del_cleanup (cleanup_report_mod_gshadow);
cleanup_unlock_gshadow (&process_selinux);
group_name, AUDIT_NO_ID,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "group changed in %s (%s)",
- pw_dbname (), info_passwd.action));
+ SYSLOG(LOG_INFO, "group changed in %s (%s)",
+ pw_dbname(), info_passwd.action);
del_cleanup (cleanup_report_mod_passwd);
cleanup_unlock_passwd (&process_selinux);
{
if (gr_open (O_CREAT | O_RDWR) == 0) {
fprintf (stderr, _("%s: cannot open %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", gr_dbname());
exit (E_GRP_UPDATE);
}
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", sgr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", sgr_dbname());
exit (E_GRP_UPDATE);
}
}
fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", gr_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", gr_dbname());
exit (E_GRP_UPDATE);
}
}
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
fprintf (stderr, _("%s: cannot open %s\n"), Prog,
grp_file);
if (use_system_grp_file) {
- SYSLOG ((LOG_WARN, "cannot open %s", grp_file));
+ SYSLOG(LOG_WARN, "cannot open %s", grp_file);
}
fail_exit (E_CANT_OPEN, process_selinux);
}
fprintf (stderr, _("%s: cannot open %s\n"), Prog,
sgr_file);
if (use_system_sgr_file) {
- SYSLOG ((LOG_WARN, "cannot open %s", sgr_file));
+ SYSLOG(LOG_WARN, "cannot open %s", sgr_file);
}
fail_exit (E_CANT_OPEN, process_selinux);
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
sgr_locked = false;
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
gr_locked = false;
continue;
}
- SYSLOG ((LOG_INFO, fmt_syslog, members[i], groupname));
+ SYSLOG(LOG_INFO, fmt_syslog, members[i], groupname);
members_changed = 1;
delete_member (members, members[i]);
* to try out the next list element.
*/
delete_gr:
- SYSLOG ((LOG_INFO, "delete group line '%s'",
- gre->line));
+ SYSLOG(LOG_INFO, "delete group line '%s'", gre->line);
*changed = true;
__gr_del_entry (gre);
sg.sg_passwd = grp->gr_passwd;
sg.sg_adm = ∅
sg.sg_mem = grp->gr_mem;
- SYSLOG ((LOG_INFO,
- "add group '%s' to '%s'",
- grp->gr_name, sgr_file));
+ SYSLOG(LOG_INFO, "add group '%s' to '%s'",
+ grp->gr_name, sgr_file);
*changed = true;
if (sgr_update (&sg) == 0) {
* of the loop to try out the next list element.
*/
delete_sg:
- SYSLOG ((LOG_INFO, "delete shadow line '%s'",
- sge->line));
+ SYSLOG(LOG_INFO, "delete shadow line '%s'", sge->line);
*changed = true;
__sgr_del_entry (sge);
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sgr_dbname());
fail_exit (3, process_selinux);
}
if (gr_close (process_selinux) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", gr_dbname());
fail_exit (3, process_selinux);
}
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", gr_dbname());
fail_exit (3, process_selinux);
}
fprintf (stderr,
_("%s: cannot delete %s\n"),
Prog, _PATH_GSHADOW);
- SYSLOG((LOG_ERR, "cannot delete %s", _PATH_GSHADOW));
+ SYSLOG(LOG_ERR, "cannot delete %s", _PATH_GSHADOW);
fail_exit (3, process_selinux);
}
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
#define PAM_FAIL_CHECK if (retcode != PAM_SUCCESS) { \
fprintf(stderr,"\n%s\n",pam_strerror(pamh, retcode)); \
- SYSLOG((LOG_ERR,"%s",pam_strerror(pamh, retcode))); \
+ SYSLOG(LOG_ERR,"%s",pam_strerror(pamh, retcode)); \
(void) pam_end(pamh, retcode); \
exit(1); \
}
* root), but not if run by root.
*/
if (!amroot && (err != 0)) {
- SYSLOG ((LOG_ERR,
- "No session entry, error %d. You must exec \"login\" from the lowest level \"sh\"",
- err));
+ SYSLOG(LOG_ERR,
+ "No session entry, error %d. You must exec \"login\" from the lowest level \"sh\"",
+ err);
exit (1);
}
fprintf (stderr,
_("login: PAM Failure, aborting: %s\n"),
pam_strerror (pamh, retcode));
- SYSLOG ((LOG_ERR, "Couldn't initialize PAM: %s",
- pam_strerror (pamh, retcode)));
+ SYSLOG(LOG_ERR, "Couldn't initialize PAM: %s", pam_strerror(pamh, retcode));
exit (99);
}
failent_user = get_failent_user (pam_user);
if (retcode == PAM_MAXTRIES) {
- SYSLOG ((LOG_NOTICE,
- "TOO MANY LOGIN TRIES (%u)%s FOR '%s'",
- failcount, fromhost, failent_user));
+ SYSLOG(LOG_NOTICE,
+ "TOO MANY LOGIN TRIES (%u)%s FOR '%s'",
+ failcount, fromhost, failent_user);
fprintf (stderr,
_("Maximum number of tries exceeded (%u)\n"),
failcount);
} else if (retcode == PAM_ABORT) {
/* Serious problems, quit now */
(void) fputs (_("login: abort requested by PAM\n"), stderr);
- SYSLOG ((LOG_ERR,"PAM_ABORT returned from pam_authenticate()"));
+ SYSLOG(LOG_ERR, "PAM_ABORT returned from pam_authenticate()");
PAM_END;
exit(99);
} else if (retcode != PAM_SUCCESS) {
- SYSLOG ((LOG_NOTICE,"FAILED LOGIN (%u)%s FOR '%s', %s",
+ SYSLOG(LOG_NOTICE, "FAILED LOGIN (%u)%s FOR '%s', %s",
failcount, fromhost, failent_user,
- pam_strerror (pamh, retcode)));
+ pam_strerror(pamh, retcode));
failed = true;
}
(void) puts (_("Login incorrect"));
if (failcount >= retries) {
- SYSLOG ((LOG_NOTICE,
- "TOO MANY LOGIN TRIES (%u)%s FOR '%s'",
- failcount, fromhost, failent_user));
+ SYSLOG(LOG_NOTICE,
+ "TOO MANY LOGIN TRIES (%u)%s FOR '%s'",
+ failcount, fromhost, failent_user);
fprintf (stderr,
_("Maximum number of tries exceeded (%u)\n"),
failcount);
pwd = xgetpwnam (username);
if (NULL == pwd) {
- SYSLOG ((LOG_ERR, "cannot find user %s", failent_user));
+ SYSLOG(LOG_ERR, "cannot find user %s", failent_user);
fprintf (stderr,
_("Cannot find user (%s)\n"),
username);
* shadow. SHADOW_PASSWD_STRING indicates
* that the password shall be in shadow.
*/
- SYSLOG ((LOG_WARN,
- "no shadow password for '%s'%s",
- username, fromhost));
+ SYSLOG(LOG_WARN, "no shadow password for '%s'%s",
+ username, fromhost);
}
}
goto auth_ok;
}
- SYSLOG ((LOG_WARN, "invalid password for '%s' %s",
- failent_user, fromhost));
+ SYSLOG(LOG_WARN, "invalid password for '%s' %s",
+ failent_user, fromhost);
failed = true;
auth_ok:
&& (NULL != pwd)
&& (0 == pwd->pw_uid)
&& !is_console) {
- SYSLOG ((LOG_CRIT, "ILLEGAL ROOT LOGIN %s", fromhost));
+ SYSLOG(LOG_CRIT, "ILLEGAL ROOT LOGIN %s", fromhost);
failed = true;
}
if ( !failed
&& !login_access(username, (!streq(hostname, "")) ? hostname : tty)) {
- SYSLOG ((LOG_WARN, "LOGIN '%s' REFUSED %s",
- username, fromhost));
+ SYSLOG(LOG_WARN, "LOGIN '%s' REFUSED %s",
+ username, fromhost);
failed = true;
}
if ( (NULL != pwd)
&& getdef_bool ("FAILLOG_ENAB")
&& !failcheck (pwd->pw_uid, &faillog, failed)) {
- SYSLOG ((LOG_CRIT,
- "exceeded failure limit for '%s' %s",
- username, fromhost));
+ SYSLOG(LOG_CRIT, "exceeded failure limit for '%s' %s",
+ username, fromhost);
failed = true;
}
if (!failed) {
retries--;
if (retries <= 0) {
- SYSLOG ((LOG_CRIT, "REPEATED login failures%s",
- fromhost));
+ SYSLOG(LOG_CRIT, "REPEATED login failures%s", fromhost);
}
/*
*/
if ( getdef_bool ("PORTTIME_CHECKS_ENAB")
&& !isttytime (username, tty, time (NULL))) {
- SYSLOG ((LOG_WARN, "invalid login time for '%s'%s",
- username, fromhost));
+ SYSLOG(LOG_WARN, "invalid login time for '%s'%s",
+ username, fromhost);
closelog ();
bad_time_notify ();
exit (1);
pw_free (pwd);
pwd = xgetpwnam (username);
if (NULL == pwd) {
- SYSLOG ((LOG_ERR,
- "cannot find user %s after update of expired password",
- username));
+ SYSLOG(LOG_ERR,
+ "cannot find user %s after update of expired password",
+ username);
exit (1);
}
spw_free (spwd);
*/
err = update_utmp(username, tty, hostname, initial_pid);
if (err != 0) {
- SYSLOG ((LOG_WARN, "Unable to update utmp entry for %s", username));
+ SYSLOG(LOG_WARN, "Unable to update utmp entry for %s", username);
}
#endif /* ENABLE_LOGIND */
if ( (0 != faillog.fail_max)
&& (faillog.fail_cnt >= faillog.fail_max)) {
(void) puts (_("Warning: login re-enabled after temporary lockout."));
- SYSLOG ((LOG_WARN,
- "login '%s' re-enabled after temporary lockout (%d failures)",
- username, (int) faillog.fail_cnt));
+ SYSLOG(LOG_WARN,
+ "login '%s' re-enabled after temporary lockout (%d failures)",
+ username, (int) faillog.fail_cnt);
}
}
#ifdef ENABLE_LASTLOG
(void) signal (SIGINT, SIG_DFL); /* default interrupt signal */
if (0 == pwd->pw_uid) {
- SYSLOG ((LOG_NOTICE, "ROOT LOGIN %s", fromhost));
+ SYSLOG(LOG_NOTICE, "ROOT LOGIN %s", fromhost);
} else if (getdef_bool ("LOG_OK_LOGINS")) {
- SYSLOG ((LOG_INFO, "'%s' logged in %s", username, fromhost));
+ SYSLOG(LOG_INFO, "'%s' logged in %s", username, fromhost);
}
closelog ();
tmp = getdef_str ("FAKE_SHELL");
lineno++;
if (stpsep(line, "\n") == NULL) {
- SYSLOG ((LOG_ERR,
- "%s: line %jd: missing newline or line too long",
- TABLE, lineno));
+ SYSLOG(LOG_ERR,
+ "%s: line %jd: missing newline or line too long",
+ TABLE, lineno);
continue;
}
if (strprefix(line, "#")) {
users = strsep(&p, ":");
froms = strsep(&p, ":");
if (froms == NULL || p != NULL) {
- SYSLOG ((LOG_ERR,
- "%s: line %jd: bad field count",
- TABLE, lineno));
+ SYSLOG(LOG_ERR, "%s: line %jd: bad field count",
+ TABLE, lineno);
continue;
}
if (perm[0] != '+' && perm[0] != '-') {
- SYSLOG ((LOG_ERR,
- "%s: line %jd: bad first field",
- TABLE, lineno));
+ SYSLOG(LOG_ERR, "%s: line %jd: bad first field",
+ TABLE, lineno);
continue;
}
match = ( list_match (froms, from, from_match)
(void) fclose (fp);
} else if (errno != ENOENT) {
int err = errno;
- SYSLOG ((LOG_ERR, "cannot open %s: %s", TABLE, strerror (err)));
+ SYSLOG(LOG_ERR, "cannot open %s: %s", TABLE, strerror(err));
}
return (!match || strprefix(line, "+"))?1:0;
}
gai_err = getaddrinfo(string, NULL, NULL, &addrs);
if (gai_err != 0) {
- SYSLOG ((LOG_ERR, "getaddrinfo(%s): %s", string, gai_strerror(gai_err)));
+ SYSLOG(LOG_ERR, "getaddrinfo(%s): %s", string, gai_strerror(gai_err));
return string;
}
gai_err = getnameinfo(addrs[0].ai_addr, addrs[0].ai_addrlen,
host, countof(host), NULL, 0, NI_NUMERICHOST);
if (gai_err != 0) {
- SYSLOG ((LOG_ERR, "getnameinfo(%s): %s", string, gai_strerror(gai_err)));
+ SYSLOG(LOG_ERR, "getnameinfo(%s): %s", string, gai_strerror(gai_err));
addr_str = string;
}
fprintf (stderr,
_("%s: Cannot determine your user name.\n"),
Prog);
- SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
- (unsigned long) getuid ()));
+ SYSLOG(LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid());
return EXIT_FAILURE;
}
fprintf (stderr,
_("%s: failed to crypt password with previous salt: %s\n"),
Prog, strerrno());
- SYSLOG ((LOG_INFO,
- "Failed to crypt password with previous salt of group '%s'",
- groupname));
+ SYSLOG(LOG_INFO,
+ "Failed to crypt password with previous salt of group '%s'",
+ groupname);
goto failure;
}
audit_logger (AUDIT_GRP_AUTH,
audit_buf, NULL, getuid (), SHADOW_AUDIT_FAILURE);
#endif
- SYSLOG ((LOG_INFO,
- "Invalid password for group '%s' from '%s'",
- groupname, pwd->pw_name));
+ SYSLOG(LOG_INFO,
+ "Invalid password for group '%s' from '%s'",
+ groupname, pwd->pw_name);
(void) sleep (1);
(void) fputs (_("Invalid password.\n"), stderr);
goto failure;
}
tty = strprefix(tty, "/dev/") ?: tty;
- SYSLOG ((LOG_INFO,
- "user '%s' (login '%s' on %s) switched to group '%s'",
- name, loginname, tty, group));
+ SYSLOG(LOG_INFO, "user '%s' (login '%s' on %s) switched to group '%s'",
+ name, loginname, tty, group);
#ifdef USE_PAM
/*
* We want to fork and exec the new shell in the child, leaving the
|| ((pid != child) && (errno == EINTR)));
/* local, no need for xgetgrgid */
if (NULL != grp) {
- SYSLOG ((LOG_INFO,
- "user '%s' (login '%s' on %s) returned to group '%s'",
- name, loginname, tty, grp->gr_name));
+ SYSLOG(LOG_INFO,
+ "user '%s' (login '%s' on %s) returned to group '%s'",
+ name, loginname, tty, grp->gr_name);
} else {
- SYSLOG ((LOG_INFO,
- "user '%s' (login '%s' on %s) returned to group '%lu'",
- name, loginname, tty,
- (unsigned long) gid));
+ SYSLOG(LOG_INFO,
+ "user '%s' (login '%s' on %s) returned to group '%lu'",
+ name, loginname, tty, (unsigned long) gid);
/* Either the user's passwd entry has a
* GID that does not match with any group,
* or the group was deleted while the user
* was in a newgrp session.*/
- SYSLOG ((LOG_WARN,
- "unknown GID '%lu' used by user '%s'",
- (unsigned long) gid, name));
+ SYSLOG(LOG_WARN,
+ "unknown GID '%lu' used by user '%s'",
+ (unsigned long) gid, name);
}
closelog ();
exit ((0 != WIFEXITED (cst)) ? WEXITSTATUS (cst)
audit_logger (AUDIT_CHGRP_ID,
"changing", NULL, getuid (), SHADOW_AUDIT_FAILURE);
#endif
- SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
- (unsigned long) getuid ()));
+ SYSLOG(LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid());
closelog ();
exit (EXIT_FAILURE);
}
fprintf (stderr,
_("%s: GID '%lu' does not exist\n"),
Prog, (unsigned long) pwd->pw_gid);
- SYSLOG ((LOG_CRIT, "GID '%lu' does not exist",
- (unsigned long) pwd->pw_gid));
+ SYSLOG(LOG_CRIT, "GID '%lu' does not exist",
+ (unsigned long) pwd->pw_gid);
goto failure;
} else {
group = grp->gr_name;
fprintf (stderr,
_("%s: Cannot determine your user name.\n"),
Prog);
- SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
- (unsigned long) getuid ()));
+ SYSLOG(LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid());
return EXIT_FAILURE;
}
if (spw_locked) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
if (sub_uid_locked) {
if (sub_uid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_uid_dbname());
/* continue */
}
}
if (sub_gid_locked) {
if (sub_gid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_gid_dbname());
/* continue */
}
}
if (pw_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (EXIT_FAILURE, process_selinux);
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
pw_locked = false;
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", spw_dbname());
fail_exit (EXIT_FAILURE, process_selinux);
}
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
spw_locked = false;
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", gr_dbname());
fail_exit (EXIT_FAILURE, process_selinux);
}
#ifdef ENABLE_SUBIDS
if (is_sub_uid && (sub_uid_close (process_selinux) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sub_uid_dbname());
fail_exit (EXIT_FAILURE, process_selinux);
}
if (is_sub_gid && (sub_gid_close (process_selinux) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sub_gid_dbname());
fail_exit (EXIT_FAILURE, process_selinux);
}
#endif /* ENABLE_SUBIDS */
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
gr_locked = false;
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sgr_dbname());
fail_exit (EXIT_FAILURE, process_selinux);
}
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
sgr_locked = false;
if (is_sub_uid) {
if (sub_uid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_uid_dbname());
/* continue */
}
sub_uid_locked = false;
if (is_sub_gid) {
if (sub_gid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_gid_dbname());
/* continue */
}
sub_gid_locked = false;
fprintf (stderr,
_("%s: failed to crypt password with previous salt: %s\n"),
Prog, strerrno());
- SYSLOG ((LOG_INFO,
- "Failed to crypt password with previous salt of user '%s'",
- pw->pw_name));
+ SYSLOG(LOG_INFO,
+ "Failed to crypt password with previous salt of user '%s'",
+ pw->pw_name);
return -1;
}
if (!streq(cipher, crypt_passwd)) {
erase_pass (clear);
strzero (cipher);
- SYSLOG ((LOG_WARN, "incorrect password for %s",
- pw->pw_name));
+ SYSLOG(LOG_WARN, "incorrect password for %s", pw->pw_name);
(void) sleep (1);
(void) fprintf (stderr,
_("Incorrect password for %s.\n"),
(void) fprintf (stderr,
_("The password for %s cannot be changed.\n"),
sp->sp_namp);
- SYSLOG ((LOG_WARN, "password locked for '%s'", sp->sp_namp));
+ SYSLOG(LOG_WARN, "password locked for '%s'", sp->sp_namp);
closelog ();
fail_exit(E_NOPERM, process_selinux);
}
(void) fprintf (stderr,
_("The password for %s cannot be changed yet.\n"),
sp->sp_namp);
- SYSLOG ((LOG_WARN, "now < minimum age for '%s'", sp->sp_namp));
+ SYSLOG(LOG_WARN, "now < minimum age for '%s'", sp->sp_namp);
closelog ();
fail_exit(E_NOPERM, process_selinux);
}
if (spw_locked) {
if (spw_unlock (process_selinux) == 0) {
(void) fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
(void) fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
(void) fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", pw_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", pw_dbname());
fail_exit (E_MISSING, process_selinux);
}
(void) fprintf (stderr,
_("%s: cannot open %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_WARN, "cannot open %s", spw_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", spw_dbname());
fail_exit (E_FAILURE, process_selinux);
}
}
(void) fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", spw_dbname());
fail_exit (E_FAILURE, process_selinux);
}
if (spw_unlock (process_selinux) == 0) {
(void) fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
spw_locked = false;
(void) fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (E_FAILURE, process_selinux);
}
if (pw_unlock (process_selinux) == 0) {
(void) fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
pw_locked = false;
(void) fprintf (stderr,
_("%s: Cannot determine your user name.\n"),
Prog);
- SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
- (unsigned long) getuid ()));
+ SYSLOG(LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) getuid());
exit (E_NOPERM);
}
myname = xstrdup (pw->pw_name);
NULL, pw->pw_uid,
SHADOW_AUDIT_FAILURE);
#endif /* WITH_AUDIT */
- SYSLOG ((LOG_ALERT,
- "root is not authorized by SELinux to change the password of %s",
- name));
+ SYSLOG(LOG_ALERT,
+ "root is not authorized by SELinux to change the password of %s",
+ name);
(void) fprintf(stderr,
_("%s: root is not authorized by SELinux to change the password of %s\n"),
Prog, name);
(void) fprintf (stderr,
_("%s: You may not view or modify password information for %s.\n"),
Prog, name);
- SYSLOG ((LOG_WARN,
- "can't view or modify password information for %s",
- name));
+ SYSLOG(LOG_WARN,
+ "can't view or modify password information for %s",
+ name);
closelog ();
exit (E_NOPERM);
}
#endif /* USE_PAM */
if (setuid (0) != 0) {
(void) fputs (_("Cannot change ID to root.\n"), stderr);
- SYSLOG ((LOG_ERR, "can't setuid(0)"));
+ SYSLOG(LOG_ERR, "can't setuid(0)");
closelog ();
exit (E_NOPERM);
}
nscd_flush_cache ("group");
sssd_flush_cache (SSSD_DB_PASSWD | SSSD_DB_GROUP);
- SYSLOG ((LOG_INFO, "password for '%s' changed by '%s'", name, myname));
+ SYSLOG(LOG_INFO, "password for '%s' changed by '%s'", name, myname);
closelog ();
if (!qflg) {
if (!anyflag) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
if (use_system_spw_file) {
- SYSLOG ((LOG_ERR, "failed to unlock %s",
- spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
}
/* continue */
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
if (use_system_pw_file) {
- SYSLOG ((LOG_ERR, "failed to unlock %s",
- pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
}
/* continue */
}
fprintf (stderr, _("%s: cannot open %s\n"),
Prog, pw_dbname ());
if (use_system_pw_file) {
- SYSLOG ((LOG_WARN, "cannot open %s", pw_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", pw_dbname());
}
fail_exit (E_CANTOPEN, process_selinux);
}
fprintf (stderr, _("%s: cannot open %s\n"),
Prog, spw_dbname ());
if (use_system_spw_file) {
- SYSLOG ((LOG_WARN, "cannot open %s",
- spw_dbname ()));
+ SYSLOG(LOG_WARN, "cannot open %s", spw_dbname());
}
fail_exit (E_CANTOPEN, process_selinux);
}
_("%s: failure while writing changes to %s\n"),
Prog, pw_dbname ());
if (use_system_pw_file) {
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- pw_dbname ()));
+ SYSLOG(LOG_ERR,
+ "failure while writing changes to %s",
+ pw_dbname());
}
fail_exit (E_CANTUPDATE, process_selinux);
}
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
if (use_system_spw_file) {
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- spw_dbname ()));
+ SYSLOG(LOG_ERR,
+ "failure while writing changes to %s",
+ spw_dbname());
}
fail_exit (E_CANTUPDATE, process_selinux);
}
_("%s: failed to unlock %s\n"),
Prog, spw_dbname ());
if (use_system_spw_file) {
- SYSLOG ((LOG_ERR, "failed to unlock %s",
- spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
}
/* continue */
}
_("%s: failed to unlock %s\n"),
Prog, pw_dbname ());
if (use_system_pw_file) {
- SYSLOG ((LOG_ERR, "failed to unlock %s",
- pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
}
/* continue */
}
*/
delete_pw:
if (use_system_pw_file) {
- SYSLOG ((LOG_INFO, "delete passwd line '%s'",
- pfe->line));
+ SYSLOG(LOG_INFO, "delete passwd line '%s'",
+ pfe->line);
}
*changed = true;
_("%s: failed to unlock %s\n"),
Prog, spw_dbname ());
if (use_system_spw_file) {
- SYSLOG ((LOG_ERR,
- "failed to unlock %s",
- spw_dbname ()));
+ SYSLOG(LOG_ERR,
+ "failed to unlock %s",
+ spw_dbname());
}
}
continue;
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
if (use_system_spw_file) {
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- spw_dbname ()));
+ SYSLOG(LOG_ERR,
+ "failure while writing changes to %s",
+ spw_dbname());
}
} else {
spw_opened = false;
_("%s: failed to unlock %s\n"),
Prog, spw_dbname ());
if (use_system_spw_file) {
- SYSLOG ((LOG_ERR, "failed to unlock %s",
- spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s",
+ spw_dbname());
}
} else {
spw_locked = false;
*/
delete_spw:
if (use_system_spw_file) {
- SYSLOG ((LOG_INFO, "delete shadow line '%s'",
- spe->line));
+ SYSLOG(LOG_INFO, "delete shadow line '%s'",
+ spe->line);
}
*changed = true;
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
if (spw_locked) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", spw_dbname());
fail_exit (E_FAILURE, process_selinux);
}
if (pw_close (process_selinux) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (E_FAILURE, process_selinux);
}
fprintf (stderr,
_("%s: failed to change the mode of %s to 0600\n"),
Prog, PASSWD_FILE "-");
- SYSLOG ((LOG_ERR, "failed to change the mode of %s to 0600", PASSWD_FILE "-"));
+ SYSLOG(LOG_ERR, "failed to change the mode of %s to 0600", PASSWD_FILE "-");
/* continue */
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
if (spw_locked) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (3, process_selinux);
}
if (unlink (SHADOW) != 0) {
fprintf (stderr,
_("%s: cannot delete %s\n"), Prog, SHADOW);
- SYSLOG ((LOG_ERR, "cannot delete %s", SHADOW));
+ SYSLOG(LOG_ERR, "cannot delete %s", SHADOW);
fail_exit (3, process_selinux);
}
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
{
sulog (tty, false, caller_name, name); /* log failed attempt */
if (getdef_bool ("SYSLOG_SU_ENAB")) {
- SYSLOG ((su_to_root ? LOG_NOTICE : LOG_INFO,
- "- %s %s:%s", tty,
- ('\0' != caller_name[0]) ? caller_name : "???",
- ('\0' != name[0]) ? name : "???"));
+ SYSLOG(su_to_root ? LOG_NOTICE : LOG_INFO,
+ "- %s %s:%s", tty,
+ ('\0' != caller_name[0]) ? caller_name : "???",
+ ('\0' != name[0]) ? name : "???");
}
closelog ();
fprintf (stderr,
_("%s: signal masking malfunction\n"),
Prog);
- SYSLOG ((LOG_WARN, "Will not execute %s", shellstr));
+ SYSLOG(LOG_WARN, "Will not execute %s", shellstr);
closelog ();
exit (1);
/* Only the child returns. See above. */
(void) fprintf (stderr,
_("%s: Cannot fork user shell\n"),
Prog);
- SYSLOG ((LOG_WARN, "Cannot execute %s", shellstr));
+ SYSLOG(LOG_WARN, "Cannot execute %s", shellstr);
closelog ();
exit (1);
/* Only the child returns. See above. */
ret = pam_close_session (pamh, 0);
if (PAM_SUCCESS != ret) {
- SYSLOG ((LOG_ERR, "pam_close_session: %s",
- pam_strerror (pamh, ret)));
+ SYSLOG(LOG_ERR, "pam_close_session: %s", pam_strerror(pamh, ret));
fprintf (stderr, _("%s: %s\n"), Prog, pam_strerror (pamh, ret));
}
int ret;
ret = pam_authenticate (pamh, 0);
if (PAM_SUCCESS != ret) {
- SYSLOG (((pw->pw_uid != 0)? LOG_NOTICE : LOG_WARN, "pam_authenticate: %s",
- pam_strerror (pamh, ret)));
+ SYSLOG(pw->pw_uid ? LOG_NOTICE : LOG_WARN, "pam_authenticate: %s",
+ pam_strerror(pamh, ret));
fprintf (stderr, _("%s: %s\n"), Prog, pam_strerror (pamh, ret));
(void) pam_end (pamh, ret);
su_failure (caller_tty, 0 == pw->pw_uid);
} else if (PAM_NEW_AUTHTOK_REQD == ret) {
ret = pam_chauthtok (pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
if (PAM_SUCCESS != ret) {
- SYSLOG ((LOG_ERR, "pam_chauthtok: %s",
- pam_strerror (pamh, ret)));
+ SYSLOG(LOG_ERR, "pam_chauthtok: %s",
+ pam_strerror(pamh, ret));
fprintf (stderr,
_("%s: %s\n"),
Prog, pam_strerror (pamh, ret));
su_failure (caller_tty, 0 == pw->pw_uid);
}
} else {
- SYSLOG ((LOG_ERR, "pam_acct_mgmt: %s",
- pam_strerror (pamh, ret)));
+ SYSLOG(LOG_ERR, "pam_acct_mgmt: %s", pam_strerror(pamh, ret));
fprintf (stderr,
_("%s: %s\n"),
Prog, pam_strerror (pamh, ret));
* character.
*/
if (pw_auth(password, name) != 0) {
- SYSLOG (((pw->pw_uid != 0)? LOG_NOTICE : LOG_WARN,
- "Authentication failed for %s", name));
+ SYSLOG(pw->pw_uid ? LOG_NOTICE : LOG_WARN,
+ "Authentication failed for %s", name);
fprintf(stderr, _("%s: Authentication failure\n"), Prog);
su_failure (caller_tty, 0 == pw->pw_uid);
}
* the account.
*/
if (!isttytime (name, "SU", time (NULL))) {
- SYSLOG (((0 != pw->pw_uid) ? LOG_WARN : LOG_CRIT,
- "SU by %s to restricted account %s",
- caller_name, name));
+ SYSLOG(pw->pw_uid ? LOG_WARN : LOG_CRIT,
+ "SU by %s to restricted account %s", caller_name, name);
fprintf (stderr,
_("%s: You are not authorized to su at that time\n"),
Prog);
if (NULL == pw) {
(void) fprintf (stderr,
_("No passwd entry for user '%s'\n"), name);
- SYSLOG ((LOG_NOTICE, "No passwd entry for user '%s'", name));
+ SYSLOG(LOG_NOTICE, "No passwd entry for user '%s'", name);
su_failure (caller_tty, true);
}
/* PAM authentication can request a change of account */
ret = pam_get_item(pamh, PAM_USER, &item);
if (ret != PAM_SUCCESS) {
- SYSLOG((LOG_ERR, "pam_get_item: internal PAM error\n"));
+ SYSLOG(LOG_ERR, "pam_get_item: internal PAM error\n");
(void) fprintf (stderr,
"%s: Internal PAM error retrieving username\n",
Prog);
}
tmp_name = item;
if (!streq(name, tmp_name)) {
- SYSLOG ((LOG_INFO,
- "Change user from '%s' to '%s' as requested by PAM",
- name, tmp_name));
+ SYSLOG(LOG_INFO,
+ "Change user from '%s' to '%s' as requested by PAM",
+ name, tmp_name);
if (strtcpy_a(name, tmp_name) == -1) {
fprintf (stderr, _("Overlong user name '%s'\n"),
tmp_name);
- SYSLOG ((LOG_NOTICE, "Overlong user name '%s'",
- tmp_name));
+ SYSLOG(LOG_NOTICE, "Overlong user name '%s'", tmp_name);
su_failure (caller_tty, true);
}
pw = xgetpwnam (name);
(void) fprintf (stderr,
_("No passwd entry for user '%s'\n"),
name);
- SYSLOG ((LOG_NOTICE,
- "No passwd entry for user '%s'", name));
+ SYSLOG(LOG_NOTICE, "No passwd entry for user '%s'", name);
su_failure (caller_tty, true);
}
}
fprintf (stderr,
_("%s: Cannot determine your user name.\n"),
Prog);
- SYSLOG ((LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
- (unsigned long) caller_uid));
+ SYSLOG(LOG_WARN, "Cannot determine the user name of the caller (UID %lu)",
+ (unsigned long) caller_uid);
su_failure (caller_tty, true); /* unknown target UID*/
}
strtcpy_a(caller_name, pw->pw_name);
} else {
root_pw = getpwuid (0);
if (NULL == root_pw) {
- SYSLOG ((LOG_CRIT, "There is no UID 0 user."));
+ SYSLOG(LOG_CRIT, "There is no UID 0 user.");
su_failure (caller_tty, true);
}
(void) strcpy (name, root_pw->pw_name);
#ifdef USE_PAM
ret = pam_start (Prog, name, &conv, &pamh);
if (PAM_SUCCESS != ret) {
- SYSLOG((LOG_ERR, "pam_start: error %d", ret));
+ SYSLOG(LOG_ERR, "pam_start: error %d", ret);
fprintf(stderr, _("%s: pam_start: error %d\n"), Prog, ret);
exit (1);
}
ret = pam_set_item (pamh, PAM_RUSER, caller_name);
}
if (PAM_SUCCESS != ret) {
- SYSLOG ((LOG_ERR, "pam_set_item: %s",
- pam_strerror (pamh, ret)));
+ SYSLOG(LOG_ERR, "pam_set_item: %s", pam_strerror(pamh, ret));
fprintf (stderr, _("%s: %s\n"), Prog, pam_strerror (pamh, ret));
pam_end (pamh, ret);
exit (1);
sulog (caller_tty, true, caller_name, name); /* save SU information */
if (getdef_bool ("SYSLOG_SU_ENAB")) {
- SYSLOG ((LOG_INFO, "+ %s %s:%s", caller_tty,
- (!streq(caller_name, "")) ? caller_name : "???",
- (!streq(name, "")) ? name : "???"));
+ SYSLOG(LOG_INFO, "+ %s %s:%s", caller_tty,
+ (!streq(caller_name, "")) ? caller_name : "???",
+ (!streq(name, "")) ? name : "???");
}
#ifdef USE_PAM
*/
ret = pam_setcred (pamh, PAM_ESTABLISH_CRED);
if (PAM_SUCCESS != ret) {
- SYSLOG ((LOG_ERR, "pam_setcred: %s", pam_strerror (pamh, ret)));
+ SYSLOG(LOG_ERR, "pam_setcred: %s", pam_strerror(pamh, ret));
fprintf (stderr, _("%s: %s\n"), Prog, pam_strerror (pamh, ret));
(void) pam_end (pamh, ret);
exit (1);
ret = pam_open_session (pamh, 0);
if (PAM_SUCCESS != ret) {
- SYSLOG ((LOG_ERR, "pam_open_session: %s",
- pam_strerror (pamh, ret)));
+ SYSLOG(LOG_ERR, "pam_open_session: %s", pam_strerror(pamh, ret));
fprintf (stderr, _("%s: %s\n"), Prog, pam_strerror (pamh, ret));
pam_setcred (pamh, PAM_DELETE_CRED);
(void) pam_end (pamh, ret);
if (ENOENT == err) {
return NOACTION;
}
- SYSLOG ((LOG_ERR,
- "could not open/read config file '%s': %s\n",
- SUAUTHFILE, strerror (err)));
+ SYSLOG(LOG_ERR, "could not open/read config file '%s': %s\n",
+ SUAUTHFILE, strerror(err));
return DENY;
}
lines++;
if (stpsep(temp, "\n") == NULL) {
- SYSLOG ((LOG_ERR,
- "%s, line %jd: line too long or missing newline",
- SUAUTHFILE, lines));
+ SYSLOG(LOG_ERR,
+ "%s, line %jd: line too long or missing newline",
+ SUAUTHFILE, lines);
continue;
}
from_users = strsep(&p, ":");
action = strsep(&p, ":");
if (action == NULL || p != NULL) {
- SYSLOG ((LOG_ERR,
- "%s, line %jd. Bad number of fields.\n",
- SUAUTHFILE, lines));
+ SYSLOG(LOG_ERR, "%s, line %jd. Bad number of fields.\n",
+ SUAUTHFILE, lines);
continue;
}
if (!applies (actual_id, from_users))
continue;
if (streq(action, "DENY")) {
- SYSLOG ((su_to_root ? LOG_WARN : LOG_NOTICE,
- "DENIED su from '%s' to '%s' (%s)\n",
- actual_id, wanted_id, SUAUTHFILE));
+ SYSLOG(su_to_root ? LOG_WARN : LOG_NOTICE,
+ "DENIED su from '%s' to '%s' (%s)\n",
+ actual_id, wanted_id, SUAUTHFILE);
fputs (_("Access to su to that account DENIED.\n"),
stderr);
fclose (authfile_fd);
return DENY;
} else if (streq(action, "NOPASS")) {
- SYSLOG ((su_to_root ? LOG_NOTICE : LOG_INFO,
- "NO password asked for su from '%s' to '%s' (%s)\n",
- actual_id, wanted_id, SUAUTHFILE));
+ SYSLOG(su_to_root ? LOG_NOTICE : LOG_INFO,
+ "NO password asked for su from '%s' to '%s' (%s)\n",
+ actual_id, wanted_id, SUAUTHFILE);
fputs (_("Password authentication bypassed.\n"),stderr);
fclose (authfile_fd);
return NOPWORD;
} else if (streq(action, "OWNPASS")) {
- SYSLOG ((su_to_root ? LOG_NOTICE : LOG_INFO,
- "su from '%s' to '%s': asking for user's own password (%s)\n",
- actual_id, wanted_id, SUAUTHFILE));
+ SYSLOG(su_to_root ? LOG_NOTICE : LOG_INFO,
+ "su from '%s' to '%s': asking for user's own password (%s)\n",
+ actual_id, wanted_id, SUAUTHFILE);
fputs (_("Please enter your OWN password as authentication.\n"),
stderr);
fclose (authfile_fd);
return OWNPWORD;
} else {
- SYSLOG ((LOG_ERR,
- "%s, line %jd: unrecognized action!\n",
- SUAUTHFILE, lines));
+ SYSLOG(LOG_ERR, "%s, line %jd: unrecognized action!\n",
+ SUAUTHFILE, lines);
}
}
fclose (authfile_fd);
if (streq(tok, "ALL")) {
if (state != 0) {
- SYSLOG ((LOG_ERR,
- "%s, line %jd: ALL in bad place\n",
- SUAUTHFILE, lines));
+ SYSLOG(LOG_ERR, "%s, line %jd: ALL in bad place\n",
+ SUAUTHFILE, lines);
return 0;
}
state = 1;
} else if (streq(tok, "EXCEPT")) {
if (state != 1) {
- SYSLOG ((LOG_ERR,
- "%s, line %jd: EXCEPT in bas place\n",
- SUAUTHFILE, lines));
+ SYSLOG(LOG_ERR, "%s, line %jd: EXCEPT in bas place\n",
+ SUAUTHFILE, lines);
return 0;
}
state = 2;
} else if (streq(tok, "GROUP")) {
if ((state != 0) && (state != 2)) {
- SYSLOG ((LOG_ERR,
- "%s, line %jd: GROUP in bad place\n",
- SUAUTHFILE, lines));
+ SYSLOG(LOG_ERR, "%s, line %jd: GROUP in bad place\n",
+ SUAUTHFILE, lines);
return 0;
}
state = (state == 0) ? 3 : 4;
return 1;
break;
case 1: /* An all */
- SYSLOG ((LOG_ERR,
- "%s, line %jd: expect another token after ALL\n",
- SUAUTHFILE, lines));
+ SYSLOG(LOG_ERR,
+ "%s, line %jd: expect another token after ALL\n",
+ SUAUTHFILE, lines);
return 0;
case 2: /* All except */
if (streq(tok, single))
fprintf(stderr,
_("%s: %s was created, but could not be removed\n"),
Prog, prefix_user_home);
- SYSLOG((LOG_ERR, "failed to remove %s", prefix_user_home));
+ SYSLOG(LOG_ERR, "failed to remove %s", prefix_user_home);
}
if (spw_locked && spw_unlock(process_selinux) == 0) {
fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname());
- SYSLOG((LOG_ERR, "failed to unlock %s", spw_dbname()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
if (pw_locked && pw_unlock(process_selinux) == 0) {
fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname());
- SYSLOG((LOG_ERR, "failed to unlock %s", pw_dbname()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
if (gr_locked && gr_unlock(process_selinux) == 0) {
fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname());
- SYSLOG((LOG_ERR, "failed to unlock %s", gr_dbname()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
#ifdef SHADOWGRP
if (sgr_locked && sgr_unlock(process_selinux) == 0) {
fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname());
- SYSLOG((LOG_ERR, "failed to unlock %s", sgr_dbname()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
#endif
#ifdef ENABLE_SUBIDS
if (sub_uid_locked && sub_uid_unlock(process_selinux) == 0) {
fprintf(stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname());
- SYSLOG((LOG_ERR, "failed to unlock %s", sub_uid_dbname()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_uid_dbname());
/* continue */
}
if (sub_gid_locked && sub_gid_unlock(process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_gid_dbname());
/* continue */
}
#endif /* ENABLE_SUBIDS */
"add-user",
user_name, AUDIT_NO_ID, SHADOW_AUDIT_FAILURE);
#endif
- SYSLOG((LOG_INFO, "failed adding user '%s', exit code: %d", user_name, code));
+ SYSLOG(LOG_INFO, "failed adding user '%s', exit code: %d", user_name, code);
exit(code);
}
NULL, AUDIT_NO_ID,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
+ SYSLOG(LOG_INFO,
"useradd defaults: GROUP=%u, HOME=%s, SHELL=%s, INACTIVE=%ld, "
"EXPIRE=%s, SKEL=%s, CREATE_MAIL_SPOOL=%s, LOG_INIT=%s",
(unsigned int) def_group, def_home, def_shell,
def_inactive, def_expire, def_template,
- def_create_mail_spool, def_log_init));
+ def_create_mail_spool, def_log_init);
ret = 0;
err_free_def:
fprintf (stderr,
_("%s: Out of memory. Cannot update %s.\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to prepare the new %s entry '%s'", gr_dbname (), user_name));
+ SYSLOG(LOG_ERR, "failed to prepare the new %s entry '%s'", gr_dbname(), user_name);
fail_exit (E_GRP_UPDATE, process_selinux); /* XXX */
}
fprintf (stderr,
_("%s: failed to prepare the new %s entry '%s'\n"),
Prog, gr_dbname (), ngrp->gr_name);
- SYSLOG ((LOG_ERR, "failed to prepare the new %s entry '%s'", gr_dbname (), user_name));
+ SYSLOG(LOG_ERR, "failed to prepare the new %s entry '%s'", gr_dbname(), user_name);
fail_exit (E_GRP_UPDATE, process_selinux);
}
#ifdef WITH_AUDIT
user_name, AUDIT_NO_ID, "grp", ngrp->gr_name,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "add '%s' to group '%s'",
- user_name, ngrp->gr_name));
+ SYSLOG(LOG_INFO, "add '%s' to group '%s'", user_name, ngrp->gr_name);
}
#ifdef SHADOWGRP
fprintf (stderr,
_("%s: Out of memory. Cannot update %s.\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to prepare the new %s entry '%s'", sgr_dbname (), user_name));
+ SYSLOG(LOG_ERR, "failed to prepare the new %s entry '%s'", sgr_dbname(), user_name);
fail_exit (E_GRP_UPDATE, process_selinux); /* XXX */
}
fprintf (stderr,
_("%s: failed to prepare the new %s entry '%s'\n"),
Prog, sgr_dbname (), nsgrp->sg_namp);
- SYSLOG ((LOG_ERR, "failed to prepare the new %s entry '%s'", sgr_dbname (), user_name));
+ SYSLOG(LOG_ERR, "failed to prepare the new %s entry '%s'", sgr_dbname(), user_name);
fail_exit (E_GRP_UPDATE, process_selinux);
}
user_name, AUDIT_NO_ID, "grp", nsgrp->sg_namp,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "add '%s' to shadow group '%s'",
- user_name, nsgrp->sg_namp));
+ SYSLOG(LOG_INFO, "add '%s' to shadow group '%s'",
+ user_name, nsgrp->sg_namp);
}
#endif /* SHADOWGRP */
}
if (pw_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (E_PW_UPDATE, process_selinux);
}
if (is_shadow_pwd && (spw_close (process_selinux) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", spw_dbname());
fail_exit (E_PW_UPDATE, process_selinux);
}
if (is_sub_uid && (sub_uid_close (process_selinux) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sub_uid_dbname());
fail_exit (E_SUB_UID_UPDATE, process_selinux);
}
if (is_sub_gid && (sub_gid_close (process_selinux) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sub_gid_dbname());
fail_exit (E_SUB_GID_UPDATE, process_selinux);
}
#endif /* ENABLE_SUBIDS */
if (is_shadow_pwd) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER,
"unlocking-shadow-file",
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER,
"unlocking-passwd-file",
if (is_sub_uid) {
if (sub_uid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_uid_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER,
"unlocking-subordinate-user-file",
if (is_sub_gid) {
if (sub_gid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_gid_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER,
"unlocking-subordinate-group-file",
fprintf(stderr,
_("%s: failure while writing changes to %s\n"),
Prog, gr_dbname());
- SYSLOG((LOG_ERR, "failure while writing changes to %s", gr_dbname()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", gr_dbname());
fail_exit(E_GRP_UPDATE, process_selinux);
}
#ifdef SHADOWGRP
fprintf(stderr,
_("%s: failure while writing changes to %s\n"),
Prog, sgr_dbname());
- SYSLOG((LOG_ERR, "failure while writing changes to %s", sgr_dbname()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sgr_dbname());
fail_exit(E_GRP_UPDATE, process_selinux);
}
#endif /* SHADOWGRP */
{
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER,
"unlocking-group-file",
if (is_shadow_grp) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_USER,
"unlocking-gshadow-file",
fail_exit (E_GRP_UPDATE, process_selinux);
}
#endif /* SHADOWGRP */
- SYSLOG ((LOG_INFO, "new group: name=%s, GID=%u", user_name, user_gid));
+ SYSLOG(LOG_INFO, "new group: name=%s, GID=%u", user_name, user_gid);
#ifdef WITH_AUDIT
audit_logger (AUDIT_ADD_GROUP,
"add-group",
fprintf (stderr,
_("%s: failed to open the faillog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerrno());
- SYSLOG ((LOG_WARN, "failed to open the faillog file for UID %lu", (unsigned long) uid));
+ SYSLOG(LOG_WARN, "failed to open the faillog file for UID %lu", (unsigned long) uid);
return;
}
if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid)
fprintf (stderr,
_("%s: failed to reset the faillog entry of UID %lu: %s\n"),
Prog, (unsigned long) uid, strerrno());
- SYSLOG ((LOG_WARN, "failed to reset the faillog entry of UID %lu", (unsigned long) uid));
+ SYSLOG(LOG_WARN, "failed to reset the faillog entry of UID %lu", (unsigned long) uid);
}
if (close (fd) != 0 && errno != EINTR) {
fprintf (stderr,
_("%s: failed to close the faillog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerrno());
- SYSLOG ((LOG_WARN, "failed to close the faillog file for UID %lu", (unsigned long) uid));
+ SYSLOG(LOG_WARN, "failed to close the faillog file for UID %lu", (unsigned long) uid);
}
}
fprintf (stderr,
_("%s: failed to open the lastlog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerrno());
- SYSLOG ((LOG_WARN, "failed to open the lastlog file for UID %lu", (unsigned long) uid));
+ SYSLOG(LOG_WARN, "failed to open the lastlog file for UID %lu", (unsigned long) uid);
return;
}
if ( (lseek (fd, offset_uid, SEEK_SET) != offset_uid)
fprintf (stderr,
_("%s: failed to reset the lastlog entry of UID %lu: %s\n"),
Prog, (unsigned long) uid, strerrno());
- SYSLOG ((LOG_WARN, "failed to reset the lastlog entry of UID %lu", (unsigned long) uid));
+ SYSLOG(LOG_WARN, "failed to reset the lastlog entry of UID %lu", (unsigned long) uid);
/* continue */
}
if (close (fd) != 0 && errno != EINTR) {
fprintf (stderr,
_("%s: failed to close the lastlog file for UID %lu: %s\n"),
Prog, (unsigned long) uid, strerrno());
- SYSLOG ((LOG_WARN, "failed to close the lastlog file for UID %lu", (unsigned long) uid));
+ SYSLOG(LOG_WARN, "failed to close the lastlog file for UID %lu", (unsigned long) uid);
/* continue */
}
}
fprintf (stderr,
_("%s: failed to reset the tallylog entry of user \"%s\"\n"),
Prog, user_name);
- SYSLOG ((LOG_WARN, "failed to reset the tallylog entry of user \"%s\"", user_name));
+ SYSLOG(LOG_WARN, "failed to reset the tallylog entry of user \"%s\"", user_name);
}
return;
* happens so we know what we were trying to accomplish.
*/
tty=ttyname (STDIN_FILENO);
- SYSLOG ((LOG_INFO,
+ SYSLOG(LOG_INFO,
"new user: name=%s, UID=%u, GID=%u, home=%s, shell=%s, from=%s",
user_name, (unsigned int) user_id,
(unsigned int) user_gid, user_home, user_shell,
- tty ? tty : "none" ));
+ tty ? tty : "none");
/*
* Initialize faillog and lastlog entries for this UID in case
user_name, user_id, "grp", ngrp->gr_name,
SHADOW_AUDIT_SUCCESS);
#endif /* WITH_AUDIT */
- SYSLOG ((LOG_INFO, "delete '%s' from group '%s'\n",
- user_name, ngrp->gr_name));
+ SYSLOG(LOG_INFO, "delete '%s' from group '%s'\n",
+ user_name, ngrp->gr_name);
}
if (getdef_bool ("USERGROUPS_ENAB")) {
user_name, user_id, nsgrp->sg_namp, "grp",
SHADOW_AUDIT_SUCCESS);
#endif /* WITH_AUDIT */
- SYSLOG ((LOG_INFO, "delete '%s' from shadow group '%s'\n",
- user_name, nsgrp->sg_namp));
+ SYSLOG(LOG_INFO, "delete '%s' from shadow group '%s'\n",
+ user_name, nsgrp->sg_namp);
}
#endif /* SHADOWGRP */
}
user_name, AUDIT_NO_ID, "grp", user_name,
SHADOW_AUDIT_SUCCESS);
#endif /* WITH_AUDIT */
- SYSLOG ((LOG_INFO,
- "removed group '%s' owned by '%s'\n",
- user_name, user_name));
+ SYSLOG(LOG_INFO, "removed group '%s' owned by '%s'\n",
+ user_name, user_name);
#ifdef SHADOWGRP
if (sgr_locate (user_name) != NULL) {
user_name, AUDIT_NO_ID, "grp", user_name,
SHADOW_AUDIT_SUCCESS);
#endif /* WITH_AUDIT */
- SYSLOG ((LOG_INFO,
- "removed shadow group '%s' owned by '%s'\n",
- user_name, user_name));
+ SYSLOG(LOG_INFO, "removed shadow group '%s' owned by '%s'\n",
+ user_name, user_name);
}
#endif /* SHADOWGRP */
if (pw_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (E_PW_UPDATE, process_selinux);
}
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
pw_locked = false;
if (spw_close (process_selinux) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", spw_dbname());
fail_exit (E_PW_UPDATE, process_selinux);
}
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
spw_locked = false;
if (gr_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", gr_dbname());
fail_exit (E_GRP_UPDATE, process_selinux);
}
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
gr_locked = false;
if (sgr_close (process_selinux) == 0) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sgr_dbname());
fail_exit (E_GRP_UPDATE, process_selinux);
}
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
sgr_locked = false;
if (is_sub_uid) {
if (sub_uid_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sub_uid_dbname());
fail_exit (E_SUB_UID_UPDATE, process_selinux);
}
if (sub_uid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_uid_dbname());
/* continue */
}
sub_uid_locked = false;
if (is_sub_gid) {
if (sub_gid_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sub_gid_dbname());
fail_exit (E_SUB_GID_UPDATE, process_selinux);
}
if (sub_gid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_gid_dbname());
/* continue */
}
sub_gid_locked = false;
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
if (spw_locked) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
if (sub_uid_locked) {
if (sub_uid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_uid_dbname());
/* continue */
}
}
if (sub_gid_locked) {
if (sub_gid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_gid_dbname());
/* continue */
}
}
"delete-user",
user_name, user_id, SHADOW_AUDIT_SUCCESS);
#endif /* WITH_AUDIT */
- SYSLOG ((LOG_INFO, "delete user '%s'\n", user_name));
+ SYSLOG(LOG_INFO, "delete user '%s'\n", user_name);
}
/*
fprintf (stderr,
_("%s: warning: can't remove %s: %s\n"),
Prog, mailfile, strerrno());
- SYSLOG((LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno()));
+ SYSLOG(LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno());
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_USER,
"delete-mail-file",
fprintf (stderr,
_("%s: warning: can't remove %s: %s\n"),
Prog, mailfile, strerrno());
- SYSLOG((LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno()));
+ SYSLOG(LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno());
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_USER,
"delete-mail-file",
fprintf (stderr,
_("%s: %s not owned by %s, not removing\n"),
Prog, mailfile, user_name);
- SYSLOG((LOG_ERR, "%s not owned by %s, not removed", mailfile, user_name));
+ SYSLOG(LOG_ERR, "%s not owned by %s, not removed", mailfile, user_name);
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_USER,
"delete-mail-file",
fprintf (stderr,
_("%s: warning: can't remove %s: %s\n"),
Prog, mailfile, strerrno());
- SYSLOG((LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno()));
+ SYSLOG(LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno());
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_USER,
"delete-mail-file",
audit_logger (AUDIT_USER_CHAUTHTOK,
"updating-passwd", user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO, "lock user '%s' password", user_newname));
+ SYSLOG(LOG_INFO, "lock user '%s' password", user_newname);
pw_pass = xaprintf("!%s", pw_pass);
} else if (Uflg && strprefix(pw_pass, "!")) {
if (pw_pass[1] == '\0') {
audit_logger (AUDIT_USER_CHAUTHTOK,
"updating-password", user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO, "unlock user '%s' password", user_newname));
+ SYSLOG(LOG_INFO, "unlock user '%s' password", user_newname);
memmove(pw_pass, pw_pass + 1, strlen(pw_pass));
} else if (pflg) {
#ifdef WITH_AUDIT
audit_logger (AUDIT_USER_CHAUTHTOK,
"updating-password", user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO, "change user '%s' password", user_newname));
+ SYSLOG(LOG_INFO, "change user '%s' password", user_newname);
pw_pass = xstrdup (user_pass);
}
return pw_pass;
audit_logger (AUDIT_USER_MGMT,
"changing-name", user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO,
- "change user name '%s' to '%s'",
- pwent->pw_name, user_newname));
+ SYSLOG(LOG_INFO, "change user name '%s' to '%s'",
+ pwent->pw_name, user_newname);
pwent->pw_name = xstrdup (user_newname);
}
/* Update the password in passwd if there is no shadow file or if
audit_logger (AUDIT_USER_MGMT,
"changing-uid", user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO,
- "change user '%s' UID from '%d' to '%d'",
- pwent->pw_name, pwent->pw_uid, user_newid));
+ SYSLOG(LOG_INFO, "change user '%s' UID from '%d' to '%d'",
+ pwent->pw_name, pwent->pw_uid, user_newid);
pwent->pw_uid = user_newid;
}
if (gflg) {
"changing-primary-group",
user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO,
- "change user '%s' GID from '%d' to '%d'",
- pwent->pw_name, pwent->pw_gid, user_newgid));
+ SYSLOG(LOG_INFO, "change user '%s' GID from '%d' to '%d'",
+ pwent->pw_name, pwent->pw_gid, user_newgid);
pwent->pw_gid = user_newgid;
}
if (cflg) {
"changing-home-dir",
user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO,
- "change user '%s' home from '%s' to '%s'",
- pwent->pw_name, pwent->pw_dir, user_newhome));
+ SYSLOG(LOG_INFO, "change user '%s' home from '%s' to '%s'",
+ pwent->pw_name, pwent->pw_dir, user_newhome);
if (!streq(user_newhome, ""))
stpcpy(stprspn(user_newhome + 1, "/"), "");
"changing-shell",
user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO,
- "change user '%s' shell from '%s' to '%s'",
- pwent->pw_name, pwent->pw_shell, user_newshell));
+ SYSLOG(LOG_INFO, "change user '%s' shell from '%s' to '%s'",
+ pwent->pw_name, pwent->pw_shell, user_newshell);
pwent->pw_shell = user_newshell;
}
}
"changing-inactive-days",
user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO,
- "change user '%s' inactive from '%ld' to '%ld'",
- spent->sp_namp, spent->sp_inact, user_newinactive));
+ SYSLOG(LOG_INFO, "change user '%s' inactive from '%ld' to '%ld'",
+ spent->sp_namp, spent->sp_inact, user_newinactive);
spent->sp_inact = user_newinactive;
}
if (eflg) {
"changing-expiration-date",
user_newname, user_newid, 1);
#endif
- SYSLOG ((LOG_INFO,
- "change user '%s' expiration from '%s' to '%s'",
- spent->sp_namp, old_exp, new_exp));
+ SYSLOG(LOG_INFO, "change user '%s' expiration from '%s' to '%s'",
+ spent->sp_namp, old_exp, new_exp);
spent->sp_expire = user_newexpire;
}
if (gr_locked) {
if (gr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, gr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
if (sgr_locked) {
if (sgr_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
if (spw_locked) {
if (spw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
if (pw_locked) {
if (pw_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
}
if (sub_uid_locked) {
if (sub_uid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_uid_dbname());
/* continue */
}
}
if (sub_gid_locked) {
if (sub_gid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_gid_dbname());
/* continue */
}
}
ngrp->gr_name,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "change '%s' to '%s' in group '%s'",
- user_name, user_newname,
- ngrp->gr_name));
+ SYSLOG(LOG_INFO,
+ "change '%s' to '%s' in group '%s'",
+ user_name, user_newname,
+ ngrp->gr_name);
}
} else {
/* User was a member but is no more a
ngrp->gr_name,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "delete '%s' from group '%s'",
- user_name, ngrp->gr_name));
+ SYSLOG(LOG_INFO, "delete '%s' from group '%s'",
+ user_name, ngrp->gr_name);
}
} else if (is_member) {
/* User was not a member but is now a member this
ngrp->gr_name,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO, "add '%s' to group '%s'",
- user_newname, ngrp->gr_name));
+ SYSLOG(LOG_INFO, "add '%s' to group '%s'",
+ user_newname, ngrp->gr_name);
}
if (!changed)
goto free_ngrp;
fprintf (stderr,
_("%s: failed to prepare the new %s entry '%s'\n"),
Prog, gr_dbname (), ngrp->gr_name);
- SYSLOG ((LOG_WARN, "failed to prepare the new %s entry '%s'", gr_dbname (), ngrp->gr_name));
+ SYSLOG(LOG_WARN, "failed to prepare the new %s entry '%s'", gr_dbname(), ngrp->gr_name);
fail_exit (E_GRP_UPDATE, process_selinux);
}
user_name, AUDIT_NO_ID, "grp", nsgrp->sg_namp,
SHADOW_AUDIT_SUCCESS);
#endif
- SYSLOG ((LOG_INFO,
- "change admin '%s' to '%s' in shadow group '%s'",
- user_name, user_newname, nsgrp->sg_namp));
+ SYSLOG(LOG_INFO, "change admin '%s' to '%s' in shadow group '%s'",
+ user_name, user_newname, nsgrp->sg_namp);
}
if (was_member) {
user_name, AUDIT_NO_ID, "grp",
nsgrp->sg_namp, 1);
#endif
- SYSLOG ((LOG_INFO,
- "change '%s' to '%s' in shadow group '%s'",
- user_name, user_newname,
- nsgrp->sg_namp));
+ SYSLOG(LOG_INFO,
+ "change '%s' to '%s' in shadow group '%s'",
+ user_name, user_newname, nsgrp->sg_namp);
}
} else {
/* User was a member but is no more a
user_name, AUDIT_NO_ID, "grp",
nsgrp->sg_namp, 1);
#endif
- SYSLOG ((LOG_INFO,
- "delete '%s' from shadow group '%s'",
- user_name, nsgrp->sg_namp));
+ SYSLOG(LOG_INFO, "delete '%s' from shadow group '%s'",
+ user_name, nsgrp->sg_namp);
}
} else if (is_member) {
/* User was not a member but is now a member this
user_newname, AUDIT_NO_ID, "grp",
nsgrp->sg_namp, 1);
#endif
- SYSLOG ((LOG_INFO, "add '%s' to shadow group '%s'",
- user_newname, nsgrp->sg_namp));
+ SYSLOG(LOG_INFO, "add '%s' to shadow group '%s'",
+ user_newname, nsgrp->sg_namp);
}
if (!changed)
goto free_nsgrp;
fprintf (stderr,
_("%s: failed to prepare the new %s entry '%s'\n"),
Prog, sgr_dbname (), nsgrp->sg_namp);
- SYSLOG ((LOG_WARN, "failed to prepare the new %s entry '%s'",
- sgr_dbname (), nsgrp->sg_namp));
+ SYSLOG(LOG_WARN, "failed to prepare the new %s entry '%s'",
+ sgr_dbname(), nsgrp->sg_namp);
fail_exit (E_GRP_UPDATE, process_selinux);
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", pw_dbname());
fail_exit (E_PW_UPDATE, process_selinux);
}
if (is_shadow_pwd && (spw_close (process_selinux) == 0)) {
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- spw_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", spw_dbname());
fail_exit (E_PW_UPDATE, process_selinux);
}
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- gr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s",
+ gr_dbname());
fail_exit (E_GRP_UPDATE, process_selinux);
}
#ifdef SHADOWGRP
fprintf (stderr,
_("%s: failure while writing changes to %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR,
- "failure while writing changes to %s",
- sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s",
+ sgr_dbname());
fail_exit (E_GRP_UPDATE, process_selinux);
}
}
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, sgr_dbname ());
- SYSLOG ((LOG_ERR,
- "failed to unlock %s",
- sgr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sgr_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, gr_dbname ());
- SYSLOG ((LOG_ERR,
- "failed to unlock %s",
- gr_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", gr_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, spw_dbname ());
- SYSLOG ((LOG_ERR,
- "failed to unlock %s",
- spw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", spw_dbname());
/* continue */
}
}
fprintf (stderr,
_("%s: failed to unlock %s\n"),
Prog, pw_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", pw_dbname());
/* continue */
}
if (vflg || Vflg) {
if (sub_uid_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sub_uid_dbname());
fail_exit (E_SUB_UID_UPDATE, process_selinux);
}
if (sub_uid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_uid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_uid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_uid_dbname());
/* continue */
}
sub_uid_locked = false;
if (wflg || Wflg) {
if (sub_gid_close (process_selinux) == 0) {
fprintf (stderr, _("%s: failure while writing changes to %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failure while writing changes to %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failure while writing changes to %s", sub_gid_dbname());
fail_exit (E_SUB_GID_UPDATE, process_selinux);
}
if (sub_gid_unlock (process_selinux) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, sub_gid_dbname ());
- SYSLOG ((LOG_ERR, "failed to unlock %s", sub_gid_dbname ()));
+ SYSLOG(LOG_ERR, "failed to unlock %s", sub_gid_dbname());
/* continue */
}
sub_gid_locked = false;
if (filelocked) {
if ((*unlock) (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, fileeditname);
- SYSLOG ((LOG_ERR, "failed to unlock %s", fileeditname));
+ SYSLOG(LOG_ERR, "failed to unlock %s", fileeditname);
/* continue */
}
}
if ((*file_unlock) (true) == 0) {
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, fileeditname);
- SYSLOG ((LOG_ERR, "failed to unlock %s", fileeditname));
+ SYSLOG(LOG_ERR, "failed to unlock %s", fileeditname);
/* continue */
}
- SYSLOG ((LOG_INFO, "file %s edited", fileeditname));
+ SYSLOG(LOG_INFO, "file %s edited", fileeditname);
}
int main (int argc, char **argv)