From 4bc26fe2421067914e687378437e137d0fbe53ec Mon Sep 17 00:00:00 2001 From: soochoi Date: Fri, 21 Apr 2006 23:19:47 +0000 Subject: [PATCH] detach kwallet from CASA and rename to casakwallet --- c_kwallet/AUTHORS | 0 c_kwallet/COPYING | 340 +++++++++++++ c_kwallet/ChangeLog | 0 c_kwallet/Makefile.am | 131 +++++ c_kwallet/NEWS | 0 c_kwallet/README | 176 +++++++ c_kwallet/autogen.sh | 130 +++++ c_kwallet/casa_dcop.h | 71 +++ c_kwallet/casakwallet.cpp | 656 ++++++++++++++++++++++++++ c_kwallet/casakwallet.h | 97 ++++ c_kwallet/configure.in | 239 ++++++++++ c_kwallet/link.lux | 14 + c_kwallet/objs.lux | 2 + c_kwallet/package/CASAKWALLET.changes | 7 + c_kwallet/package/CASAKWALLET.spec.in | 81 ++++ c_kwallet/package/Makefile.am | 67 +++ 16 files changed, 2011 insertions(+) create mode 100644 c_kwallet/AUTHORS create mode 100644 c_kwallet/COPYING create mode 100644 c_kwallet/ChangeLog create mode 100644 c_kwallet/Makefile.am create mode 100644 c_kwallet/NEWS create mode 100644 c_kwallet/README create mode 100755 c_kwallet/autogen.sh create mode 100644 c_kwallet/casa_dcop.h create mode 100644 c_kwallet/casakwallet.cpp create mode 100644 c_kwallet/casakwallet.h create mode 100644 c_kwallet/configure.in create mode 100644 c_kwallet/link.lux create mode 100644 c_kwallet/objs.lux create mode 100644 c_kwallet/package/CASAKWALLET.changes create mode 100644 c_kwallet/package/CASAKWALLET.spec.in create mode 100644 c_kwallet/package/Makefile.am diff --git a/c_kwallet/AUTHORS b/c_kwallet/AUTHORS new file mode 100644 index 00000000..e69de29b diff --git a/c_kwallet/COPYING b/c_kwallet/COPYING new file mode 100644 index 00000000..623b6258 --- /dev/null +++ b/c_kwallet/COPYING @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/c_kwallet/ChangeLog b/c_kwallet/ChangeLog new file mode 100644 index 00000000..e69de29b diff --git a/c_kwallet/Makefile.am b/c_kwallet/Makefile.am new file mode 100644 index 00000000..c2f7cdf9 --- /dev/null +++ b/c_kwallet/Makefile.am @@ -0,0 +1,131 @@ +####################################################################### +# +# Copyright (C) 2006 Novell, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# +####################################################################### + +if DEBUG +TARGET_CFG = Debug +CFLAGS += -v -w +else +TARGET_CFG = Release +endif + +SUBDIRS = package +DIST_SUBDIRS = package + +EXTRA_DIST = $(CXXFILES) $(CXX_MOC_FILES) *.h *.sh + +CASAROOT = . + +CASALIBDIR = $(LIB) + +BUILD_VER = 1.1.1 + +# handle Mono secondary dependencies +export MONO_PATH := $(MONO_PATH) + +PLATFORMINDEPENDENTSOURCEDIR = +PLATFORMDEPENDENTSOURCEDIR = . + +####this needs to be defined in configure.in +MOC = /usr/lib/qt3/bin/moc +CXX = g++ + +MODULE_NAME =libcasakwallet +MODULE_EXT =so + +CXXFILES = $(srcdir)/casakwallet.cpp + +CXX_MOC_FILES = casakwallet.moc + +CXXFILES_CXX := +INCLUDES = -I. \ +-I/opt/kde3/include -I/usr/lib/qt3/include -I/usr/X11R6/include -I/opt/gnome/include/gnome-keyring-1/ +CXXFLAGS = $(CPP_LIBFLAG) $(INCLUDES) +EXTRA_CXXFLAGS = -fPIC -DPIC -DSSCS_LINUX_PLAT_F -DQT_THREAD_SUPPORT -DQT_CLEAN_NANESPACE \ + -DQT_NO_ASCII_CAS -O2 -fmessage-length=0 -Wall -g -D_REENTRANT \ + -DALIGNMENT -DN_PLAT_UNIX -DUNIX -DLINUX -DIAPX386 +CXX_RESOURCES = +LIBS = -lpthread -ldl +LDFLAGS = -fno-exception -fno-check-new -Wl,-Bsymbolic -shared -pthread -O2 \ + -Wl,-soname -Wl,libcasakwallet.so.1 + +EXTRA_LDFLAGS = -L/opt/kde3/$(LIB) -lkwalletclient \ + -lqt-mt -L/usr/X11R6/$(LIB) -L/usr/lib/qt3/$(LIB) -lqt-mt + +OBJDIR = ./$(TARGET_CFG)/$(LIB) + +OBJS = $(addprefix $(OBJDIR)/, $(CXXFILES:%.cpp=%.o)) + +CUR_DIR := $(shell pwd) + +all: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) + +# +# Pattern based rules. +# +vpath %.c $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR) +vpath %.cpp $(PLATFORMDEPENDENTSOURCEDIR) $(PLATFORMINDEPENDENTSOURCEDIR) + +$(CXX_MOC_FILES): casakwallet.h + $(MOC) $^ -o $@ + +$(OBJDIR)/%.o: %.cpp + c++ -c -g $(CXXFLAGS) $(EXTRA_CXXFLAGS) -o $@ $< + +$(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER):$(CXX_MOC_FILES) $(OBJDIR) $(OBJS) + @echo [======== Linking $@ ========] + c++ -o $@ $(LDFLAGS) $(EXTRA_LDFLAGS) $(OBJS) $(LIBS) + cp -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) + ln -sf $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).$(BUILD_VER) $(CASALIBDIR)/$(TARGET_CFG)/$(MODULE_NAME).$(MODULE_EXT).1 + +$(OBJDIR): + [ -d $(OBJDIR) ] || mkdir -p $(OBJDIR) + [ -d $(CASALIBDIR) ] || mkdir -p $(CASALIBDIR) + [ -d $(CASALIBDIR)/$(TARGET_CFG) ] || mkdir -p $(CASALIBDIR)/$(TARGET_CFG) + + +install-exec-local: $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) + $(mkinstalldirs) $(DESTDIR)$(libdir) + $(INSTALL_PROGRAM) $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) $(DESTDIR)$(libdir)/ + +uninstall-local: + cd $(DESTDIR)$(libdir); rm -f $(OBJDIR)/$(MODULE_NAME).$(MODULE_EXT) + rmdir $(DESTDIR)$(libdir) + +clean-local: + if [ -d $(TARGET_CFG) ]; then rm -rf $(TARGET_CFG); fi + if [ -f $(CXX_MOC_FILES) ]; then rm -f $(CXX_MOC_FILES); fi + rm -rf *.suo $(CASALIBDIR) + rm -rf *.suo $(CASABINDIR) + +.PHONY: package package-clean package-install package-uninstall +package package-clean package-install package-uninstall: + $(MAKE) -C package $@ + + +maintainer-clean-local: + rm -f configure Makefile.in casa-*.tar.gz + rm -f aclocal.m4 conf*.sh configure.lineno + rm -f config.guess config.sub config.status + rm -f ltmain.sh libtool + rm -f install-sh install-sh.lnk INSTALL INSTALL.lnk + rm -f missing missing.lnk mkinstalldirs mkinstalldir.lnk + rm -rf autom4te.cache + diff --git a/c_kwallet/NEWS b/c_kwallet/NEWS new file mode 100644 index 00000000..e69de29b diff --git a/c_kwallet/README b/c_kwallet/README new file mode 100644 index 00000000..6fd7ab21 --- /dev/null +++ b/c_kwallet/README @@ -0,0 +1,176 @@ +/*********************************************************************** + * File: README + * + * Copyright (C) 2004 Novell, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the Free + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + ***********************************************************************/ + +INTRODUCTION + +The LoginCapture provides a service that exports the credentials used +by the user to login to the desktop to the SecretStore wallet. Once in the +SecretStore wallet, the credentials can be leveraged by desktop applications +to provide a better single sign-on experience to the user. + +Please note that the better single sign-on experience will only be realized if +the credentials used to log to the back-end systems match the credentials +used to login to the desktop. + +FEATURES + +The LoginCapture services are provided by components that are platform dependent. + +On Linux, LoginCapture provides its services through the use of a PAM module which +is inserted into the PAM configuration chain of the default Windows Manager during +the installation of the LoginCapture rpm. + +On Windows2000 and above, LoginCapture provides its services through a Credential Manager. + +CONTENTS + +linux - This folder contains the Linux PAM module implementation. + +windows - This folder contanins the Windows Credential Manager implementation. + +package - This folder contains the files necessary to build the software packages +under windows and under linux. + +REQUIREMENTS FOR BUILDING THE SOFTWARE PACKAGE ON WINDOWS + + - Install Visual Studio .NET 2003 + - Install Cygwin - See instructions below. + +Download and start cygwin install: +Browse to http://sources.redhat.com/cygwin/ + +Click on "Install or update now!" or "Install Cygwin now" + +Cygwin Setup: +Next + +Cygwin Setup - Choose Installation Type: +Install from Internet +Next + +Cygwin Setup - Choose Installation Directory: +Root Directory: C:\cygwin +Install For: "All Users" + +Default Text File Type: DOS + +Cygwin Setup - Select Local Package Directory: + Local Package Directory: C:\cygwin-packages + +Cygwin Setup - Select Connection Type: + Direct Connection + +Choose A Download Site: + ftp://ftp.nas.nasa.gov + +Cywin Setup - Select Packages: + Base: + defaults + + Devel: + autoconf + automake + libtool + make + pkgconfig + cvs + gcc + gcc-g++ + + Editors: + vim (optional) + + Net: + openssh + openssl + + Text: + more + + Utils: + clear (optional) + +Cygwin Setup - Create Icons: +Finish + +Edit cygwin.bat (c:\cygwin\cygwin.bat) to add a call to +%VS71COMNTOOLS%\vsvars32.bat (see example below). This sets up the +Visual Studio tools in Cygwin. + +Sample cygwin.bat: + +@echo off + +call "%VS71COMNTOOLS%\vsvars32.bat" > NUL + +C: +chdir C:\cygwin\bin + +bash --login -i + + +REQUIREMENTS FOR BUILDING THE SOFTWARE PACKAGE ON LINUX + +Install latest mono and mono-devel RPM - Obtain RPMs from +www.go-mono.org. + + +BUILDING THE SOFTWARE PACKAGE + +Windows: Start at Step 1. +Linux: Skip to Step 2. + +1. Run cygwin.bat to start up Cygwin. + +2. Generate autotools files: +./autogen.sh --prefix=/ [--enable-debug] +( is some writable directory where 'make install' will +install files for testing. + +3. To reconfigure later, or to configure software that came from a source +distribution (.tar.gz) file, use configure. +./configure --prefix/ [--enable-debug] +(run ./configure --help for more options) + +4. Select your make target, here are a few interesting ones: + +make [all] - build product files (package files not included) + +make clean - clean up files built by 'make all' + +make package - build product and package files + +make package-clean - clean up package files + +make install - install product files to specified by +--prefix during configure + +make uninstall - undo 'make install' + +make dist - build a source distribution tarball. + +make distclean - removes files to return state back to same as the +source distribution (configure, Makefile.in files, and other distributed +autotools files are not removed) + +make maintainer-clean - removes files to return state back to same as +the CVS checkout (you will need to run ./autogen.sh again before running +make again) + diff --git a/c_kwallet/autogen.sh b/c_kwallet/autogen.sh new file mode 100755 index 00000000..42e04308 --- /dev/null +++ b/c_kwallet/autogen.sh @@ -0,0 +1,130 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir +PROJECT=CASA +TEST_TYPE=-f +FILE=casakwallet.cpp + +DIE=0 + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed to compile $PROJECT." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +AUTOMAKE=automake-1.9 +ACLOCAL=aclocal-1.9 + +($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { + AUTOMAKE=automake + ACLOCAL=aclocal +} + +($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have automake installed to compile $PROJECT." + echo "Download the appropriate package for your distribution," + echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/" + DIE=1 +} + +if test "$DIE" -eq 1; then + exit 1 +fi + +test $TEST_TYPE $FILE || { + echo "You must run this script in the top-level $PROJECT directory" + exit 1 +} + +if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." +fi + +case $CC in +*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;; +esac + +for coin in `find $srcdir -name configure.in -print` +do + dr=`dirname $coin` + if test -f $dr/NO-AUTO-GEN; then + echo skipping $dr -- flagged as no auto-gen + else + echo processing $dr + macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin` + ( cd $dr + aclocalinclude="$ACLOCAL_FLAGS" + for k in $macrodirs; do + if test -d $k; then + aclocalinclude="$aclocalinclude -I $k" + ##else + ## echo "**Warning**: No such directory \`$k'. Ignored." + fi + done + if grep "^AM_GNU_GETTEXT" configure.in >/dev/null; then + if grep "sed.*POTFILES" configure.in >/dev/null; then + : do nothing -- we still have an old unmodified configure.in + else + echo "Creating $dr/aclocal.m4 ..." + test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 + echo "Running gettextize... Ignore non-fatal messages." + echo "no" | gettextize --force --copy + echo "Making $dr/aclocal.m4 writable ..." + test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 + fi + fi + if grep "^AM_GNOME_GETTEXT" configure.in >/dev/null; then + echo "Creating $dr/aclocal.m4 ..." + test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 + echo "Running gettextize... Ignore non-fatal messages." + echo "no" | gettextize --force --copy + echo "Making $dr/aclocal.m4 writable ..." + test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 + fi + if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then + echo "Creating $dr/aclocal.m4 ..." + test -r $dr/aclocal.m4 || touch $dr/aclocal.m4 + echo "Running gettextize... Ignore non-fatal messages." + echo "no" | glib-gettextize --force --copy + echo "Making $dr/aclocal.m4 writable ..." + test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4 + fi + if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then + echo "Running libtoolize..." + libtoolize --force --copy + fi + echo "Running $ACLOCAL $aclocalinclude ..." + $ACLOCAL $aclocalinclude + if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then + echo "Running autoheader..." + autoheader + fi + echo "Running $AUTOMAKE --gnu $am_opt ..." + $AUTOMAKE --add-missing --gnu $am_opt + echo "Running autoconf ..." + autoconf + ) + fi +done + +conf_flags="--config-cache --enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c + +cd "$ORIGDIR" + +if test x$NOCONFIGURE = x; then + echo Running $srcdir/configure $conf_flags "$@" ... + $srcdir/configure $conf_flags "$@" \ + && echo Now type \`make\' to compile $PROJECT || exit 1 +else + echo Skipping configure process. +fi diff --git a/c_kwallet/casa_dcop.h b/c_kwallet/casa_dcop.h new file mode 100644 index 00000000..d6b2cc10 --- /dev/null +++ b/c_kwallet/casa_dcop.h @@ -0,0 +1,71 @@ +/*********************************************************************** + * + * Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, Novell, Inc. + * + * To contact Novell about this file by physical or electronic mail, + * you may find current contact information at www.novell.com. + * + ***********************************************************************/ + +// -*- c++ -*- +#ifndef _DCOP_CASA_CONNECTOR_H_ +#define _DCOP_CASA_CONNECTOR_H_ + + +#include + + +/** + * Adding DCOP interface to the Console. + * + */ + + +struct EnumSecretList +{ + // struct SecretInfo *sInfo; + char *walletName; + char *folderName; + int entryType; + char *secretVal; + struct EnumSecretList *next; +}; + + + + + +class DCOPCASAConnector : public QObject +{ + + Q_OBJECT + +public: + DCOPCASAConnector(); + ~DCOPCASAConnector(); + +public slots: + + int ReadAllWalletSecrets(struct EnumSecretList **); + +private: + + int ReadKey(Wallet *, QString, QByteArray*); + +}; + +#endif + diff --git a/c_kwallet/casakwallet.cpp b/c_kwallet/casakwallet.cpp new file mode 100644 index 00000000..7a16ea76 --- /dev/null +++ b/c_kwallet/casakwallet.cpp @@ -0,0 +1,656 @@ +/*********************************************************************** + * + * Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, Novell, Inc. + * + * To contact Novell about this file by physical or electronic mail, + * you may find current contact information at www.novell.com. + * + ***********************************************************************/ + +#include +#include +#include +#include +#include +#include + +#define MAX_LENGTH 256 + +using namespace KWallet; +using namespace std; + +#include "casakwallet.h" +#include "casakwallet.moc" +//#include "mytest.h" + + +// char *applName="dcopifacedemo"; + char *applName="casaconsole"; + QStringList walletList; + + DCOPCASAConnector *win = new DCOPCASAConnector(); + + DCOPCASAConnector::DCOPCASAConnector() + { + + int ret = 0; + kapp->dcopClient()->isRegistered() ; + if (!ret) + { + if(kapp->dcopClient()->registerAs( "casaconsole" ).isEmpty()) + { + kapp->startKdeinit(); + kapp->dcopClient()->isRegistered() ; + if (!ret) + { + if (kapp->dcopClient()->registerAs( "casaconsole" ).isEmpty()) + { + printf("Cannot setup DCOP communication. Start kdeinit manually\n"); + return; + } + } + } + } + +/* if ( !kapp->dcopClient()->isRegistered() ) { + kapp->dcopClient()->registerAs( "casaconsole" ); + } +*/ + } + + DCOPCASAConnector::~DCOPCASAConnector() + { + + for ( QStringList::Iterator walletIter = walletList.begin(); walletIter != walletList.end(); ++walletIter ) + { + QString walletName = (*walletIter); + Wallet::disconnectApplication(walletName,applName); + + } + } + + + + + + + int DCOPCASAConnector::ReadKey(Wallet *wallet,QString key, QByteArray *secretVal) + { + + // Read the secret from the entry + QByteArray value; + //printf("kwallet: Read Key entered\n"); + + if (wallet->readEntry(key, value)==0) + { + + if (value) + { + + *secretVal = value; + QDataStream convert(*secretVal, IO_ReadOnly); + + + if (wallet->entryType(key) == 1 ) + { + + //Commented by Austin + /* // Convert the ByteArray to QString + QString passwd; + printf("In read Entry Convert Final before success\n"); + convert >> passwd; + printf("In read Entry Convert Final success\n"); + */ + + } else if (wallet->entryType(key) == 3) + { + + // If the entry is of type "map" + // Convert the ByteArray to QMap + QMap mapSecret; + convert >> mapSecret; + + // Iterate through each map entry. + QMap::Iterator mapIter; + QString tempSecret = QString::fromLatin1(""); + + for ( mapIter = mapSecret.begin(); mapIter != mapSecret.end(); ++mapIter ) + { + // This logic has to be improved + tempSecret.append(mapIter.key().latin1()); + tempSecret.append(":"); + tempSecret.append(mapIter.data().latin1()); + + if ((++mapIter) != mapSecret.end()) + tempSecret.append(";"); + + --mapIter; + } + + // Convert the QString to QByteArray + QDataStream stream(*secretVal, IO_WriteOnly); + stream << tempSecret ; + + } + + } else + { + //printf("Could not read the entry..inner IF\n"); + return -1; + } + + } else + { + //printf("Could not read the entry Inside wallet->readkey\n"); + return -1; + } + + return 0; + +} + + + + + + + + + + + + + + + + + + + + + + + + +extern "C" +{ + static struct EnumSecretList *tempEnumSecrets = NULL; + + //void MyTest(struct EnumSecretList *enumWalletSecrets) + void Aggregate(struct EnumSecretList *enumWalletSecrets) + { + + //printf("inside natiove agg"); + int retVal = 0; + tempEnumSecrets = NULL; + retVal = win->ReadAllWalletSecrets(&tempEnumSecrets); + + struct EnumSecretList *iter = tempEnumSecrets; + //struct EnumSecretList *head = tempEnumSecrets; +/* + if (iter == NULL) + { + + printf("Native has given NULLLL\n"); + enumWalletSecrets = NULL; + return; + } +*/ + while (iter != NULL) + { + + /* + printf("\n\n**Wallet Name : %s\n",iter->walletName); + printf("\t**Folder Name : %s\n",iter->folderName); + printf("\t\t**Secret Type : %d\n",iter->entryType); + printf("\t\t\t**Secret Value : %s\n",iter->secretVal); + */ + + enumWalletSecrets->walletName = iter->walletName; + enumWalletSecrets->folderName = iter->folderName; + enumWalletSecrets->secretVal = iter->secretVal; + enumWalletSecrets->entryType = iter->entryType; + enumWalletSecrets->next = iter->next; + + iter = iter->next; + if (iter != NULL) + { + enumWalletSecrets = enumWalletSecrets->next ; + } + else + { + enumWalletSecrets = NULL; + } + + } +/* + // Free the list + struct EnumSecretList *temp; + while (head != NULL) + { + free(head->walletName); + free(head->folderName); + free(head->secretVal); + //free(head->entryType); + temp = head->next; + free(head); + head = temp; + } + + + */ + + } + + char * GetDefaultWallet() + { + char *homedir = NULL; + char *defaultwallet = NULL; + char *str1 = "Default Wallet="; + char str[MAX_LENGTH]; + FILE *fs = NULL; + int i,j,k; + + defaultwallet = (char *)malloc(MAX_LENGTH); + homedir = (char *)malloc(MAX_LENGTH); + + strcpy(homedir, getenv("HOME")); + strcat(homedir, "/.kde/share/config/kwalletrc"); + strcat(homedir,"\0"); + + fs = fopen(homedir,"r"); + if(fs == NULL) + { + free (homedir); + free (defaultwallet); + return "kdewallet"; + } + while(!feof(fs)) + { + fgets(str,MAX_LENGTH,fs); + for(i=0; str[i] && str1[i]; i++) + { + if(str[i] == str1[i]) + continue; + else + break; + } + if(i==strlen(str1)) + { + for(j=i,k=0;jwalletName); + free(head->folderName); + free(head->secretVal); + //free(head->entryType); + temp = head->next; + free(head); + head = temp; + } + tempEnumSecrets = NULL; + + } + + + +} + + + + + int DCOPCASAConnector::ReadAllWalletSecrets(struct EnumSecretList **enumWalletSecrets) + { + + walletList = Wallet::walletList(); + for ( QStringList::Iterator walletIter = walletList.begin(); walletIter != walletList.end(); ++walletIter ) + { + QString walletName = (*walletIter); + // printf("The wallet name is %s\n",(*walletIter).latin1()); + + + // Open the wallet + Wallet *wallet = NULL; + wallet = Wallet::openWallet(walletName,0,Wallet::Synchronous); + + if (wallet == NULL) + { + //printf("Could not open the wallet\n"); + return -1; + } + + // Get the folder list of the wallet + QStringList folderList = wallet->folderList(); + + for ( QStringList::Iterator folderIter = folderList.begin(); folderIter != folderList.end(); ++folderIter) + { + + // printf("\t%s\n",(*folderIter).latin1()); + QString folderName = (*folderIter); + + // Set the current folder + if (!(wallet->setFolder(folderName))) + { + //printf("Could not set the folder\n"); + return -1; + } + + // Get the list of entries in the folder + QStringList entryList = wallet->entryList(); + + for ( QStringList::Iterator entryIter = entryList.begin(); entryIter != entryList.end(); ++entryIter) + { + //printf("Entry Name : \t\t%s\n",(*entryIter).latin1()); + + // Read the secret from the entry + QString key = (*entryIter); + + QByteArray *secretVal = new QByteArray(); + if (ReadKey(wallet,key,secretVal) != 0) + { + //printf("Could not read \"%s\"\n",key.latin1()); + break; + //FIXME + } + + struct EnumSecretList *tempWalletSecrets = (struct EnumSecretList*)malloc(sizeof(struct EnumSecretList)); + + if (tempWalletSecrets == NULL) { + //printf("Memory Allocation failure\n"); + return -1; + } + + tempWalletSecrets->walletName = (char*)malloc(512); + + if (tempWalletSecrets->walletName == NULL) + { + //printf("Memory Allocation failure\n"); + return -1; + } + + //printf("Wallet Name is %s\n",walletName.latin1()); + strcpy(tempWalletSecrets->walletName, walletName.latin1()); + tempWalletSecrets->folderName = (char*)malloc(512); + + if (tempWalletSecrets->folderName == NULL) + { + //printf("Memory Allocation failure\n"); + return -1; + } + + // printf("Folder Name is %s\n",folderName.latin1()); + + strcpy(tempWalletSecrets->folderName, folderName.latin1()); + tempWalletSecrets->entryType = wallet->entryType(key); + // printf("EntryType is %d\n",wallet->entryType(key)); + + + if (*enumWalletSecrets == NULL) + { + *enumWalletSecrets = tempWalletSecrets; + } + else + { + struct EnumSecretList *iter; + for(iter=*enumWalletSecrets; iter->next!=NULL; iter=iter->next); + iter->next = tempWalletSecrets; + } + + tempWalletSecrets->next = NULL; + + + + //Commented by Austin + QDataStream convert(*secretVal, IO_ReadOnly); + QString passwd; + convert >> passwd; + //QString passwd(*secretVal); + //printf("kwallet : ReadAll key %s value %s \n",key.latin1(), passwd.latin1()); + tempWalletSecrets->secretVal = (char*)malloc(512); + + if (tempWalletSecrets->secretVal == NULL) + { + //printf("Memory Allocation failure\n"); + return -1; + } + + strcpy(tempWalletSecrets->secretVal,key.latin1()); + //printf("After strcpy - 1 - key is %s\n",key.latin1()); + strcat(tempWalletSecrets->secretVal,"="); + //printf("After strcat = \n"); + if(passwd) + { + //printf("Passwd is %s\n",passwd.latin1()); + strcat(tempWalletSecrets->secretVal,passwd.latin1()); + } + + // Free memory + free(secretVal); + // printf("After free\n"); + + } + + } + + + // Print all the secrets +/* + struct EnumSecretList *iter = *enumWalletSecrets; + while (iter != NULL) + { + printf("\n\nWallet Name : %s\n",iter->walletName); + printf("\tFolder Name : %s\n",iter->folderName); + printf("\t\tSecret Type : %d\n",iter->entryType); + printf("\t\t\t Secret Value : %s\n",iter->secretVal); + iter = iter->next; + } + +*/ + + } + + return(0); + +} + +int DCOPCASAConnector::SetEntry(char *name, char *foldername, int entryType, char *keyname, char *value, int valueLen ) + { + + QString qWalletName(name); + QString qKey(keyname); + QString qFolderName(foldername); + + QString &refQKey = qKey; + + // Open the wallet + Wallet *wallet = NULL; + wallet = Wallet::openWallet(qWalletName,0,Wallet::Synchronous); + if (wallet == NULL) + { + //printf("Could not open the wallet %s \n", qWalletName.latin1()); + return KWALLET_RESULT_CANNOT_OPEN_WALLET; + } + if (wallet->setFolder(qFolderName) == false) + { + //printf("Could not open the folder %s \n", qFolderName.latin1()); + return KWALLET_RESULT_CANNOT_OPEN_FOLDER; + } + QString unicodeValue = tr(value); + // Read the secret from the entry + //QByteArray secretVal(valueLen *2 ); + + QByteArray secretVal; + QDataStream ds(secretVal, IO_WriteOnly); + ds << unicodeValue; + + /*for(int i=0; i< valueLen; i++) + { + secretVal[i] = 0; + secretVal[i+1] = value[i]; + } + */ + //secretVal[valueLen] = '\0'; + + // secretVal.fill('a'); + //secretVal.setRawData(value,valueLen); + QByteArray &refSecretVal = secretVal; + + //QDataStream convert( secretVal, IO_WriteOnly ); + //convert.readBytes( value, (uint)valueLen); +// Wallet::EntryType MyEntryType = 3; + if (wallet->entryType(qKey) != 3) + { + //printf("kwallet : SetEntry : Before setting Entry key %s value = %s EntryType =%d \n" , qKey.latin1() , value, entryType ); + if (wallet->writeEntry(refQKey, refSecretVal , (Wallet::EntryType) entryType ) != 0) + { + return KWALLET_RESULT_CANNOT_WRITE_ENTRY; + } + } + // Free memory + wallet->sync(); + return KWALLET_RESULT_OK; + } + + +int DCOPCASAConnector::SetMap(char *name, char *foldername, char *keyname, char **value, int numOfKeys ) + { + QString qWalletName(name); + QString qKey(keyname); + QString qFolderName(foldername); + //printf("kwallet : SetMap : Wallet %s Folder %s Key =%s\n", name, foldername, keyname); + + + // Open the wallet + Wallet *wallet = NULL; + wallet = Wallet::openWallet(qWalletName,0,Wallet::Synchronous); + if (wallet == NULL) + { + //printf("Could not open the wallet\n"); + return KWALLET_RESULT_CANNOT_OPEN_WALLET; + } + + + if (wallet->hasFolder(qFolderName) == false) + { + if(wallet->createFolder(qFolderName) == false) + { + return KWALLET_RESULT_CANNOT_CREATE_FOLDER; + } + } + + if (wallet->setFolder(qFolderName) == false) + { + return KWALLET_RESULT_CANNOT_OPEN_FOLDER; + } + + QMap mapSecret; + for (int i=0; i < numOfKeys * 2; i+=2) + { + QString mapelekey((char *)value[i]); + QString mapelevalue((char *)value[i+1]); + mapSecret.insert(mapelekey,mapelevalue); + } + if (wallet->writeMap(qKey,mapSecret) != 0 ) + { + return KWALLET_RESULT_CANNOT_WRITE_ENTRY; + } + wallet->sync(); + return KWALLET_RESULT_OK; +} + + + +int DCOPCASAConnector::RemoveEntry(char *name, char *foldername, char *keyname ) +{ + + QString qWalletName(name); + QString qKey(keyname); + QString qFolderName(foldername); + //printf("In DCOPCASAConnector:RemoveEntry\n"); + //printf("In DCOPCASAConnector:False %d\n",false); + //printf("In DCOPCASAConnector:False %d\n",FALSE); + + // Open the wallet + Wallet *wallet = NULL; + wallet = Wallet::openWallet(qWalletName,0,Wallet::Synchronous); + if (wallet == NULL) + { + //printf("Could not open the wallet %s \n", qWalletName.latin1()); + return KWALLET_RESULT_CANNOT_OPEN_WALLET; + } + if (wallet->setFolder(qFolderName) == false) + { + //printf("Could not set the folder %s \n", qFolderName.latin1()); + return KWALLET_RESULT_CANNOT_OPEN_FOLDER; + } + if (wallet->removeEntry(qKey) != 0) + { + //printf("Could not remove Entry %s \n", qKey.latin1()); + return KWALLET_RESULT_CANNOT_REMOVE_ENTRY; + } + wallet->sync(); + //printf("In DCOPCASAConnector:RemoveEntry Exit\n"); + return KWALLET_RESULT_OK; +} + diff --git a/c_kwallet/casakwallet.h b/c_kwallet/casakwallet.h new file mode 100644 index 00000000..2a5779fd --- /dev/null +++ b/c_kwallet/casakwallet.h @@ -0,0 +1,97 @@ +/*********************************************************************** + * + * Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; version 2.1 + * of the License. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, Novell, Inc. + * + * To contact Novell about this file by physical or electronic mail, + * you may find current contact information at www.novell.com. + * + ***********************************************************************/ + + +// -*- c++ -*- +#ifndef _DCOP_CASA_RW_H +#define _DCOP_CASA_RW_H +#include + + +enum KWalletResult +{ KWALLET_RESULT_OK, + + KWALLET_RESULT_CANNOT_OPEN_WALLET, + KWALLET_RESULT_CANNOT_OPEN_FOLDER, + KWALLET_RESULT_CANNOT_WRITE_ENTRY, + KWALLET_RESULT_MALFORMED_XML, + KWALLET_RESULT_CANNOT_CREATE_FOLDER, + KWALLET_RESULT_CANNOT_CREATE_WALLET, + KWALLET_RESULT_CANNOT_REMOVE_ENTRY, + KWALLET_RESULT_UNKNOWN_ERROR +}; + + + + +/** + * Adding DCOP interface to an app. + */ + + +struct EnumSecretList +{ + char *walletName; + char *folderName; + int entryType; + char *secretVal; + struct EnumSecretList *next; +}; + + +struct TryEnumSecretList +{ + char *name; + struct TryEnumSecretList *next; +}; + + + + +class DCOPCASAConnector : public QObject +{ + + Q_OBJECT + +public: + DCOPCASAConnector(); + ~DCOPCASAConnector(); + +public slots: + +// void dump(); + int ReadAllWalletSecrets(struct EnumSecretList **); +// int ReadWalletSecret(QString, QString, QString, QByteArray*); +// int WriteWalletSecret(QString, QString, QString, QByteArray , int); + int SetEntry(char *, char *, int , char *, char *, int); + int SetMap(char *, char *, char *, char** , int ); + int RemoveEntry(char *, char *, char *); + + +private: + + int ReadKey(Wallet*, QString, QByteArray*); + +}; + +#endif + diff --git a/c_kwallet/configure.in b/c_kwallet/configure.in new file mode 100644 index 00000000..5109e41d --- /dev/null +++ b/c_kwallet/configure.in @@ -0,0 +1,239 @@ +####################################################################### +# +# Copyright (C) 2006 Novell, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# +####################################################################### + +AC_INIT(casakwallet.cpp) +AC_CANONICAL_SYSTEM +AM_INIT_AUTOMAKE(CASAKWALLET, 1.6.476) +RELEASE=`date +%Y%m%d_%H%M` +AC_SUBST(RELEASE) +AM_MAINTAINER_MODE + +# +# Check for a valid C# compiler +# +AC_CHECK_PROG(CSC, csc, csc) +test -z "$CSC" && AC_CHECK_PROG(CSC, mcs, mcs) +test -z "$CSC" && AC_MSG_ERROR([no acceptable C Sharp compiler found in \$PATH]) + +case $CSC in + # + # Mono-specific configuration + # + mcs) + CSC_EXEFLAG=/target:exe + CSC_LIBFLAG=/target:library + CSC_EXEFLAG=/target:exe + CSC_WINEXEFLAG=/target:winexe + CSCFLAGS='/d:MONO /warn:4 /d:TRACE -d:LINUX' + CSCFLAGS_DEBUG="/debug+ /d:DEBUG" + CSCFLAGS_OPTIMIZE="/optimize+" + MONO=mono + MONO_DEBUG='mono --debug' + MONO_PATH= + SYSTEM_XML='System.Xml.dll' + ;; + # + # .NET-specific configuration + # + csc) + CSC_EXEFLAG=/target:exe + CSC_LIBFLAG=/target:library + CSC_EXEFLAG=/target:exe + CSC_WINEXEFLAG=/target:winexe + CSCFLAGS='/d:DOTNET /warn:4 /d:TRACE /nologo' + CSCFLAGS_DEBUG="/debug+ /d:DEBUG" + CSCFLAGS_OPTIMIZE="/optimize+" + MONO= + MONO_DEBUG= + MONO_PATH= + SYSTEM_XML='System.XML.dll' + ;; +esac +AC_SUBST(CSC) +AC_SUBST(CSC_EXEFLAG) +AC_SUBST(CSC_LIBFLAG) +AC_SUBST(CSC_WINEXEFLAG) +AC_SUBST(CSCFLAGS) +AC_SUBST(CSCFLAGS_DEBUG) +AC_SUBST(MONO) +AC_SUBST(MONO_PATH) +AC_SUBST(SYSTEM_XML) + +SRCDIR='$(top_srcdir)' +DOCDIR="$SRCDIR/doc" + +AC_SUBST(SRCDIR) +AC_SUBST(DOCDIR) + +EMPTY= +SPACE='$(EMPTY) $(EMPTY)' + +AC_SUBST(EMPTY) +AC_SUBST(SPACE) + +# +# Check for operating system and set TARGET_OS +# +case $host_os in + cygwin*) + TARGET_OS='windows' + ;; + *) + TARGET_OS='linux' + ;; +esac + +AC_SUBST(TARGET_OS) +AM_CONDITIONAL(LINUX, test "$TARGET_OS" = "linux") +AM_CONDITIONAL(WINDOWS, test "$TARGET_OS" = "windows") + +# +# Check for architecture and set TARGET_ARCH +# ia64 needs to be treated as non64. + +case $target_cpu in + x86_64|p*pc64|s390x) + LIB=lib64 + ;; + *ia64|*) + LIB=lib + ;; +esac + +AC_SUBST(LIB) +AM_CONDITIONAL(LIB64, test "$LIB" = lib64) + +# +# +# Set platform-specific variables +# +case $TARGET_OS in + # + # Linux-specific configuration + # + linux) + # + # Set variables + # + COMMON_CLEAN_FILES='' + ICON_EXT='.ico' + ICON_FLAG='/resource:' + PLATFORM_SUBDIRS=$LINUX_SUBDIRS + SEP='/' + LINK=gcc + ;; + # + # Windows-specific configuration + # + windows) + COMMON_CLEAN_FILES='*.suo */*.suo *.csproj.user */*.csproj.user bin obj */bin */obj *.xml */*.xml *.pdb */*.pdb' + ICON_EXT='.ico' + ICON_FLAG='/win32icon:' + PLATFORM_SUBDIRS=$WINDOWS_SUBDIRS + SEP='$(EMPTY)\\$(EMPTY)' + LINK= + ;; +esac +AC_SUBST(COMMON_CLEAN_FILES) +AC_SUBST(ICON_EXT) +AC_SUBST(ICON_FLAG) +AC_SUBST(PLATFORM_SUBDIRS) +AC_SUBST(SEP) +AC_SUBST(LINK) + +# +# Run standard macros +# +AM_PROG_CC_STDC +AC_PROG_INSTALL +AC_HEADER_STDC + +# +# Handle --enable-debug +# +AC_ARG_ENABLE(debug, [ + --enable-debug configure the Makefiles to build in DEBUG mode], + [case "${enableval}" in + yes) enable_debug=true ;; + no) enable_debug=false ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;; + esac],[enable_debug=false]) +AM_CONDITIONAL(DEBUG, test x$enable_debug = xtrue) +if test "$enable_debug" = "true" +then + # Build debug version. + # CFLAGS="$CFLAGS_DEBUG $CFLAGS -DDBG -DDEBUG" + CFLAGS="$CFLAGS_DEBUG $CFLAGS -g -DDBG -DDEBUG \ +-fPIC -DPIC -DSSCS_LINUX_PLAT_F -O2 -fmessage-length=0 -Wall \ +-D_REENTRANT -DALIGNMENT -DN_PLAT_UNIX \ +-DUNIX -DLINUX -DIAPX38" + CSCFLAGS="$CSCFLAGS_DEBUG $CSCFLAGS" + CXXFLAGS="$CXXFLAGS_DEBUG $CXXFLAGS" + DEVENV_CONFIGURATION=Debug + MONO=$MONO_DEBUG +else + # Build optimized version. + CFLAGS="$CFLAGS_OPTIMIZE $CFLAGS -g -fPIC -DPIC \ +-DSSCS_LINUX_PLAT_F -O2 -fmessage-length=0 -Wall \ +-D_REENTRANT -DALIGNMENT -DN_PLAT_UNIX \ +-DUNIX -DLINUX -DIAPX38" + CSCFLAGS="$CSCFLAGS_OPTIMIZE $CSCFLAGS" + CXXFLAGS="$CXXFLAGS_OPTIMIZE $CXXFLAGS" + DEVENV_CONFIGURATION=Release +fi +AC_SUBST(CSCFLAGS) +AC_SUBST(DEVENV_CONFIGURATION) + +##comment out due to build failure +# Check for GCC version to add fstack-protector flag +# +#GCC_VER="`gcc -dumpversion`" +#case "$GCC_VER" in +# 3*) +# ;; +# 4*) +# CFLAGS="$CFLAGS -fstack-protector" +# ;; +# *) +# ;; +#esac + +AC_SUBST(GCC_VER) + +# +# Configure PKG_CONFIG +# +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) +if test "x$PKG_CONFIG" = "xno"; then + AC_MSG_ERROR([You need to install pkg-config]) +fi + +# +# Configure files +# +AC_OUTPUT([ +Makefile +package/Makefile +package/CASAKWALLET.spec +]) + + + diff --git a/c_kwallet/link.lux b/c_kwallet/link.lux new file mode 100644 index 00000000..4f33ed17 --- /dev/null +++ b/c_kwallet/link.lux @@ -0,0 +1,14 @@ +LINK = $(CPP) \ + -Wl,-Bsymbolic \ + -shared \ + -pthread \ + -O2 -fno-exceptions -fno-check-new \ + -Wl,-rpath -Wl,/usr/lib$(ARC) \ + -L/usr/lib$(ARC) -lpthread -lc -ldl \ + -L/opt/kde3/lib$(ARC) -lkwalletclient -lqt-mt \ + -L/usr/X11R6/lib$(ARC) \ + -L/usr/lib/qt3/lib$(ARC) -lqt-mt \ + -Wl,-soname -Wl,lib$(TARGET).so.$(PROD_NUM) \ + -o $(LIBDIR)$(XTRA)/lib$(TARGET).so.$(BLD_VER) \ + -L$(LIBDIR)$(XTRA) \ + $(OBJDIR)*.$(O) diff --git a/c_kwallet/objs.lux b/c_kwallet/objs.lux new file mode 100644 index 00000000..4dc82ce0 --- /dev/null +++ b/c_kwallet/objs.lux @@ -0,0 +1,2 @@ +OBJS=\ + casakwallet.$(O) diff --git a/c_kwallet/package/CASAKWALLET.changes b/c_kwallet/package/CASAKWALLET.changes new file mode 100644 index 00000000..94a44b49 --- /dev/null +++ b/c_kwallet/package/CASAKWALLET.changes @@ -0,0 +1,7 @@ +------------------------------------------------------------------- +Fri Apr 21 17:11:20 MST 2006 - schoi@novell.com + + CASAKWALLET (CASA Kwallet) is the KWallet plugin for enabling the +CASA GUI to perform Aggregation and Distribution tasks for managing +KWallet through CASA in KDE desktop. +------------------------------------------------------------------- diff --git a/c_kwallet/package/CASAKWALLET.spec.in b/c_kwallet/package/CASAKWALLET.spec.in new file mode 100644 index 00000000..49a9ad79 --- /dev/null +++ b/c_kwallet/package/CASAKWALLET.spec.in @@ -0,0 +1,81 @@ +# +# spec file for package CASAKWALLET (Version 1.6.0) +# +# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. +# +# Please submit bugfixes or comments via http://bugs.opensuse.org +# + +# norootforbuild + +# For debug build, please replace Release to Debug and set debug_opt to --enable-debug +%define cfg Release +%define debug_opt "" + + +Name: @PACKAGE@ +URL: http://www.novell.com/products +BuildRequires: kdelibs3-devel mono-devel +%define prefix /usr/share/doc/packages +%define bin_prefix /usr +License: LGPL +Group: Productivity/Other +Autoreqprov: on +%define bldno 1.1.1 +Version: @VERSION@ +Release: 0 +Summary: CASA KWALLET Adapter (casakwallet) +Source: %{name}-%{version}.tar.bz2 +#Patch: %{name}-%{version}.diff +BuildRoot: %{_tmppath}/%{name}-%{version}-build +Requires: CASA-gui >= 1.6.0 mono >= 1.1.13 mono-core >= 1.1.13 +PreReq: %fillup_prereq %insserv_prereq +#ExclusiveArch: %ix86 x86_64 +#NoSource: 0 + +%description +CASAKWALLET (CASA Kwallet) is the KWallet plugin for enabling the +CASA GUI to perform Aggregation and Distribution tasks for managing +KWallet through CASA in KDE desktop. + +%prep +%setup -q +#%patch +%if %{_lib} == "lib64" +%define binsource bin64 +%else +%define binsource bin +%endif + + +%build +export PATH=.:$PATH:/usr/%_lib/qt3/bin +%if %suse_version > 1000 +export CFLAGS="$CFLAGS $RPM_OPT_FLAGS -fstack-protector" +%endif + +./autogen.sh +make + +%install + +mkdir -p %{buildroot}%{prefix} +mkdir -p %{buildroot}%{bin_prefix}/%{_lib} + +install -m 755 %{_lib}/%{cfg}/libcasakwallet.so.%{bldno} %{buildroot}%{bin_prefix}/%{_lib} +ln -s libcasakwallet.so.%{bldno} %{buildroot}%{bin_prefix}/%{_lib}/libcasakwallet.so +ln -s libcasakwallet.so.%{bldno} %{buildroot}%{bin_prefix}/%{_lib}/libcasakwallet.so.1 + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{bin_prefix}/%{_lib}/libcasakwallet.so.%{bldno} +%{bin_prefix}/%{_lib}/libcasakwallet.so +%{bin_prefix}/%{_lib}/libcasakwallet.so.1 + + +%changelog -n CASKWALLET diff --git a/c_kwallet/package/Makefile.am b/c_kwallet/package/Makefile.am new file mode 100644 index 00000000..e21dfa15 --- /dev/null +++ b/c_kwallet/package/Makefile.am @@ -0,0 +1,67 @@ +####################################################################### +# +# Copyright (C) 2006 Novell, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public +# License along with this program; if not, write to the Free +# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# +# +####################################################################### +#how do you get the version?? +RPM_FILE = $(PACKAGE)-$(VERSION)-$(RELEASE).$(target_cpu).rpm +#SRPM_FILE = $(PACKAGE)-$(VERSION)-$(RELEASE).src.rpm +SRPM_FILE = $(PACKAGE)-$(VERSION)*.src.rpm + +SPEC_FILE = CASAKWALLET.spec + +.PHONY: package package-clean package-install package-uninstall casa + +#all: $(RPM_FILE) + +package: $(RPM_FILE) + +all clean: + +$(RPM_FILE): + cd $(top_srcdir); make dist-bzip2 + rm -rf RPM + mkdir RPM + echo %_topdir `pwd`/RPM > $(HOME)/.rpmmacros + mkdir -p RPM/BUILD + mkdir -p RPM/RPMS + mkdir -p RPM/SOURCES + mkdir -p RPM/SPECS + mkdir -p RPM/SRPMS + cp $(SPEC_FILE) RPM/SPECS + cp $(top_srcdir)/$(PACKAGE)-*.tar.bz2 RPM/SOURCES + mv $(top_srcdir)/$(PACKAGE)-$(VERSION).tar.bz2 $(PACKAGE)-$(VERSION).tar.bz2 + rpmbuild -ba -v -vv --target=$(target_triplet) RPM/SPECS/$(SPEC_FILE) + cp RPM/RPMS/*/*.rpm . + cp RPM/SRPMS/$(SRPM_FILE) . + +package-install: package + su -c "rpm -Uvh $(RPM_FILE)" + +package-uninstall: + su -c "rpm -e $(PACKAGE)" + +package-clean clean-local: + rm -rf *.rpm RPM *.bz2 + +distclean-local: package-clean + rm -f Makefile $(SPEC_FILE) + +maintainer-clean-local: + rm -f Makefile.in +