This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

userfile permissions

Old posts that have not been replied to for several years.
Locked
J
Jay
Voice
Posts: 7
Joined: Thu Mar 18, 2004 3:44 pm

userfile permissions

Post by Jay »

hey,

as I'm looking trough the .c code in the src directory I can't find why the eggdrop changes the permissions of the .user file after altering it.

I'm trying to read the userfile trough a php script, offcorse it there are only user permissions , apache can't read it. chmodding it won't help cause it keeps changing the permission after writing to it.

any suggestions to make it so that I can read it.

tnx
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

How about chmodding it before you access it each time in PHP?

Code: Select all

function chmodfile( $strFile )
{
    chmod("$strFile", 0755);
}
Just call that function each time before you access the userfile

Jon.
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
J
Jay
Voice
Posts: 7
Joined: Thu Mar 18, 2004 3:44 pm

Post by Jay »

because php (Apache) isn't the owner of the file, so chmodding it before accessing the file isn't possible. Tryed that one before I posted my question :) thanks.
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

Jay wrote:because php (Apache) isn't the owner of the file, so chmodding it before accessing the file isn't possible. Tryed that one before I posted my question :) thanks.
How about running a small script on your bot on a timer to chmod its userfile every minute or half hour depending on how often your userfile is used?
The lifecycle of a noob is complex. Fledgling noobs gestate inside biometric pods. Once a budding noob has matured thru gestation they climb out of their pod, sit down at a PC, ask a bunch of questions that are clearly in the FAQ, The Noob is born
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

from default eggdrop.conf:
# This specifies what permissions the user, channel, and notes files should
# be set to. The octal values are the same as for the chmod system command.
#
# To remind you:
#
# u g o u g o u g o
# 0600 rw------- 0400 r-------- 0200 -w------- u - user
# 0660 rw-rw---- 0440 r--r----- 0220 -w--w---- g - group
# 0666 rw-rw-rw- 0444 r--r--r-- 0222 -w--w--w- o - others
#
# Note that the default 0600 is the most secure one and should only be changed
# if you need your files for shell scripting or other external applications.
set userfile-perm 0600
J
Jay
Voice
Posts: 7
Joined: Thu Mar 18, 2004 3:44 pm

Post by Jay »

must overlooked it, I'm sorry .

tnx for your answer
Locked