Commit f56f3542 authored by BERJON Matthieu's avatar BERJON Matthieu
Browse files

Merge branch 'port-ssh-container-to-django-models' into 'django'

port the ssh container to the django models

See merge request !122
parents 7df2a90a 38026c69
Pipeline #40175 failed with stage
in 1 minute and 3 seconds
......@@ -48,7 +48,7 @@ int main(int argc, char* argv[])
die_mysqlerror(my, "mysql_real_escape_string");
}
const char* template = "SELECT sshkey FROM webapps JOIN users ON webapps.user_id=users.id OR users.admin=1 WHERE webapps.docker_name='%s'";
const char* template = "SELECT sshkey FROM dj_webapps JOIN auth_user ON (auth_user.id=dj_webapps.user_id OR auth_user.is_superuser=1) JOIN dj_users ON dj_users.user_id=auth_user.id WHERE dj_webapps.docker_name='%s'";
char* cmd = malloc(strlen(template) + strlen(escaped_name));
if (!cmd) {
......
getpwnam SELECT docker_name AS username,'x',id+2000 AS uid,65534 AS gid,name AS gecos,"/nohome" AS homedir, "/bin/allgo-shell" AS shell \
FROM webapps \
FROM dj_webapps \
WHERE docker_name='%1$s' \
LIMIT 1
getpwuid SELECT docker_name AS username,'x',id+2000 AS uid,65534 AS gid,name AS gecos,"/nohome" AS homedir, "/bin/allgo-shell" AS shell \
FROM webapps \
FROM dj_webapps \
WHERE id=%1$u-2000 \
LIMIT 1
getpwent SELECT docker_name AS username,'x',id+2000 AS uid,65534 AS gid,name AS gecos,"/nohome" AS homedir, "/bin/allgo-shell" AS shell \
FROM webapps LIMIT 0;
FROM dj_webapps LIMIT 0;
getspnam SELECT name,'*','1','','99999999999','','','99999999999','' \
FROM webapps \
FROM dj_webapps \
WHERE docker_name='%1$s' \
LIMIT 1
getspuid SELECT name,'*','1','','99999999999','','','99999999999','' \
FROM webapps \
FROM dj_webapps \
WHERE id=%1$u-2000 \
LIMIT 1
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment