Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
default is an SQL keyword, so protect it with appropriate quoting.
Matthew Seaman committed 13 years ago
commit b428a95675071316f4921039ae1a79c1724b17c9
parent 0630406c98bb4b933f98137d052f12925d1c05f1
2 files changed +3 -3
modified libpkg/pkg_repo.c
@@ -260,7 +260,7 @@ get_repo_user_version(sqlite3 *sqlite, const char *database, int *reposcver)
	sqlite3_stmt *stmt;
	int retcode;
	char sql[BUFSIZ];
-
	const char *fmt = "PRAGMA %s.user_version";
+
	const char *fmt = "PRAGMA \"%s\".user_version";

	assert(database != NULL);

modified libpkg/pkgdb.c
@@ -730,7 +730,7 @@ pkgdb_open(struct pkgdb **db_p, pkgdb_t type)
					return (EPKG_ENODB);
				}

-
				if (sql_exec(db->sqlite, "ATTACH '%q' AS '%q';", remotepath, repo_name) != EPKG_OK) {
+
				if (sql_exec(db->sqlite, "ATTACH '%s' AS '%s';", remotepath, repo_name) != EPKG_OK) {
					pkgdb_close(db);
					return (EPKG_FATAL);
				}
@@ -741,7 +741,7 @@ pkgdb_open(struct pkgdb **db_p, pkgdb_t type)
					return (EPKG_FATAL);
					break;
				case EPKG_REPOSCHEMA:
-
					if (sql_exec(db->sqlite, "DETACH DATABSE '%q'", repo_name) != EPKG_OK) {
+
					if (sql_exec(db->sqlite, "DETACH DATABASE '%s'", repo_name) != EPKG_OK) {
						pkgdb_close(db);
						return (EPKG_FATAL);
					}