A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » Security and Administration with Windows XP
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Bug in NET USER /times or is it me?



 
 
Thread Tools Display Modes
  #1  
Old January 11th 08, 08:18 PM posted to microsoft.public.windowsxp.security_admin
Patrick Philippot
external usenet poster
 
Posts: 2
Default Bug in NET USER /times or is it me?

Hi,

Let's assume the following command

net user john /times:F,10am-12pm

or

net user john /times:F,10:00-24:00

The command "net user john" displays the correct settings. But if John tries
to connect between 10am and 12pm, the login is rejected. If I change the
settings as follows

net user john /times:F,10am-11pm

or

net user john /times:F,10:00-23:00

there's no problem.

Is this a known bug or did I miss some syntax subtlety? How do I set
midnight as the end of the time slot?

--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr
Ads
  #2  
Old January 13th 08, 10:52 AM posted to microsoft.public.windowsxp.security_admin
Patrick Philippot[_2_]
external usenet poster
 
Posts: 1
Default Bug in NET USER /times or is it me?

Hi,

It seems it's an XP specific bug. We have made some progress analyzing this
bug with another fellow MVP (Gilles Laurent). Actually, there are two
problems.

If I use the am-pm notation and if the end time is midnight as in

net user john /times:S,10am-12pm

the command "net user john" will display the expected settings but the logon
hours data (retrieved with the NetUserGetInfo API) is obviously wrong (first
bug):

\ netusertimes -get -user john
0 6 12 18 24
| . . . . . | . . . . . | . . . . . | . . . . . |
D D D D D D D D D D D D D D D D D D D D D D D D D Sunday
L D D D D D D D D D D D D D D D D D D D D D D D D Monday
M D D D D D D D D D D D D D D D D D D D D D D D D Tuesday
M D D D D D D D D D D D D D D D D D D D D D D D D Wednesday
J D D D D D D D D D D D D D D D D D D D D D D D D Thursday
V D D D D D D D D D D D D D D D D D D D D D D D D Friday
S D D D D D D D D D D A A D D D D D D D D D D D D Saturday

A : Allowed D : Disallowed

netusertimes being a small program written by Gilles and using the
NetUserGetInfo API..

Now, if I enter the following command:

net user john /times:S,10:00-24:00 (which is actually the same command)

the command "net user john" will display wrong settings (second bug)
claiming that John is allowed to logon from Saturday (S is for
samedi-saturday in french) 10:00am to Sunday 12:am. However, the actual
settings retrieved with netusertimes are correct and the logon hours work as
expected:

\ netusertimes -get -user john
0 6 12 18 24
| . . . . . | . . . . . | . . . . . | . . . . . |
D D D D D D D D D D D D D D D D D D D D D D D D D Sunday
L D D D D D D D D D D D D D D D D D D D D D D D D Monday
M D D D D D D D D D D D D D D D D D D D D D D D D Tuesday
M D D D D D D D D D D D D D D D D D D D D D D D D Wednesday
J D D D D D D D D D D D D D D D D D D D D D D D D Thursday
V D D D D D D D D D D D D D D D D D D D D D D D D Friday
S D D D D D D D D D D A A A A A A A A A A A A A A Saturday

A : Allowed D : Disallowed

We observe the same behavior with the english version of XP.

Conclusion: if the end of a time slot is midnight, do not use the am-pm
notation. Using the hh:mm notation will cause net user username to display
wrong settings but the actual settings will be correct and work as expected.

Cheers.

--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr


  #3  
Old January 14th 08, 08:03 AM posted to microsoft.public.windowsxp.security_admin
Patrick Philippot
external usenet poster
 
Posts: 2
Default Bug in NET USER /times or is it me?

Hi,

Conclusion: if the end of a time slot is midnight, do not use the am-pm
notation. Using the hh:mm notation will cause net user username to display
wrong settings but the actual settings will be correct and work as expected.


Well, actually, there's no bug. It's a problem with the confusing am-pm
notation that is not interpreted here as in the US. 12pm doesn't mean
midnight but noon while 12am means midnight. Here in France, we tend to
consider that 12am is noon and 12pm midnight. So both the settings and the
display of the settings when using net user username are actually correct
and the command works as expected. Just, the notation is misleading...

--
Patrick Philippot - Microsoft MVP
MainSoft Consulting Services
www.mainsoft.fr

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 02:12 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.