diff --git a/lib/libutil/Symbol.map b/lib/libutil/Symbol.map --- a/lib/libutil/Symbol.map +++ b/lib/libutil/Symbol.map @@ -115,7 +115,6 @@ setclassenvironment; setclassresources; setusercontext; - trimdomain; uu_lock_txfr; uu_lock; uu_lockerr; @@ -130,6 +129,10 @@ crypt_set_format; }; +FBSD_1.9 { + trimdomain; +}; + FBSDprivate_1.0 { __pw_initpwd; }; diff --git a/lib/libutil/libutil.h b/lib/libutil/libutil.h --- a/lib/libutil/libutil.h +++ b/lib/libutil/libutil.h @@ -140,7 +140,7 @@ int realhostname_sa(char *_host, size_t _hsize, struct sockaddr *_addr, int _addrlen); int _secure_path(const char *_path, uid_t _uid, gid_t _gid); -void trimdomain(char *_fullhost, int _hostsize); +void trimdomain(char *_fullhost, size_t _hostsize); const char * uu_lockerr(int _uu_lockresult); int uu_lock(const char *_ttyname); diff --git a/lib/libutil/trimdomain.3 b/lib/libutil/trimdomain.3 --- a/lib/libutil/trimdomain.3 +++ b/lib/libutil/trimdomain.3 @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 7, 1999 +.Dd January 9, 2026 .Dt TRIMDOMAIN 3 .Os .Sh NAME @@ -34,7 +34,7 @@ .In sys/types.h .In libutil.h .Ft void -.Fn trimdomain "char *fullhost" "int hostsize" +.Fn trimdomain "char *fullhost" "size_t hostsize" .Sh DESCRIPTION The function .Fn trimdomain @@ -53,13 +53,13 @@ The .Fn trimdomain function will only trim the domain name if the passed -.Ar fullname +.Ar fullhost ends with the current domain name and if the length of the resulting host name does not exceed .Ar hostsize . .Pp If the passed -.Ar fullname +.Ar fullhost is actually a .Dv DISPLAY specification of the form diff --git a/lib/libutil/trimdomain.c b/lib/libutil/trimdomain.c --- a/lib/libutil/trimdomain.c +++ b/lib/libutil/trimdomain.c @@ -34,6 +34,7 @@ #include #include +void freebsd15_trimdomain(char *, int); static int isDISP(const char *); /*- @@ -50,7 +51,7 @@ * trimdomain("abcde.my.domain:0.0", 8) -> "abcde.my.domain:0.0" */ void -trimdomain(char *fullhost, int hostsize) +trimdomain(char *fullhost, size_t hostsize) { static size_t dlen; static int first = 1; @@ -89,6 +90,14 @@ } } +void +freebsd15_trimdomain(char *fullhost, int hostsize) +{ + trimdomain(fullhost, hostsize); +} + +__sym_compat(trimdomain, freebsd15_trimdomain, FBSD_1.8); + /* * Is the given string NN or NN.NN where ``NN'' is an all-numeric string ? */