public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/globus-gatekeeper] rawhide: Fix compiler warnings
@ 2026-06-14 8:46 Mattias Ellert
0 siblings, 0 replies; only message in thread
From: Mattias Ellert @ 2026-06-14 8:46 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/globus-gatekeeper
Branch : rawhide
Commit : 9fce8c699d882cdfc81cdd299f02c6eae0ebcff9
Author : Mattias Ellert <mattias.ellert@physics.uu.se>
Date : 2026-06-14T10:39:13+02:00
Stats : +760/-1 in 3 file(s)
URL : https://src.fedoraproject.org/rpms/globus-gatekeeper/c/9fce8c699d882cdfc81cdd299f02c6eae0ebcff9?branch=rawhide
Log:
Fix compiler warnings
---
diff --git a/0001-Untabify-and-remove-trailing-white-space.patch b/0001-Untabify-and-remove-trailing-white-space.patch
new file mode 100644
index 0000000..483317a
--- /dev/null
+++ b/0001-Untabify-and-remove-trailing-white-space.patch
@@ -0,0 +1,716 @@
+From 3ccdaa0236230bbcbcbf339e7dfdfaf23c10bd6f Mon Sep 17 00:00:00 2001
+From: Mattias Ellert <mattias.ellert@physics.uu.se>
+Date: Wed, 20 May 2026 00:15:37 +0200
+Subject: [PATCH 1/2] Untabify and remove trailing white-space
+
+---
+ .../source/globus_gatekeeper_utils.c | 592 +++++++++---------
+ 1 file changed, 296 insertions(+), 296 deletions(-)
+
+diff --git a/gram/gatekeeper/source/globus_gatekeeper_utils.c b/gram/gatekeeper/source/globus_gatekeeper_utils.c
+index 5e8b6ec72..9f2333a8e 100644
+--- a/gram/gatekeeper/source/globus_gatekeeper_utils.c
++++ b/gram/gatekeeper/source/globus_gatekeeper_utils.c
+@@ -20,20 +20,20 @@
+ globus_gatekeeper_utils.c
+
+ Description:
+- Some common routines used by globus_gatekeeper
+- and globus_gram_k5.c
++ Some common routines used by globus_gatekeeper
++ and globus_gram_k5.c
+
+
+ CVS Information:
+- $Source$
+- $Date$
+- $Revision$
+- $Author$
++ $Source$
++ $Date$
++ $Revision$
++ $Author$
+
+ ******************************************************************************/
+
+ /*****************************************************************************
+- Include header files
++ Include header files
+ ******************************************************************************/
+ #include "globus_config.h"
+ #include "globus_gatekeeper_config.h"
+@@ -72,226 +72,226 @@ char * fgetscont(char *line, int size, FILE* fd);
+ static
+ char * fgetscont(char * line, int size, FILE* fd)
+ {
+- int i;
+- int len;
+- char * cp;
++ int i;
++ int len;
++ char * cp;
+
+- i = 2;
+- len = size;
++ i = 2;
++ len = size;
+ cp = line;
+- *cp = '\0';
+-
+- while(fgets(cp, len, fd) &&
+- (i = strlen(line)) > 2 &&
+- line[i-1] == '\n' && line[i-2] == '\\') {
+- len = size - i - 2;
+- cp = line + i - 2;
+- }
+- if (*cp == '\0') {
+- return NULL;
+- }
+- return line;
++ *cp = '\0';
++
++ while(fgets(cp, len, fd) &&
++ (i = strlen(line)) > 2 &&
++ line[i-1] == '\n' && line[i-2] == '\\') {
++ len = size - i - 2;
++ cp = line + i - 2;
++ }
++ if (*cp == '\0') {
++ return NULL;
++ }
++ return line;
+ }
+ /******************************************************************************
+ Function: globus_gatekeeper_util_globusxmap()
+ Description:
+- Given a index, find the command to be issued. For example
+- this could be a service name, or a globusID, or K5 principal
++ Given a index, find the command to be issued. For example
++ this could be a service name, or a globusID, or K5 principal
+
+ Parameters:
+- index
+- A pointer to a char *. will strdup with command
++ index
++ A pointer to a char *. will strdup with command
+ Returns:
+ ******************************************************************************/
+ int
+ globus_gatekeeper_util_globusxmap( char * filename, char * index, char ** command)
+ {
+
+- FILE * fd;
+- int rc;
+- int i;
++ FILE * fd;
++ int rc;
++ int i;
+ int offset;
+- char f_index[256];
+- char line[4096];
++ char f_index[256];
++ char line[4096];
+
+- *command = NULL;
++ *command = NULL;
+
+- if ((fd = fopen(filename, "r")) != NULL) {
++ if ((fd = fopen(filename, "r")) != NULL) {
+
+- while(fgetscont(line, sizeof(line), fd)) {
+- i = strlen(line);
+- if (line[0] != '#') { /* comment line */
+- if (line[i - 1] == '\n') {
+- line[i - 1] = '\0';
+- }
++ while(fgetscont(line, sizeof(line), fd)) {
++ i = strlen(line);
++ if (line[0] != '#') { /* comment line */
++ if (line[i - 1] == '\n') {
++ line[i - 1] = '\0';
++ }
+ if (!index)
+ {
+- *command = strdup(line);
++ *command = strdup(line);
++ fclose(fd);
++ return(0);
++ }
++
++ rc = sscanf(line, " \"%255[^\"]%*c%n %n",
++ f_index, &offset, &offset);
++ if (rc != 1) {
++ rc = sscanf(line, "%255s%n %n",
++ f_index, &offset, &offset);
++ }
++ if (rc == 1) {
++ if (!strcmp(index, f_index)) {
++ *command = strdup(&line[offset]);
+ fclose(fd);
+ return(0);
++
++ }
+ }
+-
+- rc = sscanf(line, " \"%255[^\"]%*c%n %n",
+- f_index, &offset, &offset);
+- if (rc != 1) {
+- rc = sscanf(line, "%255s%n %n",
+- f_index, &offset, &offset);
+- }
+- if (rc == 1) {
+- if (!strcmp(index, f_index)) {
+- *command = strdup(&line[offset]);
+- fclose(fd);
+- return(0);
+-
+- }
+- }
+- }
+- }
+- fclose(fd);
+- return(-1); /* not found */
+- }
+- return(-2); /* open failed */
++ }
++ }
++ fclose(fd);
++ return(-1); /* not found */
++ }
++ return(-2); /* open failed */
+ }
+ /******************************************************************************
+ Function: globus_gatekeeper_util_tokenize()
+
+ Description:
+- Breakup the command in to args, pointing the args array
+- at the tokens. Replace white space at the end of each
+- token with a null. A token maybe in quotes.
++ Breakup the command in to args, pointing the args array
++ at the tokens. Replace white space at the end of each
++ token with a null. A token maybe in quotes.
+
+ Parameters:
+- The command line to be parsed.
+- A pointer to an array of pointers to be filled it
+- Size of the array, on input, and set to size used on output.
++ The command line to be parsed.
++ A pointer to an array of pointers to be filled it
++ Size of the array, on input, and set to size used on output.
+
+ Returns:
+- 0 on success.
+- -1 on to malloc
+- -2 on to many args
+- -3 on quote not matched
++ 0 on success.
++ -1 on to malloc
++ -2 on to many args
++ -3 on quote not matched
+ ******************************************************************************/
+
+ int
+-globus_gatekeeper_util_tokenize(char * command,
+- char ** args,
+- int * n,
+- char * sep)
++globus_gatekeeper_util_tokenize(char * command,
++ char ** args,
++ int * n,
++ char * sep)
+ {
+- int i;
+- char * cp;
+- char * pp;
+- char * qp;
+- char ** arg;
+-
+- arg = args;
+- i = *n - 1;
+-
+- cp = command;
+- while (*cp)
+- {
+- /* skip leading sep characters */
+- while (*cp && strchr(sep, *cp))
+- {
+- cp++;
+- }
+- pp = NULL;
+- if (*cp == '\"')
+- {
+- cp++;
+- pp = cp;
+- if ((qp = strchr(cp,'\"')) == NULL)
+- {
+- return -3;
+- }
+- cp = qp + 1;
+-
+- }
+- else if (*cp)
+- {
+- pp = cp;
+- if ((qp = strpbrk(cp,sep)) == NULL)
+- {
+- qp = strchr(cp,'\0');
+- }
+- cp = qp;
+- }
+- if (pp)
+- {
+- *arg = (char*)malloc((qp - pp) + 1);
+- if (*arg == NULL)
+- {
+- return -1;
+- }
+- memcpy(*arg,pp,qp - pp);
+- *(*arg + (qp - pp)) = '\0';
+- i--;
+- if (i == 0)
+- return(-2); /* to many args */
+- arg++;
+- }
+- }
+- *arg = (char *) 0;
+- *n = *n - i - 1;
+- return(0);
++ int i;
++ char * cp;
++ char * pp;
++ char * qp;
++ char ** arg;
++
++ arg = args;
++ i = *n - 1;
++
++ cp = command;
++ while (*cp)
++ {
++ /* skip leading sep characters */
++ while (*cp && strchr(sep, *cp))
++ {
++ cp++;
++ }
++ pp = NULL;
++ if (*cp == '\"')
++ {
++ cp++;
++ pp = cp;
++ if ((qp = strchr(cp,'\"')) == NULL)
++ {
++ return -3;
++ }
++ cp = qp + 1;
++
++ }
++ else if (*cp)
++ {
++ pp = cp;
++ if ((qp = strpbrk(cp,sep)) == NULL)
++ {
++ qp = strchr(cp,'\0');
++ }
++ cp = qp;
++ }
++ if (pp)
++ {
++ *arg = (char*)malloc((qp - pp) + 1);
++ if (*arg == NULL)
++ {
++ return -1;
++ }
++ memcpy(*arg,pp,qp - pp);
++ *(*arg + (qp - pp)) = '\0';
++ i--;
++ if (i == 0)
++ return(-2); /* to many args */
++ arg++;
++ }
++ }
++ *arg = (char *) 0;
++ *n = *n - i - 1;
++ return(0);
+ }
+
+ /******************************************************************************
+ Function: globus_gatekeeper_util_envsub()
+
+ Description:
+- Substitute from environment string like ${text}
+- into arg. arg will be freed and copied.
+- Recursion is allowed.
++ Substitute from environment string like ${text}
++ into arg. arg will be freed and copied.
++ Recursion is allowed.
+
+ Parameters:
+- arg a pointer to the string pointer.
++ arg a pointer to the string pointer.
+
+ Returns:
+- 0 on success.
+- -1 on malloc
+- -3 on env string not found
++ 0 on success.
++ -1 on malloc
++ -3 on env string not found
+ ******************************************************************************/
+
+ int
+ globus_gatekeeper_util_envsub(char ** arg)
+ {
+- char * cp;
+- char * pp;
+- char * qp;
+- char * rp;
+- char * narg;
+-
+- cp = *arg;
+- while ((pp = strstr(cp,"${"))) /* for editor matching } */
+- {
+- pp+=2;
+- /* for editor matching { */
+- if(!(qp = strstr(pp,"}")))
+- {
+- return -2; /* not terminated */
+- }
+- *(pp-2) = '\0'; /* term the prefix */
+- *qp = '\0'; /* term the env name */
+- qp++;
+- if (!(rp = getenv(pp)))
+- {
+- return -3;
+- }
+- if (!(narg = (char *)malloc(strlen(cp) +
+- strlen(rp) +
+- strlen(qp) + 1)))
+- {
+- return -1;
+- }
+- strcpy(narg,cp);
+- strcat(narg,rp);
+- strcat(narg,qp);
+- free(cp);
+- cp = narg;
+- *arg = cp;
+- }
+- return 0;
++ char * cp;
++ char * pp;
++ char * qp;
++ char * rp;
++ char * narg;
++
++ cp = *arg;
++ while ((pp = strstr(cp,"${"))) /* for editor matching } */
++ {
++ pp+=2;
++ /* for editor matching { */
++ if(!(qp = strstr(pp,"}")))
++ {
++ return -2; /* not terminated */
++ }
++ *(pp-2) = '\0'; /* term the prefix */
++ *qp = '\0'; /* term the env name */
++ qp++;
++ if (!(rp = getenv(pp)))
++ {
++ return -3;
++ }
++ if (!(narg = (char *)malloc(strlen(cp) +
++ strlen(rp) +
++ strlen(qp) + 1)))
++ {
++ return -1;
++ }
++ strcpy(narg,cp);
++ strcat(narg,rp);
++ strcat(narg,qp);
++ free(cp);
++ cp = narg;
++ *arg = cp;
++ }
++ return 0;
+ }
+
+ /******************************************************************************
+@@ -301,155 +301,155 @@ Parameters:
+ Returns:
+ ******************************************************************************/
+ int
+-globus_gatekeeper_util_exec(char *args[],
+- struct passwd *pw,
+- char * user,
+- char **errmsgp)
++globus_gatekeeper_util_exec(char *args[],
++ struct passwd *pw,
++ char * user,
++ char **errmsgp)
+ {
+
+- int pid;
+- int err;
+- int rc;
+- char *path;
+- char * cp;
++ int pid;
++ int err;
++ int rc;
++ char *path;
++ char * cp;
+
+ #define WAIT_USES_INT
+ #ifdef WAIT_USES_INT
+- int wait_status;
++ int wait_status;
+ #else /* WAIT_USES_INT */
+- union wait wait_status;
++ union wait wait_status;
+ #endif /* WAIT_USES_INT */
+
+- pid = fork();
+- if (pid <0)
+- return(-1);
+-
+- if (pid == 0) { /* child process */
+-
+- /* If need to run child as user */
+- if (pw != NULL) {
+- if ((rc = globus_gatekeeper_util_trans_to_user(pw, user, errmsgp)) != 0) {
+- /* child failed to transfer to user context */
+- fprintf(stderr,"Failed trying to run as user %s: %s\n",
+- user, *errmsgp);
+- exit(126);
+- }
+- }
+-
+- path = strdup(args[0]);
+- cp = strrchr(path, '/');
+- if (cp)
+- cp++;
+- else
+- cp = path;
+-
+- args[0] = cp;
++ pid = fork();
++ if (pid <0)
++ return(-1);
++
++ if (pid == 0) { /* child process */
++
++ /* If need to run child as user */
++ if (pw != NULL) {
++ if ((rc = globus_gatekeeper_util_trans_to_user(pw, user, errmsgp)) != 0) {
++ /* child failed to transfer to user context */
++ fprintf(stderr,"Failed trying to run as user %s: %s\n",
++ user, *errmsgp);
++ exit(126);
++ }
++ }
++
++ path = strdup(args[0]);
++ cp = strrchr(path, '/');
++ if (cp)
++ cp++;
++ else
++ cp = path;
++
++ args[0] = cp;
+
+ #ifdef DEBUG
+- fprintf(stderr,"EXECING %s args=",path);
+- {
+- int n = 0;
+- while (args[n]) {
+- fprintf (stderr," %s \n",args[n]);
+- n++;
+- }
+- fprintf(stderr,"\n");
+- }
++ fprintf(stderr,"EXECING %s args=",path);
++ {
++ int n = 0;
++ while (args[n]) {
++ fprintf (stderr," %s \n",args[n]);
++ n++;
++ }
++ fprintf(stderr,"\n");
++ }
+ #endif
+- execv(path, args);
+- fprintf(stderr,"Failed to exec the child\n");
+- exit(127); /* in case execl fails */
+- }
++ execv(path, args);
++ fprintf(stderr,"Failed to exec the child\n");
++ exit(127); /* in case execl fails */
++ }
+
+- /* parent, wait for child to finish */
++ /* parent, wait for child to finish */
+
+- wait_status = 0;
++ wait_status = 0;
+ #ifdef HAVE_WAITPID
+- err = waitpid((pid_t) pid, &wait_status, 0);
++ err = waitpid((pid_t) pid, &wait_status, 0);
+ #else /* HAVE_WAITPID */
+- err = wait4(pid, &wait_status, 0, (struct rusage *) NULL);
++ err = wait4(pid, &wait_status, 0, (struct rusage *) NULL);
+ #endif /* HAVE_WAITPID */
+
+- /* if it worked or failed, continue on. */
+- return(wait_status);
++ /* if it worked or failed, continue on. */
++ return(wait_status);
+ }
+
+ /******************************************************************************
+ Function: globus_gatekeeper_util_trans_to_user()
+ Description:
+- Transition the process from root to the user,
+- doing all the operating system specific stuff.
++ Transition the process from root to the user,
++ doing all the operating system specific stuff.
+
+ Parameters:
+ Returns:
+- 0 if OK
+- <0 if errno is set;
+- >0 if some other error.
+- 1 if not root
+- DEE needs work
++ 0 if OK
++ <0 if errno is set;
++ >0 if some other error.
++ 1 if not root
++ DEE needs work
+ ******************************************************************************/
+
+ int
+ globus_gatekeeper_util_trans_to_user(struct passwd * pw,
+- char * userid,
+- char ** errmsg)
++ char * userid,
++ char ** errmsg)
+ {
+
+- uid_t myuid;
+-
+- /* must be root to use this */
+-
+- if ((myuid = getuid()) != 0)
+- {
+- if (myuid == pw->pw_uid)
+- return 0; /* already running as the user */
+- else
+- {
+- *errmsg = strdup("Can not run as another user");
+- return 1; /* can't run as another user */
+- }
+- }
+-
+- /*
+- *DEE If we are root and want to run as root, should we continue
+- * here or just exit? Some logging might be usefull.
+- */
+- setgid(pw->pw_gid);
+- initgroups(pw->pw_name, pw->pw_gid);
+-
+-# if defined(__hpux)
+- {
+- if (setresuid(pw->pw_uid, pw->pw_uid, -1) != 0)
+- {
+- *errmsg = strdup("cannot setresuid");
+- return -2;
+- }
+- }
+-# elif defined(TARGET_ARCH_SOLARIS) || \
+- defined(TARGET_ARCH_BSD) || \
+- defined(TARGET_ARCH_CYGWIN)
+- {
+- if (setuid(pw->pw_uid) != 0)
+- {
+- *errmsg = strdup("cannot setuid");
+- return -3;
+- }
+- }
+-# else
+- {
+- if (seteuid(0) != 0)
+- {
+- *errmsg = strdup("cannot seteuid");
+- return -4;
+- }
+-
+- if (setreuid(pw->pw_uid, pw->pw_uid) != 0)
+- {
+- *errmsg = strdup("cannot setreuid");
+- return -5;
+- }
+- }
+-# endif
+-
+- return 0;
++ uid_t myuid;
++
++ /* must be root to use this */
++
++ if ((myuid = getuid()) != 0)
++ {
++ if (myuid == pw->pw_uid)
++ return 0; /* already running as the user */
++ else
++ {
++ *errmsg = strdup("Can not run as another user");
++ return 1; /* can't run as another user */
++ }
++ }
++
++ /*
++ *DEE If we are root and want to run as root, should we continue
++ * here or just exit? Some logging might be usefull.
++ */
++ setgid(pw->pw_gid);
++ initgroups(pw->pw_name, pw->pw_gid);
++
++# if defined(__hpux)
++ {
++ if (setresuid(pw->pw_uid, pw->pw_uid, -1) != 0)
++ {
++ *errmsg = strdup("cannot setresuid");
++ return -2;
++ }
++ }
++# elif defined(TARGET_ARCH_SOLARIS) || \
++ defined(TARGET_ARCH_BSD) || \
++ defined(TARGET_ARCH_CYGWIN)
++ {
++ if (setuid(pw->pw_uid) != 0)
++ {
++ *errmsg = strdup("cannot setuid");
++ return -3;
++ }
++ }
++# else
++ {
++ if (seteuid(0) != 0)
++ {
++ *errmsg = strdup("cannot seteuid");
++ return -4;
++ }
++
++ if (setreuid(pw->pw_uid, pw->pw_uid) != 0)
++ {
++ *errmsg = strdup("cannot setreuid");
++ return -5;
++ }
++ }
++# endif
++
++ return 0;
+ }
+--
+2.54.0
+
diff --git a/0002-Fix-compiler-and-doxygen-warnings.patch b/0002-Fix-compiler-and-doxygen-warnings.patch
new file mode 100644
index 0000000..6fffdbf
--- /dev/null
+++ b/0002-Fix-compiler-and-doxygen-warnings.patch
@@ -0,0 +1,36 @@
+From 4ee08d13e2963309e2063dc45dedd067337d3b76 Mon Sep 17 00:00:00 2001
+From: Mattias Ellert <mattias.ellert@physics.uu.se>
+Date: Wed, 20 May 2026 00:15:37 +0200
+Subject: [PATCH 2/2] Fix compiler and doxygen warnings
+
+---
+ gram/gatekeeper/source/globus_gatekeeper_utils.c | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/gram/gatekeeper/source/globus_gatekeeper_utils.c b/gram/gatekeeper/source/globus_gatekeeper_utils.c
+index 9f2333a8e..341041d41 100644
+--- a/gram/gatekeeper/source/globus_gatekeeper_utils.c
++++ b/gram/gatekeeper/source/globus_gatekeeper_utils.c
+@@ -308,7 +308,6 @@ globus_gatekeeper_util_exec(char *args[],
+ {
+
+ int pid;
+- int err;
+ int rc;
+ char *path;
+ char * cp;
+@@ -365,9 +364,9 @@ globus_gatekeeper_util_exec(char *args[],
+
+ wait_status = 0;
+ #ifdef HAVE_WAITPID
+- err = waitpid((pid_t) pid, &wait_status, 0);
++ waitpid((pid_t) pid, &wait_status, 0);
+ #else /* HAVE_WAITPID */
+- err = wait4(pid, &wait_status, 0, (struct rusage *) NULL);
++ wait4(pid, &wait_status, 0, (struct rusage *) NULL);
+ #endif /* HAVE_WAITPID */
+
+ /* if it worked or failed, continue on. */
+--
+2.54.0
+
diff --git a/globus-gatekeeper.spec b/globus-gatekeeper.spec
index ca01f1d..bf2c775 100644
--- a/globus-gatekeeper.spec
+++ b/globus-gatekeeper.spec
@@ -3,7 +3,7 @@
Name: globus-gatekeeper
%global _name %(tr - _ <<< %{name})
Version: 11.4
-Release: 11%{?dist}
+Release: 12%{?dist}
Summary: Grid Community Toolkit - Globus Gatekeeper
License: Apache-2.0
@@ -12,6 +12,8 @@ Source: https://repo.gridcf.org/gct6/sources/%{_name}-%{version}.tar.gz
Source1: %{name}.service
Source3: %{name}.README
Source8: README
+Patch0: 0001-Untabify-and-remove-trailing-white-space.patch
+Patch1: 0002-Fix-compiler-and-doxygen-warnings.patch
BuildRequires: make
BuildRequires: gcc
@@ -36,6 +38,8 @@ Globus Gatekeeper
%prep
%setup -q -n %{_name}-%{version}
+%patch -P0 -p4
+%patch -P1 -p4
%build
# Reduce overlinking
@@ -100,6 +104,9 @@ mkdir -p %{buildroot}%{_sysconfdir}/grid-services/available
%license GLOBUS_LICENSE
%changelog
+* Sun Jun 14 2026 Mattias Ellert <mattias.ellert@physics.uu.se> - 11.4-12
+- Fix compiler warnings
+
* Fri Jan 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 11.4-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-14 8:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-14 8:46 [rpms/globus-gatekeeper] rawhide: Fix compiler warnings Mattias Ellert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox