Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
tintin++ ogg sound player script for linux
Author: Robert Smith
Submitted by: Vladaar
6Dragons ogg Soundpack
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.4
Author: Vladaar
Submitted by: Vladaar
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
Users Online
CommonCrawl, Yandex

Members: 0
Guests: 9
Stats
Files
Topics
Posts
Members
Newest Member
481
3,734
19,366
618
Micheal64X
Today's Birthdays
Vintar (28)
Related Links
» SmaugMuds.org » Bugfix Lists » SmaugFUSS Bugfix List » [Bug] pcrename incorrectly ch...
Forum Rules | Mark all | Recent Posts

[Bug] pcrename incorrectly checks the user's area instead of the target's
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Mar 5, 2005, 4:04 pm   Last edited May 11, 2005, 6:52 pm by Samson
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,643
JoinedJan 1, 2002

Bug: pcrename command incorrectly checks the user's area instead of the target's
Danger: medium
Found by: Zebeid
Fixed by: Zebeid

act_wiz.c, do_pcrename

Locate the following:

    /* Remember to change the names of the areas */
    if ( ch->pcdata->area )
    {
       char filename[MAX_STRING_LENGTH];
       char newfilename[MAX_STRING_LENGTH];

       sprintf( filename, "%s%s.are", BUILD_DIR, victim->name);
       sprintf( newfilename, "%s%s.are", BUILD_DIR, capitalize(arg2));
       rename(filename, newfilename);
       sprintf( filename, "%s%s.are.bak", BUILD_DIR, victim->name);
       sprintf( newfilename, "%s%s.are.bak", BUILD_DIR, capitalize(arg2));
       rename(filename, newfilename);
    }


Change to:

    /* Remember to change the names of the areas */
    if ( victim->pcdata->area )
    {
       char filename[MAX_STRING_LENGTH];
       char newfilename[MAX_STRING_LENGTH];

       sprintf( filename, "%s%s.are", BUILD_DIR, victim->name);
       sprintf( newfilename, "%s%s.are", BUILD_DIR, capitalize(arg2));
       rename(filename, newfilename);
       sprintf( filename, "%s%s.are.bak", BUILD_DIR, victim->name);
       sprintf( newfilename, "%s%s.are.bak", BUILD_DIR, capitalize(arg2));
       rename(filename, newfilename);
    }


A subtle yet very important little problem. Having one's own area renamed unintentionally would generally not be good. Or worse, having this command crash because the person who used the command had no area pointer!
       
Pages:<< prev 1 next >>