Re: XForms: Building Virtual Private Networking solution with Xforms

Steve Lamont (spl@szechuan.ucsd.edu)
Thu, 29 Jan 98 12:18:59 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> o Several portions of this application will need to run setuid
> root. Is the xforms library safe in this regard or should I
> concentrate the security sensitive code in helper processes.

I haven't done an exhaustive analysis of the code so I can't say too
much here -- TC will probably have to comment on these issues. I'd
say offhand that it's probably about as safe as X is.

> o If I have a sequence:
>
> main() /* Xforms app */
> {
> ...
> childpid = fork();
> if (childpid != 0) {
> /* Still xforms app */
> }
> else if (childpid == 0) {
> /* new app... */
>
> terminate_xforms_interaction();
>
> execlp("Some other code", NULL);
> }
> ...
> }
>
> What do I have to put in the function
> terminate_xforms_interaction() to make sure that the actions in
> my child processes don't screw up Xforms in any way?

Pretty much nothing since when you execlp() the connection with the X
server is closed automagically. The X connection file descriptor is
marked close-on-exec. If you specifically need that descriptor, then
you can use the Xlib macro ConnectionNumber() to get the server's file
descriptor.

Obviously, you should execute no XForms (or Xlib) functions which
interact with the server in the child process.

Unless there's a hidden gotcha somewhere, I think that's about it.

Cool project.

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bloch.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/