mirror of
https://github.com/gophernicus/gophernicus.git
synced 2024-09-01 04:14:15 -04:00
Merge pull request #8 from vext01/no-personal-spaces
Add -nu flag to disable personal spaces.
This commit is contained in:
commit
536c989156
1
README
1
README
@ -45,6 +45,7 @@ Command line options:
|
|||||||
-nr Disable root user checking (for debugging)
|
-nr Disable root user checking (for debugging)
|
||||||
-np Disable HAproxy proxy protocol
|
-np Disable HAproxy proxy protocol
|
||||||
-nx Disable execution of gophermaps and scripts
|
-nx Disable execution of gophermaps and scripts
|
||||||
|
-nu Disable personal gopherspaces
|
||||||
|
|
||||||
-d Debug output in syslog and /server-status
|
-d Debug output in syslog and /server-status
|
||||||
-v Display version number and build date
|
-v Display version number and build date
|
||||||
|
@ -228,7 +228,8 @@ void selector_to_path(state *st)
|
|||||||
|
|
||||||
#ifdef HAVE_PASSWD
|
#ifdef HAVE_PASSWD
|
||||||
/* Virtual userdir (~user -> /home/user/public_gopher)? */
|
/* Virtual userdir (~user -> /home/user/public_gopher)? */
|
||||||
if (*(st->user_dir) && sstrncmp(st->req_selector, "/~") == MATCH) {
|
if (st->opt_personal_spaces && *(st->user_dir) &&
|
||||||
|
sstrncmp(st->req_selector, "/~") == MATCH) {
|
||||||
|
|
||||||
/* Parse userdir login name & path */;
|
/* Parse userdir login name & path */;
|
||||||
sstrlcpy(buf, st->req_selector + 2);
|
sstrlcpy(buf, st->req_selector + 2);
|
||||||
@ -464,6 +465,7 @@ void init_state(state *st)
|
|||||||
st->opt_root = TRUE;
|
st->opt_root = TRUE;
|
||||||
st->opt_proxy = TRUE;
|
st->opt_proxy = TRUE;
|
||||||
st->opt_exec = TRUE;
|
st->opt_exec = TRUE;
|
||||||
|
st->opt_personal_spaces = TRUE;
|
||||||
st->debug = FALSE;
|
st->debug = FALSE;
|
||||||
|
|
||||||
/* Load default suffix -> filetype mappings */
|
/* Load default suffix -> filetype mappings */
|
||||||
|
@ -360,6 +360,7 @@ typedef struct {
|
|||||||
char opt_root;
|
char opt_root;
|
||||||
char opt_proxy;
|
char opt_proxy;
|
||||||
char opt_exec;
|
char opt_exec;
|
||||||
|
char opt_personal_spaces;
|
||||||
char debug;
|
char debug;
|
||||||
} state;
|
} state;
|
||||||
|
|
||||||
|
2
menu.c
2
menu.c
@ -343,7 +343,7 @@ int gophermap(state *st, char *mapfile, int depth)
|
|||||||
if (type == '.') return QUIT;
|
if (type == '.') return QUIT;
|
||||||
|
|
||||||
/* Print a list of users with public_gopher */
|
/* Print a list of users with public_gopher */
|
||||||
if (type == '~') {
|
if (type == '~' && st->opt_personal_spaces) {
|
||||||
#ifdef HAVE_PASSWD
|
#ifdef HAVE_PASSWD
|
||||||
userlist(st);
|
userlist(st);
|
||||||
#endif
|
#endif
|
||||||
|
@ -145,6 +145,7 @@ void parse_args(state *st, int argc, char *argv[])
|
|||||||
if (*optarg == 'r') { st->opt_root = FALSE; break; }
|
if (*optarg == 'r') { st->opt_root = FALSE; break; }
|
||||||
if (*optarg == 'p') { st->opt_proxy = FALSE; break; }
|
if (*optarg == 'p') { st->opt_proxy = FALSE; break; }
|
||||||
if (*optarg == 'x') { st->opt_exec = FALSE; break; }
|
if (*optarg == 'x') { st->opt_exec = FALSE; break; }
|
||||||
|
if (*optarg == 'u') { st->opt_personal_spaces = FALSE; break; }
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'd': st->debug = TRUE; break;
|
case 'd': st->debug = TRUE; break;
|
||||||
|
Loading…
Reference in New Issue
Block a user