diff options
author | Jeremy Allison <jra@samba.org> | 2003-10-02 17:53:55 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2003-10-02 17:53:55 +0000 |
commit | 9519ffc7cbdb37a4279c8804230596978679220e (patch) | |
tree | b0f4322e79e778cf1a7844340d40ce1f427a5ff5 | |
parent | a0828a2a1ce04075f0a7cb4a201cea0781998237 (diff) | |
download | samba-9519ffc7cbdb37a4279c8804230596978679220e.tar.gz |
Portability fix from schmitz@hp.com (Joachim Schmitz). Bug #547.
Jeremy.
-rw-r--r-- | source/passdb/pdb_smbpasswd.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/passdb/pdb_smbpasswd.c b/source/passdb/pdb_smbpasswd.c index 8171b65adcc..8cdbec9b9d0 100644 --- a/source/passdb/pdb_smbpasswd.c +++ b/source/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); |