mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
Increase MAX command, and arg., length: 64 -> 256
With non-standard paths, e.g., when running `make distcheck`, the absolute path to some commands become ridiculously long. However, this has been a recurring issue for some users in the past, so it is time to increase the capabilibieies of Finit to cover this. Yes, a better way is probably to allocate all these strings when they are used, but that would require a redesign of the initctl API and likely cause a lot of regressions before everything has stabilized. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
480d29175c
commit
939ae02a6a
3 files changed
+10
-9
No files matched your search
@@ -101,7 +101,7 @@ static int modules_load(const char *file, int index)
|
|||||||
}
|
}
|
||||||
|
|
||||||
while ((line = fparseln(fp, NULL, NULL, NULL, 0))) {
|
while ((line = fparseln(fp, NULL, NULL, NULL, 0))) {
|
||||||
char cmd[CMD_SIZE * 2], *mod, *args, *set;
|
char cmd[CMD_SIZE], *mod, *args, *set;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* fparseln() skips regular UNIX comments only.
|
* fparseln() skips regular UNIX comments only.
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@
|
|||||||
#define _PATH_SULOGIN FINIT_EXECPATH_ "/sulogin"
|
#define _PATH_SULOGIN FINIT_EXECPATH_ "/sulogin"
|
||||||
#define _PATH_GETTY FINIT_EXECPATH_ "/getty"
|
#define _PATH_GETTY FINIT_EXECPATH_ "/getty"
|
||||||
|
|
||||||
#define CMD_SIZE 256
|
#define CMD_SIZE 1024
|
||||||
#define LINE_SIZE 1024
|
#define LINE_SIZE 1024
|
||||||
#define BUF_SIZE 4096
|
#define BUF_SIZE 4096
|
||||||
|
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ typedef enum {
|
|||||||
|
|
||||||
#define MAX_ID_LEN 16
|
#define MAX_ID_LEN 16
|
||||||
#define MAX_ARG_LEN 64
|
#define MAX_ARG_LEN 64
|
||||||
|
#define MAX_CMD_LEN 256
|
||||||
#define MAX_IDENT_LEN (MAX_ARG_LEN + MAX_ID_LEN + 1)
|
#define MAX_IDENT_LEN (MAX_ARG_LEN + MAX_ID_LEN + 1)
|
||||||
#define MAX_STR_LEN 64
|
#define MAX_STR_LEN 64
|
||||||
#define MAX_COND_LEN (MAX_ARG_LEN * 3)
|
#define MAX_COND_LEN (MAX_ARG_LEN * 3)
|
||||||
@@ -118,7 +119,7 @@ typedef struct svc {
|
|||||||
int sighalt; /* Signal to stop process, default: SIGTERM */
|
int sighalt; /* Signal to stop process, default: SIGTERM */
|
||||||
int killdelay; /* Delay in msec before sending SIGKILL */
|
int killdelay; /* Delay in msec before sending SIGKILL */
|
||||||
pid_t oldpid, pid;
|
pid_t oldpid, pid;
|
||||||
char pidfile[256];
|
char pidfile[MAX_CMD_LEN];
|
||||||
long start_time; /* Start time, as seconds since boot, from sysinfo() */
|
long start_time; /* Start time, as seconds since boot, from sysinfo() */
|
||||||
int started; /* Set for run/task/sysv to track if started */
|
int started; /* Set for run/task/sysv to track if started */
|
||||||
int status; /* From waitpid() when process is collected */
|
int status; /* From waitpid() when process is collected */
|
||||||
@@ -181,15 +182,15 @@ typedef struct svc {
|
|||||||
char group[MAX_USER_LEN];
|
char group[MAX_USER_LEN];
|
||||||
|
|
||||||
/* Command, arguments and service description */
|
/* Command, arguments and service description */
|
||||||
char cmd[MAX_ARG_LEN];
|
char cmd[MAX_CMD_LEN];
|
||||||
char args[MAX_NUM_SVC_ARGS][MAX_ARG_LEN];
|
char args[MAX_NUM_SVC_ARGS][MAX_CMD_LEN];
|
||||||
int args_dirty;
|
int args_dirty;
|
||||||
char conflict[MAX_ARG_LEN];
|
char conflict[MAX_ARG_LEN];
|
||||||
char desc[MAX_STR_LEN];
|
char desc[MAX_STR_LEN];
|
||||||
char env[MAX_ARG_LEN];
|
char env[MAX_CMD_LEN];
|
||||||
char pre_script[MAX_ARG_LEN];
|
char pre_script[MAX_CMD_LEN];
|
||||||
char post_script[MAX_ARG_LEN];
|
char post_script[MAX_CMD_LEN];
|
||||||
char ready_script[MAX_ARG_LEN];
|
char ready_script[MAX_CMD_LEN];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Used to forcefully kill services that won't shutdown on
|
* Used to forcefully kill services that won't shutdown on
|
||||||
|
|||||||
Reference in new issue
Block a user