Hello,

It looks like the trailing newline isn't stripped from the sequence count input
anymore, which causes strtonum(3) to fail. To work around this problem in
5.8-stable, you can press Ctrl-D twice after typing in the sequence number.

I have also attached a patch for -current that fixes this issue and another
issue where skeyinit needs more pledge(2)s when running skeyinit -s -a passwd
as a regular user.

Thanks,
Serguey

Index: skeyinit.c
===================================================================
RCS file: /cvs/src/usr.bin/skeyinit/skeyinit.c,v
retrieving revision 1.62
diff -u -p -r1.62 skeyinit.c
--- skeyinit.c  20 Nov 2015 20:57:48 -0000      1.62
+++ skeyinit.c  29 Nov 2015 03:14:39 -0000
@@ -55,7 +55,7 @@ main(int argc, char **argv)
        struct skey skey;
        struct passwd *pp;
 
-       if (pledge("stdio rpath wpath cpath fattr flock tty", NULL) == -1)
+       if (pledge("stdio rpath wpath cpath fattr flock tty getpw proc exec", 
NULL) == -1)
                err(1, "pledge");
 
        n = rmkey = hexmode = enable = 0;
@@ -319,6 +319,7 @@ secure_mode(int *count, char *key, char 
                    SKEY_MAX_SEQ);
                (void)fgets(buf, bufsiz, stdin);
                clearerr(stdin);
+               rip(buf);
                n = strtonum(buf, 1, SKEY_MAX_SEQ-1, &errstr);
                if (!errstr)
                        break;  /* Valid range */

  • [no subject] rjohnson
    • Re: Todd C. Miller
    • Re: skeyinit -s does not accept sequence count Serguey Parkhomovsky

Reply via email to