diff --git a/config.l b/config.l index 9f53925..0de9362 100644 --- a/config.l +++ b/config.l @@ -93,6 +93,7 @@ unlink { yylval.i = DGLCMD_UNLINK; return TYPE_DGLCMD1; } setenv { yylval.i = DGLCMD_SETENV; return TYPE_DGLCMD2; } exec { yylval.i = DGLCMD_EXEC; return TYPE_DGLCMD2; } chpasswd { yylval.i = DGLCMD_CHPASSWD; return TYPE_DGLCMD0; } +chmail { yylval.i = DGLCMD_CHMAIL; return TYPE_DGLCMD0; } DEFINE { return TYPE_DEFINE_GAME; } diff --git a/dgamelaunch.h b/dgamelaunch.h index a9a2fe5..c409ace 100644 --- a/dgamelaunch.h +++ b/dgamelaunch.h @@ -104,6 +104,7 @@ typedef enum DGLCMD_UNLINK, /* unlink foo */ DGLCMD_EXEC, /* exec foo bar */ DGLCMD_SETENV, /* setenv foo bar */ + DGLCMD_CHMAIL, /* chmail */ DGLCMD_CHPASSWD /* chpasswd */ } dglcmd_actions; diff --git a/dgl-common.c b/dgl-common.c index 603713a..8cf41e9 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -200,6 +200,9 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me) case DGLCMD_CHPASSWD: if (loggedin) changepw(1); break; + case DGLCMD_CHMAIL: + if (loggedin) change_email(); + break; } free(p1); free(p2); diff --git a/examples/dgamelaunch.conf b/examples/dgamelaunch.conf index 8693f7d..5fd52d8 100644 --- a/examples/dgamelaunch.conf +++ b/examples/dgamelaunch.conf @@ -76,6 +76,7 @@ lockfile = "/dgl-lock" # setenv "foo "bar" = sets environment variable "foo" to "bar" # exec "foo" "bar" = execute "foo" with "bar" as it's param # chpasswd = do the change password prompting, if logged in +# chmail = do the change email prompting, if logged in # # The commands will be done inside the chroot and with the uid and gid # defined above.