delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/03/09/02:29:28

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <47D39192.2020801@cwilson.fastmail.fm>
Date: Sun, 09 Mar 2008 02:28:18 -0500
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: csih and sspi with guest accounts
References: <47CE07A2 DOT 5030505 AT cwilson DOT fastmail DOT fm> <47CEE4DD DOT 6030608 AT x-ray DOT at> <47D2F243 DOT 4090309 AT x-ray DOT at>
In-Reply-To: <47D2F243.4090309@x-ray.at>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Reini Urban wrote:
> Reini Urban schrieb:
> I'd need to warn the user on XP about an active
> "net user Guest" account. "Guest" needs to be localized, hmm.
> I have "Gast" in german.

I've uploaded a new version as a 'test' release (csih-0.1.1-1). It 
includes a (binary) utility program:

getAccountName [-hVL] [-g|-a|-n INT]
returns the (possibly localized) name of the requested account

    --help|-h           print this help
    --version|-V        print version information
    --license|-L        print license information
    --guest|-g          print name of Guest account
    --admin|-a          print name of Administrator account
    --number|-n NUM     print name of the account specified by the 

                        supplied integer. This number should be in
                        the range [0,78] inclusive. See
                        WELL_KNOWN_SID_TYPE documentation matching
                        these numbers to specific account types.
Exactly one of the options `-g', `-a', or `-n INT' may be specified.
NOTE: this application works only on Windows XP or above

BTW, this utility is a native program, not a cygwin one. So if you use 
it directly, you'll need to strip \r before passing the result to "net 
user".  Or, use the csih shell function(s) that wraps this utility,
   csih_get_localized_account_name()
   csih_get_guest_account_name()
which does that for you.

> I believe having a global shell function for the postinstaller
> to check for xp and an active Guest account would make sense for the 
> service helper.
>   csih_is_xp()
>   csih_guestaccount_active()
> 
> csih_is_2008() would also be appreciated.

The test release also includes:

* New system id function: csih_is_2k(), csih_is_xp(), csih_is_vista()

note that Vista and Server 2008 both report "CYGWIN_NT-6.0", so I don't 
really have a good way of distinguishing between them.

Also, all of these "system id" functions are "minimum".  That is, if 
your system is Vista, then ALL of the id functions will return true, 
because they each are defined as:

    will return true if the system is XXXX or above

So, to find out if the system is EXACTLY windows XP, you have to check 
csih_is_xp && ! csih_is_vista

* New function: csih_invoke_helper
     invokes utilities in /usr/lib/csih/
* New function: csih_get_localized_account_name
     Given an WELL_KNOWN_SID_TYPE enumeration value, uses getAccountName
     utility to obtain the localized name associated with the account
* New function: csih_get_guest_account_name
     Shortcut using csih_get_localized_account_name for Guest account
* New function: csih_guest_account_active
     returns true (0) if Guest account is active, false (1) otherwise

Let me know what you think...

--
Chuck


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019