Author: lslezak Date: Tue Jul 1 11:32:48 2008 New Revision: 48703 URL: http://svn.opensuse.org/viewcvs/yast?rev=48703&view=rev Log: - check HAVE_POLKIT define Modified: branches/tmp/lslezak/workshop/core/libscr/src/SCRAgent.cc Modified: branches/tmp/lslezak/workshop/core/libscr/src/SCRAgent.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/lslezak/workshop/core/libscr/src/SCRAgent.cc?rev=48703&r1=48702&r2=48703&view=diff ============================================================================== --- branches/tmp/lslezak/workshop/core/libscr/src/SCRAgent.cc (original) +++ branches/tmp/lslezak/workshop/core/libscr/src/SCRAgent.cc Tue Jul 1 11:32:48 2008 @@ -27,7 +27,9 @@ #include "ycp/YCPPath.h" #include "ycp/YCPValue.h" +#ifdef HAVE_POLKIT #include "PolKit.h" +#endif SCRAgent* SCRAgent::current_scr = 0; @@ -113,6 +115,7 @@ YCPValue SCRAgent::Get(const YCPPath& path, const YCPValue& arg, const YCPValue& opt) { +#ifdef HAVE_POLKIT std::string pathstr(path->toString().c_str()); y2internal("Get: %s", pathstr.c_str()); @@ -126,10 +129,14 @@ { return YCPError(("User is NOT authorized to Read " + pathstr).c_str(), YCPNull()); } +#else + return Read(path, arg, opt); +#endif } YCPBoolean SCRAgent::Set(const YCPPath& path, const YCPValue& value, const YCPValue& arg) { +#ifdef HAVE_POLKIT std::string pathstr(path->toString().c_str()); y2internal("Set: %s", pathstr.c_str()); @@ -144,10 +151,14 @@ y2error("User is NOT authorized to Write %s", pathstr.c_str()); return YCPBoolean(false); } +#else + return Write(path, value, arg); +#endif } YCPList SCRAgent::List(const YCPPath& path) { +#ifdef HAVE_POLKIT std::string pathstr(path->toString().c_str()); y2internal("List: %s", pathstr.c_str()); @@ -162,11 +173,15 @@ y2error("User is NOT authorized to Dir %s", pathstr.c_str()); return YCPList(); } +#else + return Dir(path); +#endif } YCPValue SCRAgent::Run(const YCPPath& path, const YCPValue& /*value*/, const YCPValue& /*arg*/) { +#ifdef HAVE_POLKIT std::string pathstr(path->toString().c_str()); y2internal("List: %s", pathstr.c_str()); @@ -180,5 +195,8 @@ { return YCPError(("User is NOT authorized to Execute " + pathstr).c_str(), YCPNull()); } +#else + return Execute(path, YCPNull(), YCPNull()); +#endif } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org