Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that the user has write permissions when opening a temp file.
[rsync/rsync.git]
/
popt
/
popt.c
diff --git
a/popt/popt.c
b/popt/popt.c
index
9ce3b35
..
a2c24e7
100644
(file)
--- a/
popt/popt.c
+++ b/
popt/popt.c
@@
-18,6
+18,10
@@
#include "findme.h"
#include "poptint.h"
#include "findme.h"
#include "poptint.h"
+#ifndef DBL_EPSILON
+#define DBL_EPSILON 2.2204460492503131e-16
+#endif
+
#ifdef MYDEBUG
/*@unchecked@*/
int _popt_debug = 0;
#ifdef MYDEBUG
/*@unchecked@*/
int _popt_debug = 0;
@@
-388,7
+392,6
@@
static int execCommand(poptContext con)
poptItem item = con->doExec;
const char ** argv;
int argc = 0;
poptItem item = con->doExec;
const char ** argv;
int argc = 0;
- int rc;
if (item == NULL) /*XXX can't happen*/
return POPT_ERROR_NOARG;
if (item == NULL) /*XXX can't happen*/
return POPT_ERROR_NOARG;
@@
-428,8
+431,9
@@
static int execCommand(poptContext con)
argv[argc] = NULL;
argv[argc] = NULL;
+ {
#ifdef __hpux
#ifdef __hpux
- rc = setresgid(getgid(), getgid(),-1);
+
int
rc = setresgid(getgid(), getgid(),-1);
if (rc) return POPT_ERROR_ERRNO;
rc = setresuid(getuid(), getuid(),-1);
if (rc) return POPT_ERROR_ERRNO;
if (rc) return POPT_ERROR_ERRNO;
rc = setresuid(getuid(), getuid(),-1);
if (rc) return POPT_ERROR_ERRNO;
@@
-440,12
+444,12
@@
static int execCommand(poptContext con)
* XXX from Norbert Warmuth <nwarmuth@privat.circular.de>
*/
#if defined(HAVE_SETUID)
* XXX from Norbert Warmuth <nwarmuth@privat.circular.de>
*/
#if defined(HAVE_SETUID)
- rc = setgid(getgid());
+
int
rc = setgid(getgid());
if (rc) return POPT_ERROR_ERRNO;
rc = setuid(getuid());
if (rc) return POPT_ERROR_ERRNO;
#elif defined (HAVE_SETREUID)
if (rc) return POPT_ERROR_ERRNO;
rc = setuid(getuid());
if (rc) return POPT_ERROR_ERRNO;
#elif defined (HAVE_SETREUID)
- rc = setregid(getgid(), getgid());
+
int
rc = setregid(getgid(), getgid());
if (rc) return POPT_ERROR_ERRNO;
rc = setreuid(getuid(), getuid());
if (rc) return POPT_ERROR_ERRNO;
if (rc) return POPT_ERROR_ERRNO;
rc = setreuid(getuid(), getuid());
if (rc) return POPT_ERROR_ERRNO;
@@
-453,6
+457,7
@@
static int execCommand(poptContext con)
; /* Can't drop privileges */
#endif
#endif
; /* Can't drop privileges */
#endif
#endif
+ }
if (argv[0] == NULL)
return POPT_ERROR_NOARG;
if (argv[0] == NULL)
return POPT_ERROR_NOARG;
@@
-467,7
+472,7
@@
if (_popt_debug)
}
#endif
}
#endif
-
rc =
execvp(argv[0], (char *const *)argv);
+ execvp(argv[0], (char *const *)argv);
return POPT_ERROR_ERRNO;
}
return POPT_ERROR_ERRNO;
}
@@
-961,10
+966,10
@@
int poptGetNextOpt(poptContext con)
if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_DOUBLE) {
*((double *) opt->arg) = aDouble;
} else {
if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_DOUBLE) {
*((double *) opt->arg) = aDouble;
} else {
-#define
_ABS(a)
((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a))
- if ((_ABS(aDouble) - FLT_MAX) > DBL_EPSILON)
+#define
MY_ABS(a)
((((a) - 0.0) < DBL_EPSILON) ? -(a) : (a))
+ if ((
MY
_ABS(aDouble) - FLT_MAX) > DBL_EPSILON)
return POPT_ERROR_OVERFLOW;
return POPT_ERROR_OVERFLOW;
- if ((FLT_MIN - _ABS(aDouble)) > DBL_EPSILON)
+ if ((FLT_MIN -
MY
_ABS(aDouble)) > DBL_EPSILON)
return POPT_ERROR_OVERFLOW;
*((float *) opt->arg) = aDouble;
}
return POPT_ERROR_OVERFLOW;
*((float *) opt->arg) = aDouble;
}