Previous Thread
Next Thread
Print Thread
Hop To
Anonymous
Unregistered
Anonymous
Unregistered
Where: UBB 6.3 BR 1 - ubb_lib_secgroups.cgi

Description: Incorrect usage of $_[0]. $_[0] is a anonymous hash that seems to contain the %in as well %filehandler (%filehandler has %lockfile which has %config). There is also a shortcut {CONFIG} reference. The problem lies in the following code:

<pre>
if (!-d "$_[0]->{NonCGIPath}/cache-$_[0]->{cache_pw}") {
mkdir("$_[0]->{NonCGIPath}/cache-$_[0]->{cache_pw}", 0777);
chmod(0777, "$_[0]->{NonCGIPath}/cache-$_[0]->{cache_pw}");
} # cache

if (!-d "$_[0]->{MembersPath}/user_groups") {
mkdir("$_[0]->{MembersPath}/user_groups", 0777);
chmod(0777, "$_[0]->{MembersPath}/user_groups");
} # user_groups
</pre>

$_[0] is incorrectly referenced and thus will cause unnecessary directories to be created.

Fix: To fix this, make use of $_[0]->{CONFIG} like the following:

<pre>
if (!-d "$_[0]->{CONFIG}->{NonCGIPath}/cache-$_[0]->{cache_pw}") {
mkdir("$_[0]->{CONFIG}->{NonCGIPath}/cache-$_[0]->{cache_pw}", 0777);
chmod(0777, "$_[0]->{CONFIG}=>{NonCGIPath}/cache-$_[0]->{cache_pw}");
} # cache

if (!-d "$_[0]->{CONFIG}->{MembersPath}/user_groups") {
mkdir("$_[0]->{CONFIG}->{MembersPath}/user_groups", 0777);
chmod(0777, "$_[0]->{CONFIG}->{MembersPath}/user_groups");
} # user_groups

</pre>

[This message was edited by Charles Capps on August 23, 2002 at 10:35 AM.]

Anonymous
Unregistered
Anonymous
Unregistered
THANK YOU qasic! I've been trying to figure this one out for quite a long time... Fixed in 6.3.1

--
Charles Capps
UBB.classic™ Developer
Having problems? Open up a support ticket!


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
PHP 8 bug in membermanage.tmpl
by phoenix011235 - 09/08/2026 7:47 PM
Are any of these legitmate?
by Baldeagle - 09/06/2026 1:37 PM
After server reboot
by Morgan - 09/02/2026 8:27 AM
Email Settings
by Outdoorking - 05/13/2026 2:44 AM
Who's Online Now
0 members (), 206 guests, and 158 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Ride safe!
Ride safe!
by Morgan, December 7
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Powered by UBB.threads™ PHP Forum Software 8.1.0
(Snapshot build 20260527)