Comment On #WHO WROTE THIS JUNK

Justin de Vesine was less than thrilled with his internet service. On a good day, his high-speed would pretend to be dial-up; usually, it seemed that things would just give up loading half-way through. Through some trial and error, he narrowed it down to the brand-name DSL modem that his ISP gave him. Since it was running a stripped down version of Linux, and supported telnet administration, Justin decided to log in and poke around some of the scripts and config files to see if he could find the source of his problems. [expand full text]
« PrevPage 1 | Page 2 | Page 3Next »

Re: #WHO WROTE THIS JUNK

2009-02-02 09:02 • by Anon (unregistered)
client conf gets fucked by config.xml


SeXML?

Re: #WHO WROTE THIS JUNK

2009-02-02 09:06 • by Not Microsoft (unregistered)
uPNP is a piece of crap.

Re: #WHO WROTE THIS JUNK

2009-02-02 09:06 • by TarquinWJ
# this needs proper comment to determine optimal humour
# idiots cant figure out how to produce this in a reasonable amoutn of time
# for now just mention amoutn

Re: #WHO WROTE THIS JUNK

2009-02-02 09:07 • by Krupuk (unregistered)
> #turn power led to green after 10s i guess

And he's always wondering why it takes 10 seconds until the unit is operational.

Perhaps he could add soemthing like "boot_time=0" and it would be on immediately.

Re: #WHO WROTE THIS JUNK

2009-02-02 09:09 • by younamedme (unregistered)
241865 in reply to 241864
wonder if there's a "bandwith" option as well?

> #set speed to 56kbits i guess...

Re: #WHO WROTE THIS JUNK

2009-02-02 09:10 • by dkf
# FOXME: clean up comments for release
Oh, the delicious failure!

Re: #WHO WROTE THIS JUNK

2009-02-02 09:12 • by gosse (unregistered)
trail an error?

Re: #WHO WROTE THIS JUNK

2009-02-02 09:14 • by CodeReview (unregistered)
#do not honor captcha
captcha: junkuo

Re: #WHO WROTE THIS JUNK

2009-02-02 09:23 • by somewhiteguy
Not too surprised to see this kind of thing. I ran into this gem early in my career...

bool kenIsaJackass = true;

Don't know who Ken was or why he was a jackass... but it seems that he was.

Re: #WHO WROTE THIS JUNK

2009-02-02 09:25 • by Whoevar (unregistered)
241871 in reply to 241866
# FOXME BABY
# FOXME HARD!

Re: #WHO WROTE THIS JUNK

2009-02-02 09:29 • by rm -rf WTF (unregistered)
I dunno what's going on here with the routing, but TRWTF is that even though PATH clearly lists "/bin" they still call "rm" as "/bin/rm" even though every *nix system ever knows what you mean if you just say "rm".

Re: #WHO WROTE THIS JUNK

2009-02-02 09:32 • by rm -rf WTF (unregistered)
241873 in reply to 241872
Same goes for /sbin/whatever.

Re: #WHO WROTE THIS JUNK

2009-02-02 09:38 • by Kevin Fairchild (unregistered)
Through trail an error, I finally managed to post a comment.

Re: #WHO WROTE THIS JUNK

2009-02-02 09:41 • by d3matt
241877 in reply to 241872
rm -rf WTF:
I dunno what's going on here with the routing, but TRWTF is that even though PATH clearly lists "/bin" they still call "rm" as "/bin/rm" even though every *nix system ever knows what you mean if you just say "rm".

Not sure if it's common in every linux environment, but if you rsh then run a script (i.e. rsh myhost /path/to/script), often times the path isn't fully set so any command that doesn't have the full path will fail. There could be a similar issue with this "init" script

Re: #WHO WROTE THIS JUNK

2009-02-02 09:44 • by tulcod (unregistered)
TRWTF is the fact that I saw a .nl domain name at the top of the file, surfed there, got redirected to xs4all.nl, and realized, i have that very same router :(

Re: #WHO WROTE THIS JUNK

2009-02-02 09:47 • by Brompot (unregistered)
241880 in reply to 241877
d3matt:
rm -rf WTF:
I dunno what's going on here with the routing, but TRWTF is that even though PATH clearly lists "/bin" they still call "rm" as "/bin/rm" even though every *nix system ever knows what you mean if you just say "rm".

Not sure if it's common in every linux environment, but if you rsh then run a script (i.e. rsh myhost /path/to/script), often times the path isn't fully set so any command that doesn't have the full path will fail. There could be a similar issue with this "init" script


True, but after you explicitly set the PATH variable that should not be an issue. You set EITHER the PATH variable OR you use full paths.

Re: #WHO WROTE THIS JUNK

2009-02-02 09:49 • by Steenbergh (unregistered)
XS4All?

90% of the time, when you hear the name "XS4All", it's in the sentence:
"Welcome to the XS4All support line. All our call agents are currently engaged. Please hold..."

Re: #WHO WROTE THIS JUNK

2009-02-02 09:54 • by Kiss me I'm Polish
#WHO WROTE THIS COMMENT

Re: #WHO WROTE THIS JUNK

2009-02-02 09:55 • by Spectre
And TRWTF is... that it doesn't route IPv6, right? And that it drops ICMP Destination Unreachable messages, I guess.

But I don't see the answer to the original question: why was the Internet access so slow?

Re: #WHO WROTE THIS JUNK

2009-02-02 09:56 • by Mark Janssen (unregistered)
241884 in reply to 241878
miquels and cistron.nl don't deserve this bad credit.

Miquel write the original rcS script on debian, and whoever made this router completely gutted the script (since it doesn't even do what the header says it does) and replaced it with his own.

They at least could have also ripped out the copyright, since everything from the "FOXME" and on isn't in the original script.

Re: #WHO WROTE THIS JUNK

2009-02-02 09:57 • by IByte (unregistered)
241885 in reply to 241876
Kevin Fairchild:
Through trail an error, I finally managed to post a comment.
It would seem that spelling TDWTF articles is performed by trial and (mostly) error. ;-P

CAPTCHA: vulputate. I'm not sure I want to know what that means...

Re: #WHO WROTE THIS JUNK

2009-02-02 09:57 • by A. Coward (unregistered)
LOL, have a look at http://miquels.www.cistron.nl/nonsense/ the maintainers homepage....

Re: #WHO WROTE THIS JUNK

2009-02-02 09:59 • by Mark Janssen (unregistered)
241888 in reply to 241884
Mark Janssen:

They at least could have also ripped out the copyright, since everything from the "FOXME" and on isn't in the original script.


The original version:
http://pyramid.metrix.net/trac/browser/Pyramid/dist/etc/init.d/rcS?rev=91

Re: #WHO WROTE THIS JUNK

2009-02-02 10:07 • by Miquel van Smoorenburg <miquels@cistron.nl> (unregistered)
I most certainly did not write this script.

Looked like they took a sample script that comes with
sysvinit, deleted everything but the version number
and my name, and then put their own code in.

Nice ... :/

Mike.

Re: #WHO WROTE THIS JUNK

2009-02-02 10:19 • by onitake (unregistered)
241893 in reply to 241862
Not Microsoft:
uPNP is a piece of crap.

guess who invented it :)

anyway... if you want zeroconf, use dns-sd or slp. if you want autopiercing of firewalls, JUST DON'T. configure your firewall correctly instead.

Re: #WHO WROTE THIS JUNK

2009-02-02 10:33 • by Kensey
241894 in reply to 241880
Brompot:
d3matt:
rm -rf WTF:
I dunno what's going on here with the routing, but TRWTF is that even though PATH clearly lists "/bin" they still call "rm" as "/bin/rm" even though every *nix system ever knows what you mean if you just say "rm".

Not sure if it's common in every linux environment, but if you rsh then run a script (i.e. rsh myhost /path/to/script), often times the path isn't fully set so any command that doesn't have the full path will fail. There could be a similar issue with this "init" script


True, but after you explicitly set the PATH variable that should not be an issue. You set EITHER the PATH variable OR you use full paths.


When dealing with basic system commands as root, typing, say, "/bin/rm" rather than "rm" is a good habit to get into -- it reduces the chance that somebody compromises your box by getting you to run a Trojan-horse rm from a different location in your PATH than you think. root should also have a minimal PATH and it should be arranged sensibly to further reduce the risk.

If you *really* want paranoia, you can disable root entirely and set up sudo on a single otherwise-unprivileged account, so that you can force root-level rm (or whatever) to run from /bin/rm or not at all regardless of what the value of PATH is.

Re: #WHO WROTE THIS JUNK

2009-02-02 10:42 • by zolf
Welcome to the world of embedded devices with Linux!

It is much easier to hack startup scripts than recompile busybox.

Re: #WHO WROTE THIS JUNK

2009-02-02 10:46 • by Code Dependent
trail an error
Do you guys ever proofread anything?

From Mark - All spelling and grammer checking is crowdsourced - Thanks! Fixed.

Re: #WHO WROTE THIS JUNK

2009-02-02 10:53 • by Mark (unregistered)
Trail an error = starting with one error, only to dig deeper and deeper until the root cause of the error is discovered. Not to be confused with "trial and error."

Re: #WHO WROTE THIS JUNK

2009-02-02 10:53 • by Rich (unregistered)
# UPnP is a piece of crap and requires loopback
ifconfig lo 127.0.0.1

I'm sure they'll find that it's more than UPnP that needs this.

captcha: these just aren't fun anymore, what happened to whiskey, tango, or foxtrot?

Re: #WHO WROTE THIS JUNK

2009-02-02 10:54 • by Alnitak (unregistered)
Sorry, but what's the big deal?

This is just the router startup script, and is pretty much what you'd expect for an embedded device, particularly one where the main stuff is in flash and you need to store temporary data in a ram disk.

Nor is there anything here that would reduce or otherwise throttle the user's bandwidth.

Re: #WHO WROTE THIS JUNK

2009-02-02 11:06 • by workmad3 (unregistered)
241901 in reply to 241873
rm -rf WTF:
Same goes for /sbin/whatever.


sbin is sometimes only in the path for root and admin users, although the progs are usually usable by everyone.

Doesn't stop the entire script being a mess though :)

Re: #WHO WROTE THIS JUNK

2009-02-02 11:12 • by IByte (unregistered)
241902 in reply to 241896
Code Dependent:
trail an error
Do you guys ever proofread anything?

From Mark - All spelling and grammer checking is crowdsourced - Thanks! Fixed.
Interesting enough, the trial and error process entered another iteration, and it now says "trail and error"... (a lost pathfinder?)

CAPTCHA: facilisis - what you can catch when facilitating TDWTF spell checking

Re: #WHO WROTE THIS JUNK

2009-02-02 11:16 • by Alex (unregistered)
241904 in reply to 241899
Alnitak:
Sorry, but what's the big deal?

This is just the router startup script, and is pretty much what you'd expect for an embedded device, particularly one where the main stuff is in flash and you need to store temporary data in a ram disk.

Nor is there anything here that would reduce or otherwise throttle the user's bandwidth.


Or the manufacturers could've taken a simple route an added their scripts to /etc/rcS.d/ as they were supposed too, thus avoiding this mess altogether; but noes, writing rc scripts is too freaking difficult.

Re: #WHO WROTE THIS JUNK

2009-02-02 11:36 • by Mark Bowytz
241905 in reply to 241902
IByte:
Interesting enough, the trial and error process entered another iteration, and it now says "trail and error"... (a lost pathfinder?)


Crap - It's Monday for sure. That one's me trying to keep one eye on on a long-running Unix job that should've been done ages ago and another on the comments. Ok, now THAT typo's fixed.

Re: #WHO WROTE THIS JUNK

2009-02-02 11:44 • by DaveK
241906 in reply to 241897
Mark:
Trail an error = starting with one error, only to dig deeper and deeper until the root cause of the error is discovered. Not to be confused with "trial and error."
No, to "trail an error" is to give people a teaser or sneak preview of an upcoming error, in order to generate a buzz of anticipation amongst the error's potential audience. Some errors are anticipated long in advance, with excited fans camping on the pavement outside computer stores waiting for the launch day celebrations of the faulty code.

The thing you're describing, where one failure leads you to another and from there to another until you're reeling and staggering, blundering from one error to another like a human pinball, only concussed, with each one hitting you with the force of a stepped-on lawnrake right in the face: that's called "trail OF error".

Re: #WHO WROTE THIS JUNK

2009-02-02 11:48 • by DaveK
241907 in reply to 241905
Mark Bowytz:
IByte:
Interesting enough, the trial and error process entered another iteration, and it now says "trail and error"... (a lost pathfinder?)


Crap - It's Monday for sure. That one's me trying to keep one eye on on a long-running Unix job that should've been done ages ago and another on the comments. Ok, now THAT typo's fixed.
I've just been re-reading the Unix Hater's Guide.

Perhaps this has coloured my perceptions, but I am amused by the notion of a background job that requires constant operator attention to wait for it to complete. And yet not surprised.

Anyway, mustn't keep you, it's nearing the hour. You'll probably be busy enough going and making sure all your cron jobs run.

Re: #WHO WROTE THIS JUNK

2009-02-02 11:50 • by DaveK
241908 in reply to 241866
dkf:
# FOXME: clean up comments for release
Oh, the delicious failure!
You mean the total failure of your humour detector, I take it.

Re: #WHO WROTE THIS JUNK

2009-02-02 12:17 • by cf18 (unregistered)
I think at this point the story should censor the email address to protect the innocent.

Re: #WHO WROTE THIS JUNK

2009-02-02 12:43 • by Zygo (unregistered)
241910 in reply to 241909
cf18:
I think at this point the story should censor the email address to protect the innocent.


Someone probably told the coders at that company "never remove a copyright notice, we'll get into all kinds of trouble with the lawyers."

Re: #WHO WROTE THIS JUNK

2009-02-02 12:53 • by Chiper (unregistered)
241912 in reply to 241889
Miquel van Smoorenburg <miquels@cistron.nl>:
I most certainly did not write this script.

Looked like they took a sample script that comes with
sysvinit, deleted everything but the version number
and my name, and then put their own code in.

Nice ... :/

Mike.


This deserves a blue, I think.

Re: #WHO WROTE THIS JUNK

2009-02-02 12:59 • by dkf
241913 in reply to 241908
DaveK:
dkf:
# FOXME: clean up comments for release
Oh, the delicious failure!
You mean the total failure of your humour detector, I take it.
It amused me. I take pleasure in small things. I'm sorry for you if you feel that humour has to involve a banana skin.

(It's the comment that amused me most because it's the one that, if it had been heeded by even the most junior of interns, would have made this a non-WTF. Therefore it represents the very epitome of Fail.)

Re: #WHO WROTE THIS JUNK

2009-02-02 13:03 • by iMalc (unregistered)
241914 in reply to 241878
tulcod:
TRWTF is the fact that I saw a .nl domain name at the top of the file, surfed there, got redirected to xs4all.nl, and realized, i have that very same router :(
In the words of Police Chief Wiggam's son from the Simpsons:
Haa Haa!

Re: #WHO WROTE THIS JUNK

2009-02-02 13:07 • by obediah
241915 in reply to 241904
Alex:

Or the manufacturers could've taken a simple route an added their scripts to /etc/rcS.d/ as they were supposed too, thus avoiding this mess altogether; but noes, writing rc scripts is too freaking difficult.


Is this where I can bitch about linux distros creating their own library-fueled rc abomination? Some of them add some nice features, but damn it's a kick in the teeth when you periodically pop-in to make a would-be quick change.

Re: #WHO WROTE THIS JUNK

2009-02-02 13:13 • by DaveK
241916 in reply to 241914
iMalc:
tulcod:
TRWTF is the fact that I saw a .nl domain name at the top of the file, surfed there, got redirected to xs4all.nl, and realized, i have that very same router :(
In the words of Police Chief Wiggam's son from the Simpsons:
Haa Haa!
In the words of Nelson Muntz, "FAIL!".

Re: #WHO WROTE THIS JUNK

2009-02-02 13:14 • by DaveK
241917 in reply to 241913
dkf:
DaveK:
dkf:
# FOXME: clean up comments for release
Oh, the delicious failure!
You mean the total failure of your humour detector, I take it.
It amused me. I take pleasure in small things. I'm sorry for you if you feel that humour has to involve a banana skin.

(It's the comment that amused me most because it's the one that, if it had been heeded by even the most junior of interns, would have made this a non-WTF. Therefore it represents the very epitome of Fail.)
I thought you were calling it "fail" because you thought it was an ironic typo, rather than a deliberate joke. I do apologise if that's not what you meant.

Re: #WHO WROTE THIS JUNK

2009-02-02 13:21 • by private static synchronized String longSignature() (unregistered)
241919 in reply to 241901
workmad3:
rm -rf WTF:
Same goes for /sbin/whatever.


sbin is sometimes only in the path for root and admin users, although the progs are usually usable by everyone.

Doesn't stop the entire script being a mess though :)


Actually, Fedora 10 lists having /sbin added to user's acount as a major new feature.

Re: #WHO WROTE THIS JUNK

2009-02-02 13:22 • by private static synchronized String longSignature() (unregistered)
241921 in reply to 241919
private static synchronized String longSignature():


That was meant merely as an aside, not a troll or flame or what-have-you

Re: #WHO WROTE THIS JUNK

2009-02-02 13:27 • by Tzafrir Cohen (unregistered)
241922 in reply to 241884
Not all the original script.

The tarp line, along with its comment survived as well.

This script is the version included in Debian potato and woody (maybe also in older, but not the newer Sarge:

http://archive.debian.org/sysvinit (under debian/etc/init.d/rcS )

Note that the version of busybox at the time had a rather lousy shell interpreter. It didn't support functions. Maybe they also disabled other standard shell functions to save space.

This script is behaves much differently than the original rcS script, but that's OK, as it runs a limited and well-controlled environment. And no services are ever supposed to be properly shut down. After all, the user has but one way to fix an error: reset. No need for a full-fledged init.d process. That will also take an extra second to run.

The extra sleep-s are probably the simple way to wait that some kernel stuff is initialized (they are after insmod-s that load kernel modules). Those boxes often use lousy manufacturer-proviced kernel modules for drivers.


As for "who wrote this junk", it refers to that cm_pc that doesn't daemonize properly and required ugly and half-working workarounds by the author. cm_* programs seem to be some "configuration manager" (the one responsible for that so un-unixish config.xml)

Re: #WHO WROTE THIS JUNK

2009-02-02 13:43 • by shadowman
241924 in reply to 241894
Kensey:

When dealing with basic system commands as root, typing, say, "/bin/rm" rather than "rm" is a good habit to get into -- it reduces the chance that somebody compromises your box by getting you to run a Trojan-horse rm from a different location in your PATH than you think. root should also have a minimal PATH and it should be arranged sensibly to further reduce the risk.

If you *really* want paranoia, you can disable root entirely and set up sudo on a single otherwise-unprivileged account, so that you can force root-level rm (or whatever) to run from /bin/rm or not at all regardless of what the value of PATH is.


Unless of course, there's a trojan-horse rm that simply replaced /bin/rm.
« PrevPage 1 | Page 2 | Page 3Next »

Add Comment