[MonoDevelop] C#, MonoDev, System Time & Date Problem

Oskar Berggren oskar.berggren at gmail.com
Wed Sep 12 20:49:02 UTC 2012


One solution is to write a tiny program in script or C, that either runs
date or some syscall (no sudo or anything). Install that program setuid
root (http://en.wikipedia.org/wiki/Setuid). Then execute that program from
your main software (still no sudo).

/Oskar


2012/9/5 rigsmith <david.scott-frame at toshiba-ac.com>

> Hi
>
> I am trying to change the system time/date on Ubuntu operating system from
> c# code. I am using MonoDevelop Complier.
>
> My end user should never see the operating system (FluxBox) nor will they
> be
> provided the passwords for the system so I must build my own control to
> adjust the time/date.
>
> I am very stuck and have been on google and trying various things for weeks
> and I worry now that I am not going to find a solution without help
>
> I have seen two methods and I cannot implement them
>
> I have tried the following.
>
> System.Diagnostics.Process.Start(“Sudo date 031212001986”);
>
> This fails because it cannot find a TTY or password.
>
> I have also tried to use DLL import on Kernel32.dll, Enter point =
> “SetLocalTime”. This just totally fails as it cannot find the Entry point
> (All though it loads the DLL). I guess this method has been intended for C#
> on windows.
>
> I have tried quite a few variations and I am just totally stuck/confused. I
> really need to ability to change the system clock without the user knowing
> passwords and having excess to the operating system.
>
> Any method will do, I couldn’t care if its 1000 lines of code or 2 lines. I
> just really need to adjust this clock and date urgently.
>
>
>
> --
> View this message in context:
> http://mono.1490590.n4.nabble.com/C-MonoDev-System-Time-Date-Problem-tp4656499.html
> Sent from the Mono - MonoDevelop IDE mailing list archive at Nabble.com.
> _______________________________________________
> Monodevelop-list mailing list
> Monodevelop-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monodevelop-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodevelop-list/attachments/20120912/e29c6153/attachment-0001.html>


More information about the Monodevelop-list mailing list