s3: Fix bug 7470
authorVolker Lendecke <vl@samba.org>
Sat, 25 Sep 2010 17:56:58 +0000 (10:56 -0700)
committerKarolin Seeger <kseeger@samba.org>
Wed, 6 Oct 2010 19:17:36 +0000 (21:17 +0200)
S_IREAD and S_IWRITE are not standard.

Thanks to Joachim Schmitz <schmitz@hp.com> for reporting!
(cherry picked from commit f1f260c018bfb5b2269731bb806176da1db12db8)

source3/registry/reg_api.c
source3/utils/net_rpc_registry.c
source3/utils/profiles.c

index 9aff4b05ca8277e97cfe4caf5651ce5288678ba9..b02481e07b217af137cd6b446ee08d3602e86fe4 100644 (file)
@@ -953,7 +953,7 @@ static WERROR backup_registry_key(struct registry_key_handle *krecord,
        /* open the registry file....fail if the file already exists */
 
        regfile = regfio_open(fname, (O_RDWR|O_CREAT|O_EXCL),
-                             (S_IREAD|S_IWRITE));
+                             (S_IRUSR|S_IWUSR));
        if (regfile == NULL) {
                DEBUG(0,("backup_registry_key: failed to open \"%s\" (%s)\n",
                         fname, strerror(errno) ));
index fb9d80b876dacd062ae5e2117b4880942cb187e3..8f1a10de3ed6bdc292fac491167d19dbcb204432 100644 (file)
@@ -1150,7 +1150,8 @@ static int rpc_registry_copy(struct net_context *c, int argc, const char **argv
        d_printf(_("ok\n"));
 
        d_printf(_("Opening %s...."), argv[1]);
-       if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) {
+       if ( !(outfile = regfio_open( argv[1], (O_RDWR|O_CREAT|O_TRUNC),
+                                     (S_IRUSR|S_IWUSR) )) ) {
                d_fprintf(stderr, _("Failed to open %s for writing\n"),argv[1]);
                goto out;
        }
index 0dc9aca8765dd2be5c80c0e44cdf9f528ff03878..eeaf2d21ac0788b57e9ff0625f6928f8d4d41191 100644 (file)
@@ -275,7 +275,8 @@ int main( int argc, char *argv[] )
                exit (1);
        }
 
-       if ( !(outfile = regfio_open( new_filename, (O_RDWR|O_CREAT|O_TRUNC), (S_IREAD|S_IWRITE) )) ) {
+       if ( !(outfile = regfio_open( new_filename, (O_RDWR|O_CREAT|O_TRUNC),
+                                     (S_IRUSR|S_IWUSR) )) ) {
                fprintf( stderr, "Failed to open new file %s!\n", new_filename );
                fprintf( stderr, "Error was (%s)\n", strerror(errno) );
                exit (1);