summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-10-02 17:53:55 +0000
committerJeremy Allison <jra@samba.org>2003-10-02 17:53:55 +0000
commite8fb38d8dda4fe44324c454c88e3e58d2e877a56 (patch)
tree6d03cbdecc14939cf58e8309a8554582d9b2bb72
parent460aa846391df5a29bcbc80317c7b73d68a6a78b (diff)
downloadsamba-e8fb38d8dda4fe44324c454c88e3e58d2e877a56.tar.gz
samba-e8fb38d8dda4fe44324c454c88e3e58d2e877a56.tar.bz2
samba-e8fb38d8dda4fe44324c454c88e3e58d2e877a56.zip
Portability fix from schmitz@hp.com (Joachim Schmitz). Bug #547.
Jeremy. (This used to be commit 9519ffc7cbdb37a4279c8804230596978679220e)
-rw-r--r--source3/passdb/pdb_smbpasswd.c4
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);