My passkey looks like this:
http://myste/drupalweb/announce.php?passkey=%FB%B1%CD%BC%B4%3B.%5E%C2%04...

and I have problem- I can not seed torrent, I have this error: User does not have permission to user(yes, user not use) this tracker.

I hope You'll help me :)
/sorry for my bad english/

Comments

bradfordcp’s picture

Thanks for catching the bad string (many long nights went into this, apparently some were to long :)). As far as the passkey is concerned, it should be decoded automatically by php. The passkey that is created for you is created using sha1(, TRUE) meaning that the returned passkey does contain binary (the reason for all the escaping). I will look at converting the passkey into hex before assigning it to a user hopefully making everything easier on both the client and server side.

NOTE: This is a copy from the original post at #250601: Question about Bit Torrent

robbt’s picture

I'm also having a problem with the passkey. Instead of saying does not have permission my torrent client transmission is simply saying "Invalid passkey: qP%253BL%25DA%25A8%25BFg%25A3%25B3%25D7%25A3%25A1%259A%25CF%25D4%2516J%25E7%25E2". This is from a torrent that I had downloaded from another tracker and then resubmitted to my site as a test.

gildedgod’s picture

Grrrr!

I also have such a passkey and message "User does not have permission to user(yes, user not use) this tracker.":

http://****.ru/announce.php?passkey=%EB%DC%2B%F3%8F%05%C5%88NQ%1Di%81%CEV%92H%27u%D210

gildedgod’s picture

Assigned: Juris Malinens » gildedgod
Category: support » bug
Status: Active » Needs review

There some bugs in code:

  • announce.php, line 267-272:: Table 'users_role' doesn't exist

    FROM:

        // Determine if the user has permission to use the tracker.
        $role = db_result(db_query("SELECT r.name FROM {role} r INNER JOIN {users_role} ur ON ur.rid = r.rid INNER JOIN {permission} p ON p.rid = ur.rid WHERE ur.uid = %d AND p.perm LIKE '%download torrent%'"));
        
        if (!$role) {
          bt_message('User does not have permission to user the tracker.', BITTORRENT_MESSAGE_ERROR);
        }
    

    TO:

        // Determine if the user has permission to use the tracker.
        $role = db_result(db_query("SELECT r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid INNER JOIN {permission} p ON p.rid = ur.rid WHERE ur.uid = %d AND p.perm LIKE '%download torrent%'"));
        
        if (!$role) {
          bt_message('User does not have permission to user the tracker.', BITTORRENT_MESSAGE_ERROR);
        }
    

    There is a misprint here: users_roles

  • announce.php, line 69-73 :: Typical mistake

    FROM:

      if (array_key_exists('passkey', $request)) {
        if (strlen(urldecode($request['passkey'])) != 20) {
          bt_message('Invalid passkey: '. $request['passkey'], BITTORRENT_MESSAGE_ERROR);
        }
      }
    

    TO:

      if (array_key_exists('passkey', $request)) {
        if (strlen($request['passkey']) != 20) {
          bt_message('Invalid passkey: '. $request['passkey'], BITTORRENT_MESSAGE_ERROR);
        }
      }
    

    The superglobals $_GET and $_REQUEST are already decoded. Using urldecode() on an element in $_GET or $_REQUEST could have unexpected and dangerous results. http://php.net/urldecode

bradfordcp’s picture

Thanks for all of your help in finding and isolating these issues, I will try and roll in some of these changes over the weekend.

WeaselMan’s picture

Also, you should fix this permission problem too:

FROM:

    $role = db_result(db_query("SELECT r.name FROM {role} r INNER JOIN {users_role} ur ON ur.rid = r.rid INNER JOIN {permission} p ON p.rid = ur.rid WHERE ur.uid = %d AND p.perm LIKE '%download torrent%'"));

TO:

$role = db_result(db_query("SELECT r.name FROM {role} r INNER JOIN {users_roles} ur ON ur.rid = r.rid INNER JOIN {permission} p ON p.rid = ur.rid WHERE ur.uid = %d AND p.perm LIKE '%%download torrent%%'", $uid));

I replaced '%download torrent%' with '%%download torrent%%'

bradfordcp’s picture

The passkey system is getting an overhaul in the new D6 release. There is a focus on getting the basic tracker up and functioning nicely before implementing the system. The changes there will definitely be backported to here.

~Chris

liquixis’s picture

Status: Needs review » Closed (won't fix)

5.x version is longer not supported.