Sharing Hall of Fame on multiuser system

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • audiodude
    Rookie
    • Oct 2014
    • 11

    Sharing Hall of Fame on multiuser system

    Hi!

    I've installed angband on a shared Linux system as a fun diversion for the local users. But everyone only sees their own hall of fame! Is there anyway to symlink a file in the filesystem somewhere so that the hall of fames are linked together?

    Thanks!
    -Travis
  • audiodude
    Rookie
    • Oct 2014
    • 11

    #2
    So I've tried recompiling with:

    $ ./configure --with-setgid=games

    But it seems like if you're on a UNIX-y system you end up with PRIVATE_USER_PATH set anyways:



    So is the solution just to delete those lines?

    Thanks,
    -Travis

    Comment

    • audiodude
      Rookie
      • Oct 2014
      • 11

      #3
      Tried deleting the following lines:

      Code:
      /*
       * OPTION: Create and use a hidden directory in the users home directory
       * for storing pref files and character dumps.
       */
      #if defined(UNIX) && !defined(MACH_O_CARBON) && !defined(PRIVATE_USER_PATH)
      # define PRIVATE_USER_PATH "~/.angband"
      #endif
      and recompiling, but it didn't seem to help. Angband wanted to create a directory when it started up the first time: /usr/local/var/games/angband/user

      Comment

      • Nick
        Vanilla maintainer
        • Apr 2007
        • 9338

        #4
        I'm no expert, but you could try
        Code:
        ./configure --without-private-dirs
        One for the Dark Lord on his dark throne
        In the Land of Mordor where the Shadows lie.

        Comment

        • audiodude
          Rookie
          • Oct 2014
          • 11

          #5
          Originally posted by Nick
          I'm no expert, but you could try
          Code:
          ./configure --without-private-dirs
          I did try that, but it doesn't work. It still outputs:

          Code:
            var path:                               (not used)
            (with private save and score files in ~/.angband/Angband/)

          Comment

          • AnonymousHero
            Veteran
            • Jun 2007
            • 1322

            #6
            I don't know how to get this working, but I think I ought to point out that there are probably(!) numerous security issues with this even if you get it working. (Angband and C codebases of its age are not exactly known for good security practices.)

            Comment

            • myshkin
              Angband Devteam member
              • Apr 2007
              • 327

              #7
              Originally posted by audiodude
              I did try that, but it doesn't work. It still outputs:

              Code:
                var path:                               (not used)
                (with private save and score files in ~/.angband/Angband/)
              I think you need to specify --with-setgid=<groupname>. I suspect that these code paths are old and not well tested, though.

              Comment

              • Magnate
                Angband Devteam member
                • May 2007
                • 4916

                #8
                Originally posted by myshkin
                I think you need to specify --with-setgid=<groupname>. I suspect that these code paths are old and not well tested, though.
                This is correct. Be warned that this setgid build mode is unmaintained though, as it's deprecated as a security risk.

                This is a shame, because shared halls of fame are a neat idea, but you're the first person in about a decade to want one.

                Let me know if you're still trying to get it working - I am back to building Angband and may be able to help.
                "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                Comment

                • audiodude
                  Rookie
                  • Oct 2014
                  • 11

                  #9
                  Originally posted by audiodude
                  Tried deleting the following lines:

                  Code:
                  /*
                   * OPTION: Create and use a hidden directory in the users home directory
                   * for storing pref files and character dumps.
                   */
                  #if defined(UNIX) && !defined(MACH_O_CARBON) && !defined(PRIVATE_USER_PATH)
                  # define PRIVATE_USER_PATH "~/.angband"
                  #endif
                  and recompiling, but it didn't seem to help. Angband wanted to create a directory when it started up the first time: /usr/local/var/games/angband/user
                  So it turns out this worked. After I create a random character and let him get killed on level 1 by a Jackal, the dead character showed up on my other user's hall of fame.

                  When you first start up Angband after doing this hack, it will say
                  Code:
                  angband: Cannot create '/usr/local/var/games/angband/user'
                  This is overcome by the following:

                  Code:
                  $ sudo mkdir /usr/local/var/games/angband/user
                  $ sudo chown root:games /usr/local/var/games/angband/user
                  Substituting "games" for whatever group you used for setgid in the confgure options of course.

                  Now what would be really cool is if it read other people's in-progress saves into the Hall of Fame display. I wonder if I could hack that together (I don't know much C, only Python and Javascript yikes!). But I feel I could hack it well enough that it would work on my system, even if it didn't work on others'.

                  Comment

                  • Magnate
                    Angband Devteam member
                    • May 2007
                    • 4916

                    #10
                    Originally posted by audiodude
                    So it turns out this worked. After I create a random character and let him get killed on level 1 by a Jackal, the dead character showed up on my other user's hall of fame.

                    When you first start up Angband after doing this hack, it will say
                    Code:
                    angband: Cannot create '/usr/local/var/games/angband/user'
                    This is overcome by the following:

                    Code:
                    $ sudo mkdir /usr/local/var/games/angband/user
                    $ sudo chown root:games /usr/local/var/games/angband/user
                    Substituting "games" for whatever group you used for setgid in the confgure options of course.

                    Now what would be really cool is if it read other people's in-progress saves into the Hall of Fame display. I wonder if I could hack that together (I don't know much C, only Python and Javascript yikes!). But I feel I could hack it well enough that it would work on my system, even if it didn't work on others'.
                    Thanks for the update - I can probably fix the dir creation issue.

                    The way to achieve your last idea is to have the game add the in-progress savefile to the Hall of Fame on exit, just as if the character's dead. The difficult bit is to *delete* the previous entry for the same character so that a living character appears only once. To my knowledge the hall of fame code is add-only.
                    "Been away so long I hardly knew the place, gee it's good to be back home" - The Beatles

                    Comment

                    • myshkin
                      Angband Devteam member
                      • Apr 2007
                      • 327

                      #11
                      Originally posted by Magnate
                      The way to achieve your last idea is to have the game add the in-progress savefile to the Hall of Fame on exit, just as if the character's dead. The difficult bit is to *delete* the previous entry for the same character so that a living character appears only once. To my knowledge the hall of fame code is add-only.
                      Alternately, if permissions are such that the game binary can read all savefiles (but only write the user's), then predict_score() could add all scores, not just that of the current character.

                      Comment

                      Working...
                      😀
                      😂
                      🥰
                      😘
                      🤢
                      😎
                      😞
                      😡
                      👍
                      👎