#20751: Dropbear crashes if banner file is set, but file does not exist.
-----------------------+---------------------------------------
  Reporter:  3ndymion  |      Owner:  developers
      Type:  defect    |     Status:  new
  Priority:  normal    |  Milestone:  Designated Driver (Trunk)
 Component:  packages  |    Version:  Trunk
Resolution:            |   Keywords:  dropbear ssh
-----------------------+---------------------------------------

Comment (by anonymous):

 It doesn't crash. If BannerFile is set and it can't be opened, is too
 large or there is an error reading it then DropBear exits with an
 appropriate error message. The code is in svr-runopts.c :

 {{{#!c
 if (svr_opts.bannerfile) {
                 struct stat buf;
                 if (stat(svr_opts.bannerfile, &buf) != 0) {
                         dropbear_exit("Error opening banner file '%s'",
                                         svr_opts.bannerfile);
                 }

                 if (buf.st_size > MAX_BANNER_SIZE) {
                         dropbear_exit("Banner file too large, max is %d
 bytes",
                                         MAX_BANNER_SIZE);
                 }

                 svr_opts.banner = buf_new(buf.st_size);
                 if (buf_readfile(svr_opts.banner,
 svr_opts.bannerfile)!=DROPBEAR_SUCCESS) {
                         dropbear_exit("Error reading banner file '%s'",
                                         svr_opts.bannerfile);
                 }
                 buf_setpos(svr_opts.banner, 0);
         }
 }}}

--
Ticket URL: <https://dev.openwrt.org/ticket/20751#comment:3>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to