Rather than using S_IRREAD and S_IWRITE in .../source3/registry/reg_api.c , .../source3/registry/reg_api.c and .../source3/registry/reg_api.c, the standard S_IRUSR and S_IWUSR should get used, if available. Patch: diff -u ./source3/modules/vfs_scannedonly.c.orig ./source3/modules/vfs_scannedonly.c --- ./source3/modules/vfs_scannedonly.c.orig 2010-05-17 06:51:23.000000000 -0500 +++ ./source3/modules/vfs_scannedonly.c 2010-05-26 15:21:40.000000000 -0500 @@ -476,7 +476,9 @@ "(max %d), %d ms) for %s\n", i, recheck_tries, recheck_time, cache_smb_fname->base_name)); +#ifdef HAVE_NANOSLEEP /* ??? */ nanosleep(&req, NULL); +#endif retval = SMB_VFS_NEXT_STAT(handle, cache_smb_fname); i++; } diff -u ./source3/registry/reg_api.c.orig ./source3/registry/reg_api.c --- ./source3/registry/reg_api.c.orig 2010-05-17 06:51:23.000000000 -0500 +++ ./source3/registry/reg_api.c 2010-05-26 14:36:46.000000000 -0500 @@ -953,7 +953,11 @@ /* open the registry file....fail if the file already exists */ regfile = regfio_open(fname, (O_RDWR|O_CREAT|O_EXCL), +#if defined(S_IRUSR) && defined(S_IWUSR) + (S_IRUSR|S_IWUSR)); +#else (S_IREAD|S_IWRITE)); +#endif if (regfile == NULL) { DEBUG(0,("backup_registry_key: failed to open \"%s\" (%s)\n", fname, strerror(errno) )); diff -u ./source3/utils/net_rpc_registry.c.orig ./source3/utils/net_rpc_registry.c --- ./source3/utils/net_rpc_registry.c.orig 2010-05-17 06:51:23.000000000 -0500 +++ ./source3/utils/net_rpc_registry.c 2010-05-26 09:13:51.000000000 -0500 @@ -1150,7 +1150,11 @@ d_printf(_("ok\n")); d_printf(_("Opening %s...."), argv[1]); +#if defined(S_IRUSR) && defined(S_IWUSR) + if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC), (S_IRUSR|S_IWUSR) )) ) { +#else if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) { +#endif d_fprintf(stderr, _("Failed to open %s for writing\n"),argv[1]); goto out; } diff -u ./source3/utils/profiles.c.orig ./source3/utils/profiles.c --- ./source3/utils/profiles.c.orig 2010-05-17 06:51:23.000000000 -0500 +++ ./source3/utils/profiles.c 2010-05-26 09:16:24.000000000 -0500 @@ -275,7 +275,11 @@ exit (1); } +#if defined(S_IRUSR) && defined(S_IWUSR) + if ( !(outfile = regfio_open( new_filename, (O_RDWR|O_CREAT|O_TRUNC), (S_IRUSR|S_IWUSR) )) ) { +#else if ( !(outfile = regfio_open( new_filename, (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) { +#endif fprintf( stderr, "Failed to open new file %s!\n", new_filename ); fprintf( stderr, "Error was (%s)\n", strerror(errno) ); exit (1); Bye, Jojo
See also the very old and long closed bug #546
oops, forget the 1st patch, that one is for bug #7478. And another way to fix it might to to #define S_IREAD and S_IWRITE (to S_IRUSR and S_IWUSR respectively) in .../lib/replace/replace.h? Bye, Jojo
Created attachment 5754 [details] Patch
From http://www.gnu.org/s/libc/manual/html_node/Permission-Bits.html: S_IRUSR S_IREAD Read permission bit for the owner of the file. On many systems this bit is 0400. S_IREAD is an obsolete synonym provided for BSD compatibility. S_IWUSR S_IWRITE Write permission bit for the owner of the file. Usually 0200. S_IWRITE is an obsolete synonym provided for BSD compatibility. S_IXUSR S_IEXEC Execute (for ordinary files) or search (for directories) permission bit for the owner of the file. Usually 0100. S_IEXEC is an obsolete synonym provided for BSD compatibility. Bye, Jojo
Created attachment 5983 [details] Patch for 3.5 No need to #ifdef that. We use S_IRUSR|S_IWUSR elsewhere unconditionally. Volker
Well, that certainly works too ;-)
Comment on attachment 5983 [details] Patch for 3.5 thanks for spotting and fixing
Assiging to Karolin for picking to release.
Pushed to v3-5-test. Closing out bug report. Thanks!