diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/time.c | 5 | ||||
-rw-r--r-- | source3/lib/util.c | 32 |
2 files changed, 36 insertions, 1 deletions
diff --git a/source3/lib/time.c b/source3/lib/time.c index 62a7016994..81e3dcfd8f 100644 --- a/source3/lib/time.c +++ b/source3/lib/time.c @@ -508,5 +508,8 @@ time_t get_create_time(struct stat *st) time_t get_access_time(struct stat *st) { - return st->st_atime; + if (lp_win95_bug_compatibility()) + return st->st_mtime; + else + return st->st_atime; } diff --git a/source3/lib/util.c b/source3/lib/util.c index 1d65269f95..3b30f1e6b5 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3811,6 +3811,38 @@ void standard_sub_basic(char *str) case 'h' : string_sub(p,"%h", myhostname); break; case 'm' : string_sub(p,"%m", remote_machine); break; case 'v' : string_sub(p,"%v", VERSION); break; + case '$' : /* Expand environment variables */ + { + /* Contributed by Branko Cibej <branko.cibej@hermes.si> */ + fstring envname; + char *envval; + char *q, *r; + int copylen; + + if (*(p+2) != '(') { p+=2; break; } + if ((q = strchr(p,')')) == NULL) + { + DEBUG(0,("standard_sub_basic: Unterminated environment \ +variable [%s]\n", p)); + p+=2; break; + } + + r = p+3; + copylen = MIN((q-r),(sizeof(envname)-1)); + strncpy(envname,r,copylen); + envname[copylen] = '\0'; + if ((envval = getenv(envname)) == NULL) + { + DEBUG(0,("standard_sub_basic: Environment variable [%s] not set\n", + envname)); + p+=2; break; + } + copylen = MIN((q+1-p),(sizeof(envname)-1)); + strncpy(envname,p,copylen); + envname[copylen] = '\0'; + string_sub(p,envname,envval); + break; + } case '\0': p++; break; /* don't run off end if last character is % */ default : p+=2; break; } |