Re: File Import permission problem

Josh Escobedo <[email protected]> Tue, 22 Jun 2004 19:22:05 -0500
Newsgroups gmane.comp.audio.netjuke.user
Message-ID <[email protected]>
Weird.

In lib/inc-admin.php , I found this function:
function CheckDataDirPerm() {
   $path =3D str_replace('//','/',FS_PATH."/".DATA_DIR_IMPORT);
   if (  !file_exists($path) || !is_writable($path) ) {
     alert(INCADM_NOPERM);
     exit;
   }
}

That's what the import proggie calls on to check the permissions of the=20
data directory.  I commented out the alert and the exit, and gave it a=20
shot.  It worked.  For some bizarre reason, it's trying to process=20
FORMAT_SAMPLE.txt even though I wasn't checking that file's checkbox.  At=20
any rate, it ran, and gave me this info:

Found 2 file(s) to process in the default import folder.
/usr/home/josh/mainweb/netjuke/var/data/import
Processing FORMAT_SAMPLE.txt.
Ignoring column names
|
Inserted 1 track(s), 0 artist(s), 0 album(s), 0 genre(s).

Warning:=20
rename(/usr/home/josh/mainweb/netjuke/var/data/import/FORMAT_SAMPLE.txt,/usr=
/home/josh/mainweb/netjuke/var/data/backup/FORMAT_SAMPLE.txt):=20
Permission denied in=20
/usr/home/josh/mainweb/netjuke/admin/tabfile-import.php on line 221
Archiving FORMAT_SAMPLE.txt as=20
/usr/home/josh/mainweb/netjuke/var/data/import/FORMAT_SAMPLE.txt
Done with /usr/home/josh/mainweb/netjuke/var/data/backup/FORMAT_SAMPLE.txt!

Processing jukeback.txt.
Ignoring column names
|||||||||||||||||||||||||||||||||||||||||||||||||   =BB   50
||||||||||||||||||||||||||||||||||||||||||||||||||   =BB   100
and so on and so on...
||||||||||||||||||||||||||||||||||||||||||||||||||   =BB   2700
||||||||||||||||||||||||
Inserted 2723 track(s), 269 artist(s), 193 album(s), 17 genre(s).

Warning:=20
rename(/usr/home/josh/mainweb/netjuke/var/data/import/jukeback.txt,/usr/home=
/josh/mainweb/netjuke/var/data/backup/jukeback.txt):=20
Permission denied in=20
/usr/home/josh/mainweb/netjuke/admin/tabfile-import.php on line 221
Archiving jukeback.txt as=20
/usr/home/josh/mainweb/netjuke/var/data/import/jukeback.txt
Done with /usr/home/josh/mainweb/netjuke/var/data/backup/jukeback.txt!

Whatever it's doing, it looks like it's trying to move files to the backup=
=20
dir after it processes them, and that's where the failure is.

Everything seems okay now.  Now on to the fun of getting it to feed=20
icecast->shoutcast :P

Stress and all, this netjuke thing still rocks.

At 07:01 PM 6/22/2004, you wrote:
>Anders,
>
>I assumed they were, but just to be sure I chmod'd var/data as you=20
>suggested and it still pops up the same error upon import attempt :/  If I=
=20
>click "View File" I get the import file as text in my browser.  But if I=20
>try to import, permissions error :/
>
>At 06:44 PM 6/22/2004, you wrote:
>>Hi Josh,
>>
>>I would guess that the /var/data/ directory is not readable by the user=20
>>that your Apache runs as.
>>
>>If that is the case, a
>>
>>chmod -R a+rx /var/data
>>
>>could solve it.
>>
>>Regards - Anders Ekstrand, Sweden
>>
>>________________ Reply Header ________________
>>Subject:        [Netjuke-users] File Import permission problem
>>Author: Josh Escobedo <[email protected]>
>>Date:           22nd June 2004 4:32:18 pm
>>
>>Hiya folks,
>>
>>So I was running netjuke with mySQL on windows2K with IIS/PHP, and thought
>>"hey!  How about I take advantage of this awesome portability in netjuke=
 by
>>moving it to a platform that doesn't suck!"
>>
>>Anyhow.  I installed netjuke on my FreeBSD box no problem, did the usual
>>mucking around getting everything else going (apache+PHP+postgres), and=
 now
>>everything's kosher.  Netjuke works.  All my media is mounted with
>>sharity-light (it still lives on the windows box) in the exact same
>>directory structure that my first install of netjuke used
>>(/netjuke/var/music/).
>>
>>I did a backup of the db on the windows box, got a text file in
>>/netjuke/var/data/backup.  I copied that text file to the FreeBSD box in
>>/netjuke/var/data/import.
>>
>>When I try to process the import on the FreeBSD box, I get a javascript
>>popup (VERY ANNOYING ERROR DELIVERY BY THE WAY) that says,
>>simply:  "Permissions Error with the netjuke /var/data/ directory."
>>
>>Can anyone shed any light on that?  "Permissions Error" doesn't really=
 tell
>>me much.  I mean, it tells me it's a permissions error, but it doesn't=
 tell
>>me exactly how whatever it was failed or what to do about it.
>>
>>Help?  Is there a way to do this import via command-line on the
>>server?  I'll re-import everything if I have to, but I was really hoping=
 to
>>avoid that since the netjuke database is actually far more accurate than=
 my
>>ID3 tags and whatnot.  Especially with regard to genre.
>>
>>
>>
>>-- josh escobedo, computer support
>>     office of international services
>>     university of illinois at chicago
>>     -------------------------------------
>>     Any opinions expressed in the content of this e-mail
>>     are the sole responsibility of the author, and do not
>>     reflect the opinions, policies or intentions of the
>>     University of Illinois at Chicago, the Office of the Vice
>>     Chancellor for Student Affairs, the Office of International
>>     Services, or their assigns.
>>
>>
>>
>>-------------------------------------------------------
>>This SF.Net email sponsored by Black Hat Briefings & Training.
>>Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
>>digital self defense, top technical experts, no vendor pitches,
>>unmatched networking opportunities. Visit www.blackhat.com
>>_______________________________________________
>>Netjuke-users mailing list
>>[email protected]
>>https://lists.sourceforge.net/lists/listinfo/netjuke-users
>
>-- josh escobedo, computer support
>    office of international services
>    university of illinois at chicago
>    -------------------------------------
>    Any opinions expressed in the content of this e-mail
>    are the sole responsibility of the author, and do not
>    reflect the opinions, policies or intentions of the
>    University of Illinois at Chicago, the Office of the Vice
>    Chancellor for Student Affairs, the Office of International
>    Services, or their assigns.
>
>
>-------------------------------------------------------
>This SF.Net email sponsored by Black Hat Briefings & Training.
>Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self=
=20
>defense, top technical experts, no vendor pitches, unmatched networking=20
>opportunities. Visit www.blackhat.com
>_______________________________________________
>Netjuke-users mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/netjuke-users

-- josh escobedo, computer support
    office of international services
    university of illinois at chicago
    -------------------------------------
    Any opinions expressed in the content of this e-mail
    are the sole responsibility of the author, and do not
    reflect the opinions, policies or intentions of the
    University of Illinois at Chicago, the Office of the Vice
    Chancellor for Student Affairs, the Office of International
    Services, or their assigns.=20



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com