[kredentials/f16] Resolves: bz836256
Neil Horman
nhorman at fedoraproject.org
Thu Jun 28 14:27:58 UTC 2012
commit 39d3c2d25c2dd789be35b97059909960c88087f0
Author: Neil Horman <nhorman at tuxdriver.com>
Date: Thu Jun 28 10:27:38 2012 -0400
Resolves: bz836256
kredentials-renew-option.patch | 120 ++++++++++++++++++++++++++++++++++++++++
kredentials.spec | 20 +++++--
2 files changed, 134 insertions(+), 6 deletions(-)
---
diff --git a/kredentials-renew-option.patch b/kredentials-renew-option.patch
new file mode 100644
index 0000000..d0d86aa
--- /dev/null
+++ b/kredentials-renew-option.patch
@@ -0,0 +1,120 @@
+diff -up kredentials-2.0-pre3/kredentials.1.orig kredentials-2.0-pre3/kredentials.1
+--- kredentials-2.0-pre3/kredentials.1.orig 2012-06-28 07:46:46.311834603 -0400
++++ kredentials-2.0-pre3/kredentials.1 2012-06-28 07:47:36.294228059 -0400
+@@ -40,6 +40,9 @@ Inform the user via a KDE "passive dialo
+ .TP
+ \-d|--disable-aklog
+ Don't run aklog to get new AFS tokens when renewing Kerberos creds.
++.TP
++\-r|--renew
++Set the renewal time in seconds. Setting a time of 0 disables ticket renewal
+ .SH BUGS
+ There aren't really any major bugs, but the feature list can and should
+ be expanded.
+diff -up kredentials-2.0-pre3/src/kredentials.cpp.orig kredentials-2.0-pre3/src/kredentials.cpp
+--- kredentials-2.0-pre3/src/kredentials.cpp.orig 2012-01-29 14:48:32.000000000 -0500
++++ kredentials-2.0-pre3/src/kredentials.cpp 2012-06-28 07:46:35.245526093 -0400
+@@ -57,6 +57,12 @@
+ #define LOG kDebugDevNull()
+ #endif /*DEBUG*/
+
++/*
++ * Since our timer runs in ms, we can wait more than
++ * MAX_INT/1000 seconds
++ */
++#define MAX_RENEWAL_TIME (INT_MAX / 1000)
++
+ kredentials::kredentials(int notify)
+ : KSystemTrayIcon(),tixmgr(){
+ // set the shell's ui resource file
+@@ -100,7 +106,8 @@ kredentials::kredentials(int notify)
+
+ timer = new QTimer(this);
+ connect(timer, SIGNAL(timeout()), this, SLOT(ticketTimerEvent()));
+- timer->start(1000);
++ if (secondsToNextRenewal)
++ timer->start(secondsToNextRenewal * 1000);
+
+ LOG << "Using Kerberos KRB5CCNAME of" << cc.name().c_str();
+ LOG << "kredentials constructor returning";
+@@ -168,7 +175,8 @@ void kredentials::tryPassGetTickets(){
+ if( !runAklog() ){
+ KMessageBox::sorry(0, i18n("Unable to run aklog"), 0, 0);
+ }
+- timer->start(1000);
++ if (secondsToNextRenewal)
++ timer->start(secondsToNextRenewal * 1000);
+ //that's it
+ break;
+ }
+@@ -245,8 +253,8 @@ void kredentials::tryRenewTickets()
+ // restart the timer here, regardless of whether we currently
+ // have tickets now or not. The user may get tickets before
+ // the next timeout, and we need to be able to renew them
+- secondsToNextRenewal = DEFAULT_RENEWAL_INTERVAL;
+- timer->start(1000);
++ if(secondsToNextRenewal)
++ timer->start(secondsToNextRenewal * 1000);
+ if(authenticated > 0){
+ if( !runAklog() ){
+ KMessageBox::sorry(0, "Unable to run aklog", 0, 0);
+@@ -287,11 +295,7 @@ void kredentials::ticketTimerEvent()
+ LOG << "ticketTimerEvent triggered, secondsToNextRenewal =="
+ << secondsToNextRenewal;
+
+- secondsToNextRenewal--;
+- if(secondsToNextRenewal < 0)
+- {
+- tryRenewTickets();
+- }
++ tryRenewTickets();
+ return;
+ }
+
+@@ -339,4 +343,14 @@ void kredentials::setDoNotify(int state)
+ doNotify = state;
+ }
+
++void kredentials::setRenewalTime(int seconds)
++{
++ QString msgString;
++ if (seconds > MAX_RENEWAL_TIME) {
++ KMessageBox::information(0, msgString, "Can't wait more than 2147483 seconds to renew", 0, 0);
++ seconds = MAX_RENEWAL_TIME;
++ }
++ secondsToNextRenewal = seconds;
++}
++
+ #include "kredentials.moc"
+diff -up kredentials-2.0-pre3/src/kredentials.h.orig kredentials-2.0-pre3/src/kredentials.h
+--- kredentials-2.0-pre3/src/kredentials.h.orig 2012-01-29 14:48:32.000000000 -0500
++++ kredentials-2.0-pre3/src/kredentials.h 2012-06-28 07:46:35.245526093 -0400
+@@ -62,7 +62,7 @@ public:
+ */
+ virtual ~kredentials();
+ void setDoNotify(int);
+-
++ void setRenewalTime(int);
+ protected slots:
+ void tryRenewTickets();
+ void showTicketCache();
+diff -up kredentials-2.0-pre3/src/main.cpp.orig kredentials-2.0-pre3/src/main.cpp
+--- kredentials-2.0-pre3/src/main.cpp.orig 2011-12-26 03:37:31.000000000 -0500
++++ kredentials-2.0-pre3/src/main.cpp 2012-06-28 07:46:35.245526093 -0400
+@@ -47,6 +47,8 @@ int main(int argc, char **argv)
+ ki18n("Inform the user when credentials are renewed"));
+ options.add("d").add("disable-aklog",
+ ki18n("Don't run aklog after renewing Kerberos tickets"));
++ options.add("r").add("renew <seconds>",
++ ki18n("'Number of seconds to delay before renewal"), "3600");
+ KCmdLineArgs::addCmdLineOptions( options );
+ KUniqueApplication::addCmdLineOptions();
+
+@@ -71,6 +73,7 @@ int main(int argc, char **argv)
+ {
+ k_obj->setDoAklog(false);
+ }
++ k_obj->setRenewalTime(args->getOption("renew").toInt());
+
+ k_obj->show();
+
diff --git a/kredentials.spec b/kredentials.spec
index 3deed43..ca7241e 100644
--- a/kredentials.spec
+++ b/kredentials.spec
@@ -1,12 +1,12 @@
Name: kredentials
Version: 2.0
-Release: 0.1.pre1%{?dist}
+Release: 0.3.pre3%{?dist}
Summary: KDE system tray kerberos ticket monitor
Group: System Environment/Daemons
License: MIT
URL: http://freecode.com/projects/kredentials
-Source0: http://people.csail.mit.edu/noahm/%{name}/%{version}/%{name}_%{version}-pre1.tar.bz2
+Source0: http://people.csail.mit.edu/noahm/%{name}/%{version}/%{name}-%{version}-pre3.tar.bz2
Source1: kredentials.desktop
Source2: kredentials-22x22.png
Source3: kredentials-48x48.png
@@ -18,17 +18,16 @@ BuildRequires: cmake kdelibs-devel
BuildRequires: desktop-file-utils
Requires: kdebase
-Patch0: kredentials-renew.patch
+Patch0: kredentials-renew-option.patch
%description
Kredentials is a system tray applet that monitors and renews kerberos tickets
for a user
%prep
-%setup -q -n kredentials
+%setup -q -n %{name}-%{version}-pre3
%patch0 -p1
-
%build
%{__mkdir} build
cd build
@@ -59,7 +58,7 @@ desktop-file-install --dir=$RPM_BUILD_ROOT/%{_datadir}/applications %{SOURCE1}
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
%{_bindir}/kredentials
%{_datadir}/applications/kredentials.desktop
-%{_datadir}/applnk/Utilities/kredentials.desktop
+%{_datadir}/applications/kde4/kredentials.desktop
%{_datadir}/icons/hicolor/16x16/apps/kredentials.png
%{_datadir}/icons/hicolor/22x22/apps/kredentials.png
%{_datadir}/icons/hicolor/32x32/apps/kredentials.png
@@ -67,6 +66,15 @@ desktop-file-install --dir=$RPM_BUILD_ROOT/%{_datadir}/applications %{SOURCE1}
%{_datadir}/icons/hicolor/64x64/apps/kredentials.png
%changelog
+* Thu Jun 28 2012 Neil Horman <nhorman at tuxdriver.com> - 2.0-0.3.pre3
+- Add renewal timer option
+
+* Fri Jun 08 2012 Neil Horman <nhorman at tuxdriver.com> - 2.0-0.2.pre3
+- Update to latest upstream
+
+* Thu Jan 26 2012 Neil Horman <nhorman at tuxdriver.com> - 2.0-0.2.pre1
+- Fixed a build break
+
* Tue Jan 17 2012 Neil Horman <nhorman at tuxdriver.com> - 2.0-0.1.pre1
- Initial Build
More information about the scm-commits
mailing list