Commit b0d791bb authored by Paul Green's avatar Paul Green

Patch from Roderick Schertler (roderick at argon.org) to ignore

non-POSIX directory mode bits that are used by AIX.
parent 3903928c
......@@ -203,9 +203,9 @@ int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st,
#ifdef HAVE_CHMOD
if (!S_ISLNK(st->st_mode)) {
if (st->st_mode != file->mode) {
if ((st->st_mode & CHMOD_BITS) != (file->mode & CHMOD_BITS)) {
updated = 1;
if (do_chmod(fname,file->mode) != 0) {
if (do_chmod(fname,(file->mode & CHMOD_BITS)) != 0) {
rprintf(FERROR,"failed to set permissions on %s : %s\n",
fname,strerror(errno));
return 0;
......
......@@ -497,6 +497,16 @@ extern int errno;
#define S_IWUSR 0200
#endif
#ifndef ACCESSPERMS
#define ACCESSPERMS 0777
#endif
#ifndef S_ISVTX
#define S_ISVTX 0
#endif
#define CHMOD_BITS (S_ISUID | S_ISGID | S_ISVTX | ACCESSPERMS)
#ifndef _S_IFMT
#define _S_IFMT 0170000
#endif
......@@ -560,9 +570,6 @@ extern int errno;
#define IS_DEVICE(mode) (S_ISCHR(mode) || S_ISBLK(mode) || S_ISSOCK(mode) || S_ISFIFO(mode))
#ifndef ACCESSPERMS
#define ACCESSPERMS 0777
#endif
/* Initial mask on permissions given to temporary files. Mask off setuid
bits and group access because of potential race-condition security
holes, and mask other access because mode 707 is bizarre */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment