Merge branch 'master' of git://git.samba.org/samba
authorNadezhda Ivanova <nadezhda.ivanova@postpath.com>
Fri, 25 Sep 2009 01:57:27 +0000 (18:57 -0700)
committerNadezhda Ivanova <nadezhda.ivanova@postpath.com>
Fri, 25 Sep 2009 01:57:27 +0000 (18:57 -0700)
client/mount.cifs.c
docs-xml/Samba3-ByExample/SBE-TheSmallOffice.xml
docs-xml/Samba3-HOWTO/TOSHARG-IDMAP.xml
docs-xml/Samba3-HOWTO/TOSHARG-TheNetCommand.xml
lib/util/util.h
lib/util/util_strlist.c
source3/include/ntdomain.h
source3/lib/util_str.c
source3/modules/vfs_default.c
source3/nmbd/nmbd_packets.c
source3/winbindd/winbindd_rpc.c

index 4387f5945a916d4d6b9216538c45c6015e49f35a..1c04e13c8d63aa30657d79f9a55d65d959e23af7 100644 (file)
@@ -273,31 +273,34 @@ BB end finish BB */
 static char * check_for_domain(char **);
 
 
-static void mount_cifs_usage(void)
+static void mount_cifs_usage(FILE *stream)
 {
-       printf("\nUsage:  %s <remotetarget> <dir> -o <options>\n", thisprogram);
-       printf("\nMount the remote target, specified as a UNC name,");
-       printf(" to a local directory.\n\nOptions:\n");
-       printf("\tuser=<arg>\n\tpass=<arg>\n\tdom=<arg>\n");
-       printf("\nLess commonly used options:");
-       printf("\n\tcredentials=<filename>,guest,perm,noperm,setuids,nosetuids,rw,ro,");
-       printf("\n\tsep=<char>,iocharset=<codepage>,suid,nosuid,exec,noexec,serverino,");
-       printf("\n\tmapchars,nomapchars,nolock,servernetbiosname=<SRV_RFC1001NAME>");
-       printf("\n\tdirectio,nounix,cifsacl,sec=<authentication mechanism>,sign");
-       printf("\n\nOptions not needed for servers supporting CIFS Unix extensions");
-       printf("\n\t(e.g. unneeded for mounts to most Samba versions):");
-       printf("\n\tuid=<uid>,gid=<gid>,dir_mode=<mode>,file_mode=<mode>,sfu");
-       printf("\n\nRarely used options:");
-       printf("\n\tport=<tcpport>,rsize=<size>,wsize=<size>,unc=<unc_name>,ip=<ip_address>,");
-       printf("\n\tdev,nodev,nouser_xattr,netbiosname=<OUR_RFC1001NAME>,hard,soft,intr,");
-       printf("\n\tnointr,ignorecase,noposixpaths,noacl,prefixpath=<path>,nobrl");
-       printf("\n\tin6_addr");
-       printf("\n\nOptions are described in more detail in the manual page");
-       printf("\n\tman 8 mount.cifs\n");
-       printf("\nTo display the version number of the mount helper:");
-       printf("\n\t%s -V\n",thisprogram);
+       fprintf(stream, "\nUsage:  %s <remotetarget> <dir> -o <options>\n", thisprogram);
+       fprintf(stream, "\nMount the remote target, specified as a UNC name,");
+       fprintf(stream, " to a local directory.\n\nOptions:\n");
+       fprintf(stream, "\tuser=<arg>\n\tpass=<arg>\n\tdom=<arg>\n");
+       fprintf(stream, "\nLess commonly used options:");
+       fprintf(stream, "\n\tcredentials=<filename>,guest,perm,noperm,setuids,nosetuids,rw,ro,");
+       fprintf(stream, "\n\tsep=<char>,iocharset=<codepage>,suid,nosuid,exec,noexec,serverino,");
+       fprintf(stream, "\n\tmapchars,nomapchars,nolock,servernetbiosname=<SRV_RFC1001NAME>");
+       fprintf(stream, "\n\tdirectio,nounix,cifsacl,sec=<authentication mechanism>,sign");
+       fprintf(stream, "\n\nOptions not needed for servers supporting CIFS Unix extensions");
+       fprintf(stream, "\n\t(e.g. unneeded for mounts to most Samba versions):");
+       fprintf(stream, "\n\tuid=<uid>,gid=<gid>,dir_mode=<mode>,file_mode=<mode>,sfu");
+       fprintf(stream, "\n\nRarely used options:");
+       fprintf(stream, "\n\tport=<tcpport>,rsize=<size>,wsize=<size>,unc=<unc_name>,ip=<ip_address>,");
+       fprintf(stream, "\n\tdev,nodev,nouser_xattr,netbiosname=<OUR_RFC1001NAME>,hard,soft,intr,");
+       fprintf(stream, "\n\tnointr,ignorecase,noposixpaths,noacl,prefixpath=<path>,nobrl");
+       fprintf(stream, "\n\nOptions are described in more detail in the manual page");
+       fprintf(stream, "\n\tman 8 mount.cifs\n");
+       fprintf(stream, "\nTo display the version number of the mount helper:");
+       fprintf(stream, "\n\t%s -V\n",thisprogram);
 
        SAFE_FREE(mountpassword);
+
+       if (stream == stderr)
+               exit(EX_USAGE);
+       exit(0);
 }
 
 /* caller frees username if necessary */
@@ -348,7 +351,7 @@ static int open_cred_file(char * file_name)
                                        }
                                }
                                if(length > 4086) {
-                                       printf("mount.cifs failed due to malformed username in credentials file");
+                                       fprintf(stderr, "mount.cifs failed due to malformed username in credentials file\n");
                                        memset(line_buf,0,4096);
                                        exit(EX_USAGE);
                                } else {
@@ -372,7 +375,7 @@ static int open_cred_file(char * file_name)
                                        }
                                }
                                if(length > MOUNT_PASSWD_SIZE) {
-                                       printf("mount.cifs failed: password in credentials file too long\n");
+                                       fprintf(stderr, "mount.cifs failed: password in credentials file too long\n");
                                        memset(line_buf,0, 4096);
                                        exit(EX_USAGE);
                                } else {
@@ -392,7 +395,7 @@ static int open_cred_file(char * file_name)
                                 /* go past equals sign */
                                 temp_val++;
                                if(verboseflag)
-                                       printf("\nDomain %s\n",temp_val);
+                                       fprintf(stderr, "\nDomain %s\n",temp_val);
                                 for(length = 0;length<DOMAIN_SIZE+1;length++) {
                                        if ((temp_val[length] == '\n')
                                            || (temp_val[length] == '\0')) {
@@ -401,7 +404,7 @@ static int open_cred_file(char * file_name)
                                        }
                                 }
                                 if(length > DOMAIN_SIZE) {
-                                        printf("mount.cifs failed: domain in credentials file too long\n");
+                                        fprintf(stderr, "mount.cifs failed: domain in credentials file too long\n");
                                         exit(EX_USAGE);
                                 } else {
                                         if(domain_name == NULL) {
@@ -434,14 +437,14 @@ static int get_password_from_file(int file_descript, char * filename)
                memset(mountpassword, 0, MOUNT_PASSWD_SIZE);
 
        if (mountpassword == NULL) {
-               printf("malloc failed\n");
+               fprintf(stderr, "malloc failed\n");
                exit(EX_SYSERR);
        }
 
        if(filename != NULL) {
                file_descript = open(filename, O_RDONLY);
                if(file_descript < 0) {
-                       printf("mount.cifs failed. %s attempting to open password file %s\n",
+                       fprintf(stderr, "mount.cifs failed. %s attempting to open password file %s\n",
                                   strerror(errno),filename);
                        exit(EX_SYSERR);
                }
@@ -451,14 +454,14 @@ static int get_password_from_file(int file_descript, char * filename)
        for(i=0;i<MOUNT_PASSWD_SIZE;i++) {
                rc = read(file_descript,&c,1);
                if(rc < 0) {
-                       printf("mount.cifs failed. Error %s reading password file\n",strerror(errno));
+                       fprintf(stderr, "mount.cifs failed. Error %s reading password file\n",strerror(errno));
                        if(filename != NULL)
                                close(file_descript);
                        exit(EX_SYSERR);
                } else if(rc == 0) {
                        if(mountpassword[0] == 0) {
                                if(verboseflag)
-                                       printf("\nWarning: null password used since cifs password file empty");
+                                       fprintf(stderr, "\nWarning: null password used since cifs password file empty");
                        }
                        break;
                } else /* read valid character */ {
@@ -470,7 +473,7 @@ static int get_password_from_file(int file_descript, char * filename)
                }
        }
        if((i == MOUNT_PASSWD_SIZE) && (verboseflag)) {
-               printf("\nWarning: password longer than %d characters specified in cifs password file",
+               fprintf(stderr, "\nWarning: password longer than %d characters specified in cifs password file",
                        MOUNT_PASSWD_SIZE);
        }
        got_password = 1;
@@ -499,7 +502,7 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
        data = *optionsp;
 
        if(verboseflag)
-               printf("parsing options: %s\n", data);
+               fprintf(stderr, "parsing options: %s\n", data);
 
        /* BB fixme check for separator override BB */
 
@@ -546,7 +549,7 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                                        *filesys_flags |= MS_USER;
                                        goto nocopy;
                                } else {
-                                       printf("username specified with no parameter\n");
+                                       fprintf(stderr, "username specified with no parameter\n");
                                        SAFE_FREE(out);
                                        return 1;       /* needs_arg; */
                                }
@@ -560,7 +563,7 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                                                        mountpassword = (char *)calloc(MOUNT_PASSWD_SIZE+1,1);
                                                if(mountpassword) {
                                                        if(got_password)
-                                                               printf("\nmount.cifs warning - password specified twice\n");
+                                                               fprintf(stderr, "\nmount.cifs warning - password specified twice\n");
                                                        got_password = 1;
                                                        percent_char++;
                                                        strlcpy(mountpassword, percent_char,MOUNT_PASSWD_SIZE+1);
@@ -579,7 +582,7 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                                        invoked */
                                        domain_name = check_for_domain(&value);
                                } else {
-                                       printf("username too long\n");
+                                       fprintf(stderr, "username too long\n");
                                        SAFE_FREE(out);
                                        return 1;
                                }
@@ -587,15 +590,15 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                } else if (strncmp(data, "pass", 4) == 0) {
                        if (!value || !*value) {
                                if(got_password) {
-                                       printf("\npassword specified twice, ignoring second\n");
+                                       fprintf(stderr, "\npassword specified twice, ignoring second\n");
                                } else
                                        got_password = 1;
                        } else if (strnlen(value, MOUNT_PASSWD_SIZE) < MOUNT_PASSWD_SIZE) {
                                if(got_password)
-                                       printf("\nmount.cifs warning - password specified twice\n");
+                                       fprintf(stderr, "\nmount.cifs warning - password specified twice\n");
                                got_password = 1;
                        } else {
-                               printf("password too long\n");
+                               fprintf(stderr, "password too long\n");
                                SAFE_FREE(out);
                                return 1;
                        }
@@ -607,13 +610,13 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                        }
                } else if (strncmp(data, "ip", 2) == 0) {
                        if (!value || !*value) {
-                               printf("target ip address argument missing");
+                               fprintf(stderr, "target ip address argument missing");
                        } else if (strnlen(value, MAX_ADDRESS_LEN) <= MAX_ADDRESS_LEN) {
                                if(verboseflag)
-                                       printf("ip address %s override specified\n",value);
+                                       fprintf(stderr, "ip address %s override specified\n",value);
                                got_ip = 1;
                        } else {
-                               printf("ip address too long\n");
+                               fprintf(stderr, "ip address too long\n");
                                SAFE_FREE(out);
                                return 1;
                        }
@@ -621,32 +624,32 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                   || (strncmp(data, "target", 6) == 0)
                   || (strncmp(data, "path", 4) == 0)) {
                        if (!value || !*value) {
-                               printf("invalid path to network resource\n");
+                               fprintf(stderr, "invalid path to network resource\n");
                                SAFE_FREE(out);
                                return 1;  /* needs_arg; */
                        } else if(strnlen(value,5) < 5) {
-                               printf("UNC name too short");
+                               fprintf(stderr, "UNC name too short");
                        }
 
                        if (strnlen(value, 300) < 300) {
                                got_unc = 1;
                                if (strncmp(value, "//", 2) == 0) {
                                        if(got_unc)
-                                               printf("unc name specified twice, ignoring second\n");
+                                               fprintf(stderr, "unc name specified twice, ignoring second\n");
                                        else
                                                got_unc = 1;
                                } else if (strncmp(value, "\\\\", 2) != 0) {                       
-                                       printf("UNC Path does not begin with // or \\\\ \n");
+                                       fprintf(stderr, "UNC Path does not begin with // or \\\\ \n");
                                        SAFE_FREE(out);
                                        return 1;
                                } else {
                                        if(got_unc)
-                                               printf("unc name specified twice, ignoring second\n");
+                                               fprintf(stderr, "unc name specified twice, ignoring second\n");
                                        else
                                                got_unc = 1;
                                }
                        } else {
-                               printf("CIFS: UNC name too long\n");
+                               fprintf(stderr, "CIFS: UNC name too long\n");
                                SAFE_FREE(out);
                                return 1;
                        }
@@ -656,14 +659,14 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                           such as "DOM" and "dom" and "workgroup"
                           and "WORKGRP" etc. */
                        if (!value || !*value) {
-                               printf("CIFS: invalid domain name\n");
+                               fprintf(stderr, "CIFS: invalid domain name\n");
                                SAFE_FREE(out);
                                return 1;       /* needs_arg; */
                        }
                        if (strnlen(value, DOMAIN_SIZE+1) < DOMAIN_SIZE+1) {
                                got_domain = 1;
                        } else {
-                               printf("domain name too long\n");
+                               fprintf(stderr, "domain name too long\n");
                                SAFE_FREE(out);
                                return 1;
                        }
@@ -671,13 +674,13 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                        if (value && *value) {
                                rc = open_cred_file(value);
                                if(rc) {
-                                       printf("error %d (%s) opening credential file %s\n",
+                                       fprintf(stderr, "error %d (%s) opening credential file %s\n",
                                                rc, strerror(rc), value);
                                        SAFE_FREE(out);
                                        return 1;
                                }
                        } else {
-                               printf("invalid credential file name specified\n");
+                               fprintf(stderr, "invalid credential file name specified\n");
                                SAFE_FREE(out);
                                return 1;
                        }
@@ -688,7 +691,7 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                                        struct passwd *pw;
 
                                        if (!(pw = getpwnam(value))) {
-                                               printf("bad user name \"%s\"\n", value);
+                                               fprintf(stderr, "bad user name \"%s\"\n", value);
                                                exit(EX_USAGE);
                                        }
                                        snprintf(user, sizeof(user), "%u", pw->pw_uid);
@@ -704,7 +707,7 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                                        struct group *gr;
 
                                        if (!(gr = getgrnam(value))) {
-                                               printf("bad group name \"%s\"\n", value);
+                                               fprintf(stderr, "bad group name \"%s\"\n", value);
                                                exit(EX_USAGE);
                                        }
                                        snprintf(group, sizeof(group), "%u", gr->gr_gid);
@@ -716,32 +719,32 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
        /* fmask and dmask synonyms for people used to smbfs syntax */
                } else if (strcmp(data, "file_mode") == 0 || strcmp(data, "fmask")==0) {
                        if (!value || !*value) {
-                               printf ("Option '%s' requires a numerical argument\n", data);
+                               fprintf(stderr, "Option '%s' requires a numerical argument\n", data);
                                SAFE_FREE(out);
                                return 1;
                        }
 
                        if (value[0] != '0') {
-                               printf ("WARNING: '%s' not expressed in octal.\n", data);
+                               fprintf(stderr, "WARNING: '%s' not expressed in octal.\n", data);
                        }
 
                        if (strcmp (data, "fmask") == 0) {
-                               printf ("WARNING: CIFS mount option 'fmask' is deprecated. Use 'file_mode' instead.\n");
+                               fprintf(stderr, "WARNING: CIFS mount option 'fmask' is deprecated. Use 'file_mode' instead.\n");
                                data = "file_mode"; /* BB fix this */
                        }
                } else if (strcmp(data, "dir_mode") == 0 || strcmp(data, "dmask")==0) {
                        if (!value || !*value) {
-                               printf ("Option '%s' requires a numerical argument\n", data);
+                               fprintf(stderr, "Option '%s' requires a numerical argument\n", data);
                                SAFE_FREE(out);
                                return 1;
                        }
 
                        if (value[0] != '0') {
-                               printf ("WARNING: '%s' not expressed in octal.\n", data);
+                               fprintf(stderr, "WARNING: '%s' not expressed in octal.\n", data);
                        }
 
                        if (strcmp (data, "dmask") == 0) {
-                               printf ("WARNING: CIFS mount option 'dmask' is deprecated. Use 'dir_mode' instead.\n");
+                               fprintf(stderr, "WARNING: CIFS mount option 'dmask' is deprecated. Use 'dir_mode' instead.\n");
                                data = "dir_mode";
                        }
                        /* the following eight mount options should be
@@ -794,7 +797,7 @@ static int parse_options(char ** optionsp, unsigned long * filesys_flags)
                        }
                } else if (strnicmp(data, "version", 3) == 0) {
                } else {
-                       printf("CIFS: Unknown mount option %s\n",data);
+                       fprintf(stderr, "CIFS: Unknown mount option %s\n",data);
                } */ /* nothing to do on those four mount options above.
                        Just pass to kernel and ignore them here */
 
@@ -888,7 +891,7 @@ static void check_for_comma(char ** ppasswrd)
                return;
        if(number_of_commas > MOUNT_PASSWD_SIZE) {
                /* would otherwise overflow the mount options buffer */
-               printf("\nInvalid password. Password contains too many commas.\n");
+               fprintf(stderr, "\nInvalid password. Password contains too many commas.\n");
                return;
        }
 
@@ -942,7 +945,7 @@ static char * check_for_domain(char **ppuser)
        }
 
        if(got_domain) {
-               printf("Domain name specified twice. Username probably malformed\n");
+               fprintf(stderr, "Domain name specified twice. Username probably malformed\n");
                return NULL;
        }
 
@@ -951,7 +954,7 @@ static char * check_for_domain(char **ppuser)
        if (domainnm[0] != 0) {
                got_domain = 1;
        } else {
-               printf("null domain\n");
+               fprintf(stderr, "null domain\n");
        }
        len = strlen(domainnm);
        /* reset domainm to new buffer, and copy
@@ -1010,18 +1013,18 @@ parse_server(char ** punc_name)
        int rc;
 
        if(length > (MAX_UNC_LEN - 1)) {
-               printf("mount error: UNC name too long");
+               fprintf(stderr, "mount error: UNC name too long");
                return NULL;
        }
        if ((strncasecmp("cifs://", unc_name, 7) == 0) ||
            (strncasecmp("smb://", unc_name, 6) == 0)) {
-               printf("\nMounting cifs URL not implemented yet. Attempt to mount %s\n", unc_name);
+               fprintf(stderr, "\nMounting cifs URL not implemented yet. Attempt to mount %s\n", unc_name);
                return NULL;
        }
 
        if(length < 3) {
                /* BB add code to find DFS root here */
-               printf("\nMounting the DFS root for domain not implemented yet\n");
+               fprintf(stderr, "\nMounting the DFS root for domain not implemented yet\n");
                return NULL;
        } else {
                if(strncmp(unc_name,"//",2) && strncmp(unc_name,"\\\\",2)) {
@@ -1042,8 +1045,8 @@ parse_server(char ** punc_name)
                                unc_name[length+2] = 0;
                                goto continue_unc_parsing;
                        } else {
-                               printf("mount error: improperly formatted UNC name.");
-                               printf(" %s does not begin with \\\\ or //\n",unc_name);
+                               fprintf(stderr, "mount error: improperly formatted UNC name.");
+                               fprintf(stderr, " %s does not begin with \\\\ or //\n",unc_name);
                                return NULL;
                        }
                } else {
@@ -1059,7 +1062,7 @@ continue_unc_parsing:
                                if(got_ip == 0) {
                                        rc = getaddrinfo(unc_name, NULL, NULL, &addrlist);
                                        if (rc != 0) {
-                                               printf("mount error: could not resolve address for %s: %s\n",
+                                               fprintf(stderr, "mount error: could not resolve address for %s: %s\n",
                                                        unc_name, gai_strerror(rc));
                                                addrlist = NULL;
                                        }
@@ -1074,7 +1077,7 @@ continue_unc_parsing:
                                }
                                if(got_ip) {
                                        if(verboseflag)
-                                               printf("ip address specified explicitly\n");
+                                               fprintf(stderr, "ip address specified explicitly\n");
                                        return NULL;
                                }
                                /* BB should we pass an alternate version of the share name as Unicode */
@@ -1082,7 +1085,7 @@ continue_unc_parsing:
                                return addrlist; 
                        } else {
                                /* BB add code to find DFS root (send null path on get DFS Referral to specified server here */
-                               printf("Mounting the DFS root for a particular server not implemented yet\n");
+                               fprintf(stderr, "Mounting the DFS root for a particular server not implemented yet\n");
                                return NULL;
                        }
                }
@@ -1181,12 +1184,10 @@ int main(int argc, char ** argv)
        bindtextdomain(PACKAGE, LOCALEDIR);
        textdomain(PACKAGE); */
 
-       if(argc && argv) {
+       if(argc && argv)
                thisprogram = argv[0];
-       } else {
-               mount_cifs_usage();
-               exit(EX_USAGE);
-       }
+       else
+               mount_cifs_usage(stderr);
 
        if(thisprogram == NULL)
                thisprogram = "mount.cifs";
@@ -1195,7 +1196,7 @@ int main(int argc, char ** argv)
        /* BB add workstation name and domain and pass down */
 
 /* #ifdef _GNU_SOURCE
-       printf(" node: %s machine: %s sysname %s domain %s\n", sysinfo.nodename,sysinfo.machine,sysinfo.sysname,sysinfo.domainname);
+       fprintf(stderr, " node: %s machine: %s sysname %s domain %s\n", sysinfo.nodename,sysinfo.machine,sysinfo.sysname,sysinfo.domainname);
 #endif */
        if(argc > 2) {
                dev_name = argv[1];
@@ -1216,16 +1217,11 @@ int main(int argc, char ** argv)
                if ((strcmp(argv[1], "-h") == 0) ||
                    (strcmp(argv[1], "-?") == 0) ||
                    (strcmp(argv[1], "--help") == 0))
-               {
-                       mount_cifs_usage();
-                       exit(0);
-               }
+                       mount_cifs_usage(stdout);
 
-               mount_cifs_usage();
-               exit(EX_USAGE);
+               mount_cifs_usage(stderr);
        } else {
-               mount_cifs_usage();
-               exit(EX_USAGE);
+               mount_cifs_usage(stderr);
        }
 
 
@@ -1246,8 +1242,7 @@ int main(int argc, char ** argv)
 
                case '?':
                case 'h':        /* help */
-                       mount_cifs_usage ();
-                       exit(0);
+                       mount_cifs_usage(stdout);
                case 'n':
                        ++nomtab;
                        break;
@@ -1297,14 +1292,14 @@ int main(int argc, char ** argv)
 
                                uid = strtoul(optarg, &ep, 10);
                                if (*ep) {
-                                       printf("bad uid value \"%s\"\n", optarg);
+                                       fprintf(stderr, "bad uid value \"%s\"\n", optarg);
                                        exit(EX_USAGE);
                                }
                        } else {
                                struct passwd *pw;
 
                                if (!(pw = getpwnam(optarg))) {
-                                       printf("bad user name \"%s\"\n", optarg);
+                                       fprintf(stderr, "bad user name \"%s\"\n", optarg);
                                        exit(EX_USAGE);
                                }
                                uid = pw->pw_uid;
@@ -1317,14 +1312,14 @@ int main(int argc, char ** argv)
 
                                gid = strtoul(optarg, &ep, 10);
                                if (*ep) {
-                                       printf("bad gid value \"%s\"\n", optarg);
+                                       fprintf(stderr, "bad gid value \"%s\"\n", optarg);
                                        exit(EX_USAGE);
                                }
                        } else {
                                struct group *gr;
 
                                if (!(gr = getgrnam(optarg))) {
-                                       printf("bad user name \"%s\"\n", optarg);
+                                       fprintf(stderr, "bad user name \"%s\"\n", optarg);
                                        exit(EX_USAGE);
                                }
                                gid = gr->gr_gid;
@@ -1356,15 +1351,13 @@ int main(int argc, char ** argv)
                        ++fakemnt;
                        break;
                default:
-                       printf("unknown mount option %c\n",c);
-                       mount_cifs_usage();
-                       exit(EX_USAGE);
+                       fprintf(stderr, "unknown mount option %c\n",c);
+                       mount_cifs_usage(stderr);
                }
        }
 
        if((argc < 3) || (dev_name == NULL) || (mountpoint == NULL)) {
-               mount_cifs_usage();
-               exit(EX_USAGE);
+               mount_cifs_usage(stderr);
        }
 
        /* make sure mountpoint is legit */
@@ -1423,7 +1416,7 @@ int main(int argc, char ** argv)
 
        addrhead = addr = parse_server(&share_name);
        if((addrhead == NULL) && (got_ip == 0)) {
-               printf("No ip address specified and hostname not found\n");
+               fprintf(stderr, "No ip address specified and hostname not found\n");
                rc = EX_USAGE;
                goto mount_exit;
        }
@@ -1453,7 +1446,7 @@ int main(int argc, char ** argv)
                                                           no good replacement yet. */
                mountpassword = (char *)calloc(MOUNT_PASSWD_SIZE+1,1);
                if (!tmp_pass || !mountpassword) {
-                       printf("Password not entered, exiting\n");
+                       fprintf(stderr, "Password not entered, exiting\n");
                        exit(EX_USAGE);
                }
                strlcpy(mountpassword, tmp_pass, MOUNT_PASSWD_SIZE+1);
@@ -1469,8 +1462,8 @@ int main(int argc, char ** argv)
        if(share_name)
                optlen += strlen(share_name) + 4;
        else {
-               printf("No server share name specified\n");
-               printf("\nMounting the DFS root for server not implemented yet\n");
+               fprintf(stderr, "No server share name specified\n");
+               fprintf(stderr, "\nMounting the DFS root for server not implemented yet\n");
                 exit(EX_USAGE);
        }
        if(user_name)
@@ -1484,7 +1477,7 @@ mount_retry:
        options = (char *)malloc(options_size /* space for commas in password */ + 8 /* space for domain=  , domain name itself was counted as part of the length username string above */);
 
        if(options == NULL) {
-               printf("Could not allocate memory for mount options\n");
+               fprintf(stderr, "Could not allocate memory for mount options\n");
                exit(EX_SYSERR);
        }
 
@@ -1530,7 +1523,7 @@ mount_retry:
                strlcat(options,prefixpath,options_size); /* no need to cat the / */
        }
        if(verboseflag)
-               printf("\nmount.cifs kernel mount options %s \n",options);
+               fprintf(stderr, "\nmount.cifs kernel mount options %s \n",options);
 
        /* convert all '\\' to '/' in share portion so that /proc/mounts looks pretty */
        replace_char(dev_name, '\\', '/', strlen(share_name));
@@ -1583,7 +1576,7 @@ mount_retry:
                        }
                        break;
                case ENODEV:
-                       printf("mount error: cifs filesystem not supported by the system\n");
+                       fprintf(stderr, "mount error: cifs filesystem not supported by the system\n");
                        break;
                case ENXIO:
                        if(retry == 0) {
@@ -1591,13 +1584,13 @@ mount_retry:
                                if (uppercase_string(dev_name) &&
                                    uppercase_string(share_name) &&
                                    uppercase_string(prefixpath)) {
-                                       printf("retrying with upper case share name\n");
+                                       fprintf(stderr, "retrying with upper case share name\n");
                                        goto mount_retry;
                                }
                        }
                }
-               printf("mount error(%d): %s\n", errno, strerror(errno));
-               printf("Refer to the mount.cifs(8) manual page (e.g. man "
+               fprintf(stderr, "mount error(%d): %s\n", errno, strerror(errno));
+               fprintf(stderr, "Refer to the mount.cifs(8) manual page (e.g. man "
                       "mount.cifs)\n");
                rc = EX_FAIL;
                goto mount_exit;
@@ -1608,12 +1601,12 @@ mount_retry:
        atexit(unlock_mtab);
        rc = lock_mtab();
        if (rc) {
-               printf("cannot lock mtab");
+               fprintf(stderr, "cannot lock mtab");
                goto mount_exit;
        }
        pmntfile = setmntent(MOUNTED, "a+");
        if (!pmntfile) {
-               printf("could not update mount table\n");
+               fprintf(stderr, "could not update mount table\n");
                unlock_mtab();
                rc = EX_FILEIO;
                goto mount_exit;
index 846145ed58c8e0d694c828c6aeb6214a52ad585e..625cfed21942ae2a74ac59cc9b148fd49827eb69 100644 (file)
@@ -489,8 +489,8 @@ Users (S-1-5-32-545) -> -1
 <screen>
 &rootprompt; mkdir -p /data/{accounts,finsvcs}
 &rootprompt; chown -R root:root /data
-&rootprompt; chown -R alanm:accounts /data/accounts
-&rootprompt; chown -R alanm:finsvcs /data/finsvcs
+&rootprompt; chown -R alanm:acctsdep /data/accounts
+&rootprompt; chown -R alanm:finsrvcs /data/finsrvcs
 &rootprompt; chmod -R ug+rwx,o+rx-w /data
 </screen>
                Each department is responsible for creating its own directory structure within its
@@ -688,9 +688,9 @@ hosts:      files wins
 <smbconfoption name="valid users">%G</smbconfoption>
 <smbconfoption name="read only">No</smbconfoption>
 
-<smbconfsection name="[finsvcs]"/>
+<smbconfsection name="[finsrvcs]"/>
 <smbconfoption name="comment">Financial Service Files</smbconfoption>
-<smbconfoption name="path">/data/finsvcs</smbconfoption>
+<smbconfoption name="path">/data/finsrvcs</smbconfoption>
 <smbconfoption name="valid users">%G</smbconfoption>
 <smbconfoption name="read only">No</smbconfoption>
 </smbconfblock>
index 4781994881600cab8d98fe42cc1e90afa0bf04fd..f590334ebe67c2a014aedd8da0532aea0ec7a33d 100644 (file)
@@ -36,7 +36,7 @@ This is followed by an overview of how the IDMAP facility may be implemented.
 The IDMAP facility is of concern where more than one Samba server (or Samba network client)
 is installed in a domain. Where there is a single Samba server, do not be too concerned regarding
 the IDMAP infrastructure &smbmdash; the default behavior of Samba is nearly always sufficient.
-Where mulitple Samba servers are used it is often necessary to move data off one server and onto
+Where multiple Samba servers are used it is often necessary to move data off one server and onto
 another, and that is where the fun begins!
 </para>
 
@@ -426,7 +426,7 @@ on Server Types and Security Modes</link>.
        <indexterm><primary>passdb backend</primary></indexterm>
        <indexterm><primary>BDC</primary></indexterm>
        <indexterm><primary>LDAP backend</primary></indexterm>
-       Security identifiers used within a domain must be managed to avoid conflict and to preserve itegrity.
+       Security identifiers used within a domain must be managed to avoid conflict and to preserve integrity.
        In an NT4 domain context, the PDC manages the distribution of all security credentials to the backup
        domain controllers (BDCs). At this time the only passdb backend for a Samba domain controller that is suitable
        for such information is an LDAP backend.
index ea0ed485c00fe8a2966214c31d0890bcf1417008..6e96ad1e1a3fda4e535dbfaabcc91cdc2e907470 100644 (file)
@@ -634,7 +634,7 @@ exit 0
 
                <step><para>
                Modify the &smb.conf; file so the <literal>NETLOGON</literal> stanza contains the parameters
-               shown in <link linkend="magicnetlogon">the Netlogon Example smb.conf file</link>.
+               shown in <link linkend="magicnetlogon">the Netlogon Example smb.conf file</link> as shown.
                </para></step>
 
 <example id="magicnetlogon">
@@ -1303,7 +1303,7 @@ Storing SID S-1-5-21-726309263-4128913605-1168186429 \
        that the addition and deletion of shares using this tool depends on the availability of a suitable
        interface script. The interface scripts Sambas <command>smbd</command> uses are called
        <smbconfoption name="add share command"/>, <smbconfoption name="delete share command"/> and
-       <smbconfoption name="change share command"/> A set of example scripts are provided in the Samba source
+       <smbconfoption name="change share command"/>. A set of example scripts are provided in the Samba source
        code tarball in the directory <filename>~samba/examples/scripts</filename>.
        </para>
 
@@ -1630,7 +1630,7 @@ net rpc share MIGRATE ALL &lt;share-name&gt; -S &lt;source&gt;
        Printing needs vary greatly depending on the network environment and may be very simple or complex. If
        the need is very simple, the best solution to the implementation of printing support may well be to
        re-install everything from a clean slate instead of migrating older configurations. On the other hand,
-       a complex network that is integrated with many international offices and a multiplexity of local branch
+       a complex network that is integrated with many international offices and a complex arrangement of local branch
        offices, each of which form an inter-twined maze of printing possibilities, the ability to migrate all
        printer configurations is decidedly beneficial. To manually re-establish a complex printing network
        will take much time and frustration. Often it will not be possible to find driver files that are
index 385a3ae07a1995e2425a12895cc9b94ece095be8..c766e3dce7332a3d13963e2f48009e4b8140912a 100644 (file)
@@ -407,12 +407,12 @@ _PUBLIC_ bool strequal(const char *s1, const char *s2);
 /**
   build an empty (only NULL terminated) list of strings (for expansion with str_list_add() etc)
 */
-_PUBLIC_ const char **str_list_make_empty(TALLOC_CTX *mem_ctx);
+_PUBLIC_ char **str_list_make_empty(TALLOC_CTX *mem_ctx);
 
 /**
   place the only element 'entry' into a new, NULL terminated string list
 */
-_PUBLIC_ const char **str_list_make_single(TALLOC_CTX *mem_ctx,
+_PUBLIC_ char **str_list_make_single(TALLOC_CTX *mem_ctx,
        const char *entry);
 
 /**
@@ -420,7 +420,7 @@ _PUBLIC_ const char **str_list_make_single(TALLOC_CTX *mem_ctx,
   separator list. The separator list must contain characters less than
   or equal to 0x2f for this to work correctly on multi-byte strings
 */
-_PUBLIC_ const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string,
+_PUBLIC_ char **str_list_make(TALLOC_CTX *mem_ctx, const char *string,
        const char *sep);
 
 /**
@@ -428,7 +428,7 @@ _PUBLIC_ const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string,
  * Entries are seperated by spaces and can be enclosed by quotes. 
  * Does NOT support escaping
  */
-_PUBLIC_ const char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
+_PUBLIC_ char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, const char *sep);
 
 /**
  * join a list back to one string 
@@ -447,7 +447,7 @@ _PUBLIC_ size_t str_list_length(const char * const *list);
 /**
   copy a string list
 */
-_PUBLIC_ const char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
+_PUBLIC_ char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list);
 
 /**
    Return true if all the elements of the list match exactly.
index b4b991f3db172ae0370ea7c9e255286a843aaa43..1331fee6a70c9c9a753c09dcfe4e16638926c1e8 100644 (file)
 /**
   build an empty (only NULL terminated) list of strings (for expansion with str_list_add() etc)
 */
-_PUBLIC_ const char **str_list_make_empty(TALLOC_CTX *mem_ctx)
+_PUBLIC_ char **str_list_make_empty(TALLOC_CTX *mem_ctx)
 {
-       const char **ret = NULL;
+       char **ret = NULL;
 
-       ret = talloc_array(mem_ctx, const char *, 1);
+       ret = talloc_array(mem_ctx, char *, 1);
        if (ret == NULL) {
                return NULL;
        }
@@ -48,11 +48,11 @@ _PUBLIC_ const char **str_list_make_empty(TALLOC_CTX *mem_ctx)
 /**
   place the only element 'entry' into a new, NULL terminated string list
 */
-_PUBLIC_ const char **str_list_make_single(TALLOC_CTX *mem_ctx, const char *entry)
+_PUBLIC_ char **str_list_make_single(TALLOC_CTX *mem_ctx, const char *entry)
 {
-       const char **ret = NULL;
+       char **ret = NULL;
 
-       ret = talloc_array(mem_ctx, const char *, 2);
+       ret = talloc_array(mem_ctx, char *, 2);
        if (ret == NULL) {
                return NULL;
        }
@@ -72,30 +72,30 @@ _PUBLIC_ const char **str_list_make_single(TALLOC_CTX *mem_ctx, const char *entr
   separator list. The separator list must contain characters less than
   or equal to 0x2f for this to work correctly on multi-byte strings
 */
-_PUBLIC_ const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
+_PUBLIC_ char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
 {
        int num_elements = 0;
-       const char **ret = NULL;
+       char **ret = NULL;
 
        if (sep == NULL) {
                sep = LIST_SEP;
        }
 
-       ret = talloc_array(mem_ctx, const char *, 1);
+       ret = talloc_array(mem_ctx, char *, 1);
        if (ret == NULL) {
                return NULL;
        }
 
        while (string && *string) {
                size_t len = strcspn(string, sep);
-               const char **ret2;
+               char **ret2;
                
                if (len == 0) {
                        string += strspn(string, sep);
                        continue;
                }
 
-               ret2 = talloc_realloc(mem_ctx, ret, const char *,
+               ret2 = talloc_realloc(mem_ctx, ret, char *,
                        num_elements+2);
                if (ret2 == NULL) {
                        talloc_free(ret);
@@ -123,12 +123,12 @@ _PUBLIC_ const char **str_list_make(TALLOC_CTX *mem_ctx, const char *string, con
  * Entries are seperated by spaces and can be enclosed by quotes. 
  * Does NOT support escaping
  */
-_PUBLIC_ const char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
+_PUBLIC_ char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
 {
        int num_elements = 0;
-       const char **ret = NULL;
+       char **ret = NULL;
 
-       ret = talloc_array(mem_ctx, const char *, 1);
+       ret = talloc_array(mem_ctx, char *, 1);
        if (ret == NULL) {
                return NULL;
        }
@@ -139,7 +139,7 @@ _PUBLIC_ const char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *strin
        while (string && *string) {
                size_t len = strcspn(string, sep);
                char *element;
-               const char **ret2;
+               char **ret2;
                
                if (len == 0) {
                        string += strspn(string, sep);
@@ -161,7 +161,7 @@ _PUBLIC_ const char **str_list_make_shell(TALLOC_CTX *mem_ctx, const char *strin
                        return NULL;
                }
 
-               ret2 = talloc_realloc(mem_ctx, ret, const char *, num_elements+2);
+               ret2 = talloc_realloc(mem_ctx, ret, char *, num_elements+2);
                if (ret2 == NULL) {
                        talloc_free(ret);
                        return NULL;
@@ -238,15 +238,15 @@ _PUBLIC_ size_t str_list_length(const char * const *list)
 /**
   copy a string list
 */
-_PUBLIC_ const char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list)
+_PUBLIC_ char **str_list_copy(TALLOC_CTX *mem_ctx, const char **list)
 {
        int i;
-       const char **ret;
+       char **ret;
 
        if (list == NULL)
                return NULL;
        
-       ret = talloc_array(mem_ctx, const char *, str_list_length(list)+1);
+       ret = talloc_array(mem_ctx, char *, str_list_length(list)+1);
        if (ret == NULL) 
                return NULL;
 
index f90478296c2274fcf0fc75c02f493561a9209e35..bbe653b8bd5056f4cbb3b0ab113473a3c429b3c5 100644 (file)
@@ -241,15 +241,4 @@ struct api_struct {
        bool (*fn) (pipes_struct *);
 };
 
-/*
- * higher order functions for use with msrpc client code
- */
-
-#define PRINT_INFO_FN(fn)\
-        void (*fn)(const char*, uint32, uint32, void  *const *const)
-#define JOB_INFO_FN(fn)\
-        void (*fn)(const char*, const char*, uint32, uint32, void *const *const)
-
-/* end higher order functions */
-
 #endif /* _NT_DOMAIN_H */
index c197fd751598d955d1c5d96f18beddd660615d7c..9a0b12adea0fc39de887bb20fb0e481424c921be 100644 (file)
@@ -1616,7 +1616,7 @@ bool str_list_sub_basic( char **list, const char *smb_name,
 }
 
 /******************************************************************************
- substritute a specific pattern in a string list
+ substitute a specific pattern in a string list
  *****************************************************************************/
 
 bool str_list_substitute(char **list, const char *pattern, const char *insert)
@@ -2430,13 +2430,13 @@ char *escape_shell_string(const char *src)
 
 #define S_LIST_ABS 16 /* List Allocation Block Size */
 
-char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string, const char *sep)
+char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string,
+       const char *sep)
 {
        char **list;
        const char *str;
-       char *s;
+       char *s, *tok;
        int num, lsize;
-       char *tok;
 
        if (!string || !*string)
                return NULL;
index 408721ab3e947acd4ddeb16123d3be0893456da1..c92bc8ec21a0e3360a291917a66700b54d43c1fc 100644 (file)
@@ -652,7 +652,8 @@ static int vfswrap_lstat(vfs_handle_struct *handle,
 }
 
 static NTSTATUS vfswrap_translate_name(vfs_handle_struct *handle,
-                                      char **mapped_name)
+                                      char **mapped_name,
+                                      enum vfs_translate_direction direction)
 {
        /* Default behavior is a NOOP */
 
index 4045184f335dd98e73b82b2c43be91e4111b7cb4..6136c6d1711ee19037335a38ad4295d42d368b69 100644 (file)
@@ -1068,7 +1068,7 @@ mismatch with our scope (%s).\n", inet_ntoa(p->ip), scope, global_scope()));
 
        pull_ascii_nstring(src_name, sizeof(src_name), dgram->source_name.name);
        if (is_myname(src_name)) {
-               DEBUG(0,("process_browse_packet: Discarding datagram from IP %s. Source name \
+               DEBUG(7,("process_browse_packet: Discarding datagram from IP %s. Source name \
 %s is one of our names !\n", inet_ntoa(p->ip), nmb_namestr(&dgram->source_name)));
                return;
        }
index 82e782b9db09b131026eb399babd98fb237731c7..ac5c3d2d93a66339406c82b8c97c68fa63e26373 100644 (file)
@@ -493,18 +493,6 @@ static NTSTATUS query_user(struct winbindd_domain *domain,
                return NT_STATUS_OK;
        }
 
-       if ( !winbindd_can_contact_domain( domain ) ) {
-               DEBUG(10,("query_user: No incoming trust for domain %s\n",
-                         domain->name));
-               return NT_STATUS_OK;
-       }
-
-       if ( !winbindd_can_contact_domain( domain ) ) {
-               DEBUG(10,("query_user: No incoming trust for domain %s\n",
-                         domain->name));
-               return NT_STATUS_OK;
-       }
-
        /* no cache; hit the wire */
 
        result = cm_connect_sam(domain, mem_ctx, &cli, &dom_pol);