From 63f769fc04bca48db3fe3389f93edf58e29ae887 Mon Sep 17 00:00:00 2001 From: ruglory Date: Sun, 22 Feb 2009 06:31:50 +0000 Subject: [PATCH] Check for uid removed git-svn-id: https://svn.code.sf.net/p/qlscribe/svn/trunk@79 cac9541e-1b8d-4bfa-827e-589bba606050 --- src/main.cpp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 481a0a8..c539681 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,8 +28,6 @@ #include -uid_t realUserId; - std::ostream &operator<<( std::ostream &os, const QString &str ) { return os << str.toAscii().data(); @@ -108,29 +106,6 @@ int main( int argc, char **argv ) return 3; } - bool enablePrint = false; - if( geteuid() ) { - if( !doPrint ) { - if( QMessageBox::question( 0, - QObject::tr( "Confirmation" ), - QObject::tr( "Print functionality requires setuid (sticky) flag set on the application\n" - "This program does not seem to have it set, print functionality will be disabled\n" - "You still will be able to do print preview and edit documents\n" - "Do you want to continue?" ), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No ) - == QMessageBox::No ) - return 4; - } else { - std::cerr << "Error: setuid flag is not set, cannot print" << std::endl; - return 4; - } - } else { - realUserId = getuid(); - setreuid( 0, realUserId ); - enablePrint = true; - } - int rez = 0; if( doPrint ) { @@ -156,7 +131,7 @@ int main( int argc, char **argv ) drives[driveIndex]->print( params, &scene ); rez = app.exec(); } else { - MainWindow mwindow( enablePrint ); + MainWindow mwindow( true ); mwindow.show(); mwindow.open( files ); rez = app.exec();