Software Freedom Law Center

Show
Ignore:
Timestamp:
05/01/08 21:46:48 (8 months ago)
Author:
bkuhn
Message:

r129@hughes: bkuhn | 2008-05-01 21:46:34 -0400

  • Merged upstream trac via: svk smerge /loblaw/local/branches/trac.upstream-r6969 .
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/trac/contrib/bugzilla2trac.py

    r46 r103  
    1515Many enhancements, Bill Soudan <bill@soudan.net> 
    1616Other enhancements, Florent Guillaume <fg@nuxeo.com> 
    17 Reworked, Jeroen Ruigrok van der Werven <asmodai@tendra.org> 
     17Reworked, Jeroen Ruigrok van der Werven <asmodai@in-nomine.org> 
    1818 
    1919$Id$ 
     
    2929# 
    3030# Currently, the following bugzilla versions are known to work: 
    31 #   2.11 (2110), 2.16.5 (2165), 2.18.3 (2183), 2.19.1 (2191) 
     31#   2.11 (2110), 2.16.5 (2165), 2.18.3 (2183), 2.19.1 (2191), 2.23.3 (2233) 
    3232# 
    3333# If you run this script on a version not listed here and it is successful, 
    34 # please report it to the Trac mailing list and drop a note to 
    35 # asmodai@tendra.org so we can update the list
     34# please file a ticket at http://trac.edgewall.org/ and assign it to 
     35# jruigrok
    3636BZ_VERSION = 2180 
    3737 
     
    428428    def getFieldName(self, cursor, fieldid): 
    429429        if fieldid not in self.fieldNameCache: 
    430             cursor.execute("SELECT * FROM fielddefs WHERE fieldid = %s", 
    431                            (fieldid)) 
     430            # fielddefs.fieldid got changed to fielddefs.id in Bugzilla 
     431            # 2.23.3. 
     432            if BZ_VERSION >= 2233: 
     433                cursor.execute("SELECT * FROM fielddefs WHERE id = %s", 
     434                               (fieldid)) 
     435            else: 
     436                cursor.execute("SELECT * FROM fielddefs WHERE fieldid = %s", 
     437                               (fieldid)) 
    432438            fieldName = cursor.fetchall() 
    433439 
  • trunk/trac/contrib/htdigest.py

    r57 r103  
    2323from getpass import getpass 
    2424 
    25 def get_digest(userprefix): 
     25def ask_pass(): 
    2626    pass1 = getpass('New password: ') 
    2727    pass2 = getpass('Re-type new password: ') 
     
    2929        print >>sys.stderr, "They don't match, sorry" 
    3030        sys.exit(1) 
    31     return userprefix + md5.new(userprefix + pass1).hexdigest() 
     31    return pass1 
    3232 
    33 usage = "%prog [-c] passwordfile realm username" 
     33def get_digest(userprefix, password=None): 
     34    if password == None: 
     35        password = ask_pass() 
     36    return make_digest(userprefix, password) 
     37 
     38def make_digest(userprefix, password): 
     39    return userprefix + md5.new(userprefix + password).hexdigest() 
     40 
     41usage = "%prog [-c] [-b] passwordfile realm username" 
    3442parser = OptionParser(usage=usage) 
    3543parser.add_option('-c', action='store_true', dest='create', default=False, 
    3644                  help='Create a new file') 
     45parser.add_option('-b', action='store_true', dest='batch', default=False, 
     46                  help='Batch mode, password on the commandline.') 
    3747 
    3848opts, args = parser.parse_args() 
    3949 
    4050try: 
    41     filename, realm, username = args 
     51    if opts.batch: 
     52        filename, realm, username, password = args 
     53    else: 
     54        filename, realm, username = args 
     55        password = None 
    4256except ValueError: 
    4357    parser.error('Wrong number of arguments') 
     
    5569            raise 
    5670    try: 
    57         print >>f, get_digest(prefix
     71        print >>f, get_digest(prefix, password
    5872    finally: 
    5973        f.close() 
     
    6478            if line.startswith(prefix): 
    6579                if not matched: 
    66                     print get_digest(prefix
     80                    print get_digest(prefix, password
    6781                matched = True 
    6882            else: 
     
    7185            f = open(filename, 'a') 
    7286            try: 
    73                 print >>f, get_digest(prefix
     87                print >>f, get_digest(prefix, password
    7488            finally: 
    7589                f.close() 

SFLC Main Page

[frdm] Support SFLC