1w6 uRPG 1w6 uRPG
  • Anmelden
  • Öffentlich

    • Öffentlich
    • Gruppen
    • Beliebt
    • Verzeichnis

Unterhaltung

Nachrichten

  1. drak drak

    mkdir -p /tmp/ask; cd /tmp/ask && touch -- -i askme && rm *

    Wednesday, 12-Jul-17 15:05:42 UTC von web
    • mcscx und clacke gefällt das.
    • mcscx mcscx

      @drak Nice one :-) A reminder to prefer ./* to *.

      Wednesday, 12-Jul-17 15:30:22 UTC
      drak gefällt das.
    • benediktg benediktg mcscx

      @mcscx @drak https://gnusocial.de/attachment/4090600

      Wednesday, 12-Jul-17 15:55:47 UTC
      drak gefällt das.
    • mcscx mcscx benediktg

      @benediktg don't try this (unless you want to delete your home dir): "touch -- -rf \$HOME askme; rm *" @drak #DONTTRYTHISATHOME

      Wednesday, 12-Jul-17 16:40:11 UTC
      drak gefällt das.
    • mcscx mcscx benediktg

      @benediktg oh, interesting, why is your "-i" file still there? Doesnt zsh expand "*" to "-i askme"?

      Wednesday, 12-Jul-17 16:50:29 UTC
    • drak drak mcscx

      yes, it does. And then rm does `rm -i askme`, meaning: delete askme with required user interaction (-i) :)

      Thursday, 13-Jul-17 06:41:01 UTC
      mcscx gefällt das.
    • drak drak mcscx

      did you try this? It does not work for me.

      Friday, 14-Jul-17 07:44:20 UTC
    • mcscx mcscx mcscx

      @drak indeed it doesnt work. It seems bash doesn't do variable expansion after pathname expansion.I wonder if there are other malicious ways

      Friday, 14-Jul-17 10:06:56 UTC
      drak gefällt das.
    • mcscx mcscx bash , mcscx

      !bash tip: After setting "shopt -s extglob" you can exclude patterns from bash's #pathname #expansion:
      ls /bin/!(*a*|*b*)

      Friday, 14-Jul-17 10:24:08 UTC
    • mcscx mcscx bash , mcscx

      !bash tip: After setting "shopt -s extglob" you can exclude patterns from bash's #pathname #expansion:
      ls /bin/!(*a*|*b*)

      Friday, 14-Jul-17 10:24:08 UTC
      drak gefällt das.
    • clacke clacke mcscx

      @mcscx Ooh, yes, nice workaround.

      Or just, in scripts always put filenames after `--` when possible. It's hard enough to quote everything everywhere.

      Monday, 17-Jul-17 08:31:52 UTC
    • clacke clacke mcscx , perloid

      @mcscx Nope, the evaluation order of the various replacements in bash is pretty clearly documented, and I'm sure it's in one of @perloid's excellent episodes. :-)

      Monday, 17-Jul-17 08:34:08 UTC
      drak gefällt das.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Hilfe
  • Über
  • FAQ
  • AGB
  • Privatsphäre
  • Quellcode
  • Version
  • Kontakt

1w6 uRPG ist ein Mikrobloggingdienst von Arne (Drak) Babenhauserheide. Es wird mit der Mikrobloggingsoftware StatusNet (Version 1.1.1-release) betrieben, die unter der GNU Affero General Public License erhältlich ist. The running version includes the patches from draketo.de/proj/statusnet-patches.

Creative Commons Attribution 3.0 Alle Inhalte und Daten von 1w6 uRPG sind unter der Creative Commons Attribution 3.0 Lizenz verfügbar.