Turns out this also fails in noble, and wasn't seen before just because
of ordering.

If we try to first reproduce the bug, and then update the package and
run again, it will work. Even though we get a crash at first when trying
to reproduce the bug, it did manage to create the policy file. Then when
we update to the package in proposed, and run the command again, the
policy file already exists, and we run through a different code path.

In noble, if you start fresh from the packages in noble proposed, this
bug is also not verified:

ubuntu@n-ad:~$ sudo samba-tool gpo manage motd set 
{31B2F340-016D-11D2-945F-00C04FB984F9} "Welcome" -U Administrator%Passw0rd      
                                                            
WARNING: Using passwords on command line is insecure. Installing the 
setproctitle python module will hide these from shortly after program start.    
                                          
ERROR(<class 'AttributeError'>): uncaught exception - 'NoneType' object has no 
attribute 'text'                                                                
                                
  File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 279, in 
_run                                                                            
                                
    return self.run(*args, **kwargs)                                            
                                                                                
                               
           ^^^^^^^^^^^^^^^^^^^^^^^^^                                            
                                                                                
                               
  File "/usr/lib/python3/dist-packages/samba/netcmd/gpo.py", line 3832, in run  
                                                                                
                               
    text.text = value                                                           
                                                                                
                               
    ^^^^^^^^^                                                                   
                                                                                
                               


Package from proposed:

ubuntu@n-ad:~$ apt-cache policy samba                                           
                                                                                
                               
samba:                                                                          
                                                                                
                               
  Installed: 2:4.19.5+dfsg-4ubuntu9.1                                           
                                                                                
                               
  Candidate: 2:4.19.5+dfsg-4ubuntu9.1                                           
                                                                                
                               
  Version table:                                                                
                                                                                
                               
 *** 2:4.19.5+dfsg-4ubuntu9.1 100                                               
                                                                                
                               
        100 http://br.archive.ubuntu.com/ubuntu noble-proposed/main amd64 
Packages                                                                        
                                     
        100 /var/lib/dpkg/status                                                
                                                                                
                               
     2:4.19.5+dfsg-4ubuntu9 500                                                 
                                                                                
                               
        500 http://br.archive.ubuntu.com/ubuntu noble/main amd64 Packages       
                                                                                
                               


And it fails to create the policy from scratch:

ubuntu@n-ad:~$ sudo find /var/lib/samba/sysvol                                  
                                                                                
                               
/var/lib/samba/sysvol                                                           
                                                                                
                               
/var/lib/samba/sysvol/example.internal                                          
                                                                                
                               
/var/lib/samba/sysvol/example.internal/Policies                                 
                                                                                
                               
/var/lib/samba/sysvol/example.internal/Policies/{6AC1786C-016F-11D2-945F-00C04FB984F9}
                                                                                
                         
/var/lib/samba/sysvol/example.internal/Policies/{6AC1786C-016F-11D2-945F-00C04FB984F9}/MACHINE
                                                                                
                 
/var/lib/samba/sysvol/example.internal/Policies/{6AC1786C-016F-11D2-945F-00C04FB984F9}/USER
                                                                                
                    
/var/lib/samba/sysvol/example.internal/Policies/{6AC1786C-016F-11D2-945F-00C04FB984F9}/GPT.INI
                                                                                
                 
/var/lib/samba/sysvol/example.internal/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}
                                                                                
                         
/var/lib/samba/sysvol/example.internal/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/MACHINE
                                                                                
                 
/var/lib/samba/sysvol/example.internal/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/USER
                                                                                
                    
/var/lib/samba/sysvol/example.internal/Policies/{31B2F340-016D-11D2-945F-00C04FB984F9}/GPT.INI
                                                                                
                 
/var/lib/samba/sysvol/example.internal/scripts 

In other words, the fix from this bug indeed fixes the update case, but
breaks the "create the policy from scratch/fresh" case.


** Tags removed: verification-done-noble
** Tags added: verification-failed-noble

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2092308

Title:
  Backtrace when running "gpo manage motd set" to update an existing
  motd policy

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/2092308/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to