~ubuntu-branches/ubuntu/hardy/edbrowse/hardy-security

« back to all changes in this revision

Viewing changes to edbdoc.html

  • Committer: Bazaar Package Importer
  • Author(s): Kapil Hari Paranjape
  • Date: 2007-05-09 07:33:04 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20070509073304-ywptg9g6iiitsg17
Tags: 3.2.1-1
* New upstream version (3.2.1). Closes: #421451.
  - can fetch and execute a local javascript file
    if required by local html file.
  - provide COPYING and CHANGES files.
* debian/rules:
  - add CHANGES to dh_installchangelogs line.
  - add dh_installman entry to install the man page.
* debian/copyright: updated to include the COPYING file.
* debian/edbrowse.1: added a basic man page.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
<LI><A HREF=#cook> Cookies </A>
72
72
<LI><A HREF=#ssl> Secure Connections </A>
73
73
<LI><A HREF=#ftp> FTP Retrievals </A>
 
74
<LI><A HREF=#proxy> Proxy Servers </A>
74
75
<LI><A HREF=#frame> Frames </A>
75
76
</UL>
76
77
 
106
107
<LI><A HREF=#filter> Mail Filtering </A>
107
108
</UL>
108
109
 
 
110
<H4> Chapter 8, Database Access </H4>
 
111
 
 
112
<UL>
 
113
<LI><A HREF=#sqlb> Building edbrowse with Database Access </A>
 
114
<LI><A HREF=#rtb> Reading Tables </A>
 
115
<LI><A HREF=#insupd> Insert, Update, Delete </A>
 
116
<LI><A HREF=#td> Table Descriptors </A>
 
117
</UL>
 
118
 
109
119
<H3 align=center> <A NAME=auth> Author </A> </H3>
110
120
 
111
121
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>Karl Dahlke
112
 
<A HREF=mailto:karl@eklhad.net>karl@eklhad.net</A>
 
122
<A HREF=mailto:eklhad@comcast.net>eklhad@comcast.net</A>
113
123
248-524-1004 (during regular business hours)
114
124
</font></PRE>
115
125
 
116
126
<H3 align=center> <A NAME=copy> Copyright Notice </A> </H3>
117
127
 
118
 
This program is copyright (C) (C) Karl Dahlke, 2000-2006.&nbsp;
 
128
This program is copyright (C) (C) Karl Dahlke, 2000-2007.&nbsp;
119
129
It is made available by the author under the terms of the GNU General Public License (GPL),
120
130
as articulated by the Free Software Foundation.&nbsp;
121
131
It may be used for any purpose, and redistributed, provided this copyright notice is included.
298
308
et: edit this web page as pure text
299
309
vs: verify ssl connections (toggle)
300
310
ip: show referenced ip numbers, usually for saved mail messages
 
311
sc: show columns
301
312
sm: send mail [account number]
302
313
</font></PRE>
303
314
 
965
976
Since these edits have implications outside the scope of this program,
966
977
there is no undo capability.&nbsp;
967
978
When you make a change it is made.&nbsp;
968
 
With this in mind, I borrowed a good idea from Microsoft.&nbsp;
969
 
(That's one.)&nbsp;
 
979
With this in mind, I borrowed a good idea from Microsoft, which, as you might expect, originated with Apple.&nbsp;
970
980
The deleted file isn't actually deleted;
971
981
it is moved to your recycle bin,
972
982
located in $HOME/.recycle.&nbsp;
2142
2152
trying to steal your account numbers and passwords.&nbsp;
2143
2153
You can grab a certificate file <A HREF=ssl-certs>here</A>,
2144
2154
but I don't always keep it up to date.&nbsp;
2145
 
If you don't have this file,
 
2155
On some Linux distributions, you can run `cd /etc/ssl/certs ; cat * >../edbrowse-certs'
 
2156
to capture ssl certificates that are as current as your linux system.
 
2157
If you don't have or create this file,
2146
2158
or, if you don't specify its location in your config file,
2147
2159
you will not be able to verify secure connections, and you will be warned accordingly.&nbsp;
2148
2160
Some browsers don't have this feature at all, so it's not the end of the world,
2198
2210
I use other, expendable passwords when the connection is not secure.
2199
2211
 
2200
2212
<P>
2201
 
Please don't fall for all those email scams
 
2213
Please don't fall for all those "phishing" email scams
2202
2214
that tell you your login has expired, and would you please log in again using this convenient form.&nbsp;
2203
2215
The mail is forged to look legitimate,
2204
2216
and the form actually sends your secret password to a thief,
2297
2309
so you just have to wait until it's done.&nbsp;
2298
2310
(Depending on your operating system, you could switch to another virtual console/window and check on the length of the local file.)
2299
2311
 
 
2312
<H3 align=center> <A NAME=proxy> Proxy Servers </A> </H3>
 
2313
 
 
2314
A proxy server is a web server that sits between your web browser and remote websites.&nbsp;
 
2315
It intercepts your requests for web pages and forwards them to the system that hosts
 
2316
the site you are browsing.&nbsp;
 
2317
Proxy servers are used for a variety of reasons.&nbsp;
 
2318
Here are just a few of them:
 
2319
 
 
2320
<OL>
 
2321
<P><LI>Efficiency.&nbsp;
 
2322
The proxy server may be able to store previously-accessed webpages
 
2323
(known as caching).&nbsp;
 
2324
If your connection to the proxy is faster than your connection to the rest of the network,
 
2325
then caching insures that frequently-accessed web pages load quickly.
 
2326
<P><LI>Policies.&nbsp;
 
2327
Some firewall administrators require their users to use
 
2328
a proxy server.
 
2329
<P><LI>Anonymity.&nbsp;
 
2330
There are so-called anonymizing
 
2331
proxy servers that hide your IP address from the websites that you browse.
 
2332
</OL>
 
2333
 
 
2334
<P>
 
2335
If you wish to use a proxy server for http traffic, simply set the proxy
 
2336
option in your configuration file.&nbsp;
 
2337
Provide the hostname and port, separated by a colon.&nbsp;
 
2338
For example:
 
2339
<P>
 
2340
proxy = proxy.campus.edu:3128
 
2341
 
 
2342
<p>
 
2343
Note that proxies often listen on ports other than port 80.&nbsp;
 
2344
Squid is a proxy server that comes bundled with some Linux distributions, and it uses
 
2345
port 3128 by default.
 
2346
 
 
2347
<p>
 
2348
Presently, edbrowse only handles proxying of standard http.&nbsp;
 
2349
Secure http and ftp
 
2350
can both be proxied, but this functionality is not implemented.
 
2351
 
2300
2352
<H3 align=center> <A NAME=frame> Frames </A> </H3>
2301
2353
 
2302
2354
Frames are a mechanism whereby a web page can fetch and display several other web pages on the screen at once.&nbsp;
3469
3521
I set this when looking at other people's mail, such as my wife's account.&nbsp;
3470
3522
I don't want her mail sent somewhere else because it matches one of my filter rules.
3471
3523
 
 
3524
<H3 align=center> <A NAME=sqlb> Building edbrowse with Database Access </A> </H3>
 
3525
 
 
3526
If you simply type make, you get edbrowse, with no database interface.&nbsp;
 
3527
Two other targets support database access.&nbsp;
 
3528
Run either `make edbrowseodbc' or make `edbrowseinf'.&nbsp;
 
3529
The former uses odbc to access just about any sql database,
 
3530
and the latter uses the
 
3531
<A HREF=http://www.informix.com>Informix</A> interface.&nbsp;
 
3532
If you would like to test the odbc interface,
 
3533
or write a new interface, e.g. for Oracle or mysql,
 
3534
I will be eternally grateful.&nbsp;
 
3535
You are basically implementing the interface described in dbapi.h,
 
3536
using the C database development toolkit provided by the vendor.&nbsp;
 
3537
The easiest way to proceed is to copy one of the two files that is already there,
 
3538
dbinfx.ec or dbodbc.c, and make changes as necessary.
 
3539
 
 
3540
<H3 align=center> <A NAME=rtb> Reading Tables </A> </H3>
 
3541
 
 
3542
When a file name is of a certain format, with the http:// in front etc,
 
3543
it is deemed to be a url.&nbsp;
 
3544
Edbrowse does not look on your computer for the file; it goes out to the internet.&nbsp;
 
3545
Similarly, when the file name has a certain format,
 
3546
it is assumed to be a table or view in the database.&nbsp;
 
3547
If you have a table called customers, you follow it up with a right bracket.
 
3548
 
 
3549
<P>
 
3550
e customers]
 
3551
 
 
3552
<P>
 
3553
This allows you to bring in the entire table,
 
3554
or portions thereof, one row per line, with fields delimited by pipes.&nbsp;
 
3555
If the result looks like a bunch of numbers and pipes,
 
3556
and you have forgottten the structure of the table,
 
3557
use the sc (show columns) command.&nbsp;
 
3558
The output might look like this.
 
3559
 
 
3560
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>Table customers, 536281 rows
 
3561
1 *custnum int
 
3562
2 firstname string
 
3563
3 lastname string
 
3564
4 birthdate date
 
3565
5 sex char
 
3566
6 email string
 
3567
7 picture blob
 
3568
</font></PRE>
 
3569
 
 
3570
<P>
 
3571
The first column is a unique number that designates this particular customer.&nbsp;
 
3572
After all, two customers could have the same first and last name,
 
3573
and even the same birthdate.&nbsp;
 
3574
Serial numbers are <em>always</em> a good idea,
 
3575
and that usually becomes the primary key.&nbsp;
 
3576
This is indicated by a star, just before the column name.&nbsp;
 
3577
If edbrowse changes or deletes a record, the primary key is used.&nbsp;
 
3578
I assume, at all times, that the key determines a unique record in the database,
 
3579
and that each record appears at most once in an editing session.
 
3580
 
 
3581
<P>
 
3582
Note that edbrowse can support a primary key with two columns, such as a serial number and a modifier.&nbsp;
 
3583
I actually have some tables at work that look like this.
 
3584
 
 
3585
<P>
 
3586
The table syntax is more than just an identifier and a right bracket.&nbsp;
 
3587
You can follow the right bracket with a where clause.&nbsp;
 
3588
This is important if you don't want the entire table,
 
3589
especially if there are millions of rows.&nbsp;
 
3590
Here are some table commands and their meanings.
 
3591
 
 
3592
<P>
 
3593
customers]
 
3594
<br>
 
3595
Set the buffer up for the customers table, but don't fetch any rows.
 
3596
 
 
3597
<P>
 
3598
customers]*
 
3599
<br>
 
3600
Fetch all the rows in the table.
 
3601
 
 
3602
<P>
 
3603
customers]37
 
3604
<br>
 
3605
Fetch the customer whose serial number is 37.&nbsp;
 
3606
The primary key is assumed; your table has to have a primary key
 
3607
if you are going to use this syntax.
 
3608
 
 
3609
<P>
 
3610
customers]1=37
 
3611
<br>
 
3612
Fetch the row whose first column is 37.
 
3613
 
 
3614
<P>
 
3615
customers]37-59
 
3616
<br>
 
3617
Fetch the customers with serial numbers between 37 and 59 inclusive.
 
3618
 
 
3619
<P>
 
3620
customers]3=Smith
 
3621
<br>
 
3622
Fetch the customers whose last name is Smith.
 
3623
 
 
3624
<P>
 
3625
customers]lastname=Smith
 
3626
<br>
 
3627
Same as above.
 
3628
 
 
3629
<P>
 
3630
customers]last=Smith
 
3631
<br>
 
3632
Same as above.&nbsp;
 
3633
If the string uniquely gloms onto a column name, we're all set.
 
3634
 
 
3635
<P>
 
3636
customers]last=Barn*
 
3637
<br>
 
3638
Fetch the customers whose last names begin with Barn.
 
3639
 
 
3640
<P>
 
3641
customers]birth=01/01/1960-12/31/1960
 
3642
<br>
 
3643
Fetch the customers who were born in 1960.
 
3644
 
 
3645
<P>
 
3646
It is sometimes best to edit with a blank template, i.e. without a where clause.&nbsp;
 
3647
Then, you can read in whatever rows you like.&nbsp;
 
3648
Type an r before any of the strings shown above to read rows into your buffer.&nbsp;
 
3649
Note, you cannot read data from different tables into the same buffer,
 
3650
but you can switch to another editing session to look at another table,
 
3651
without losing the rows you are working on.
 
3652
 
 
3653
<P>
 
3654
When reading rows into a growing buffer, you can usually omit the table, since it has to be customers] every time.&nbsp;
 
3655
For instance, you can bring in customer #738 by typing `r customers]738' or `r 738'.
 
3656
 
 
3657
<P>
 
3658
If you want a clean slate, type `rf' to refresh the buffer.&nbsp;
 
3659
This brings you back to a template for the table, with no rows.&nbsp;
 
3660
WARNING - do not clear your buffer by deleting all the rows,
 
3661
as that will delete the corresponding entries in the database.&nbsp;
 
3662
This feature works just like directory mode -
 
3663
your edits are translated into actions in the real world, so be careful.&nbsp;
 
3664
Referential integrity will usually save you from this accidental delete disaster,
 
3665
if you routinely use this sql feature to link tables together,
 
3666
which is a good idea at many levels.
 
3667
 
 
3668
<P>
 
3669
Now, how about the seventh column in our example, the one called "picture"?&nbsp;
 
3670
This is the customer's picture, a jpg image that is in binary,
 
3671
and cannot be easily folded into an editing session.&nbsp;
 
3672
Instead, it is stored in another buffer,
 
3673
e.g. buffer 9, and this is indicated by &lt;9&gt;.&nbsp;
 
3674
You can switch to session 9 and save the file, or throw it away.
 
3675
 
 
3676
<P>
 
3677
2139|Fred|Flintstone|08/21/1969|M|foo@bar.bar.com|&lt;9&gt;
 
3678
 
 
3679
<P>
 
3680
To do anything with the database, your config file must specify
 
3681
the name of the database, the login, and the password.&nbsp;
 
3682
(The last two can sometimes be omitted, if they are inferred from your identity on the computer.)&nbsp;
 
3683
Here is how the line might look
 
3684
if you are tapping into the retail database, where the customers table resides.
 
3685
 
 
3686
<P>
 
3687
database = retail,mylogin,mypassword
 
3688
 
 
3689
<P>
 
3690
Although this cannot be changed on the fly, you can access other databases by vectoring through this one.&nbsp;
 
3691
For instance, you can read the parts table in the inventory database by calling up inventory:parts].&nbsp;
 
3692
This is standard sql syntax for looking at tables in another database;
 
3693
I just pass it through.
 
3694
 
 
3695
<H3 align=center> <A NAME=insupd> Insert, Update, Delete </A> </H3>
 
3696
 
 
3697
Adding database rows is substantially different from adding text.&nbsp;
 
3698
Since a row may contain a dozen fields, and you may not remember what goes where,
 
3699
edbrowse prompts you for each field in turn.&nbsp;
 
3700
It also checks the integrity of each field as you go,
 
3701
e.g. a date has to look like mm/dd/yyyy etc.&nbsp;
 
3702
If a row cannot be added because of a database error,
 
3703
edbrowse prints the error,
 
3704
and data entry continues;
 
3705
giving you a chance to reenter the row.&nbsp;
 
3706
Data entry stops when you enter a period all by itself,
 
3707
no matter what field you are on.&nbsp;
 
3708
The rows that were entered successfully will be present in your buffer,
 
3709
and the current line is the last entered row.&nbsp;
 
3710
Note that blobs cannot be entered at this time.
 
3711
 
 
3712
<P>
 
3713
Use the substitute command to update a row.&nbsp;
 
3714
Make sure you don't accidentally introduce an additional pipe, or remove a pipe.&nbsp;
 
3715
Key columns cannot be modified.&nbsp;
 
3716
If you are updating many rows with one command,
 
3717
through a range or through g//s,
 
3718
and an error occurs while updating the database,
 
3719
substitution stops in its tracks.&nbsp;
 
3720
The editing session will reflect the database,
 
3721
with some rows changed and others untouched.&nbsp;
 
3722
There are many reasons for these update errors, including datatype mismatch
 
3723
(e.g. pushing an integer into a date field), and check constraints
 
3724
(e.g. putting J in for sex, instead of M or F).&nbsp;
 
3725
If you have any say in the database design,
 
3726
apply check constraints wherever they make sense.&nbsp;
 
3727
They will protect you from erroneous substitutions, wich would produce inconsistent updates.
 
3728
 
 
3729
<P>
 
3730
Delete works as you would expect; delete a row,
 
3731
and the corresponding entry disappears.&nbsp;
 
3732
There is no undo command.&nbsp;
 
3733
It couldn't be done in any case, since you may have selected only part of the row (see below),
 
3734
and I wouldn't have all the data to put the row back.&nbsp;
 
3735
As mentioned before, referential integrity should be employed wherever it makes sense.&nbsp;
 
3736
As a last check, I only let you delete 100 rows at a time.&nbsp;
 
3737
Be careful, and run regular backups.
 
3738
 
 
3739
<H3 align=center> <A NAME=td> Table Descriptors </A> </H3>
 
3740
 
 
3741
Suppose a table contains 100 fields.&nbsp;
 
3742
Displaying all those fields is awkward, to say the least.&nbsp;
 
3743
Sometimes you are interested in a group of 6 fields,
 
3744
and sometimes you are interested in another group of 8.&nbsp;
 
3745
You can set up virtual tables, similar to views, in your config file.&nbsp;
 
3746
The short name is the alias, and you can call up the table using this alias.&nbsp;
 
3747
It will contain only the columns you specify.&nbsp;
 
3748
Here are two descriptors for the aforementioned customers table.
 
3749
 
 
3750
<P><PRE><font size=3 face=Arial,Helvetica,sans-serif>table {
 
3751
    tname = customers
 
3752
#  cnm is my cryptic shorthand for customer name
 
3753
#  I want to be cryptic here, cause I'm going to be typing this a lot.
 
3754
    tshort = cnm
 
3755
    cols = custnum,firstname,lastname
 
3756
#  Specify the primary key, in this case, the first column selected.
 
3757
    keycol = 1
 
3758
}
 
3759
 
 
3760
table {
 
3761
    tname = customers
 
3762
#  All I care about here is customer and birthdate.
 
3763
    tshort = cbd
 
3764
    cols = birthdate,custnum
 
3765
    keycol = 2
 
3766
}
 
3767
</font></PRE>
 
3768
 
 
3769
<P>
 
3770
When inserting a row through one of these descriptors,
 
3771
remember that you are only specifying a subset of the columns in the table.&nbsp;
 
3772
The other columns will be null, or they will take on their default values,
 
3773
as specified by the schema.&nbsp;
 
3774
If you receive a Not-Null error, it could be due to one of the other columns,
 
3775
which requires an entered value.&nbsp;
 
3776
It is usually safer to insert a row using the complete table.
 
3777
 
3472
3778
<H3 align=center> <A NAME=end> Wrap up </A> </H3>
3473
3779
 
3474
3780
That concludes the user's guide.&nbsp;
3475
3781
As you can see, edbrowse is a difficult program to master, but an easy program to use.&nbsp;
3476
3782
I believe this is the key to success for any blind user or programmer.&nbsp;
3477
3783
One can certainly paste a screen reader on top of an existing 2 dimensional program
3478
 
such as emacs or lynx, and get "up and running" quickly,
 
3784
such as emacs or lynx, and get up and running quickly,
3479
3785
but to be truly competitive in the workplace, or efficient at home,
3480
3786
you need a <A HREF=http://www.eklhad.net/cli.html>command line interface</a>.&nbsp;
3481
3787
Edbrowse is an important step in this direction.&nbsp;