From aed243fe03fc8f9b40f753ea1ef85ce59cce9011 Mon Sep 17 00:00:00 2001 From: Andrew DeFaria Date: Tue, 21 Nov 2017 10:22:41 -0800 Subject: [PATCH] Some minor changes to maps . Changed MAPSDB.sql to work with MariaDB. MariaDB doesn't like type=innodb even though it's the default . MAPSDeliever no longer tries to setgid . A more testy test.msg --- maps/bin/MAPSDB.sql | 10 +-- maps/bin/MAPSDeliver | 40 +++------- maps/test.msg | 180 +++---------------------------------------- 3 files changed, 24 insertions(+), 206 deletions(-) diff --git a/maps/bin/MAPSDB.sql b/maps/bin/MAPSDB.sql index 0a2a3fc..54a4917 100644 --- a/maps/bin/MAPSDB.sql +++ b/maps/bin/MAPSDB.sql @@ -27,7 +27,7 @@ create table user ( email varchar (128) not null, password tinytext not null, primary key (userid) -) type=innodb; -- user +); -- user -- useropts: User's options are stored here create table useropts ( @@ -36,7 +36,7 @@ create table useropts ( value varchar (128), key user_index (userid), foreign key (userid) references user (userid) on delete cascade -) type=innodb; -- useropts +); -- useropts -- email: Table that holds the email create table email ( @@ -48,7 +48,7 @@ create table email ( key user_index (userid), foreign key (userid) references user (userid) on delete cascade, key sender_index (sender) -) type=innodb; -- email +); -- email -- whitelist: Table holds the users' whitelists create table list ( @@ -64,7 +64,7 @@ create table list ( key user_listtype (userid, type), unique (userid, type, sequence), foreign key (userid) references user (userid) on delete cascade -) type=innodb; -- list +); -- list -- log: Table to hold log information create table log ( @@ -85,7 +85,7 @@ create table log ( message varchar (255) not null, key user_index (userid), foreign key (userid) references user (userid) on delete cascade -) type=innodb; -- log +); -- log -- Create users --grant all privileges diff --git a/maps/bin/MAPSDeliver b/maps/bin/MAPSDeliver index e58126c..05ceafd 100755 --- a/maps/bin/MAPSDeliver +++ b/maps/bin/MAPSDeliver @@ -2,11 +2,11 @@ ################################################################################ # # File: $RCSfile: MAPSDeliver,v $ -# Revision: $Revision: 1.1 $ +# Revision: $Revision: 1.1 $ # Description: This script simply delivers the mail. It is separated out so -# it can be the only portion that is setgid to the group mail -# for the purposes of being able to deliver the mail to the users -# maildrop +# it can be the only portion that is setgid to the group mail +# for the purposes of being able to deliver the mail to the users +# maildrop # Author: Andrew@DeFaria.com # Created: Fri Nov 29 14:17:21 2002 # Modified: $Date: 2013/06/12 14:05:47 $ @@ -18,19 +18,9 @@ use strict; use warnings; -use English; use FindBin; -# Untaint $FindBin::Bin -my $lib; - -BEGIN { - if ($FindBin::Bin =~ /^(.*)$/) { - $lib = $1; - } # if -} # BEGIN - -use lib $lib; +use lib $FindBin::Bin; use MAPSFile; use MAPSDB; @@ -39,14 +29,6 @@ use MAPSLog; sub DeliverMail ($$) { my ($userid, $msgfileName) = @_; - # Switch to group mail - $EGID = getgrnam "mail"; - - # Untaint $userid - if ($userid =~ /^([-\@\w.]+)$/) { - $userid = $1; - } # if - # Open maildrop file open my $maildrop, '>>', "/var/mail/$userid" or return "Unable to open maildrop file (/var/mail/$userid): $!"; @@ -59,7 +41,7 @@ sub DeliverMail ($$) { Lock $maildrop; # Write msgfile -> $maildrop - print $maildrop "\n"; + print $maildrop "\n\n"; print $maildrop $_ while (<$msgfile>); @@ -74,11 +56,10 @@ sub DeliverMail ($$) { } # DeliverMail # Main -die 'User id not specified' unless $ARGV [0]; -die 'Msgfile not specified' unless $ARGV [1]; +my ($userid, $msgfile) = @ARGV; -my $userid = shift @ARGV; -my $msgfile = shift @ARGV; +die 'User id not specified' unless $userid; +die 'Msgfile not specified' unless $msgfile; my $err = DeliverMail $userid, $msgfile; @@ -90,5 +71,4 @@ if ($err) { Error $err; } # if -exit 1 if $err; -exit 0; +exit $err ? 1 : 0; diff --git a/maps/test.msg b/maps/test.msg index fe92463..9aacd39 100644 --- a/maps/test.msg +++ b/maps/test.msg @@ -1,171 +1,9 @@ -Message-ID: <546412AB.7090404@DeFaria.com> -Date: Wed, 12 Nov 2014 18:08:43 -0800 -From: Andrew DeFaria -User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 -MIME-Version: 1.0 -To: Yubico Support -Subject: Glutten for punishment... -Content-Type: multipart/alternative; - boundary="------------060602060101040803010204" - -This is a multi-part message in MIME format. ---------------060602060101040803010204 -Content-Type: text/plain; charset=utf-8; format=flowed -Content-Transfer-Encoding: 7bit - -OK I returned the Yubico Security key thing and bought the Yubikey Neo. -I'm on Windows 7 with Chrome 38.0.2125.111 m. I even have the FIDO U2F -(Universal 2nd Factor) extension 0.9.3 installed. - -I go to http://demo.yubico.com/start/u2f/neo?tab=register and insert my -key. Unlike the instructions my yubikey is not a "flashing U2F device" - -the light is on solid. I hit the button anyway. It does nothing but -eventually times out with: - - - Registration failed! - - Make sure you have a U2F device connected, and try again. - - Traceback (most recent call last): - File "/root/python-u2flib-server-demo/examples/yubiauth_server.py", line 159, in __call__ - raise Exception("FIDO Client error: %s" % error) - Exception: FIDO Client error: 5 (TIMEOUT) - - -/root? Really? - -Similarly when I go to my Google account under Security Keys and follow -the instruction there the yubikey doesn't do anything! When I tap the -gold circle the light goes out for a brief second then back on. But the -"Now insert (and tap) your Security Key" with the spinning progress -indicator goes forever... - -Now what? --- -Andrew DeFaria -ClearSCM, Inc. - ---------------060602060101040803010204 -Content-Type: text/html; charset=utf-8 -Content-Transfer-Encoding: 8bit - - - - - - - - OK I returned the Yubico Security key thing and bought the Yubikey - Neo. I'm on Windows 7 with Chrome  38.0.2125.111 m. I even have the - FIDO U2F (Universal 2nd Factor) extension 0.9.3 installed.
-
- I go to http://demo.yubico.com/start/u2f/neo?tab=register and insert - my key. Unlike the instructions my yubikey is not a "flashing U2F - device" - the light is on solid. I hit the button anyway. It does - nothing but eventually times out with:
-
-

Registration failed!

-

Make sure - you have a U2F device connected, and try again.

-
 Traceback (most recent call last):
-  File "/root/python-u2flib-server-demo/examples/yubiauth_server.py", line 159, in __call__
-    raise Exception("FIDO Client error: %s" % error)
-Exception: FIDO Client error: 5 (TIMEOUT)
- 
-
-
/root? Really?
-
- Similarly when I go to my Google account under Security Keys and - follow the instruction there the yubikey doesn't do anything! When - I tap the gold circle the light goes out for a brief second then - back on. But the "Now insert (and tap) your Security Key" with the - spinning progress indicator goes forever...
-
- Now what?
- --
- Andrew DeFaria
- ClearSCM, Inc.
-
- - - ---------------060602060101040803010204-- +From andrew@defaria.com Tue Nov 14 20:02:28 2017 +Return-Path: +X-Original-To: andrew +Delivered-To: andrew@defaria.novalocal +Received: from defaria.com (cpe-76-167-176-12.san.res.rr.com [76.167.176.12]) + by defaria.novalocal (Postfix) with ESMTP id 93C2D84D55E + for ; Tue, 14 Nov 2017 20:02:12 +0000 (UTC) + +This is a test message. -- 2.17.1