Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Malware on CPAN

by Anonymous Monk
on Jun 20, 2012 at 16:51 UTC ( #977405=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Malware on CPAN
in thread Malware on CPAN

Say, why would you do while loop instead of xargs ...

find ... -print0 | xargs -0 chmod ...

... ?

Somewhat related, I have come to like symbolic permission modes to selectively modify the permissions while preserving the rest ...

# Strip group- & world-write permissions. chmod -R g-w,o-w directory


Comment on Re^3: Malware on CPAN
Select or Download Code
Re^4: Malware on CPAN
by taint (Chaplain) on Jun 20, 2012 at 17:57 UTC

    Say, why would you do while loop instead of xargs ...
    find ... -print0 | xargs -0 chmod ...
    ... ?

    For consistency across *NIX's && versions || find(1) is guaranteed to return the same results, regardless of *NIX || version. :)

    #!/usr/bin/perl -Tw
    use strict;
    use perl::always;
    my $perl_version( 5.12.4 );
    print $perl_version;
      "For consistency across *NIX's && versions || find(1) is ...."

      Woah! The question was why are you using a while loop instead of xargs. You did nothing to show how xargs fails to work as reliably as a while loop.

        D'OH!
        Right you are! Sorry, I'm afraid I hadn't finished my first cup of coffee yet (late night).
        Operating a keyboard without sufficient coffee, should be considered as bad as
        drinking, and driving -- that's one citation for me! :/
        To your original point; My previous attempts with xargs(1) produced inconsistent results -- hence, my previous reply.
        But what about the "for loop", you ask? Probably overkill; I used it, it worked && bad habits die hard. ;)
        I should use this as an opportunity to conjure up a perl script, to accomplish these same tasks. :)

        use perl::always;
        my $perl_version( 5.12.4 );
        print $perl_version;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://977405]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (17)
As of 2015-07-01 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (19 votes), past polls