Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > A small CGI program to test

A small CGI program to test
Thread Tools
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Mar 4, 2003, 03:24 PM
 
I have been working on and off on a small CGI program to make the contents of the Addressbook.framework addressbooks avalibel over the web. I have a beta version of it up on a small web site at:

http://mysite.verizon.net/vze4pm8b/

Give it a try and tell me what you think. Comment, sugestions, and heckling are all accepted.

PS.. once you have it installed and your web server running the address should be:

http://127.0.0.1/cgi-bin/Addressbook
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Mar 5, 2003, 03:00 PM
 
Rather than distributing as a package that auto-installs (and requires a superuser password), why not distribute as a file and let the user install it? I'd be more likely to try it if I didn't have to worry about security (the web server runs as "nobody" which has no privileges).
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
larkost  (op)
Mac Elite
Join Date: Oct 1999
Location: San Jose, Ca
Status: Offline
Reply With Quote
Mar 5, 2003, 09:33 PM
 
Actually I have thought of those things, and the answers are:

Since the image files are not part of the binary, they have to be installed. I am working on putting them inside the binary, but things are slow on that front (any help would be appriciated... I haven't figured out how to get the octal data in). Since I am installing multiple files (around 15), a .pgk is the best way to go.

The CGI has to be run as root because otherwise I cna't chage the working ID durring runtime. I have to do this because the Addressbook.framework only allows you to view the information from the current userID. I am puling quite the trick to get all the information. In other words: it has to be root to work.

I am toying with an idea to alow people to install a version that only gives access to their own Addressbook and puts the cgi in their own private folder, but that still requires and administration password to change some configuration files or the cgi-bin directory. There are potential nightmares in a lot of places.

I have thought of running as a daemon and a responder, but thought I should get it working first. Ths would conceptually increase security, but not by much since I am being very careful about taint (and Obj-C strings to prevent buffer overflows). Long term I have some more ambitous ideas with this system that will change the whole security discussion.

PS... You should never run a web server as 'nobody', you sould always run it as 'www', a user with no privileges. Because so many system process run as 'nobody' that user winds up with the power to do a lot of damage. 'www' on the other hand can only mess up your web space.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:51 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2