]> sipb.mit.edu Git - snippets/.git/log
snippets/.git
11 years agoWrappers for safely calling commands in a new PAG
Alex Dehnert [Sun, 16 Sep 2012 01:53:40 +0000 (21:53 -0400)] 
Wrappers for safely calling commands in a new PAG

The usual mechanism for starting a new PAG is pagsh(1). Unfortunately, because
it basically just execvp(3) /bin/sh passing the appropriate arguments, it isn't
immediately obvious how to safely pass arguments that may contain shell
metacharacters. By using the shell's exec and taking advantage of the fact that
later arguments to /bin/sh end up in $@ we can safely avoid shell
metacharacters. We wrap subprocess.check_{call,output} in
pag_check_{call,output}, which perform appropriate contortions to establish the
PAG before safely executing the passed commands without evaluating any
metacharacters.

11 years agoValidate constitution_url (ASA-#76)
Alex Dehnert [Mon, 10 Sep 2012 08:50:40 +0000 (04:50 -0400)] 
Validate constitution_url (ASA-#76)

12 years agoDjango MIT plugin: Don't crash on users with hidden emails (ASA Trac: #63)
Geoffrey Thomas [Tue, 24 Jan 2012 06:57:01 +0000 (01:57 -0500)] 
Django MIT plugin: Don't crash on users with hidden emails (ASA Trac: #63)

12 years agoFunction to create an MIT user with LDAP data
Alex Dehnert [Sun, 18 Dec 2011 05:49:59 +0000 (00:49 -0500)] 
Function to create an MIT user with LDAP data

This adds a function get_or_create_mit_user. As with the "get_or_create"
methods on managers, this returns an object satisfying some conditions,
creating it if necessary. In this case, we return a User object that's
populated using data from MIT's LDAP. If the user does not exist and
cannot be found in LDAP, we raise an exception.

12 years agoScripts auth: Use ldap-too for LDAP server
Alex Dehnert [Tue, 25 Oct 2011 16:25:33 +0000 (12:25 -0400)] 
Scripts auth: Use ldap-too for LDAP server

Apparently it includes email addresses for people who have suppressed it,
unlike ldap.mit.edu.

12 years agoMerge "upstream" fixes from SIPB's snippets
Alex Dehnert [Mon, 6 Jun 2011 07:10:15 +0000 (03:10 -0400)] 
Merge "upstream" fixes from SIPB's snippets

13 years agolocalhost check needs to use portless-HTTP_HOST
Alex Dehnert [Sun, 30 May 2010 02:34:45 +0000 (22:34 -0400)] 
localhost check needs to use portless-HTTP_HOST

As a bonus, this gets around the problem that the Django dev server doesn't
set REQUEST_URI.

13 years agoAdd scripts_login, to do cert login if possible
Alex Dehnert [Sun, 30 May 2010 01:10:59 +0000 (21:10 -0400)] 
Add scripts_login, to do cert login if possible

13 years agoShamelessly lift MIT-specific code from Remit
Alex Dehnert [Thu, 13 May 2010 09:58:47 +0000 (05:58 -0400)] 
Shamelessly lift MIT-specific code from Remit