Force sudo to be non-interactive
authorDaniel Klaffenbach <danielklaffenbach@gmail.com>
Thu, 24 Jun 2010 20:38:40 +0000 (22:38 +0200)
committerDaniel Klaffenbach <danielklaffenbach@gmail.com>
Thu, 24 Jun 2010 20:38:40 +0000 (22:38 +0200)
Interactive sudo mode may cause the application to hang when
the sudoers file was not updated correctly.

src/mainwindow.cpp

index 0875b85..1ae4294 100755 (executable)
@@ -81,6 +81,9 @@ void MainWindow::adjustFreq()
     QString max;
     max.setNum( newmax );
     QStringList arguments;
+    //run sudo in non-interactive mode
+    arguments.append( "-n" );
+
 #if defined(Q_WS_MAEMO_5)
     //on Maemo5 the set_scalingmaxfreq-Script is not in $PATH
     arguments.append( "/opt/usr/bin/set_scalingmaxfreq" );
@@ -320,6 +323,8 @@ void MainWindow::setSmartReflex()
 //SmartReflex is only supprted on Maemo5
 #if defined(Q_WS_MAEMO_5)
     QStringList arguments;
+    //run sudo in non-interactive mode
+    arguments.append( "-n" );
     arguments.append( "/opt/usr/bin/set_sr" );
 
     if ( getSmartReflexState() == 1 )