Re: Call for testing: OpenSSH 6.7

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On Wed, 20 Aug 2014, Tom Christensen wrote:

> (gdb) p __progname
> $1 = 0x0
> (gdb)
> 
> test_helper.c should probably use ssh_get_progname() from bsd-misc.c.

Thanks for figuring this out. I'd prefer to keep the dependencies from
the tests to a minimum, at least until we have the API defined in
libopenssh, so here's a workaround that uses argv[0]:

Index: regress/unittests/test_helper/test_helper.c
===================================================================
RCS file: /var/cvs/openssh/regress/unittests/test_helper/test_helper.c,v
retrieving revision 1.3
diff -u -p -r1.3 test_helper.c
--- regress/unittests/test_helper/test_helper.c	11 Jun 2014 19:32:30 -0000	1.3
+++ regress/unittests/test_helper/test_helper.c	21 Aug 2014 00:59:02 -0000
@@ -117,6 +117,19 @@ main(int argc, char **argv)
 {
 	int ch;
 
+	/* Handle systems without __progname */
+	if (__progname == NULL) {
+		__progname = strrchr(argv[0], '/');
+		if (__progname == NULL || __progname[1] == '\0')
+			__progname = argv[0];	
+		else
+			__progname++;
+		if ((__progname = strdup(__progname)) == NULL) {
+			fprintf(stderr, "strdup failed\n");
+			exit(1);
+		}
+	}
+
 	while ((ch = getopt(argc, argv, "vqd:")) != -1) {
 		switch (ch) {
 		case 'd':
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev




[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux