]> skyeroc.xyz Git - dgamelaunch/commitdiff
passwd file is global config, not per-game
authorPasi Kallinen <paxed@alt.org>
Sat, 31 Mar 2007 21:18:32 +0000 (21:18 +0000)
committerPasi Kallinen <paxed@alt.org>
Sat, 31 Mar 2007 21:18:32 +0000 (21:18 +0000)
git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@351 db0b04b0-f4d1-0310-9a6d-de3e77497b0e

config.y
dgamelaunch.c
dgamelaunch.h
dgl-common.c

index 694745992901e26fb4c4053caf3026c8b0f048f8..bd8137427d5727e8cc09065383e37fd681c58311 100644 (file)
--- a/config.y
+++ b/config.y
@@ -170,8 +170,8 @@ KeyPair: KeyType '=' TYPE_VALUE {
       break;
 
     case TYPE_PATH_PASSWD:
-      if (myconfig[ncnf]->passwd) free(myconfig[ncnf]->passwd);
-      myconfig[ncnf]->passwd = strdup($3);
+      if (globalconfig.passwd) free(globalconfig.passwd);
+      globalconfig.passwd = strdup($3);
       break;
 
     case TYPE_PATH_SAVEFILEFMT:
index 15246cdfab897c5a93d1bff4410bb6f0c8623d37..a2534806d366d60b2dc8ef6a7cb2833150d95426 100644 (file)
@@ -1108,7 +1108,7 @@ readfile (int nolock)
         graceful_exit (114);
     }
 
-  fp = fopen (myconfig[0]->passwd, "r");
+  fp = fopen (globalconfig.passwd, "r");
   if (!fp)
     graceful_exit (106);
 
@@ -1331,7 +1331,7 @@ writefile (int requirenew)
   freefile ();
   readfile (1);
 
-  fp = fopen (myconfig[0]->passwd, "w");
+  fp = fopen (globalconfig.passwd, "w");
   if (!fp)
     {
       sigprocmask(SIG_SETMASK, &oldmask, NULL);
@@ -1972,7 +1972,7 @@ main (int argc, char** argv)
   printf("game:'%s'\n", myconfig[userchoice]->game_name);
   printf("dglroot:'%s'\n", globalconfig.dglroot);
   printf("lockfile:'%s'\n", myconfig[userchoice]->lockfile);
-  printf("passwd:'%s'\n", myconfig[userchoice]->passwd);
+  printf("passwd:'%s'\n", globalconfig.passwd);
   printf("banner:'%s'\n", globalconfig.banner);
   printf("rcfile:'%s'\n", myconfig[userchoice]->rcfile);
   printf("spool:'%s'\n", myconfig[userchoice]->spool);
index c82169dc448ba2e436b5420e885f00ad26dfe821..7318daa1983319ce1877dc9eb15c5bacf4b47a76 100644 (file)
@@ -47,7 +47,6 @@ struct dg_config
   char* game_name;
   char* chdir;
   char* lockfile;
-  char* passwd;
   char* rcfile;
   char* spool;
   char* savefilefmt;
@@ -68,6 +67,7 @@ struct dg_globalconfig
     char* shed_group;
     uid_t shed_uid;
     gid_t shed_gid;
+    char* passwd;
 };
 
 /* Global variables */
index f3f8e752c61e827cea7e9860afbc94dbaa67833d..d7d27942b06aa1482e04ff24b78eb9e12081530b 100644 (file)
@@ -24,7 +24,7 @@ struct dg_config defconfig = {
   /* chdir = */ NULL,
   /* dglroot = *//*  "/dgldir/",*/
   /* lockfile = */ "/dgl-lock",
-  /* passwd = */ "/dgl-login",
+  /* passwd = */ /*"/dgl-login",*/
   /* banner = */ /*"/dgl-banner",*/
   /* rcfile = */ NULL, /*"/dgl-default-rcfile",*/
   /* spool = */ "/var/mail/",
@@ -328,7 +328,6 @@ create_config ()
       if (!myconfig[tmp]->game_name) myconfig[tmp]->game_name = defconfig.game_name;
       if (!myconfig[tmp]->rcfile) myconfig[tmp]->rcfile = defconfig.rcfile;
       if (!myconfig[tmp]->spool) myconfig[tmp]->spool = defconfig.spool;
-      if (!myconfig[tmp]->passwd) myconfig[tmp]->passwd = defconfig.passwd;
       if (!myconfig[tmp]->lockfile) myconfig[tmp]->lockfile = defconfig.lockfile;
       if (!myconfig[tmp]->savefilefmt) myconfig[tmp]->savefilefmt = defconfig.savefilefmt;
       if (!myconfig[tmp]->inprogressdir) myconfig[tmp]->inprogressdir = defconfig.inprogressdir;
@@ -342,6 +341,8 @@ create_config ()
   if (!globalconfig.dglroot) globalconfig.dglroot = "/dgldir/";
   if (!globalconfig.banner)  globalconfig.banner = "/dgl-banner";
 
+  if (!globalconfig.passwd) globalconfig.passwd = "/dgl-login";
+
   if (!globalconfig.shed_user && globalconfig.shed_uid == (uid_t)-1)
          {
              struct passwd *pw;