Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crossclient and mapsindex



> 
> Hi,
> 
> I take version 89.2 and have a probleme:
> I manage crossfire here as simple user privilege: it is under my directory and
> it is setsuid. The setsuid is not propagat between station. Then I run server
> on a station and everybody could connect via crossclient.. but crossclient
> want to to open mapsindex and it can't because it isn't setsuid. I don't
> think that it need this file (quick look on source). Then how no modify
> crossclient to prevent it to try to open this file (or other like it) ?
> I runing on SunOs 4.1.3 on Sun4m & 4c
I fix the probleme and this-is the patch I propose for next version. There is
also a correction for display : When DISPLAY is :0.0 to use Unix socket,
crossclient send :0.0 to server then server open display of local display
where is running. I add the named of hostname if DISPLAY begin by ":".


*** crossfire-0.89.2/clien/client.c.old	Sun Mar  7 12:06:44 1993
--- crossfire-0.89.2/clien/client.c	Fri Mar 26 10:09:50 1993
***************
*** 63,68 ****
--- 63,69 ----
  main(int argc, char **argv, char **env)
  {
    char *dispname = (char *) getenv("DISPLAY");
+   char localdispname[65+6];
    char *hostname = (char *) getenv("HOST");
    char *optcmd = (char *) NULL;
    char *ch;
***************
*** 77,83 ****
    FILE *fpin,*fpout;
    use_pixmaps = 0;
  
!   init_library();
  
    for (i = 1; i < argc; i++)
    {
--- 78,86 ----
    FILE *fpin,*fpout;
    use_pixmaps = 0;
  
!   /*init_library();*/
!   init_globals();
!   init_defaults();
  
    for (i = 1; i < argc; i++)
    {
***************
*** 144,149 ****
--- 147,153 ----
    }
    username = strdup_local(pwent->pw_name);
  
+ 
    if (optcmd == (char *) NULL)
    {
      if (dispname == (char *) NULL)
***************
*** 152,157 ****
--- 156,174 ----
        fprintf(stderr, "(Or specify it with the -display option.)\n");
        return 1;
      }
+     if (*dispname == ':')
+     {
+       char localhostname[65+6];
+ 
+       if ((int)gethostname(localhostname, 65))
+       {
+ 	fprintf(stderr, "Can't get local hostname.\n");
+ 	perror("gethostname ");
+       }
+       sprintf(localdispname, "%s%s", localhostname, dispname);
+       dispname = localdispname;
+     }
+ 
      if ((display = XOpenDisplay(dispname)) == (Display *) NULL)
      {
        fprintf(stderr, "Can't open display %s.\n",dispname);
--