Date: Mon, 3 Oct 2016 18:20:58 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306651 - in head: include lib/libc/gen Message-ID: <201610031820.u93IKwIm043327@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Mon Oct 3 18:20:58 2016 New Revision: 306651 URL: https://svnweb.freebsd.org/changeset/base/306651 Log: 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 Modified: head/include/stdlib.h head/include/unistd.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/crypt.c Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Mon Oct 3 18:00:10 2016 (r306650) +++ head/include/stdlib.h Mon Oct 3 18:20:58 2016 (r306651) @@ -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); Modified: head/include/unistd.h ============================================================================== --- head/include/unistd.h Mon Oct 3 18:00:10 2016 (r306650) +++ head/include/unistd.h Mon Oct 3 18:20:58 2016 (r306651) @@ -449,8 +449,6 @@ int symlink(const char * __restrict, co /* 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 *); Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Mon Oct 3 18:00:10 2016 (r306650) +++ head/lib/libc/gen/Symbol.map Mon Oct 3 18:20:58 2016 (r306651) @@ -73,10 +73,6 @@ FBSD_1.0 { clock; closedir; confstr; - encrypt; - des_setkey; - des_cipher; - setkey; ctermid; ctermid_r; daemon; Modified: head/lib/libc/gen/crypt.c ============================================================================== --- head/lib/libc/gen/crypt.c Mon Oct 3 18:00:10 2016 (r306650) +++ head/lib/libc/gen/crypt.c Mon Oct 3 18:20:58 2016 (r306651) @@ -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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610031820.u93IKwIm043327>