[openssh-commits] [openssh] branch master updated: upstream: replace remaining cases where we manually included __func__

git+noreply at mindrot.org git+noreply at mindrot.org
Tue Sep 2 19:27:08 AEST 2025


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

The following commit(s) were added to refs/heads/master by this push:
     new a9b0b69f1 upstream: replace remaining cases where we manually included __func__
a9b0b69f1 is described below

commit a9b0b69f15e63bc4e8c8b38e24ee85ea076a7e11
Author: djm at openbsd.org <djm at openbsd.org>
AuthorDate: Tue Sep 2 09:26:21 2025 +0000

    upstream: replace remaining cases where we manually included __func__
    
    in a debug or error log with the respective *_f log variant
    
    OpenBSD-Commit-ID: 46a280d78bcc0bc98f28e65a30b613366600328f
---
 sftp-client.c | 10 +++++-----
 sftp-server.c | 10 +++++-----
 srclimit.c    | 10 +++++-----
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/sftp-client.c b/sftp-client.c
index 9f8ab4afa..3d8bb3496 100644
--- a/sftp-client.c
+++ b/sftp-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-client.c,v 1.177 2025/03/11 07:48:51 dtucker Exp $ */
+/* $OpenBSD: sftp-client.c,v 1.178 2025/09/02 09:26:21 djm Exp $ */
 /*
  * Copyright (c) 2001-2004 Damien Miller <djm at openbsd.org>
  *
@@ -1138,7 +1138,7 @@ sftp_copy(struct sftp_conn *conn, const char *oldpath, const char *newpath)
 	attr.flags |= SSH2_FILEXFER_ATTR_PERMISSIONS;
 
 	if ((msg = sshbuf_new()) == NULL)
-		fatal("%s: sshbuf_new failed", __func__);
+		fatal_f("sshbuf_new failed");
 
 	attrib_clear(&junk); /* Send empty attributes */
 
@@ -1149,7 +1149,7 @@ sftp_copy(struct sftp_conn *conn, const char *oldpath, const char *newpath)
 	    (r = sshbuf_put_cstring(msg, oldpath)) != 0 ||
 	    (r = sshbuf_put_u32(msg, SSH2_FXF_READ)) != 0 ||
 	    (r = encode_attrib(msg, &junk)) != 0)
-		fatal("%s: buffer error: %s", __func__, ssh_err(r));
+		fatal_fr(r, "buffer error");
 	send_msg(conn, msg);
 	debug3("Sent message SSH2_FXP_OPEN I:%u P:%s", id, oldpath);
 
@@ -1170,7 +1170,7 @@ sftp_copy(struct sftp_conn *conn, const char *oldpath, const char *newpath)
 	    (r = sshbuf_put_u32(msg, SSH2_FXF_WRITE|SSH2_FXF_CREAT|
 	    SSH2_FXF_TRUNC)) != 0 ||
 	    (r = encode_attrib(msg, &attr)) != 0)
-		fatal("%s: buffer error: %s", __func__, ssh_err(r));
+		fatal_fr(r, "buffer error");
 	send_msg(conn, msg);
 	debug3("Sent message SSH2_FXP_OPEN I:%u P:%s", id, newpath);
 
@@ -1194,7 +1194,7 @@ sftp_copy(struct sftp_conn *conn, const char *oldpath, const char *newpath)
 	    (r = sshbuf_put_u64(msg, 0)) != 0 ||
 	    (r = sshbuf_put_string(msg, new_handle, new_handle_len)) != 0 ||
 	    (r = sshbuf_put_u64(msg, 0)) != 0)
-		fatal("%s: buffer error: %s", __func__, ssh_err(r));
+		fatal_fr(r, "buffer error");
 	send_msg(conn, msg);
 	debug3("Sent message copy-data \"%s\" 0 0 -> \"%s\" 0",
 	       oldpath, newpath);
diff --git a/sftp-server.c b/sftp-server.c
index a4abb9f7c..c3baebd86 100644
--- a/sftp-server.c
+++ b/sftp-server.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp-server.c,v 1.148 2024/04/30 06:23:51 djm Exp $ */
+/* $OpenBSD: sftp-server.c,v 1.149 2025/09/02 09:26:21 djm Exp $ */
 /*
  * Copyright (c) 2000-2004 Markus Friedl.  All rights reserved.
  *
@@ -1620,7 +1620,7 @@ process_extended_copy_data(u_int32_t id)
 	    (r = sshbuf_get_u64(iqueue, &read_len)) != 0 ||
 	    (r = get_handle(iqueue, &write_handle)) != 0 ||
 	    (r = sshbuf_get_u64(iqueue, &write_off)) != 0)
-		fatal("%s: buffer error: %s", __func__, ssh_err(r));
+		fatal_fr(r, "buffer error");
 
 	debug("request %u: copy-data from \"%s\" (handle %d) off %llu len %llu "
 	    "to \"%s\" (handle %d) off %llu",
@@ -1648,14 +1648,14 @@ process_extended_copy_data(u_int32_t id)
 
 	if (lseek(read_fd, read_off, SEEK_SET) < 0) {
 		status = errno_to_portable(errno);
-		error("%s: read_seek failed", __func__);
+		error_f("read_seek failed");
 		goto out;
 	}
 
 	if ((handle_to_flags(write_handle) & O_APPEND) == 0 &&
 	    lseek(write_fd, write_off, SEEK_SET) < 0) {
 		status = errno_to_portable(errno);
-		error("%s: write_seek failed", __func__);
+		error_f("write_seek failed");
 		goto out;
 	}
 
@@ -1670,7 +1670,7 @@ process_extended_copy_data(u_int32_t id)
 			break;
 		} else if (ret == 0) {
 			status = errno_to_portable(errno);
-			error("%s: read failed: %s", __func__, strerror(errno));
+			error_f("read failed: %s", strerror(errno));
 			break;
 		}
 		len = ret;
diff --git a/srclimit.c b/srclimit.c
index c63a462e2..8a47588e4 100644
--- a/srclimit.c
+++ b/srclimit.c
@@ -119,7 +119,7 @@ srclimit_init(int max, int persource, int ipv4len, int ipv6len,
 	debug("%s: max connections %d, per source %d, masks %d,%d", __func__,
 	    max, persource, ipv4len, ipv6len);
 	if (max <= 0)
-		fatal("%s: invalid number of sockets: %d", __func__, max);
+		fatal_f("invalid number of sockets: %d", max);
 	children = xcalloc(max_children, sizeof(*children));
 	for (i = 0; i < max_children; i++)
 		children[i].id = -1;
@@ -136,7 +136,7 @@ srclimit_check_allow(int sock, int id)
 	if (max_persource == INT_MAX)	/* no limit */
 		return 1;
 
-	debug("%s: sock %d id %d limit %d", __func__, sock, id, max_persource);
+	debug_f("sock %d id %d limit %d", sock, id, max_persource);
 	if (srclimit_peer_addr(sock, &xa) != 0)
 		return 1;
 	bits = xa.af == AF_INET ? ipv4_masklen : ipv6_masklen;
@@ -154,14 +154,14 @@ srclimit_check_allow(int sock, int id)
 		}
 	}
 	if (addr_ntop(&xa, xas, sizeof(xas)) != 0) {
-		debug3("%s: addr ntop failed", __func__);
+		debug3_f("addr ntop failed");
 		return 1;
 	}
 	debug3("%s: new unauthenticated connection from %s/%d, at %d of %d",
 	    __func__, xas, bits, count, max_persource);
 
 	if (first_unused == max_children) { /* no free slot found */
-		debug3("%s: no free slot", __func__);
+		debug3_f("no free slot");
 		return 0;
 	}
 	if (first_unused < 0 || first_unused >= max_children)
@@ -185,7 +185,7 @@ srclimit_done(int id)
 	if (max_persource == INT_MAX)	/* no limit */
 		return;
 
-	debug("%s: id %d", __func__, id);
+	debug_f("id %d", id);
 	/* Clear corresponding state entry. */
 	for (i = 0; i < max_children; i++) {
 		if (children[i].id == id) {

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list