🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: apana.lists.os.linux.c-programming
Article #4

chown, getuid and getgid operations

#4
From: Nathan Bird
Date: Tue, 26 Sep 2000 00:00
22 lines
1877 bytes
Hi,

I am trying to write a web page script in C which is to take a username and
password from a HTML form and process it in the C code.
The code then has to create a public_html directory under the users home
directory ( specified by the username ) and then creates an index.html file.

The part I am getting stuck on is I have to set the directory and files to
the correct user and groups. ( ie the username entered in the HTML form ), I
know the command setuid, setgid and getuid, and getgid exist however they
only allow you to set it to the value of the person calling the process
which is NOBODY. As nobody is the value always used when a process is called
from a Web Page.

Does anyone know how to take the value in the string/char array "username"
and run the chown() command and pass it the "username" rather then the id of
the process caller.

Thanks in advance

Nathan
nathanb@hunterlink.net.au
Technical Details
Message-ID: <39d02c9f$1@news.hunterlink.net.au>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fdf5c,2e5e1279a45cbb62,start
X-Google-Attributes: gidfdf5c,public
X-Google-Thread: 1116e3,2e5e1279a45cbb62,start
X-Google-Attributes: gid1116e3,public
X-Google-Thread: 10aedf,2e5e1279a45cbb62,start
X-Google-Attributes: gid10aedf,public
From: "Nathan Bird" <nathanb@hunterlink.net.au>
Subject: chown, getuid and getgid operations
Date: 2000/09/26
Message-ID: <39d02c9f$1@news.hunterlink.net.au>
X-Deja-AN: 674162302
X-Original-NNTP-Posting-Host: berrigan.hunterlink.net.au
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
X-Complaints-To: abuse@pacific.net.au
X-Trace: nina.pacific.net.au 969944282 6915 203.12.144.16 (26 Sep 2000 04:58:02 GMT)
Organization: HunterLink Pty Ltd
X-MSMail-Priority: Normal
NNTP-Posting-Date: Tue, 26 Sep 2000 04:58:02 +0000 (UTC)
Newsgroups: apana.lists.os.linux.c-programming,linux.dev.c-programming,linux.dev.newbie