Re: [OFF-TOPIC] File permissions

From: Jarhad Idanno (Jarhad@webmail.merging.org)
Date: 05/08/03


--- Templar Viper <templarviper@HOTMAIL.COM> wrote:
>I'm running Circlemud 3.1 with Oasisolc, ascii player files and more on a
>redhat 8.0 machine. I have some problems with file permissions however.
>Sometimes after a copyover/reboot after a compile, the muds boots fine,
>but when I try to log in, the mud complains it can't read the player file.

Hi Templar Viper,
actually your problem has nothing to do with file permissions on your OS.  I also encountered this problem some time back.
It seems that after someone receives mail, his name in the player_table is capitalized (until now I still can't locate the code that does this), but since the name of the pfile is stored in small letters, of course the system won't be able to open the capitalized file since it doesn't exist.
My solution was rather simple.  In db.c, under load_char:

     sprintf(filename, "%s%s%c%s%s%s", PLR_PREFIX, SLASH, *player_table[id].name,
       SLASH, player_table[id].name, PLR_SUFFIX);
+      /* Try to rectify the problem first.  Perhaps name is capitalized? */
+      if (player_table[id].name[0] != LOWER(*name))
+        player_table[id].name[0] = LOWER(*name);
+      save_player_index();
+      sprintf(filename, "%s%s%c%s%s%s", PLR_PREFIX, SLASH, *player_table[id].name,
+        SLASH, player_table[id].name, PLR_SUFFIX);
     if(!(fl = fbopen(filename, FB_READ))) {
       mudlog(NRM, LVL_GOD, TRUE, "SYSERR: Couldn't open player file %s", filename);
       return (-1);
     }


Jarhad Idanno

_____________________________________________________________
Play at A Merging of Fates MUD and get free E-Mail too! http://www.merging.org

_____________________________________________________________
Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/26/03 PDT