diff --git a/dgamelaunch.c b/dgamelaunch.c index bc9002e..dd3d887 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -2164,7 +2164,7 @@ userexist (char *cname, int isnew) qbuf = sqlite3_mprintf("select * from dglusers where username like '%q' limit 1", tmpbuf); - ret = sqlite3_open(USE_SQLITE_DB, &db); /* FIXME: use globalconfig->passwd? */ + ret = sqlite3_open(globalconfig.passwd, &db); if (ret) { sqlite3_close(db); debug_write("sqlite3_open failed"); @@ -2352,7 +2352,7 @@ writefile (int requirenew) qbuf = sqlite3_mprintf("update dglusers set username='%q', email='%q', env='%q', password='%q', flags=%li where id=%i", me->username, me->email, me->env, me->password, me->flags, me->id); } - ret = sqlite3_open(USE_SQLITE_DB, &db); /* FIXME: use globalconfig->passwd? */ + ret = sqlite3_open(globalconfig.passwd, &db); if (ret) { sqlite3_close(db); debug_write("writefile sqlite3_open failed"); diff --git a/dgl-common.c b/dgl-common.c index 084e0ea..20aff4f 100644 --- a/dgl-common.c +++ b/dgl-common.c @@ -807,7 +807,11 @@ create_config () if (!globalconfig.dglroot) globalconfig.dglroot = "/dgldir/"; if (!globalconfig.banner) globalconfig.banner = "/dgl-banner"; +#ifndef USE_SQLITE3 if (!globalconfig.passwd) globalconfig.passwd = "/dgl-login"; +#else + if (!globalconfig.passwd) globalconfig.passwd = USE_SQLITE_DB; +#endif if (!globalconfig.lockfile) globalconfig.lockfile = "/dgl-lock"; if (!globalconfig.shed_user && globalconfig.shed_uid == (uid_t)-1) { diff --git a/examples/dgamelaunch.conf b/examples/dgamelaunch.conf index 9e1eef5..a162274 100644 --- a/examples/dgamelaunch.conf +++ b/examples/dgamelaunch.conf @@ -96,13 +96,13 @@ locale = "en_US.UTF-8" # For setting game idle time, use max_idle_time in the game DEFINE. # menu_max_idle_time = 1024 -# The defaults are usually just fine for this. passwd refers to the file -# that stores the user database, and lockfile is only used internally by -# dgamelaunch. -# passwd doesn't matter if dgl was compiled with SQLite, as the name of -# the sqlite database will be defined at compile time. -passwd = "/dgl-login" -lockfile = "/dgl-lock" +# Passwd refers to the file that stores the user database. +# The default passwd file is "/dgl-login" for flat-text database, and for +# sqlite, whatever value was defined for the sqlite database at compile time. +#passwd = "/dgl-login" + +# Lockfile is used only when dgl was compiled without sqlite. +#lockfile = "/dgl-lock" # # define some commands that are run when something happens. format is