Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Addbs adds no backslash
Message
From
23/10/2006 22:11:12
 
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01163916
Message ID:
01164028
Views:
11
I would agree that the help text should point this behavior out, but it does do what it says it will do.

Peter, in the real world, why is this a problem?


>>By design.
>>
>>Also a potential security issue. If you added a BS to a blank string, you get the root of the current ("SET DEFAULT") drive which may not be a good idea.
>
>Okay, so it was done by design and because someone thought it might be a potential security issue. Nevertheless, in this specific case, the function does NOT do what its name says it will gonna do! It promisses to add a backslash at the end if there is none yet. This is also what the helptext explicitly promisses. Nowhere in the helptext there is a mention of this one and only exception! The programmer expects that a path that is treated with the addbs() function is always, guaranteed, one with a backslash at the end. And all of a sudden the program crashes because there occurs a situation that no backslash was added?! Talking about a security issue.
>
>>OTOH, if you are specific, as in ADDBS(SET("DEFAULT")) then it adds a BS to the drive letter.
>
>Sure, but addbs() is meant to add a backslash to a path. A path does not necessarilly contain a drive letter.
>
>Anyway, as you said, it is by design. So, we'll have to deal with it. Hope this thread has made some people aware of the potential harm.
>
>>
>>>I have noticed that addbs() does not add a backslash if given an empty path. I'd expect a backslash even in that case, creating a reference to the root! I can't imagine that this was done by design. Who's at vault?
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform