Subject: Re: Plug-gw and userid patch?

From: "[email-masked]"<[email-masked]>
Date: Thu, 26 Apr 2001 07:52:58 +0100

[To be removed from this list send the message "unsubscribe fwtk-users" in the
BODY of a mail message to [email-masked].]

Hello; 
few weeks ago i posted the same kind of messages, but 
still waiting :(
I do a workaround for this userid/grouid issue. ( 
mainly a copy/paste of other *-gw userid/groupid 
support. )

As i am not very confident with my C skills i'd like 
people of the early developpers to tell if it's this 
workaround is ok or not and maybe (if it is so simple 
as that why it  has not been implemented at start-
up ? :) ) 

Thanks, 

Quentin GIORGI 
Network enginner.
[email-masked]

diff between plug-gw.c files: 
55,56d54
<       int             rungid = -1;
<       int             runuid = -1;
119,144d116
< /*BEGIN:  ADD ON TO SUPPORT GROUPID AND USERID OPTION 
*/
<       if((cf = cfg_get("groupid",cfp)) != (Cfg *)0) {
<
<                 if(cf->argc != 1) {
<                         syslog(LLEV,"fwtkcfgerr: 
groupid must have one paramet
er,line %d",cf->ln);
<                         exit(1);
<                 }
<                 if((rungid = mapgid(cf->argv[0])) == -
1) {
<                         syslog(LLEV,"fwtkcfgerr: 
cannot map %.100s to gid",cf-
>argv[0]);
<                         exit(1);
<                 }
<         }
<
<       if((cf = cfg_get("userid",cfp)) != (Cfg *)0) {
<
<                 if(cf->argc != 1) {
<                         syslog(LLEV,"fwtkcfgerr: 
userid must have one paramete
r,line %d",cf->ln);
<                         exit(1);
<                 }
<                 if((runuid = mapuid(cf->argv[0])) == -
1) {
<                         syslog(LLEV,"fwtkcfgerr: 
cannot map %.100s to uid",cf-
>argv[0]);
<                         exit(1);
<                 }
<         }
< /* END:  ADD ON TO SUPPORT USERID AND GROUPID OPTION 
*/
<
159,168d130
< /*BEGIN:  ADD ON TO SUPPORT USERID AND GROUPID OPTION 
*/
<      if(rungid != -1 && setgid(rungid)) {
<              syslog(LLEV,"fwtksyserr: cannot setgid %
d: %m",rungid);
<              exit(1);
<      }
<      if(runuid != -1 && setuid(runuid)) {
<              syslog(LLEV,"fwtksyserr: cannot setuid %
d: %m",runuid);
<              exit(1);
<      }
<
170d131
< /*END:  ADD ON TO SUPPORT USERID AND GROUPID OPTION */

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Choisissez les offres que vous voulez recevoir
Et gagnez une playstation 2 ou des baladeurs MP3 
----> http://www.respublica.fr/site/yoptin <----
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---

From: Scott Campbell <[email-masked]>
Date: Thu, 26 Apr 2001 13:05:37 -0700 (PDT)

> as that why it  has not been implemented at start-

I spoke too soon - sort of - up until now all my plug-gw proxies have had
their rules as:

plug-gw:  port ....

since using the proxy name didn't work.  After I put in your diffs I now
have to put in the actual names of the proxies like:

geoweb-gw: port ....

which would mean for each plug-gw instance I need a rule in the
netperm-table to give the userid and groupid - hmmm there must be a way
for it to read its own plus the plug-gw lines. (damn my lack of C skills -
will poke away for awhile on it though)

Thanks again for your push in the right direction.

Scott E. Campbell
_______________________________
Computer Operations
Greater Victoria Public Library
Victoria BC CANADA