status = TS_MISSING;
}
} else if (errno != ENOENT) {
- log_error(NO_EXIT|USE_ERRNO, _("can't stat %s"), dirparent);
+ log_error(NO_EXIT|USE_ERRNO, _("unable to stat %s"), dirparent);
} else {
/* No dirparent, try to make one. */
if (ISSET(flags, TS_MAKE_DIRS)) {
if (mkdir(dirparent, S_IRWXU))
- log_error(NO_EXIT|USE_ERRNO, _("can't mkdir %s"),
+ log_error(NO_EXIT|USE_ERRNO, _("unable to mkdir %s"),
dirparent);
else
status = TS_MISSING;
status = TS_OLD; /* do date check later */
}
} else if (errno != ENOENT) {
- log_error(NO_EXIT|USE_ERRNO, _("can't stat %s"), timestampdir);
+ log_error(NO_EXIT|USE_ERRNO, _("unable to stat %s"), timestampdir);
} else
status = TS_MISSING;
if (status == TS_MISSING && timestampfile && ISSET(flags, TS_MAKE_DIRS)) {
if (mkdir(timestampdir, S_IRWXU) == -1) {
status = TS_ERROR;
- log_error(NO_EXIT|USE_ERRNO, _("can't mkdir %s"), timestampdir);
+ log_error(NO_EXIT|USE_ERRNO, _("unable to mkdir %s"), timestampdir);
}
}
}
}
} else if (errno != ENOENT) {
- log_error(NO_EXIT|USE_ERRNO, _("can't stat %s"), timestampfile);
+ log_error(NO_EXIT|USE_ERRNO, _("unable to stat %s"), timestampfile);
status = TS_ERROR;
}
}
else
status = rmdir(timestampdir);
if (status == -1 && errno != ENOENT) {
- log_error(NO_EXIT, _("can't remove %s (%s), will reset to Epoch"),
+ log_error(NO_EXIT,
+ _("unable to remove %s (%s), will reset to the epoch"),
path, strerror(errno));
remove = FALSE;
}
} else {
timevalclear(&tv);
if (touch(-1, path, &tv) == -1 && errno != ENOENT)
- error(1, _("can't reset %s to Epoch"), path);
+ error(1, _("unable to reset %s to the epoch"), path);
}
}
switch (fork()) {
case -1:
- error(1, "can't fork");
+ error(1, "unable to fork");
case 0:
/* tracer, fork again to completely disassociate */
switch (fork()) {
case -1:
- warning("can't fork");
+ warning("unable to fork");
kill(pid, SIGKILL);
_exit(1);
case 0:
*/
if (sudo_goodpath(user_cmnd, user_stat) == NULL) {
if (rval != -1 && ioctl(fd, STRIOCRESCWD, 0) != 0)
- warning("can't restore cwd");
+ warning("unable to restore cwd");
*policyp = SYSTR_POLICY_NEVER;
*errorp = EACCES;
return 0;
}
if (rval != -1 && ioctl(fd, STRIOCRESCWD, 0) != 0)
- warning("can't restore cwd");
+ warning("unable to restore cwd");
/* Check sudoers and log the result. */
init_defaults();
aix_setauthdb(pw->pw_name);
# endif
if (initgroups(pw->pw_name, pw->pw_gid) < 0)
- log_error(USE_ERRNO|MSG_ONLY, _("can't set runas group vector"));
+ log_error(USE_ERRNO|MSG_ONLY, _("unable to set runas group vector"));
# ifdef HAVE_GETGROUPS
if (runas_groups) {
efree(runas_groups);
if ((runas_ngroups = getgroups(0, NULL)) > 0) {
runas_groups = emalloc2(runas_ngroups, sizeof(GETGROUPS_T));
if (getgroups(runas_ngroups, runas_groups) < 0)
- log_error(USE_ERRNO|MSG_ONLY, _("can't get runas group vector"));
+ log_error(USE_ERRNO|MSG_ONLY, _("unable to get runas group vector"));
}
# ifdef HAVE_SETAUTHDB
aix_restoreauthdb();
# endif
} else {
if (setgroups(runas_ngroups, runas_groups) < 0)
- log_error(USE_ERRNO|MSG_ONLY, _("can't set runas group vector"));
+ log_error(USE_ERRNO|MSG_ONLY, _("unable to set runas group vector"));
# endif /* HAVE_GETGROUPS */
}
}
aix_setauthdb(pw->pw_name);
# endif
if (initgroups(pw->pw_name, pw->pw_gid) == -1)
- log_error(USE_ERRNO|MSG_ONLY, _("can't reset group vector"));
+ log_error(USE_ERRNO|MSG_ONLY, _("unable to reset group vector"));
efree(user_groups);
user_groups = NULL;
if ((user_ngroups = getgroups(0, NULL)) > 0) {
user_groups = emalloc2(user_ngroups, sizeof(GETGROUPS_T));
if (getgroups(user_ngroups, user_groups) < 0)
- log_error(USE_ERRNO|MSG_ONLY, _("can't get group vector"));
+ log_error(USE_ERRNO|MSG_ONLY, _("unable to get group vector"));
}
# ifdef HAVE_SETAUTHDB
aix_restoreauthdb();
set_perms(PERM_SUDOERS);
if (rootstat != 0 && stat_sudoers(sudoers, &statbuf) != 0)
- log_error(USE_ERRNO|NO_EXIT, _("can't stat %s"), sudoers);
+ log_error(USE_ERRNO|NO_EXIT, _("unable to stat %s"), sudoers);
else if (!S_ISREG(statbuf.st_mode))
log_error(NO_EXIT, _("%s is not a regular file"), sudoers);
else if ((statbuf.st_mode & 07577) != sudoers_mode)
log_error(NO_EXIT, _("%s is owned by gid %u, should be %u"), sudoers,
(unsigned int) statbuf.st_gid, (unsigned int) sudoers_gid);
else if ((fp = fopen(sudoers, "r")) == NULL)
- log_error(USE_ERRNO|NO_EXIT, _("can't open %s"), sudoers);
+ log_error(USE_ERRNO|NO_EXIT, _("unable to open %s"), sudoers);
else {
/*
* Make sure we can actually read sudoers so we can present the
* user with a reasonable error message (unlike the lexer).
*/
if (statbuf.st_size != 0 && fgetc(fp) == EOF) {
- log_error(USE_ERRNO|NO_EXIT, _("can't read %s"), sudoers);
+ log_error(USE_ERRNO|NO_EXIT, _("unable to read %s"), sudoers);
fclose(fp);
fp = NULL;
}
#else
if (stat(sp->path, &sb) == -1)
#endif
- error(1, _("can't stat %s"), sp->path);
+ error(1, _("unable to stat %s"), sp->path);
orig_size = sb.st_size;
mtim_get(&sb, &orig_mtim);
last = tq_last(&sudoerslist);
fp = fopen(sp->tpath, "r+");
if (fp == NULL)
- errorx(1, _("can't re-open temporary file (%s), %s unchanged."),
+ errorx(1, _("unable to re-open temporary file (%s), %s unchanged."),
sp->tpath, sp->path);
/* Clean slate for each parse */
break;
}
}
- if (sp == NULL)
- errorx(1, _("internal error, can't find %s in list!"), sudoers);
+ if (sp == NULL) {
+ errorx(1, _("internal error, unable to find %s in list!"),
+ sudoers);
+ }
}
/* If any new #include directives were added, edit them too. */
#else
if (stat(sp->path, &sb) == -1)
#endif
- error(1, _("can't stat %s"), sp->path);
+ error(1, _("unable to stat %s"), sp->path);
if (chown(sp->tpath, sb.st_uid, sb.st_gid) != 0) {
warning(_("unable to set (uid, gid) of %s to (%d, %d)"),
sp->tpath, sb.st_uid, sb.st_gid);
if (io_fds[SFD_USERTTY] != -1) {
if (!get_pty(&io_fds[SFD_MASTER], &io_fds[SFD_SLAVE],
slavename, sizeof(slavename), uid))
- error(1, _("can't allocate pty"));
+ error(1, _("unable to allocate pty"));
/* Add entry to utmp/utmpx? */
if (utmp_user != NULL)
utmp_login(tty, slavename, io_fds[SFD_SLAVE], utmp_user);
ud->groups = emalloc2(ud->ngroups, sizeof(GETGROUPS_T));
if (getgroups(ud->ngroups, ud->groups) < 0)
- error(1, _("can't get group vector"));
+ error(1, _("unable to get group vector"));
glsize = sizeof("groups=") - 1 + (ud->ngroups * (MAX_UID_T_LEN + 1));
gid_list = emalloc(glsize);
memcpy(gid_list, "groups=", sizeof("groups=") - 1);
* doesn't take an argument.
*/
if ((sfd = dup(STDIN_FILENO)) == -1)
- error(1, _("can't save stdin"));
+ error(1, _("unable to save stdin"));
if (dup2(ttyfd, STDIN_FILENO) == -1)
- error(1, _("can't dup2 stdin"));
+ error(1, _("unable to dup2 stdin"));
slot = ttyslot();
if (dup2(sfd, STDIN_FILENO) == -1)
- error(1, _("can't restore stdin"));
+ error(1, _("unable to restore stdin"));
close(sfd);
return slot;