Claudio André
2016-04-23 20:29:35 UTC
Hi, I need to know if something like this can be accepted on Jumbo. This
is not ugly but the 'patch' for JOHN_SYSTEMWIDE_EXEC is going to be.
Claudio
|diff --git a/src/listconf.c b/src/listconf.c index 4531993..974f40d
100644 --- a/src/listconf.c +++ b/src/listconf.c @@ -135,7 +135,7 @@
static void listconf_list_build_info(void) #endif #if JOHN_SYSTEMWIDE
puts("System-wide exec: " JOHN_SYSTEMWIDE_EXEC); - puts("System-wide
home: " JOHN_SYSTEMWIDE_HOME); + printf("System-wide home: %s\n",
path_expand("$JOHN/")); puts("Private home: " JOHN_PRIVATE_HOME); #endif
#if CPU_FALLBACK diff --git a/src/path.c b/src/path.c index
af97e38..cf064ec 100644 --- a/src/path.c +++ b/src/path.c @@ -52,7
+52,11 @@ void path_init(char **argv) #if JOHN_SYSTEMWIDE john_home_path
= mem_alloc(PATH_BUFFER_SIZE); - strnzcpy(john_home_path,
JOHN_SYSTEMWIDE_HOME "/", PATH_BUFFER_SIZE); + if ((home_dir =
getenv("JOHN_SYSTEMWIDE_HOME"))) { + strnzcpy(john_home_path, home_dir,
PATH_BUFFER_SIZE - 1); + strcat (john_home_path, "/"); + } else +
strnzcpy(john_home_path, JOHN_SYSTEMWIDE_HOME "/", PATH_BUFFER_SIZE);
john_home_length = strlen(john_home_path); if (user_home_path) return;|
is not ugly but the 'patch' for JOHN_SYSTEMWIDE_EXEC is going to be.
Claudio
|diff --git a/src/listconf.c b/src/listconf.c index 4531993..974f40d
100644 --- a/src/listconf.c +++ b/src/listconf.c @@ -135,7 +135,7 @@
static void listconf_list_build_info(void) #endif #if JOHN_SYSTEMWIDE
puts("System-wide exec: " JOHN_SYSTEMWIDE_EXEC); - puts("System-wide
home: " JOHN_SYSTEMWIDE_HOME); + printf("System-wide home: %s\n",
path_expand("$JOHN/")); puts("Private home: " JOHN_PRIVATE_HOME); #endif
#if CPU_FALLBACK diff --git a/src/path.c b/src/path.c index
af97e38..cf064ec 100644 --- a/src/path.c +++ b/src/path.c @@ -52,7
+52,11 @@ void path_init(char **argv) #if JOHN_SYSTEMWIDE john_home_path
= mem_alloc(PATH_BUFFER_SIZE); - strnzcpy(john_home_path,
JOHN_SYSTEMWIDE_HOME "/", PATH_BUFFER_SIZE); + if ((home_dir =
getenv("JOHN_SYSTEMWIDE_HOME"))) { + strnzcpy(john_home_path, home_dir,
PATH_BUFFER_SIZE - 1); + strcat (john_home_path, "/"); + } else +
strnzcpy(john_home_path, JOHN_SYSTEMWIDE_HOME "/", PATH_BUFFER_SIZE);
john_home_length = strlen(john_home_path); if (user_home_path) return;|