| « Prev | Page 1 | Page 2 | Page 3 | Next » |
|
$ chmod article 666
FIRST! |
|
Too simple. My method of checking file permissions would have many more steps, and involve a wooden table.
|
Re: Now I Have Two Hundred Problems
2008-11-10 09:06
•
by
jamface
(unregistered)
|
No... chmod article 777 I want to be able to execute the code in it too! |
Re: Now I Have Two Hundred Problems
2008-11-10 09:06
•
by
The Complicator
(unregistered)
|
|
Gloves!
|
Re: Now I Have Two Hundred Problems
2008-11-10 09:08
•
by
changa dullwit
(unregistered)
|
|
regex rulez not
|
Pretty sure those are backwards - the 256 is owner read and the 4 is other read (since mode 0600 is read/write only for the owner, not other users). |
Re: Now I Have Two Hundred Problems
2008-11-10 09:11
•
by
Barack Obama
(unregistered)
|
|
This reminds me of the following xkcd comic:
http://xkcd.com/208/ Stand Back! I know regular expressions! |
|
Heh...heh...it says "$perms".
|
Re: Now I Have Two Hundred Problems
2008-11-10 09:14
•
by
73313 permissions
(unregistered)
|
|
OK, this has to be approaching the record for number of WTFs per byte of code!
We'll just start here: $perms->mode & 0777 Whoever wrote this had some clue about masking bits in/out of the permissions result. So close, yet so far... |
Re: Now I Have Two Hundred Problems
2008-11-10 09:20
•
by
Christian Vogel
(unregistered)
|
|
http://de2.php.net/manual/en/function.posix-access.php
|
|
Stupid question, what's a clean way to do it?
|
|
if(-r $path){
# file is readable } |
Re: Now I Have Two Hundred Problems
2008-11-10 09:23
•
by
Boobies
(unregistered)
|
You missed the (.).(.) part |
|
Pretty clever though.
|
|
What exactly is a $permsbin? This code kinda makes me wanna go home to my wife and $earch for one...
|
Re: Now I Have Two Hundred Problems
2008-11-10 09:35
•
by
Adriano
|
Actually, it contained (.)..(.)..(.) Clearly a reference to Eccentrica Gallumbits, the triple-breasted whore of Eroticon Six |
Re: Now I Have Two Hundred Problems
2008-11-10 09:44
•
by
Greg
(unregistered)
|
|
LOL
|
|
The RWTF is the
$perms->mode & 0777. |
|
If you think you are going to need PERL, then it's probably too late to save you. You shall die a painful regexp death.
|
|
As someone mentioned, perl has inherited test(1)'s -r test for checking if a file is readable, and that aside stat(2) is only a partial check - it'll tell you the unix permissions, but not quite which apply to you, nor if there are ACLs involved. Most of the time you don't need to check, and if you do, chances are you want access(2). Perl's equivalent difference is in -r versus -R.
|
Re: Now I Have Two Hundred Problems
2008-11-10 09:52
•
by
mauhiz
(unregistered)
|
|
Who's buying my $permsbin?
|
Re: Now I Have Two Hundred Problems
2008-11-10 09:59
•
by
alan
(unregistered)
|
|
Hah! lol!
|
Re: Now I Have Two Hundred Problems
2008-11-10 10:01
•
by
AdT
(unregistered)
|
~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o O ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o ~~o |
Re: Now I Have Two Hundred Problems
2008-11-10 10:08
•
by
Arture Le Coiffeur
(unregistered)
|
|
stat($path) should be (stat($path))[2]
Even Rube Goldberg machines should work. |
The rebuttal to which is: (if someone knows who actually said that, that would be fantastic) |
Re: Now I Have Two Hundred Problems
2008-11-10 10:14
•
by
NiceWTF
(unregistered)
|
Failure for forgetting to include "-R" somewhere, and preferably a "/", too. |
Re: Now I Have Two Hundred Problems
2008-11-10 10:24
•
by
memals
(unregistered)
|
I believe that would be "fanguad" on the 2008-11-10 at 10:10 |
|
chmod 666 /bin/chmod
:) |
Re: Now I Have Two Hundred Problems
2008-11-10 10:33
•
by
bord4kop
(unregistered)
|
And all go into the $permsbin |
Failure for not nitpicking that the arguments are reversed. `chmod 777 article` |
Re: Now I Have Two Hundred Problems
2008-11-10 10:50
•
by
Lustig
(unregistered)
|
Is that a problem? If you are a superuser, Instead of running dubious built-in shell command search for the source code of 'chmod'. When all else fails backup your files, format the disk, and write a program in assembly language to change the permissions of a file. If you cannot trust your assembler write the generated machine code, and write it to the computer's memory. |
Re: Now I Have Two Hundred Problems
2008-11-10 10:52
•
by
Edward Royce
(unregistered)
|
The new Ovula Invaders! |
|
Could someone tell me why you want to know if a file is universally readable? I mean I could see wanting to know if some user X can read a file (if he is user/group/other to the file), but I have never written something to ensure that ugo+r was set.
|
|
EAFP anyway.
|
Re: Now I Have Two Hundred Problems
2008-11-10 11:06
•
by
SayWhat?
(unregistered)
|
|
Ah, I fondly remember Eroticon Six. But, Comic-con XII was much better. There was this woman in a Xena costume...
|
Re: Now I Have Two Hundred Problems
2008-11-10 11:08
•
by
Me
(unregistered)
|
Which is why you use S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISGID S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR if you are even going to go the route of doing this yourself and not letting perl shortcut it for you. C provides these in stat.h, and perl provides them as part of the POSIX module. |
Re: Now I Have Two Hundred Problems
2008-11-10 11:10
•
by
Me
(unregistered)
|
plz, send teh codes. |
|
You have nothing to teach to Bill Gates about UNIX. You were either still a naughty project from your parent or at most very young when Microsoft worked on XENIX.
A lot of things happened in the past. I guess you should learn about people before you bash them. |
|
..and of course there's...
$permsbin =~ s/.*(.)..(.)..(.)../$1$2$3/; I won't go into the mechanics of backtracking etc., but that expression could conceivably take many many millions of years to run... |
|
got 200 problems but a b1tch ain't one
|
Re: Now I Have Two Hundred Problems
2008-11-10 11:34
•
by
Bob
(unregistered)
|
That's because it's actually not UNIX. |
Re: Now I Have Two Hundred Problems
2008-11-10 11:36
•
by
Barack Obama
(unregistered)
|
|
This is a UNIX system. I know this!
|
Re: Bill knows all about UNIX
2008-11-10 11:45
•
by
mauhiz
(unregistered)
|
|
Yeah, he was still a $perm at that time.
|
|
Here's the correct way to do it.
1. Using a third party program that can emulate keyboard and mouse controls bring up a terminal screen. You'll need the mouse control because you have to click on the terminal shortcut. 2. In the terminal screen have it type in the file you are getting the permissions from. 3. Take a screenshot, save it to the desktop, and have the user open it in a program with OCR and have them run it and save the resulting file to the desktop as SAVEDPERMISSIONSxxxxxxxx.txt where the x's are a unique number given to the user through a message box. 4. Open the text file and use a regular expression to find the permissions. 5. Done! |
Re: Now I Have Two Hundred Problems
2008-11-10 11:48
•
by
Glow-in-the-dark
(unregistered)
|
And? Never heard of self-propagating code? :-) |
Re: Now I Have Two Hundred Problems
2008-11-10 11:49
•
by
James O'Boston
(unregistered)
|
|
so that's more like two-hundred-million little problems
|
|
So much for my mode-700 files.
rwx------ |
|
Ah, Perl. The Swiss Army Chainsaw.
|
Re: Now I Have Two Hundred Problems
2008-11-10 12:20
•
by
JamesQMurphy
|
FIFY |
Re: Now I Have Two Hundred Problems
2008-11-10 12:23
•
by
Tilman Baumann
(unregistered)
|
|
Every $perm is sacred,
Every $perm is great. If a $perm is wasted, God gets quite irate. |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |