summaryrefslogtreecommitdiff
path: root/source/locking/locking_slow.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-07-29 03:08:05 +0000
committerAndrew Tridgell <tridge@samba.org>1998-07-29 03:08:05 +0000
commit3bda7ac417107a7b01d91805ca71c4330657ed21 (patch)
tree0fb2fb0cbd2df1b77ea814ba30e2bb1f8a1d999f /source/locking/locking_slow.c
parent7b3a9d6285cc0d1967155a68845e28c6296ecc67 (diff)
downloadsamba-3bda7ac417107a7b01d91805ca71c4330657ed21.tar.gz
merge from the autoconf2 branch to the main branch
Diffstat (limited to 'source/locking/locking_slow.c')
-rw-r--r--source/locking/locking_slow.c46
1 files changed, 7 insertions, 39 deletions
diff --git a/source/locking/locking_slow.c b/source/locking/locking_slow.c
index 183acd1f440..1f8f962ac90 100644
--- a/source/locking/locking_slow.c
+++ b/source/locking/locking_slow.c
@@ -33,6 +33,9 @@
*/
#include "includes.h"
+
+#ifndef FAST_SHARE_MODES
+
extern int DEBUGLEVEL;
extern connection_struct Connections[];
extern files_struct Files[];
@@ -504,17 +507,8 @@ mode file %s (%s)\n", fname, strerror(errno)));
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)
@@ -526,10 +520,6 @@ mode file %s to size %d (%s)\n", fname, newsize, strerror(errno)));
}
}
-#ifdef FTRUNCATE_NEEDS_ROOT
- unbecome_root(False);
-#endif /* FTRUNCATE_NEEDS_ROOT */
-
if(buf)
free(buf);
@@ -670,27 +660,14 @@ mode file %s (%s)\n", fname, strerror(errno)));
}
/* 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 */
}
/*******************************************************************
@@ -825,17 +802,8 @@ deleting it (%s).\n",fname, strerror(errno)));
/* 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)));
@@ -844,10 +812,6 @@ mode file %s to size %d (%s)\n", fname, header_size + (SMF_ENTRY_LENGTH*num_entr
return False;
}
-#ifdef FTRUNCATE_NEEDS_ROOT
- unbecome_root(False);
-#endif /* FTRUNCATE_NEEDS_ROOT */
-
if(buf)
free(buf);
@@ -1093,3 +1057,7 @@ struct share_ops *locking_slow_init(int ronly)
return &share_ops;
}
+#else
+ int locking_slow_dummy_procedure(void)
+{return 0;}
+#endif /* !FAST_SHARE_MODES */