I want to let a standard user change the system date.

So I created a named pipe. The standard user write a date to the named pipe and a root process listens to it and sets the date accordingly:

(user)

echo 122515502010 > /tmp/mypipe

(root)

date -s < /tmp/mypipe

Unfortunately this doesn't work. Where am I wrong?

I'm doing this from an embedded Linux (busybox) with bash.

link|improve this question

feedback

2 Answers

up vote 1 down vote accepted

Got it!

(root)

read line < mypipe
date -s $line

Thank you everybody! ;)

link|improve this answer
1  
As a shortcut, note that read will automatically populate $REPLY (unless you override the return variable name, as done in your example) – danlefree Dec 29 '10 at 1:18
feedback

Why not give the user access to date via sudo ?

link|improve this answer
busybox doesn't support sudo (at least the version I'm using). – michelemarcon Dec 28 '10 at 16:03
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.