Fossil

Check-in [535714e3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:In the "fossil login-group" command, make sure to leave one group before joining another.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 535714e35cf9829b14e646a60654fbbb96a7cea0ce572505b10de3dad47e0c54
User & Date: drh 2019-05-29 00:57:47
Context
2019-05-29
13:27
Activate the load limiter for the /vdiff page. check-in: 76f4e009 user: drh tags: trunk
00:57
In the "fossil login-group" command, make sure to leave one group before joining another. check-in: 535714e3 user: drh tags: trunk
2019-05-28
20:53
Make the new "login-group" command a secondary command in the help system so that one needs to include the "--all" option to see it. check-in: fcec3edb user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/login.c.

2015
2016
2017
2018
2019
2020
2021



2022
2023
2024
2025
2026
2027
2028
....
2029
2030
2031
2032
2033
2034
2035

2036
2037
2038
2039
2040
2041
2042
      const char *zOther;
      char *zErr = 0;
      verify_all_options();
      if( g.argc!=4 ){
        fossil_fatal("unknown extra arguments to \"login-group add\"");
      }
      zOther = g.argv[3];



      login_group_join(zOther,0,0,0,zNewName,&zErr);
      if( zErr ){
        fossil_fatal("%s", zErr);
      }
    }else if( strncmp(zCmd,"leave",nCmd)==0 && nCmd>=1 ){
      verify_all_options();
      if( g.argc!=3 ){
................................................................................
        fossil_fatal("unknown extra arguments to \"login-group leave\"");
      }
      zLGName = login_group_name();
      if( zLGName ){
        char *zErr = 0;
        fossil_print("Leaving login-group \"%s\"\n", zLGName);
        login_group_leave(&zErr);

        return;
      }
    }else{
      fossil_fatal("unknown command \"%s\" - should be \"add\" or \"leave\"",
                   zCmd);
    }
  }







>
>
>







 







>







2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
....
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
      const char *zOther;
      char *zErr = 0;
      verify_all_options();
      if( g.argc!=4 ){
        fossil_fatal("unknown extra arguments to \"login-group add\"");
      }
      zOther = g.argv[3];
      login_group_leave(&zErr);
      sqlite3_free(zErr);
      zErr = 0;
      login_group_join(zOther,0,0,0,zNewName,&zErr);
      if( zErr ){
        fossil_fatal("%s", zErr);
      }
    }else if( strncmp(zCmd,"leave",nCmd)==0 && nCmd>=1 ){
      verify_all_options();
      if( g.argc!=3 ){
................................................................................
        fossil_fatal("unknown extra arguments to \"login-group leave\"");
      }
      zLGName = login_group_name();
      if( zLGName ){
        char *zErr = 0;
        fossil_print("Leaving login-group \"%s\"\n", zLGName);
        login_group_leave(&zErr);
        if( zErr ) fossil_fatal("Oops: %s", zErr);
        return;
      }
    }else{
      fossil_fatal("unknown command \"%s\" - should be \"add\" or \"leave\"",
                   zCmd);
    }
  }