diff options
author | Jeremy Allison <jra@samba.org> | 2003-10-02 17:53:57 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-10-02 17:53:57 +0000 |
commit | 567caaf5f9d48b881052a1272e0154f55faac462 (patch) | |
tree | 8b1fd22d8e8eed8dc62ee891383ded5069a8679f /source3 | |
parent | 3092718ab127bcf83138552a0518cea070451d14 (diff) | |
download | samba-567caaf5f9d48b881052a1272e0154f55faac462.tar.gz samba-567caaf5f9d48b881052a1272e0154f55faac462.tar.bz2 samba-567caaf5f9d48b881052a1272e0154f55faac462.zip |
Portability fix from schmitz@hp.com (Joachim Schmitz). Bug #547.
Jeremy.
(This used to be commit bbc7b189b9b4b3a5ef0a5ddbb7d2d755f6341fdf)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/passdb/pdb_smbpasswd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index 8171b65adc..8cdbec9b9d 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -261,7 +261,11 @@ static FILE *startsmbfilepwent(const char *pfile, enum pwf_access_type type, int setvbuf(fp, (char *)NULL, _IOFBF, 1024); /* Make sure it is only rw by the owner */ +#ifdef HAVE_FCHMOD if(fchmod(fileno(fp), S_IRUSR|S_IWUSR) == -1) { +#else + if(chmod(pfile, S_IRUSR|S_IWUSR) == -1) { +#endif DEBUG(0, ("startsmbfilepwent_internal: failed to set 0600 permissions on password file %s. \ Error was %s\n.", pfile, strerror(errno) )); pw_file_unlock(fileno(fp), lock_depth); |