Fixed bug with -chmod go=r

master
Thomas Schmitt 15 years ago
parent af7b92b699
commit 9dc3dbb1ab

@ -1521,7 +1521,7 @@ time_t Decode_timestring(char *code, time_t *date, int flag)
seconds= 0;
sscanf(code+1,"%lf",&value);
} else {
seconds= time(0);
seconds= time(NULL);
sscanf(code,"%lf",&value);
}
scale_chr= code[strlen(code)-1];
@ -3979,7 +3979,7 @@ int Xorriso_option_chmodi(struct XorrisO *xorriso, char *mode,
{
int i, end_idx, ret, who_val= 0, was_failure= 0;
unsigned int num;
mode_t mode_and= ~0, mode_or= 0, mode_val;
mode_t mode_and= ~0, mode_or= 0, mode_val, mask;
char sfe[4*SfileadrL], *mpt, *opt, *vpt;
end_idx= Xorriso_end_idx(xorriso, argc, argv, *idx, 0);
@ -3988,7 +3988,8 @@ int Xorriso_option_chmodi(struct XorrisO *xorriso, char *mode,
mode_and= 0;
sscanf(mode,"%o",&num);
mode_or= num;
} else if(strchr(mode,'+')!=NULL || strchr(mode,'-')!=NULL) {
} else if(strchr(mode,'+')!=NULL || strchr(mode,'-')!=NULL
|| strchr(mode,'=')!=NULL) {
/* [ugoa][+-][rwxst] */;
for(mpt= mode; mpt!=NULL; mpt= strchr(mpt, ',')) {
if(*mpt==',')
@ -4038,15 +4039,23 @@ int Xorriso_option_chmodi(struct XorrisO *xorriso, char *mode,
if(who_val&2)
mode_val|= S_ISGID;
} else if(*vpt=='t') {
mode_val|= S_ISVTX;
if(who_val&1)
mode_val|= S_ISVTX;
} else
goto unrecognizable;
}
if(*opt=='+') {
mode_or|= mode_val;
} else if(*opt=='=') {
mode_and= 0;
mode_or= mode_val;
mask= 0;
if(who_val&1)
mask|= S_IRWXO|S_ISVTX;
if(who_val&2)
mask|= S_IRWXG|S_ISGID;
if(who_val&4)
mask|= S_IRWXU|S_ISUID;
mode_and&= ~(mask);
mode_or= (mode_or & ~mask) | mode_val;
} else if(*opt=='-') {
mode_or&= ~mode_val;
mode_and&= ~mode_val;

@ -1 +1 @@
#define Xorriso_timestamP "2007.11.08.145016"
#define Xorriso_timestamP "2007.11.08.160302"

Loading…
Cancel
Save