Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: CVS commit: src/lib/libpam/modules/pam_ssh



> On Mon, 22 Nov 2010, Christos Zoulas wrote:
> 
> > In article <20101121204136.CBED0175DF%cvs.netbsd.org@localhost>,
> > Adam Ciarcinski <source-changes-d%NetBSD.org@localhost> wrote:
> >> -=-=-=-=-=-
> >>
> >> Module Name:       src
> >> Committed By:      adam
> >> Date:              Sun Nov 21 20:41:36 UTC 2010
> >>
> >> Modified Files:
> >>    src/lib/libpam/modules/pam_ssh: pam_ssh.c
> >>
> >> Log Message:
> >> Use ssh_add_identity_constrained() instead of ssh_add_identity()
> >
> > Just for this example you need to bump the major of libssh!
> 
> I'm having all sorts of troubles with casting for prints, etc.

there are multiple issues.

there's *really* broken code that writes to a time_t via a long*.

here's the patches i've got in my tree right now.  the first one
is the real bug fix, the rest just make it compile for me.

for some reason it took sparc and vax builds to find all of these.


.mrg.


Index: dist/servconf.c
===================================================================
RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/servconf.c,v
retrieving revision 1.5
diff -p -r1.5 servconf.c
*** dist/servconf.c     21 Nov 2010 18:59:04 -0000      1.5
--- dist/servconf.c     22 Nov 2010 03:13:06 -0000
*************** process_server_config_line(ServerOptions
*** 816,822 ****
        int cmdline = 0, *intptr, value, n;
        SyslogFacility *log_facility_ptr;
        LogLevel *log_level_ptr;
!       unsigned long lvalue, *longptr;
        ServerOpCodes opcode;
        int port = 0;
        u_int i, flags = 0;
--- 816,823 ----
        int cmdline = 0, *intptr, value, n;
        SyslogFacility *log_facility_ptr;
        LogLevel *log_level_ptr;
!       unsigned long lvalue;
!       time_t *timetptr;
        ServerOpCodes opcode;
        int port = 0;
        u_int i, flags = 0;
*************** process_server_config_line(ServerOptions
*** 831,837 ****
        if (!arg || !*arg || *arg == '#')
                return 0;
        intptr = NULL;
!       longptr = NULL;
        charptr = NULL;
        opcode = parse_token(arg, filename, linenum, &flags);
  
--- 832,838 ----
        if (!arg || !*arg || *arg == '#')
                return 0;
        intptr = NULL;
!       timetptr = NULL;
        charptr = NULL;
        opcode = parse_token(arg, filename, linenum, &flags);
  
*************** process_server_config_line(ServerOptions
*** 1627,1645 ****
                        *intptr = value;
                break;
        case sBindTimeout:
!               longptr = (unsigned long *) &options->lpk.b_timeout.tv_sec;
  parse_ulong:
                arg = strdelim(&cp);
                if (!arg || *arg == '\0')
                        fatal("%s line %d: missing integer value.",
                            filename, linenum);
                lvalue = atol(arg);
!               if (*activep && *longptr == -1)
!                       *longptr = lvalue;
                break;
  
        case sSearchTimeout:
!               longptr = (unsigned long *) &options->lpk.s_timeout.tv_sec;
                goto parse_ulong;
                break;
        case sLdapConf:
--- 1628,1646 ----
                        *intptr = value;
                break;
        case sBindTimeout:
!               timetptr = &options->lpk.b_timeout.tv_sec;
  parse_ulong:
                arg = strdelim(&cp);
                if (!arg || *arg == '\0')
                        fatal("%s line %d: missing integer value.",
                            filename, linenum);
                lvalue = atol(arg);
!               if (*activep && *timetptr == -1)
!                       *timetptr = (time_t)lvalue;
                break;
  
        case sSearchTimeout:
!               timetptr = &options->lpk.s_timeout.tv_sec;
                goto parse_ulong;
                break;
        case sLdapConf:
Index: dist/sftp.c
===================================================================
RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/sftp.c,v
retrieving revision 1.4
diff -p -r1.4 sftp.c
*** dist/sftp.c 21 Nov 2010 18:29:49 -0000      1.4
--- dist/sftp.c 22 Nov 2010 03:13:06 -0000
*************** complete(EditLine *el, int ch)
*** 1778,1784 ****
        struct complete_ctx *complete_ctx;
  
        lf = el_line(el);
!       if (el_get(el, EL_CLIENTDATA, (void**)&complete_ctx) != 0)
                fatal("%s: el_get failed", __func__);
  
        /* Figure out which argument the cursor points to */
--- 1778,1784 ----
        struct complete_ctx *complete_ctx;
  
        lf = el_line(el);
!       if (el_get(el, EL_CLIENTDATA, &complete_ctx) != 0)
                fatal("%s: el_get failed", __func__);
  
        /* Figure out which argument the cursor points to */
Index: dist/ssh-keygen.c
===================================================================
RCS file: /cvsroot/src/crypto/external/bsd/openssh/dist/ssh-keygen.c,v
retrieving revision 1.4
diff -p -r1.4 ssh-keygen.c
*** dist/ssh-keygen.c   21 Nov 2010 18:29:49 -0000      1.4
--- dist/ssh-keygen.c   22 Nov 2010 03:13:06 -0000
*************** do_ca_sign(struct passwd *pw, int argc, 
*** 1445,1451 ****
                if (!quiet) {
                        logit("Signed %s key %s: id \"%s\" serial %llu%s%s "
                            "valid %s", key_cert_type(public), 
!                           out, public->cert->key_id, public->cert->serial,
                            cert_principals != NULL ? " for " : "",
                            cert_principals != NULL ? cert_principals : "",
                            fmt_validity(cert_valid_from, cert_valid_to));
--- 1445,1451 ----
                if (!quiet) {
                        logit("Signed %s key %s: id \"%s\" serial %llu%s%s "
                            "valid %s", key_cert_type(public), 
!                           out, public->cert->key_id, (unsigned long 
long)public->cert->serial,
                            cert_principals != NULL ? " for " : "",
                            cert_principals != NULL ? cert_principals : "",
                            fmt_validity(cert_valid_from, cert_valid_to));
*************** do_show_cert(struct passwd *pw)
*** 1671,1677 ****
            key_type(key->cert->signature_key), ca_fp);
        printf("        Key ID: \"%s\"\n", key->cert->key_id);
        if (!v00)
!               printf("        Serial: %llu\n", key->cert->serial);
        printf("        Valid: %s\n",
            fmt_validity(key->cert->valid_after, key->cert->valid_before));
        printf("        Principals: ");
--- 1671,1677 ----
            key_type(key->cert->signature_key), ca_fp);
        printf("        Key ID: \"%s\"\n", key->cert->key_id);
        if (!v00)
!               printf("        Serial: %llu\n", (unsigned long 
long)key->cert->serial);
        printf("        Valid: %s\n",
            fmt_validity(key->cert->valid_after, key->cert->valid_before));
        printf("        Principals: ");


Home | Main Index | Thread Index | Old Index