[cmor] 65/190: 2010-10-27 : edited the test for permission on output directory, used to fail if you had group write privileges but that wasnt your main group
Alastair McKinstry
mckinstry at moszumanska.debian.org
Tue Jul 21 12:54:38 UTC 2015
This is an automated email from the git hooks/post-receive script.
mckinstry pushed a commit to branch debian/master
in repository cmor.
commit c28e4ee474e99cbeafe95852344582222e15a6cd
Author: Charles Doutriaux <doutriaux1 at llnl.gov>
Date: Wed Oct 27 15:44:38 2010 -0700
2010-10-27 : edited the test for permission on output directory, used to fail if you had group write privileges but that wasnt your main group
---
RELEASE-NOTES | 1 +
Src/cmor.c | 34 ++++++++++++++++++++++------------
configure | 18 +++++++++---------
configure.ac | 2 +-
include/cmor.h | 2 +-
5 files changed, 34 insertions(+), 23 deletions(-)
diff --git a/RELEASE-NOTES b/RELEASE-NOTES
index 35d27a1..1172d5f 100644
--- a/RELEASE-NOTES
+++ b/RELEASE-NOTES
@@ -1,3 +1,4 @@
+2010-10-27 : edited the test for permission on output directory, used to fail if you had group write privileges but that wasnt your main group
2010-10-22 : Tagging 2.4.0
2010-10-22 : updated docs to reflect all these changes
2010-10-22 : exposed cmor_set/get/has_variable in Fortran interface, just like Python works only on "string" variables
diff --git a/Src/cmor.c b/Src/cmor.c
index 73d5fd2..32a2504 100644
--- a/Src/cmor.c
+++ b/Src/cmor.c
@@ -1063,6 +1063,7 @@ int cmor_dataset(char *outpath,
char msg[CMOR_MAX_STRING];
int i,found;
struct stat buf;
+ FILE *test_file=NULL;
cmor_add_traceback("cmor_dataset");
cmor_is_setup();
@@ -1081,21 +1082,30 @@ int cmor_dataset(char *outpath,
}
/* ok if not root then test permssions */
if (getuid()!=0) {
- if (buf.st_uid == getuid()) {
- if (!((buf.st_mode & S_IRUSR) && (buf.st_mode & S_IWUSR))) {
- sprintf(msg,"You defined your output directory to be: '%s', but you do not have read/write permissions on it",cmor_current_dataset.outpath);
- cmor_handle_error(msg,CMOR_CRITICAL);
- }
- }
- else if (buf.st_gid == getgid()) {
- if (!((buf.st_mode & S_IRGRP) && (buf.st_mode & S_IWGRP))) {
- sprintf(msg,"You defined your output directory to be: '%s', but you do not have read/write permissions on it",cmor_current_dataset.outpath);
- cmor_handle_error(msg,CMOR_CRITICAL);
- }
- } else if (!((buf.st_mode & S_IROTH) && (buf.st_mode & S_IWOTH))) {
+ strcpy(msg,cmor_current_dataset.outpath);
+ strncat(msg,"tmp.cmor.test",CMOR_MAX_STRING);
+ test_file = fopen(msg,"w");
+ if (test_file == NULL) {
+
+ /* if (buf.st_uid == getuid()) { */
+ /* if (!((buf.st_mode & S_IRUSR) && (buf.st_mode & S_IWUSR))) { */
+ /* sprintf(msg,"You defined your output directory to be: '%s', but you do not have read/write permissions on it",cmor_current_dataset.outpath); */
+ /* cmor_handle_error(msg,CMOR_CRITICAL); */
+ /* } */
+ /* } */
+ /* else if (buf.st_gid == getgid()) { */
+ /* if (!((buf.st_mode & S_IRGRP) && (buf.st_mode & S_IWGRP))) { */
+ /* sprintf(msg,"You defined your output directory to be: '%s', but you do not have read/write permissions on it",cmor_current_dataset.outpath); */
+ /* cmor_handle_error(msg,CMOR_CRITICAL); */
+ /* } */
+ /* } else if (!((buf.st_mode & S_IROTH) && (buf.st_mode & S_IWOTH))) { */
sprintf(msg,"You defined your output directory to be: '%s', but you do not have read/write permissions on it",cmor_current_dataset.outpath);
cmor_handle_error(msg,CMOR_CRITICAL);
}
+ else {
+ fclose(test_file);
+ remove(msg);
+ }
/* /\* Ok now we need to see if we can read/write/access the directory *\/ */
/* if (buf.st_uid == getuid()) { */
/* /\* ok user is owner of the directory *\/ */
diff --git a/configure b/configure
index 5a94e43..96975ee 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for cmor 2.4.0.
+# Generated by GNU Autoconf 2.61 for cmor 2.4.1.
#
# Report bugs to <doutriaux1 at llnl.gov>.
#
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='cmor'
PACKAGE_TARNAME='cmor'
-PACKAGE_VERSION='2.4.0'
-PACKAGE_STRING='cmor 2.4.0'
+PACKAGE_VERSION='2.4.1'
+PACKAGE_STRING='cmor 2.4.1'
PACKAGE_BUGREPORT='doutriaux1 at llnl.gov'
ac_default_prefix=/usr/local/cmor
@@ -1185,7 +1185,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures cmor 2.4.0 to adapt to many kinds of systems.
+\`configure' configures cmor 2.4.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1251,7 +1251,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of cmor 2.4.0:";;
+ short | recursive ) echo "Configuration of cmor 2.4.1:";;
esac
cat <<\_ACEOF
@@ -1350,7 +1350,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-cmor configure 2.4.0
+cmor configure 2.4.1
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1364,7 +1364,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by cmor $as_me 2.4.0, which was
+It was created by cmor $as_me 2.4.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -4989,7 +4989,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by cmor $as_me 2.4.0, which was
+This file was extended by cmor $as_me 2.4.1, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -5032,7 +5032,7 @@ Report bugs to <bug-autoconf at gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-cmor config.status 2.4.0
+cmor config.status 2.4.1
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 1ea495c..25a4286 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@ dnl -*- Autoconf -*-
dnl Process this file with autoconf to produce a configure script.
dnl AC_PREREQ(2.59)
-AC_INIT(cmor, 2.4.0, doutriaux1 at llnl.gov)
+AC_INIT(cmor, 2.4.1, doutriaux1 at llnl.gov)
GIT_TAG=`./get_git_version.sh`
diff --git a/include/cmor.h b/include/cmor.h
index e966c2b..60ad272 100644
--- a/include/cmor.h
+++ b/include/cmor.h
@@ -3,7 +3,7 @@
#define CMOR_VERSION_MAJOR 2
#define CMOR_VERSION_MINOR 4
-#define CMOR_VERSION_PATCH 0
+#define CMOR_VERSION_PATCH 1
#define CMOR_CF_VERSION_MAJOR 1
#define CMOR_CF_VERSION_MINOR 4
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cmor.git
More information about the debian-science-commits
mailing list