Re: Make dhclient not use lease files

2014-12-12 Thread patric conant
Why aren't you just deleting the lease file on shutdown?
On Dec 8, 2014 10:04 AM, Jurjen Oskam jur...@osk.am wrote:

 Hi,

 My (residential) ISP assigns me an IP address using DHCP. The lease time
 is 7
 days or so. I just put dhcp in hostname.re1 and everything works, except
 for
 a minor annoyance.

 When re1 goes down (e.g. because of a reboot) the ISP *requires* a
 successful
 DHCP exchange to occur before it enables the link on a layer 3 level. It
 does
 not matter whether there still is a valid lease or not: after re1 goes
 down,
 there *has* to be a DHCP exchange otherwise the link won't work.

 What makes this worse is that the DHCP server does not always immediately
 respond after re1 comes back up. It regularly happens that dhclient
 concludes
 that the DHCP server is unreachable, finds that it still has a valid lease
 in the lease file, and it'll use that. The problem with this is that
 dhclient
 doesn't seem to try to contact the server anymore. With long lease times,
 it
 could take days for dhclient to try to renew the lease.

 I've tried using timeout 0 in dhclient.conf, but that only causes
 dhclient
 to immediately using the lease from the lease file (after trying to
 reacquire
 its previous address for ten seconds). Using an arbitrarily high timeout
 value doesn't seem right.

 The retry setting doesn't seem to help in this case: by default it's set to
 5 minutes, but in my testing I noticed that once dhclient is bound to a
 lease
 from the lease file, this setting doesn't seem to be used anymore.


 Perhaps I've missed something, but I concluded that in my scenario lease
 files are never useful. I modified dhclient to accept a new option called
 no-lease-file in dhclient.conf. A diff against -current is below. I've
 tested it lightly on a laptop, and it seems to work OK. I've been using
 roughly the same diff against -stable for a day or two.


 Index: sbin/dhclient/clparse.c
 ===
 RCS file: /cvs/src/sbin/dhclient/clparse.c,v
 retrieving revision 1.90
 diff -u -p -r1.90 clparse.c
 --- sbin/dhclient/clparse.c 3 Nov 2014 22:06:39 -   1.90
 +++ sbin/dhclient/clparse.c 8 Dec 2014 10:07:39 -
 @@ -67,6 +67,7 @@ read_client_conf(void)
 new_parse(path_dhclient_conf);

 /* Set some defaults. */
 +   config-use_lease_file = 1;
 config-link_timeout = 10;
 config-timeout = 60;
 config-select_interval = 0;
 @@ -153,6 +154,7 @@ read_client_leases(void)
   * TOK_BACKOFF_CUTOFF number |
   * TOK_INITIAL_INTERVAL number |
   * interface-declaration |
 + * TOK_NO_LEASE_FILE |
   * TOK_LEASE client-lease-statement |
   * TOK_ALIAS client-lease-statement |
   * TOK_REJECT reject-statement
 @@ -240,6 +242,10 @@ parse_client_statement(FILE *cfile)
 break;
 case TOK_INTERFACE:
 parse_interface_declaration(cfile);
 +   break;
 +   case TOK_NO_LEASE_FILE:
 +   config-use_lease_file = 0;
 +   parse_semi(cfile);
 break;
 case TOK_LEASE:
 parse_client_lease_statement(cfile, 1);
 Index: sbin/dhclient/conflex.c
 ===
 RCS file: /cvs/src/sbin/dhclient/conflex.c,v
 retrieving revision 1.29
 diff -u -p -r1.29 conflex.c
 --- sbin/dhclient/conflex.c 5 May 2014 18:02:49 -   1.29
 +++ sbin/dhclient/conflex.c 8 Dec 2014 10:07:39 -
 @@ -352,6 +352,7 @@ static const struct keywords {
 { media,  TOK_MEDIA },
 { medium, TOK_MEDIUM },
 { next-server,TOK_NEXT_SERVER },
 +   { no-lease-file,  TOK_NO_LEASE_FILE },
 { option, TOK_OPTION },
 { prepend,TOK_PREPEND },
 { rebind, TOK_REBIND },
 Index: sbin/dhclient/dhclient.c
 ===
 RCS file: /cvs/src/sbin/dhclient/dhclient.c,v
 retrieving revision 1.343
 diff -u -p -r1.343 dhclient.c
 --- sbin/dhclient/dhclient.c8 Dec 2014 02:04:58 -   1.343
 +++ sbin/dhclient/dhclient.c8 Dec 2014 10:07:39 -
 @@ -549,15 +549,17 @@ main(int argc, char *argv[])
 close(tailfd);
 }

 -   if ((fd = open(path_dhclient_db,
 -   O_RDONLY|O_EXLOCK|O_CREAT|O_NOFOLLOW, 0640)) == -1)
 -   error(can't open and lock %s: %s, path_dhclient_db,
 -   strerror(errno));
 -   read_client_leases();
 -   if ((leaseFile = fopen(path_dhclient_db, w)) == NULL)
 -   error(can't open %s: %s, path_dhclient_db,
 strerror(errno));
 -   rewrite_client_leases();
 -   close(fd);
 +   if (config-use_lease_file) {
 +   if ((fd = open(path_dhclient_db,
 +  

Re: lynx: disable old protocols

2014-07-16 Thread patric conant
What about the other direction, what about all the poeple who believe that
lynx is the end-all, be-all choice for secure browsing, because they
believe that it's the only browser that is held to the audit standards of
being included in OpenBSD base. If it isn't, isn't there a responsibility
to disclose that, and possibly remove it from base. The only chicken and
egg issue I can see with it, is that you use it to get a list of mirrors
for your newly installed system, so you can set the pkg_path. I'd love it
if we included another method for discovering that, a copy of mirrors in
/usr/share/docs, or even a second email sent to root. I'd also like to
point out that Shawn has broken the social contract here, it's well known
that it's generally considered rude to direct developers, in this forum. I
think it's also a well-known part of the shut up and hack, culture, that
he can offer to audit and maintain lynx in a manner consistent with the
rest of base, or be quiet about it. No users are being harmed in the
removal of unmaintained code. I'm shocked at how hard people would push
back, against having to install a package.


Re: USB install image for OpenBSD 5.5 - TESTING REQUIRED

2014-03-02 Thread patric conant
On Sat, Mar 1, 2014 at 5:15 AM, Alexander Hall alexan...@beard.se wrote:

 On 02/28/14 23:51, Chris Cappuccio wrote:

 Here are some potential USB installer images for OpenBSD/amd64 5.5

 http://www.nmedia.net/chris/install55.fs
 http://www.nmedia.net/chris/miniroot55.fs

 The install55.fs contains full installation packages. The
 miniroot55.fs is a ramdisk-kernel only (for network installation or
 troubleshooting.)


 It might be obvious, but since it confused me for a bit, I'd like to
 correct this an say that miniroot55.fs *contains* a ramdisk kernel only. It
 is still a complete disk image.

 /Alexander



 Please test either on as many amd64 machines as you can with any USB
 flash and any USB-CF adapters that you have.

 Report failures and success of each image ASAP. Test as many flash
 types (USB, CF-USB, old USB, new USB...) as you can.

 SPECIFICALLY, IF you have a boot failure, I need to see the dmesg output
 (and the fdisk and disklabel output from the machine if possible to boot
 it another way). Any error messages displayed from the boot blocks or
 BIOS are also essential.


 Works well for me, an error about the entropy pool not being created
seemed reasonable to me. Only tried on it from USB on an old Net-Burst era
system. Installed very nicely, way faster than cd or lan, and also quicker
than my previous USB installs, although this media's new to me.