pax_global_header00006660000000000000000000000064147144314110014512gustar00rootroot0000000000000052 comment=35b5d5b68f5620c49cc19121674489c98106e0ba mcds-1.9/000077500000000000000000000000001471443141100123115ustar00rootroot00000000000000mcds-1.9/.github/000077500000000000000000000000001471443141100136515ustar00rootroot00000000000000mcds-1.9/.github/workflows/000077500000000000000000000000001471443141100157065ustar00rootroot00000000000000mcds-1.9/.github/workflows/build.yaml000066400000000000000000000007471471443141100177010ustar00rootroot00000000000000name: build run-name: ${{ github.actor }} build on: push: branches: [ "master" ] pull_request: branches: [ "master" ] jobs: building: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Install dependencies run: sudo apt-get install -y autopoint gettext libcurl4-openssl-dev - name: Configure build system run: autoreconf -vi - name: Configure run: ./configure - name: Build run: make mcds-1.9/.gitignore000066400000000000000000000004051471443141100143000ustar00rootroot00000000000000autom4te.cache aclocal.m4 m4/* build-aux/* config.log config.status configure configure~ po/POTFILES po/remove-potcdate.sed po/Makevars.template Makefile Makefile.in src/.deps/ src/config.h src/config.h.in src/config.h.in~ src/stamp-h1 src/*.o VERSION *.tar.gz mcds-1.9/ABOUT-NLS000066400000000000000000002671331471443141100135540ustar00rootroot000000000000001 Notes on the Free Translation Project *************************************** Free software is going international! The Free Translation Project is a way to get maintainers of free software, translators, and users all together, so that free software will gradually become able to speak many languages. A few packages already provide translations for their messages. If you found this `ABOUT-NLS' file inside a distribution, you may assume that the distributed package does use GNU `gettext' internally, itself available at your nearest GNU archive site. But you do _not_ need to install GNU `gettext' prior to configuring, installing or using this package with messages translated. Installers will find here some useful hints. These notes also explain how users should proceed for getting the programs to use the available translations. They tell how people wanting to contribute and work on translations can contact the appropriate team. 1.1 INSTALL Matters =================== Some packages are "localizable" when properly installed; the programs they contain can be made to speak your own native language. Most such packages use GNU `gettext'. Other packages have their own ways to internationalization, predating GNU `gettext'. By default, this package will be installed to allow translation of messages. It will automatically detect whether the system already provides the GNU `gettext' functions. Installers may use special options at configuration time for changing the default behaviour. The command: ./configure --disable-nls will _totally_ disable translation of messages. When you already have GNU `gettext' installed on your system and run configure without an option for your new package, `configure' will probably detect the previously built and installed `libintl' library and will decide to use it. If not, you may have to to use the `--with-libintl-prefix' option to tell `configure' where to look for it. Internationalized packages usually have many `po/LL.po' files, where LL gives an ISO 639 two-letter code identifying the language. Unless translations have been forbidden at `configure' time by using the `--disable-nls' switch, all available translations are installed together with the package. However, the environment variable `LINGUAS' may be set, prior to configuration, to limit the installed set. `LINGUAS' should then contain a space separated list of two-letter codes, stating which languages are allowed. 1.2 Using This Package ====================== As a user, if your language has been installed for this package, you only have to set the `LANG' environment variable to the appropriate `LL_CC' combination. If you happen to have the `LC_ALL' or some other `LC_xxx' environment variables set, you should unset them before setting `LANG', otherwise the setting of `LANG' will not have the desired effect. Here `LL' is an ISO 639 two-letter language code, and `CC' is an ISO 3166 two-letter country code. For example, let's suppose that you speak German and live in Germany. At the shell prompt, merely execute `setenv LANG de_DE' (in `csh'), `export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash'). This can be done from your `.login' or `.profile' file, once and for all. You might think that the country code specification is redundant. But in fact, some languages have dialects in different countries. For example, `de_AT' is used for Austria, and `pt_BR' for Brazil. The country code serves to distinguish the dialects. The locale naming convention of `LL_CC', with `LL' denoting the language and `CC' denoting the country, is the one use on systems based on GNU libc. On other systems, some variations of this scheme are used, such as `LL' or `LL_CC.ENCODING'. You can get the list of locales supported by your system for your language by running the command `locale -a | grep '^LL''. Not all programs have translations for all languages. By default, an English message is shown in place of a nonexistent translation. If you understand other languages, you can set up a priority list of languages. This is done through a different environment variable, called `LANGUAGE'. GNU `gettext' gives preference to `LANGUAGE' over `LANG' for the purpose of message handling, but you still need to have `LANG' set to the primary language; this is required by other parts of the system libraries. For example, some Swedish users who would rather read translations in German than English for when Swedish is not available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'. Special advice for Norwegian users: The language code for Norwegian bokma*l changed from `no' to `nb' recently (in 2003). During the transition period, while some message catalogs for this language are installed under `nb' and some older ones under `no', it's recommended for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and older translations are used. In the `LANGUAGE' environment variable, but not in the `LANG' environment variable, `LL_CC' combinations can be abbreviated as `LL' to denote the language's main dialect. For example, `de' is equivalent to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT' (Portuguese as spoken in Portugal) in this context. 1.3 Translating Teams ===================== For the Free Translation Project to be a success, we need interested people who like their own language and write it well, and who are also able to synergize with other translators speaking the same language. Each translation team has its own mailing list. The up-to-date list of teams can be found at the Free Translation Project's homepage, `http://translationproject.org/', in the "Teams" area. If you'd like to volunteer to _work_ at translating messages, you should become a member of the translating team for your own language. The subscribing address is _not_ the same as the list itself, it has `-request' appended. For example, speakers of Swedish can send a message to `sv-request@li.org', having this message body: subscribe Keep in mind that team members are expected to participate _actively_ in translations, or at solving translational difficulties, rather than merely lurking around. If your team does not exist yet and you want to start one, or if you are unsure about what to do or how to get started, please write to `coordinator@translationproject.org' to reach the coordinator for all translator teams. The English team is special. It works at improving and uniformizing the terminology in use. Proven linguistic skills are praised more than programming skills, here. 1.4 Available Packages ====================== Languages are not equally supported in all packages. The following matrix shows the current state of internationalization, as of June 2010. The matrix shows, in regard of each package, for which languages PO files have been submitted to translation coordination, with a translation percentage of at least 50%. Ready PO files af am an ar as ast az be be@latin bg bn_IN bs ca +--------------------------------------------------+ a2ps | [] [] | aegis | | ant-phone | | anubis | | aspell | [] [] | bash | | bfd | | bibshelf | [] | binutils | | bison | | bison-runtime | [] | bluez-pin | [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] [] | cpio | | cppi | | cpplib | [] | cryptsetup | | dfarc | | dialog | [] [] | dico | | diffutils | [] | dink | | doodle | | e2fsprogs | [] | enscript | [] | exif | | fetchmail | [] | findutils | [] | flex | [] | freedink | | gas | | gawk | [] [] | gcal | [] | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] [] | gettext-tools | [] [] | gip | [] | gjay | | gliv | [] | glunarclock | [] [] | gnubiff | | gnucash | [] | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | | gold | | gpe-aerial | | gpe-beam | | gpe-bluetooth | | gpe-calendar | | gpe-clock | [] | gpe-conf | | gpe-contacts | | gpe-edit | | gpe-filemanager | | gpe-go | | gpe-login | | gpe-ownerinfo | [] | gpe-package | | gpe-sketchbook | | gpe-su | [] | gpe-taskmanager | [] | gpe-timesheet | [] | gpe-today | [] | gpe-todo | | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | [] [] | gsasl | | gss | | gst-plugins-bad | [] | gst-plugins-base | [] | gst-plugins-good | [] | gst-plugins-ugly | [] | gstreamer | [] [] [] | gtick | | gtkam | [] | gtkorphan | [] | gtkspell | [] [] [] | gutenprint | | hello | [] | help2man | | hylafax | | idutils | | indent | [] [] | iso_15924 | | iso_3166 | [] [] [] [] [] [] [] | iso_3166_2 | | iso_4217 | | iso_639 | [] [] [] [] | iso_639_3 | | jwhois | | kbd | | keytouch | [] | keytouch-editor | | keytouch-keyboa... | [] | klavaro | [] | latrine | | ld | [] | leafpad | [] [] | libc | [] [] | libexif | () | libextractor | | libgnutls | | libgpewidget | | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | [] | libidn | | lifelines | | liferea | [] [] | lilypond | | linkdr | [] | lordsawar | | lprng | | lynx | [] | m4 | | mailfromd | | mailutils | | make | | man-db | | man-db-manpages | | minicom | | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | | psmisc | | pspp | [] | pwdutils | | radius | [] | recode | [] [] | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] [] | sed | [] [] | sharutils | [] [] | shishi | | skencil | | solfege | | solfege-manual | | soundtracker | | sp | | sysstat | | tar | [] | texinfo | | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] [] | wyslij-po | | xchat | [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] | +--------------------------------------------------+ af am an ar as ast az be be@latin bg bn_IN bs ca 6 0 1 2 3 19 1 10 3 28 3 1 38 crh cs da de el en en_GB en_ZA eo es et eu fa +-------------------------------------------------+ a2ps | [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] () | anubis | [] [] | aspell | [] [] [] [] [] | bash | [] [] [] | bfd | [] | bibshelf | [] [] [] | binutils | [] | bison | [] [] | bison-runtime | [] [] [] [] | bluez-pin | [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] [] [] | cflow | [] [] | clisp | [] [] [] [] | coreutils | [] [] [] [] | cpio | | cppi | | cpplib | [] [] [] | cryptsetup | [] | dfarc | [] [] [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] | dink | [] [] [] | doodle | [] | e2fsprogs | [] [] [] | enscript | [] [] [] | exif | () [] [] | fetchmail | [] [] () [] [] [] | findutils | [] [] [] | flex | [] [] | freedink | [] [] [] | gas | [] | gawk | [] [] [] | gcal | [] | gcc | [] [] | gettext-examples | [] [] [] [] | gettext-runtime | [] [] [] [] | gettext-tools | [] [] [] | gip | [] [] [] [] | gjay | [] | gliv | [] [] [] | glunarclock | [] [] | gnubiff | () | gnucash | [] () () () () | gnuedu | [] [] | gnulib | [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] | gpe-aerial | [] [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] | gpe-conf | [] [] [] | gpe-contacts | [] [] [] | gpe-edit | [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] | gpe-taskmanager | [] [] [] [] | gpe-timesheet | [] [] [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] () [] [] [] | gprof | [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] | grub | [] [] | gsasl | [] | gss | | gst-plugins-bad | [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] () [] | gtkam | [] [] () [] [] | gtkorphan | [] [] [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | [] [] [] | hello | [] [] [] [] | help2man | [] | hylafax | [] [] | idutils | [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] [] [] [] () [] [] [] () | iso_3166_2 | () | iso_4217 | [] [] [] () [] [] | iso_639 | [] [] [] [] () [] [] | iso_639_3 | [] | jwhois | [] | kbd | [] [] [] [] [] | keytouch | [] [] | keytouch-editor | [] [] | keytouch-keyboa... | [] | klavaro | [] [] [] [] | latrine | [] () | ld | [] [] | leafpad | [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | [] [] | libgphoto2 | [] () | libgphoto2_port | [] () [] | libgsasl | | libiconv | [] [] [] [] [] | libidn | [] [] [] | lifelines | [] () | liferea | [] [] [] [] [] | lilypond | [] [] [] | linkdr | [] [] [] | lordsawar | [] | lprng | | lynx | [] [] [] [] | m4 | [] [] [] [] | mailfromd | | mailutils | [] | make | [] [] [] | man-db | | man-db-manpages | | minicom | [] [] [] [] | mkisofs | | myserver | | nano | [] [] [] | opcodes | [] [] | parted | [] [] | pies | | popt | [] [] [] [] [] | psmisc | [] [] [] | pspp | [] | pwdutils | [] | radius | [] | recode | [] [] [] [] [] [] | rosegarden | () () () | rpm | [] [] [] | rush | | sarg | | screem | | scrollkeeper | [] [] [] [] [] | sed | [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | | skencil | [] () [] | solfege | [] [] [] | solfege-manual | [] [] | soundtracker | [] [] [] | sp | [] | sysstat | [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] | tin | [] [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] | vice | () () | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] | wyslij-po | | xchat | [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] [] | +-------------------------------------------------+ crh cs da de el en en_GB en_ZA eo es et eu fa 5 64 105 117 18 1 8 0 28 89 18 19 0 fi fr ga gl gu he hi hr hu hy id is it ja ka kn +----------------------------------------------------+ a2ps | [] [] [] [] | aegis | [] [] | ant-phone | [] [] | anubis | [] [] [] [] | aspell | [] [] [] [] | bash | [] [] [] [] | bfd | [] [] [] | bibshelf | [] [] [] [] [] | binutils | [] [] [] | bison | [] [] [] [] | bison-runtime | [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] | buzztard | [] | cflow | [] [] [] | clisp | [] | coreutils | [] [] [] [] [] | cpio | [] [] [] [] | cppi | [] [] | cpplib | [] [] [] | cryptsetup | [] [] [] | dfarc | [] [] [] | dialog | [] [] [] [] [] [] [] | dico | | diffutils | [] [] [] [] [] [] [] [] [] | dink | [] | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] | exif | [] [] [] [] [] [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] [] | flex | [] [] [] | freedink | [] [] [] | gas | [] [] | gawk | [] [] [] [] () [] | gcal | [] | gcc | [] | gettext-examples | [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] | gettext-tools | [] [] [] [] | gip | [] [] [] [] [] [] | gjay | [] | gliv | [] () | glunarclock | [] [] [] [] | gnubiff | () [] () | gnucash | () () () () () [] | gnuedu | [] [] | gnulib | [] [] [] [] [] [] | gnunet | | gnunet-gtk | [] | gnutls | [] [] | gold | [] [] | gpe-aerial | [] [] [] | gpe-beam | [] [] [] [] | gpe-bluetooth | [] [] [] [] | gpe-calendar | [] [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] [] [] | gpe-contacts | [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] [] | gpe-go | [] [] [] [] [] | gpe-login | [] [] [] | gpe-ownerinfo | [] [] [] [] [] | gpe-package | [] [] [] | gpe-sketchbook | [] [] [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] | gpe-todo | [] [] [] | gphoto2 | [] [] [] [] [] [] | gprof | [] [] [] [] | gpsdrive | [] [] [] | gramadoir | [] [] [] | grep | [] [] | grub | [] [] [] [] | gsasl | [] [] [] [] [] | gss | [] [] [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] [] [] | gtkam | [] [] [] [] [] | gtkorphan | [] [] [] | gtkspell | [] [] [] [] [] [] [] [] [] | gutenprint | [] [] [] [] | hello | [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] [] | indent | [] [] [] [] [] [] [] [] | iso_15924 | [] () [] [] | iso_3166 | [] () [] [] [] [] [] [] [] [] [] [] | iso_3166_2 | () [] [] [] | iso_4217 | [] () [] [] [] [] | iso_639 | [] () [] [] [] [] [] [] [] | iso_639_3 | () [] [] | jwhois | [] [] [] [] [] | kbd | [] [] | keytouch | [] [] [] [] [] [] | keytouch-editor | [] [] [] [] [] | keytouch-keyboa... | [] [] [] [] [] | klavaro | [] [] | latrine | [] [] [] | ld | [] [] [] [] | leafpad | [] [] [] [] [] [] [] () | libc | [] [] [] [] [] | libexif | [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] [] | libgphoto2_port | [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] [] | libidn | [] [] [] [] | lifelines | () | liferea | [] [] [] [] | lilypond | [] [] | linkdr | [] [] [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] [] [] | m4 | [] [] [] [] [] [] | mailfromd | | mailutils | [] [] | make | [] [] [] [] [] [] [] [] [] | man-db | [] [] | man-db-manpages | [] | minicom | [] [] [] [] [] | mkisofs | [] [] [] [] | myserver | | nano | [] [] [] [] [] [] | opcodes | [] [] [] [] | parted | [] [] [] [] | pies | | popt | [] [] [] [] [] [] [] [] [] | psmisc | [] [] [] | pspp | | pwdutils | [] [] | radius | [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () () () () | rpm | [] [] | rush | | sarg | [] | screem | [] [] | scrollkeeper | [] [] [] [] | sed | [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] [] [] [] | shishi | [] | skencil | [] | solfege | [] [] [] [] | solfege-manual | [] [] | soundtracker | [] [] | sp | [] () | sysstat | [] [] [] [] [] | tar | [] [] [] [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | [] [] | util-linux-ng | [] [] [] [] [] [] | vice | () () () | vmm | [] | vorbis-tools | [] | wastesedge | () () | wdiff | [] | wget | [] [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] [] [] | +----------------------------------------------------+ fi fr ga gl gu he hi hr hu hy id is it ja ka kn 105 121 53 20 4 8 3 5 53 2 120 5 84 67 0 4 ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne +-----------------------------------------------+ a2ps | [] | aegis | | ant-phone | | anubis | [] [] | aspell | [] | bash | | bfd | | bibshelf | [] [] | binutils | | bison | [] | bison-runtime | [] [] [] [] [] | bluez-pin | [] [] [] [] [] | bombono-dvd | | buzztard | | cflow | | clisp | | coreutils | [] | cpio | | cppi | | cpplib | | cryptsetup | | dfarc | [] | dialog | [] [] [] [] [] | dico | | diffutils | [] [] | dink | | doodle | | e2fsprogs | | enscript | | exif | [] | fetchmail | | findutils | | flex | | freedink | [] | gas | | gawk | | gcal | | gcc | | gettext-examples | [] [] [] [] | gettext-runtime | [] | gettext-tools | [] | gip | [] [] | gjay | | gliv | | glunarclock | [] | gnubiff | | gnucash | () () () () | gnuedu | | gnulib | | gnunet | | gnunet-gtk | | gnutls | [] | gold | | gpe-aerial | [] | gpe-beam | [] | gpe-bluetooth | [] [] | gpe-calendar | [] | gpe-clock | [] [] [] [] [] | gpe-conf | [] [] | gpe-contacts | [] [] | gpe-edit | [] | gpe-filemanager | [] [] | gpe-go | [] [] [] | gpe-login | [] | gpe-ownerinfo | [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] | gpe-su | [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] | gpe-timesheet | [] [] | gpe-today | [] [] [] [] | gpe-todo | [] [] | gphoto2 | | gprof | [] | gpsdrive | | gramadoir | | grep | | grub | | gsasl | | gss | | gst-plugins-bad | [] [] [] [] | gst-plugins-base | [] [] | gst-plugins-good | [] [] | gst-plugins-ugly | [] [] [] [] [] | gstreamer | | gtick | | gtkam | [] | gtkorphan | [] [] | gtkspell | [] [] [] [] [] [] [] | gutenprint | | hello | [] [] [] | help2man | | hylafax | | idutils | | indent | | iso_15924 | [] [] | iso_3166 | [] [] () [] [] [] [] [] | iso_3166_2 | | iso_4217 | [] [] | iso_639 | [] [] | iso_639_3 | [] | jwhois | [] | kbd | | keytouch | [] | keytouch-editor | [] | keytouch-keyboa... | [] | klavaro | [] | latrine | [] | ld | | leafpad | [] [] [] | libc | [] | libexif | | libextractor | | libgnutls | [] | libgpewidget | [] [] | libgpg-error | | libgphoto2 | | libgphoto2_port | | libgsasl | | libiconv | | libidn | | lifelines | | liferea | | lilypond | | linkdr | | lordsawar | | lprng | | lynx | | m4 | | mailfromd | | mailutils | | make | [] | man-db | | man-db-manpages | | minicom | [] | mkisofs | | myserver | | nano | [] [] | opcodes | | parted | | pies | | popt | [] [] [] | psmisc | | pspp | | pwdutils | | radius | | recode | | rosegarden | | rpm | | rush | | sarg | | screem | | scrollkeeper | [] [] | sed | | sharutils | | shishi | | skencil | | solfege | [] | solfege-manual | | soundtracker | | sp | | sysstat | [] | tar | [] | texinfo | [] | tin | | unicode-han-tra... | | unicode-transla... | | util-linux-ng | | vice | | vmm | | vorbis-tools | | wastesedge | | wdiff | | wget | [] | wyslij-po | | xchat | [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +-----------------------------------------------+ ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne 20 5 10 1 13 48 4 2 2 4 24 10 20 3 1 nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr +---------------------------------------------------+ a2ps | [] [] [] [] [] [] [] [] | aegis | [] [] [] | ant-phone | [] [] | anubis | [] [] [] | aspell | [] [] [] [] [] | bash | [] [] | bfd | [] | bibshelf | [] [] | binutils | [] [] | bison | [] [] [] | bison-runtime | [] [] [] [] [] [] [] | bluez-pin | [] [] [] [] [] [] [] [] | bombono-dvd | [] () | buzztard | [] [] | cflow | [] | clisp | [] [] | coreutils | [] [] [] [] [] [] | cpio | [] [] [] | cppi | [] | cpplib | [] | cryptsetup | [] | dfarc | [] | dialog | [] [] [] [] | dico | [] | diffutils | [] [] [] [] [] [] | dink | () | doodle | [] [] | e2fsprogs | [] [] | enscript | [] [] [] [] [] | exif | [] [] [] () [] | fetchmail | [] [] [] [] | findutils | [] [] [] [] [] | flex | [] [] [] [] [] | freedink | [] [] | gas | | gawk | [] [] [] [] | gcal | | gcc | [] | gettext-examples | [] [] [] [] [] [] [] [] | gettext-runtime | [] [] [] [] [] [] [] [] [] | gettext-tools | [] [] [] [] [] [] | gip | [] [] [] [] [] | gjay | | gliv | [] [] [] [] [] [] | glunarclock | [] [] [] [] [] | gnubiff | [] () | gnucash | [] () () () | gnuedu | [] | gnulib | [] [] [] [] | gnunet | | gnunet-gtk | | gnutls | [] [] | gold | | gpe-aerial | [] [] [] [] [] [] [] | gpe-beam | [] [] [] [] [] [] [] | gpe-bluetooth | [] [] | gpe-calendar | [] [] [] [] | gpe-clock | [] [] [] [] [] [] [] [] | gpe-conf | [] [] [] [] [] [] [] | gpe-contacts | [] [] [] [] [] | gpe-edit | [] [] [] | gpe-filemanager | [] [] [] | gpe-go | [] [] [] [] [] [] [] [] | gpe-login | [] [] | gpe-ownerinfo | [] [] [] [] [] [] [] [] | gpe-package | [] [] | gpe-sketchbook | [] [] [] [] [] [] [] | gpe-su | [] [] [] [] [] [] [] [] | gpe-taskmanager | [] [] [] [] [] [] [] [] | gpe-timesheet | [] [] [] [] [] [] [] [] | gpe-today | [] [] [] [] [] [] [] [] | gpe-todo | [] [] [] [] [] | gphoto2 | [] [] [] [] [] [] [] [] | gprof | [] [] [] | gpsdrive | [] [] | gramadoir | [] [] | grep | [] [] [] [] | grub | [] [] [] | gsasl | [] [] [] [] | gss | [] [] [] | gst-plugins-bad | [] [] [] [] [] [] | gst-plugins-base | [] [] [] [] [] | gst-plugins-good | [] [] [] [] [] | gst-plugins-ugly | [] [] [] [] [] [] | gstreamer | [] [] [] [] [] | gtick | [] [] [] | gtkam | [] [] [] [] [] [] | gtkorphan | [] | gtkspell | [] [] [] [] [] [] [] [] [] [] | gutenprint | [] [] | hello | [] [] [] [] | help2man | [] [] | hylafax | [] | idutils | [] [] [] [] [] | indent | [] [] [] [] [] [] [] | iso_15924 | [] [] [] [] | iso_3166 | [] [] [] [] [] () [] [] [] [] [] [] [] [] | iso_3166_2 | [] [] [] | iso_4217 | [] [] [] [] [] [] [] [] | iso_639 | [] [] [] [] [] [] [] [] [] | iso_639_3 | [] [] | jwhois | [] [] [] [] | kbd | [] [] [] | keytouch | [] [] [] | keytouch-editor | [] [] [] | keytouch-keyboa... | [] [] [] | klavaro | [] [] | latrine | [] [] | ld | | leafpad | [] [] [] [] [] [] [] [] [] | libc | [] [] [] [] | libexif | [] [] () [] | libextractor | | libgnutls | [] [] | libgpewidget | [] [] [] | libgpg-error | [] [] | libgphoto2 | [] [] | libgphoto2_port | [] [] [] [] [] | libgsasl | [] [] [] [] [] | libiconv | [] [] [] [] [] | libidn | [] [] | lifelines | [] [] | liferea | [] [] [] [] [] () () [] | lilypond | [] | linkdr | [] [] [] | lordsawar | | lprng | [] | lynx | [] [] [] | m4 | [] [] [] [] [] | mailfromd | [] | mailutils | [] | make | [] [] [] [] | man-db | [] [] [] | man-db-manpages | [] [] [] | minicom | [] [] [] [] | mkisofs | [] [] [] | myserver | | nano | [] [] [] [] | opcodes | [] [] | parted | [] [] [] [] | pies | [] | popt | [] [] [] [] | psmisc | [] [] [] | pspp | [] [] | pwdutils | [] | radius | [] [] [] | recode | [] [] [] [] [] [] [] [] | rosegarden | () () | rpm | [] [] [] | rush | [] [] | sarg | | screem | | scrollkeeper | [] [] [] [] [] [] [] [] | sed | [] [] [] [] [] [] [] [] [] | sharutils | [] [] [] [] | shishi | [] | skencil | [] [] | solfege | [] [] [] [] | solfege-manual | [] [] [] | soundtracker | [] | sp | | sysstat | [] [] [] [] | tar | [] [] [] [] | texinfo | [] [] [] [] | tin | [] | unicode-han-tra... | | unicode-transla... | | util-linux-ng | [] [] [] [] [] | vice | [] | vmm | [] | vorbis-tools | [] [] | wastesedge | [] | wdiff | [] [] | wget | [] [] [] [] [] [] [] | wyslij-po | [] [] [] | xchat | [] [] [] [] [] [] [] [] [] | xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] [] [] [] [] | xkeyboard-config | [] [] [] | +---------------------------------------------------+ nl nn or pa pl ps pt pt_BR ro ru rw sk sl sq sr 135 10 4 7 105 1 29 62 47 91 3 54 46 9 37 sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW +---------------------------------------------------+ a2ps | [] [] [] [] [] | 27 aegis | [] | 9 ant-phone | [] [] [] [] | 9 anubis | [] [] [] [] | 15 aspell | [] [] [] | 20 bash | [] [] [] | 12 bfd | [] | 6 bibshelf | [] [] [] | 16 binutils | [] [] | 8 bison | [] [] | 12 bison-runtime | [] [] [] [] [] [] | 29 bluez-pin | [] [] [] [] [] [] [] [] | 37 bombono-dvd | [] | 4 buzztard | [] | 7 cflow | [] [] [] | 9 clisp | | 10 coreutils | [] [] [] [] | 22 cpio | [] [] [] [] [] [] | 13 cppi | [] [] | 5 cpplib | [] [] [] [] [] [] | 14 cryptsetup | [] [] | 7 dfarc | [] | 9 dialog | [] [] [] [] [] [] [] | 30 dico | [] | 2 diffutils | [] [] [] [] [] [] | 30 dink | | 4 doodle | [] [] | 7 e2fsprogs | [] [] [] | 11 enscript | [] [] [] [] | 17 exif | [] [] [] | 16 fetchmail | [] [] [] | 17 findutils | [] [] [] [] [] | 20 flex | [] [] [] [] | 15 freedink | [] | 10 gas | [] | 4 gawk | [] [] [] [] | 18 gcal | [] [] | 5 gcc | [] [] [] | 7 gettext-examples | [] [] [] [] [] [] [] | 34 gettext-runtime | [] [] [] [] [] [] [] | 29 gettext-tools | [] [] [] [] [] [] | 22 gip | [] [] [] [] | 22 gjay | [] | 3 gliv | [] [] [] | 14 glunarclock | [] [] [] [] [] | 19 gnubiff | [] [] | 4 gnucash | () [] () [] () | 10 gnuedu | [] [] | 7 gnulib | [] [] [] [] | 16 gnunet | [] | 1 gnunet-gtk | [] [] [] | 5 gnutls | [] [] [] | 10 gold | [] | 4 gpe-aerial | [] [] [] | 18 gpe-beam | [] [] [] | 19 gpe-bluetooth | [] [] [] | 13 gpe-calendar | [] [] [] [] | 12 gpe-clock | [] [] [] [] [] | 28 gpe-conf | [] [] [] [] | 20 gpe-contacts | [] [] [] | 17 gpe-edit | [] [] [] | 12 gpe-filemanager | [] [] [] [] | 16 gpe-go | [] [] [] [] [] | 25 gpe-login | [] [] [] | 11 gpe-ownerinfo | [] [] [] [] [] | 25 gpe-package | [] [] [] | 13 gpe-sketchbook | [] [] [] | 20 gpe-su | [] [] [] [] [] | 30 gpe-taskmanager | [] [] [] [] [] | 29 gpe-timesheet | [] [] [] [] [] | 25 gpe-today | [] [] [] [] [] [] | 30 gpe-todo | [] [] [] [] | 17 gphoto2 | [] [] [] [] [] | 24 gprof | [] [] [] | 15 gpsdrive | [] [] [] | 11 gramadoir | [] [] [] | 11 grep | [] [] [] | 10 grub | [] [] [] | 14 gsasl | [] [] [] [] | 14 gss | [] [] [] | 11 gst-plugins-bad | [] [] [] [] | 26 gst-plugins-base | [] [] [] [] [] | 24 gst-plugins-good | [] [] [] [] | 24 gst-plugins-ugly | [] [] [] [] [] | 29 gstreamer | [] [] [] [] | 22 gtick | [] [] [] | 13 gtkam | [] [] [] | 20 gtkorphan | [] [] [] | 14 gtkspell | [] [] [] [] [] [] [] [] [] | 45 gutenprint | [] | 10 hello | [] [] [] [] [] [] | 21 help2man | [] [] | 7 hylafax | [] | 5 idutils | [] [] [] [] | 17 indent | [] [] [] [] [] [] | 30 iso_15924 | () [] () [] [] | 16 iso_3166 | [] [] () [] [] () [] [] [] () | 53 iso_3166_2 | () [] () [] | 9 iso_4217 | [] () [] [] () [] [] | 26 iso_639 | [] [] [] () [] () [] [] [] [] | 38 iso_639_3 | [] () | 8 jwhois | [] [] [] [] [] | 16 kbd | [] [] [] [] [] | 15 keytouch | [] [] [] | 16 keytouch-editor | [] [] [] | 14 keytouch-keyboa... | [] [] [] | 14 klavaro | [] | 11 latrine | [] [] [] | 10 ld | [] [] [] [] | 11 leafpad | [] [] [] [] [] [] | 33 libc | [] [] [] [] [] | 21 libexif | [] () | 7 libextractor | [] | 1 libgnutls | [] [] [] | 9 libgpewidget | [] [] [] | 14 libgpg-error | [] [] [] | 9 libgphoto2 | [] [] | 8 libgphoto2_port | [] [] [] [] | 14 libgsasl | [] [] [] | 13 libiconv | [] [] [] [] | 21 libidn | () [] [] | 11 lifelines | [] | 4 liferea | [] [] [] | 21 lilypond | [] | 7 linkdr | [] [] [] [] [] | 17 lordsawar | | 1 lprng | [] | 3 lynx | [] [] [] [] | 17 m4 | [] [] [] [] | 19 mailfromd | [] [] | 3 mailutils | [] | 5 make | [] [] [] [] | 21 man-db | [] [] [] | 8 man-db-manpages | | 4 minicom | [] [] | 16 mkisofs | [] [] | 9 myserver | | 0 nano | [] [] [] [] | 21 opcodes | [] [] [] | 11 parted | [] [] [] [] [] | 15 pies | [] [] | 3 popt | [] [] [] [] [] [] | 27 psmisc | [] [] | 11 pspp | | 4 pwdutils | [] [] | 6 radius | [] [] | 9 recode | [] [] [] [] | 28 rosegarden | () | 0 rpm | [] [] [] | 11 rush | [] [] | 4 sarg | | 1 screem | [] | 3 scrollkeeper | [] [] [] [] [] | 27 sed | [] [] [] [] [] | 30 sharutils | [] [] [] [] [] | 22 shishi | [] | 3 skencil | [] [] | 7 solfege | [] [] [] [] | 16 solfege-manual | [] | 8 soundtracker | [] [] [] | 9 sp | [] | 3 sysstat | [] [] | 15 tar | [] [] [] [] [] [] | 23 texinfo | [] [] [] [] [] | 17 tin | | 4 unicode-han-tra... | | 0 unicode-transla... | | 2 util-linux-ng | [] [] [] [] | 20 vice | () () | 1 vmm | [] | 4 vorbis-tools | [] | 6 wastesedge | | 2 wdiff | [] [] | 7 wget | [] [] [] [] [] | 26 wyslij-po | [] [] | 8 xchat | [] [] [] [] [] [] | 36 xdg-user-dirs | [] [] [] [] [] [] [] [] [] [] | 63 xkeyboard-config | [] [] [] | 22 +---------------------------------------------------+ 85 teams sv sw ta te tg th tr uk vi wa zh_CN zh_HK zh_TW 178 domains 119 1 3 3 0 10 65 51 155 17 98 7 41 2618 Some counters in the preceding matrix are higher than the number of visible blocks let us expect. This is because a few extra PO files are used for implementing regional variants of languages, or language dialects. For a PO file in the matrix above to be effective, the package to which it applies should also have been internationalized and distributed as such by its maintainer. There might be an observable lag between the mere existence a PO file and its wide availability in a distribution. If June 2010 seems to be old, you may fetch a more recent copy of this `ABOUT-NLS' file on most GNU archive sites. The most up-to-date matrix with full percentage details can be found at `http://translationproject.org/extra/matrix.html'. 1.5 Using `gettext' in new packages =================================== If you are writing a freely available program and want to internationalize it you are welcome to use GNU `gettext' in your package. Of course you have to respect the GNU Library General Public License which covers the use of the GNU `gettext' library. This means in particular that even non-free programs can use `libintl' as a shared library, whereas only free software can use `libintl' as a static library or use modified versions of `libintl'. Once the sources are changed appropriately and the setup can handle the use of `gettext' the only thing missing are the translations. The Free Translation Project is also available for packages which are not developed inside the GNU project. Therefore the information given above applies also for every other Free Software Project. Contact `coordinator@translationproject.org' to make the `.pot' files available to the translation teams. mcds-1.9/AUTHORS000066400000000000000000000001171471443141100133600ustar00rootroot00000000000000Authors of mcds --------------- Timothy Brown mcds-1.9/ChangeLog000066400000000000000000000136051471443141100140700ustar00rootroot000000000000002024-11-09 Timothy Brown Creating release v1.8 Adding the ability to use libsecret including prompting and saving the password. 2024-10-20 Timothy Brown Creating release v1.7. Fixed a few printf() object types. Removed most of the autoconfig automatically generated files. Changing CI from Travis to Github actions. Fail and return an error when HTTP request fails. Cleaned up/rearranged the arg parsing so as to be able to run -V and -h without having an rc file. Fixed unveil ifdefs. 2020-01-15 Timothy Brown Created version 1.6 Cleaned up the autoconf macros for GPGME. Created version 1.5 Updated the result regex. 2019-12-28 Timothy Brown Created version 1.4 2019-12-26 Timothy Brown Created version 1.3 Adding support for passwords encrypted with GPG. 2019-05-07 Timothy Brown Created version 1.2 Created version 1.1 2019-05-06 Timothy Brown Created version 1.0 Adding pledge(). 2019-04-25 Timothy Brown Created version 0.9 Added the ability to do case insensitive searches and to parse the response from Gmail. 2014-03-14 Timothy Brown Adding more debug info and correcting for \r's. Adding a debug section in the xml parsing. It seems owncloud/sabredav encode the \r's which libxml converts back to \r's so in the vcard regex/printing we should check to make sure they are not the second to last character, if they are we remove them. Adding the known query terms. In reading the man page, I forgot to add the known terms to the argument list. Adding example URLs to the README. Updating the ChangeLog and version number. Bug fix in the carddav (webdav) headders. When querying against owncloud (sabredav.org) we must specify the depth in the headers and not saying breif is true. 2014-03-10 Timothy Brown Bugfix in xml namespace. Bug fix from Chip Black, there needs to be space between the xml namespace definitions for Apple's Calendar and Card server. 2014-03-08 Timothy Brown Clean up for v0.3 release. Cleaning up all the supporting files in order to get ready for the 0.3 release. 2014-03-07 Timothy Brown Bug fix (malloc incorrect brackets). Bug fix in argument parsing routine. I had the +1 inside of the call to strlen(). Also changed the default value of the curl error code to be CURLE_OK instead of 0. 2014-03-07 Timothy Brown Bug fix in carddav. Bug fix in terminating the response string. I was under allocting the array by 1. Adding a sanity check in the rc parsing. Putting in a break to make sure we only parse the first two tokens in a rc file. Adding the ability to read a configuration file. 2014-03-06 Timothy Brown Code clean up. Adding C99 standard. Adding the C99 standard for autoconf and the removal of unused variables in the source. Bugfix. Renaming function. Missed a rename of the xml walk_nodes to walk_tree function. Merge branch 'master' of https://code.freeshell.org/mcds Split the parsing into xml and regex. Decided to bite the bullet and use libxml to do the initial parsing of the carddav data received. Then when a vcard is found, pass it off to a regex parser. 2014-03-05 Timothy Brown Upping the revision number. Updated the output to conform to mutt. 2014-03-05 Timothy Brown Adding the ability to print the full name. The mutt query command expects the results along the lines of: Searching database ... 20 entries ... 3 matching: me@cs.hmc.edu Michael Elkins mutt dude blong@fiction.net Brandon Long mutt and more roessler@guug.de Thomas Roessler mutt pgp That is a one line message, then each matching response on a single line, each line containing a tab separated address then name then some other optional information. On error, or if there are no matching addresses, return a non-zero exit code and a one line error message. 2014-03-05 Timothy Brown Updated manpage. I had left in a reference to tbrown as the user in the carddav url. Removing main.h from the src/Makefile.am There is no main.h yet I had left it in the source automake file. Moving the ChangeLog to the toplevel directory. Updating Makefile.am to include man-page. 2014-03-05 Timothy Brown Updated the usage statement and added a man page. Updated the usage statement to include the ability to specify email (although this is the default). Added a first pass of a man page. 2014-03-05 Timothy Brown Clean up and build on a debian machine. Adding Makevars in the po directory. Adding the makefile for the translations. Removing the libxml dependency. Adding files to the build-aux instead of sym links. 2014-03-05 Timothy Brown Email query is working. The email query/regex is working. However addresses still need to be re-parsed. Possibly need to check how mutt wants the query returned as. 2014-03-04 Timothy Brown Updated the CardDav search fields. Updated the CardDav search fields to be correct. Added a comment to the parse_args function (should refactor to options.c?). Option clean up and build macros. Cleaned up the options to be able to use x-macros. Added the m4 build macros. 2014-03-03 Timothy Brown Big update.... Adding options, mem/malloc wrappers and code to construct the curl request and carddav search. 2014-02-26 Timothy Brown Full autotools project. Sorted out the gettext issues and made it into a full/proper autotools project. Adding some src automake defauuts. Initial Git import mcds-1.9/LICENSE000066400000000000000000001045151471443141100133240ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. 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 them 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 prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. 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. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey 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; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If 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 convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU 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 that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. 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. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 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. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. 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 state 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program 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, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU 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 Lesser General Public License instead of this License. But first, please read . mcds-1.9/Makefile.am000066400000000000000000000015431471443141100143500ustar00rootroot00000000000000ACLOCAL_AMFLAGS = -I m4 SUBDIRS = po src DISTCLEANFILES= *~ *.log MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = ChangeLog check-gettext: @if test x$(USE_NLS) != "xyes" ; then echo "Missing gettext. Rerun configure and check for" \ "'checking whether to use NLS... yes'!" ; exit 1 ; fi update-po: check-gettext @find $(srcdir)/src/ -name "*.c" -print | sort > $(srcdir)/po/POTFILES.in.2 ; \ if diff $(srcdir)/po/POTFILES.in $(srcdir)/po/POTFILES.in.2 >/dev/null 2>&1 ; then \ rm -f $(srcdir)/po/POTFILES.in.2 ; \ else \ mv $(srcdir)/po/POTFILES.in.2 $(srcdir)/po/POTFILES.in ; \ fi cd po && $(MAKE) $(AM_MAKEFLAGS) update-po update-gmo: check-gettext cd po && $(MAKE) $(AM_MAKEFLAGS) update-gmo force-update-gmo: check-gettext touch po/*.po cd po && $(MAKE) $(AM_MAKEFLAGS) update-gmo .PHONY: check-gettext update-po update-gmo force-update-gmo mcds-1.9/NEWS000066400000000000000000000000701471443141100130050ustar00rootroot00000000000000 8th March 2014 Version 0.3 ready for public release. mcds-1.9/README.md000066400000000000000000000050731471443141100135750ustar00rootroot00000000000000MCDS ==== ![Build Status](https://github.com/t-brown/mcds/actions/workflows/build.yaml/badge.svg) `mcds` is a command line tool primarily used as a search query plugin for mutt to query a CardDav server. Prerequisites ------------- + [C compiler](https://gcc.gnu.org/) + [Curl](https://curl.haxx.se/libcurl/) + [LibXML2](http://www.xmlsoft.org/) + Optionally [GPGME](https://www.gnupg.org/software/gpgme/index.html) Building / Installation ----------------------- ### Building from the repository If building from a source release package, e.g. the tarball shipped from , skip to the next section. `mcds` relies on the GNU build system [autoconf](https://www.gnu.org/software/autoconf/) and [automake](https://www.gnu.org/software/automake/). To use the autotools, invoke: autoreconf -vi This will recreate the `configure` script and other auxiliary files required for the build. Continue with the instructions in the next section. ### Building from a source release package To install `mcds` with the default options (this includes GPGME support): ./configure make make install This will install the binary tool in `/usr/local/bin` and man pages in `/usr/local/man`. To specify a different installation prefix, use the --prefix option to configure: ./configure --prefix=/opt make make install Will install `mcds` in `/opt/{bin,man}`. Usage ----- The utility `mcds` queries a CardDav server. For example to query all email address of people called Fred in your addressbook at the URL https://example.org/addressbook: mcds -u https://example.org/addressbook Fred If you had an entry for Fred Smith it would return a result like: fred.smith@example.org Fred Smith mcds can make use of an rc file (`${HOME}/.mcdsrc`). Please read the accompanying man page for more examples and the specifications of the rc file. ### Typical URLs. The typical URL to query for various CardDav servers. + [Davical](https://www.davical.org/) `https://example.org/caldav.php/username/addresses` + [Owncloud](https://owncloud.org/) `http://example.org/remote.php/carddav/addressbooks/username/contacts` + [Nextcloud](https://nextcloud.com/) `http://example.org/remote.php/dav/addressbooks/users/username/contacts` + [Gmail](https://gmail.com/) `https://www.googleapis.com/carddav/v1/principals/username@example.com/lists/default` where one needs to subsitute your email address for `username@example.com`. + [Baikal](https://sabre.io/baikal/) `https://example.org/dav.php/addressbooks/username/default/` mcds-1.9/configure.ac000066400000000000000000000104141471443141100145770ustar00rootroot00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. # AC_PREREQ(2.61) AC_INIT([mcds], [1.9], [tbrown@freeshell.org]) AC_CONFIG_AUX_DIR([build-aux]) # Define our M4 macro directory AC_CONFIG_MACRO_DIR([m4]) AC_SUBST(PACKAGE_VERSION) # Internationalization AM_GNU_GETTEXT_VERSION([0.19]) AM_GNU_GETTEXT([external]) # Initialise automake AM_INIT_AUTOMAKE([foreign -Wall -Werror]) # Check there is a source file AC_CONFIG_SRCDIR([src/main.c]) # Put our generated config header in the source directory AC_CONFIG_HEADERS([src/config.h]) # Checks the compiler vendor AC_PROG_CC # GPGME is compiled with _FILE_OFFSET_BITS=64 on i386 AC_SYS_LARGEFILE # Checks for header files AC_CHECK_HEADERS([stdlib.h string.h unistd.h]) # Checks for functions and libraries AC_CHECK_FUNCS([getprogname \ memset \ pledge program_invocation_short_name \ unveil]) AC_FUNC_MALLOC # Shouldn't need this on newer automakes AM_PROG_CC_C_O AC_CONFIG_FILES([Makefile po/Makefile.in src/Makefile ]) PKG_CHECK_MODULES([CURL], [libcurl]) PKG_CHECK_MODULES([XML], [libxml-2.0]) PKG_CHECK_MODULES([SECRET], [libsecret-1],, [HAVE_PKG_LIBSECRET=0]) AC_ARG_ENABLE([libsecret], AS_HELP_STRING([--disable-libsecret], [do not use libsecret support])) AS_IF([test "$HAVE_PKG_LIBSECRET" != "0"], [AS_IF([test x$enable_libsecret != xno], [AC_DEFINE([HAVE_LIBSECRET], [1], [Define to 1 if you have libsecret support]) AC_SUBST(LIBSECRET_CFLAGS) AC_SUBST(LIBSECRET_LIBS) AM_CONDITIONAL([WANT_LIBSECRET], [test x = x]) enable_libsecret=yes ], [AC_DEFINE([HAVE_LIBSECRET], [0], [Define to 1 if you have libsecret support]) AM_CONDITIONAL([WANT_LIBSECRET], [test x = y]) enable_libsecret=no ] )], [AC_DEFINE([HAVE_LIBSECRET], [0], [Define to 1 if you have libsecret support]) AM_CONDITIONAL([WANT_LIBSECRET], [test x = y]) enable_libsecret=no ] ) dnl locate gpgme and gpg AH_TEMPLATE([GPGME_CONFIG], [Defined to the full path of gpgme-config]) AH_TEMPLATE([GPG_CONFIG], [Defined to the full path of gpgconf]) AH_TEMPLATE([GPG], [Defined to the full path of gpg/gpg2]) AC_ARG_ENABLE([gpgme], AS_HELP_STRING([--disable-gpgme], [do not use GPGME support])) m4_ifdef([AM_PATH_GPGME], [AS_IF([test x$enable_gpgme != xno], [AM_PATH_GPGME([], [AC_DEFINE([HAVE_GPGME], [1], [Define to 1 if you have GPGME support]) AM_CONDITIONAL([WANT_GPGME], [test x = x]) ], [AC_MSG_ERROR([GPGME not found, if you do not want GPGME support, rerun with --disable-gpgme])]) AC_DEFINE_UNQUOTED([GPGME_CONFIG], ["$GPGME_CONFIG"]) AC_PATH_PROG([GPG_CONFIG], [gpgconf]) AS_IF([test x$GPG_CONFIG != x], [AC_DEFINE_UNQUOTED([GPG_CONFIG], ["$GPG_CONFIG"])], [AC_MSG_ERROR([gpgconf is needed with GPGME])] ) AC_PATH_PROGS([GPG], [gpg gpg2]) AS_IF([test x$GPG != x], [AC_DEFINE_UNQUOTED([GPG], ["$GPG"])], [AC_MSG_ERROR([gpg or gpg2 is needed with GPGME])] ) enable_gpgme=yes ], [AC_DEFINE(HAVE_GPGME, 0, [Define to 1 if you have GPGME support]) AM_CONDITIONAL([WANT_GPGME], [test x = y])] )], [AC_DEFINE(HAVE_GPGME, 0, [Define to 1 if you have GPGME support]) AM_CONDITIONAL([WANT_GPGME], [test x = y]) enable_gpgme=no ] ) AC_OUTPUT echo echo echo "========================================================================" echo "$PACKAGE_NAME version $PACKAGE_VERSION" echo "------------------------------------------------------------------------" echo echo "Configuration Options Summary:" echo echo "Installation prefix : $prefix" echo "C command : $CC $CFLAGS" echo "Linker : $LD $LDFLAGS $LIBS" echo "Enable GPGME : $enable_gpgme" echo "Enable libsecret : $enable_libsecret" echo mcds-1.9/po/000077500000000000000000000000001471443141100127275ustar00rootroot00000000000000mcds-1.9/po/Makefile.in.in000066400000000000000000000415531471443141100154110ustar00rootroot00000000000000# Makefile for PO directory in any package using GNU gettext. # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper # # This file can be copied and used freely without restrictions. It can # be used in projects which are not available under the GNU General Public # License but which still want to provide support for the GNU gettext # functionality. # Please note that the actual code of GNU gettext is covered by the GNU # General Public License and is *not* in the public domain. # # Origin: gettext-0.19 GETTEXT_MACRO_VERSION = 0.19 PACKAGE = @PACKAGE@ VERSION = @VERSION@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ SED = @SED@ SHELL = /bin/sh @SET_MAKE@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ datadir = @datadir@ localedir = @localedir@ gettextsrcdir = $(datadir)/gettext/po INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ # We use $(mkdir_p). # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, # @install_sh@ does not start with $(SHELL), so we add it. # In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake # versions, $(mkinstalldirs) and $(install_sh) are unused. mkinstalldirs = $(SHELL) @install_sh@ -d install_sh = $(SHELL) @install_sh@ MKDIR_P = @MKDIR_P@ mkdir_p = @mkdir_p@ GMSGFMT_ = @GMSGFMT@ GMSGFMT_no = @GMSGFMT@ GMSGFMT_yes = @GMSGFMT_015@ GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) MSGFMT_ = @MSGFMT@ MSGFMT_no = @MSGFMT@ MSGFMT_yes = @MSGFMT_015@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) XGETTEXT_ = @XGETTEXT@ XGETTEXT_no = @XGETTEXT@ XGETTEXT_yes = @XGETTEXT_015@ XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) MSGMERGE = msgmerge MSGMERGE_UPDATE = @MSGMERGE@ --update MSGINIT = msginit MSGCONV = msgconv MSGFILTER = msgfilter POFILES = @POFILES@ GMOFILES = @GMOFILES@ UPDATEPOFILES = @UPDATEPOFILES@ DUMMYPOFILES = @DUMMYPOFILES@ DISTFILES.common = Makefile.in.in remove-potcdate.sin \ $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ $(POFILES) $(GMOFILES) \ $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) POTFILES = \ CATALOGS = @CATALOGS@ POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot POFILESDEPS_yes = $(POFILESDEPS_) POFILESDEPS_no = POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT)) DISTFILESDEPS_ = update-po DISTFILESDEPS_yes = $(DISTFILESDEPS_) DISTFILESDEPS_no = DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO)) # Makevars gets inserted here. (Don't remove this line!) .SUFFIXES: .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update .po.mo: @echo "$(MSGFMT) -c -o $@ $<"; \ $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ .po.gmo: @lang=`echo $* | sed -e 's,.*/,,'`; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo .sin.sed: sed -e '/^#/d' $< > t-$@ mv t-$@ $@ all: all-@USE_NLS@ all-yes: stamp-po all-no: # Ensure that the gettext macros and this Makefile.in.in are in sync. CHECK_MACRO_VERSION = \ test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \ || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \ exit 1; \ } # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because # we don't want to bother translators with empty POT files). We assume that # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. # In this case, stamp-po is a nop (i.e. a phony target). # stamp-po is a timestamp denoting the last time at which the CATALOGS have # been loosely updated. Its purpose is that when a developer or translator # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent # invocations of "make" will do nothing. This timestamp would not be necessary # if updating the $(CATALOGS) would always touch them; however, the rule for # $(POFILES) has been designed to not touch files that don't need to be # changed. stamp-po: $(srcdir)/$(DOMAIN).pot @$(CHECK_MACRO_VERSION) test ! -f $(srcdir)/$(DOMAIN).pot || \ test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) @test ! -f $(srcdir)/$(DOMAIN).pot || { \ echo "touch stamp-po" && \ echo timestamp > stamp-poT && \ mv stamp-poT stamp-po; \ } # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', # otherwise packages like GCC can not be built if only parts of the source # have been downloaded. # This target rebuilds $(DOMAIN).pot; it is an expensive operation. # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. # The determination of whether the package xyz is a GNU one is based on the # heuristic whether some file in the top level directory mentions "GNU xyz". # If GNU 'find' is available, we avoid grepping through monster files. $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed package_gnu="$(PACKAGE_GNU)"; \ test -n "$$package_gnu" || { \ if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \ LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \ -size -10000000c -exec grep 'GNU @PACKAGE@' \ /dev/null '{}' ';' 2>/dev/null; \ else \ LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \ fi; \ } | grep -v 'libtool:' >/dev/null; then \ package_gnu=yes; \ else \ package_gnu=no; \ fi; \ }; \ if test "$$package_gnu" = "yes"; then \ package_prefix='GNU '; \ else \ package_prefix=''; \ fi; \ if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ else \ msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ fi; \ case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ *) \ $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \ --files-from=$(srcdir)/POTFILES.in \ --copyright-holder='$(COPYRIGHT_HOLDER)' \ --package-name="$${package_prefix}@PACKAGE@" \ --package-version='@VERSION@' \ --msgid-bugs-address="$$msgid_bugs_address" \ ;; \ esac test ! -f $(DOMAIN).po || { \ if test -f $(srcdir)/$(DOMAIN).pot; then \ sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ else \ rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ else \ mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ fi; \ } # This rule has no dependencies: we don't need to update $(DOMAIN).pot at # every "make" invocation, only create it when it is missing. # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. $(srcdir)/$(DOMAIN).pot: $(MAKE) $(DOMAIN).pot-update # This target rebuilds a PO file if $(DOMAIN).pot has changed. # Note that a PO file is not touched if it doesn't need to be changed. $(POFILES): $(POFILESDEPS) @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ if test -f "$(srcdir)/$${lang}.po"; then \ test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ cd $(srcdir) \ && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ esac; \ }; \ else \ $(MAKE) $${lang}.po-create; \ fi install: install-exec install-data install-exec: install-data: install-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ for file in $(DISTFILES.common) Makevars.template; do \ $(INSTALL_DATA) $(srcdir)/$$file \ $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ for file in Makevars; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi install-data-no: all install-data-yes: all @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ fi; \ done; \ done install-strip: install installdirs: installdirs-exec installdirs-data installdirs-exec: installdirs-data: installdirs-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ else \ : ; \ fi installdirs-data-no: installdirs-data-yes: @catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ dir=$(localedir)/$$lang/LC_MESSAGES; \ $(mkdir_p) $(DESTDIR)$$dir; \ for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ if test -n "$$lc"; then \ if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ for file in *; do \ if test -f $$file; then \ ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ fi; \ done); \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ else \ if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ :; \ else \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ fi; \ fi; \ fi; \ done; \ done # Define this as empty until I found a useful application. installcheck: uninstall: uninstall-exec uninstall-data uninstall-exec: uninstall-data: uninstall-data-@USE_NLS@ if test "$(PACKAGE)" = "gettext-tools"; then \ for file in $(DISTFILES.common) Makevars.template; do \ rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ done; \ else \ : ; \ fi uninstall-data-no: uninstall-data-yes: catalogs='$(CATALOGS)'; \ for cat in $$catalogs; do \ cat=`basename $$cat`; \ lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ done; \ done check: all info dvi ps pdf html tags TAGS ctags CTAGS ID: mostlyclean: rm -f remove-potcdate.sed rm -f stamp-poT rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po rm -fr *.o clean: mostlyclean distclean: clean rm -f Makefile Makefile.in POTFILES *.mo maintainer-clean: distclean @echo "This command is intended for maintainers to use;" @echo "it deletes files that may require special tools to rebuild." rm -f stamp-po $(GMOFILES) distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) dist distdir: test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS) @$(MAKE) dist2 # This is a separate target because 'update-po' must be executed before. dist2: stamp-po $(DISTFILES) dists="$(DISTFILES)"; \ if test "$(PACKAGE)" = "gettext-tools"; then \ dists="$$dists Makevars.template"; \ fi; \ if test -f $(srcdir)/$(DOMAIN).pot; then \ dists="$$dists $(DOMAIN).pot stamp-po"; \ fi; \ if test -f $(srcdir)/ChangeLog; then \ dists="$$dists ChangeLog"; \ fi; \ for i in 0 1 2 3 4 5 6 7 8 9; do \ if test -f $(srcdir)/ChangeLog.$$i; then \ dists="$$dists ChangeLog.$$i"; \ fi; \ done; \ if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ for file in $$dists; do \ if test -f $$file; then \ cp -p $$file $(distdir) || exit 1; \ else \ cp -p $(srcdir)/$$file $(distdir) || exit 1; \ fi; \ done update-po: Makefile $(MAKE) $(DOMAIN).pot-update test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) $(MAKE) update-gmo # General rule for creating PO files. .nop.po-create: @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ exit 1 # General rule for updating PO files. .nop.po-update: @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ cd $(srcdir); \ if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ *) \ $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ esac; \ }; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "msgmerge for $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi $(DUMMYPOFILES): update-gmo: Makefile $(GMOFILES) @: # Recreate Makefile by invoking config.status. Explicitly invoke the shell, # because execution permission bits may not work on the current file system. # Use @SHELL@, which is the shell determined by autoconf for the use by its # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ cd $(top_builddir) \ && @SHELL@ ./config.status $(subdir)/$@.in po-directories force: # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: mcds-1.9/po/Makevars000066400000000000000000000045071471443141100144310ustar00rootroot00000000000000# Makefile variables for PO directory in any package using GNU gettext. # Usually the message domain is the same as the package name. DOMAIN = $(PACKAGE) # These two variables depend on the location of this directory. subdir = po top_builddir = .. # These options get passed to xgettext. XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ # This is the copyright holder that gets inserted into the header of the # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding # package. (Note that the msgstr strings, extracted from the package's # sources, belong to the copyright holder of the package.) Translators are # expected to transfer the copyright for their translations to this person # or entity, or to disclaim their copyright. The empty string stands for # the public domain; in this case the translators are expected to disclaim # their copyright. COPYRIGHT_HOLDER = Timothy Brown # This is the email address or URL to which the translators shall report # bugs in the untranslated strings: # - Strings which are not entire sentences, see the maintainer guidelines # in the GNU gettext documentation, section 'Preparing Strings'. # - Strings which use unclear terms or require additional context to be # understood. # - Strings which make invalid assumptions about notation of date, time or # money. # - Pluralisation problems. # - Incorrect English spelling. # - Incorrect formatting. # It can be your email address, or a mailing list address where translators # can write to without being subscribed, or the URL of a web page through # which the translators can contact you. MSGID_BUGS_ADDRESS = # This is the list of locale categories, beyond LC_MESSAGES, for which the # message catalogs shall be used. It is usually empty. EXTRA_LOCALE_CATEGORIES = # This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' # context. Possible values are "yes" and "no". Set this to yes if the # package uses functions taking also a message context, like pgettext(), or # if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. USE_MSGCTXT = no # These options get passed to msgmerge. # Useful options are in particular: # --previous to keep previous msgids of translated messages, # --quiet to reduce the verbosity. MSGMERGE_OPTIONS = mcds-1.9/po/POTFILES.in000066400000000000000000000001531471443141100145030ustar00rootroot00000000000000./src/carddav.c ./src/curl.c ./src/decrypt.c ./src/main.c ./src/mem.c ./src/rc.c ./src/vcard.c ./src/xml.c mcds-1.9/po/Rules-quot000066400000000000000000000041421471443141100147330ustar00rootroot00000000000000# This file, Rules-quot, can be copied and used freely without restrictions. # Special Makefile rules for English message catalogs with quotation marks. DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot .SUFFIXES: .insert-header .po-update-en en@quot.po-create: $(MAKE) en@quot.po-update en@boldquot.po-create: $(MAKE) en@boldquot.po-update en@quot.po-update: en@quot.po-update-en en@boldquot.po-update: en@boldquot.po-update-en .insert-header.po-update-en: @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ tmpdir=`pwd`; \ echo "$$lang:"; \ ll=`echo $$lang | sed -e 's/@.*//'`; \ LC_ALL=C; export LC_ALL; \ cd $(srcdir); \ if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ ;; \ *) \ $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ ;; \ esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ ; then \ if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ rm -f $$tmpdir/$$lang.new.po; \ else \ if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ :; \ else \ echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ exit 1; \ fi; \ fi; \ else \ echo "creation of $$lang.po failed!" 1>&2; \ rm -f $$tmpdir/$$lang.new.po; \ fi en@quot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header en@boldquot.insert-header: insert-header.sin sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header mostlyclean: mostlyclean-quot mostlyclean-quot: rm -f *.insert-header mcds-1.9/po/boldquot.sed000066400000000000000000000003311471443141100152520ustar00rootroot00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g s/“/“/g s/”/”/g s/‘/‘/g s/’/’/g mcds-1.9/po/en@boldquot.header000066400000000000000000000024711471443141100163610ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # # This catalog furthermore displays the text between the quotation marks in # bold face, assuming the VT100/XTerm escape sequences. # mcds-1.9/po/en@quot.header000066400000000000000000000022631471443141100155170ustar00rootroot00000000000000# All this catalog "translates" are quotation characters. # The msgids must be ASCII and therefore cannot contain real quotation # characters, only substitutes like grave accent (0x60), apostrophe (0x27) # and double quote (0x22). These substitutes look strange; see # http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html # # This catalog translates grave accent (0x60) and apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019). # It also translates pairs of apostrophe (0x27) to # left single quotation mark (U+2018) and right single quotation mark (U+2019) # and pairs of quotation mark (0x22) to # left double quotation mark (U+201C) and right double quotation mark (U+201D). # # When output to an UTF-8 terminal, the quotation characters appear perfectly. # When output to an ISO-8859-1 terminal, the single quotation marks are # transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to # grave/acute accent (by libiconv), and the double quotation marks are # transliterated to 0x22. # When output to an ASCII terminal, the single quotation marks are # transliterated to apostrophes, and the double quotation marks are # transliterated to 0x22. # mcds-1.9/po/insert-header.sin000066400000000000000000000012401471443141100161710ustar00rootroot00000000000000# Sed script that inserts the file called HEADER before the header entry. # # At each occurrence of a line starting with "msgid ", we execute the following # commands. At the first occurrence, insert the file. At the following # occurrences, do nothing. The distinction between the first and the following # occurrences is achieved by looking at the hold space. /^msgid /{ x # Test if the hold space is empty. s/m/m/ ta # Yes it was empty. First occurrence. Read the file. r HEADER # Output the file's contents by reading the next line. But don't lose the # current line while doing this. g N bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } mcds-1.9/po/mcds.pot000066400000000000000000000127201471443141100144030ustar00rootroot00000000000000# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Timothy Brown # This file is distributed under the same license as the mcds package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: mcds 1.8\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2024-11-09 15:27-0700\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #: src/carddav.c:95 msgid "Will not to write results to non-null pointer." msgstr "" #: src/carddav.c:110 msgid "Unable to build search string." msgstr "" #: src/carddav.c:135 #, c-format msgid "Unable to search for %s: %s" msgstr "" #: src/carddav.c:144 #, c-format msgid "Unable to obtain a result: %ld (%zu bytes)." msgstr "" #: src/carddav.c:200 msgid "Unable to extend the response data buffer" msgstr "" #: src/curl.c:55 msgid "Unable to initialize non-null curl handle." msgstr "" #: src/curl.c:60 msgid "Unable to initialize curl." msgstr "" #: src/curl.c:66 msgid "Unable to initialize curl handle." msgstr "" #: src/curl.c:70 msgid "Unable to set curls verbose option." msgstr "" #: src/curl.c:74 msgid "Unable to set curls URL." msgstr "" #: src/curl.c:78 msgid "Unable to set curls SSL verification." msgstr "" #: src/curl.c:83 msgid "Unable to set curls username option." msgstr "" #: src/curl.c:87 msgid "Unable to set curls password option." msgstr "" #: src/curl.c:92 msgid "Unable to set curls .netrc option." msgstr "" #: src/curl.c:97 msgid "Unable to set curls HTTP auth method." msgstr "" #: src/curl.c:117 msgid "Unable to finalise null curl handle." msgstr "" #: src/decrypt.c:70 src/decrypt.c:74 src/decrypt.c:78 src/rc.c:102 src/rc.c:230 #: src/rc.c:257 src/rc.c:277 #, c-format msgid "Unable to unveil %s" msgstr "" #: src/decrypt.c:85 #, c-format msgid "Unable to initialize GPGME: %s" msgstr "" #: src/decrypt.c:90 #, c-format msgid "Unable to open password file: %s" msgstr "" #: src/decrypt.c:95 #, c-format msgid "Unable to create new context: %s" msgstr "" #: src/decrypt.c:101 #, c-format msgid "Unable to get encrypted password: %s" msgstr "" #: src/decrypt.c:107 #, c-format msgid "Unable to create GPGME data: %s" msgstr "" #: src/decrypt.c:113 #, c-format msgid "Unable to decrypt password: %s" msgstr "" #: src/decrypt.c:118 #, c-format msgid "Unable to seek: %s" msgstr "" #: src/decrypt.c:126 msgid "Unable to realloc password." msgstr "" #: src/decrypt.c:134 msgid "Unable to close password file." msgstr "" #: src/main.c:116 msgid "Unable to disable further unveil" msgstr "" #: src/main.c:291 msgid "Must specify a term to query for." msgstr "" #: src/main.c:308 #, c-format msgid "" "usage: %s [-c config] [-h] [-q a|e|n|t] [-s a|e|n|t] [-u URL] [-V] [-v] " "string\n" " -c, --config A configuration file to use.\n" " -h, --help Display this help and exit.\n" " -p, --password Prompt for a password.\n" " -q, --query a|e|n|t Query term (default name). Known terms are:\n" " a = address\n" " e = email\n" " n = name\n" " t = telephone\n" " -S, --save Save the password.\n" " -s, --search a|n|e|t Search term (default email). Known terms are:\n" " a = address\n" " e = email\n" " n = name\n" " t = telephone\n" " -u, --url The URL of the carddav server to query.\n" " -V, --version Display version information and exit.\n" " -v, --verbose Verbose mode.\n" " string The query string to look for within the query term.\n" msgstr "" #: src/main.c:339 #, c-format msgid "%s (GNU %s) %s\n" msgstr "" #: src/main.c:340 #, c-format msgid "" "Copyright (C) %s Timothy Brown.\n" "License GPLv3+: GNU GPL version 3 or later \n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n" "\n" msgstr "" #: src/main.c:345 #, c-format msgid "" "Compiled on %s at %s:\n" " - %s GPGME support.\n" " - %s libsecret support.\n" "\n" msgstr "" #: src/main.c:349 src/main.c:350 msgid "with" msgid_plural "with-out" msgstr[0] "" msgstr[1] "" #: src/mem.c:60 #, c-format msgid "out of memory (unable to allocate %zu bytes)" msgstr "" #: src/rc.c:83 src/rc.c:212 src/rc.c:266 msgid "Unable to obtain home directory" msgstr "" #: src/rc.c:89 msgid "Unable to build rc file string" msgstr "" #: src/rc.c:95 msgid "Unable to duplicate string" msgstr "" #: src/rc.c:181 #, c-format msgid "Unable to close %s" msgstr "" #: src/rc.c:218 src/rc.c:272 msgid "Unable to build password file string" msgstr "" #: src/rc.c:224 msgid "Unable to duplicate password file string" msgstr "" #: src/rc.c:249 msgid "Encrypted password files are not supportred, ignoring." msgstr "" #: src/vcard.c:83 msgid "Unable to build quoted term." msgstr "" #: src/vcard.c:95 src/vcard.c:118 msgid "Unable to build regex pattern." msgstr "" #: src/vcard.c:103 src/vcard.c:126 #, c-format msgid "Unable to compile regex '%s': %s\n" msgstr "" #: src/xml.c:64 msgid "Unable to generate an xml document" msgstr "" #: src/xml.c:70 msgid "Unable to get the root node of the xml document" msgstr "" #: src/xml.c:107 #, c-format msgid "" "Data:\n" "%s\n" msgstr "" mcds-1.9/po/quot.sed000066400000000000000000000002311471443141100144100ustar00rootroot00000000000000s/"\([^"]*\)"/“\1”/g s/`\([^`']*\)'/‘\1’/g s/ '\([^`']*\)' / ‘\1’ /g s/ '\([^`']*\)'$/ ‘\1’/g s/^'\([^`']*\)' /‘\1’ /g s/“”/""/g mcds-1.9/po/remove-potcdate.sin000066400000000000000000000006601471443141100165420ustar00rootroot00000000000000# Sed script that remove the POT-Creation-Date line in the header entry # from a POT file. # # The distinction between the first and the following occurrences of the # pattern is achieved by looking at the hold space. /^"POT-Creation-Date: .*"$/{ x # Test if the hold space is empty. s/P/P/ ta # Yes it was empty. First occurrence. Remove the line. g d bb :a # The hold space was nonempty. Following occurrences. Do nothing. x :b } mcds-1.9/po/stamp-po000066400000000000000000000000121471443141100144030ustar00rootroot00000000000000timestamp mcds-1.9/src/000077500000000000000000000000001471443141100131005ustar00rootroot00000000000000mcds-1.9/src/.gitignore000066400000000000000000000000111471443141100150600ustar00rootroot00000000000000mcds *.o mcds-1.9/src/Makefile.am000066400000000000000000000022571471443141100151420ustar00rootroot00000000000000localedir = $(datadir)/locale DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ AUTOMAKE_OPTIONS = nostdinc bin_PROGRAMS = mcds mcds_CPPFLAGS = $(CURL_CFLAGS) \ $(XML_CFLAGS) \ $(SECRET_CFLAGS) \ $(GPGME_CFLAGS) mcds_LDADD = $(LTLIBINTL) \ $(CURL_LIBS) \ $(XML_LIBS) \ $(SECRET_LIBS) \ $(GPGME_LIBS) mcds_SOURCES = defs.h \ options.h \ main.c \ mem.c mem.h \ curl.c curl.h \ carddav.c carddav.h \ xml.c xml.h \ vcard.c vcard.h \ rc.c rc.h \ prompt.c prompt.h if WANT_GPGME mcds_SOURCES += decrypt.c decrypt.h endif if WANT_LIBSECRET mcds_SOURCES += secret.c secret.h endif noinst_HEADERS = gettext.h dist_man_MANS = mcds.1 mcds-1.9/src/carddav.c000066400000000000000000000122651471443141100146560ustar00rootroot00000000000000 /* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file carddav.c * Routines to query and search a vcard. * * \ingroup carddav * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "gettext.h" #include "defs.h" #include "options.h" #include "mem.h" #include "carddav.h" /** Curl response data structure **/ struct r_data { size_t size; char *data; }; /** Search callback fuction **/ static size_t query_cb(void *, size_t, size_t, void *); /** Search string **/ static const char sterm[] = "\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ %s\n\ \n\ \n\ "; /** * Query for a name from the carddav server. * * \parm[in] hdl Curl handle. * \parm[out] result The results from the query. * * \retval 0 If there were no errors. * \retval 1 If an error was encounted. **/ int query(CURL *hdl, char **result) { int plen = 0; size_t len = 0; char *s = NULL; long response_code; CURLcode res = CURLE_OK; struct curl_slist *hdrs = NULL; struct r_data buffer = {0}; if (*result != NULL) { warnx(_("Will not to write results to non-null pointer.")); return(EXIT_FAILURE); } len = strlen(sterm) -8 + strlen(sterm_name[options.search]) + (2*strlen(sterm_name[options.query])) + strlen(options.term) + 1; s = xmalloc(len*sizeof(char)); plen = snprintf(s, len, sterm, sterm_name[options.search], sterm_name[options.query], sterm_name[options.query], options.term); if (plen < 0 || (size_t)plen != len -1) { warnx(_("Unable to build search string.")); return(EXIT_FAILURE); } /* Response buffer, will be realloc'ed by the call back */ buffer.data = xmalloc(1); buffer.size = 0; if (options.verbose) { fprintf(stderr, " Sending :\n%s\n", s); } hdrs = curl_slist_append(hdrs, "Content-Type: text/xml; charset=utf-8"); hdrs = curl_slist_append(hdrs, "Depth: 1"); curl_easy_setopt(hdl, CURLOPT_CUSTOMREQUEST, "REPORT"); curl_easy_setopt(hdl, CURLOPT_POSTFIELDS, s); curl_easy_setopt(hdl, CURLOPT_HTTPHEADER, hdrs); curl_easy_setopt(hdl, CURLOPT_WRITEFUNCTION, query_cb); curl_easy_setopt(hdl, CURLOPT_WRITEDATA, (void *)&buffer); res = curl_easy_perform(hdl); if (res == CURLE_OK) res = curl_easy_getinfo(hdl, CURLINFO_RESPONSE_CODE, &response_code); if (res != CURLE_OK) { warnx(_("Unable to search for %s: %s"), options.term, curl_easy_strerror(res)); return(EXIT_FAILURE); } /* Write out a blank line for mutt */ printf("\n"); if (response_code < 200 || response_code > 299 || buffer.size == 0) { warnx(_("Unable to obtain a result: %ld (%zu bytes)."), response_code, buffer.size); return(EXIT_FAILURE); } *result = xmalloc(buffer.size+1); memcpy(*result, buffer.data, buffer.size); (*result)[buffer.size] = '\0'; if (options.verbose) { fprintf(stderr, "Retrieved:\n======\n%s\n======\n", *result); } curl_slist_free_all(hdrs); if (s) { free(s); s = NULL; } if (buffer.data) { free(buffer.data); buffer.data = NULL; buffer.size = 0; } return(EXIT_SUCCESS); } /** * Query's callback routine. That gets called when curl has * a response. * * Note curl normally writes out every 16k (as defined * by CURL_MAX_WRITE_SIZE in curl.h). So if the response is * larger than 16k, this callback will be called multiple * times. * * \parm[in] contents The contents received by curl. * \parm[in] size The size of a member returned. * \parm[in] nmemb The number of members returned. * \parm[out] mem The contents copied back as a string. * * \retval 0 If there were no errors. * \retval 1 If an error was encounted. **/ static size_t query_cb(void *contents, size_t size, size_t nmemb, void *mem) { size_t len = 0; struct r_data *res = (struct r_data *)mem; len = size * nmemb; res->data = realloc(res->data, res->size + len + 1); if (res->data == NULL) { warn(_("Unable to extend the response data buffer")); return(0); } memcpy(&(res->data[res->size]), contents, len); res->size += len; res->data[res->size] = '\0'; return(len); } /** * \} **/ mcds-1.9/src/carddav.h000066400000000000000000000021241471443141100146540ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file carddav.h * Internal definitions for interacting with carddav's. * * \ingroup search * \{ **/ #ifndef MCDS_CARDDAV_H #define MCDS_CARDDAV_H #ifdef __cplusplus extern "C" { #endif /* Query a carddav server */ int query(CURL *, char **); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_CARDDAV_H */ /** * \} **/ mcds-1.9/src/curl.c000066400000000000000000000057111471443141100142150ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file curl.c * Routines to interact with curl. * * \ingroup curl * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "gettext.h" #include "defs.h" #include "curl.h" #include "options.h" /** * Initalise a curl handle. * * \parm[in] url The URL to connect to. * \parm[out] hdl The curl handle. * * \retval 0 If it was sucessful. * \retval 1 If the initialization failed. **/ int cinit(CURL **hdl) { if (*hdl != NULL) { warnx(_("Unable to initialize non-null curl handle.")); return(EXIT_FAILURE); } if (curl_global_init(CURL_GLOBAL_DEFAULT)) { warnx(_("Unable to initialize curl.")); return(EXIT_FAILURE); } *hdl = curl_easy_init(); if (*hdl == NULL) { warnx(_("Unable to initialize curl handle.")); return(EXIT_FAILURE); } if (curl_easy_setopt(*hdl, CURLOPT_VERBOSE, options.verbose)) { warnx(_("Unable to set curls verbose option.")); return(EXIT_FAILURE); } if (curl_easy_setopt(*hdl, CURLOPT_URL, options.url)) { warnx(_("Unable to set curls URL.")); return(EXIT_FAILURE); } if (curl_easy_setopt(*hdl, CURLOPT_SSL_VERIFYPEER, options.verify)) { warnx(_("Unable to set curls SSL verification.")); return(EXIT_FAILURE); } if (options.username) { if (curl_easy_setopt(*hdl, CURLOPT_USERNAME, options.username)) { warnx(_("Unable to set curls username option.")); return(EXIT_FAILURE); } if (curl_easy_setopt(*hdl, CURLOPT_PASSWORD, options.password)) { warnx(_("Unable to set curls password option.")); return(EXIT_FAILURE); } } else { if (curl_easy_setopt(*hdl, CURLOPT_NETRC, options.netrc)) { warnx(_("Unable to set curls .netrc option.")); return(EXIT_FAILURE); } } if (curl_easy_setopt(*hdl, CURLOPT_HTTPAUTH, CURLAUTH_ANY)) { warnx(_("Unable to set curls HTTP auth method.")); return(EXIT_FAILURE); } return(EXIT_SUCCESS); } /** * Finalise a curl handle. * * \parm[in] hdl The curl handle. * * \retval 0 If it was sucessful. * \retval 1 If the initialization failed. **/ int cfini(CURL **hdl) { if (*hdl == NULL) { warnx(_("Unable to finalise null curl handle.")); return(EXIT_FAILURE); } curl_easy_cleanup(*hdl); curl_global_cleanup(); return(EXIT_SUCCESS); } /** * \} **/ mcds-1.9/src/curl.h000066400000000000000000000021731471443141100142210ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file curl.h * Internal definitions for interacting with the curl library. * * \ingroup curl * \{ **/ #ifndef MCDS_CURL_H #define MCDS_CURL_H #ifdef __cplusplus extern "C" { #endif /** Initialise a curl handle */ int cinit(CURL **); /** Finalise a curl handle */ int cfini(CURL **); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_CURL_H */ /** * \} **/ mcds-1.9/src/decrypt.c000066400000000000000000000072111471443141100147170ustar00rootroot00000000000000 /* * Copyright (C) 2019 Timothy Brown * * 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 3 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, see . * */ /** * \file decrypt.c * Routines to decrypt the password file. * * \ingroup decrypt * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include "gettext.h" #include "defs.h" #include "options.h" #include "mem.h" #ifndef LINE_MAX #define LINE_MAX sysconf(_SC_LINE_MAX) #endif /** * Decrypt the password file and save the password * in the options structure. * * \retval 0 If there were no errors. * \retval 1 If an error was encounted. **/ int decrypt(char *filename) { int fd = 0; /* Password file descriptor */ size_t ret = 0; /* Number of bytes read from buffer */ size_t total = 0; /* Total number of bytes read */ gpgme_error_t err = {0}; /* GPGME error type */ gpgme_ctx_t ctx = {0}; /* GPGME control context */ gpgme_data_t in = {0}; /* GPGME encrypted input */ gpgme_data_t out = {0}; /* GPGME decrypted output */ char tmp[LINE_MAX]; /* GPGME data read */ #ifdef HAVE_UNVEIL if (unveil(GPGME_CONFIG, "rx") == -1) { warn(_("Unable to unveil %s"), GPGME_CONFIG); return(EXIT_FAILURE); } if (unveil(GPG_CONFIG, "rx") == -1) { warn(_("Unable to unveil %s"), GPG_CONFIG); return(EXIT_FAILURE); } if (unveil(GPG, "rx") == -1) { warn(_("Unable to unveil %s"), GPG); return(EXIT_FAILURE); } #endif gpgme_check_version(NULL); if ((err = gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP)) != 0) { warnx(_("Unable to initialize GPGME: %s"), gpgme_strerror(err)); return(EXIT_FAILURE); } if ((fd = open(filename, O_RDONLY)) < 0) { warn(_("Unable to open password file: %s"), filename); return(EXIT_FAILURE); } if ((err = gpgme_new(&ctx)) != 0) { warnx(_("Unable to create new context: %s"), gpgme_strerror(err)); return(EXIT_FAILURE); } if ((err = gpgme_data_new_from_fd(&in, fd)) != 0) { warnx(_("Unable to get encrypted password: %s"), gpgme_strerror(err)); return(EXIT_FAILURE); } if ((err = gpgme_data_new(&out)) != 0) { warnx(_("Unable to create GPGME data: %s"), gpgme_strerror(err)); return(EXIT_FAILURE); } if ((err = gpgme_op_decrypt(ctx, in, out)) != 0) { warnx(_("Unable to decrypt password: %s"), gpgme_strerror(err)); return(EXIT_FAILURE); } if ((err = gpgme_data_seek(out, 0, SEEK_SET)) !=0) { warnx(_("Unable to seek: %s"), gpgme_strerror(err)); return(EXIT_FAILURE); } while ((ret = gpgme_data_read(out, tmp, LINE_MAX)) > 0) { total += ret; options.password = realloc(options.password, total); if (!options.password) { warn(_("Unable to realloc password.")); return(EXIT_FAILURE); } memcpy(&(options.password[total - ret]), tmp, ret); } options.password[total-1] = '\0'; if (close(fd) < 0) { warn(_("Unable to close password file.")); return(EXIT_FAILURE); } gpgme_data_release(in); gpgme_data_release(out); gpgme_release(ctx); return(EXIT_SUCCESS); } /** * \} **/ mcds-1.9/src/decrypt.h000066400000000000000000000021171471443141100147240ustar00rootroot00000000000000/* * Copyright (C) 2019 Timothy Brown * * 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 3 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, see . * */ /** * \file decrypt.h * Internal definitions for decrypting the password file. * * \ingroup rc * \{ **/ #ifndef MCDS_DECRYPT_H #define MCDS_DECRYPT_H #ifdef __cplusplus extern "C" { #endif /** Decrypt the password file */ int decrypt(char *); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_DECRYPT_H */ /** * \} **/ mcds-1.9/src/defs.h000066400000000000000000000040271471443141100141750ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file defs.h * Internal definitions. * * \ingroup defs * \{ **/ #ifndef MCDS_DEFS_H #define MCDS_DEFS_H #ifdef __cplusplus extern "C" { #endif #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #define _(x) gettext(x) /** * Compiler __attribute__ extensions **/ #ifdef HAVE___ATTRIBUTE__ #define ATT_CONSTR __attribute__((__constructor__)) #define ATT_DESTR __attribute__((__destructor__)) #define ATT_PUBLIC __attribute__((__visibility__("default"))) #define ATT_LOCAL __attribute__((__visibility__("hidden"))) #define ATT_DEPRECATED __attribute__((__deprecated__)) #define ATT_MSIZE(x) __attribute__((__alloc_size__(x))) #define ATT_MALLOC __attribute__((__malloc__)) #define ATT_FMT(x,y) __attribute__((__format__(printf, x, y))) #define ATT_NORETURN __attribute__((__noreturn__)) #define ATT_INLINE __attribute__((__always_inline__)) #define ATT_ALIAS(x) __attribute__((__weak__, __alias__(x))) #else #define ATT_CONSTR #define ATT_DESTR #define ATT_PUBLIC #define ATT_LOCAL #define ATT_DEPRECATED(msg) #define ATT_MSIZE(x) #define ATT_MALLOC #define ATT_FMT(x,y) #define ATT_NORETURN #define ATT_INLINE #define ATT_ALIAS(x) #endif #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_DEFS_H */ /** * \} **/ mcds-1.9/src/gettext.h000066400000000000000000000231171471443141100147410ustar00rootroot00000000000000/* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009 Free Software Foundation, 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 3, 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 Library 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. */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include /* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by the gettext() and ngettext() macros. This is an alternative to calling textdomain(), and is useful for libraries. */ # ifdef DEFAULT_TEXT_DOMAIN # undef gettext # define gettext(Msgid) \ dgettext (DEFAULT_TEXT_DOMAIN, Msgid) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N) # endif #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Many header files from the libstdc++ coming with g++ 3.3 or newer include , which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. */ #if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3) # include # if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H # include # endif #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # undef gettext # define gettext(Msgid) ((const char *) (Msgid)) # undef dgettext # define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid)) # undef dcgettext # define dcgettext(Domainname, Msgid, Category) \ ((void) (Category), dgettext (Domainname, Msgid)) # undef ngettext # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 \ ? ((void) (Msgid2), (const char *) (Msgid1)) \ : ((void) (Msgid1), (const char *) (Msgid2))) # undef dngettext # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((void) (Domainname), ngettext (Msgid1, Msgid2, N)) # undef dcngettext # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N)) # undef textdomain # define textdomain(Domainname) ((const char *) (Domainname)) # undef bindtextdomain # define bindtextdomain(Domainname, Dirname) \ ((void) (Domainname), (const char *) (Dirname)) # undef bind_textdomain_codeset # define bind_textdomain_codeset(Domainname, Codeset) \ ((void) (Domainname), (const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String /* The separator between msgctxt and msgid in a .mo file. */ #define GETTEXT_CONTEXT_GLUE "\004" /* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a MSGID. MSGCTXT and MSGID must be string literals. MSGCTXT should be short and rarely need to change. The letter 'p' stands for 'particular' or 'special'. */ #ifdef DEFAULT_TEXT_DOMAIN # define pgettext(Msgctxt, Msgid) \ pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #else # define pgettext(Msgctxt, Msgid) \ pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #endif #define dpgettext(Domainname, Msgctxt, Msgid) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES) #define dcpgettext(Domainname, Msgctxt, Msgid, Category) \ pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category) #ifdef DEFAULT_TEXT_DOMAIN # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #else # define npgettext(Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #endif #define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES) #define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \ npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * pgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, int category) { const char *translation = dcgettext (domain, msg_ctxt_id, category); if (translation == msg_ctxt_id) return msgid; else return translation; } #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * npgettext_aux (const char *domain, const char *msg_ctxt_id, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { const char *translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); if (translation == msg_ctxt_id || translation == msgid_plural) return (n == 1 ? msgid : msgid_plural); else return translation; } /* The same thing extended for non-constant arguments. Here MSGCTXT and MSGID can be arbitrary expressions. But for string literals these macros are less efficient than those above. */ #include #define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \ (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \ /* || __STDC_VERSION__ >= 199901L */ ) #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS #include #endif #define pgettext_expr(Msgctxt, Msgid) \ dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES) #define dpgettext_expr(Domainname, Msgctxt, Msgid) \ dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcgettext (domain, msg_ctxt_id, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (translation != msg_ctxt_id) return translation; } return msgid; } #define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \ dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES) #ifdef __GNUC__ __inline #else #ifdef __cplusplus inline #endif #endif static const char * dcnpgettext_expr (const char *domain, const char *msgctxt, const char *msgid, const char *msgid_plural, unsigned long int n, int category) { size_t msgctxt_len = strlen (msgctxt) + 1; size_t msgid_len = strlen (msgid) + 1; const char *translation; #if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS char msg_ctxt_id[msgctxt_len + msgid_len]; #else char buf[1024]; char *msg_ctxt_id = (msgctxt_len + msgid_len <= sizeof (buf) ? buf : (char *) malloc (msgctxt_len + msgid_len)); if (msg_ctxt_id != NULL) #endif { memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); msg_ctxt_id[msgctxt_len - 1] = '\004'; memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category); #if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS if (msg_ctxt_id != buf) free (msg_ctxt_id); #endif if (!(translation == msg_ctxt_id || translation == msgid_plural)) return translation; } return (n == 1 ? msgid : msgid_plural); } #endif /* _LIBGETTEXT_H */ mcds-1.9/src/main.c000066400000000000000000000214101471443141100141660ustar00rootroot00000000000000 /* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file main.c * Main entry point for the program MCDS. * * \ingroup main * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include #include #include #include #include "gettext.h" #include #include #include "defs.h" #include "options.h" #include "mem.h" #include "rc.h" #include "curl.h" #include "carddav.h" #include "xml.h" #if HAVE_LIBSECRET #include "secret.h" #endif /* Initalise extern definitions */ #define X(a, b) b, char *sterm_name[] = { /**< Search term names */ STERMS_TABLE }; #undef X struct opts options = {0}; /**< Program options */ /* Internal functions */ static void print_usage(void); static void print_version(void); static int parse_argv(int, char **, char **); static const char *program_name(void); /** * The main entry point of the program. * * \param argc Number of command line arguments. * \param argv Reference to the pointer to the argument array list. * * \retval 0 If there were no errors. * \retval 1 If an error was encounted. **/ int main(int argc, char **argv) { char *file = NULL; /* config file */ char *res = NULL; /* query result */ CURL *hdl = NULL; /* Curl handle */ #ifdef HAVE_PLEDGE if (pledge("stdio rpath inet dns proc exec unveil", NULL) == -1) { err(1, "pledge"); } #endif #ifdef HAVE_SETLOCALE setlocale(LC_ALL, ""); #endif #ifdef ENABLE_NLS bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); #endif if (parse_argv(argc, argv, &file)) { return(EXIT_FAILURE); } if (read_rc(file)) { return(EXIT_FAILURE); } #ifdef HAVE_UNVEIL if (unveil(NULL, NULL) == -1) { warn(_("Unable to disable further unveil")); return(EXIT_FAILURE); } #endif if (options.verbose) { fprintf(stderr, "%s options are:\n", program_name()); fprintf(stderr, " URL : %s\n", options.url); fprintf(stderr, " SSL Verify : %d\n", options.verify); fprintf(stderr, " Use .netrc : %d\n", options.netrc); fprintf(stderr, " Use libsecret : %d\n", options.libsecret); fprintf(stderr, " Save password : %d\n", options.save); fprintf(stderr, " Password prompted : %d\n", options.pwprompt); fprintf(stderr, " Username : %s\n", options.username); fprintf(stderr, " Password : %s\n", options.password); fprintf(stderr, " Query term : %s\n", options.term); fprintf(stderr, " Query : %s\n", sterm_name[options.query]); fprintf(stderr, " Search : %s\n", sterm_name[options.search]); } if (cinit(&hdl)) { return(EXIT_FAILURE); } if (query(hdl, &res)) { return(EXIT_FAILURE); } if (cfini(&hdl)) { return(EXIT_FAILURE); } if (parse_xml(res)) { return(EXIT_FAILURE); } if (options.save) { #if HAVE_LIBSECRET if (options.libsecret) { if(store_password()) { return(EXIT_FAILURE); } } #endif } if (options.url) { free(options.url); options.url = NULL; } if (options.term) { free(options.term); options.term = NULL; } if (options.username) { free(options.username); options.username = NULL; } if (options.password) { free(options.password); options.password = NULL; } if (res) { free(res); res = NULL; } if (file) { free(file); file = NULL; } return(EXIT_SUCCESS); } /** * Parse the command line arguments. * * \param[in] argc Number of command line arguments. * \param[in] argv Reference to the pointer to the argument array list. * \param[out] file A configuration file. * * \retval 0 If there were no errors. **/ static int parse_argv(int argc, char **argv, char **file) { int opt = 0; int opt_index = 0; char *soptions = "c:hpq:Ss:u:Vv"; /* short options structure */ static struct option loptions[] = { /* long options structure */ {"config", required_argument, NULL, 'c'}, {"help", no_argument, NULL, 'h'}, {"password", no_argument, NULL, 'p'}, {"query", required_argument, NULL, 'q'}, {"save", no_argument, NULL, 'S'}, {"search", required_argument, NULL, 's'}, {"url", required_argument, NULL, 'u'}, {"version", no_argument, NULL, 'V'}, {"verbose", no_argument, NULL, 'v'}, {NULL, 1, NULL, 0} }; /* set the default field to search */ options.query = name; options.search = email; /* parse the arguments */ while ((opt = getopt_long(argc, argv, soptions, loptions, &opt_index)) != -1) { switch (opt) { case 'c': *file = strdup(optarg); break; case 'h': print_usage(); break; case 'p': options.pwprompt = 1; break; case 'q': if (optarg[0] == 'a' || optarg[0] == 'A' ) { options.query = address; } else if (optarg[0] == 'e' || optarg[0] == 'E' ) { options.query = email; } else if (optarg[0] == 'n' || optarg[0] == 'N' ) { options.query = name; } else if (optarg[0] == 't' || optarg[0] == 'T' ) { options.query = telephone; } break; case 'S': options.save = 1; break; case 's': if (optarg[0] == 'a' || optarg[0] == 'A' ) { options.search = address; } else if (optarg[0] == 'e' || optarg[0] == 'E' ) { options.search = email; } else if (optarg[0] == 'n' || optarg[0] == 'N' ) { options.search = name; } else if (optarg[0] == 't' || optarg[0] == 'T' ) { options.search = telephone; } break; case 'u': if (options.url) { free(options.url); } options.url = xmalloc((strlen(optarg)+1)*sizeof(char)); strcpy(options.url, optarg); break; case 'V': print_version(); break; case 'v': options.verbose = 1; break; default: print_usage(); break; } } argc -= optind; argv += optind; if (argc != 1) { warnx(_("Must specify a term to query for.")); print_usage(); } options.term = xmalloc((strlen(argv[0]) +1) * sizeof(char)); strcpy(options.term, argv[0]); return(EXIT_SUCCESS); } /** * Prints a short program usage statement, explaining the * command line arguments and flags expected. **/ static void print_usage(void) { printf(_("\ usage: %s [-c config] [-h] [-q a|e|n|t] [-s a|e|n|t] [-u URL] [-V] [-v] string\n\ -c, --config A configuration file to use.\n\ -h, --help Display this help and exit.\n\ -p, --password Prompt for a password.\n\ -q, --query a|e|n|t Query term (default name). Known terms are:\n\ a = address\n\ e = email\n\ n = name\n\ t = telephone\n\ -S, --save Save the password.\n\ -s, --search a|n|e|t Search term (default email). Known terms are:\n\ a = address\n\ e = email\n\ n = name\n\ t = telephone\n\ -u, --url The URL of the carddav server to query.\n\ -V, --version Display version information and exit.\n\ -v, --verbose Verbose mode.\n\ string The query string to look for within the query term.\n\ "), program_name()); exit(EXIT_FAILURE); } /** * Prints the program version number, copyright information and * compile date. **/ static void print_version(void) { printf(_("%s (GNU %s) %s\n"), program_name(), PACKAGE, VERSION); printf(_("\ Copyright (C) %s Timothy Brown.\n\ License GPLv3+: GNU GPL version 3 or later \n\ This is free software: you are free to change and redistribute it.\n\ There is NO WARRANTY, to the extent permitted by law.\n\n"), "2019"); printf(_("Compiled on %s at %s:\n" " - %s GPGME support.\n" " - %s libsecret support.\n\n"), __DATE__, __TIME__, ngettext("with", "with-out", HAVE_GPGME), ngettext("with", "with-out", HAVE_LIBSECRET) ); exit(EXIT_FAILURE); } static const char * program_name(void) { #if HAVE_GETPROGNAME return getprogname(); #else #if HAVE_PROGRAM_INVOCATION_SHORT_NAME return program_invocation_short_name; #else return "unknown"; #endif /* HAVE_PROGRAM_INVOCATION_SHORT_NAME */ #endif /* HAVE_GETPROGNAME */ } /** * \} **/ mcds-1.9/src/mcds.1000066400000000000000000000106471471443141100141200ustar00rootroot00000000000000.\"- .\" Manual page written by Timothy Brown .\" .\" Copyright (C) 2014 Timothy Brown .\" .\" Permission is granted to make and distribute verbatim copies of .\" this manual provided the copyright notice and this permission notice .\" are preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Permission is granted to copy and distribute translations of this .\" manual into another language, under the above conditions for modified .\" versions, except that this permission notice may be included in .\" translations approved by the Free Software Foundation instead of in .\" the original English. .\" .\" $Id$ .\" .Dd November 5, 2024 .Dt MCDS 1 .Os .Sh NAME .Nm mcds .Nd mutt CardDAV query .Sh SYNOPSIS .Nm .Op Fl c Ar config_file .Op Fl hVvp .Op Fl q Cm a | e | n | t .Op Fl S .Op Fl s Cm a | e | n | t .Op Fl u Ar URL .Ar term .Sh DESCRIPTION The .Nm utility queries a CardDAV server for requested information. Its primary function is to provide an address query command for .Xr mutt 1 . .Pp The options are as follows: .Bl -tag -width Ds .It Fl c Pa config_file Specifies an alternative configuration file. The default file is .Pa ~/.mcdsrc . .It Fl h Print help text to standard output and exit. .It Fl p Prompt for a password. .It Fl q Cm a | e | n | t The term to query against. Known terms are: .Bl -tag -width Ds .It Cm a Query for the address field. .It Cm e Query for the email field. This is the default. .It Cm n Query for the full-name field. .It Cm t Query for the telephone field. .El .It Fl S Save the password. .It Fl s Cm a | e | n | t The search term to return. Known terms are: .Bl -tag -width Ds .It Cm a Query for the address field. .It Cm e Query for the email field. This is the default. .It Cm n Query for the full-name field. .It Cm t Query for the telephone field. .El .It Fl u Ar URL The URL of the CardDAV server. .It Fl V Print the version number and license information of .Nm to standard output and exit. .It Fl v Enable verbose mode. Forces .Nm to print debugging messages about its progress. .El .Sh FILES .Bl -tag -width Ds .It Pa ~/.mcdsrc Configuration file. Used to set default values for .Nm , but can be overridden with command-line arguments. Formatted as a list of .Dq Cm key No \&= Ar value pairs separated by newlines. .Pp The keys are as follows: .Bl -tag -width Ds .It Cm url No \&= Ar URL The URL of the CardDAV server. .It Cm verify No \&= Op Cm yes | no Verify server certificate if connecting over HTTPS. Disabled by default. .It Cm netrc No \&= Op Cm yes | no Enable reading the .Pa ~/.netrc file. Disabled by default. .It Cm username No \&= Ar USERNAME The username to login to the CardDAV server with. If a username is specified .Nm will not use the .Pa ~/.netrc file. .It Cm password_file No \&= Ar password.gpg The GPG encrypted file containing the password for the CardDAV server. .It Cm libsecret No \&= Op Cm yes | no Use .Lb libsecret to store and retrieve the password. .El .It Pa ~/.netrc Used to access your username and password when authenticating with the CardDAV server, if you have not specified your username and password file in .Pa ~/.mcdsrc . .El .Sh EXIT STATUS .Ex -std .Sh EXAMPLES Query a CardDAV server for email addresses corresponding to .Dq Ben : .Bd -literal -offset indent $ mcds -u https://localhost/caldav.php/username/addressbook/ Ben ben@example.net Ben Smith \&... .Ed .Pp To use .Nm with .Nm mutt , add the following to your .Xr muttrc 5 : .Bd -literal -offset indent set query_command="mcds -u https://localhost/caldav.php/username/addressbook/ '%s'" .Ed .Pp This query can be simplified by putting the relevant values in .Pa ~/.mcdsrc : .Bd -literal -offset indent url = https://localhost/caldav.php/username/addressbook/ verify = no netrc = yes .Ed .Pp Now the query command can be shortened to: .Bd -literal -offset indent set query_command="mcds '%s'" .Ed .Pp When compiled against and after enabling libsecret in the configuration file, .Nm can save passwords provided at the password prompt. To set, replace or clear the password, run .Bd -literal -offset indent mcds -pS .Ed .Sh SEE ALSO .Xr curl 1 , .Xr gpg2 1 , .Xr mutt 1 , .Xr muttrc 5 , .Xr netrc 5 .Sh AUTHORS The .Nm utility is maintained by .An Timothy Brown Aq Mt tbrown@freeshell.org mcds-1.9/src/mem.c000066400000000000000000000030721471443141100140240ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file mem.c * Memory allocation and deallocation routines. * * \ingroup memory * \{ **/ #include "config.h" #include #include #include #include #include #include "gettext.h" #include "defs.h" #include "mem.h" /** * Allocate a block of memory and set all entries to zero. * If there is an error in obtaining the memory err() * is called, terminating the program. * * \param[in] n The amount of memory in bytes. * * \return A pointer to the newly allocated memory. **/ ATT_MSIZE(1) ATT_MALLOC void * xmalloc(size_t n) { void *ptr = NULL; /* New pointer to memory location */ ptr = (void *) malloc(n); if (ptr) { memset(ptr, 0, n); return ptr; } else { errx(EX_SOFTWARE,_("out of memory (unable to allocate %zu bytes)"), n); } /* should never get here */ return NULL; } /** * \} **/ mcds-1.9/src/mem.h000066400000000000000000000021141471443141100140250ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file mem.h * Internal definitions for memory allocation and deallocation. * * \ingroup memory * \{ **/ #ifndef MCDS_MEM_H #define MCDS_MEM_H #ifdef __cplusplus extern "C" { #endif /* Allocate a block of memory */ void * xmalloc(size_t); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_MEM_H */ /** * \} **/ mcds-1.9/src/options.h000066400000000000000000000030321471443141100147420ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file options.h * Internal definitions for program options. * * \ingroup options * \{ **/ #ifndef MCDS_OPTIONS_H #define MCDS_OPTIONS_H #ifdef __cplusplus extern "C" { #endif #define STERMS_TABLE \ X(name, "FN") \ X(email, "EMAIL") \ X(address, "ADR") \ X(telephone, "TEL") #define X(a, b) a, enum s_terms { STERMS_TABLE }; #undef X /** Program command line options **/ struct opts { int verbose; int verify; int netrc; int pwprompt; int libsecret; int save; enum s_terms query; enum s_terms search; char *url; char *term; char *username; char *password; }; /** Extern declarations **/ extern struct opts options; extern char *sterm_name[]; #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_OPTIONS_H */ /** * \} **/ mcds-1.9/src/prompt.c000066400000000000000000000046651471443141100146000ustar00rootroot00000000000000/* * Copyright (C) 2024 Andrew Bower * * 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 3 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, see . * */ /** * \file prompt.c * Routine to prompt for a password. * * \ingroup prompt * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "gettext.h" #include "defs.h" #include "options.h" #include "mem.h" #include "prompt.h" int prompt_password(void) { struct termios tios_save; struct termios tios; FILE *console; char *password = NULL; int console_fd; ssize_t len; size_t sz; /* Open controlling terminal */ console = fopen("/dev/tty", "w+"); if (console == NULL) { warn(_("Could not open console for password prompt")); return(EXIT_FAILURE); } console_fd = fileno(console); /* Output prompt */ fprintf(console, _("mcds: password for %s at %s: "), options.username, options.url); fflush(console); /* Do not echo password */ if (tcgetattr(console_fd, &tios_save) != 0) { warn(_("Could not turn off echo for password prompt")); fclose(console); return(EXIT_FAILURE); } tios = tios_save; tios.c_lflag &= ~ECHO; if (tcsetattr(console_fd, TCSAFLUSH, &tios) != 0) { warn(_("Could not turn off echo for password prompt")); fclose(console); return(EXIT_FAILURE); } /* Read password */ len = getline(&password, &sz, console); fprintf(console, "\n"); fflush(console); if (len < 1) { free(password); /* Yes, getline(3) says to do this! */ warn(_("Could not read password")); } else { /* Remove line ending */ password[len - 1] = '\0'; options.password = password; } /* Restore echo state */ tcsetattr(console_fd, TCSAFLUSH, &tios_save); fclose(console); return(EXIT_SUCCESS); } /** * \} **/ mcds-1.9/src/prompt.h000066400000000000000000000021131471443141100145670ustar00rootroot00000000000000/* * Copyright (C) 2024 Andrew Bower * * 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 3 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, see . * */ /** * \file prompt.h * Internal definitions for password prompting. * * \ingroup secret * \{ **/ #ifndef MCDS_PROMPT_H #define MCDS_PROMPT_H #ifdef __cplusplus extern "C" { #endif /** Prompt for user's password */ int prompt_password(void); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_PROMPT_H */ /** * \} **/ mcds-1.9/src/rc.c000066400000000000000000000157531471443141100136630ustar00rootroot00000000000000 /* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file rc.c * Routines to read a configuration/rc file. * * \ingroup rc * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include "gettext.h" #include "decrypt.h" #include "defs.h" #include "mem.h" #include "options.h" #include "prompt.h" #include "secret.h" #ifndef LINE_MAX #define LINE_MAX sysconf(_SC_LINE_MAX) #endif /** * Read the rc file and parse it into the options. * * \retval 0 If there were no errors. * \retval 1 If an error was encounted. **/ int read_rc(const char *file) { int i = 0; /* Temporary loop indexer */ int ln = 0; /* Line number */ int len = 0; /* String length */ char *home = NULL; /* Home directory */ char *pfile = NULL; /* Password file */ char *abs_file = NULL; /* Absolute filename */ FILE *ifd = NULL; /* File descriptor */ char line[LINE_MAX]; /* Read line from file */ char *lptr = NULL; /* Line pointer for strsep */ char *tmp = NULL; /* Temporary pointer for read variables*/ char *vals[2] = {0}; /* Key, value read from a line */ struct stat buf = {0}; /* Stat information */ static const char nfile[] = ".netrc"; /* Netrc file */ static const char rfile[] = ".mcdsrc"; /* Default rc file */ if (file == NULL) { home = getenv("HOME"); if (home == NULL) { warnx(_("Unable to obtain home directory")); return(EXIT_FAILURE); } len = strlen(home) + strlen(rfile) + 2; abs_file = xmalloc(len*sizeof(char)); if (snprintf(abs_file, len, "%s/%s", home, rfile) >= len) { warnx(_("Unable to build rc file string")); return(EXIT_FAILURE); } } else { abs_file = strdup(file); if (abs_file == NULL) { warn(_("Unable to duplicate string")); return(EXIT_FAILURE); } } #ifdef HAVE_UNVEIL if (unveil(abs_file, "r") == -1) { warn(_("Unable to unveil %s"), abs_file); return(EXIT_FAILURE); } #endif /* fail silently in case the user does not have a rc file */ if (stat(abs_file, &buf) == -1) { if (errno == ENOENT) { return(EXIT_SUCCESS); } } if ((ifd = fopen(abs_file, "r")) == NULL) { return(EXIT_FAILURE); } while (fgets(line, LINE_MAX, ifd) != NULL) { ++ln; lptr = line; i = 0; if (line[0] != '\n' && line[0] != '#') { while ((tmp = strsep(&lptr, " \t=\n")) != NULL) { if (tmp[0] != '\0') { len = strlen(tmp) +1; vals[i] = xmalloc(len); strncpy(vals[i], tmp, len); ++i; if (i == 2) { break; } } } if (strncmp("url", vals[0], 3) == 0) { if (options.url == NULL) { len = strlen(vals[1]) +1; options.url = xmalloc(len); strncpy(options.url, vals[1], len); } } else if (strncmp("verify", vals[0], 6) == 0) { if ((vals[1][0] == 'y') || (vals[1][0] == 'Y')) { options.verify = 1; } else { options.verify = 0; } } else if (strncmp("netrc", vals[0], 5) == 0) { if ((vals[1][0] == 'y') || (vals[1][0] == 'Y')) { options.netrc = 1; } else { options.netrc = 0; } } else if (strncmp("libsecret", vals[0], 9) == 0) { if ((vals[1][0] == 'y') || (vals[1][0] == 'Y')) { options.libsecret = 1; } else { options.libsecret = 0; } } else if (strncmp("password_file", vals[0], 13) == 0) { len = strlen(vals[1]) +1; pfile = xmalloc(len); strncpy(pfile, vals[1], len); } else if (strncmp("username", vals[0], 8) == 0) { if (options.username == NULL) { len = strlen(vals[1]); options.username = xmalloc(len+1); strncpy(options.username, vals[1], len); } } if (vals[0]) { free(vals[0]); vals[0] = NULL; } if (vals[1]) { free(vals[1]); vals[1] = NULL; } } } if (fclose(ifd)) { warn(_("Unable to close %s"), abs_file); } if (abs_file) { free(abs_file); abs_file = NULL; } if (options.username == NULL && options.netrc == 0) { options.username = strdup(getenv("USER")); } if (options.pwprompt) { prompt_password(); } #if HAVE_LIBSECRET if (options.libsecret) { if (!options.pwprompt) { if (lookup_password() == 1) { return(EXIT_FAILURE); } } } #endif if (options.password == NULL && pfile) { #if HAVE_GPGME == 1 if (pfile[0] == '~' && pfile[1] == '/') { home = getenv("HOME"); if (home == NULL) { warnx(_("Unable to obtain home directory")); return(EXIT_FAILURE); } len = strlen(home) + strlen(pfile); abs_file = xmalloc(len*sizeof(char)); if (snprintf(abs_file, len, "%s/%s", home, pfile +2) >= len) { warnx(_("Unable to build password file string")); return(EXIT_FAILURE); } } else { abs_file = strdup(pfile); if (abs_file == NULL) { warn(_("Unable to duplicate password file string")); return(EXIT_FAILURE); } } #ifdef HAVE_UNVEIL if (unveil(abs_file, "r") == -1) { warn(_("Unable to unveil %s"), abs_file); return(EXIT_FAILURE); } #endif if (pfile) { free(pfile); pfile = NULL; } if (decrypt(abs_file)) { return(EXIT_FAILURE); } if (abs_file) { free(abs_file); abs_file = NULL; } #else if (options.verbose == 1) { warnx(_("Encrypted password files are not supportred, ignoring.")); } #endif } if (options.verify == 1) { #ifdef HAVE_UNVEIL if (unveil("/etc/ssl", "r") == -1) { warn(_("Unable to unveil %s"), "/etc/ssl/"); return(EXIT_FAILURE); } #endif } if (options.password == NULL && options.netrc == 1) { home = getenv("HOME"); if (home == NULL) { warnx(_("Unable to obtain home directory")); return(EXIT_FAILURE); } len = strlen(home) + strlen(nfile) + 2; abs_file = xmalloc(len*sizeof(char)); if (snprintf(abs_file, len, "%s/%s", home, nfile) >= len) { warnx(_("Unable to build password file string")); return(EXIT_FAILURE); } #ifdef HAVE_UNVEIL if (unveil(abs_file, "r") == -1) { warn(_("Unable to unveil %s"), abs_file); return(EXIT_FAILURE); } #endif if (abs_file) { free(abs_file); abs_file = NULL; } } #if HAVE_LIBSECRET if (options.libsecret == 1) { if (options.password && options.password[0] == '\0') { clear_password(); options.password = NULL; } } #endif return(EXIT_SUCCESS); } /** * \} **/ mcds-1.9/src/rc.h000066400000000000000000000020571471443141100136610ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file rc.h * Internal definitions for reading the rc file. * * \ingroup rc * \{ **/ #ifndef MCDS_RC_H #define MCDS_RC_H #ifdef __cplusplus extern "C" { #endif /** Read the rc file */ int read_rc(const char *); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_RC_H */ /** * \} **/ mcds-1.9/src/secret.c000066400000000000000000000061441471443141100145360ustar00rootroot00000000000000/* * Copyright (C) 2024 Andrew Bower * * 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 3 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, see . * */ /** * \file secret.c * Routines to manage access to credential store. * * \ingroup secret * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "gettext.h" #include "defs.h" #include "mem.h" #include "options.h" #include "prompt.h" #include "secret.h" #if HAVE_LIBSECRET #include #define MCDS_NAMESPACE "com.github.t-brown.mcds" #define MCDS_SECRET_SCHEMA_NAME MCDS_NAMESPACE ".password" #define MCDS_SECRET_KEY_URL "url" #define MCDS_SECRET_KEY_USER "user" static const SecretSchema mcds_secret_schema = { MCDS_SECRET_SCHEMA_NAME, SECRET_SCHEMA_NONE, { { MCDS_SECRET_KEY_URL, SECRET_SCHEMA_ATTRIBUTE_STRING }, { MCDS_SECRET_KEY_USER, SECRET_SCHEMA_ATTRIBUTE_STRING }, { "NULL", 0 } } }; int store_password(void) { GError *error = NULL; secret_password_store_sync(&mcds_secret_schema, SECRET_COLLECTION_DEFAULT, "Mutt CardDAV Search user credentials", options.password, NULL, &error, MCDS_SECRET_KEY_URL, options.url, MCDS_SECRET_KEY_USER, options.username, NULL); if (error) { warnx(_("error storing password with libsecret: %s"), error->message); g_error_free(error); return(EXIT_FAILURE); } return(EXIT_SUCCESS); } int lookup_password(void) { GError *error = NULL; gchar *password = secret_password_lookup_sync(&mcds_secret_schema, NULL, &error, MCDS_SECRET_KEY_URL, options.url, MCDS_SECRET_KEY_USER, options.username, NULL); if (error) { warnx(_("error retrieving password with libsecret: %s"), error->message); g_error_free(error); return(EXIT_FAILURE); } if (password) { options.password = strdup(password); } secret_password_free(password); return(EXIT_SUCCESS); } int clear_password(void) { GError *error = NULL; gboolean removed = secret_password_clear_sync(&mcds_secret_schema, NULL, &error, MCDS_SECRET_KEY_URL, options.url, MCDS_SECRET_KEY_USER, options.username, NULL); if (error) { /* This is a non-fatal condition. */ warnx(_("error clearing password with libsecret: %s"), error->message); g_error_free(error); } return(!error && removed ? EXIT_SUCCESS : EXIT_FAILURE); } #endif /** * \} **/ mcds-1.9/src/secret.h000066400000000000000000000024631471443141100145430ustar00rootroot00000000000000/* * Copyright (C) 2024 Andrew Bower * * 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 3 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, see . * */ /** * \file secret.h * Internal definitions for accessing credential store. * * \ingroup secret * \{ **/ #ifndef MCDS_SECRET_H #define MCDS_SECRET_H #if HAVE_LIBSECRET #include #endif #ifdef __cplusplus extern "C" { #endif /** Save password in user's credential store */ int store_password(void); /** Lookup password in user's credential store */ int lookup_password(void); /** Clear password in user's credential store */ int clear_password(void); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_SECRET_H */ /** * \} **/ mcds-1.9/src/vcard.c000066400000000000000000000127161471443141100143520ustar00rootroot00000000000000 /* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file carddav.c * Routines to query and search a vcard. * * \ingroup carddav * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include "gettext.h" #include "defs.h" #include "options.h" #include "mem.h" #include "vcard.h" /** * Search a query's result. This will run regexs over the result * to filter the data. * The first regex will be to obtain the name (FN property). * While the second one will be to find all requested fields. * * It will print all matches found to stdout. * * \parm[in] card The vcard. * * \retval 0 If there were no errors. * \retval 1 If an error was encounted. **/ int search(const char *card) { /* Regex patterns */ static const char r[] = "%s(.*):(.*)"; /* Whole result */ static const char t[] = "^%s([A-Za-z;=])*:(.*%s.*)"; /* Query term */ int plen = 0; /* Length of snprintf()'s */ int rerr = 0; /* Regex error code */ size_t rlen = 0; /* Regex error string length */ char *rstr = NULL; /* Regex error string */ size_t qlen = 0; /* Length of the query string */ char *q = NULL; /* Regex pattern for query */ char *qt = NULL; /* Quoted query term */ regex_t rq = {0}; /* Regex precompiled query */ char *qres = NULL; /* Result of the query */ size_t slen = 0; /* Length of the search string */ char *s = NULL; /* Regex pattern for search */ regex_t rs = {0}; /* Regex precompiled search */ regmatch_t match[3] = {0}; /* Regex matches */ /* Generate a quoted query term */ if (quote(options.term, &qt)) { warnx(_("Unable to build quoted term.")); return(EXIT_FAILURE); } /* Compile the regex for the query */ qlen = strlen(t) -4 + strlen(sterm_name[options.query]) + strlen(qt) +1; q = xmalloc(qlen*sizeof(char)); plen = snprintf(q, qlen, t, sterm_name[options.query], qt); if (plen < 0 || (size_t)plen != qlen -1) { warnx(_("Unable to build regex pattern.")); return(EXIT_FAILURE); } if ((rerr = regcomp(&rq, q, REG_EXTENDED|REG_NEWLINE|REG_ICASE)) != 0) { rlen = regerror(rerr, &rq, NULL, 0); rstr = xmalloc((rlen+1)*sizeof(char)); regerror(rerr, &rq, rstr, rlen); warnx(_("Unable to compile regex '%s': %s\n"), q, rstr); if (rstr) { free(rstr); rstr = NULL; } return(EXIT_FAILURE); } /* Compile the regex for the search */ slen = strlen(r) -2 + strlen(sterm_name[options.search]) +1; s = xmalloc((slen)*sizeof(char)); plen = snprintf(s, slen, r, sterm_name[options.search]); if (plen < 0 || (size_t)plen != slen -1) { warnx(_("Unable to build regex pattern.")); return(EXIT_FAILURE); } if ((rerr = regcomp(&rs, s, REG_EXTENDED|REG_NEWLINE)) != 0) { rlen = regerror(rerr, &rs, NULL, 0); rstr = xmalloc((rlen+1)*sizeof(char)); regerror(rerr, &rs, rstr, rlen); warnx(_("Unable to compile regex '%s': %s\n"), s, rstr); if (rstr) { free(rstr); rstr = NULL; } return(EXIT_FAILURE); } if (options.verbose) { fprintf(stderr, "Regex for query term: %s\n", q); fprintf(stderr, "Regex for search term: %s\n", s); } /* Look for the query term in the original card */ rerr = regexec(&rq, &card[0], 3, match, 0); if (rerr != 0) { goto rtn; } qlen = (int)(match[2].rm_eo - match[2].rm_so); qres = xmalloc(qlen+1); memcpy(qres, card+match[2].rm_so, qlen); if (qres[qlen-1] == '\r') { qres[qlen-1] = '\0'; } else { qres[qlen] ='\0'; } /* Grab all the fields that we wanted */ rerr = regexec(&rs, card, 3, match, 0); while (rerr == 0) { /* TODO: For addresses convert ";" to "\n" */ slen = match[2].rm_eo - match[2].rm_so; if (card[match[2].rm_eo -1] == '\r') { slen -= 1; } printf("%.*s\t%s\n", (int)slen, card + match[2].rm_so, qres); card += match[0].rm_eo; rerr = regexec(&rs, card, 3, match, REG_NOTBOL); } regfree(&rq); regfree(&rs); rtn: if (qres) { free(qres); qres = NULL; } if (qt) { free(qt); qt = NULL; } return(rerr); } /** * Generate a quoted string for regex's. * * \param[in] term The search term unquoted. * \param[out] quoted The search term quoted for regex. * * \retval 0 If there were no errors. **/ int quote(const char *term, char **quoted) { int i = 0; int j = 0; int len = 0; len = strlen(term); j = len; /* find out how many extra characters we might need */ for (i = 0; i < len; ++i) { switch (term[i]) { case '(': case ')': case '+': case '-': case '.': case ' ': ++j; break; } } /* create the quoted string */ (*quoted) = xmalloc((j+1) * sizeof(char)); j = 0; for (i = 0; i < len; ++i) { switch (term[i]) { case '(': case ')': case '+': case '-': case '.': case ' ': (*quoted)[j] = '\x5c'; (*quoted)[++j] = term[i]; break; default: (*quoted)[j] = term[i]; break; } ++j; } return(EXIT_SUCCESS); } /** * \} **/ mcds-1.9/src/vcard.h000066400000000000000000000022061471443141100143500ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file vcard.h * Internal definitions for interacting with vcards. * * \ingroup vcard * \{ **/ #ifndef MCDS_VCARD_H #define MCDS_VCARD_H #ifdef __cplusplus extern "C" { #endif /** Search the vcard */ int search(const char *); /** Quote a string for regex's */ int quote(const char *, char **); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_VCARD_H */ /** * \} **/ mcds-1.9/src/xml.c000066400000000000000000000053151471443141100140500ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file xml.c * Routines to interact with XML. * * \ingroup XML * \{ **/ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include #include #include #include #include #include "gettext.h" #include "defs.h" #include "xml.h" #include "vcard.h" #include "options.h" /** Internal functions **/ static void walk_tree(xmlDocPtr, xmlNode *); /** * Parse the output of curl to get the vcards. * * \parm[in] res The query result. * * \retval 0 If there were no errors. * \retval 1 If an error was encounted. **/ int parse_xml(const char *res) { size_t len = 0; /* Length of the result */ xmlDocPtr doc = NULL; /* XML document pointer */ xmlNodePtr node = NULL; /* XML node pointer */ len = strlen(res); doc = xmlReadMemory(res, len, "noname.xml", NULL, 0); if (doc == NULL) { warnx(_("Unable to generate an xml document")); return(EXIT_FAILURE); } node = xmlDocGetRootElement(doc); if (node == NULL) { warnx(_("Unable to get the root node of the xml document")); return(EXIT_FAILURE); } walk_tree(doc, node); xmlFreeDoc(doc); xmlCleanupParser(); return(EXIT_SUCCESS); } /** * Recursively walk an xml tree, when an "address-data" node is found * call the search function on that data. * * \parm[in] doc The whole xml document. * \parm[in] node The current node to traverse from. * * \retval 0 If there were no errors. * \retval 1 If an error was encounted. **/ static void walk_tree(xmlDocPtr doc, xmlNode *node) { static const xmlChar adr[] = "address-data"; xmlChar *data = NULL; xmlNode *cur = NULL; for (cur = node; cur; cur = cur->next) { if (cur->type == XML_ELEMENT_NODE) { if (!xmlStrcmp(cur->name, adr)) { data = xmlNodeListGetString(doc, cur->xmlChildrenNode, 1); if (options.verbose) { fprintf(stderr, _("Data:\n%s\n"), data); } search((const char *)data); xmlFree(data); } } walk_tree(doc, cur->children); } return; } /** * \} **/ mcds-1.9/src/xml.h000066400000000000000000000021111471443141100140440ustar00rootroot00000000000000/* * Copyright (C) 2014 Timothy Brown * * 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 3 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, see . * */ /** * \file xml.h * Internal definitions for interacting with the XML library. * * \ingroup xml * \{ **/ #ifndef MCDS_XML_H #define MCDS_XML_H #ifdef __cplusplus extern "C" { #endif /** Parse the query result */ int parse_xml(const char *); #ifdef __cplusplus } /* extern "C" */ #endif #endif /* MCDS_XML_H */ /** * \} **/