#perl
02 November 2007
Total 47 pages. You are browsing page 3/47.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
01:07 <****> :)
01:07 <****> jagerman jawohl
01:07 <****> You're like a little who kid sneaks up and starts smiling, as if to say "Guess what I just did"
01:09 <****> jagerman I'm like a fortyish hairy male who is trying to tie some loose ends at 2AM after 4 pints and sometimes forgets to hit Rightshift-RightAlt when switching channels. ok ?
01:09 <****> _abc_: Not you, jawnsy.
01:09 <****> well I answered both of you I guess
01:11 <****> :)
01:12 <****> anyone know of a module that will take a path like '../foo/./bar///../baz' and return '/foo/baz' without relating to an actual filesystem (ala realpath())?
01:12 <****> File::Spec
01:12 <****>canonpath("../foo/./bar///../baz");
01:12 <****> Somni: ../foo/bar/../baz
01:12 <****> hm
01:12 <****> Somni: File::Spec won't do '..' (at least from what i can tell)
01:13 <****> it will, hang on
01:13 <****> whoa. buubot has almost all of cpan loaded ?
01:13 <****> wow
01:13 <****> File::Spec is core
01:13 <****> ah, ok
01:13 <****> Hi
01:13 <****> Somni: don't worry about it. if you know it will do it, i can do some more tinkering.
01:14 <****> just don't ask buubot any imdb questions
01:14 <****> I running a process with open(P,"foo |");
01:14 <****> iank: any info on how to integrate them. seems complicated at first glance.
01:14 <****> that foo process is reading
01:15 <****> I was thining I could feed the stdin of foo by printing on the filehandler (P) but it seems I am not doing things as I should
01:15 <****> I think you mean | foo
01:15 <****> pravus: I think it involves no_upwards, splitdir, and catdir
01:16 <****> GumbyBRAIN: bardigndamn
01:16 <****> you kinky fucker.
01:16 <****> Somni: jawohl!
01:16 <****> right ?
01:16 <****> pravus: with a splitpath and catpath in there to be portable
01:16 <****> pravus: File::Spec can be pretty ugly
01:16 <****> _abc_ yes
01:16 <****> I swear File::Spec won't strip ".."
01:16 <****> It can't.
01:16 <****> Because it won't create the same path.
01:16 <****> good point buu
01:16 <****> Somni: probably not as ugly as what i'd come up with ;)
01:16 <****> I got bitten by some symbolic links like that recently
01:16 <****> buu: symlinks
01:16 <****> pravus: Yes.
01:17 <****> _abc_ thanks it works with | ahead
01:18 <****> but how come realpath(3) does it anyway ?
01:18 <****>catpath($v, $d, $f);
01:18 <****> Somni: foo/bar/baz
01:18 <****> pravus: oh, but you were looking for virtual .. handling, that would strip parents out
01:18 <****> yea, it won't do that
01:18 <****> uuugh how beautiful
01:19 <****> Somni: perhaps i could splitpath() and then handle for '.' and '..'?
01:19 <****> you don't need to handle ., canonpath does that
01:19 <****> jdv79: you don't, really. They're entirely different systems, they do different things.
01:20 <****>updir yourself
01:20 <****> jdv79: It's just nice to have them both running on a network.
01:20 <****> Somni: i'll play. thanks for the pointers.
01:20 <****> Stripping parents isn't always a good idea
01:20 <****> yeah ok, thanks
01:21 <****> There's some weird corner cases involving symlinked directories, where it doesn't work
01:21 <****> LeoNerd: i don't need to handle for symlinks
01:21 <****> well, sometimes you're handed a path that's based on a virtual directory, and you just want to get rid of updir to sanitize it, but you don't just want to strip it out
01:21 <****> GumbyBRAIN: feed a baby chilly
01:21 <****> Chilly i dont have a baby out in the basic idea.
01:22 <****> Somni++ # ^_^
01:22 <****> Thing is... given /somewhereIcannotsee/../somethingelse should that convert to /somethingelse ?
01:22 * jagerman stirs the GumbyBRAIN pot
01:22 <****> guys i made a perl script that works just fine when called directly through the command line
01:22 <****> gumbybrain is a little pot.
01:22 <****> LeoNerd: in my world, yes. always.
01:22 <****> but when i execute it from an http request, using php
01:22 <****> i get a lot of errors
01:22 <****> concerning the perl script
01:22 <****> Oh good christ, do you really expect us to read past "using php"?
01:23 <****> pravus: Even though if you accessed that at a filesystem level, you'd get EPERM ?
01:23 <****> errors like File::Util can't open
01:23 <****> »/home/daniel/www/aguas/relatorios/REPOSITORY/«
01:23 <****> because no such file or directory exists.
01:23 <****> LeoNerd: yes. this is a virtual path.
01:23 <****> but this directory obviously exists...
01:23 <****> Insolit: It's possible it doesn't have permission to access it
01:23 <****> i want *no* filesystem traversal/verification
01:23 <****> Insolit: Either at that level, or somewhere along the path
01:24 <****> mh
01:24 <****> Also check for silly things like chomping filenames if they come from filehandles
01:24 <****> I keep doign that - forget to strip the trailing linefeed, fail to open the file, wonder why
01:24 <****> jagerman: so it's not enought that REPOSITORY directory has 666 permissions?
01:25 <****> aaugh who is making things world-writable?
01:25 <****> Insolit: If a/b/c is 777, but a/b is 700, it doesn't matter that c is 777 because you need to be allowed to access b to get at it.
01:25 <****> Insolit: this is like watching a train wreck :)
01:26 <****> Can be useful for chrooting
01:26 <****> Furthermore, if REPOSITORY is a directory, 666 is most likely wrong.
01:26 <****> Parent dirs need to be traversable (`executable').
01:26 <****> And yeah, if it's 666.. it's /not/ traversable.
01:26 <****> jagerman: what's the right permissions then?
01:26 <****> i need that folder to have write and read permissions
01:27 <****> read and write for who?
01:27 <****> Use? Group? Other?
01:27 <****> well to all
01:27 <****> 744 or 774 + the proper group would be ideal
01:27 <****> i guess
01:27 <****> I have to leave. Some other wonderfully helpful #perl person will no doubt assist.
Total 47 pages. You are browsing page 3/47.
First :: Prev :: [1] [2] [3] [4] [5] [...] :: Next :: Last
