Project

General

Profile

Segnalazione #225

creazione utene con home non predefinita

Added by Michael Guggenberg about 7 years ago. Updated almost 7 years ago.

Status:
Chiuso
Priority:
Alta
Start date:
04/10/2017
Due date:
% Done:

100%

Estimated time:

Description

Creo l'utente username impostando la path della home a /home/studenti/username (non predefinita).
La home dell utente appena inserito viene però creata in /home/username
Edito l'utente e riemposto la path a /home/studenti/username, l'utente appena modificato trova la sua home non in /home/studenti/username ma sempre in /home/username.


Related issues

Blocked by octonet - Segnalazione #230: Autocompletare il campo home durante la creazione di un utenteChiuso04/14/2017

Actions

History

#1

Updated by Paolo Dongilli about 7 years ago

  • Assignee set to TRUELITE
  • Priority changed from Normale to Alta
#2

Updated by Mark Caglienzi about 7 years ago

  • Status changed from Nuovo to In elaborazione
  • Assignee changed from TRUELITE to Mark Caglienzi
#3

Updated by Mark Caglienzi about 7 years ago

  • Status changed from In elaborazione to Commenti
  • Assignee changed from Mark Caglienzi to Christopher R. Gabriel

Credo che il problema sia in octofussd, però non conosco molto il suo codice.

  • Nella view UserCreate la home viene correttamente letta dal form
  • Poi viene creato il tree per l'utente con lcreate() passando tutti i dati del form
  • A questo punto credo che intervenga octofussd
  • In ldapusers.py -> UserDB.new_user() chiama self._fillInNewUser()
  • In common.py c'è l'implementazione di _fillInNewUser() che rispetto alla home directory sembra ignorare il dato in arrivo e setta sempre '/home/$UTENTE'

Facendo print di value e data ottengo questo:

_fillInNewUser, value {'gecos': 'user_b', 'homeDirectory': '/home/studenti/user_b', 'uid': 'user_b', 'loginShell': '/bin/bash'}
_fillInNewUser, data {'uid': ['user_b'], 'sn': ['user_b'], 'givenName': ['user_b'], 'sambaPwdCanChange': ['0'], 'gecos': ['user_b'],
'homeDirectory': ['/home/user_b'], 'sambaLogonTime': ['0'], 'sambaPrimaryGroupSID': ['SIDPREFIX-2000'], 'shadowMax': ['99999'], 'sambaLMPassword': ['XXX'],
'gidNumber': ['500'], 'ou': ['studenti'], 'sambaPwdLastSet': ['0'], 'uidNumber': ['2001'], 'sambaLogoffTime': ['2147483647'],
'sambaNTPassword': ['XXX'], 'sambaHomeDrive': ['H:'], 'sambaAcctFlags': ['[UX]'], 'loginShell': ['/bin/bash'], 'displayName': ['user_b'],
'cn': ['user_b'], 'sambaSID': ['SIDPREFIX-5002'], 'sambaPwdMustChange': ['2147483647'], 'objectClass': ['top', 'person', 'organizationalPerson',
'inetOrgPerson', 'posixAccount', 'shadowAccount', 'sambaSamAccount'], 'sambaKickoffTime': ['2147483647']}

e si vede che value['homeDirectory'] (cioè l'input) contiene '/home/studenti/user_b', mentre data['homeDirectory'] contiene '/home/user_b'.

Ma non so se ho trovato il problema o se la questione risiede altrove.

#4

Updated by Mark Caglienzi about 7 years ago

  • Status changed from Commenti to In elaborazione
  • Assignee changed from Christopher R. Gabriel to Mark Caglienzi

Visto il successo in #217 vedo se il problema anche qui è simile, come pare a prima vista

#5

Updated by Mark Caglienzi about 7 years ago

  • Status changed from In elaborazione to Commenti
  • Assignee changed from Mark Caglienzi to Christopher R. Gabriel

Corretto nel commit b15698f5 in octofussd (guardaci se è ok come soluzione. Ho provato anche a fare qualcosa come getattr(value, 'homeDirectory', '/home/%s' % user) ma così non funzionava, per questo c'è quella versione un po' più prolissa)

Pushato in octofussd master.

#6

Updated by Christopher R. Gabriel about 7 years ago

  • Project changed from octonet to octofussd
#7

Updated by Christopher R. Gabriel about 7 years ago

  • Assignee changed from Christopher R. Gabriel to Mark Caglienzi

Mi torna la patch.

Pero' prima dobbiamo allora aggiungere a octonet il popolamento del campo del form quando si create/modifica un utente, perche' attualmente come default e' vuoto. Il rischio e' che non venga compilato e quindi che la home create sia un valore vuoto.

Nel form di creazione utente, aggiungerei via js il popolare il campo con '/home/${valore del campo username}' solo se il campo inizialmente e' vuoto, usando come trigger il keydown sul campo username.

Se vuoi apri un ticket in octonet e metti questo bloccato dal nuovo ticket.

#8

Updated by Mark Caglienzi about 7 years ago

  • Status changed from Commenti to In elaborazione
#9

Updated by Mark Caglienzi about 7 years ago

  • Blocked by Segnalazione #230: Autocompletare il campo home durante la creazione di un utente added
#10

Updated by Mark Caglienzi about 7 years ago

  • Status changed from In elaborazione to Commenti
  • Assignee changed from Mark Caglienzi to Christopher R. Gabriel

Mergiato in master e pushato il ticket #230, ti giro anche questo allora

#11

Updated by Elena Grandi about 7 years ago

  • Assignee changed from Christopher R. Gabriel to Elena Grandi
#12

Updated by Mark Caglienzi about 7 years ago

  • Assignee changed from Elena Grandi to Michael Guggenberg

Con le nuove versioni dei pacchetti (octofussd 8.0.17-1 e octonet 0.2.3-1) questo problema non dovrebbe più presentarsi.

Inoltre come detto nei messaggi precedenti, c'è una sorta di autocompletamento di aiuto durante la creazione di un nuovo utente:
  • Mentre si scrive lo username, viene autocompletato il campo home con /home/USERNAME
  • Ovviamente il campo home resta modificabile a piacere
#13

Updated by Michael Guggenberg almost 7 years ago

  • Status changed from Commenti to Risolto
  • % Done changed from 0 to 100
#14

Updated by Michael Guggenberg almost 7 years ago

  • Status changed from Risolto to Chiuso

Also available in: Atom PDF