]> granicus.if.org Git - sudo/commitdiff
can't -> "unable to" in warning/error messages
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 18 May 2011 16:36:26 +0000 (12:36 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 18 May 2011 16:36:26 +0000 (12:36 -0400)
plugins/sudoers/check.c
plugins/sudoers/mon_systrace.c
plugins/sudoers/set_perms.c
plugins/sudoers/sudo_nss.c
plugins/sudoers/sudoers.c
plugins/sudoers/visudo.c
src/exec_pty.c
src/sudo.c
src/utmp.c

index cc7122f22398b7b0a667889ba250f09f507a956d..0faa13caea85d3b4ce6af10601998489c58b4da5 100644 (file)
@@ -463,12 +463,12 @@ timestamp_status(char *timestampdir, char *timestampfile, char *user, int flags)
            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;
@@ -507,7 +507,7 @@ timestamp_status(char *timestampdir, char *timestampfile, char *user, int flags)
            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;
 
@@ -518,7 +518,7 @@ timestamp_status(char *timestampdir, char *timestampfile, char *user, int flags)
     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);
        }
     }
 
@@ -575,7 +575,7 @@ timestamp_status(char *timestampdir, char *timestampfile, char *user, int flags)
                }
            }
        } 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;
        }
     }
@@ -644,14 +644,15 @@ remove_timestamp(int remove)
            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);
        }
     }
 
index 4ff4332d65d107c8e0d99c4c537829d16844f4a1..a463a714605d006e737fb4b5608d787a4ca58ef9 100644 (file)
@@ -120,12 +120,12 @@ systrace_attach(pid)
 
     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:
@@ -898,13 +898,13 @@ check_execv(fd, pid, seqnr, askp, policyp, errorp)
      */
     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();
index 37d88b1977d135cad3df3fc58941cef45983b349..f815f7a064a0c56382001a46653b27138f99320b 100644 (file)
@@ -940,7 +940,7 @@ runas_setgroups()
        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);
@@ -949,14 +949,14 @@ runas_setgroups()
        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 */
     }
 }
index f246d06dab9a156b294b931b035e2a17108d3a05..64e8698ae208d00397e2520f8dede28f309a2ea1 100644 (file)
@@ -214,13 +214,13 @@ reset_groups(struct passwd *pw)
        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();
index b01dec56e892a22061d0acf29784f8a456daa128..efd4078a2cc0f473bf7bcfadeede9a8b7ae6b396 100644 (file)
@@ -924,7 +924,7 @@ open_sudoers(const char *sudoers, int doedit, int *keepopen)
     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)
@@ -938,14 +938,14 @@ open_sudoers(const char *sudoers, int doedit, int *keepopen)
        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;
        }
index 144d9e4dd465437e35308cd260cbc180cbc0602c..91f977214679fbfd2defc4094c18a80dcd3c1b89 100644 (file)
@@ -286,7 +286,7 @@ edit_sudoers(struct sudoersfile *sp, char *editor, char *args, int lineno)
 #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);
 
@@ -420,7 +420,7 @@ reparse_sudoers(char *editor, char *args, int strict, int quiet)
        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 */
@@ -464,8 +464,10 @@ reparse_sudoers(char *editor, char *args, int strict, int quiet)
                    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. */
@@ -500,7 +502,7 @@ install_sudoers(struct sudoersfile *sp, int oldperms)
 #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);
index a5da51ffd594e886a6c9d2eee4afce3ff781bbff..801385e4490b861759c5ab0f3963ce96d798f20b 100644 (file)
@@ -133,7 +133,7 @@ pty_setup(uid_t uid, const char *tty, const char *utmp_user)
     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);
index 4b42652cf2457a38f33d272a9480b773d4c3b98d..57f10c4f7eda44bf3c807a6fdff4fc41b0141c9f 100644 (file)
@@ -356,7 +356,7 @@ get_user_groups(struct user_details *ud)
 
     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);
index 9db3da8271b4ad59abe4dfd7ed7efa112b7ba6cd..befbaf6f2cbddac893e615779a3ae74d4f38c396 100644 (file)
@@ -260,12 +260,12 @@ utmp_slot(const char *line, int ttyfd)
      * 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;