Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Addbs adds no backslash
Message
From
23/10/2006 18:37:03
 
 
To
23/10/2006 14:47:08
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:
01164011
Views:
11
>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?
Groet,
Peter de Valença

Constructive frustration is the breeding ground of genius.
If there’s no willingness to moderate for the sake of good debate, then I have no willingness to debate at all.
Let's develop superb standards that will end the holy wars.
"There are three types of people: Alphas and Betas", said the beta decisively.
If you find this message rude or offensive or stupid, please take a step away from the keyboard and try to think calmly about an eventual a possible alternative explanation of my message.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform