Bug 547 - fchmod used unconditionaly
fchmod used unconditionaly
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
3.0.0
Other other
: P3 normal
: 3.0.1
Assigned To: Tim Potter
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-01 03:38 UTC by Joachim Schmitz
Modified: 2005-08-24 10:26 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joachim Schmitz 2003-10-01 03:38:37 UTC
Hi there

--- source/passdb/pdb_smbpasswd.c.orig       2003-08-15 22:39:57.000000000 +0200
+++ source/passdb/pdb_smbpasswd.c    2003-09-30 12:44:03.000000000 +0200
@@ -261,7 +261,11 @@
   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 pa
ssword file %s. \
 Error was %s\n.", pfile, strerror(errno) ));
     pw_file_unlock(fileno(fp), lock_depth);


Bye, Jojo
Comment 1 Jeremy Allison 2003-10-02 10:54:07 UTC
Applied, thanks.
Jeremy.
Comment 2 Gerald (Jerry) Carter 2005-08-24 10:26:14 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.