Return-Path: Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 82392 invoked by uid 500); 20 Feb 2003 17:09:04 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 82377 invoked from network); 20 Feb 2003 17:09:04 -0000 Received: from out004pub.verizon.net (HELO out004.verizon.net) (206.46.170.142) by daedalus.apache.org with SMTP; 20 Feb 2003 17:09:04 -0000 Received: from verizon.net ([4.46.53.173]) by out004.verizon.net (InterMail vM.5.01.05.20 201-253-122-126-120-20021101) with ESMTP id <20030220170906.ZMCD2505.out004.verizon.net@verizon.net> for ; Thu, 20 Feb 2003 11:09:06 -0600 Message-ID: <3E550EF0.2070602@verizon.net> Date: Thu, 20 Feb 2003 09:22:56 -0800 From: Marcus Carey User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003 X-Accept-Language: en-us, en MIME-Version: 1.0 To: users@httpd.apache.org Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Authentication-Info: Submitted using SMTP AUTH at out004.verizon.net from [4.46.53.173] at Thu, 20 Feb 2003 11:09:06 -0600 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Subject: [users@httpd] I/O does not work with CGI applications and the AliasMatch directive I added the ExeCGI directive to the default httpd.conf file to all cgi scripts. Then I used the AliasMatch directive to remove the "~" from the username in the URL. When using the "~" in a URL a cgi application can create files for reading and writing. However if you use AliasMatch the application cannot create files for read and write access. AllowOverride FileInfo AuthConfig Limit Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec ExecCGI Order allow,deny Allow from all Order deny,allow Deny from all http://www.example.com/~user/file.html http://www.example.com/~user/cgi-bin/file.cgi file.cgi creates a file in the user directory and prints out html content. /* File.c */ int fd = 0; print("Content-Type: text/html\n\n"); fd = open("/home/user/file", O_RDWR | O_CREAT | O_TRUNC); if(fd == -1) { printf("Could not create file: %d
\n",errno); printf("strerror says open failed: %s
\n",strerror(errno)); printf("
\n"); } else { printf("File created
\n"); } close(fd); /* end File.c */ In the above case, the output is: File created! AliasMatch ^/upages/([a-zA-Z0-9]*)/?(.*) /home/$1/public_html/$2 http://www.example.com/upages/user/file.html http://www.example.com/upages/user/cgi-bin/file.cgi file.cgi does not create a file in the user directory but prints out html content. The error log shows the normal request string with the 200 response code. Then I added the strerror(errno) to the code to get more information which returned: Permission Denied. Is there a way to use AliasMatch and I/O routines in cgi applications? Thank You! Marcus --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org