Remove setkey(), encrypt(), des_setkey() and des_cipher().

The setkey() and encrypt() functions are part of XSI, not the POSIX base
definitions. There is no strict requirement for us to provide these,
especially if we're only going to keep these around as undocumented
stubs. The same holds for des_setkey() and des_cipher().

Instead of providing functions that only generate warnings when linking,
simply disallow linking against them. The impact of this is relatively
low. It only causes two leaf ports to break. I'll see what I can do to
help out to get those fixed.

PR:		211626
This commit is contained in:
Ed Schouten 2016-10-03 18:20:58 +00:00
parent 905339874b
commit 1a466ddc79
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=306651
4 changed files with 10 additions and 32 deletions

View file

@ -221,10 +221,6 @@ int putenv(char *);
long random(void);
unsigned short
*seed48(unsigned short[3]);
#ifndef _SETKEY_DECLARED
int setkey(const char *);
#define _SETKEY_DECLARED
#endif
char *setstate(/* const */ char *);
void srand48(long);
void srandom(unsigned int);

View file

@ -449,8 +449,6 @@ int symlink(const char * __restrict, const char * __restrict);
/* X/Open System Interfaces */
#if __XSI_VISIBLE
char *crypt(const char *, const char *);
/* char *ctermid(char *); */ /* XXX ??? */
int encrypt(char *, int);
long gethostid(void);
int lockf(int, int, off_t);
int nice(int);
@ -498,8 +496,6 @@ const char *
crypt_get_format(void);
char *crypt_r(const char *, const char *, struct crypt_data *);
int crypt_set_format(const char *);
int des_cipher(const char *, char *, long, int);
int des_setkey(const char *key);
int dup3(int, int, int);
int eaccess(const char *, int);
void endusershell(void);
@ -567,10 +563,6 @@ int setdomainname(const char *, int);
int setgroups(int, const gid_t *);
void sethostid(long);
int sethostname(const char *, int);
#ifndef _SETKEY_DECLARED
int setkey(const char *);
#define _SETKEY_DECLARED
#endif
int setlogin(const char *);
int setloginclass(const char *);
void *setmode(const char *);

View file

@ -73,10 +73,6 @@ FBSD_1.0 {
clock;
closedir;
confstr;
encrypt;
des_setkey;
des_cipher;
setkey;
ctermid;
ctermid_r;
daemon;

View file

@ -48,47 +48,41 @@ __FBSDID("$FreeBSD$");
* encryption, make sure you've got libcrypt.a around.
*/
__warn_references(des_setkey,
"WARNING! des_setkey(3) not present in the system!");
/* ARGSUSED */
int
des_setkey(const char *key __unused)
__freebsd11_des_setkey(const char *key __unused)
{
fprintf(stderr, "WARNING! des_setkey(3) not present in the system!\n");
return (0);
}
__warn_references(des_cipher,
"WARNING! des_cipher(3) not present in the system!");
/* ARGSUSED */
int
des_cipher(const char *in, char *out, long salt __unused, int num_iter __unused)
__freebsd11_des_cipher(const char *in, char *out, long salt __unused,
int num_iter __unused)
{
fprintf(stderr, "WARNING! des_cipher(3) not present in the system!\n");
bcopy(in, out, 8);
return (0);
}
__warn_references(setkey,
"WARNING! setkey(3) not present in the system!");
/* ARGSUSED */
int
setkey(const char *key __unused)
__freebsd11_setkey(const char *key __unused)
{
fprintf(stderr, "WARNING! setkey(3) not present in the system!\n");
return (0);
}
__warn_references(encrypt,
"WARNING! encrypt(3) not present in the system!");
/* ARGSUSED */
int
encrypt(char *block __unused, int flag __unused)
__freebsd11_encrypt(char *block __unused, int flag __unused)
{
fprintf(stderr, "WARNING! encrypt(3) not present in the system!\n");
return (0);
}
__sym_compat(des_setkey, __freebsd11_des_setkey, FBSD_1.0);
__sym_compat(des_cipher, __freebsd11_des_cipher, FBSD_1.0);
__sym_compat(setkey, __freebsd11_setkey, FBSD_1.0);
__sym_compat(encrypt, __freebsd11_encrypt, FBSD_1.0);