Linked by Thom Holwerda on Sat 9th Sep 2006 19:54 UTC
Ubuntu, Kubuntu, Xubuntu Mark Shuttleworth writes on his blog: "I'm of the opinion that Ubuntu could not exist without Debian. So it's absolutely my intention to see that Ubuntu is a constructive part of the broader Debian landscape. It's vital that Ubuntu help to sustain and grow Debian, because it's the breadth and strength of Debian which make up the 'shoulders of greatness' on which we in the Ubuntu community stand when we reach for the stars."
Thread beginning with comment 161181
To view parent comment, click here.
To read all comments associated with this story, please click here.
SEJeff
Member since:
2005-11-05

1. You're an idiot, because no it doesn't. Check your f--king code.
Before you make yourself look more ignorant than you have ALREADY PROVEN, take a look at line 120. If you are blind, it states this:
sudo sed -ie '/NOPASSWD/s/NOPASSWD: //' /etc/sudoers

For those of you that don't understand this, this takes the NOPASSWD statement and replaces it entirely with null. No, I didn't all of the sudden change the file on my site because of your statements...

2. You're an idiot because it wouldn't even be necessary. Once you initiate the first /bin/sh using sudo scriptname everything spawned from that shell, ie. the remainder of the script, runs as root.
This wasn't supposed to be run with sudo. The script runs sudo by itsself. Being an elitest prick doesn't help anything or anyone.

Notice by reading my response to #1 that you were indeed wrong. You were wrong, and that is a fact. End of story.

Reply Parent Bookmark Score: 1

DigitalAxis Member since:
2005-08-28

If someone kills your script (I checked, they can) midway through execution, won't the system be left with sudo set to 'nopasswd'?

Anyway, if your script requires the user to give a password for sudo the first time (when the command setting to NOPASSWD is run), why not just have THEM run your script as sudo, and run everything assuming you're root?
I didn't test it, but I'm pretty sure sudo would be inherited by all processes spawned by your script, so you wouldn't have to worry about sudo timing out and sitting at a prompt until someone notices. Correct me if I'm wrong.

I mean, yes this would cause problems if the user forgot to run the script as 'sudo', but you could check that quickly by trying to create (and then remove) a file in, say, /etc; if that fails you exit with an error saying the script must be run with sudo.

I would also log completion messages AFTER you've successfully changed the setting. I'm assuming that the logging command is less likely to fail than the configuring command...

Reply Parent Bookmark Score: 3