Re: /bin/false (was Re: security questions)

2000-10-30 Thread Jonathan Markevich
On Sun, Oct 29, 2000 at 11:50:18PM +, sena wrote:

 I heard that Jonathan Markevich wrote this on 29/10/00:
  However, writing one in C proved to be simple, and an afternoon's worth
  of fun. 
 
 --(snip - false.c)--
   int main() { return 1; }
 --(snip - false.c)--
 10 seconds writing plus 3 minutes worth of fun is more like it... :)

YOU *may* or may not have caught the subtle (and weak) humor.  Of course
you've gone and re-invented my wheel.  Whatever happened to OOP?  :)

Only 3 minutes of fun?  Disappointing.  You've gone and blown the rest of
the afternoon.  Read through it, make it funnier.  Imagine it in Perl.  Or
Befunge.  Or my favorite, Rube.  (extra points if you use the weasel -- I
believe it's all on www.catseye.mb.ca...)  Actually, this may be more of an
appropriate job for the language FALSE.  Should we set up a sourceforge
project for this?
 
  Oh writing it sure didn't take all afternoon, but the fun did.  My current
  /bin/false is a compiled ELF file, and I don't really know if it's mine or
  Potato's (it's been a long time).
  
 Potato's /bin/false has a378dbf982c7694b173cd87ecc8463f1 md5sum.

32 bytes, huh?  24 for your source above (with spaces).  Might as well
compile it yourself.

Oh well, I'll let you think of it.  I've got a bash script that's a barrel
of laughs right now, gotta go.

-- 
Jonathan Markevich [EMAIL PROTECTED]
http://www.geocities.com/jmarkevich
== It's VIRUSES, not VIRII!  See http://language.perl.com/misc/virus.html ==

Campus sidewalks never exist as the straightest line between two points.
-- M. M. Johnston



Re: /bin/false (was Re: security questions)

2000-10-30 Thread sena
I heard that Jonathan Markevich wrote this on 29/10/00:

 Only 3 minutes of fun?  Disappointing.  You've gone and blown the rest of
 the afternoon.  Read through it, make it funnier.  Imagine it in Perl.  Or
 Befunge.  Or my favorite, Rube.  (extra points if you use the weasel -- I
 believe it's all on www.catseye.mb.ca...)  Actually, this may be more of an
 appropriate job for the language FALSE.  Should we set up a sourceforge
 project for this?

Python, Scheme, Pascal, BASIC (ugh..), whatever.. Why not make a kind of
hello world repository with the equivalent of /bin/false in several
languages. Of course, it would have to include the history of the false
command, etc.

  Potato's /bin/false has a378dbf982c7694b173cd87ecc8463f1 md5sum.
 
 32 bytes, huh?  24 for your source above (with spaces).  Might as well
 compile it yourself.

Or, as in C the return type of a function defaults to int, we could write:
main(){return 1;}
even if the compiler whines about it, the source is only 17 bytes long. How
many (kilo)bytes would be necessary to write that in BASIC? :)

Now remembering your shell script approach, lets include in the
false-tribute web page a section for shells (bash, ash, zsh, csh, etc.).

 Oh well, I'll let you think of it.  I've got a bash script that's a barrel
 of laughs right now, gotta go.
 
Well, have fun... :)

Regards, sena..

-- 
[EMAIL PROTECTED]
http://decoy.ath.cx/~sena/



Re: /bin/false (was Re: security questions)

2000-10-30 Thread Damian Menscher
On Mon, 30 Oct 2000, sena wrote:
 I heard that Jonathan Markevich wrote this on 29/10/00:
 
  32 bytes, huh?  24 for your source above (with spaces).  Might as well
  compile it yourself.
 
 Or, as in C the return type of a function defaults to int, we could write:
   main(){return 1;}
 even if the compiler whines about it, the source is only 17 bytes long. How
 many (kilo)bytes would be necessary to write that in BASIC? :)

Save a byte:
main(){exit(1);}

But we're pretty far off topic here

Damian Menscher
-- 
--==## Grad. student  Sys. Admin. @ U. Illinois at Urbana-Champaign ##==--
--==## [EMAIL PROTECTED] www.uiuc.edu/~menscher/ Ofc:(217)333-0038 ##==--
--==## Physics Dept, 1110 W Green, Urbana IL 61801 Fax:(217)333-9819 ##==--



Re: /bin/false (was Re: security questions)

2000-10-30 Thread Miquel van Smoorenburg
In article [EMAIL PROTECTED],
sena  [EMAIL PROTECTED] wrote:
I heard that Jonathan Markevich wrote this on 29/10/00:

 However, writing one in C proved to be simple, and an afternoon's worth
 of fun. 

--(snip - false.c)--
   int main() { return 1; }
--(snip - false.c)--
10 seconds writing plus 3 minutes worth of fun is more like it... :)

Ah, way too big ...

#include linux/unistd.h
#include asm/unistd.h

int errno;

_syscall1(void, exit, int, status);

int main(void)
{
exit(1);
}

void *_start = main;

Compile with cc -s -o false -nostdlib false.c

Mike.
-- 
People get the operating system they deserve.



Re: /bin/false (was Re: security questions)

2000-10-30 Thread sena
I heard that Miquel van Smoorenburg wrote this on 30/10/00:

 Ah, way too big ...
 
(snip...)
 
 Compile with cc -s -o false -nostdlib false.c
 
[EMAIL PROTECTED]:~$ cc -s -o false -nostdlib false.c
false.c: In function `exit':
false.c:6: warning: function declared `noreturn' has a `return' statement
false.c:6: warning: `noreturn' function does return
[EMAIL PROTECTED]:~$ ./false
Segmentation fault
[EMAIL PROTECTED]:~$

Regards, sena...

-- 
[EMAIL PROTECTED]
http://decoy.ath.cx/~sena/



Re: /bin/false (was Re: security questions)

2000-10-29 Thread Jonathan Markevich
On Sat, Oct 28, 2000 at 03:20:15PM -0700, kmself@ix.netcom.com wrote:
  also, i noticed that some accounts which are disabled are given a shell of
  /bin/false:
  
  ftp:x:100:65534::/home/ftp:/bin/false
  
  tiger seemed to hate this too.  i tried playing around with /bin/false.
  can't seem to figure out what it is.  whatever it is, it's tiny.  only 4 kb
  long.
 
 See man false.

Now I also have heard that a shell script /bin/false is a bad thing, because
it still allows some nasty shell tricks, but I haven't come across any
examples.  It is also usually what distros install.

However, writing one in C proved to be simple, and an afternoon's worth of fun. 
Oh writing it sure didn't take all afternoon, but the fun did.  My current
/bin/false is a compiled ELF file, and I don't really know if it's mine or
Potato's (it's been a long time).

-- 
Jonathan Markevich [EMAIL PROTECTED]
http://www.geocities.com/jmarkevich
== It's VIRUSES, not VIRII!  See http://language.perl.com/misc/virus.html ==

Man and wife make one fool.



Re: /bin/false (was Re: security questions)

2000-10-29 Thread sena
I heard that Jonathan Markevich wrote this on 29/10/00:

 However, writing one in C proved to be simple, and an afternoon's worth
 of fun. 

--(snip - false.c)--
int main() { return 1; }
--(snip - false.c)--
10 seconds writing plus 3 minutes worth of fun is more like it... :)

 Oh writing it sure didn't take all afternoon, but the fun did.  My current
 /bin/false is a compiled ELF file, and I don't really know if it's mine or
 Potato's (it's been a long time).
 
Potato's /bin/false has a378dbf982c7694b173cd87ecc8463f1 md5sum.

Regards, sena...

-- 
[EMAIL PROTECTED]
http://decoy.ath.cx/~sena/



/bin/false (was Re: security questions)

2000-10-28 Thread kmself
on Sat, Oct 28, 2000 at 10:06:56AM -0700, Peter Jay Salzman ([EMAIL PROTECTED]) 
wrote:

 also, i noticed that some accounts which are disabled are given a shell of
 /bin/false:
 
   ftp:x:100:65534::/home/ftp:/bin/false
 
 tiger seemed to hate this too.  i tried playing around with /bin/false.
 can't seem to figure out what it is.  whatever it is, it's tiny.  only 4 kb
 long.

See man false.

false - do nothing, unsuccessfully

Think of it as /dev/null, /dev/full, /dev/zero, or the lo loopback
networking interface.  Or zero (0), for that matter.

Doing nothing can be incredibly valuable.  As the Zen saying goes:
Don't just do something, stand there!.  /bin/true and /bin/false do
nothing.  true exits with a successful status, false exits with a
nonsuccessful status.

This is useful for accounts which you don't want to have any successful
shell access, it can be handy in shell scripts to force a failure
condition, or elsewhere.  In the same sense, /dev/null discards bits (or
returns a null read), /dev/full is a file which is always full (write
produces error), /dev/zero returns an ASCII null, and the lo interface
allows tests of networking when no real networking interface is
available -- this is useful both in testing services, and in setting up
systems such as diald.

-- 
Karsten M. Self kmself@ix.netcom.com http://www.netcom.com/~kmself
 Evangelist, Opensales, Inc.http://www.opensales.org
  What part of Gestalt don't you understand?  There is no K5 cabal
   http://gestalt-system.sourceforge.net/http://www.kuro5hin.org


pgpt6rohv7wXg.pgp
Description: PGP signature