Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: jobs -Z example?



On Sun, 15 Mar 2009, Bart Schaefer wrote:

> Some OSs stash the original command and environment so that you can't 
> conceal them this way, because malware sometimes attempts to disguise 
> itself with this trick so it's considered more secure to disallow it.
>
> Try this:
>
>    perl -e '$0 = "Test hiding command"; sleep 10;' & ps $!
>
> If perl is able to do it but zsh is not, then it's just that FreeBSD has 
> a different mechanism for it and we may be able to patch zsh.
=====================

weird.... (FreeBSD 6.2-RELEASE amd64) it sometimes works under bash, 
doesn't work under zsh. see below. similar results in a 7.1-STABLE jail, 
but it seems more likely to work as desired.


* bash:
for n in {1..10}; do
    perl -e '$0 = "Test hiding command"; sleep 10;' &
done ; ps -t p7
[1] 5247
[2] 5248
[3] 5249
[4] 5250
[5] 5251
[6] 5252
[7] 5253
[8] 5254
[9] 5255
[10] 5256
   PID  TT  STAT      TIME COMMAND
   945  p7  Is     0:00.87 zsh
  4843  p7  S      0:00.15 bash
  5247  p7  S      0:00.01 Test hiding command (perl5.8.8)
  5248  p7  S      0:00.01 Test hiding command (perl5.8.8)
  5249  p7  S      0:00.01 Test hiding command (perl5.8.8)
  5250  p7  S      0:00.01 Test hiding command (perl5.8.8)
  5251  p7  R      0:00.00 perl -e $0 = "Test hiding command"; sleep 10; (perl5.8.8)
  5252  p7  S      0:00.01 Test hiding command (perl5.8.8)
  5253  p7  RL     0:00.00 perl -e $0 = "Test hiding command"; sleep 10; (perl5.8.8)
  5254  p7  R      0:00.00 perl -e $0 = "Test hiding command"; sleep 10; (perl5.8.8)
  5255  p7  S      0:00.01 Test hiding command (perl5.8.8)
  5256  p7  D      0:00.00 perl -e $0 = "Test hiding command"; sleep 10; (perl5.8.8)
  5257  p7  R+     0:00.00 ps -t p7

* zsh:
for n in {1..10}; do
    perl -e '$0 = "Test hiding command"; sleep 10;' &
done ; ps -t p7
[2] 5341
[3] 5342
[4] 5343
[5] 5344
[6] 5345
[7] 5346
[8] 5347
[9] 5348
[10] 5349
[11] 5350
   PID  TT  STAT      TIME COMMAND
   945  p7  Ss     0:01.00 zsh
  5341  p7  RN     0:00.00 zsh
  5342  p7  RNL    0:00.00 zsh
  5343  p7  DN     0:00.00 zsh
  5344  p7  DN     0:00.00 zsh
  5345  p7  DN     0:00.00 zsh
  5346  p7  DN     0:00.00 zsh
  5347  p7  DN     0:00.00 zsh
  5348  p7  DN     0:00.00 zsh
  5349  p7  DN     0:00.00 zsh
  5350  p7  DN     0:00.00 zsh
  5351  p7  R+     0:00.00 ps -t p7




-- 
         ...atom

  ________________________
  http://atom.smasher.org/
  762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
  -------------------------------------------------

 	To become vegetarian is to step into the stream
 	which leads to nirvana.
 		-- Buddha



Messages sorted by: Reverse Date, Date, Thread, Author