CVS commit by goffioul: Quick workaround for authentication problem appeared with cups-1.1.20 (backport) M +6 -0 configure.in.in 1.2.4.1 M +16 -0 ipprequest.cpp 1.29.2.1 --- kdelibs/kdeprint/cups/configure.in.in #1.2:1.2.4.1 @@ -18,2 +18,8 @@ fi +dnl check if CUPS is at least 1.1.20 +ac_have_new_cups="no" +AC_CHECK_CUPS_VERSION(1.0120) +if test "$ac_have_new_cups" = "yes"; then + AC_DEFINE(HAVE_CUPS_NO_PWD_CACHE, 1, CUPS doesn't have password caching) +fi --- kdelibs/kdeprint/cups/ipprequest.cpp #1.29:1.29.2.1 @@ -30,4 +30,13 @@ #include +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifdef HAVE_CUPS_NO_PWD_CACHE +#include +static QCString cups_authstring = ""; +#endif + void dumpRequest(ipp_t *req, bool answer = false, const QString& s = QString::null) { @@ -301,4 +310,8 @@ bool IppRequest::doFileRequest(const QSt } +#ifdef HAVE_CUPS_NO_PWD_CACHE + strncpy( HTTP->authstring, cups_authstring.data(), HTTP_MAX_VALUE ); +#endif + if (dump_ > 0) { @@ -307,4 +320,7 @@ bool IppRequest::doFileRequest(const QSt request_ = cupsDoFileRequest(HTTP, request_, (res.isEmpty() ? "/" : res.latin1()), (filename.isEmpty() ? NULL : filename.latin1())); +#ifdef HAVE_CUPS_NO_PWD_CACHE + cups_authstring = HTTP->authstring; +#endif httpClose(HTTP);