return 0;
}
/* Now truncate the file at this point. */
+#ifdef FTRUNCATE_NEEDS_ROOT
+ become_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
+
if(ftruncate(fd, newsize)!= 0)
{
+
+#ifdef FTRUNCATE_NEEDS_ROOT
+ unbecome_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
+
DEBUG(0,("ERROR: get_share_modes: failed to ftruncate share \
mode file %s to size %d (%s)\n", fname, newsize, strerror(errno)));
if(*old_shares)
}
}
+#ifdef FTRUNCATE_NEEDS_ROOT
+ unbecome_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
+
if(buf)
free(buf);
free(buf);
return;
}
+
/* Now truncate the file at this point. */
+#ifdef FTRUNCATE_NEEDS_ROOT
+ become_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
+
if(ftruncate(fd, newsize) != 0)
{
+
+#ifdef FTRUNCATE_NEEDS_ROOT
+ unbecome_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
+
DEBUG(0,("ERROR: del_share_mode: failed to ftruncate share \
mode file %s to size %d (%s)\n", fname, newsize, strerror(errno)));
if(buf)
free(buf);
return;
}
+
+#ifdef FTRUNCATE_NEEDS_ROOT
+ unbecome_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
}
/*******************************************************************
}
/* Now truncate the file at this point - just for safety. */
+
+#ifdef FTRUNCATE_NEEDS_ROOT
+ become_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
+
if(ftruncate(fd, header_size + (SMF_ENTRY_LENGTH*num_entries))!= 0)
{
+
+#ifdef FTRUNCATE_NEEDS_ROOT
+ unbecome_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
+
DEBUG(0,("ERROR: set_share_mode: failed to ftruncate share \
mode file %s to size %d (%s)\n", fname, header_size + (SMF_ENTRY_LENGTH*num_entries),
strerror(errno)));
return False;
}
+#ifdef FTRUNCATE_NEEDS_ROOT
+ unbecome_root(False);
+#endif /* FTRUNCATE_NEEDS_ROOT */
+
if(buf)
free(buf);