Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Do not allow the "fossil chat send" command to transmit over an unencrypted channel unless the --unsafe option is used on the command-line. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
6da3a74d5fa83b941de647a21f2c87a7 |
| User & Date: | drh 2021-01-05 01:32:42.918 |
Context
|
2021-01-05
| ||
| 02:05 | In the "fossil chat send" command, detect extra arguments and throw an error if they are seen. ... (check-in: 1814f528de user: drh tags: trunk) | |
| 01:32 | Do not allow the "fossil chat send" command to transmit over an unencrypted channel unless the --unsafe option is used on the command-line. ... (check-in: 6da3a74d5f user: drh tags: trunk) | |
| 01:26 | The "fossil chat send" command should throw an error if there are any unrecognized command-line options. ... (check-in: 904a5a5612 user: drh tags: trunk) | |
Changes
Changes to src/chat.c.
| ︙ | ︙ | |||
697 698 699 700 701 702 703 704 | ** The following subcommands are supported: ** ** > fossil chat send [ARGUMENTS] ** ** This command sends a new message to the chatroom. The message ** to be sent is determined by arguments as follows: ** ** -m|--message TEXT Text of the chat message | > | | 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 |
** The following subcommands are supported:
**
** > fossil chat send [ARGUMENTS]
**
** This command sends a new message to the chatroom. The message
** to be sent is determined by arguments as follows:
**
** -f|--file FILENAME File to attach to the message
** -m|--message TEXT Text of the chat message
** --unsafe Allow the use of unencrypted http://
**
** Additional subcommands may be added in the future.
*/
void chat_command(void){
const char *zUrl = find_option("remote",0,1);
int urlFlags = 0;
int isDefaultUrl = 0;
|
| ︙ | ︙ | |||
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 |
#else
zCmd = mprintf("%s \"%s/chat?cli\" &", zBrowser, zUrl);
#endif
fossil_system(zCmd);
}else if( strcmp(g.argv[2],"send")==0 ){
const char *zFilename = find_option("file","r",1);
const char *zMsg = find_option("message","m",1);
const int mFlags = HTTP_GENERIC | HTTP_QUIET | HTTP_NOCOMPRESS;
int i;
const char *zPw;
Blob up, down, fcontent;
char zBoundary[80];
sqlite3_uint64 r[3];
if( zFilename==0 && zMsg==0 ){
fossil_fatal("must have --message or --file or both");
}
verify_all_options();
i = (int)strlen(g.url.path);
while( i>0 && g.url.path[i-1]=='/' ) i--;
g.url.path = mprintf("%.*s/chat-send", i, g.url.path);
blob_init(&up, 0, 0);
blob_init(&down, 0, 0);
sqlite3_randomness(sizeof(r),r);
| > > > > | 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 |
#else
zCmd = mprintf("%s \"%s/chat?cli\" &", zBrowser, zUrl);
#endif
fossil_system(zCmd);
}else if( strcmp(g.argv[2],"send")==0 ){
const char *zFilename = find_option("file","r",1);
const char *zMsg = find_option("message","m",1);
int allowUnsafe = find_option("unsafe",0,0)!=0;
const int mFlags = HTTP_GENERIC | HTTP_QUIET | HTTP_NOCOMPRESS;
int i;
const char *zPw;
Blob up, down, fcontent;
char zBoundary[80];
sqlite3_uint64 r[3];
if( zFilename==0 && zMsg==0 ){
fossil_fatal("must have --message or --file or both");
}
if( !g.url.isHttps && !allowUnsafe ){
fossil_fatal("URL \"%s\" is unencrypted. Use https:// instead", zUrl);
}
verify_all_options();
i = (int)strlen(g.url.path);
while( i>0 && g.url.path[i-1]=='/' ) i--;
g.url.path = mprintf("%.*s/chat-send", i, g.url.path);
blob_init(&up, 0, 0);
blob_init(&down, 0, 0);
sqlite3_randomness(sizeof(r),r);
|
| ︙ | ︙ |