Permalink
Browse files

Initial Commit.

This is just to make the source code easier to find. I had to dig through Google
to find it for myself.

I may hack on this in the future, but not now.
  • Loading branch information...
0 parents commit 65ca837067fc271a4c7b0aeb75442af10a027c1a @sigmavirus24 committed Sep 8, 2011
Showing with 4,422 additions and 0 deletions.
  1. +405 −0 ChangeLog
  2. +217 −0 Imakefile
  3. +217 −0 Imakefile.in
  4. +175 −0 README
  5. +102 −0 SshAskpass-1337.ad
  6. +104 −0 SshAskpass-NeXTish.ad
  7. +102 −0 SshAskpass-default.ad
  8. +102 −0 SshAskpass-green.ad
  9. +102 −0 SshAskpass-motif.ad
  10. +28 −0 TODO
  11. +290 −0 configure
  12. +81 −0 drawing.c
  13. +31 −0 drawing.h
  14. +83 −0 dynlist.c
  15. +34 −0 dynlist.h
  16. +180 −0 resources.c
  17. +34 −0 resources.h
  18. +1,551 −0 x11-ssh-askpass.c
  19. +268 −0 x11-ssh-askpass.h
  20. +316 −0 x11-ssh-askpass.man.in
405 ChangeLog
@@ -0,0 +1,405 @@
+2001-09-17 03:42 jmknoble
+
+ * Imakefile.in: Bumped version to 1.2.4.1 to correct problem with
+ autogenerated Imakefile in distribution tarball for v1.2.4.
+
+2001-09-16 18:10 jmknoble
+
+ * Imakefile.in: Bumped version to 1.2.4.
+
+2001-09-16 18:09 jmknoble
+
+ * Imakefile.in, README, SshAskpass-1337.ad, SshAskpass-NeXTish.ad,
+ SshAskpass-default.ad, SshAskpass-green.ad, SshAskpass-motif.ad,
+ configure, drawing.c, drawing.h, dynlist.c, dynlist.h, resources.c,
+ resources.h, x11-ssh-askpass.c, x11-ssh-askpass.h,
+ x11-ssh-askpass.man.in: Changed email address from
+ <jmknoble@jmknoble.cx> back to <jmknoble@pobox.com>.
+
+2001-09-16 17:51 jmknoble
+
+ * Imakefile.in: Changed 'distclean:' target to 'squeakyclean:',
+ since XFree86-4.1.0 and later have a conflicting 'distclean::'
+ target in their imake configuration.
+
+ Bumped to version 1.2.3.
+
+2001-04-02 19:17 jmknoble
+
+ * Imakefile.in: New version 1.2.2.
+
+2001-04-02 19:15 jmknoble
+
+ * Imakefile.in, configure: Added setting of $(CC) if CC is set in
+ the environment. Display compiler, cflags, and ldflags settings at
+ end of configuration. Added '--default' option to ./configure to
+ allow maintainer (me:) to generate an Imakefile containing default
+ settings for putting in the distribution tarball.
+
+2001-04-01 20:16 jmknoble
+
+ * Imakefile.in: New version 1.2.1.
+
+2001-04-01 20:16 jmknoble
+
+ * .cvsignore: Added autogenerated Imakefile to .cvsignore.
+
+2001-04-01 20:13 jmknoble
+
+ * README: Revised installation instructions for new configure
+ method.
+
+2001-04-01 20:12 jmknoble
+
+ * configure: Slightly improved instructions at end.
+
+2001-04-01 19:56 jmknoble
+
+ * configure: Oops ... wrong copyright date.
+
+2001-04-01 19:56 jmknoble
+
+ * Imakefile, Imakefile.in, configure: Added capability to detect
+ autoconf's default location for libexecdir if we're building
+ x11-ssh-askpass inside a portable-OpenSSH source tree. Requires
+ the user to run the new 'configure' script. Moved Imakefile to
+ Imakefile.in; Imakefile is now generated by configure.
+
+ configure accepts the expected options for specifying prefix,
+ libexecdir, mandir, etc. Also available are '--with-XXX' and
+ '--disable-XXX' options to select the app-defaults file to garner
+ fallback resources from, and to say whether and where to install
+ the selected app-defaults file.
+
+2001-04-01 19:21 jmknoble
+
+ * dynlist.c: Updated copyright date.
+
+2001-04-01 17:43 jmknoble
+
+ * TODO, dynlist.c: (Sigh). I give in. Modified dynlist.c to work
+ on stupid/broken systems where realloc(NULL, n) != malloc(n).
+ Thanks to Charles Levert <charles@comm.polymtl.ca> and Steve
+ VanDevender <stevev@efn.org>.
+
+2001-02-14 04:10 jmknoble
+
+ * Imakefile: New version 1.2.0.
+
+2001-02-14 04:07 jmknoble
+
+ * README, x11-ssh-askpass.c, x11-ssh-askpass.h,
+ x11-ssh-askpass.man.in: Updated copyright notices to include 2001.
+
+2001-02-14 04:06 jmknoble
+
+ * Imakefile, README: Moved default BINDIR to
+ /usr/local/libexec/openssh to conform with recent releases of
+ portable OpenSSH.
+
+2001-02-14 03:59 jmknoble
+
+ * x11-ssh-askpass.c, x11-ssh-askpass.h, x11-ssh-askpass.man.in: Now
+ x11-ssh-askpass understands newline characters ('\n') in text
+ labels (both the prompt string and the button labels). Each line
+ of text in the label is displayed on a separate line in the dialog.
+ Requested by Markus Friedl
+ <markus.friedl@informatik.uni-erlangen.de> to support
+ challenge/response authentication in OpenSSH.
+
+2001-02-14 03:49 jmknoble
+
+ * x11-ssh-askpass.c: Bugfix: "*grabServer" resource was setting
+ flag to grab pointer. Fixed. (Not surprising that no one noticed;
+ i suspect it's not very widely used).
+
+2001-02-14 03:46 jmknoble
+
+ * x11-ssh-askpass.man.in: Merged changes from matthieu@openbsd.org:
+ Use .Nm instead of @NAME@. It fixes a strange formatting error.
+
+2000-11-08 23:19 jmknoble
+
+ * Imakefile: New version 1.1.1.
+
+2000-11-08 23:19 jmknoble
+
+ * x11-ssh-askpass.c: Fixed problem where inputTimeout of '0' was
+ considered invalid due to bad octal conversion. Fixed small
+ potential memory leak.
+
+2000-11-07 06:20 jmknoble
+
+ * Imakefile: Bumped version to 1.1.0.
+
+2000-11-07 06:20 jmknoble
+
+ * TODO: Added notes about recently done stuff (that's what todo
+ lists are for, isn't it?;).
+
+2000-11-07 06:16 jmknoble
+
+ * SshAskpass-1337.ad, SshAskpass-NeXTish.ad, SshAskpass-default.ad,
+ SshAskpass-green.ad, SshAskpass-motif.ad: Added new '*inputTimeout'
+ resource, with explanatory comment.
+
+2000-11-07 06:15 jmknoble
+
+ * x11-ssh-askpass.man.in: Documented new '*inputTimeout' resource.
+
+2000-11-07 06:15 jmknoble
+
+ * x11-ssh-askpass.c: Fixed a few warnings, commented another.
+ Print message to stderr when we time out, so as not to completely
+ confuse the user.
+
+2000-11-07 05:42 jmknoble
+
+ * x11-ssh-askpass.c, x11-ssh-askpass.h: Did stuff to handle timing
+ out if no input received. In particular, this required changing
+ XNextEvent() in main application loop to XtAppNextEvent(). May
+ make this larger and more cumbersome....
+
+ Also did stuff to make the button labels shift down and to the
+ right when pressed if they're drawn with 3D shading/highlighting,
+ so that they actually *look* pressed.
+
+ Finally, added code to handle MotionNotify events, so that buttons
+ don't continue to look pressed if the pointer button is pressed,
+ but the pointer is outside the button. Wheeeee! Now we have an
+ actual user interface!
+
+2000-11-07 05:23 jmknoble
+
+ * SshAskpass-1337.ad, SshAskpass-NeXTish.ad, SshAskpass-default.ad,
+ SshAskpass-green.ad, SshAskpass-motif.ad: Converted colors from
+ old-style "#rrggbb" to new-style "rgb:rr/gg/bb". Corrected typo in
+ perspicacious commentary.
+
+2000-10-30 05:28 jmknoble
+
+ * Imakefile: Bumped version to 1.0.3.
+
+2000-10-30 05:28 jmknoble
+
+ * SshAskpass-1337.ad, SshAskpass-NeXTish.ad, SshAskpass-default.ad,
+ SshAskpass-green.ad, SshAskpass-motif.ad: Added resources used for
+ pseudo-resolution-independence, along with default values and long,
+ drawn out, but mildly fulfilling explanation.
+
+2000-10-30 05:27 jmknoble
+
+ * x11-ssh-askpass.man.in: Documented the new resources for
+ pseudo-resolution-independence (defaultXResolution,
+ defaultYResolution, xResolutionFuzz, and yResolutionFuzz).
+
+2000-10-30 05:25 jmknoble
+
+ * x11-ssh-askpass.c, x11-ssh-askpass.h: Added a small amount of
+ resolution-independence to the dialog widgets. Now we detect the
+ actual X and Y resolution the server is running at; and if they're
+ significantly different from the ones our resource settings expect,
+ then we stretch or shrink buttons, indicators, and spacing to fit
+ the actual resolution. Sometimes X11 really makes my stomach
+ hurt....
+
+2000-09-24 00:51 jmknoble
+
+ * Imakefile: New version 1.0.2.
+
+2000-09-24 00:43 jmknoble
+
+ * x11-ssh-askpass.c, x11-ssh-askpass.h: Added process ID to
+ diagnostic/error messages on stderr (helps when more than one
+ ssh-askpass is started, e.g., with a shortcut key and keyboard
+ repeat).
+
+ Modified keyboard and pointer grabbing so that, if we don't get the
+ keyboard or pointer the first time, we print a helpful message,
+ sleep, and then retry. If we time out without successfully getting
+ the keyboard or pointer, then we fail as before.
+
+ Combined the logic for grabKeyboard() and grabPointer() into a
+ common function performGrab(). This makes it easier to ensure that
+ the grab/sleep logic is correct in both places.
+
+ Fixed, worked around or commented on a few warnings emitted by 'gcc
+ -Wall -W -ansi -pedantic'.
+
+2000-09-24 00:32 jmknoble
+
+ * resources.c: Removed unused declaration of get_time_resource.
+
+2000-08-28 03:35 jmknoble
+
+ * Imakefile, TODO: Added TODO file for listing potential future
+ projects within x11-ssh-askpass.
+
+2000-08-28 03:35 jmknoble
+
+ * README: Added 'make install.man' to installation instructions.
+ Formulated better wording for reference to (now ancient) Perl/Tk
+ ssh-askpass.
+
+2000-08-28 03:26 jmknoble
+
+ * Imakefile, x11-ssh-askpass.man.in: Added facilities to Imakefile
+ and man page to automatically insert name, date, and version into
+ man page. Changed install target to include man page. Rearranged
+ clean and dist targets slightly. Ready for release.
+
+2000-08-28 02:54 jmknoble
+
+ * x11-ssh-askpass.man.in: Added corrections and clarifications:
+ Mentioned optional label on command line; noted which toolkit
+ options are unsupported; and added extra indicator-specific
+ resources.
+
+2000-08-28 02:00 jmknoble
+
+ * x11-ssh-askpass.c: Moved saving of argc/argv to after call to
+ XtAppInitialize(), so that toolkit arguments get properly removed
+ from the argument list.
+
+2000-08-28 01:43 jmknoble
+
+ * x11-ssh-askpass.man.in: Changed author email address from
+ pobox.com to jmknoble.cx. Added 2000 to copyright date.
+
+2000-08-28 01:42 jmknoble
+
+ * x11-ssh-askpass.man.in: Added man page for x11-ssh-askpass from
+ Matthieu Herrb <matthieu@laas.fr> of OpenBSD.
+
+2000-08-28 01:31 jmknoble
+
+ * README, SshAskpass-1337.ad, SshAskpass-NeXTish.ad,
+ SshAskpass-default.ad, SshAskpass-green.ad, SshAskpass-motif.ad,
+ dynlist.c, dynlist.h, x11-ssh-askpass.c, x11-ssh-askpass.h: Changed
+ ISO-8859-1 copyright character '�' to ASCII '(C)'.
+
+2000-08-28 01:27 jmknoble
+
+ * README, SshAskpass-1337.ad, SshAskpass-NeXTish.ad,
+ SshAskpass-default.ad, SshAskpass-green.ad, SshAskpass-motif.ad,
+ drawing.c, drawing.h, dynlist.c, dynlist.h, resources.c,
+ resources.h, x11-ssh-askpass.c, x11-ssh-askpass.h: Changed author
+ email address from pobox.com to jmknoble.cx. Added 2000 to
+ copyright date.
+
+2000-08-28 01:19 jmknoble
+
+ * x11-ssh-askpass.c: Oops. When the keyboard or pointer grab
+ failed, the fprintf() calls to print the error message were missing
+ the 'reason' argument. Thanks to Daniel Packman
+ <pack@mop2.eos.ucar.edu>.
+
+2000-08-28 01:17 jmknoble
+
+ * Imakefile: Portability enhancements to Imakefile, suggested by
+ Charles Levert <charles@comm.polymtl.ca>. Use imake's '...Cmd'
+ macros where available; otherwise, use less-nonportable commands.
+
+ Bumped version to 1.0.1.
+
+2000-01-07 04:53 jmknoble
+
+ * README: Added note about location of x11-ssh-askpass.
+
+2000-01-07 04:52 jmknoble
+
+ * Imakefile: Now we install the actual program as
+ `x11-ssh-askpass', and make a symlink to that from `ssh-askpass'.
+ This allows for multiple passphrase dialogs on a system.
+
+ Bumped version to 1.0.
+
+1999-12-24 01:59 jmknoble
+
+ * Imakefile: Oops. Version backed out to 0.99; missing spec file
+ for building RPMs.
+
+1999-12-24 01:05 jmknoble
+
+ * Imakefile: Updated version to 1.0. Removed reference to utils.h.
+ Prefer install targets available in X11R6.
+
+1999-12-24 01:00 jmknoble
+
+ * README: Updated install directory. Removed reference to utils.h.
+
+1999-12-24 00:58 jmknoble
+
+ * resources.c, resources.h: Moved header includes from utils.h into
+ resources.c. Trimmed unused functions.
+
+1999-12-24 00:56 jmknoble
+
+ * dynlist.c: Removed potential memory leak (and ensuing loss of
+ buffer contents) if realloc() failed.
+
+1999-12-24 00:53 jmknoble
+
+ * utils.h: Moved header includes from here into resources.c.
+
+1999-12-04 23:21 jmknoble
+
+ * Imakefile: Added patch from Markus Friedl to change use of awk
+ (with GNU-specific extensions?) to sed, more likely to be available
+ on various platforms.
+
+1999-11-23 05:16 jmknoble
+
+ * .cvsignore: Added ChangeLog to .cvsignore.
+
+1999-11-23 05:14 jmknoble
+
+ * Imakefile: Added facility for autogenerating ChangeLog using
+ cvs2cl.
+
+1999-11-23 04:57 jmknoble
+
+ * .cvsignore, README, README.x11-ssh-askpass:
+ README.x11-ssh-askpass moved to README. Shorter.
+
+1999-11-23 04:55 jmknoble
+
+ * .cvsignore: Added .cvsignore file.
+
+1999-11-23 04:53 jmknoble
+
+ * Imakefile, SshAskpass-1337.ad, SshAskpass-NeXTish.ad,
+ SshAskpass-default.ad, SshAskpass-green.ad, SshAskpass-motif.ad,
+ x11-ssh-askpass.c, x11-ssh-askpass.h: - Added version to tarball.
+ - *grab(Keyboard|Pointer|Server) resources had inverted values in
+ app-defaults files. - Futzed with spacing in default and NeXTish
+ themes. - Added setrlimit() call to main() to avoid core dumps.
+
+1999-11-23 04:50 jmknoble
+
+ * Imakefile, SshAskpass-1337.ad, SshAskpass-NeXTish.ad,
+ SshAskpass-default.ad, SshAskpass-green.ad, SshAskpass-motif.ad,
+ resources.c, resources.h, x11-ssh-askpass.c, x11-ssh-askpass.h: -
+ Can optionally grab server (*grabServer resource, off by default).
+ - get_pixel_resource(), get_integer_resource() now take default
+ value. - Added minimum/maximum indicator count. - memset()
+ passphrase to 0s before freeing. - Use fputs() instead of printf()
+ to avoid possibility of passphrase getting stored in dynamic
+ memory by stdio.
+
+1999-11-23 04:43 jmknoble
+
+ * Imakefile, README.x11-ssh-askpass, SshAskpass-1337.ad,
+ SshAskpass-NeXTish.ad, SshAskpass-default.ad, SshAskpass-green.ad,
+ SshAskpass-motif.ad, drawing.c, drawing.h, dynlist.c, dynlist.h,
+ resources.c, resources.h, utils.h, x11-ssh-askpass.c,
+ x11-ssh-askpass.h: Initial revision
+
+1999-11-23 04:43 jmknoble
+
+ * Imakefile, README.x11-ssh-askpass, SshAskpass-1337.ad,
+ SshAskpass-NeXTish.ad, SshAskpass-default.ad, SshAskpass-green.ad,
+ SshAskpass-motif.ad, drawing.c, drawing.h, dynlist.c, dynlist.h,
+ resources.c, resources.h, utils.h, x11-ssh-askpass.c,
+ x11-ssh-askpass.h: Begin CVS revision control
+
217 Imakefile
@@ -0,0 +1,217 @@
+XCOMM Imakefile: How to build x11-ssh-askpass, using xmkmf and then make
+XCOMM
+XCOMM by Jim Knoble <jmknoble@pobox.com>
+XCOMM Copyright (C) 1999,2000,2001 Jim Knoble
+XCOMM
+XCOMM Disclaimer:
+XCOMM
+XCOMM This software is provided "as is", without warranty of any kind,
+XCOMM express or implied, including but not limited to the warranties of
+XCOMM merchantability, fitness for a particular purpose and
+XCOMM noninfringement. In no event shall the author(s) be liable for any
+XCOMM claim, damages or other liability, whether in an action of
+XCOMM contract, tort or otherwise, arising from, out of or in connection
+XCOMM with the software or the use or other dealings in the software.
+XCOMM
+XCOMM Permission to use, copy, modify, distribute, and sell this software
+XCOMM and its documentation for any purpose is hereby granted without
+XCOMM fee, provided that the above copyright notice appear in all copies
+XCOMM and that both that copyright notice and this permission notice
+XCOMM appear in supporting documentation.
+
+NAME = x11-ssh-askpass
+CLASS = SshAskpass
+
+XCOMM -------- configurable settings --------
+BINDIR = /usr/local/libexec
+MANPATH = /usr/local/man
+MANDIR = $(MANPATH)/man1
+APPDEFDIR = $(XAPPLOADDIR)
+APP_DEFAULTS = SshAskpass-default.ad
+
+XCOMM CC =
+XCOMM CDEBUGFLAGS =
+XCOMM LOCAL_LDFLAGS =
+XCOMM -------- end configurable settings --------
+
+#ifndef CpCmd
+# define CpCmd cp
+#endif
+
+#ifndef GzipCmd
+# define GzipCmd gzip
+#endif
+
+#ifndef LnCmd
+# if HasSymLinks
+# define LnCmd ln -s
+# else
+# define LnCmd ln
+# endif
+#endif
+
+#ifndef MvCmd
+# define MvCmd mv -f
+#endif
+
+#ifndef RmCmd
+# define RmCmd rm -f
+#endif
+
+CAT = cat
+CHMOD = chmod
+CP = CpCmd
+GREP = grep
+GZIP = GzipCmd
+LN = LnCmd
+MKDIR = MkdirHierCmd
+MV = MvCmd
+RM = RmCmd
+SED = sed
+TAR = tar
+
+MAKE_CHANGELOG = cvs2cl
+
+VERSION = 1.2.4.1
+DATE = September 17, 2001
+PROJECT = $(NAME)-$(VERSION)
+DIST_DIR = $(PROJECT)
+DIST = $(PROJECT).tar.gz
+
+HDRS = \@@\
+ drawing.h \@@\
+ dynlist.h \@@\
+ resources.h \@@\
+ x11-ssh-askpass.h
+
+SRCS = \@@\
+ drawing.c \@@\
+ dynlist.c \@@\
+ resources.c \@@\
+ x11-ssh-askpass.c
+
+OBJS = \@@\
+ drawing.o \@@\
+ dynlist.o \@@\
+ resources.o \@@\
+ x11-ssh-askpass.o
+
+MAN_OBJ = $(NAME).man
+MAN_SRC = $(MAN_OBJ).in
+MANS = $(MAN_SRC)
+
+CHANGELOG = ChangeLog
+
+CONFIGURE = configure
+
+IMAKEFILE_OBJ = Imakefile
+IMAKEFILE_SRC = $(IMAKEFILE_OBJ).in
+IMAKEFILES = $(IMAKEFILE_SRC)
+
+DOCS = \@@\
+ README \@@\
+ TODO
+
+APP_DEFAULTS_FILES = \@@\
+ $(CLASS)-1337.ad \@@\
+ $(CLASS)-NeXTish.ad \@@\
+ $(CLASS)-green.ad \@@\
+ $(CLASS)-motif.ad \@@\
+ $(CLASS)-default.ad \@@\
+
+DIST_FILES = \@@\
+ $(IMAKEFILES) \@@\
+ $(CONFIGURE) \@@\
+ $(DOCS) \@@\
+ $(APP_DEFAULTS_FILES) \@@\
+ $(MANS) \@@\
+ $(SRCS) \@@\
+ $(HDRS)
+
+DIST_EXTRAS = \@@\
+ $(CHANGELOG) \@@\
+ $(IMAKEFILE_OBJ)
+
+LOCAL_LIBRARIES = -lXt -lX11 -lSM -lICE
+
+ComplexProgramTarget($(NAME))
+
+install:: install-app-defaults
+
+install-app-defaults: $(CLASS).ad
+ @if [ -d $(DESTDIR)$(APPDEFDIR) ]; then set +x; \@@\
+ else (set -x; $(MKDIRHIER) $(DESTDIR)$(APPDEFDIR)); fi
+ $(INSTALL) $(INSTALLFLAGS) $(INSTAPPFLAGS) $(CLASS).ad \@@\
+ $(DESTDIR)$(APPDEFDIR)/$(CLASS)
+
+install::
+ @set -x; \@@\
+ if [ -f $(DESTDIR)$(BINDIR)/ssh-askpass ]; then \@@\
+ $(MV) $(DESTDIR)$(BINDIR)/ssh-askpass \@@\
+ $(DESTDIR)$(BINDIR)/ssh-askpass.old; \@@\
+ fi
+ $(LN) $(NAME) $(DESTDIR)$(BINDIR)/ssh-askpass
+
+install.man::
+ @set -x; \@@\
+ if [ -f $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX) ]; then \@@\
+ $(MV) $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX) \@@\
+ $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX).old; \@@\
+ fi
+ $(LN) $(NAME).$(MANSUFFIX) $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX)
+
+.PHONY: depends changelog realclean squeakyclean spotless tar dist
+
+all:: $(MAN_OBJ)
+
+$(MAN_OBJ): $(MAN_SRC) $(IMAKEFILE_SRC)
+ $(SED) \@@\
+ -e 's#@NAME@#$(NAME)#g' \@@\
+ -e 's#@VERSION@#$(VERSION)#g' \@@\
+ -e 's#@DATE@#$(DATE)#g' \@@\
+ <$(MAN_SRC) >$@.tmp
+ $(MV) $@.tmp $@
+
+depends: depend
+
+includes:: $(CLASS)_ad.h
+
+$(CLASS).ad:
+ $(LN) $(APP_DEFAULTS) $(CLASS).ad
+
+$(CLASS)_ad.h: $(CLASS).ad
+ $(SED) -n '/^[^!]/s/.*/"&",/p' <$(CLASS).ad >$@.tmp
+ $(MV) $@.tmp $@
+
+changelog: $(CHANGELOG)
+$(CHANGELOG): $(DIST_FILES)
+ $(MAKE_CHANGELOG)
+
+$(IMAKEFILE_OBJ): $(IMAKEFILE_SRC)
+ ./$(CONFIGURE) --defaults
+
+clean::
+ -$(RM) $(CLASS)_ad.h $(MAN_OBJ)
+
+realclean: clean
+ -$(RM) $(CLASS).ad
+ -$(RM) *.LOG *.log
+
+squeakyclean: realclean
+ -$(RM) Makefile Makefile.bak $(IMAKEFILE_OBJ) $(CHANGELOG)
+
+spotless: squeakyclean
+ -$(RM) $(DIST)
+
+tar: dist
+dist: $(DIST)
+$(DIST): $(DIST_EXTRAS) $(DIST_FILES)
+ -$(RM) -r $(DIST_DIR)
+ -$(RM) $@.tmp
+ $(MKDIR) $(DIST_DIR)
+ $(CP) $(DIST_EXTRAS) $(DIST_FILES) $(DIST_DIR)/
+ $(CHMOD) -R u+rwX,go+rX,go-w $(DIST_DIR)
+ $(TAR) -cvf - $(DIST_DIR) |$(GZIP) -9 -c >$@.tmp
+ $(MV) $@.tmp $@
+ -$(RM) -r $(DIST_DIR)
+
217 Imakefile.in
@@ -0,0 +1,217 @@
+XCOMM Imakefile: How to build x11-ssh-askpass, using xmkmf and then make
+XCOMM
+XCOMM by Jim Knoble <jmknoble@pobox.com>
+XCOMM Copyright (C) 1999,2000,2001 Jim Knoble
+XCOMM
+XCOMM Disclaimer:
+XCOMM
+XCOMM This software is provided "as is", without warranty of any kind,
+XCOMM express or implied, including but not limited to the warranties of
+XCOMM merchantability, fitness for a particular purpose and
+XCOMM noninfringement. In no event shall the author(s) be liable for any
+XCOMM claim, damages or other liability, whether in an action of
+XCOMM contract, tort or otherwise, arising from, out of or in connection
+XCOMM with the software or the use or other dealings in the software.
+XCOMM
+XCOMM Permission to use, copy, modify, distribute, and sell this software
+XCOMM and its documentation for any purpose is hereby granted without
+XCOMM fee, provided that the above copyright notice appear in all copies
+XCOMM and that both that copyright notice and this permission notice
+XCOMM appear in supporting documentation.
+
+NAME = x11-ssh-askpass
+CLASS = SshAskpass
+
+XCOMM -------- configurable settings --------
+BINDIR = /usr/local/libexec
+MANPATH = /usr/local/man
+MANDIR = $(MANPATH)/man1
+APPDEFDIR = $(XAPPLOADDIR)
+APP_DEFAULTS = $(CLASS)-default.ad
+
+XCOMM CC =
+XCOMM CDEBUGFLAGS =
+XCOMM LOCAL_LDFLAGS =
+XCOMM -------- end configurable settings --------
+
+#ifndef CpCmd
+# define CpCmd cp
+#endif
+
+#ifndef GzipCmd
+# define GzipCmd gzip
+#endif
+
+#ifndef LnCmd
+# if HasSymLinks
+# define LnCmd ln -s
+# else
+# define LnCmd ln
+# endif
+#endif
+
+#ifndef MvCmd
+# define MvCmd mv -f
+#endif
+
+#ifndef RmCmd
+# define RmCmd rm -f
+#endif
+
+CAT = cat
+CHMOD = chmod
+CP = CpCmd
+GREP = grep
+GZIP = GzipCmd
+LN = LnCmd
+MKDIR = MkdirHierCmd
+MV = MvCmd
+RM = RmCmd
+SED = sed
+TAR = tar
+
+MAKE_CHANGELOG = cvs2cl
+
+VERSION = 1.2.4.1
+DATE = September 17, 2001
+PROJECT = $(NAME)-$(VERSION)
+DIST_DIR = $(PROJECT)
+DIST = $(PROJECT).tar.gz
+
+HDRS = \@@\
+ drawing.h \@@\
+ dynlist.h \@@\
+ resources.h \@@\
+ x11-ssh-askpass.h
+
+SRCS = \@@\
+ drawing.c \@@\
+ dynlist.c \@@\
+ resources.c \@@\
+ x11-ssh-askpass.c
+
+OBJS = \@@\
+ drawing.o \@@\
+ dynlist.o \@@\
+ resources.o \@@\
+ x11-ssh-askpass.o
+
+MAN_OBJ = $(NAME).man
+MAN_SRC = $(MAN_OBJ).in
+MANS = $(MAN_SRC)
+
+CHANGELOG = ChangeLog
+
+CONFIGURE = configure
+
+IMAKEFILE_OBJ = Imakefile
+IMAKEFILE_SRC = $(IMAKEFILE_OBJ).in
+IMAKEFILES = $(IMAKEFILE_SRC)
+
+DOCS = \@@\
+ README \@@\
+ TODO
+
+APP_DEFAULTS_FILES = \@@\
+ $(CLASS)-1337.ad \@@\
+ $(CLASS)-NeXTish.ad \@@\
+ $(CLASS)-green.ad \@@\
+ $(CLASS)-motif.ad \@@\
+ $(CLASS)-default.ad \@@\
+
+DIST_FILES = \@@\
+ $(IMAKEFILES) \@@\
+ $(CONFIGURE) \@@\
+ $(DOCS) \@@\
+ $(APP_DEFAULTS_FILES) \@@\
+ $(MANS) \@@\
+ $(SRCS) \@@\
+ $(HDRS)
+
+DIST_EXTRAS = \@@\
+ $(CHANGELOG) \@@\
+ $(IMAKEFILE_OBJ)
+
+LOCAL_LIBRARIES = -lXt -lX11 -lSM -lICE
+
+ComplexProgramTarget($(NAME))
+
+install:: install-app-defaults
+
+install-app-defaults: $(CLASS).ad
+ @if [ -d $(DESTDIR)$(APPDEFDIR) ]; then set +x; \@@\
+ else (set -x; $(MKDIRHIER) $(DESTDIR)$(APPDEFDIR)); fi
+ $(INSTALL) $(INSTALLFLAGS) $(INSTAPPFLAGS) $(CLASS).ad \@@\
+ $(DESTDIR)$(APPDEFDIR)/$(CLASS)
+
+install::
+ @set -x; \@@\
+ if [ -f $(DESTDIR)$(BINDIR)/ssh-askpass ]; then \@@\
+ $(MV) $(DESTDIR)$(BINDIR)/ssh-askpass \@@\
+ $(DESTDIR)$(BINDIR)/ssh-askpass.old; \@@\
+ fi
+ $(LN) $(NAME) $(DESTDIR)$(BINDIR)/ssh-askpass
+
+install.man::
+ @set -x; \@@\
+ if [ -f $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX) ]; then \@@\
+ $(MV) $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX) \@@\
+ $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX).old; \@@\
+ fi
+ $(LN) $(NAME).$(MANSUFFIX) $(DESTDIR)$(MANDIR)/ssh-askpass.$(MANSUFFIX)
+
+.PHONY: depends changelog realclean squeakyclean spotless tar dist
+
+all:: $(MAN_OBJ)
+
+$(MAN_OBJ): $(MAN_SRC) $(IMAKEFILE_SRC)
+ $(SED) \@@\
+ -e 's#@NAME@#$(NAME)#g' \@@\
+ -e 's#@VERSION@#$(VERSION)#g' \@@\
+ -e 's#@DATE@#$(DATE)#g' \@@\
+ <$(MAN_SRC) >$@.tmp
+ $(MV) $@.tmp $@
+
+depends: depend
+
+includes:: $(CLASS)_ad.h
+
+$(CLASS).ad:
+ $(LN) $(APP_DEFAULTS) $(CLASS).ad
+
+$(CLASS)_ad.h: $(CLASS).ad
+ $(SED) -n '/^[^!]/s/.*/"&",/p' <$(CLASS).ad >$@.tmp
+ $(MV) $@.tmp $@
+
+changelog: $(CHANGELOG)
+$(CHANGELOG): $(DIST_FILES)
+ $(MAKE_CHANGELOG)
+
+$(IMAKEFILE_OBJ): $(IMAKEFILE_SRC)
+ ./$(CONFIGURE) --defaults
+
+clean::
+ -$(RM) $(CLASS)_ad.h $(MAN_OBJ)
+
+realclean: clean
+ -$(RM) $(CLASS).ad
+ -$(RM) *.LOG *.log
+
+squeakyclean: realclean
+ -$(RM) Makefile Makefile.bak $(IMAKEFILE_OBJ) $(CHANGELOG)
+
+spotless: squeakyclean
+ -$(RM) $(DIST)
+
+tar: dist
+dist: $(DIST)
+$(DIST): $(DIST_EXTRAS) $(DIST_FILES)
+ -$(RM) -r $(DIST_DIR)
+ -$(RM) $@.tmp
+ $(MKDIR) $(DIST_DIR)
+ $(CP) $(DIST_EXTRAS) $(DIST_FILES) $(DIST_DIR)/
+ $(CHMOD) -R u+rwX,go+rX,go-w $(DIST_DIR)
+ $(TAR) -cvf - $(DIST_DIR) |$(GZIP) -9 -c >$@.tmp
+ $(MV) $@.tmp $@
+ -$(RM) -r $(DIST_DIR)
+
175 README
@@ -0,0 +1,175 @@
+# README: Notes about X11-based passphrase dialog for OpenSSH
+# created 1999-Nov-21 jmk
+# autodate: 2001-Sep-16 18:07
+
++-------------+
+| Description |
++-------------+
+
+This is an X11-based passphrase dialog for use with OpenSSH. It is
+intended to replace the Perl/Tk-based ssh-askpass dialog and
+GNOME-based ssh-askpass dialog which formerly accompanied OpenSSH-1.2.
+These dialogs are intended to be called from the ssh-add program and
+not invoked directly.
+
+The features of x11-ssh-askpass are as follows:
+
+ - Configurable via the standard X resource mechanism
+ (/usr/lib/X11/app-defaults, ~/.Xdefaults, xrdb, etc.).
+
+ - Requires only stock X11 libraries (libXt, libX11, libSM, libICE).
+
+ - Can be configured to grab the keyboard and/or pointer (grabs the
+ keyboard by default, not the pointer).
+
+The user interface is somewhat different than most password/passphrase
+dialogs and more similar to the X11-based passphrase dialog that
+accompanies the regular SSH distribution. Instead of a text field that
+fills with asterisks or some other character as the user enters the
+passphrase, a series of LED-like areas light up one-by-one with each
+passphrase character entered, beginning from the lefthand edge of the
+dialog. When they reach the righthand edge, they go dark one-by-one
+again, and so on. This gives the user feedback that passphrase
+characters have been entered, but does not provide onlookers with a cue
+as to the length of the passphrase.
+
+Pressing the `OK' button accepts the passphrase (even if it is empty),
+which is printed on the standard output, and the dialog exits with a
+status of zero (success). Pressing the `Cancel' button discards the
+passphrase, and the dialog exits with non-zero status.
+
+The following keystrokes work as expected:
+
+ [Backspace] or [Delete] Erase previous character
+ [Control+U] or [Control+X] Erase entire passphrase
+ [Enter], [Control+M], or [Control+J] Accept passphrase (OK)
+ [Escape] Discard passphrase (Cancel)
+
++------------+
+| Installing |
++------------+
+
+Beginning with version 1.2.1, x11-ssh-askpass provides a 'configure'
+script to set locations to install files, etc. It's relatively
+straightforward; use './configure --help' for a full list of options.
+Most folks will probably want the default settings:
+
+ ./configure
+
+After configuring, use xmkmf and make to build and install
+x11-ssh-askpass, as follows:
+
+ xmkmf
+ make includes
+ make
+ make install
+ make install.man
+
+x11-ssh-askpass installs by default in /usr/local/libexec/; its manual
+page installs in /usr/local/man/man1/. To install them it somewhere
+else (for example, x11-ssh-askpass in /usr/libexec/openssh/ and the
+manual page in /usr/X11R6/man/man1/), use:
+
+ ./configure --libexecdir=/usr/libexec/openssh --mandir=/usr/X11R6/man/
+ xmkmf
+ make includes
+ [etc.]
+
+Several different app-defaults files accompany x11-ssh-askpass:
+
+ SshAskpass-1337.ad - small, dark, and gray
+ SshAskpass-NeXTish.ad - a look mildly similar to that of NEXTstep
+ SshAskpass-default.ad - the default look
+ SshAskpass-green.ad - somewhat green
+ SshAskpass-motif.ad - a bit like the look of the Motif toolkit
+
+You can select an app-defaults file other than the default; for
+example:
+
+ ./configure --with-app-defaults=SshAskpass-green.ad
+
+The app-defaults file installs into wherever your X11 configuration
+prefers app-defaults files to be (usually something like
+/usr/lib/X11/app-defaults/). To install the app-defaults file
+somewhere else (for example, /usr/local/lib/X11/app-defaults/), use:
+
+ ./configure --with-app-defaults-dir=/usr/local/lib/X11/app-defaults
+
+You can also decide not to install any app-defaults file:
+
+ ./configure --disable-installing-app-defaults
+
++-----------------+
+| Where To Get It |
++-----------------+
+
+x11-ssh-askpass is available at:
+
+ http://www.pobox.com/~jmknoble/software/x11-ssh-askpass/
+
++--------------------------+
+| Copyright, License, Etc. |
++--------------------------+
+
+Some portions of x11-ssh-askpass are derived directly or indirectly
+from portions of xscreensaver by Jamie Zawinski <jwz@jwz.org>, while
+others are original works.
+
+The contents of the following files is taken directly, in whole or in
+part, from xscreensaver:
+
+ drawing.c
+ drawing.h
+ resources.c
+ resources.h
+
+The contents of the following files contains a limited amount of code
+(less than approximately 25%) which is derived from portions of
+xscreensaver:
+
+ x11-ssh-askpass.c
+
+The remainder of the code is an original work, including the following
+files:
+
+ dynlist.c
+ dynlist.h
+ x11-ssh-askpass.h
+ *.ad
+
+The portions derived from xscreensaver require the following notice:
+
+ xscreensaver, Copyright (c) 1991-1999 Jamie Zawinski <jwz@jwz.org>
+
+ Permission to use, copy, modify, distribute, and sell this software
+ and its documentation for any purpose is hereby granted without fee,
+ provided that the above copyright notice appear in all copies and
+ that both that copyright notice and this permission notice appear in
+ supporting documentation. No representations are made about the
+ suitability of this software for any purpose. It is provided "as is"
+ without express or implied warranty.
+
+The remaining portions fall under the following copyright and license:
+
+ by Jim Knoble <jmknoble@pobox.com>
+ Copyright (C) 1999,2000,2001 Jim Knoble
+
+ Permission to use, copy, modify, distribute, and sell this software
+ and its documentation for any purpose is hereby granted without fee,
+ provided that the above copyright notice appear in all copies and
+ that both that copyright notice and this permission notice appear in
+ supporting documentation.
+
++------------+
+| Disclaimer |
++------------+
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ express or implied, including but not limited to the warranties of
+ merchantability, fitness for a particular purpose and
+ noninfringement. In no event shall the author(s) be liable for any
+ claim, damages or other liability, whether in an action of contract,
+ tort or otherwise, arising from, out of or in connection with the
+ software or the use or other dealings in the software.
+
+-------- End of file --------
102 SshAskpass-1337.ad
@@ -0,0 +1,102 @@
+! SshAskpass.ad: Default resources for the X11-based ssh-askpass for OpenSSH
+! created 1999-Nov-17 03:40 Jim Knoble <jmknoble@pobox.com>
+! autodate: 2001-Sep-16 18:07
+!
+! by Jim Knoble <jmknoble@pobox.com>
+! Copyright (C) 1999,2000 Jim Knoble
+!
+! Disclaimer:
+!
+! The software is provided "as is", without warranty of any kind,
+! express or implied, including but not limited to the warranties of
+! merchantability, fitness for a particular purpose and
+! noninfringement. In no event shall the author(s) be liable for any
+! claim, damages or other liability, whether in an action of
+! contract, tort or otherwise, arising from, out of or in connection
+! with the software or the use or other dealings in the software.
+!
+! Permission to use, copy, modify, distribute, and sell this software
+! and its documentation for any purpose is hereby granted without
+! fee, provided that the above copyright notice appear in all copies
+! and that both that copyright notice and this permission notice
+! appear in supporting documentation.
+!
+
+! +-------------+
+! | e133t theme |
+! +-------------+
+
+*Dialog.font: -b&h-lucida-medium-r-normal-*-*-100-*-*-*-*-iso8859-1
+*?.foreground: rgb:d0/d0/d0
+*?.background: rgb:50/50/50
+*topShadowColor: rgb:90/90/90
+*bottomShadowColor: rgb:00/00/00
+*borderColor: rgb:a0/a0/a0
+*shadowThickness: 2
+*borderWidth: 1
+*horizontalSpacing: 5
+*verticalSpacing: 5
+
+*Button.font: -b&h-lucida-medium-r-normal-*-*-100-*-*-*-*-iso8859-1
+*Button.shadowThickness: 1
+*Button.borderWidth: 0
+*Button.horizontalSpacing: 4
+*Button.verticalSpacing: 2
+
+*Indicator.foreground: rgb:70/80/90
+*Indicator.background: rgb:50/50/50
+*Indicator.shadowThickness: 1
+*Indicator.borderWidth: 0
+*Indicator.height: 4
+*Indicator.width: 13
+*Indicator.horizontalSpacing: 4
+*Indicator.verticalSpacing: 5
+*Indicator.minimumCount: 8
+*Indicator.maximumCount: 24
+
+! X11 does a miserable job of providing resolution-independent drawing
+! facilities---it expects everything to be done in pixels. So if you
+! happen to run your X server at a resolution of 100 pixels per inch
+! (or some other strange value) instead of the widely used default of
+! 75, x11-ssh-askpass looks might tiny. [Sigh].
+!
+! To get around this, umm, limitation, we declare the resolution that
+! the spacing and width/height pixels values are "valid" for, along
+! with a fuzz factor. If the current actual resolution is outside of
+! the range of <DEFAULT - FUZZ>..<DEFAULT + FUZZ>, then we scale pixel
+! measurements to fit the actual resolution.
+!
+! (And if you think *this* is a horrid hack, then take a look at the
+! actual code, which has to deal with conversion to [cheesy fanfare]
+! that's right---millimeters!!! The right hand managed to slip that
+! one in while the left hand was adding a '-dpi' switch to the sample
+! server implementation. I think both left feet were adding the
+! RESOLUTION_X and RESOLUTION_Y fields [in dots per inch, naturally]
+! to the X Logical Font Description. The irony is underwhelming.)
+
+*defaultXResolution: 75/in
+*defaultYResolution: 75/in
+*xResolutionFuzz: 20/in
+*yResolutionFuzz: 20/in
+
+! Number of seconds to wait for a key- or button-press
+! before giving up. '0' means wait forever.
+*inputTimeout: 0
+
+! Ssh-askpass grabs the keyboard by default.
+! To stop it from grabbing the keyboard, use:
+!*grabKeyboard: false
+
+! Ssh-askpass does not grab the pointer by default.
+! To make it grab the pointer, use:
+!*grabPointer: true
+
+! Ssh-askpass does not grab the server by default.
+! To make it grab the server, use:
+!*grabServer: true
+
+*Dialog.title: OpenSSH Authentication Passphrase Request
+*Dialog.label: Please enter your authentication passphrase:
+*okButton.label: OK
+*cancelButton.label: Cancel
+
104 SshAskpass-NeXTish.ad
@@ -0,0 +1,104 @@
+! SshAskpass.ad: Default resources for the X11-based ssh-askpass for OpenSSH
+! created 1999-Nov-17 03:40 Jim Knoble <jmknoble@pobox.com>
+! autodate: 2001-Sep-16 18:08
+!
+! by Jim Knoble <jmknoble@pobox.com>
+! Copyright (C) 1999,2000 Jim Knoble
+!
+! Disclaimer:
+!
+! The software is provided "as is", without warranty of any kind,
+! express or implied, including but not limited to the warranties of
+! merchantability, fitness for a particular purpose and
+! noninfringement. In no event shall the author(s) be liable for any
+! claim, damages or other liability, whether in an action of
+! contract, tort or otherwise, arising from, out of or in connection
+! with the software or the use or other dealings in the software.
+!
+! Permission to use, copy, modify, distribute, and sell this software
+! and its documentation for any purpose is hereby granted without
+! fee, provided that the above copyright notice appear in all copies
+! and that both that copyright notice and this permission notice
+! appear in supporting documentation.
+!
+
+! +--------------------+
+! | NEXTstep-ish theme |
+! +--------------------+
+
+*Dialog.font: -adobe-helvetica-medium-r-normal-*-*-120-*-*-*-*-iso8859-1
+*?.foreground: rgb:00/00/00
+*?.background: rgb:a8/a8/a8
+*topShadowColor: rgb:ff/ff/ff
+*bottomShadowColor: rgb:54/54/54
+*borderColor: rgb:20/20/20
+*shadowThickness: 0
+*borderWidth: 1
+*horizontalSpacing: 8
+*verticalSpacing: 8
+
+*Button.font: -adobe-helvetica-medium-r-normal-*-*-120-*-*-*-*-iso8859-1
+*Button.shadowThickness: 1
+*Button.borderWidth: 1
+*Button.horizontalSpacing: 8
+*Button.verticalSpacing: 3
+
+*Indicator.foreground: rgb:9b/cd/9b
+*Indicator.background: rgb:54/54/54
+*Indicator.topShadowColor: rgb:ff/ff/ff
+*Indicator.bottomShadowColor: rgb:20/20/20
+*Indicator.shadowThickness: 1
+*Indicator.borderWidth: 0
+*Indicator.height: 7
+*Indicator.width: 15
+*Indicator.horizontalSpacing: 4
+*Indicator.verticalSpacing: 6
+*Indicator.minimumCount: 8
+*Indicator.maximumCount: 24
+
+! X11 does a miserable job of providing resolution-independent drawing
+! facilities---it expects everything to be done in pixels. So if you
+! happen to run your X server at a resolution of 100 pixels per inch
+! (or some other strange value) instead of the widely used default of
+! 75, x11-ssh-askpass looks might tiny. [Sigh].
+!
+! To get around this, umm, limitation, we declare the resolution that
+! the spacing and width/height pixels values are "valid" for, along
+! with a fuzz factor. If the current actual resolution is outside of
+! the range of <DEFAULT - FUZZ>..<DEFAULT + FUZZ>, then we scale pixel
+! measurements to fit the actual resolution.
+!
+! (And if you think *this* is a horrid hack, then take a look at the
+! actual code, which has to deal with conversion to [cheesy fanfare]
+! that's right---millimeters!!! The right hand managed to slip that
+! one in while the left hand was adding a '-dpi' switch to the sample
+! server implementation. I think both left feet were adding the
+! RESOLUTION_X and RESOLUTION_Y fields [in dots per inch, naturally]
+! to the X Logical Font Description. The irony is underwhelming.)
+
+*defaultXResolution: 75/in
+*defaultYResolution: 75/in
+*xResolutionFuzz: 20/in
+*yResolutionFuzz: 20/in
+
+! Number of seconds to wait for a key- or button-press
+! before giving up. '0' means wait forever.
+*inputTimeout: 0
+
+! Ssh-askpass grabs the keyboard by default.
+! To stop it from grabbing the keyboard, use:
+!*grabKeyboard: false
+
+! Ssh-askpass does not grab the pointer by default.
+! To make it grab the pointer, use:
+!*grabPointer: true
+
+! Ssh-askpass does not grab the server by default.
+! To make it grab the server, use:
+!*grabServer: true
+
+*Dialog.title: OpenSSH Authentication Passphrase Request
+*Dialog.label: Please enter your authentication passphrase:
+*okButton.label: OK
+*cancelButton.label: Cancel
+
102 SshAskpass-default.ad
@@ -0,0 +1,102 @@
+! SshAskpass.ad: Default resources for the X11-based ssh-askpass for OpenSSH
+! created 1999-Nov-17 03:40 Jim Knoble <jmknoble@pobox.com>
+! autodate: 2001-Sep-16 18:08
+!
+! by Jim Knoble <jmknoble@pobox.com>
+! Copyright (C) 1999,2000 Jim Knoble
+!
+! Disclaimer:
+!
+! The software is provided "as is", without warranty of any kind,
+! express or implied, including but not limited to the warranties of
+! merchantability, fitness for a particular purpose and
+! noninfringement. In no event shall the author(s) be liable for any
+! claim, damages or other liability, whether in an action of
+! contract, tort or otherwise, arising from, out of or in connection
+! with the software or the use or other dealings in the software.
+!
+! Permission to use, copy, modify, distribute, and sell this software
+! and its documentation for any purpose is hereby granted without
+! fee, provided that the above copyright notice appear in all copies
+! and that both that copyright notice and this permission notice
+! appear in supporting documentation.
+!
+
+! +-----------------------------+
+! | Default theme (like SSH v1) |
+! +-----------------------------+
+
+*Dialog.font: -adobe-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-1
+*?.foreground: rgb:00/00/00
+*?.background: rgb:cc/cc/cc
+*topShadowColor: rgb:ff/ff/ff
+*bottomShadowColor: rgb:7f/7f/7f
+*borderColor: rgb:20/20/20
+*shadowThickness: 3
+*borderWidth: 1
+*horizontalSpacing: 5
+*verticalSpacing: 6
+
+*Button.font: -adobe-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-1
+*Button.shadowThickness: 2
+*Button.borderWidth: 1
+*Button.horizontalSpacing: 5
+*Button.verticalSpacing: 2
+
+*Indicator.foreground: rgb:9b/cd/9b
+*Indicator.background: rgb:00/00/80
+*Indicator.shadowThickness: 2
+*Indicator.borderWidth: 0
+*Indicator.height: 7
+*Indicator.width: 15
+*Indicator.horizontalSpacing: 2
+*Indicator.verticalSpacing: 4
+*Indicator.minimumCount: 8
+*Indicator.maximumCount: 24
+
+! X11 does a miserable job of providing resolution-independent drawing
+! facilities---it expects everything to be done in pixels. So if you
+! happen to run your X server at a resolution of 100 pixels per inch
+! (or some other strange value) instead of the widely used default of
+! 75, x11-ssh-askpass looks might tiny. [Sigh].
+!
+! To get around this, umm, limitation, we declare the resolution that
+! the spacing and width/height pixels values are "valid" for, along
+! with a fuzz factor. If the current actual resolution is outside of
+! the range of <DEFAULT - FUZZ>..<DEFAULT + FUZZ>, then we scale pixel
+! measurements to fit the actual resolution.
+!
+! (And if you think *this* is a horrid hack, then take a look at the
+! actual code, which has to deal with conversion to [cheesy fanfare]
+! that's right---millimeters!!! The right hand managed to slip that
+! one in while the left hand was adding a '-dpi' switch to the sample
+! server implementation. I think both left feet were adding the
+! RESOLUTION_X and RESOLUTION_Y fields [in dots per inch, naturally]
+! to the X Logical Font Description. The irony is underwhelming.)
+
+*defaultXResolution: 75/in
+*defaultYResolution: 75/in
+*xResolutionFuzz: 20/in
+*yResolutionFuzz: 20/in
+
+! Number of seconds to wait for a key- or button-press
+! before giving up. '0' means wait forever.
+*inputTimeout: 0
+
+! Ssh-askpass grabs the keyboard by default.
+! To stop it from grabbing the keyboard, use:
+!*grabKeyboard: false
+
+! Ssh-askpass does not grab the pointer by default.
+! To make it grab the pointer, use:
+!*grabPointer: true
+
+! Ssh-askpass does not grab the server by default.
+! To make it grab the server, use:
+!*grabServer: true
+
+*Dialog.title: OpenSSH Authentication Passphrase Request
+*Dialog.label: Please enter your authentication passphrase:
+*okButton.label: OK
+*cancelButton.label: Cancel
+
102 SshAskpass-green.ad
@@ -0,0 +1,102 @@
+! SshAskpass.ad: Default resources for the X11-based ssh-askpass for OpenSSH
+! created 1999-Nov-17 03:40 Jim Knoble <jmknoble@pobox.com>
+! autodate: 2001-Sep-16 18:07
+!
+! by Jim Knoble <jmknoble@pobox.com>
+! Copyright (C) 1999,2000 Jim Knoble
+!
+! Disclaimer:
+!
+! The software is provided "as is", without warranty of any kind,
+! express or implied, including but not limited to the warranties of
+! merchantability, fitness for a particular purpose and
+! noninfringement. In no event shall the author(s) be liable for any
+! claim, damages or other liability, whether in an action of
+! contract, tort or otherwise, arising from, out of or in connection
+! with the software or the use or other dealings in the software.
+!
+! Permission to use, copy, modify, distribute, and sell this software
+! and its documentation for any purpose is hereby granted without
+! fee, provided that the above copyright notice appear in all copies
+! and that both that copyright notice and this permission notice
+! appear in supporting documentation.
+!
+
+! +-------------+
+! | Green theme |
+! +-------------+
+
+*Dialog.font: -adobe-new century schoolbook-bold-r-normal-*-*-140-*-*-*-*-iso8859-1
+*?.foreground: rgb:54/ff/9f
+*?.background: rgb:2e/8b/57
+*topShadowColor: rgb:43/cd/80
+*bottomShadowColor: rgb:43/cd/80
+*borderColor: rgb:43/cd/80
+*shadowThickness: 2
+*borderWidth: 0
+*horizontalSpacing: 5
+*verticalSpacing: 6
+
+*Button.font: -adobe-new century schoolbook-bold-r-normal-*-*-140-*-*-*-*-iso8859-1
+*Button.shadowThickness: 0
+*Button.borderWidth: 2
+*Button.horizontalSpacing: 4
+*Button.verticalSpacing: 2
+
+*Indicator.foreground: rgb:ad/ff/2f
+*Indicator.background: rgb:2e/8b/57
+*Indicator.shadowThickness: 0
+*Indicator.borderWidth: 2
+*Indicator.height: 7
+*Indicator.width: 15
+*Indicator.horizontalSpacing: 3
+*Indicator.verticalSpacing: 4
+*Indicator.minimumCount: 8
+*Indicator.maximumCount: 24
+
+! X11 does a miserable job of providing resolution-independent drawing
+! facilities---it expects everything to be done in pixels. So if you
+! happen to run your X server at a resolution of 100 pixels per inch
+! (or some other strange value) instead of the widely used default of
+! 75, x11-ssh-askpass looks might tiny. [Sigh].
+!
+! To get around this, umm, limitation, we declare the resolution that
+! the spacing and width/height pixels values are "valid" for, along
+! with a fuzz factor. If the current actual resolution is outside of
+! the range of <DEFAULT - FUZZ>..<DEFAULT + FUZZ>, then we scale pixel
+! measurements to fit the actual resolution.
+!
+! (And if you think *this* is a horrid hack, then take a look at the
+! actual code, which has to deal with conversion to [cheesy fanfare]
+! that's right---millimeters!!! The right hand managed to slip that
+! one in while the left hand was adding a '-dpi' switch to the sample
+! server implementation. I think both left feet were adding the
+! RESOLUTION_X and RESOLUTION_Y fields [in dots per inch, naturally]
+! to the X Logical Font Description. The irony is underwhelming.)
+
+*defaultXResolution: 75/in
+*defaultYResolution: 75/in
+*xResolutionFuzz: 20/in
+*yResolutionFuzz: 20/in
+
+! Number of seconds to wait for a key- or button-press
+! before giving up. '0' means wait forever.
+*inputTimeout: 0
+
+! Ssh-askpass grabs the keyboard by default.
+! To stop it from grabbing the keyboard, use:
+!*grabKeyboard: false
+
+! Ssh-askpass does not grab the pointer by default.
+! To make it grab the pointer, use:
+!*grabPointer: true
+
+! Ssh-askpass does not grab the server by default.
+! To make it grab the server, use:
+!*grabServer: true
+
+*Dialog.title: OpenSSH Authentication Passphrase Request
+*Dialog.label: Please enter your authentication passphrase:
+*okButton.label: OK
+*cancelButton.label: Cancel
+
102 SshAskpass-motif.ad
@@ -0,0 +1,102 @@
+! SshAskpass.ad: Default resources for the X11-based ssh-askpass for OpenSSH
+! created 1999-Nov-17 03:40 Jim Knoble <jmknoble@pobox.com>
+! autodate: 2001-Sep-16 18:07
+!
+! by Jim Knoble <jmknoble@pobox.com>
+! Copyright (C) 1999,2000 Jim Knoble
+!
+! Disclaimer:
+!
+! The software is provided "as is", without warranty of any kind,
+! express or implied, including but not limited to the warranties of
+! merchantability, fitness for a particular purpose and
+! noninfringement. In no event shall the author(s) be liable for any
+! claim, damages or other liability, whether in an action of
+! contract, tort or otherwise, arising from, out of or in connection
+! with the software or the use or other dealings in the software.
+!
+! Permission to use, copy, modify, distribute, and sell this software
+! and its documentation for any purpose is hereby granted without
+! fee, provided that the above copyright notice appear in all copies
+! and that both that copyright notice and this permission notice
+! appear in supporting documentation.
+!
+
+! +-----------------+
+! | Motif-ish theme |
+! +-----------------+
+
+*Dialog.font: -adobe-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-1
+*?.foreground: rgb:00/00/00
+*?.background: rgb:c0/c0/c0
+*topShadowColor: rgb:e5/e5/e5
+*bottomShadowColor: rgb:69/69/69
+*borderColor: rgb:00/00/00
+*shadowThickness: 2
+*borderWidth: 0
+*horizontalSpacing: 8
+*verticalSpacing: 6
+
+*Button.font: -adobe-helvetica-bold-r-normal-*-*-120-*-*-*-*-iso8859-1
+*Button.shadowThickness: 2
+*Button.borderWidth: 0
+*Button.horizontalSpacing: 5
+*Button.verticalSpacing: 4
+
+*Indicator.foreground: rgb:ff/ff/70
+*Indicator.background: rgb:4f/94/cd
+*Indicator.shadowThickness: 2
+*Indicator.borderWidth: 0
+*Indicator.height: 7
+*Indicator.width: 15
+*Indicator.horizontalSpacing: 3
+*Indicator.verticalSpacing: 6
+*Indicator.minimumCount: 8
+*Indicator.maximumCount: 24
+
+! X11 does a miserable job of providing resolution-independent drawing
+! facilities---it expects everything to be done in pixels. So if you
+! happen to run your X server at a resolution of 100 pixels per inch
+! (or some other strange value) instead of the widely used default of
+! 75, x11-ssh-askpass looks might tiny. [Sigh].
+!
+! To get around this, umm, limitation, we declare the resolution that
+! the spacing and width/height pixels values are "valid" for, along
+! with a fuzz factor. If the current actual resolution is outside of
+! the range of <DEFAULT - FUZZ>..<DEFAULT + FUZZ>, then we scale pixel
+! measurements to fit the actual resolution.
+!
+! (And if you think *this* is a horrid hack, then take a look at the
+! actual code, which has to deal with conversion to [cheesy fanfare]
+! that's right---millimeters!!! The right hand managed to slip that
+! one in while the left hand was adding a '-dpi' switch to the sample
+! server implementation. I think both left feet were adding the
+! RESOLUTION_X and RESOLUTION_Y fields [in dots per inch, naturally]
+! to the X Logical Font Description. The irony is underwhelming.)
+
+*defaultXResolution: 75/in
+*defaultYResolution: 75/in
+*xResolutionFuzz: 20/in
+*yResolutionFuzz: 20/in
+
+! Number of seconds to wait for a key- or button-press
+! before giving up. '0' means wait forever.
+*inputTimeout: 0
+
+! Ssh-askpass grabs the keyboard by default.
+! To stop it from grabbing the keyboard, use:
+!*grabKeyboard: false
+
+! Ssh-askpass does not grab the pointer by default.
+! To make it grab the pointer, use:
+!*grabPointer: true
+
+! Ssh-askpass does not grab the server by default.
+! To make it grab the server, use:
+!*grabServer: true
+
+*Dialog.title: OpenSSH Authentication Passphrase Request
+*Dialog.label: Please enter your authentication passphrase:
+*okButton.label: OK
+*cancelButton.label: Cancel
+
28 TODO
@@ -0,0 +1,28 @@
+# TODO: Notes about future work on x11-ssh-askpass
+# created 2000-Aug-28 03:32 jmk
+# autodate: 2001-Apr-01 17:40
+
++------------+
+| Fun Things |
++------------+
+
+- (DONE) Add timeout feature.
+
++---------------+
+| High Priority |
++---------------+
+
+No items.
+
++--------------+
+| Low Priority |
++--------------+
+
+- (DONE) Make pressed buttons actually look pressed.
+
+- (DONE) Make pressed buttons pop back up when the pointer leaves them.
+
+- (DONE) Investigate use of malloc() vs realloc(NULL,) for SunOS and
+ other older systems. Charles Levert <charles@comm.polymtl.ca> and
+ Steve VanDevender <stevev@efn.org>.
+
290 configure
@@ -0,0 +1,290 @@
+#!/bin/sh
+#
+# configure: Automatically configure install locations for x11-ssh-askpass
+#
+# by Jim Knoble <jmknoble@pobox.com>
+# Copyright (C) 2001 Jim Knoble
+#
+# Disclaimer:
+#
+# This software is provided "as is", without warranty of any kind,
+# express or implied, including but not limited to the warranties of
+# merchantability, fitness for a particular purpose and
+# noninfringement. In no event shall the author(s) be liable for any
+# claim, damages or other liability, whether in an action of
+# contract, tort or otherwise, arising from, out of or in connection
+# with the software or the use or other dealings in the software.
+#
+# Permission to use, copy, modify, distribute, and sell this software
+# and its documentation for any purpose is hereby granted without
+# fee, provided that the above copyright notice appear in all copies
+# and that both that copyright notice and this permission notice
+# appear in supporting documentation.
+
+PrintHelp() {
+ cat <<EOF
+
+Usage: $0 [options]
+
+Options:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [${default_prefix}]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+
+ --bindir=DIR ignored
+ --sbindir=DIR ignored
+ --datadir=DIR ignored
+ --sysconfdir=DIR ignored
+ --sharedstatedir=DIR ignored
+ --localstatedir=DIR ignored
+ --libdir=DIR ignored
+ --includedir=DIR ignored
+ --infodir=DIR ignored
+
+ --with-app-defaults=FILE Use application defaults from FILE
+ [${default_app_defaults}]
+ --with-app-defaults-dir=DIR Install application defaults file into DIR
+ [wherever imake prefers]
+ --disable-installing-app-defaults Do not install the application defaults
+ file (overrides --with-app-defaults-dir)
+ [enabled]
+
+EOF
+ exit 1
+}
+
+GetOptionArg() {
+ opt="$1"
+ if [ -z "${opt}" ]; then
+ return
+ fi
+ varname=`echo "${opt}" |sed -e 's/^--//' -e 's/=.*$//' -e 'y/-/_/'`
+ case "${opt}" in
+ *=*)
+ arg=`echo "${opt}" |sed -e 's/^[^=]*=//'`
+ eval "${varname}=\"${arg}\""
+ ;;
+ esac
+}
+
+GetWithOption() {
+ opt="$1"
+ if [ -z "${opt}" ]; then
+ return
+ fi
+ varname=`echo "${opt}" |sed -e 's/^--with-//' -e 's/=.*$//' -e 'y/-/_/'`
+ case "${opt}" in
+ --with-*=*)
+ arg=`echo "${opt}" |sed -e 's/^[^=]*=//'`
+ eval "${varname}=\"${arg}\""
+ ;;
+ esac
+}
+
+GetEnableOption() {
+ opt="$1"
+ if [ -z "${opt}" ]; then
+ return
+ fi
+ varname=`echo "${opt}" |sed -e 's/^--dis/en/' -e 's/^--//' -e 's/=.*$//' \
+ -e 'y/-/_/'`
+ case "${opt}" in
+ --enable-*=*)
+ arg=`echo "${opt}" |sed -e 's/^[^=]*=//'`
+ ;;
+ --enable-*)
+ arg=yes
+ ;;
+ --disable-*)
+ arg=no
+ ;;
+ *)
+ return
+ ;;
+ esac
+ case "${arg}" in
+ 1|[yY]|[tT]|[oO][nN]|[yY][eE][sS]|[tT][rR][uU][eE]|[eE][nN][aA][bB][lL][eE][dD])
+ eval "${varname}=yes"
+ ;;
+ 0|[nN]|[fF]|[oO][fF][fF]|[nN][oO]|[fF][aA][lL][sS][eE]|[dD][iI][sS][aA][bB][lL][eE][dD])
+ eval "${varname}=no"
+ ;;
+ *)
+ echo "$0: error: I don't understand '${arg}' (from '${opt}')."
+ exit 1
+ ;;
+ esac
+}
+
+UseDefaults () {
+ unset CC
+ unset CFLAGS
+ unset LDFLAGS
+
+ prefix=''
+ exec_prefix=''
+ libexecdir=''
+ mandir=''
+ app_defaults=''
+ app_defaults_dir=''
+ enable_installing_app_defaults=''
+}
+
+IMAKEFILE_SRC="Imakefile.in"
+IMAKEFILE_DST="Imakefile"
+
+default_default_app_defaults_dir='$(XAPPLOADDIR)'
+
+default_prefix='/usr/local'
+
+if [ -f ../configure ]; then
+ eval `cat ../configure |awk '/^[ ]*ac_default_prefix=/ { print $0 }'`
+fi
+if [ -n "${ac_default_prefix}" ]; then
+ default_prefix="${ac_default_prefix}"
+fi
+
+default_exec_prefix='${prefix}'
+default_libexecdir='${exec_prefix}/libexec'
+default_mandir='${prefix}/man'
+default_app_defaults='SshAskpass-default.ad'
+default_app_defaults_dir='${default_default_app_defaults_dir}'
+default_enable_installing_app_defaults='yes'
+
+prefix=''
+exec_prefix=''
+libexecdir=''
+mandir=''
+app_defaults=''
+app_defaults_dir=''
+enable_installing_app_defaults=''
+
+while [ $# -gt 0 ]; do
+ case "$1" in
+ -h|--help|-help|-\?)
+ PrintHelp
+ ;;
+ -d|--default|--defaults|--use-defaults)
+ UseDefaults
+ break
+ ;;
+ --prefix=*|--exec-prefix=*|--libexecdir=*|--mandir=*)
+ GetOptionArg "$1"
+ shift
+ ;;
+ --with-app-defaults=*|--with-app-defaults-dir=*)
+ GetWithOption "$1"
+ shift
+ ;;
+ --enable-installing-app-defaults|--enable-installing-app-defaults=*|--disable-installing-app-defaults)
+ GetEnableOption "$1"
+ shift
+ ;;
+ -*)
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
+for i in \
+ prefix \
+ exec_prefix \
+ libexecdir \
+ mandir \
+ app_defaults \
+ app_defaults_dir \
+ enable_installing_app_defaults \
+; do
+ if eval [ -z \"\${"${i}"}\" ]; then
+ eval ${i}=\"\`eval echo \${default_"${i}"}\`\"
+ fi
+done
+
+if [ ! -f "${IMAKEFILE_SRC}" ]; then
+ echo "$0: error: I can't seem to find ${IMAKEFILE_SRC}."
+ echo "$0: Are you sure you're running me from the x11-ssh-askpass source directory?"
+ exit 1
+fi
+
+cat "${IMAKEFILE_SRC}" |sed \
+ -e 's#^\([ ]*BINDIR[ ]*=\).*$#\1 '"${libexecdir}"'#' \
+ -e 's#^\([ ]*MANPATH[ ]*=\).*$#\1 '"${mandir}"'#' \
+ -e 's#^\([ ]*APPDEFDIR[ ]*=\).*$#\1 '"${app_defaults_dir}"'#' \
+ -e 's#^\([ ]*APP_DEFAULTS[ ]*=\).*#\1 '"${app_defaults}"'#' \
+ >"${IMAKEFILE_DST}.tmp" \
+&& mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
+
+case "${enable_installing_app_defaults}" in
+ yes)
+ cat "${IMAKEFILE_DST}" |sed \
+ -e 's#^[ ]*\(XCOMM[ ]\+\)\?\(install::[ ]\+install-app-defaults.*\)$#\2#' \
+ >"${IMAKEFILE_DST}.tmp" \
+ && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
+ ;;
+ no)
+ cat "${IMAKEFILE_DST}" |sed \
+ -e 's#^[ ]*\(XCOMM[ ]\+\)\?\(install::[ ]\+install-app-defaults.*\)$#XCOMM \2#' \
+ >"${IMAKEFILE_DST}.tmp" \
+ && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
+ ;;
+esac
+
+if [ -n "${CC}" ]; then
+ cat "${IMAKEFILE_DST}" |sed \
+ -e 's#^[ ]*XCOMM[ ]\+\(CC[ ]*=\).*$#\1 '"${CC}"'#' \
+ >"${IMAKEFILE_DST}.tmp" \
+ && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
+else
+ CC='default'
+fi
+
+if [ -n "${CFLAGS}" ]; then
+ cat "${IMAKEFILE_DST}" |sed \
+ -e 's#^[ ]*XCOMM[ ]\+\(CDEBUGFLAGS[ ]*=\).*$#\1 '"${CFLAGS}"'#' \
+ >"${IMAKEFILE_DST}.tmp" \
+ && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
+else
+ CFLAGS='default'
+fi
+
+if [ -n "${LDFLAGS}" ]; then
+ cat "${IMAKEFILE_DST}" |sed \
+ -e 's#^[ ]*XCOMM[ ]\+\(LOCAL_LDFLAGS[ ]*=\).*$#\1 '"${LDFLAGS}"'#' \
+ >"${IMAKEFILE_DST}.tmp" \
+ && mv -f "${IMAKEFILE_DST}.tmp" "${IMAKEFILE_DST}"
+else
+ LDFLAGS='default'
+fi
+
+if [ "${app_defaults_dir}" = "${default_default_app_defaults_dir}" ]; then
+ app_defaults_dir='default'
+fi
+
+cat <<EOF
+
+x11-ssh-askpass has been configured with the following options:
+
+ Askpass directory: ${libexecdir}
+ Manual page: ${mandir}/man1
+ Application defaults file: ${app_defaults}
+ Application defaults directory: ${app_defaults_dir}
+ Install application defaults file: ${enable_installing_app_defaults}
+
+ Compiler: ${CC}
+ Compiler flags: ${CFLAGS}
+ Linker flags: ${LDFLAGS}
+
+You may now create the Makefile and build x11-ssh-askpass using the
+following commands:
+
+ xmkmf
+ make includes
+ make
+
+EOF
81 drawing.c
@@ -0,0 +1,81 @@
+/* xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski <jwz@netscape.com>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+/* 1999-Nov-21 Modified by Jim Knoble <jmknoble@pobox.com>
+ * Modifications:
+ * - Extracted draw_shaded_rectangle() from xscreensaver source for use
+ * in a separate application. Constructed separate header file.
+ */
+
+#include <X11/Intrinsic.h>
+
+void
+draw_shaded_rectangle (Display *dpy, Window window,
+ int x, int y,
+ int width, int height,
+ int thickness,
+ unsigned long top_color,
+ unsigned long bottom_color)
+{
+ XPoint points[4];
+ XGCValues gcv;
+ GC gc1, gc2;
+ if (thickness == 0) return;
+
+ gcv.foreground = top_color;
+ gc1 = XCreateGC (dpy, window, GCForeground, &gcv);
+ gcv.foreground = bottom_color;
+ gc2 = XCreateGC (dpy, window, GCForeground, &gcv);
+
+ points [0].x = x;
+ points [0].y = y;
+ points [1].x = x + width;
+ points [1].y = y;
+ points [2].x = x + width - thickness;
+ points [2].y = y + thickness;
+ points [3].x = x;
+ points [3].y = y + thickness;
+ XFillPolygon (dpy, window, gc1, points, 4, Convex, CoordModeOrigin);
+
+ points [0].x = x;
+ points [0].y = y + thickness;
+ points [1].x = x;
+ points [1].y = y + height;
+ points [2].x = x + thickness;
+ points [2].y = y + height - thickness;
+ points [3].x = x + thickness;
+ points [3].y = y + thickness;
+ XFillPolygon (dpy, window, gc1, points, 4, Convex, CoordModeOrigin);
+
+ points [0].x = x + width;
+ points [0].y = y;
+ points [1].x = x + width - thickness;
+ points [1].y = y + thickness;
+ points [2].x = x + width - thickness;
+ points [2].y = y + height - thickness;
+ points [3].x = x + width;
+ points [3].y = y + height - thickness;
+ XFillPolygon (dpy, window, gc2, points, 4, Convex, CoordModeOrigin);
+
+ points [0].x = x;
+ points [0].y = y + height;
+ points [1].x = x + width;
+ points [1].y = y + height;
+ points [2].x = x + width;
+ points [2].y = y + height - thickness;
+ points [3].x = x + thickness;
+ points [3].y = y + height - thickness;
+ XFillPolygon (dpy, window, gc2, points, 4, Convex, CoordModeOrigin);
+
+ XFreeGC (dpy, gc1);
+ XFreeGC (dpy, gc2);
+}
+
31 drawing.h
@@ -0,0 +1,31 @@
+/* xscreensaver, Copyright (c) 1991-1998 Jamie Zawinski <jwz@netscape.com>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+/* 1999-Nov-21 Modified by Jim Knoble <jmknoble@pobox.com>
+ * Modifications:
+ * - Extracted draw_shaded_rectangle() from xscreensaver source for use
+ * in a separate application. Constructed separate header file.
+ */
+
+#ifndef _DRAWING_H_
+#define _DRAWING_H_
+
+#include <X11/Intrinsic.h>
+
+void
+draw_shaded_rectangle (Display *dpy, Window window,
+ int x, int y,
+ int width, int height,
+ int thickness,
+ unsigned long top_color,
+ unsigned long bottom_color);
+
+#endif /* _DRAWING_H_ */
83 dynlist.c
@@ -0,0 +1,83 @@
+/* dynlist.c: Dynamic lists and buffers in C.
+ * created 1999-Jan-06 15:34 jmk
+ * autodate: 2001-Sep-16 18:08
+ *
+ * by Jim Knoble <jmknoble@pobox.com>
+ * Copyright (C) 1999,2000,2001 Jim Knoble
+ *
+ * Disclaimer:
+ *
+ * The software is provided "as is", without warranty of any kind,
+ * express or implied, including but not limited to the warranties of
+ * merchantability, fitness for a particular purpose and
+ * noninfringement. In no event shall the author(s) be liable for any
+ * claim, damages or other liability, whether in an action of
+ * contract, tort or otherwise, arising from, out of or in connection
+ * with the software or the use or other dealings in the software.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "dynlist.h"
+
+#define LIST_CHUNK_SIZE 512
+#define BUF_CHUNK_SIZE 512
+
+/* For lists of pointers cast to char *. */
+int append_to_list(char ***list_ptr, int *list_len, int *i, char *item)
+{
+ char **tmp_ptr;
+
+ if (*i >= *list_len)
+ {
+ *list_len += LIST_CHUNK_SIZE;
+ if (NULL == *list_ptr) {
+ tmp_ptr = malloc(sizeof(**list_ptr) * *list_len);
+ } else {
+ tmp_ptr = realloc(*list_ptr, (sizeof(**list_ptr) * *list_len));
+ }
+ if (NULL == tmp_ptr)
+ {
+ return(APPEND_FAILURE);
+ }
+ *list_ptr = tmp_ptr;
+ }
+ (*list_ptr)[*i] = item;
+ (*i)++;
+ return(APPEND_SUCCESS);
+}
+
+/* For single-dimensional buffers. */
+int append_to_buf(char **buf, int *buflen, int *i, int c)
+{
+ char *tmp_buf;
+
+ if (*i >= *buflen)
+ {
+ *buflen += BUF_CHUNK_SIZE;
+ if (NULL == *buf) {
+ tmp_buf = malloc(sizeof(**buf) * *buflen);
+ } else {
+ tmp_buf = realloc(*buf, (sizeof(**buf) * *buflen));
+ }
+ if (NULL == tmp_buf)
+ {
+ return(APPEND_FAILURE);
+ }
+ *buf = tmp_buf;
+#ifdef DEBUG
+ printf("-->Allocated buffer of size %d\n", *buflen);
+#endif /* DEBUG */
+ }
+ (*buf)[*i] = (char) c;
+ (*i)++;
+ return(APPEND_SUCCESS);
+}
+
34 dynlist.h
@@ -0,0 +1,34 @@
+/* dynlist.h: Dynamic lists and buffers in C
+ * created 1999-Jan-06 15:04 jmk
+ * autodate: 2001-Sep-16 18:08
+ *
+ * by Jim Knoble <jmknoble@pobox.com>
+ * Copyright (C) 1999,2000 Jim Knoble
+ *
+ * Disclaimer:
+ *
+ * The software is provided "as is", without warranty of any kind,
+ * express or implied, including but not limited to the warranties of
+ * merchantability, fitness for a particular purpose and
+ * noninfringement. In no event shall the author(s) be liable for any
+ * claim, damages or other liability, whether in an action of
+ * contract, tort or otherwise, arising from, out of or in connection
+ * with the software or the use or other dealings in the software.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software
+ * and its documentation for any purpose is hereby granted without
+ * fee, provided that the above copyright notice appear in all copies
+ * and that both that copyright notice and this permission notice
+ * appear in supporting documentation.
+ */
+
+#ifndef H_DYNLIST
+#define H_DYNLIST 1
+
+#define APPEND_SUCCESS 1
+#define APPEND_FAILURE 0
+
+int append_to_list(char ***list_ptr, int *list_len, int *i, char *item);
+int append_to_buf(char **buf, int *buflen, int *i, int c);
+
+#endif /* H_DYNLIST */
180 resources.c
@@ -0,0 +1,180 @@
+/* xscreensaver, Copyright (c) 1992, 1997, 1998
+ * Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+/* 1999-Nov-21 Modified by Jim Knoble <jmknoble@pobox.com>.
+ * Modifications:
+ *
+ * - Made get_boolean_resource() accept a third parameter, default_value,
+ * which determines the result of get_boolean_resource if either (a)
+ * no such resource exists, or (b) the resource value does not conform
+ * to the syntax of a boolean resource.
+ *
+ * - Same for get_integer_resource(), get_pixel_resource().
+ *
+ * - 1999-Dec-24 Moved header includes from utils.h to here.
+ * Trimmed unused functions.
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <X11/Xlib.h>
+#include <X11/Xos.h>
+#include <X11/Xresource.h>
+#include "resources.h"
+
+
+/* Resource functions. Assumes: */
+
+extern char *progname;
+extern char *progclass;
+extern XrmDatabase db;
+
+#ifndef isupper
+# define isupper(c) ((c) >= 'A' && (c) <= 'Z')
+#endif
+#ifndef _tolower
+# define _tolower(c) ((c) - 'A' + 'a')
+#endif
+
+char *
+get_string_resource (char *res_name, char *res_class)
+{
+ XrmValue value;
+ char *type;
+ char full_name [1024], full_class [1024];
+ strcpy (full_name, progname);
+ strcat (full_name, ".");
+ strcat (full_name, res_name);
+ strcpy (full_class, progclass);
+ strcat (full_class, ".");
+ strcat (full_class, res_class);
+ if (XrmGetResource (db, full_name, full_class, &type, &value))
+ {
+ char *str = (char *) malloc (value.size + 1);
+ strncpy (str, (char *) value.addr, value.size);
+ str [value.size] = 0;
+ return str;
+ }
+ return 0;
+}
+
+Bool
+get_boolean_resource (char *res_name, char *res_class, Bool default_value)
+{
+ char *tmp, buf [100];
+ char *s = get_string_resource (res_name, res_class);
+ char *os = s;
+ if (! s) return default_value;
+ for (tmp = buf; *s; s++)
+ *tmp++ = isupper (*s) ? _tolower (*s) : *s;
+ *tmp = 0;
+ free (os);
+
+ while (*buf &&
+ (buf[strlen(buf)-1] == ' ' ||
+ buf[strlen(buf)-1] == '\t'))
+ buf[strlen(buf)-1] = 0;
+
+ if (!strcmp (buf, "on") || !strcmp (buf, "true") || !strcmp (buf, "yes"))
+ return 1;
+ if (!strcmp (buf,"off") || !strcmp (buf, "false") || !strcmp (buf,"no"))
+ return 0;
+ fprintf (stderr, "%s: %s must be boolean, not %s.\n",
+ progname, res_name, buf);
+ return default_value;
+}
+
+int
+get_integer_resource (char *res_name, char *res_class, int default_value)
+{
+ int val;
+ char c, *s = get_string_resource (res_name, res_class);
+ char *ss = s;
+ if (!s) return default_value;
+
+ while (*ss && *ss <= ' ') ss++; /* skip whitespace */
+
+ if (ss[0] == '0' && (ss[1] == 'x' || ss[1] == 'X')) /* 0x: parse as hex */
+ {
+ if (1 == sscanf (ss+2, "%x %c", &val, &c))
+ {
+ free (s);
+ return val;
+ }
+ }
+ else /* else parse as dec */
+ {
+ if (1 == sscanf (ss, "%d %c", &val, &c))
+ {
+ free (s);
+ return val;
+ }
+ }
+
+ fprintf (stderr, "%s: %s must be an integer, not %s.\n",
+ progname, res_name, s);
+ free (s);
+ return default_value;
+}
+
+double
+get_float_resource (char *res_name, char *res_class)
+{
+ double val;
+ char c, *s = get_string_resource (res_name, res_class);
+ if (! s) return 0.0;
+ if (1 == sscanf (s, " %lf %c", &val, &c))
+ {
+ free (s);
+ return val;
+ }
+ fprintf (stderr, "%s: %s must be a float, not %s.\n",
+ progname, res_name, s);
+ free (s);
+ return 0.0;
+}
+
+
+unsigned int
+get_pixel_resource (char *res_name, char *res_class,
+ Display *dpy, Colormap cmap, unsigned int default_value)
+{
+ XColor color;
+ char *s = get_string_resource (res_name, res_class);
+ char *s2;
+ if (!s) goto DEFAULT;
+
+ for (s2 = s + strlen(s) - 1; s2 > s; s2--)
+ if (*s2 == ' ' || *s2 == '\t')
+ *s2 = 0;
+ else
+ break;
+
+ if (! XParseColor (dpy, cmap, s, &color))
+ {
+ fprintf (stderr, "%s: can't parse color %s\n", progname, s);
+ goto DEFAULT;
+ }
+ if (! XAllocColor (dpy, cmap, &color))
+ {
+ fprintf (stderr, "%s: couldn't allocate color %s\n", progname, s);
+ goto DEFAULT;
+ }
+ free (s);
+ return color.pixel;
+ DEFAULT:
+ if (s) free (s);
+ return default_value;
+}
+
34 resources.h
@@ -0,0 +1,34 @@
+/* xscreensaver, Copyright (c) 1992, 1997 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ */
+
+/* 1999-Nov-21 Modified by Jim Knoble <jmknoble@pobox.com>.
+ * Modifications:
+ *
+ * - Made get_boolean_resource() accept a third parameter, default_value,
+ * which determines the result of get_boolean_resource if either (a)
+ * no such resource exists, or (b) the resource value does not conform
+ * to the syntax of a boolean resource.
+ *
+ * - Same for get_integer_resource().
+ *
+ * - 1999-Dec-24 Trimmed unused functions.
+ */
+
+#ifndef __XSCREENSAVER_RESOURCES_H__
+#define __XSCREENSAVER_RESOURCES_H__
+
+extern char *get_string_resource (char*,char*);
+extern Bool get_boolean_resource (char*,char*,Bool);
+extern int get_integer_resource (char*,char*,int);
+extern double get_float_resource (char*,char*);
+extern unsigned int get_pixel_resource (char*,char*,Display*,Colormap,unsigned int);
+
+#endif /* __XSCREENSAVER_RESOURCES_H__ */
1,551 x11-ssh-askpass.c
@@ -0,0 +1,1551 @@
+/* x11-ssh-askpass.c: A generic X11-based password dialog for OpenSSH.
+ * created 1999-Nov-17 03:40 Jim Knoble <jmknoble@pobox.com>
+ * autodate: 2001-Sep-16 18:08
+ *
+ * by Jim Knoble <jmknoble@pobox.com>
+ * Copyright (C) 1999,2000,2001 Jim Knoble
+ *
+ * Disclaimer:
+ *
+ * The software is provided "as is", without warranty of any kind,
+ * express or implied, including but not limited to the warranties of
+ * merchantability, fitness for a particular purpose and
+ * noninfringement. In no event shall the author(s) be liable for any
+ * claim, damages or other liability, whether in an action of
+ * contract, tort or otherwise, arising from, out of or in connection
+ * with the software or the use or other dealings in the software.
+ *
+ * Portions of this code are distantly derived from code in xscreensaver
+ * by Jamie Zawinski <jwz@jwz.org>. That code says:
+ *
+ * --------8<------------------------------------------------8<--------
+ * xscreensaver, Copyright (c) 1991-1999 Jamie Zawinski <jwz@jwz.org>
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation. No representations are made about the suitability of this
+ * software for any purpose. It is provided "as is" without express or
+ * implied warranty.
+ * --------8<------------------------------------------------8<--------
+ *
+ * The remainder of this code falls under the same permissions and
+ * provisions as those of the xscreensaver code.
+ */
+
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* For (get|set)rlimit() ... */
+#include <sys/time.h>
+#include <sys/resource.h>
+/* ... end */
+/* For (get|set)rlimit(), sleep(), and getpid() ... */
+#include <unistd.h>
+/* ... end */
+
+/* For errno ... */
+#include <errno.h>
+/* ... end */
+
+#include <X11/Xlib.h>
+#include <X11/Intrinsic.h>
+#include <X11/Shell.h>
+#include <X11/Xos.h>
+#include "dynlist.h"
+#include "drawing.h"
+#include "resources.h"
+#include "x11-ssh-askpass.h"
+
+#undef MAX
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
+
+char *progname = NULL;
+char *progclass = NULL;
+XrmDatabase db = 0;
+
+static char *defaults[] = {
+#include "SshAskpass_ad.h"
+ 0
+};
+
+void outOfMemory(AppInfo *app, int line)
+{
+ fprintf(stderr, "%s[%ld]: Aaahhh! I ran out of memory at line %d.\n",
+ app->appName, (long) app->pid, line);
+ exit(EXIT_STATUS_NO_MEMORY);
+}
+
+void freeIf(void *p)
+{
+ if (p) {
+ free(p);
+ }
+}
+
+void freeFontIf(AppInfo *app, XFontStruct *f)
+{
+ if (f) {
+ XFreeFont(app->dpy, f);
+ }
+}
+
+XFontStruct *getFontResource(AppInfo *app, char *instanceName, char *className)
+{
+ char *fallbackFont = "fixed";
+
+ XFontStruct *f = NULL;
+ char *s = get_string_resource(instanceName, className);
+ f = XLoadQueryFont(app->dpy, (s ? s : fallbackFont));
+ if (!f) {
+ f = XLoadQueryFont(app->dpy, fallbackFont);
+ }
+ if (s) {
+ free(s);
+ }
+ return(f);
+}
+
+char *getStringResourceWithDefault(char *instanceName, char *className,
+ char *defaultText)
+{
+ char *s = get_string_resource(instanceName, className);
+ if (!s) {
+ if (!defaultText) {
+ s = strdup("");
+ } else {
+ s = strdup(defaultText);
+ }
+ }
+ return(s);
+}
+
+unsigned int getUnsignedIntegerResource(AppInfo *app, char *instanceName,
+ char *className,
+ unsigned int defaultValue)
+{
+ int n;
+ unsigned int value;
+ char c;
+ char *s = get_string_resource(instanceName, className);
+ char *cp = s;
+
+ if (NULL == s) {
+ return(defaultValue);
+ }
+ while ((*cp) && isspace(*cp)) {
+ /* Skip whitespace. */
+ cp++;
+ }
+ if (*cp) {
+ if (('0' == cp[0]) && cp[1]) {
+ if (('x' == cp[1]) || ('X' == cp[1])) {
+ /* Hex */
+ n = sscanf(cp + 2, "%x %c", &value, &c);
+ } else {
+ /* Octal */
+ n = sscanf(cp + 1, "%o %c", &value, &c);
+ }
+ if (1 == n) {
+ free(s);
+ return(value);
+ }
+ } else {
+ /* Unsigned Decimal */
+ n = sscanf(cp, "%u %c", &value, &c);
+ if (1 == n) {
+ free(s);
+ return(value);
+ }
+ }
+ }
+ /* If we get here, no conversion succeeded. */
+ fprintf(stderr, "%s[%ld]: invalid value '%s' for %s.\n",
+ app->appName, (long) app->pid, s, instanceName);
+ free(s);
+ return(defaultValue);
+}
+
+/* Default resolution is 75 dots/inch. 1 in = 2.54 cm. */
+#define DefaultResolution ((75 * 10000) / 254)
+long getResolutionResource(AppInfo *app, char *instanceName, char *className,
+ char *defaultResolutionSpec)
+{
+ char units[3];
+ char *s;
+ int n;
+ long resolution;
+ unsigned int i;
+
+ memset(units, 0, sizeof(units));
+ s = getStringResourceWithDefault(instanceName, className,
+ defaultResolutionSpec);
+ /* NOTE: The width of the %s format must be one less than
+ * the length of the units[] array above!
+ */
+ n = sscanf(s, "%ld / %2s", &resolution, units);
+ if (n != 2) {
+ fprintf(stderr, "%s[%ld]: invalid value '%s' for %s.\n",
+ app->appName, (long) app->pid, s, instanceName);
+ resolution = DefaultResolution;
+ } else {
+ if (resolution < 0) {
+ /* Resolution specifications should not be negative. */
+ resolution = -(resolution);
+ }
+ for (i = 0; i < (sizeof(units) - 1); i++) {
+ units[i] = tolower(units[i]);
+ }
+ if ((0 == strcmp(units, "in")) ||
+ (0 == strcmp(units, "i")) ||
+ (0 == strcmp(units, "\""))) {
+ /* dots/inch */
+ resolution = resolution * 10000 / 254;
+ } else if ((0 == strcmp(units, "m")) ||
+ (0 == strcmp(units, "me"))) {
+ /* dots/meter; no conversion necessary */
+ ;
+ } else {
+ /* some unit we don't recognize; cringe and stare at the floor */
+ resolution = DefaultResolution;
+ }
+ }
+ return(resolution);
+}
+#undef DefaultResolution
+
+void calcTextObjectExtents(TextObject *t, XFontStruct *font) {
+ if ((!t) || (!(t->text))) {
+ return;
+ }
+ t->textLength = strlen(t->text);
+ XTextExtents(font, t->text, t->textLength, &(t->direction),
+ &(t->ascent), &(t->descent), &(t->overall));
+}
+
+void calcLabelTextExtents(LabelInfo *label)
+{
+ TextObject *t;
+
+ if ((!label) || (!(label->fullText)) || (!(label->font))) {
+ return;
+ }
+ t = label->multiText;
+ while (NULL != t) {
+ calcTextObjectExtents(t, label->font);
+ label->w.height += (t->ascent + t->descent);
+ if (label->w.width < t->overall.width) {
+ label->w.width = t->overall.width;
+ }
+ t = t->next;
+ }
+}
+
+void calcTotalButtonExtents(ButtonInfo *button)
+{
+ if (!button) {
+ return;
+ }
+ button->w3.w.width = (button->w3.interiorWidth +
+ (2 * button->w3.shadowThickness));
+ button->w3.w.width += (2 * button->w3.borderWidth);
+ button->w3.w.height = (button->w3.interiorHeight +
+ (2 * button->w3.shadowThickness));
+ button->w3.w.height += (2 * button->w3.borderWidth);
+}
+
+void calcButtonExtents(ButtonInfo *button)
+{
+ if (!button) {
+ return;
+ }
+ calcLabelTextExtents(&(button->label));
+ button->w3.interiorWidth = (button->label.w.width +
+ (2 * button->w3.horizontalSpacing));
+ button->w3.interiorHeight = (button->label.w.height +
+ (2 * button->w3.verticalSpacing));
+ calcTotalButtonExtents(button);
+}
+
+void balanceButtonExtents(ButtonInfo *button1, ButtonInfo *button2)
+{
+ if ((!button1) || (!button2)) {
+ return;
+ }
+ button1->w3.interiorWidth = button2->w3.interiorWidth =
+ MAX(button1->w3.interiorWidth, button2->w3.interiorWidth);
+ button1->w3.interiorHeight = button2->w3.interiorHeight =
+ MAX(button1->w3.interiorHeight, button2->w3.interiorHeight);
+ calcTotalButtonExtents(button1);
+ calcTotalButtonExtents(button2);
+}
+
+void calcButtonLabelPosition(ButtonInfo *button)
+{
+ if (!button) {
+ return;
+ }
+ button->label.w.x = button->w3.w.x +
+ ((button->w3.w.width - button->label.w.width) / 2);
+ button->label.w.y = button->w3.w.y +
+ ((button->w3.w.height - button->label.w.height) / 2);
+}
+
+Dimension scaleXDimension(AppInfo *app, Dimension unscaled)
+{
+ Dimension scaled;
+
+ if (((app->defaultXResolution < app->xResolution) &&
+ ((app->defaultXResolution + app->xFuzz) < app->xResolution)) ||
+ ((app->xResolution < app->defaultXResolution) &&
+ ((app->xResolution + app->xFuzz) < app->defaultXResolution))) {
+ scaled = (unscaled * app->xResolution) / app->defaultXResolution;
+ } else {
+ scaled = unscaled;
+ }
+ return(scaled);
+}
+
+Dimension scaleYDimension(AppInfo *app, Dimension unscaled)
+{
+ Dimension scaled;
+
+ if (((app->defaultYResolution < app->yResolution) &&
+ ((app->defaultYResolution + app->yFuzz) < app->yResolution)) ||
+ ((app->yResolution < app->defaultYResolution) &&