Bug 284021 - usr.sbin/pkg/rsa.c: missing include of string.h
Summary: usr.sbin/pkg/rsa.c: missing include of string.h
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 13.4-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: Kyle Evans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-12 18:53 UTC by Trond Endrestøl
Modified: 2025-01-12 20:13 UTC (History)
1 user (show)

See Also:


Attachments
Patch for usr.sbin/pkg/rsa.c adding include of string.h (811 bytes, patch)
2025-01-12 18:54 UTC, Trond Endrestøl
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Trond Endrestøl 2025-01-12 18:53:22 UTC
On stable/13:

--- rsa.o ---
/usr/src/usr.sbin/pkg/rsa.c:164:37: error: call to undeclared library function 'strlen' with type 'unsigned long (const char *)'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
  164 |         ret = rsa_verify_data(ctx, sha256, strlen(sha256), sigfile, key, keylen,
      |                                            ^
/usr/src/usr.sbin/pkg/rsa.c:164:37: note: include the header <string.h> or explicitly provide a declaration for 'strlen'
1 error generated.
Comment 1 Trond Endrestøl 2025-01-12 18:54:02 UTC
Created attachment 256654 [details]
Patch for usr.sbin/pkg/rsa.c adding include of string.h
Comment 2 Kyle Evans freebsd_committer freebsd_triage 2025-01-12 20:08:24 UTC
Hmm, sorry about that.  I wonder where I'm getting pollution from...
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-01-12 20:12:06 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b8770ce1dfed52fcb7249cdf3cf4d4d16357b9fd

commit b8770ce1dfed52fcb7249cdf3cf4d4d16357b9fd
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2025-01-12 20:08:41 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2025-01-12 20:11:22 +0000

    pkg: include missing <string.h>

    My local environment seems to be seeing some pollution; we need
    <string.h> for strlen.

    PR:             284021
    Fixes:          2e065d74a5b0e ("pkg: add a pkgsign_verify_data [...]")
    MFC after:      immediately (trivial build fix)

 usr.sbin/pkg/rsa.c | 1 +
 1 file changed, 1 insertion(+)
Comment 4 commit-hook freebsd_committer freebsd_triage 2025-01-12 20:13:08 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=18790167dcacafeb7da9049fed8c66c2d07111d9

commit 18790167dcacafeb7da9049fed8c66c2d07111d9
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2025-01-12 20:08:41 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2025-01-12 20:12:12 +0000

    pkg: include missing <string.h>

    My local environment seems to be seeing some pollution; we need
    <string.h> for strlen.

    PR:             284021
    Fixes:          2e065d74a5b0e ("pkg: add a pkgsign_verify_data [...]")

    (cherry picked from commit b8770ce1dfed52fcb7249cdf3cf4d4d16357b9fd)

 usr.sbin/pkg/rsa.c | 1 +
 1 file changed, 1 insertion(+)
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-01-12 20:13:08 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=c6bf965f5d1d7cf32f26ecd5df0f8a5f5baebb0f

commit c6bf965f5d1d7cf32f26ecd5df0f8a5f5baebb0f
Author:     Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2025-01-12 20:08:41 +0000
Commit:     Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2025-01-12 20:12:18 +0000

    pkg: include missing <string.h>

    My local environment seems to be seeing some pollution; we need
    <string.h> for strlen.

    PR:             284021
    Fixes:          2e065d74a5b0e ("pkg: add a pkgsign_verify_data [...]")

    (cherry picked from commit b8770ce1dfed52fcb7249cdf3cf4d4d16357b9fd)

 usr.sbin/pkg/rsa.c | 1 +
 1 file changed, 1 insertion(+)
Comment 6 Kyle Evans freebsd_committer freebsd_triage 2025-01-12 20:13:21 UTC
Thanks!