|
楼主 |
发表于 2023-3-31 14:40:50
|
显示全部楼层
本帖最后由 pysunred 于 2023-3-31 14:42 编辑
# make
gcc -c -o smbencrypt/SMBPasswdGen.o smbencrypt/SMBPasswdGen.c
gcc -c -o smbencrypt/encrypt.o smbencrypt/encrypt.c
gcc -c -o smbencrypt/md4.o smbencrypt/md4.c
gcc -c -o smbencrypt/smbencrypt.o smbencrypt/smbencrypt.c
gcc changepassword.c -o changepassword.cgi smbencrypt/SMBPasswdGen.o smbencrypt/md4.o smbencrypt/smbencrypt.o smbencrypt/encrypt.o -lcrypt -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBCRYPT=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_STDIO_H=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_PWD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_SHADOW_H=1 -DHAVE_TIME_H=1 -DEnglish -DSMBPASSWD=\"/etc/samba/smbpasswd\" -DSQUIDPASSWD=\"no\" -DLOGO=\"opentech.jpg\" -L./smbencrypt -ldes
changepassword.c:48:1: 警告:返回类型默认为‘int’ [-Wimplicit-int]
48 | main(int argc, char *argv[]) {
| ^~~~
changepassword.c: 在函数‘main’中:
changepassword.c:188:12: 警告:隐式声明函数‘crypt’ [-Wimplicit-function-declaration]
188 | if (strcmp(crypt(form_pw,sd_list->sp_pwdp),sd_list->sp_pwdp))
| ^~~~~
changepassword.c:188:12: 警告:传递‘strcmp’的第 1 个参数时将整数赋给指针,未作类型转换 [-Wint-conversion]
188 | if (strcmp(crypt(form_pw,sd_list->sp_pwdp),sd_list->sp_pwdp))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from defs.h:7,
from changepassword.c:46:
/usr/include/string.h:140:32: 附注:需要类型‘const char *’,但实参的类型为‘int’
140 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
changepassword.c:220:6: 警告:隐式声明函数‘mkstemp’ [-Wimplicit-function-declaration]
220 | if ((mkstemp(TMPFILE))<0) {
| ^~~~~~~
changepassword.c:226:17: 警告:assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
226 | sd_list->sp_pwdp=crypt(form_newpw1,"$1$");
| ^
changepassword.c:244:1: 警告:隐式声明函数‘chmod’ [-Wimplicit-function-declaration]
244 | chmod(TMPFILE,0600);
| ^~~~~
changepassword.c: 在函数‘changesmbpass’中:
changepassword.c:476:25: 警告:隐式声明函数‘smbencrypt’ [-Wimplicit-function-declaration]
476 | smbencrypt(form_newpw1);
| ^~~~~~~~~~
changepassword.c:514:1: 警告:隐式声明函数‘flockfile’ [-Wimplicit-function-declaration]
514 | flockfile(smb_file);
| ^~~~~~~~~
changepassword.c:521:1: 警告:隐式声明函数‘funlockfile’ [-Wimplicit-function-declaration]
521 | funlockfile(smb_file);
| ^~~~~~~~~~~
changepassword.c: 在函数‘changesquidpass’中:
changepassword.c:600:34: 警告:assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
600 | squidpass=crypt(form_newpw1,salt);
| ^
changepassword.c: 在函数‘htoi’中:
changepassword.c:691:8: 警告:隐式声明函数‘isupper’ [-Wimplicit-function-declaration]
691 | if (isupper(c))
| ^~~~~~~
changepassword.c:47:1: 附注:include ‘<ctype.h>’ or provide a declaration of ‘isupper’
46 | #include "defs.h"
+++ |+#include <ctype.h>
47 |
changepassword.c:692:11: 警告:隐式声明函数‘tolower’ [-Wimplicit-function-declaration]
692 | c = tolower(c);
| ^~~~~~~
changepassword.c:692:11: 附注:include ‘<ctype.h>’ or provide a declaration of ‘tolower’
/usr/bin/ld: smbencrypt/encrypt.o:(.bss+0x0): multiple definition of `smbencrypted'; /tmp/ccci3HkK.o:(.bss+0xa0): first defined here
/usr/bin/ld: 当搜索用于 ./smbencrypt/libdes.a 时跳过不兼容的 -ldes
/usr/bin/ld: 找不到 -ldes
collect2: 错误:ld 返回 1
make: *** [Makefile:30:changepassword.cgi] 错误 1
# make install
gcc -c -o smbencrypt/SMBPasswdGen.o smbencrypt/SMBPasswdGen.c
gcc -c -o smbencrypt/encrypt.o smbencrypt/encrypt.c
gcc -c -o smbencrypt/md4.o smbencrypt/md4.c
gcc -c -o smbencrypt/smbencrypt.o smbencrypt/smbencrypt.c
gcc changepassword.c -o changepassword.cgi smbencrypt/SMBPasswdGen.o smbencrypt/md4.o smbencrypt/smbencrypt.o smbencrypt/encrypt.o -lcrypt -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_LIBCRYPT=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_STDIO_H=1 -DHAVE_STRING_H=1 -DHAVE_STDLIB_H=1 -DHAVE_PWD_H=1 -DHAVE_ERRNO_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_SHADOW_H=1 -DHAVE_TIME_H=1 -DEnglish -DSMBPASSWD=\"/etc/samba/smbpasswd\" -DSQUIDPASSWD=\"no\" -DLOGO=\"opentech.jpg\" -L./smbencrypt -ldes
changepassword.c:48:1: 警告:返回类型默认为‘int’ [-Wimplicit-int]
48 | main(int argc, char *argv[]) {
| ^~~~
changepassword.c: 在函数‘main’中:
changepassword.c:188:12: 警告:隐式声明函数‘crypt’ [-Wimplicit-function-declaration]
188 | if (strcmp(crypt(form_pw,sd_list->sp_pwdp),sd_list->sp_pwdp))
| ^~~~~
changepassword.c:188:12: 警告:传递‘strcmp’的第 1 个参数时将整数赋给指针,未作类型转换 [-Wint-conversion]
188 | if (strcmp(crypt(form_pw,sd_list->sp_pwdp),sd_list->sp_pwdp))
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int
In file included from defs.h:7,
from changepassword.c:46:
/usr/include/string.h:140:32: 附注:需要类型‘const char *’,但实参的类型为‘int’
140 | extern int strcmp (const char *__s1, const char *__s2)
| ~~~~~~~~~~~~^~~~
changepassword.c:220:6: 警告:隐式声明函数‘mkstemp’ [-Wimplicit-function-declaration]
220 | if ((mkstemp(TMPFILE))<0) {
| ^~~~~~~
changepassword.c:226:17: 警告:assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
226 | sd_list->sp_pwdp=crypt(form_newpw1,"$1$");
| ^
changepassword.c:244:1: 警告:隐式声明函数‘chmod’ [-Wimplicit-function-declaration]
244 | chmod(TMPFILE,0600);
| ^~~~~
changepassword.c: 在函数‘changesmbpass’中:
changepassword.c:476:25: 警告:隐式声明函数‘smbencrypt’ [-Wimplicit-function-declaration]
476 | smbencrypt(form_newpw1);
| ^~~~~~~~~~
changepassword.c:514:1: 警告:隐式声明函数‘flockfile’ [-Wimplicit-function-declaration]
514 | flockfile(smb_file);
| ^~~~~~~~~
changepassword.c:521:1: 警告:隐式声明函数‘funlockfile’ [-Wimplicit-function-declaration]
521 | funlockfile(smb_file);
| ^~~~~~~~~~~
changepassword.c: 在函数‘changesquidpass’中:
changepassword.c:600:34: 警告:assignment to ‘char *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
600 | squidpass=crypt(form_newpw1,salt);
| ^
changepassword.c: 在函数‘htoi’中:
changepassword.c:691:8: 警告:隐式声明函数‘isupper’ [-Wimplicit-function-declaration]
691 | if (isupper(c))
| ^~~~~~~
changepassword.c:47:1: 附注:include ‘<ctype.h>’ or provide a declaration of ‘isupper’
46 | #include "defs.h"
+++ |+#include <ctype.h>
47 |
changepassword.c:692:11: 警告:隐式声明函数‘tolower’ [-Wimplicit-function-declaration]
692 | c = tolower(c);
| ^~~~~~~
changepassword.c:692:11: 附注:include ‘<ctype.h>’ or provide a declaration of ‘tolower’
/usr/bin/ld: smbencrypt/encrypt.o:(.bss+0x0): multiple definition of `smbencrypted'; /tmp/ccvL2MpQ.o:(.bss+0xa0): first defined here
/usr/bin/ld: 当搜索用于 ./smbencrypt/libdes.a 时跳过不兼容的 -ldes
/usr/bin/ld: 找不到 -ldes
collect2: 错误:ld 返回 1
make: *** [Makefile:30:changepassword.cgi] 错误 1
|
|