aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2025-05-20 19:36:02 +0200
committerFlorian Weimer <fweimer@redhat.com>2025-05-20 19:41:26 +0200
commit2ca34d76270d02d576e385db76ebb05ce54d443c (patch)
tree2d80669f44aadf2bff05fffceaba172ca45d9251
parentdab44a3b2bb5e5f6cb911f4b5a30d19429a004c7 (diff)
downloadglibc-2ca34d76270d02d576e385db76ebb05ce54d443c.zip
glibc-2ca34d76270d02d576e385db76ebb05ce54d443c.tar.gz
glibc-2ca34d76270d02d576e385db76ebb05ce54d443c.tar.bz2
support: Use const char * argument in support_capture_subprogram_self_sgid
The function does not modify the passed-in string, so make this clear via the prototype. Reviewed-by: Carlos O'Donell <carlos@redhat.com> (cherry picked from commit f0c09fe61678df6f7f18fe1ebff074e62fa5ca7a)
-rw-r--r--support/capture_subprocess.h3
-rw-r--r--support/support_capture_subprocess.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/support/capture_subprocess.h b/support/capture_subprocess.h
index 91d75e5..7714043 100644
--- a/support/capture_subprocess.h
+++ b/support/capture_subprocess.h
@@ -45,8 +45,7 @@ struct support_capture_subprocess support_capture_subprogram
/* Copy the running program into a setgid binary and run it with CHILD_ID
argument. If execution is successful, return the exit status of the child
program, otherwise return a non-zero failure exit code. */
-int support_capture_subprogram_self_sgid
- (char *child_id);
+int support_capture_subprogram_self_sgid (const char *child_id);
/* Deallocate the subprocess data captured by
support_capture_subprocess. */
diff --git a/support/support_capture_subprocess.c b/support/support_capture_subprocess.c
index c3ef478..d99aafd 100644
--- a/support/support_capture_subprocess.c
+++ b/support/support_capture_subprocess.c
@@ -110,7 +110,7 @@ support_capture_subprogram (const char *file, char *const argv[],
safely make it SGID with the TARGET group ID. Then runs the
executable. */
static int
-copy_and_spawn_sgid (char *child_id, gid_t gid)
+copy_and_spawn_sgid (const char *child_id, gid_t gid)
{
char *dirname = xasprintf ("%s/tst-tunables-setuid.%jd",
test_dir, (intmax_t) getpid ());
@@ -182,7 +182,7 @@ copy_and_spawn_sgid (char *child_id, gid_t gid)
ret = 0;
infd = outfd = -1;
- char * const args[] = {execname, child_id, NULL};
+ char * const args[] = {execname, (char *) child_id, NULL};
status = support_subprogram_wait (args[0], args);
@@ -211,7 +211,7 @@ err:
}
int
-support_capture_subprogram_self_sgid (char *child_id)
+support_capture_subprogram_self_sgid (const char *child_id)
{
gid_t target = 0;
const int count = 64;