#include "defines.h"
#include "getdef.h"
#include "io/fprintf.h"
+#include "io/syslog.h"
#include "prototypes.h"
#include "shadowlog.h"
int err = errno;
fprinte(log_get_logfd(), _("Unable to change owner or mode of tty stdin"));
- SYSLOG(LOG_WARN,
- "unable to change owner or mode of tty stdin for user `%s': %s\n",
- info->pw_name, strerror(err));
+ SYSLOGE(LOG_WARN,
+ "unable to change owner or mode of tty stdin for user `%s'",
+ info->pw_name);
if (EROFS != err) {
closelog ();
exit (EXIT_FAILURE);
#include "defines.h"
#include "getdef.h"
#include "io/fgets/fgets.h"
+#include "io/syslog.h"
#include "prototypes.h"
#include "shadowlog.h"
#include "sizeof.h"
if (errno == ENOENT)
return;
- int err = errno;
- SYSLOG(LOG_CRIT, "cannot open login definitions %s [%s]",
- def_fname, strerror(err));
+ SYSLOGE(LOG_CRIT, "cannot open login definitions %s", def_fname);
exit (EXIT_FAILURE);
}
}
if (ferror (fp) != 0) {
- int err = errno;
- SYSLOG(LOG_CRIT, "cannot read login definitions %s [%s]",
- def_fname, strerror(err));
+ SYSLOGE(LOG_CRIT, "cannot read login definitions %s", def_fname);
exit (EXIT_FAILURE);
}
#include <selinux/label.h>
#include "io/fprintf.h"
+#include "io/syslog.h"
#include "prototypes.h"
#include "shadowlog.h"
#include "string/sprintf/aprintf.h"
-#include "string/strerrno.h"
static bool selinux_checked = false;
if (getprevcon_raw (&user_context_raw) != 0) {
fprinte(log_get_logfd(), _("%s: can not get previous SELinux process context"),
log_get_progname());
- SYSLOG(LOG_WARN,
- "can not get previous SELinux process context: %s",
- strerrno());
+ SYSLOGE(LOG_WARN, "can not get previous SELinux process context");
return (security_getenforce () != 0);
}
#include <stdio.h>
#include <grp.h>
#include <errno.h>
-#include "prototypes.h"
-#include "defines.h"
#include <pwd.h>
+
+#include "defines.h"
#include "getdef.h"
+#include "io/syslog.h"
+#include "prototypes.h"
+
/*
* setup_groups - set the group credentials
* file.
*/
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));
+ SYSLOGE(LOG_ERR, "bad group ID `%d' for user `%s'",
+ info->pw_gid, info->pw_name);
closelog ();
return -1;
}
* the group set from the /etc/group file.
*/
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));
+ SYSLOGE(LOG_ERR, "initgroups failed for user `%s'", info->pw_name);
closelog ();
return -1;
}
* Set the real UID to the UID value in the password file.
*/
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));
+ SYSLOGE(LOG_ERR, "bad user ID `%d' for user `%s'",
+ (int) info->pw_uid, info->pw_name);
closelog ();
return -1;
}
#include "getdef.h"
#include "groupio.h"
#include "io/fprintf.h"
+#include "io/syslog.h"
#include "nscd.h"
#include "sssd.h"
#include "prototypes.h"
#include "shadowlog.h"
#include "string/memset/memzero.h"
#include "string/strcmp/streq.h"
-#include "string/strerrno.h"
#include "string/strtok/stpsep.h"
/* And now open the databases */
if (gr_open (O_CREAT | O_RDWR) == 0) {
fprinte(stderr, _("%s: cannot open %s"), Prog, gr_dbname());
- SYSLOG(LOG_WARN, "cannot open %s: %s", gr_dbname(), strerrno());
+ SYSLOGE(LOG_WARN, "cannot open %s", gr_dbname());
fail_exit (E_GRP_UPDATE);
}
if (is_shadow_grp) {
if (sgr_open (O_CREAT | O_RDWR) == 0) {
fprinte(stderr, _("%s: cannot open %s"), Prog, sgr_dbname());
- SYSLOG(LOG_WARN, "cannot open %s: %s", sgr_dbname(), strerrno());
+ SYSLOGE(LOG_WARN, "cannot open %s", sgr_dbname());
fail_exit (E_GRP_UPDATE);
}
}
#include "defines.h"
#include "io/fgets/fgets.h"
+#include "io/syslog.h"
#include "prototypes.h"
#include "sizeof.h"
#include "string/strcmp/strcaseeq.h"
}
(void) fclose (fp);
} else if (errno != ENOENT) {
- int err = errno;
- SYSLOG(LOG_ERR, "cannot open %s: %s", TABLE, strerror(err));
+ SYSLOGE(LOG_ERR, "cannot open %s", TABLE);
}
return (!match || strprefix(line, "+"))?1:0;
}
#include "groupio.h"
#include "io/fgets/fgets.h"
#include "io/fprintf.h"
+#include "io/syslog.h"
#include "nscd.h"
#include "prototypes.h"
#include "pwio.h"
fprinte(stderr,
_("%s: can't find subordinate user range"),
Prog);
- SYSLOG(LOG_WARN, "can't find subordinate user range: %s\n",
- strerrno());
+ SYSLOGE(LOG_WARN, "can't find subordinate user range");
fail_exit (EXIT_FAILURE, process_selinux);
}
if (sub_uid_add(fields[0], sub_uid_start, sub_uid_count) == 0)
fprinte(stderr,
_("%s: can't find subordinate group range"),
Prog);
- SYSLOG(LOG_WARN, "can't find subordinate group range: %s\n",
- strerrno());
+ SYSLOGE(LOG_WARN, "can't find subordinate group range");
fail_exit (EXIT_FAILURE, process_selinux);
}
if (sub_gid_add(fields[0], sub_gid_start, sub_gid_count) == 0) {
#include "defines.h"
#include "io/fgets/fgets.h"
+#include "io/syslog.h"
#include "prototypes.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
if (ENOENT == err) {
return NOACTION;
}
- SYSLOG(LOG_ERR, "could not open/read config file '%s': %s\n",
- SUAUTHFILE, strerror(err));
+ SYSLOGE(LOG_ERR, "could not open/read config file '%s'", SUAUTHFILE);
return DENY;
}
#include "groupio.h"
#include "io/fgets/fgets.h"
#include "io/fprintf.h"
+#include "io/syslog.h"
#include "nscd.h"
#include "prototypes.h"
#include "pwauth.h"
fprinte(stderr,
_("%s: can't create subordinate user IDs"),
Prog);
- SYSLOG(LOG_WARN, "can't create subordinate user IDs: %s\n",
- strerrno());
+ SYSLOGE(LOG_WARN, "can't create subordinate user IDs");
fail_exit(E_SUB_UID_UPDATE, process_selinux);
}
}
fprinte(stderr,
_("%s: can't create subordinate group IDs"),
Prog);
- SYSLOG(LOG_WARN, "can't create subordinate group IDs: %s\n",
- strerrno());
+ SYSLOGE(LOG_WARN, "can't create subordinate group IDs");
fail_exit(E_SUB_GID_UPDATE, process_selinux);
}
}
#include "getdef.h"
#include "groupio.h"
#include "io/fprintf.h"
+#include "io/syslog.h"
#include "nscd.h"
#include "sssd.h"
#include "prototypes.h"
#include "string/strcmp/streq.h"
#include "string/strcmp/strprefix.h"
#include "string/strdup/strdup.h"
-#include "string/strerrno.h"
/*
return 0;
} else {
fprinte(stderr, _("%s: warning: can't remove %s"), Prog, mailfile);
- SYSLOG(LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno());
+ SYSLOGE(LOG_ERR, "Cannot remove %s", mailfile);
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_USER,
"delete-mail-file",
if (fflg) {
if (unlink (mailfile) != 0) {
fprinte(stderr, _("%s: warning: can't remove %s"), Prog, mailfile);
- SYSLOG(LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno());
+ SYSLOGE(LOG_ERR, "Cannot remove %s", mailfile);
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_USER,
"delete-mail-file",
}
if (unlink (mailfile) != 0) {
fprinte(stderr, _("%s: warning: can't remove %s"), Prog, mailfile);
- SYSLOG(LOG_ERR, "Cannot remove %s: %s", mailfile, strerrno());
+ SYSLOGE(LOG_ERR, "Cannot remove %s", mailfile);
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_USER,
"delete-mail-file",
#include "getdef.h"
#include "groupio.h"
#include "io/fprintf.h"
+#include "io/syslog.h"
#include "nscd.h"
#include "prototypes.h"
#include "pwauth.h"
fprinte(stderr,
_("%s: unable to find new subordinate uid range"),
Prog);
- SYSLOG(LOG_WARN, "unable to find new subordinate uid range: %s\n",
- strerrno());
+ SYSLOGE(LOG_WARN, "unable to find new subordinate uid range");
fail_exit (E_SUB_UID_UPDATE, process_selinux);
}
if (find_range (&add_sub_gids, user_id, find_new_sub_gids) == 0) {
fprinte(stderr,
_("%s: unable to find new subordinate gid range"),
Prog);
- SYSLOG(LOG_WARN, "unable to find new subordinate gid range: %s\n",
- strerrno());
+ SYSLOGE(LOG_WARN, "unable to find new subordinate gid range");
fail_exit (E_SUB_GID_UPDATE, process_selinux);
}
}