~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source/utils/net_join.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-07-08 07:02:37 UTC
  • mfrom: (0.27.6 upstream) (0.28.6 sid)
  • Revision ID: james.westby@ubuntu.com-20090708070237-o5wxq1shz5tabuw2
Tags: 2:3.4.0-1ubuntu1
* Merge from debian unstable, remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/smb.conf:
    - Add "(Samaba, Ubuntu)" to server string.
    - Comment out the default [homes] share, and add a comment 
      about "valid users = $s" to show users how to restrict access
      to \\server\username to only username.
    - Set 'usershare allow guests' so that usershare admins are
      allowed to create public shares to authenticated ones.
    - Add 'map to gues = Bad user', maps bad username to guest access.
  + debian/samba-common.conf:
    - Do not change priority to hight if dhclient3 is installed.
    - Use priority medium  instead of high for the workgroup question.
  + debian/samba-common.postinst: Add more informative error message for the case
    where smb.conf was manually deleted. (LP: #312449)
  + debian/mksambapasswd.awk: Do not add user with UID less than 1000 to smbpasswd.
  + debian/control:
    - Make libwbclient0 replace/conflict with hardy's likewise-open.
    - Don't build against ctdb.
    - Add suggests keyutils for smbfs. (LP: #300221)
  + debian/rules:
    - enable "native" PIE hardening.
    - remove --with-ctdb and --with-cluster-support=yes
  + Add ufw integration:
    - Created debian/samba.ufw profile.
    - debian/rules, debian/samba.dirs, debian/samba.files: install profile
    - debian/control: have samba suffest ufw
  + Dropped:
    - debian/patches/fix-password-expiry-calculation.patch: Already upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
   Samba Unix/Linux SMB client library
3
 
   net join commands
4
 
   Copyright (C) 2002  Jim McDonough  (jmcd@us.ibm.com)
5
 
   Copyright (C) 2008  Kai Blin  (kai@samba.org)
6
 
 
7
 
   This program is free software; you can redistribute it and/or modify
8
 
   it under the terms of the GNU General Public License as published by
9
 
   the Free Software Foundation; either version 3 of the License, or
10
 
   (at your option) any later version.
11
 
 
12
 
   This program is distributed in the hope that it will be useful,
13
 
   but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
   GNU General Public License for more details.
16
 
 
17
 
   You should have received a copy of the GNU General Public License
18
 
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 
*/
20
 
 
21
 
#include "includes.h"
22
 
#include "utils/net.h"
23
 
 
24
 
int net_join_usage(struct net_context *c, int argc, const char **argv)
25
 
{
26
 
        d_printf("\nnet [<method>] join [misc. options]\n"
27
 
                 "\tjoins this server to a domain\n");
28
 
        d_printf("Valid methods: (auto-detected if not specified)\n");
29
 
        d_printf("\tads\t\t\t\tActive Directory (LDAP/Kerberos)\n");
30
 
        d_printf("\trpc\t\t\t\tDCE-RPC\n");
31
 
        net_common_flags_usage(c, argc, argv);
32
 
        return -1;
33
 
}
34
 
 
35
 
int net_join(struct net_context *c, int argc, const char **argv)
36
 
{
37
 
        if (argc < 1)
38
 
                return net_join_usage(c, argc, argv);
39
 
 
40
 
        if (StrCaseCmp(argv[0], "HELP") == 0) {
41
 
                net_join_usage(c, argc, argv);
42
 
                return 0;
43
 
        }
44
 
 
45
 
        if (net_ads_check_our_domain(c) == 0) {
46
 
                if (net_ads_join(c, argc, argv) == 0)
47
 
                        return 0;
48
 
                else
49
 
                        d_fprintf(stderr, "ADS join did not work, falling back to RPC...\n");
50
 
        }
51
 
        return net_rpc_join(c, argc, argv);
52
 
}
53
 
 
54