Google Mail Kalender Text & Tabellen Reader Web Mehr »
Kürzlich besuchte Gruppen | Hilfe | Anmelden
Google Groups-Startseite
Virus exploring a security hole in the 'home' command.
Gegenwärtig gibt es mehrere Themen in dieser Gruppe, die zuerst angezeigt werden sollen. Damit dieses Thema zuerst angezeigt werden kann, muss diese Option bei einem anderen Thema entfernt werden.
Bei der Bearbeitung Ihrer Anfrage ist ein Fehler aufgetreten. Versuchen Sie es erneut.
Kennzeichnen
  Nachrichten 26 - 48 von 48 - Alle ausblenden  -  Alles übersetzen in die Sprache: Übersetzt (alle Originale anzeigen) < Ältere 
Bei der Gruppe, für die Sie eine Mitteilung verfassen, handelt es sich um eine Usenet-Gruppe. Wenn Sie in dieser Gruppe Nachrichten posten, ist Ihre E-Mail-Adresse für jeden im Internet sichtbar
Ihre Antwort wurde nicht gesendet.
Die Nachricht wurde übermittelt.
 
Von:
An:
Cc:
Nachtrag zu:
Cc hinzufügen | Nachtrag hinzufügen zu | Betreff bearbeiten
Betreff:
Bestätigung:
Geben Sie zur Bestätigung die im folgenden Bild angezeigten Zeichen oder die durchgesagten Zahlen ein, indem Sie auf das Eingabesymbol klicken. Hören Sie zu und geben Sie die gehörten Zahlen ein
 
Jim Richardson  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 22:00
Newsgroups: comp.os.linux.misc
Von: Jim Richardson <warl...@eskimo.com>
Datum: Sun, 25 Jan 2004 12:58:34 -0800
Lokal: So 25 Jan. 2004 21:58
Betreff: Re: Virus exploring a security hole in the 'home' command.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 25 Jan 2004 19:47:41 GMT,
 Juha Siltala <jsilt...@gmx.net> wrote:

eek! no, bad idea!

What if it does something you *don't* want root to do?

better to strace it and see, rather than run it as root.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAFC36d90bcYOAWPYRAnlfAJwPT49f74p4/JXXrAQGO5EidYvMAQCeM+68
p3JIKffuY0WawlyKnqwAy2k=
=16b1
-----END PGP SIGNATURE-----

--
Jim Richardson     http://www.eskimo.com/~warlock
Windows: Microsoft's tax on computer illiterates.


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Ed Murphy  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 23:03
Newsgroups: comp.os.linux.misc
Von: Ed Murphy <emurph...@socal.rr.com>
Datum: Sun, 25 Jan 2004 22:03:51 GMT
Lokal: So 25 Jan. 2004 23:03
Betreff: Re: Virus exploring a security hole in the 'home' command.

"Am I putting him on or is he putting me on?"
     -Lloyd Fellowes (Michael Caine) in _Noises Off_

    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Mike releases the "home" command under the GPL geändert" von José de Paula
José de Paula  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 23:23
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: José de Paula <jose_de_pa...@ig.com.br>
Datum: Sun, 25 Jan 2004 20:23:51 -0200
Lokal: So 25 Jan. 2004 23:23
Betreff: Re: Mike releases the "home" command under the GPL
Em Sun, 25 Jan 2004 17:42:55 +0000, Albert van der Horst escreveu:

> I miss the configure script, the Makefile and man file.
> An rpm would be nice too.
> Also this program doesn't follow the gnu presciptions of
> the --version and --help options.

I bet you didn't see GNU hello...
http://www.gnu.org/software/hello/

Download it, compile it and run it... You will laugh at the source.

--
Quidquid latine dictum sit altum viditur


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Virus exploring a security hole in the 'home' command. geändert" von Juha Siltala
Juha Siltala  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 25 Jan. 2004, 23:27
Newsgroups: comp.os.linux.misc
Von: Juha Siltala <jsilt...@gmx.net>
Datum: Sun, 25 Jan 2004 22:27:35 GMT
Lokal: So 25 Jan. 2004 23:27
Betreff: Re: Virus exploring a security hole in the 'home' command.

In article <q8nde1-uh2....@grendel.myth>, Jim Richardson wrote:

> On Sun, 25 Jan 2004 19:47:41 GMT,
>  Juha Siltala <jsilt...@gmx.net> wrote:
>> When something doesn't work as you expected, always try as root! It might
>> be a permission problem :)

> eek! no, bad idea!

> What if it does something you *don't* want root to do?

Uhhh... I'm pretty sure you don't want it to do 'rm -rf $HOME', which is
what we were talking about. This thread has long been for jesters only :)

--
Juha Siltala
http://www.edu.helsinki.fi/activity/people/jsiltala/


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Nigel releases shorter 'home' command under gpl geändert" von Wolfgang Denk
Wolfgang Denk  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 02:12
Newsgroups: comp.os.linux.misc
Von: Wolfgang Denk <w...@denx.muc.de>
Datum: Mon, 26 Jan 2004 00:17:36 GMT
Lokal: Mo 26 Jan. 2004 01:17
Betreff: Re: Nigel releases shorter 'home' command under gpl

Nigel Feltham <nigel.felt...@btinternet.com> writes:
>Here are my shorter GPL versions of your home command.
>Version 1 :-
>alias home=cd
>Version 2 :-
>alias home='cd $HOME'

Arghh... there are two major shortcomings of your proposals:

* They are not object-oriented
* They are not compatible with the original solution
  (different behaviour: not bug-compatible).

Wolfgang Denk

--
See us @ Embedded World, Nuremberg, Feb 17 - 19,  Hall 12.0 Booth 440
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88   Web: www.denx.de
Any technology distinguishable from magic is insufficiently advanced.


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Betreff der Diskussion wurde in Mike releases the "home" command under the GPL geändert" von Kelsey Bjarnason
Kelsey Bjarnason  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 02:20
Newsgroups: comp.os.linux.misc
Von: Kelsey Bjarnason <kels...@lightspeed.bc.ca>
Datum: Sun, 25 Jan 2004 17:20:24 -0800
Lokal: Mo 26 Jan. 2004 02:20
Betreff: Re: Mike releases the "home" command under the GPL
[snips]

On Sun, 25 Jan 2004 17:03:15 -0500, Madhusudan Singh wrote:
>> #include <iostream>

>> int main()
>> {
>> char* name= new char[strlen(getlogin()) + 1];

From the man page:
RETURN VALUE
       getlogin returns a pointer to the user name when successful,  and  NULL
       on failure.

If getlogin returns NULL, the code above is borked; it'll call strlen on
a NULL pointer - crash time.

>> strcpy(name,getlogin());

Assuming new[] actually worked - i.e. you have memory assigned to name -
this is okay.  However, if new[] fails, then one of two things is going to
happen; either it's going to toss an excption at new[] (and there's no
handler, hence the app bombs) or, worse, it doesn't toss an exception, but
simply returns NULL - and the strcpy fails, making the app puke.

>> if(strcmp(name, "root") == 0)
>> {
>> std::cout<<"going to home directory...\n";
>> FILE* pipe;
>> pipe =        popen("cd /root/", "w"); pclose(pipe);

Assumes popen succeeeds and actually does the equivalent of a cd.  Neither
seems to be the case.

>> } else{
>> char* base = "/home/";
>> strcat(base, name);

strcat to a string literal?  Undefined behaviour and an almost certain app
crash.

>> FILE* bong;
>> std::cout<<"going to home directory...\n"; bong = popen(base,"w");
>> pclose(bong);
>> }
>> }
>> delete [] name;
>> return 0;
>> }

All in all, not even a particularly good attempt.  Undefined behaviour,
app crashes right, left and center, and even if everything does "work" as
one might hope, no assurance it actually does what it claims to in the
first place.

    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Lew Pitcher  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 07:42
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Lew Pitcher <lpitc...@sympatico.ca>
Datum: Sun, 25 Jan 2004 12:19:13 -0500
Lokal: So 25 Jan. 2004 18:19
Betreff: Re: Mike releases the "home" command under the GPL
Mike Cox wrote:
> /*
>    ********   home command ********
>    The 'home'command takes you to your home directory if
>    you've been wandering far, and don't want to type so
>    much.  Just type "home" at the shell, and you're immediatly
>    transported to /home/yourusername/

[snip]

Well, with that, you've simultaneously proved that
a) you don't understand the concept of Unix processes,
b) you don't understand the use of the popen() function,
c) you don't understand the idea of usability, and
d) you don't know how to locate a user's HOME directory.

Perhaps you should try again, after getting a bit more familiar with the
environment in which you are working.

--
Lew Pitcher

Master Codewright and JOAT-in-training
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Johan Lindquist  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 10:09
Newsgroups: comp.os.linux.misc
Von: Johan Lindquist <s...@smilfinken.net>
Datum: Mon, 26 Jan 2004 10:01:56 +0100
Lokal: Mo 26 Jan. 2004 10:01
Betreff: Re: Mike releases the "home" command under the GPL
So anyway, it was like, 21:01 CET Jan 25 2004, you know? Oh, and, yeah,
Tony Lawrence was all like, "Dude,

>>On Sun, 25 Jan 2004 02:15:06 GMT, Frostbite <bill.ga...@ms.com> wrote:
>>>Mike Cox wrote:
>>>> ******** home command ********

[..]

> It would be even more amusing to submit it to the Patent Office.

> They'd probably approve it, and then IBM would contest it and show
> that they already patented it years ago..

Since it's freely downloadable (being posted to a public news group
and all), SCO would claim the rights and sue everyone who uses it and
any technology remotely resembling it. Probably including the single
'cd' command as well, based on the claim that the 'cd' source has
(unspecified) lines from the 'home' source code in it. After all,
it aim to do the same thing as 'home' but doesn't work quite as
well.

--
Time flies like an arrow, fruit flies like a banana.      Perth ---> *
 09:59:00 up 1 day, 17:34,  1 user,  load average: 2.04, 2.32, 2.25
$ cat /dev/bollocks                      Registered Linux user #261729
envisioneer strategic ROI


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Grant Edwards  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 16:03
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Grant Edwards <gra...@visi.com>
Datum: 26 Jan 2004 15:03:21 GMT
Lokal: Mo 26 Jan. 2004 16:03
Betreff: Re: Mike releases the "home" command under the GPL
On 2004-01-25, Lew Pitcher <lpitc...@sympatico.ca> wrote:

> Mike Cox wrote:
>> /*
>>        ********   home command ********
>>        The 'home'command takes you to your home directory if
>>        you've been wandering far, and don't want to type so
>>        much.  Just type "home" at the shell, and you're immediatly
>>        transported to /home/yourusername/
> [snip]

> Well, with that, you've simultaneously proved that
> a) you don't understand the concept of Unix processes,
> b) you don't understand the use of the popen() function,
> c) you don't understand the idea of usability, and
> d) you don't know how to locate a user's HOME directory.

You forgot:

e) he can troll Usenet.

[At least I _hope_ it was a troll.]

--
Grant Edwards                   grante             Yow!  ONE LIFE TO LIVE for
                                  at               ALL MY CHILDREN in ANOTHER
                               visi.com            WORLD all THE DAYS OF
                                                   OUR LIVES.


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Lew Pitcher  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 16:30
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Lew.Pitc...@td.com (Lew Pitcher)
Datum: Mon, 26 Jan 2004 15:17:09 GMT
Lokal: Mo 26 Jan. 2004 16:17
Betreff: Re: Mike releases the "home" command under the GPL
On 26 Jan 2004 15:03:21 GMT, Grant Edwards <gra...@visi.com> wrote:

He may be a troll, but I've seen enough newbie attempts like his to give him the
benefit of the doubt.

In any case, even if he /is/ a troll, the newbies don't always know that, and
his code is now "on the net" (available to Google, for instance) as an answer to
the newbie's question of how to change the shell's cwd programmatically. Our
negative responses should help newbies to determine that the OPs code is
useless.

--
Lew Pitcher
IT Consultant, Enterprise Technology Solutions
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Ed Murphy  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 17:53
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Ed Murphy <emurph...@socal.rr.com>
Datum: Mon, 26 Jan 2004 16:53:33 GMT
Lokal: Mo 26 Jan. 2004 17:53
Betreff: Re: Mike releases the "home" command under the GPL

On Mon, 26 Jan 2004 15:17:09 +0000, Lew Pitcher wrote:
> In any case, even if he /is/ a troll, the newbies don't always know that, and
> his code is now "on the net" (available to Google, for instance) as an answer to
> the newbie's question of how to change the shell's cwd programmatically. Our
> negative responses should help newbies to determine that the OPs code is
> useless.

ObPuzzle:  Create the shortest program that (effectively) does 'su'
followed by 'rm -rf /', without it being blindingly obvious from a
first read-through of the source code that that's what it does.

    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
The Onion Man  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 18:05
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: The Onion Man <IanPe...@netscamybrainspe.net>
Datum: Mon, 26 Jan 2004 17:07:13 +0000
Lokal: Mo 26 Jan. 2004 18:07
Betreff: Re: Mike releases the "home" command under the GPL
Jim Richardson sighed and said:

> cd, with no options, will return you to $HOME, your home directory.

Dammit!

I've been busy typing cd ~

That's /TWO/ unnecessary characters. No wonder my productivity is so low.

--
Ian

Actually I think I prefer tomatoes now.


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
chrisv  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 18:24
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: chrisv <chr...@nospam.invalid>
Datum: Mon, 26 Jan 2004 11:23:08 -0600
Lokal: Mo 26 Jan. 2004 18:23
Betreff: Re: Mike releases the "home" command under the GPL

On Mon, 26 Jan 2004 15:17:09 +0000, Lew Pitcher wrote:
>>e) he can troll Usenet.

>>[At least I _hope_ it was a troll.]

> He may be a troll, but I've seen enough newbie attempts like his to give
> him the benefit of the doubt.

Mike Cocks is a Wintroll.  He's a sick f*ck who gets his jollies proving
what a stupid a$$hole he is by saying stuff like "when MS makes free
software like IE, it gets huge market share, while Linux is free and gets
small market share, so that's proof that Linux must suck" - like IE being
bundled with the monopoly OS isn't the real issue.

    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Tim Smith  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 19:50
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Tim Smith <reply_in_gr...@mouse-potato.com>
Datum: Mon, 26 Jan 2004 18:50:02 GMT
Lokal: Mo 26 Jan. 2004 19:50
Betreff: Re: Mike releases the "home" command under the GPL
In article <pan.2004.01.26.17.07.13.3...@netscamybrainspe.net>, The Onion

Man wrote:
> Jim Richardson sighed and said:
>> cd, with no options, will return you to $HOME, your home directory.

> Dammit!

> I've been busy typing cd ~

> That's /TWO/ unnecessary characters. No wonder my productivity is so low.

Wow!  I wish I'd known about that.  I've been doing this when I need to get
to my home directory:

    1. type "cd "

    2. open another xterm

    3. run "pwd" in the other xterm

    4. copy/paste the pwd output to the first xterm

    5. hit return on the first xterm

    6. close the second xterm

And that is simplified...I won't even mention the 5 feet of snow and typing
uphill both ways...

--
--Tim Smith


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Lew Pitcher  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 20:21
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Lew.Pitc...@td.com (Lew Pitcher)
Datum: Mon, 26 Jan 2004 19:08:27 GMT
Lokal: Mo 26 Jan. 2004 20:08
Betreff: Re: Mike releases the "home" command under the GPL
On Mon, 26 Jan 2004 18:50:02 GMT, Tim Smith <reply_in_gr...@mouse-potato.com>
wrote:

My favourite:

  cd `cat /etc/passwd | grep \`whoami\` | gawk -F: ' { print $6 }'`

--
Lew Pitcher
IT Consultant, Enterprise Technology Solutions
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Lew Pitcher  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 20:26
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Lew.Pitc...@td.com (Lew Pitcher)
Datum: Mon, 26 Jan 2004 19:13:18 GMT
Lokal: Mo 26 Jan. 2004 20:13
Betreff: Re: Mike releases the "home" command under the GPL

On Mon, 26 Jan 2004 19:08:27 GMT, Lew.Pitc...@td.com (Lew Pitcher) wrote:
>My favourite:

>  cd `cat /etc/passwd | grep \`whoami\` | gawk -F: ' { print $6 }'`

And, yes, I know it has a UUOC - that's the whole idea, mate.

--
Lew Pitcher
IT Consultant, Enterprise Technology Solutions
Toronto Dominion Bank Financial Group

(Opinions expressed are my own, not my employers')


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Johan Lindquist  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 22:19
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Nachtrag zu: comp.os.linux.advocacy
Von: Johan Lindquist <s...@smilfinken.net>
Datum: Mon, 26 Jan 2004 22:14:41 +0100
Lokal: Mo 26 Jan. 2004 22:14
Betreff: Re: Mike releases the "home" command under the GPL
["Followup-To:" header set to comp.os.linux.advocacy.]
So anyway, it was like, 20:13 CET Jan 26 2004, you know? Oh, and, yeah,
Lew Pitcher was all like, "Dude,

> On Mon, 26 Jan 2004 19:08:27 GMT, Lew.Pitc...@td.com (Lew Pitcher) wrote:
>>My favourite:

>>  cd `cat /etc/passwd | grep \`whoami\` | gawk -F: ' { print $6 }'`

> And, yes, I know it has a UUOC - that's the whole idea, mate.

Well hell, why stop there. 'whoami' is abit of a cheat.

cd `cat /etc/passwd | grep \`who | grep \
   \\\`env | grep TTY | sed -e 's/.*\(pts.*\)/\1/'\\\` \
   | cut -d' ' -f1\` | gawk -F: '{print $6}'`

I /think/ it may work for both telnet and ssh logins. Adding support
for virtual consoles is left as an excercise for the next supplicant.

--
Time flies like an arrow, fruit flies like a banana.      Perth ---> *
 21:58:38 up 2 days,  5:34,  2 users,  load average: 2.07, 2.09, 2.08
$ cat /dev/bollocks                      Registered Linux user #261729
strategize wireless metrics


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Alan Connor  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 26 Jan. 2004, 22:41
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Alan Connor <zzz...@xxx.yyy>
Datum: Mon, 26 Jan 2004 21:41:13 GMT
Lokal: Mo 26 Jan. 2004 22:41
Betreff: Re: Mike releases the "home" command under the GPL

On Mon, 26 Jan 2004 19:08:27 GMT, Lew Pitcher <Lew.Pitc...@td.com> wrote:

<snip>

> My favourite:

>   cd `cat /etc/passwd | grep \`whoami\` | gawk -F: ' { print $6 }'`

<laughs out loud>

:-)

AC


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Andy Baxter  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 27 Jan. 2004, 01:24
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Andy Baxter <ne...@earthsong.null.free-online.co.uk>
Datum: Tue, 27 Jan 2004 00:31:25 +0000
Lokal: Di 27 Jan. 2004 01:31
Betreff: Re: Mike releases the "home" command under the GPL
At earth time Mon, 26 Jan 2004 15:17:09 +0000, the following transmission
was received from the entity known as Lew Pitcher:

he was posting trollfully on comp.os.linux.advocacy a while back, but this
looks to me more like he's decided linux is worth giving a try, but he's
too eager to prove he can do something, and didn't have the patience to
get it right. <rueful grin about echoes of my own psychology>

p.s. to mike cox - if you want to show people code like this, you could
try comp.os.linux.development.apps, and make it clear you're using it as
an example to learn linux coding.

--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
The Ghost In The Machine  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 27 Jan. 2004, 02:01
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: The Ghost In The Machine <ew...@sirius.athghost7038suus.net>
Datum: Tue, 27 Jan 2004 01:01:03 GMT
Lokal: Di 27 Jan. 2004 02:01
Betreff: Re: Mike releases the "home" command under the GPL
In comp.os.linux.advocacy, Mike Cox
<mikecoxli...@yahoo.com>
 wrote
on 24 Jan 2004 17:49:42 -0800
<3d6111f1.0401241749.22dc5...@posting.google.com>:

> /*
>    ********   home command ********
>    The 'home'command takes you to your home directory if
>    you've been wandering far, and don't want to type so
>    much.  Just type "home" at the shell, and you're immediatly
>    transported to /home/yourusername/

Pedant points.

[1] This won't work unless one subinvokes a shell.
[2] The home directory can be anywhere on the disk; it need
    not sit in /home.  (The location is of course specified
    in /etc/passwd.)

>    (c) 2004 Mike Cox. Released under the GNU GPL License.
>         email:  mikecoxli...@yahoo.com
>    web: www.geocities.com/mikecoxlinux/

[3] You are in technical violation of the License, as you
    did not provide it with the software submission. :-)
    Fortunately, that's easily fixed; the text version is
    readily available.  (The HTML version has some issues,
    mostly because of images.)

>    compile instructions:
>    g++ -o home home.cpp

>    install instructions:
>    move it to the /bin directory.

[4] Operation not recommended as the c++ library is typically in
    /usr/lib.  However, I'd have to look.

>    ..Or create a Makefile as follows:
>    home: home.cpp
>            g++ -o home home.cpp
>    install:
>            mv home /bin/
>    clean:
>            rm home

[5] There are better ways of structuring a Makefile, though the above will
    work.  For example,

        all: home
        %: %.o
            $(LINK.cc) -o $@ $^

    might work for a lot of applications.

> */
> #include <iostream>

#include <stdio.h>
     // for FILE *, popen(), pclose(), perror()
#include <unistd.h>
     // for getlogin()
#include <string.h>
     // for strcmp()

> int main()
> {

// optimization
      int l = strlen(getlogin());

>    char* name= new char[strlen(getlogin()) + 1];

// optimization
      char * name = new char[l+1];

// strdup() could be used here instead

>    strcpy(name,getlogin());
>    if(strcmp(name, "root") == 0)

[6] Special case is not required.

>    {
>            std::cout<<"going to home directory...\n";

[7] std::endl.

>            FILE* pipe;
>            pipe =  popen("cd /root/", "w");    

              if(pipe == null) { perror("popen"); exit(-1); }

>            pclose(pipe);
>    } else{
>            char* base = "/home/";

[8] Either use ~, ~user or getpwnam().  (See [2])

>            strcat(base, name);
>            FILE* bong;
>            std::cout<<"going to home directory...\n";
>            bong = popen(base,"w");

              if(bong == null) { perror("popen"); exit(-1); }

>            pclose(bong);
>    }

>    delete [] name;

// free() should be used here if strdup() replaces new char[] above

>    return 0;
> }

I will give you credit for the following:

[A] Dynamic string allocation for getlogin().
[B] Correct usage of delete[].
[C] Correctly returning 0 from main().
[D] Using <iostream> instead of the deprecated <iostream.h>
[E] Using the GPL.

Not bad for a first attempt, even if the idea is totally botched
from the word 'go' because one cannot set the current directory
of a parent process.

--
#191, ewi...@earthlink.net
It's still legal to go .sigless.


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Roger Leigh  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 27 Jan. 2004, 17:07
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Roger Leigh <${rog...@invalid.whinlatter.uklinux.net.invalid>
Datum: Tue, 27 Jan 2004 15:50:08 +0000
Lokal: Di 27 Jan. 2004 16:50
Betreff: Re: Mike releases the "home" command under the GPL

I've got a much better version here ;-)

/*
 * hm.c
 * Securely enter home directory....
 * Copyright (C) 2004  Roger Leigh
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 *
 *************************************************************************** **/

#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <pwd.h>
#include <sys/types.h>
#include <unistd.h>

int
main (int argc, char *argv[])
{
  const char *dir;
  uid_t uid;
  gid_t gid;
  struct passwd *pass;
  const char *shell;

  /* Get user ID */
  uid = getuid ();
  if ((pass = getpwuid (uid)) == NULL)
    {
      fprintf (stderr, "Could not get username for user %lu\n", (unsigned long) uid);
      exit (EXIT_FAILURE);
    }

  /* Validate input */
  if (argc > 2)
    {
      fprintf (stderr, "Usage: %s dir\n", argv[0]);
      exit (EXIT_FAILURE);
    }
  else if (argc == 2)
    dir = argv[1];
  else
    dir = getenv("HOME");
  if (dir == NULL)
    dir = pass->pw_dir;
  if (!strcmp(dir, ""))
    dir = "/";

  /* Enter the directory */
  if (chdir (dir))
    {
      fprintf (stderr, "Could not chdir to %s: %s\n", dir,
               strerror (errno));
      exit (EXIT_FAILURE);
    }
  /* printf ("Entered dir: %s\n", dir); */

  /* Set up environment */
  setenv("HOME", pass->pw_dir, 1);

  /* Run shell */
  if (pass->pw_shell)
    shell = pass->pw_shell;
  else
    shell = "/bin/false";
  if (execl (shell, shell, (const char *) NULL))
    {
      fprintf (stderr, "Could not exec %s: %s\n", shell, strerror (errno));
      exit (EXIT_FAILURE);
    }
  /* This should never be reached */
  exit(EXIT_FAILURE);

}

--
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
The Ghost In The Machine  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 28 Jan. 2004, 22:00
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: The Ghost In The Machine <ew...@sirius.athghost7038suus.net>
Datum: Wed, 28 Jan 2004 21:00:37 GMT
Lokal: Mi 28 Jan. 2004 22:00
Betreff: Re: Mike releases the "home" command under the GPL
In comp.os.linux.advocacy, Roger Leigh
<${rog...@invalid.whinlatter.uklinux.net.invalid>
 wrote
on Tue, 27 Jan 2004 15:50:08 +0000
<87ptd5l7bj....@wrynose.whinlatter.uklinux.net>:

True enough.

Interesting, and should work reasonably well -- although the
environment is a little on the munged side as the user's
home directory is being accessed using your account.

Of course 'su' already solves that particular subproblem,
if anyone really cares. :-)  Perhaps we should call this
"hmshell"? :-)

--
#191, ewi...@earthlink.net
It's still legal to go .sigless.


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Roger Leigh  
Profil anzeigen   Übersetzen in die Sprache: Übersetzt (Original anzeigen)
 Weitere Optionen 30 Jan. 2004, 10:18
Newsgroups: comp.os.linux.misc, comp.os.linux.advocacy
Von: Roger Leigh <${rog...@invalid.whinlatter.uklinux.net.invalid>
Datum: Thu, 29 Jan 2004 18:30:49 +0000
Lokal: Do 29 Jan. 2004 19:30
Betreff: Re: Mike releases the "home" command under the GPL
The Ghost In The Machine <ew...@sirius.athghost7038suus.net> writes:

> In comp.os.linux.advocacy, Roger Leigh
> <${rog...@invalid.whinlatter.uklinux.net.invalid>
>  wrote
>> /*
>>  * hm.c
>>  * Securely enter home directory....
>>  * Copyright (C) 2004  Roger Leigh
[...]
>>   /* Set up environment */
>>   setenv("HOME", pass->pw_dir, 1);

>>   /* Run shell */
> Interesting, and should work reasonably well -- although the
> environment is a little on the munged side as the user's
> home directory is being accessed using your account.

Yes, it should read

   setenv("HOME", dir, 1);

> Of course 'su' already solves that particular subproblem,
> if anyone really cares. :-)  Perhaps we should call this
> "hmshell"? :-)

:-)

This was originally a setuid program to execute a shell in a
restricted chroot environment.  I just stripped the extra
functionality, and tweaked it a little (which is where the HOME buglet
comes from, since it used to exec a login shell with really fascist
security checking).

--
Roger Leigh

                Printing on GNU/Linux?  http://gimp-print.sourceforge.net/
                GPG Public Key: 0x25BFB848.  Please sign and encrypt your mail.

-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----


    Weiterleiten  
Sie müssen sich anmelden, bevor Sie Nachrichten veröffentlichen können.
Bevor Sie eine Nachricht posten können, müssen Sie zunächst dieser Gruppe beitreten.
Bitte aktualisieren Sie vor dem Posten in den Abonnementeinstellungen Ihren Spitznamen.
Sie haben nicht die erforderliche Berechtigung zum Posten.
Ende der Nachrichten < Ältere 
« Zurück zu Diskussionen « Neueres Thema     Älteres Thema »

Eine Gruppe erstellen - Google Groups - Google-Startseite - Nutzungsbedingungen - Datenschutzbestimmungen
©2010 Google